ppc64-diag-2.7.4/0000755000000000000000000000000013135275553010342 500000000000000ppc64-diag-2.7.4/common/0000755000000000000000000000000013135275553011632 500000000000000ppc64-diag-2.7.4/common/tests/0000755000000000000000000000000013135275553012774 500000000000000ppc64-diag-2.7.4/common/tests/spopen.c0000644000000000000000000000132013135275400014347 00000000000000#include #include #include #include #include #include "utils.h" int main(int argc, char *argv[]) { int status; FILE *fp; pid_t cpid; char buff[128] = {}; if (argc < 2) { fprintf(stderr, "Usage : ./spopen " " ...\n"); exit(1); } fp = spopen(argv + 1, &cpid); if (fp == NULL) { fprintf(stderr, "spopen() failed : %s\n", strerror(errno)); exit(1); } while (fgets(buff, 128, fp) != NULL) printf("%s", buff); status = spclose(fp, cpid); if (status == -1) { fprintf(stderr, "Failed in spclose() : %s.\n", strerror(errno)); exit(1); } fprintf(stdout, "Child exited with status : %d.\n", status); exit(0); } ppc64-diag-2.7.4/common/tests/test-spopen-0010000644000000000000000000000075613135275400015415 00000000000000#!/bin/bash #WARNING: DO NOT RUN THIS FILE DIRECTLY # This file expects to be a part of ppc64-diag/common test suite # Run this file with ../run_tests -t test-spopen-001 SPOPEN=$(dirname $0)/tests/spopen CAT=`which cat` function do_cat_test() { local _rc _size=0 tmp_file=$(mktemp /tmp/spopen-test.XXX) $SPOPEN $CAT ${SPOPEN}.c > $tmp_file _size=$(stat -c %s ${SPOPEN}.c) cmp -s --bytes=$_size $tmp_file ${SPOPEN}.c _rc=$? rm $tmp_file return $_rc } do_cat_test rc=$? return $rc ppc64-diag-2.7.4/common/Makefile.am0000644000000000000000000000035613135275400013601 00000000000000spopen_h_files = common/utils.h check_PROGRAMS += common/tests/spopen common_tests_spopen_SOURCES = common/tests/spopen.c common/utils.c \ $(spopen_h_files) EXTRA_DIST += common/run_tests \ common/tests/test-spopen-001 ppc64-diag-2.7.4/common/utils.c0000644000000000000000000001004013135275400013040 00000000000000/* * Copyright (C) 2015 IBM Corporation. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include #include #include #include #include "utils.h" static int process_child(char *argv[], int pipefd[]) { int nullfd; close(pipefd[0]); /* stderr to /dev/null redirection */ nullfd = open("/dev/null", O_WRONLY); if (nullfd == -1) { fprintf(stderr, "%s : %d - failed to open " "\'/dev/null\' for redirection : %s\n", __func__, __LINE__, strerror(errno)); close(pipefd[1]); return -1; } /* redirect stdout to write-end of the pipe */ if (dup2(pipefd[1], STDOUT_FILENO) == -1) { fprintf(stderr, "%s : %d - failed to redirect " "pipe write fd to stdout : %s\n", __func__, __LINE__, strerror(errno)); goto err_out; } if (dup2(nullfd, STDERR_FILENO) == -1) { fprintf(stderr, "%s : %d - failed to redirect " "\'/dev/null\' to stderr : %s\n", __func__, __LINE__, strerror(errno)); goto err_out; } execve(argv[0], argv, NULL); /* some failure in exec */ err_out: close(pipefd[1]); close(nullfd); return -1; } /* * This function mimics popen(3). * * Returns: * NULL, if fork(2), pipe(2) and dup2(3) calls fail * * Note: * fclose(3) function shouldn't be used to close the stream * returned here, since it doesn't wait for the child to exit. */ FILE *spopen(char *argv[], pid_t *ppid) { FILE *fp = NULL; int pipefd[2]; pid_t cpid; if (argv == NULL) return fp; if (access(argv[0], F_OK|X_OK) != 0) { fprintf(stderr, "%s : The command \"%s\" is not executable.\n", __func__, argv[0]); return fp; } if (pipe(pipefd) == -1) { fprintf(stderr, "%s : %d - failed in pipe(), error : %s\n", __func__, __LINE__, strerror(errno)); return NULL; } cpid = fork(); switch (cpid) { case -1: /* Still in parent; Failure in fork() */ fprintf(stderr, "%s : %d - fork() failed, error : %s\n", __func__, __LINE__, strerror(errno)); close(pipefd[0]); close(pipefd[1]); return NULL; case 0: /* Code executed by child */ if (process_child(argv, pipefd) == -1) { fprintf(stderr, "%s : %d - Error occurred while " "processing write end of the pipe " "(in child).", __func__, __LINE__); exit(EXIT_FAILURE); } exit(EXIT_SUCCESS); default: /* Code executed by parent */ /* store the child pid for pclose() */ *ppid = cpid; close(pipefd[1]); fp = fdopen(pipefd[0], "r"); if (fp == NULL) { fprintf(stderr, "%s : %d - fdopen() error : %s\n", __func__, __LINE__, strerror(errno)); close(pipefd[0]); return NULL; } break; } return fp; } /* * This function closely mimics pclose(3). * Returns : * On success : exit status of the command as returned by waitpid(2), * On failure : -1 if waitpid(2) returns an error. * If it cannot obtain the child status, errno is set to ECHILD. */ int spclose(FILE *stream, pid_t cpid) { int status; pid_t pid; /* * Close the stream, fclose() takes care of closing * the underlying fd. */ if (fclose(stream) == EOF) { fprintf(stderr, "%s : %d - Failed in fclose() : %s\n", __func__, __LINE__, strerror(errno)); return -1; } /* Wait for the child to exit */ do { pid = waitpid(cpid, &status, 0); } while (pid == -1 && errno == EINTR); /* Couldn't obtain child status */ if (status == -1) errno = SIGCHLD; return status; } ppc64-diag-2.7.4/common/utils.h0000644000000000000000000000154313135275400013055 00000000000000/* * Copyright (C) 2015 IBM Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef UTILS_H #define UTILS_H FILE *spopen(char **, pid_t *); int spclose(FILE *, pid_t); #endif ppc64-diag-2.7.4/common/platform.c0000644000000000000000000000314313135275400013532 00000000000000/** * @file platform.c * * Copyright (C) 2014 IBM Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * @author Aruna Balakrishnaiah */ #include #include #include "platform.h" #define LENGTH 512 const char *__platform_name[] = { "Unknown", "PowerNV", "PowerKVM pSeries Guest", "PowerVM pSeries LPAR", /* Add new platforms name here */ }; int get_platform(void) { int rc = PLATFORM_UNKNOWN; FILE *fp; char line[LENGTH]; if((fp = fopen(PLATFORM_FILE, "r")) == NULL) return rc; while (fgets(line, LENGTH, fp)) { if (strstr(line, "PowerNV")) { rc = PLATFORM_POWERNV; break; } else if (strstr(line, "pSeries (emulated by qemu)")) { rc = PLATFORM_POWERKVM_GUEST; break; } else if (strstr(line, "pSeries")) { rc = PLATFORM_PSERIES_LPAR; /* catch model for PowerNV guest */ continue; } } fclose(fp); return rc; } ppc64-diag-2.7.4/common/platform.h0000644000000000000000000000240013135275400013532 00000000000000/** * Copyright (C) 2014 IBM Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef PLATFORM_H #define PLARFORM_H #define PLATFORM_FILE "/proc/cpuinfo" enum { PLATFORM_UNKNOWN = 0, PLATFORM_POWERNV, PLATFORM_POWERKVM_GUEST, PLATFORM_PSERIES_LPAR, /* Add new platforms here */ PLATFORM_MAX, }; extern const char *__platform_name[]; extern int get_platform(void); static inline const char * __power_platform_name(int platform) { if (platform > PLATFORM_UNKNOWN && platform < PLATFORM_MAX) return __platform_name[platform]; return __platform_name[PLATFORM_UNKNOWN]; } #endif ppc64-diag-2.7.4/common/run_tests0000755000000000000000000000154413135275400013521 00000000000000#!/bin/bash COMMON_TEST_DIR=$(dirname $0)/tests all_tests="${COMMON_TEST_DIR}/test*" verbose=0 # Test results function msg_failure() { echo "FAIL: $1" exit 1 } function msg_pass() { if [ $verbose -eq 1 ]; then echo "PASS: $1" fi } # Build the test suite if [ ! -e $COMMON_TEST_DIR ]; then msg_failure "Test cases not available" fi if [ ! -x ${COMMON_TEST_DIR}/spopen ]; then msg_failure "Fatal error, cannot execute tests. Did you make?"; fi while getopts ":vt:" opt; do case "$opt" in v) verbose=1 ;; t) all_tests=$OPTARG ;; esac done # Run the actual tests for common_test in $all_tests; do if [ ! -e $common_test ]; then msg_failure "$common_test doesn't exits" fi source $common_test rc=$? if [[ $rc -ne 0 ]]; then msg_failure "$common_test FAILED with RC $rc" else msg_pass $common_test fi done echo "PASS" exit 0 ppc64-diag-2.7.4/config/0000755000000000000000000000000013135275553011607 500000000000000ppc64-diag-2.7.4/config/config.h.in0000644000000000000000000001742113135275534013556 00000000000000/* config/config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if you have the `alarm' function. */ #undef HAVE_ALARM /* Define to 1 if you have the header file. */ #undef HAVE_ARPA_INET_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_DIRENT_H /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the `dup2' function. */ #undef HAVE_DUP2 /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the `fork' function. */ #undef HAVE_FORK /* Define to 1 if you have the `getpagesize' function. */ #undef HAVE_GETPAGESIZE /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H /* Define to 1 if you have the `localtime_r' function. */ #undef HAVE_LOCALTIME_R /* Define to 1 if your system has a GNU libc compatible `malloc' function, and to 0 otherwise. */ #undef HAVE_MALLOC /* Define to 1 if you have the header file. */ #undef HAVE_MALLOC_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `memset' function. */ #undef HAVE_MEMSET /* Define to 1 if you have the `mkdir' function. */ #undef HAVE_MKDIR /* Define to 1 if you have a working `mmap' system call. */ #undef HAVE_MMAP /* Define to 1 if you have the `munmap' function. */ #undef HAVE_MUNMAP /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_NDIR_H /* Define to 1 if your system has a GNU libc compatible `realloc' function, and to 0 otherwise. */ #undef HAVE_REALLOC /* Define to 1 if you have the `regcomp' function. */ #undef HAVE_REGCOMP /* Define to 1 if you have the `select' function. */ #undef HAVE_SELECT /* Define to 1 if stdbool.h conforms to C99. */ #undef HAVE_STDBOOL_H /* Define to 1 if you have the header file. */ #undef HAVE_STDDEF_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strcasecmp' function. */ #undef HAVE_STRCASECMP /* Define to 1 if you have the `strchr' function. */ #undef HAVE_STRCHR /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the `strerror' function. */ #undef HAVE_STRERROR /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strpbrk' function. */ #undef HAVE_STRPBRK /* Define to 1 if you have the `strrchr' function. */ #undef HAVE_STRRCHR /* Define to 1 if you have the `strstr' function. */ #undef HAVE_STRSTR /* Define to 1 if you have the `strtol' function. */ #undef HAVE_STRTOL /* Define to 1 if you have the header file. */ #undef HAVE_SYSLOG_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_DIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_IOCTL_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PARAM_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `vfork' function. */ #undef HAVE_VFORK /* Define to 1 if you have the header file. */ #undef HAVE_VFORK_H /* Define to 1 if `fork' works. */ #undef HAVE_WORKING_FORK /* Define to 1 if `vfork' works. */ #undef HAVE_WORKING_VFORK /* Define to 1 if the system has the type `_Bool'. */ #undef HAVE__BOOL /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Define to 1 if your C compiler doesn't accept -c and -o together. */ #undef NO_MINUS_C_MINUS_O /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Version number of package */ #undef VERSION /* "with librtas" */ #undef WITH_LIBRTAS /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #undef YYTEXT_POINTER /* Define for Solaris 2.5.1 so the uint32_t typedef from , , or is not used. If the typedef were allowed, the #define below would cause a syntax error. */ #undef _UINT32_T /* Define for Solaris 2.5.1 so the uint64_t typedef from , , or is not used. If the typedef were allowed, the #define below would cause a syntax error. */ #undef _UINT64_T /* Define for Solaris 2.5.1 so the uint8_t typedef from , , or is not used. If the typedef were allowed, the #define below would cause a syntax error. */ #undef _UINT8_T /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif /* Define to the type of a signed integer type of width exactly 16 bits if such a type exists and the standard includes do not define it. */ #undef int16_t /* Define to the type of a signed integer type of width exactly 32 bits if such a type exists and the standard includes do not define it. */ #undef int32_t /* Define to the type of a signed integer type of width exactly 64 bits if such a type exists and the standard includes do not define it. */ #undef int64_t /* Define to the type of a signed integer type of width exactly 8 bits if such a type exists and the standard includes do not define it. */ #undef int8_t /* Define to rpl_malloc if the replacement function should be used. */ #undef malloc /* Define to `int' if does not define. */ #undef mode_t /* Define to `int' if does not define. */ #undef pid_t /* Define to rpl_realloc if the replacement function should be used. */ #undef realloc /* Define to `unsigned int' if does not define. */ #undef size_t /* Define to `int' if does not define. */ #undef ssize_t /* Define to the type of an unsigned integer type of width exactly 16 bits if such a type exists and the standard includes do not define it. */ #undef uint16_t /* Define to the type of an unsigned integer type of width exactly 32 bits if such a type exists and the standard includes do not define it. */ #undef uint32_t /* Define to the type of an unsigned integer type of width exactly 64 bits if such a type exists and the standard includes do not define it. */ #undef uint64_t /* Define to the type of an unsigned integer type of width exactly 8 bits if such a type exists and the standard includes do not define it. */ #undef uint8_t /* Define as `fork' if `vfork' does not work. */ #undef vfork ppc64-diag-2.7.4/config/depcomp0000755000000000000000000005601613135275535013114 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2013-05-30.07; # UTC # Copyright (C) 1999-2013 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: ppc64-diag-2.7.4/config/compile0000755000000000000000000001624513135275535013115 00000000000000#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2012-10-14.11; # UTC # Copyright (C) 1999-2013 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: ppc64-diag-2.7.4/config/config.guess0000755000000000000000000013036113135275535014053 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2013 Free Software Foundation, Inc. timestamp='2013-06-10' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD # # Please send patches with a ChangeLog entry to config-patches@gnu.org. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "${UNAME_SYSTEM}" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval $set_cc_for_build cat <<-EOF > $dummy.c #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` ;; esac # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW64*:*) echo ${UNAME_MACHINE}-pc-mingw64 exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="gnulibc1" ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; or1k:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; or32:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-${LIBC} exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-${LIBC} exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown eval $set_cc_for_build if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; esac eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: ppc64-diag-2.7.4/config/config.sub0000755000000000000000000010531513135275535013517 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2013 Free Software Foundation, Inc. timestamp='2013-04-24' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches with a ChangeLog entry to config-patches@gnu.org. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | be32 | be64 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 \ | or1k | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i386-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-* | ppc64p7-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or1k-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: ppc64-diag-2.7.4/config/install-sh0000755000000000000000000003325513135275535013543 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2011-11-20.07; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: ppc64-diag-2.7.4/config/missing0000755000000000000000000001533113135275535013131 00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2012-06-26.16; # UTC # Copyright (C) 1996-2013 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=http://www.perl.org/ flex_URL=http://flex.sourceforge.net/ gnu_software_URL=http://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'automa4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: ppc64-diag-2.7.4/config/ltmain.sh0000644000000000000000000105152213135275527013356 00000000000000 # libtool (GNU libtool) 2.4.2 # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, # 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Usage: $progname [OPTION]... [MODE-ARG]... # # Provide generalized library-building support services. # # --config show all configuration variables # --debug enable verbose shell tracing # -n, --dry-run display commands without modifying any files # --features display basic configuration information and exit # --mode=MODE use operation mode MODE # --preserve-dup-deps don't remove duplicate dependency libraries # --quiet, --silent don't print informational messages # --no-quiet, --no-silent # print informational messages (default) # --no-warn don't display warning messages # --tag=TAG use configuration variables from tag TAG # -v, --verbose print more informational messages than default # --no-verbose don't print the extra informational messages # --version print version information # -h, --help, --help-all print short, long, or detailed help message # # MODE must be one of the following: # # clean remove files from the build directory # compile compile a source file into a libtool object # execute automatically set library path, then run a program # finish complete the installation of libtool libraries # install install libraries or executables # link create a library or an executable # uninstall remove libraries from an installed directory # # MODE-ARGS vary depending on the MODE. When passed as first option, # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # # host-triplet: $host # shell: $SHELL # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) # $progname: (GNU libtool) 2.4.2 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . # GNU libtool home page: . # General help using GNU software: . PROGRAM=libtool PACKAGE=libtool VERSION=2.4.2 TIMESTAMP="" package_revision=1.3337 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # NLS nuisances: We save the old values to restore during execute mode. lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then save_$lt_var=\$$lt_var $lt_var=C export $lt_var lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL $lt_unset CDPATH # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" : ${CP="cp -f"} test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. exit_status=$EXIT_SUCCESS # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_dirname may be replaced by extended shell implementation # func_basename file func_basename () { func_basename_result=`$ECHO "${1}" | $SED "$basename"` } # func_basename may be replaced by extended shell implementation # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` } # func_dirname_and_basename may be replaced by extended shell implementation # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname may be replaced by extended shell implementation # These SED scripts presuppose an absolute path with a trailing slash. pathcar='s,^/\([^/]*\).*$,\1,' pathcdr='s,^/[^/]*,,' removedotparts=':dotsl s@/\./@/@g t dotsl s,/\.$,/,' collapseslashes='s@/\{1,\}@/@g' finalslash='s,/*$,/,' # func_normal_abspath PATH # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. # value returned in "$func_normal_abspath_result" func_normal_abspath () { # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` while :; do # Processed it all yet? if test "$func_normal_abspath_tpath" = / ; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result" ; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_relative_path SRCDIR DSTDIR # generates a relative path from SRCDIR to DSTDIR, with a trailing # slash if non-empty, suitable for immediately appending a filename # without needing to append a separator. # value returned in "$func_relative_path_result" func_relative_path () { func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=${func_dirname_result} if test "x$func_relative_path_tlibdir" = x ; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test "x$func_stripname_result" != x ; then func_relative_path_result=${func_relative_path_result}/${func_stripname_result} fi # Normalisation. If bindir is libdir, return empty string, # else relative path ending with a slash; either way, target # file name can be directly appended. if test ! -z "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result/" func_relative_path_result=$func_stripname_result fi } # The name of this program: func_dirname_and_basename "$progpath" progname=$func_basename_result # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` progpath="$progdir/$progname" ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' # Sed substitution that converts a w32 file name or path # which contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. # Since each input `\' is now two `\'s, look for any number of runs of # four `\'s followed by two `\'s and then a '$'. `\' that '$'. bs='\\' bs2='\\\\' bs4='\\\\\\\\' dollar='\$' sed_double_backslash="\ s/$bs4/&\\ /g s/^$bs2$dollar/$bs&/ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g s/\n//g" # Standard options: opt_dry_run=false opt_help=false opt_quiet=false opt_verbose=false opt_warning=: # func_echo arg... # Echo program name prefixed message, along with the current mode # name if it has been set yet. func_echo () { $ECHO "$progname: ${opt_mode+$opt_mode: }$*" } # func_verbose arg... # Echo program name prefixed message in verbose mode only. func_verbose () { $opt_verbose && func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_error arg... # Echo program name prefixed message to standard error. func_error () { $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 # bash bug again: : } # func_fatal_error arg... # Echo program name prefixed message to standard error, and exit. func_fatal_error () { func_error ${1+"$@"} exit $EXIT_FAILURE } # func_fatal_help arg... # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { func_error ${1+"$@"} func_fatal_error "$help" } help="Try \`$progname --help' for more information." ## default # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # func_mkdir_p directory-path # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { my_directory_path="$1" my_dir_list= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` done my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do IFS="$save_mkdir_p_IFS" # mkdir can fail with a `File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$my_dir" 2>/dev/null || : done IFS="$save_mkdir_p_IFS" # Bail out if we (or some other process) failed to create a directory. test -d "$my_directory_path" || \ func_fatal_error "Failed to create \`$1'" fi } # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $MKDIR "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || \ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi $ECHO "$my_tmpdir" } # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT # is double-quoted, suitable for a subsequent eval, whereas # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters # which are still active within double quotes backslashified. func_quote_for_eval () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; *) func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac } # func_quote_for_expand arg # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "$1" | $SED \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac case $my_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") my_arg="\"$my_arg\"" ;; esac func_quote_for_expand_result="$my_arg" } # func_show_eval cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_show_eval_locale cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$lt_user_locale $my_cmd" my_status=$? eval "$lt_safe_locale" if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_tr_sh # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_version # Echo version message to standard output and exit. func_version () { $opt_debug $SED -n '/(C)/!b go :more /\./!{ N s/\n# / / b more } :go /^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ p }' < "$progpath" exit $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $opt_debug $SED -n '/^# Usage:/,/^# *.*--help/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" echo $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help [NOEXIT] # Echo long help message to standard output and exit, # unless 'noexit' is passed as argument. func_help () { $opt_debug $SED -n '/^# Usage:/,/# Report bugs to/ { :print s/^# // s/^# *$// s*\$progname*'$progname'* s*\$host*'"$host"'* s*\$SHELL*'"$SHELL"'* s*\$LTCC*'"$LTCC"'* s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ p d } /^# .* home page:/b print /^# General help using/b print ' < "$progpath" ret=$? if test -z "$1"; then exit $ret fi } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $opt_debug func_error "missing argument for $1." exit_cmd=exit } # func_split_short_opt shortopt # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. func_split_short_opt () { my_sed_short_opt='1s/^\(..\).*$/\1/;q' my_sed_short_rest='1s/^..\(.*\)$/\1/;q' func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` } # func_split_short_opt may be replaced by extended shell implementation # func_split_long_opt longopt # Set func_split_long_opt_name and func_split_long_opt_arg shell # variables after splitting LONGOPT at the `=' sign. func_split_long_opt () { my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^--[^=]*=//' func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` } # func_split_long_opt may be replaced by extended shell implementation exit_cmd=: magic="%%%MAGIC variable%%%" magic_exe="%%%MAGIC EXE variable%%%" # Global variables. nonopt= preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "${1}=\$${1}\${2}" } # func_append may be replaced by extended shell implementation # func_append_quoted var value # Quote VALUE and append to the end of shell variable VAR, separated # by a space. func_append_quoted () { func_quote_for_eval "${2}" eval "${1}=\$${1}\\ \$func_quote_for_eval_result" } # func_append_quoted may be replaced by extended shell implementation # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "${@}"` } # func_arith may be replaced by extended shell implementation # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` } # func_len may be replaced by extended shell implementation # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` } # func_lo2o may be replaced by extended shell implementation # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` } # func_xform may be replaced by extended shell implementation # func_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_error ${1+"$@"} func_error "See the $PACKAGE documentation for more information." func_fatal_error "Fatal configuration error." } # func_config # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # Display the features supported by this script. func_features () { echo "host: $host" if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag tagname # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname="$1" re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf="/$re_begincf/,/$re_endcf/p" # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Option defaults: opt_debug=: opt_dry_run=false opt_config=false opt_preserve_dup_deps=false opt_features=false opt_finish=false opt_help=false opt_help_all=false opt_silent=: opt_warning=: opt_verbose=: opt_silent=false opt_verbose=false # Parse options once, thoroughly. This comes as soon as possible in the # script to make things like `--version' happen as quickly as we can. { # this just eases exit handling while test $# -gt 0; do opt="$1" shift case $opt in --debug|-x) opt_debug='set -x' func_echo "enabling shell trace mode" $opt_debug ;; --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) opt_config=: func_config ;; --dlopen|-dlopen) optarg="$1" opt_dlopen="${opt_dlopen+$opt_dlopen }$optarg" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) opt_features=: func_features ;; --finish) opt_finish=: set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help_all=: opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_mode="$optarg" case $optarg in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_silent=false func_append preserve_args " $opt" ;; --no-warning|--no-warn) opt_warning=false func_append preserve_args " $opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $opt" ;; --silent|--quiet) opt_silent=: func_append preserve_args " $opt" opt_verbose=false ;; --verbose|-v) opt_verbose=: func_append preserve_args " $opt" opt_silent=false ;; --tag) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_tag="$optarg" func_append preserve_args " $opt $optarg" func_enable_tag "$optarg" shift ;; -\?|-h) func_usage ;; --help) func_help ;; --version) func_version ;; # Separate optargs to long options: --*=*) func_split_long_opt "$opt" set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-n*|-v*) func_split_short_opt "$opt" set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; *) set dummy "$opt" ${1+"$@"}; shift; break ;; esac done # Validate options: # save first non-option argument if test "$#" -gt 0; then nonopt="$opt" shift fi # preserve --debug test "$opt_debug" = : || func_append preserve_args " --debug" case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then func_fatal_configuration "not configured to build any kind of library" fi # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test "$opt_mode" != execute; then func_error "unrecognized option \`-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$progname --help --mode=$opt_mode' for more information." } # Bail if the options were screwed $exit_cmd $EXIT_FAILURE } ## ----------- ## ## Main. ## ## ----------- ## # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test "$lalib_p" = yes } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { func_lalib_p "$1" } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. func_source () { $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case "$lt_sysroot:$1" in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result="=$func_stripname_result" ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=${1} if test "$build_libtool_libs" = yes; then write_lobj=\'${2}\' else write_lobj=none fi if test "$build_old_libs" = yes; then write_oldobj=\'${3}\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$lt_sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $opt_debug # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result="" if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result" ; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $opt_debug if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $opt_debug # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $opt_debug if test -z "$2" && test -n "$1" ; then func_error "Could not determine host file name corresponding to" func_error " \`$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result="$1" fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $opt_debug if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " \`$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result="$3" fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $opt_debug case $4 in $1 ) func_to_host_path_result="$3$func_to_host_path_result" ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via `$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $opt_debug $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $opt_debug case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result="$1" } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result="$func_convert_core_msys_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via `$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $opt_debug if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd="func_convert_path_${func_stripname_result}" fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $opt_debug func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result="$1" } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_msys_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_mode_compile arg... func_mode_compile () { $opt_debug # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify \`-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" func_append_quoted lastarg "$arg" done IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with \`-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj="$func_basename_result" } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from \`$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname="$func_basename_result" xdir="$func_dirname_result" lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$opt_mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode \`$opt_mode'" ;; esac echo $ECHO "Try \`$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test "$opt_help" = :; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | sed -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | sed '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $opt_debug # The first argument is the command name. cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir="$func_dirname_result" ;; *) func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } test "$opt_mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "\`$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument \`$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and \`=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the \`-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the \`$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the \`$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test "$opt_mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test "x$prev" = x-m && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." destdir="$func_dirname_result" destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname="$1" shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name="$func_basename_result" instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest="$destfile" destfile= ;; *) func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script \`$wrapper'" finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file="$outputname" else func_warning "cannot relink \`$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name="$func_basename_result" # Set up the ranlib parameters. oldlib="$destdir/$name" func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run \`$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test "$opt_mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $opt_debug my_outputname="$1" my_originator="$2" my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename="" if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname" ; then func_basename "$dlprefile_dlname" dlprefile_dlbasename="$func_basename_result" else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename" ; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $opt_debug win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $opt_debug sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $opt_debug match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive which possess that section. Heuristic: eliminate # all those which have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $opt_debug if func_cygming_gnu_implib_p "$1" ; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1" ; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result="" fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" if test "$lock_old_archive_extraction" = yes; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test "$lock_old_archive_extraction" = yes; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory in which it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ which is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options which match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include /* declarations of non-ANSI functions */ #if defined(__MINGW32__) # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined(__CYGWIN__) # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined (other platforms) ... */ #endif /* portability defines, excluding path handling macros */ #if defined(_MSC_VER) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC # ifndef _INTPTR_T_DEFINED # define _INTPTR_T_DEFINED # define intptr_t int # endif #elif defined(__MINGW32__) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined(__CYGWIN__) # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined (other platforms) ... */ #endif #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #if defined(LT_DEBUGWRAPPER) static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (strcmp (str, pat) == 0) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { int orig_value_len = strlen (orig_value); int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $opt_debug case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_mode_link arg... func_mode_link () { $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir="$arg" prev= continue ;; dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" test -f "$arg" \ || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "\`-no-install' is ignored for $host" func_warning "assuming \`-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-flto*|-fwhopr*|-fuse-linker-plugin) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test "$prev" = dlfiles; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the \`$prevarg' option requires an argument" if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname="$func_basename_result" libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps ; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs="$tmp_deplibs" fi if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs="$dlprefiles" fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no func_dirname "$lib" "" "." ladir="$func_dirname_result" lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." else echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir="$func_dirname_result" dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test "$prefer_static_libs" = yes || test "$prefer_static_libs,$installed" = "built,no"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib="$l" done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then func_fatal_error "cannot -dlopen a convenience library: \`$lib'" fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir="$ladir" fi ;; esac func_basename "$lib" laname="$func_basename_result" # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$lt_sysroot$libdir" absdir="$lt_sysroot$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later func_append notinst_path " $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi case "$host" in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test "$installed" = no; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule="$dlpremoduletest" break fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then echo if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname="$1" shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" func_basename "$soroot" soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$opt_mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null ; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add="$dir/$old_library" fi elif test -n "$old_library"; then add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$absdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && test "$hardcode_minus_L" != yes && test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$opt_mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system can not link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs="$temp_deplibs" fi func_append newlib_search_path " $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path="$deplib" ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of \`$dir'" absdir="$dir" fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl" ; then depdepl="$absdir/$objdir/$depdepl" darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi ;; *) path="-L$absdir/$objdir" ;; esac else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "\`$deplib' seems to be moved" path="-L$absdir" fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = link; then if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test "$dlself" != no && \ func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test "$#" -gt 1 && \ func_warning "ignoring multiple \`-rpath's for a libtool library" install_libdir="$1" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift IFS="$save_ifs" test -n "$7" && \ func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$1" number_minor="$2" number_revision="$3" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|qnx|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; esac ;; no) current="$1" revision="$2" age="$3" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT \`$current' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION \`$revision' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE \`$age' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE \`$age' is greater than the current interface number \`$current'" func_fatal_error "\`$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current" ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring:${iface}.0" done # Make executables depend on our current version. func_append verstring ":${current}.0" ;; qnx) major=".$current" versuffix=".$current" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; *) func_fatal_configuration "unknown library version type \`$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then func_warning "undefined symbols not allowed in $host shared libraries" build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" func_append libobjs " $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$opt_mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then # Remove ${wl} instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$opt_mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname="$1" shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd1 in $cmds; do IFS="$save_ifs" # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test "$try_normal_branch" = yes \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=${output_objdir}/${output_la}.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\${concat_cmds}$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi if ${skipped_export-false}; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi fi test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi if ${skipped_export-false}; then if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi fi libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` else gentop="$output_objdir/${obj}x" func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ func_warning "\`-release' is ignored for programs" test "$preload" = yes \ && test "$dlopen_support" = unknown \ && test "$dlopen_self" = unknown \ && test "$dlopen_self_static" = unknown && \ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " ${wl}-bind_at_load" func_append finalize_command " ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs="$new_libs" func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=yes case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=no ;; *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' fi exit $exit_status fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save $symfileobj" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then func_append oldobjs " $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name="$func_basename_result" func_resolve_sysroot "$deplib" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test "x$bindir" != x ; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } { test "$opt_mode" = link || test "$opt_mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug RM="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) func_append RM " $arg"; rmforce=yes ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then odir="$objdir" else odir="$dir/$objdir" fi func_basename "$file" name="$func_basename_result" test "$opt_mode" = uninstall && odir="$dir" # Remember odir for removal later, being careful to avoid duplicates if test "$opt_mode" = clean; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case "$opt_mode" in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test "$opt_mode" = clean ; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name" ; then func_append rmfiles " $odir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && func_mode_uninstall ${1+"$@"} test -z "$opt_mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode \`$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: # vi:sw=2 ppc64-diag-2.7.4/diags/0000755000000000000000000000000013135275553011431 500000000000000ppc64-diag-2.7.4/diags/man/0000755000000000000000000000000013135275553012204 500000000000000ppc64-diag-2.7.4/diags/man/diag_encl.80000644000000000000000000000417713135275400014122 00000000000000.\" .\" Copyright (C) 2012 IBM Corporation .\" .TH DIAG_ENCL 8 "July 2012" Linux "PowerLinux Diagnostic Tools" .SH NAME diag_encl - diagnose SCSI enclosures .SH SYNOPSIS .nf \fBdiag_encl \fR[\fB\-s\fR [\fB\-c\fR][\fB\-l\fR]] [\fB\-v\fR] [\fB\-f\fR <\fIpath\fB.pg2\fR>] [\fBsg\fIn\fR ...] \fBdiag_encl -d\fR \fBdiag_encl --version\fR \fBdiag_encl --help\fR .fi .SH DESCRIPTION The .B diag_encl command reports the status of the various components of the SCSI enclosure(s) specified by the .BI sg n device name(s). If no enclosure is specified, all SCSI enclosures known to the system are reported. .P .B diag_encl currently supports a limited number of enclosure types and reports an error if asked to diagnose an unrecognized type. .SH OPTIONS .TP \fB\-d\fR or \fB\-\-disk \fR Collects disk health information and populates it in an xml output file under destination directory (/var/log/ppc64-diag/diag_disk/). .TP \fB\-s\fR or \fB\-\-serv_event\fR Report any faults to the servicelog database. .TP \fB\-c\fR or \fB\-\-cmp_prev\fR Report only faults that are new (or have become more critical) since the last time .B diag_encl was run with the .B \-s option. .TP \fB\-l\fR or \fB\-\-leds\fR Try to turn on the fault indicator (typically an amber LED) for any failing component. Some components' LED(s) may not be accessible to Linux. Some LEDs have independent fault and identify settings; that is, the LED may be in fault mode and identify mode at the same time (in which case both the fault setting and the identify setting bubble up to the enclosure, which may have separate fault and identify LEDs). .B diag_encl doesn't affect the LED's identify setting. .TP \fB\-v\fR or \fB\-\-verbose\fR Produce more verbose output. .TP \fB\-V\fR or \fB\-\-version\fR Display the version of the command and exit. .TP \fB\-f\fR or \fB\-\-fake\fR \fIpath\fB.pg2\fR A testing option. Instead of querying the device, read diagnostic information from the file whose pathname is .IR path .pg2, and read vital product data from the file whose pathname is .IR path .vpd. .TP \fB\-h\fR or \fB\-\-help\fR Print a usage message and exit. .SH "SEE ALSO" .BR servicelog (8), .BR encl_led (8) ppc64-diag-2.7.4/diags/man/encl_led.80000644000000000000000000000474413135275400013762 00000000000000.\" .\" Copyright (C) 2012 IBM Corporation .\" .TH ENCL_LED 8 "July 2012" Linux "PowerLinux Diagnostic Tools" .SH NAME encl_led - turn SCSI enclosure fault/identify indicators on/off .SH SYNOPSIS .nf \fBencl_led\fR \fIsettings\fR [\fB\-v\fR] \fIenclosure\fR [\fIcomponent\fR] \fBencl_led \-l\fR [\fB\-v\fR] \fIenclosure\fR [\fIcomponent\fR] \fBencl_led \-V\fR \fBencl_led \-h\fR .fi .SH DESCRIPTION The .B encl_led command turns on or off the fault/identify indicator(s) for the specified component in the specified SCSI enclosure or for the enclosure itself if no component is specified. The .B \-l option lists the setting of the specified indicator or for each indicator in the enclosure if no component is specified. .P An .I enclosure is specified by its .BI sg n device name or by its location code. .P A .I component (for example, a power supply, fan assembly, connector, or controller) is identified by its location code relative to the enclosure. For example, if an enclosure has a location code of U5888.001.G123789, and one of its fan assemblies has a full location code of U5888.001.G123789-P1-C2-A1, then on the .B encl_led command line, the fan assembly would be specified as P1-C2-A1. .P Some LEDs have independent fault and identify settings; that is, a single LED may be in fault mode and identify mode at the same time (in which case both the fault setting and the identify setting bubble up to the enclosure, which may have separate fault and identify LEDs). So .B encl_led reports the fault and identify settings separately, and enables you to turn the fault and identify settings on and off independently. .P .B encl_led currently supports a limited number of enclosure types and reports an error if asked to diagnose an unrecognized type. Some components' LED(s) may not be accessible to Linux. .P .B NOTE: Ensure that there are no outstanding service actions to be taken on the specified SCSI enclosure before turning off the enclosure fault indicator. .SH OPTIONS The .I settings options are .BR \-f and .BR \-i . .TP \fB\-f on|off\fR or \fB\-\-fault=on|off\fR Turn the indicator's fault setting on or off. .TP \fB\-i on|off\fR or \fB\-\-ident=on|off\fR Turn the indicator's identify setting on or off. .TP \fB\-l\fR or \fB\-\-list\fR Report the indicator setting(s) of the enclosure's component(s). .TP \fB\-v\fR or \fB\-\-verbose\fR Produce more verbose output. .TP \fB\-V\fR or \fB\-\-version\fR Display the version of the command and exit. .TP \fB\-h\fR or \fB\-\-help\fR Print a usage message and exit. ppc64-diag-2.7.4/diags/test/0000755000000000000000000000000013135275553012410 500000000000000ppc64-diag-2.7.4/diags/test/Makefile.am0000644000000000000000000000556613135275400014367 00000000000000diags_test_common_h_files = diags/encl_util.h \ diags/encl_common.h \ diags/diag_encl.h \ diags/test/test_utils.h \ common/utils.h diags_test_bh_h_files = diags/bluehawk.h \ $(diags_test_common_h_files) diags_test_hr_h_files = diags/homerun.h \ $(diags_test_common_h_files) diags_test_slider_h_files = diags/slider.h \ $(diags_test_common_h_files) diags_test_common_obj_files = diags/test/test_utils.c \ diags/encl_util.c \ common/utils.c check_PROGRAMS += diags/test/bh_structs \ diags/test/hr_structs \ diags/test/slider_structs \ diags/test/bh_mk_healthy \ diags/test/hr_mk_healthy \ diags/test/slider_mk_healthy \ diags/test/bh_mk_hot_power \ diags/test/hr_mk_hot_power \ diags/test/slider_mk_hot_power \ diags/test/encl_dump_pg2 \ diags/test/encl_vpd diags_test_bh_structs_SOURCES = diags/test/bh_structs.c \ diags/encl_common.h \ diags/bluehawk.h diags_test_hr_structs_SOURCES = diags/test/hr_structs.c \ diags/encl_common.h \ diags/homerun.h diags_test_slider_structs_SOURCES = diags/test/slider_structs.c \ diags/encl_common.h \ diags/slider.h diags_test_encl_dump_pg2_SOURCES = diags/test/encl_dump_pg2.c \ diags/homerun.h \ diags/bluehawk.h \ diags/slider.h \ $(diags_test_common_obj_files) \ $(diags_test_common_h_files) diags_test_bh_mk_healthy_SOURCES = diags/test/bh_mk_healthy.c \ diags/test/bh_healthy.c \ $(diags_test_common_obj_files) \ $(diags_test_bh_h_files) diags_test_hr_mk_healthy_SOURCES = diags/test/hr_mk_healthy.c \ diags/test/hr_healthy.c \ $(diags_test_common_obj_files) \ $(diags_test_hr_h_files) diags_test_slider_mk_healthy_SOURCES = diags/test/slider_mk_healthy.c \ diags/test/slider_healthy.c \ $(diags_test_common_obj_files) \ $(diags_test_slider_h_files) diags_test_bh_mk_hot_power_SOURCES = diags/test/bh_mk_hot_power.c \ diags/test/bh_healthy.c \ $(diags_test_common_obj_files) \ $(diags_test_bh_h_files) diags_test_hr_mk_hot_power_SOURCES = diags/test/hr_mk_hot_power.c \ diags/test/hr_healthy.c \ $(diags_test_common_obj_files) \ $(diags_test_hr_h_files) diags_test_slider_mk_hot_power_SOURCES = diags/test/slider_mk_hot_power.c \ diags/test/slider_healthy.c \ $(diags_test_common_obj_files) \ $(diags_test_slider_h_files) diags_test_encl_vpd_SOURCES = diags/test/encl_vpd.c \ diags/encl_util.c \ common/utils.c \ diags/homerun.h \ diags/bluehawk.h \ diags/slider.h \ $(diags_test_common_h_files) EXTRA_DIST += diags/test/bluehawk.vpd \ diags/test/homerun.vpd \ diags/test/slider.vpd \ diags/test/run_tests \ diags/test/tests \ diags/test/tests-results \ diags/test/README ppc64-diag-2.7.4/diags/test/bh_mk_healthy.c0000644000000000000000000000150713135275400015264 00000000000000#include #include #include "bluehawk.h" #include "encl_common.h" #include "encl_util.h" #include "test_utils.h" extern struct bluehawk_diag_page2 healthy_page; /* healthy pg2 for bluehawk */ int main(int argc, char **argv) { if (argc != 2) { fprintf(stderr, "usage: %s pathname\n", argv[0]); exit(1); } convert_htons(&healthy_page.page_length); convert_htons(&healthy_page.overall_voltage_status.voltage); convert_htons(&healthy_page.voltage_sensor_sets[0].sensor_12V.voltage); convert_htons(&healthy_page.voltage_sensor_sets[0].sensor_3_3VA.voltage); convert_htons(&healthy_page.voltage_sensor_sets[1].sensor_12V.voltage); convert_htons(&healthy_page.voltage_sensor_sets[1].sensor_3_3VA.voltage); if (write_page2_to_file(argv[1], &healthy_page, sizeof(healthy_page)) != 0) exit(2); exit(0); } ppc64-diag-2.7.4/diags/test/bh_healthy.c0000644000000000000000000001220613135275400014573 00000000000000#include "encl_common.h" #include "bluehawk.h" /* * Note: Initializing struct members to zero is not strictly necessary, * but we explicitly initialize all members that can take on meaningful * values. All other members are unsupported by the SES implementation. */ #define HEALTHY_STATUS_BYTE0 { .swap = 0, .status = 1 } #define HEALTHY_DISK(n) { \ .byte0 = HEALTHY_STATUS_BYTE0, \ .byte1.element_status = { .hot_swap = 1, .slot_address = n }, \ .app_client_bypassed_a = 0, \ .ready_to_insert = 0, \ .rmv = 0, \ .ident = 0, \ .app_client_bypassed_b = 0, \ .fail = 0, \ .bypassed_a = 0, \ .bypassed_b = 0, \ } #define HEALTHY_ENCLOSURE { \ .byte0 = HEALTHY_STATUS_BYTE0, \ .ident = 0, \ .fail = 0, \ .failure_requested = 0 \ } #define HEALTHY_ESM { \ .byte0 = HEALTHY_STATUS_BYTE0, \ .ident = 0, \ .fail = 0, \ .hot_swap = 1, \ } #define ROOM_TEMPERATURE 20 #define TEMPERATURE_OFFSET 20 #define HEALTHY_TEMP_SENSOR(temp) { \ .byte0 = HEALTHY_STATUS_BYTE0, \ .temperature = (temp + TEMPERATURE_OFFSET), \ .ot_failure = 0, \ .ot_warning = 0 \ } #define ROOM_TEMP_SENSOR HEALTHY_TEMP_SENSOR(ROOM_TEMPERATURE) #define HEALTHY_TEMP_SENSOR_SET { \ .croc = ROOM_TEMP_SENSOR, \ .ppc = ROOM_TEMP_SENSOR, \ .expander = ROOM_TEMP_SENSOR, \ .ambient = { \ ROOM_TEMP_SENSOR, \ ROOM_TEMP_SENSOR \ }, \ .power_supply = { \ ROOM_TEMP_SENSOR, \ ROOM_TEMP_SENSOR \ } \ } #define HEALTHY_FAN_SPEED_CODE 0x3 /* Just a guess */ #define HEALTHY_FAN(spdcd) { \ .byte0 = HEALTHY_STATUS_BYTE0, \ .ident = 0, \ .hot_swap = 1, \ .fail = 0, \ .speed_code = spdcd \ } #define HEALTHY_FAN_SET(spdcd) { \ .power_supply = HEALTHY_FAN(spdcd), \ .fan_element = { \ HEALTHY_FAN(spdcd), \ HEALTHY_FAN(spdcd), \ HEALTHY_FAN(spdcd), \ HEALTHY_FAN(spdcd) \ } \ } #define HEALTHY_POWER_SUPPLY { \ .byte0 = HEALTHY_STATUS_BYTE0, \ .ident = 0, \ .dc_over_voltage = 0, \ .dc_under_voltage = 0, \ .dc_over_current = 0, \ .hot_swap = 1, \ .fail = 0, \ .ovrtmp_fail = 0, \ .ac_fail = 0, \ .dc_fail = 0, \ } #define HEALTHY_VOLTAGE_12V 1200 #define HEALTHY_VOLTAGE_3_3V 350 #define HEALTHY_VOLTAGE_SENSOR(volts) { \ .byte0 = HEALTHY_STATUS_BYTE0, \ .warn_over = 0, \ .warn_under = 0, \ .crit_over = 0, \ .crit_under = 0, \ .voltage = volts \ } #define HEALTHY_VOLTAGE_SENSOR_SET { \ HEALTHY_VOLTAGE_SENSOR(HEALTHY_VOLTAGE_12V), \ HEALTHY_VOLTAGE_SENSOR(HEALTHY_VOLTAGE_3_3V) \ } #define HEALTHY_SAS_CONNECTOR { \ .byte0 = HEALTHY_STATUS_BYTE0, \ .ident = 0, \ .connector_type = 5, \ .connector_physical_link = 0xff, \ .fail = 0 \ } #define HEALTHY_SCC_CONTROLLER_OVERALL { \ .byte0 = HEALTHY_STATUS_BYTE0, \ .ident = 0, \ .fail = 0 \ } #define HEALTHY_SCC_CONTROLLER { \ .byte0 = HEALTHY_STATUS_BYTE0, \ .ident = 0, \ .fail = 0, \ .report = 0 \ } #define HEALTHY_MIDPLANE(stat) { \ .byte0 = { .swap = 0, .status = stat }, \ .ident = 0, \ .fail = 0 \ } struct bluehawk_diag_page2 healthy_page = { .page_code = 2, .non_crit = 0, .crit = 0, .page_length = 0x144, .generation_code = 0, .overall_disk_status = { .byte0 = HEALTHY_STATUS_BYTE0, .byte1.overall_status = { .device_environment = 2, .slot_address = 0 }, .ready_to_insert = 0, .rmv = 0, .ident = 0, .report = 0, .fail = 0 }, .disk_status = { [0] = HEALTHY_DISK(0), [1] = HEALTHY_DISK(1), [2] = HEALTHY_DISK(2), [3] = HEALTHY_DISK(3), [4] = HEALTHY_DISK(4), [5] = HEALTHY_DISK(5), [6] = HEALTHY_DISK(6), [7] = HEALTHY_DISK(7), [8] = HEALTHY_DISK(8), [9] = HEALTHY_DISK(9), [10] = HEALTHY_DISK(10), [11] = HEALTHY_DISK(11), [12] = HEALTHY_DISK(12), [13] = HEALTHY_DISK(13), [14] = HEALTHY_DISK(14), [15] = HEALTHY_DISK(15), [16] = HEALTHY_DISK(16), [17] = HEALTHY_DISK(17), [18] = HEALTHY_DISK(18), [19] = HEALTHY_DISK(19), [20] = HEALTHY_DISK(20), [21] = HEALTHY_DISK(21), [22] = HEALTHY_DISK(22), [23] = HEALTHY_DISK(23), [24] = HEALTHY_DISK(24), [25] = HEALTHY_DISK(25), [26] = HEALTHY_DISK(26), [27] = HEALTHY_DISK(27), [28] = HEALTHY_DISK(28), [29] = HEALTHY_DISK(29) }, .overall_enclosure_status = HEALTHY_ENCLOSURE, .enclosure_element_status = HEALTHY_ENCLOSURE, .overall_esm_status = HEALTHY_ESM, .esm_status = { HEALTHY_ESM, HEALTHY_ESM }, .overall_temp_sensor_status = ROOM_TEMP_SENSOR, .temp_sensor_sets = { HEALTHY_TEMP_SENSOR_SET, HEALTHY_TEMP_SENSOR_SET }, .overall_fan_status = HEALTHY_FAN(0), // speed code undefined here .fan_sets = { HEALTHY_FAN_SET(HEALTHY_FAN_SPEED_CODE), HEALTHY_FAN_SET(HEALTHY_FAN_SPEED_CODE) }, .overall_power_status = HEALTHY_POWER_SUPPLY, .ps_status = { HEALTHY_POWER_SUPPLY, HEALTHY_POWER_SUPPLY }, .overall_voltage_status = HEALTHY_VOLTAGE_SENSOR(0), .voltage_sensor_sets = { HEALTHY_VOLTAGE_SENSOR_SET, HEALTHY_VOLTAGE_SENSOR_SET }, .overall_sas_connector_status = HEALTHY_SAS_CONNECTOR, .sas_connector_status = { HEALTHY_SAS_CONNECTOR, HEALTHY_SAS_CONNECTOR, HEALTHY_SAS_CONNECTOR, HEALTHY_SAS_CONNECTOR }, .overall_scc_controller_status = HEALTHY_SCC_CONTROLLER_OVERALL, .scc_controller_status = { HEALTHY_SCC_CONTROLLER, HEALTHY_SCC_CONTROLLER }, .overall_midplane_status = HEALTHY_MIDPLANE(0), .midplane_element_status = HEALTHY_MIDPLANE(1) }; ppc64-diag-2.7.4/diags/test/test_utils.c0000644000000000000000000001332713135275400014670 00000000000000#include #include #include #include "encl_common.h" #include "bluehawk.h" #include "homerun.h" #include "slider.h" /* * Factor byte0->status into the composite status cur. A missing element * (ES_NOT_INSTALLED) is ignored. A non-critical status is less severe * than critical. Otherwise assume that an increasing value of * element_status_code indicates and increasing severity. Return the more * severe of byte0->status and cur. */ enum element_status_code add_element_status(enum element_status_code cur, const struct element_status_byte0 *byte0) { enum element_status_code s = (enum element_status_code) byte0->status; if (s == ES_OK || s == ES_NOT_INSTALLED) return cur; if ((cur == ES_OK || cur == ES_NONCRITICAL) && s > ES_OK) return s; return cur; } /* * Calculate the composite status for the nel elements starting at * address first_element. We exploit the fact that every status element * is 4 bytes and starts with an element_status_byte0 struct. */ enum element_status_code composite_status(const void* first_element, int nel) { int i; const char *el = (const char*) first_element; enum element_status_code s = ES_OK; for (i = 0; i < nel; i++, el += 4) s = add_element_status(s, (const struct element_status_byte0*) el); return s; } /* bluehawk specific call */ enum element_status_code bh_roll_up_disk_status(const struct bluehawk_diag_page2 *pg) { return composite_status(&pg->disk_status, NR_DISKS_PER_BLUEHAWK); } enum element_status_code bh_roll_up_esm_status(const struct bluehawk_diag_page2 *pg) { return composite_status(&pg->esm_status, 2); } enum element_status_code bh_roll_up_temperature_sensor_status(const struct bluehawk_diag_page2 *pg) { return composite_status(&pg->temp_sensor_sets, 2 * 7); } enum element_status_code bh_roll_up_fan_status(const struct bluehawk_diag_page2 *pg) { return composite_status(&pg->fan_sets, 2 * 5); } enum element_status_code bh_roll_up_power_supply_status(const struct bluehawk_diag_page2 *pg) { return composite_status(&pg->ps_status, 2); } enum element_status_code bh_roll_up_voltage_sensor_status(const struct bluehawk_diag_page2 *pg) { return composite_status(&pg->voltage_sensor_sets, 2 * 2); } enum element_status_code bh_roll_up_sas_connector_status(const struct bluehawk_diag_page2 *pg) { return composite_status(&pg->sas_connector_status, 4); } /* Is this valid? */ enum element_status_code bh_roll_up_scc_controller_status(const struct bluehawk_diag_page2 *pg) { return composite_status(&pg->scc_controller_status, 2); } unsigned int bh_mean_temperature(const struct bluehawk_diag_page2 *pg) { struct temperature_sensor_status *sensors = (struct temperature_sensor_status *) &pg->temp_sensor_sets; int sum = 0; int i; for (i = 0; i < 2*7; i++) sum += sensors[i].temperature; return sum / (2*7); } /* homerun specific call */ enum element_status_code hr_roll_up_disk_status(const struct hr_diag_page2 *pg) { return composite_status(&pg->disk_status, HR_NR_DISKS); } enum element_status_code hr_roll_up_esm_status(const struct hr_diag_page2 *pg) { return composite_status(&pg->esm_status, HR_NR_ESM_CONTROLLERS); } enum element_status_code hr_roll_up_temperature_sensor_status(const struct hr_diag_page2 *pg) { return composite_status(&pg->temp_sensor_sets, HR_NR_TEMP_SENSOR_SET * 4); } enum element_status_code hr_roll_up_fan_status(const struct hr_diag_page2 *pg) { return composite_status(&pg->fan_sets, HR_NR_FAN_SET * HR_NR_FAN_ELEMENT_PER_SET); } enum element_status_code hr_roll_up_power_supply_status(const struct hr_diag_page2 *pg) { return composite_status(&pg->ps_status, HR_NR_POWER_SUPPLY); } enum element_status_code hr_roll_up_voltage_sensor_status(const struct hr_diag_page2 *pg) { return composite_status(&pg->voltage_sensor_sets, HR_NR_VOLTAGE_SENSOR_SET * 3); } unsigned int hr_mean_temperature(const struct hr_diag_page2 *pg) { struct temperature_sensor_status *sensors = (struct temperature_sensor_status *) &pg->temp_sensor_sets; int sum = 0; int i; for (i = 0; i < HR_NR_TEMP_SENSOR_SET * 4; i++) sum += sensors[i].temperature; return sum / (HR_NR_TEMP_SENSOR_SET * 4); } /* slider specific call */ enum element_status_code slider_roll_up_disk_status(const struct slider_lff_diag_page2 *pg) { return composite_status(&pg->disk_status, SLIDER_NR_LFF_DISK); } enum element_status_code slider_roll_up_esm_status(const struct slider_lff_diag_page2 *pg) { return composite_status(&pg->enc_service_ctrl_element, SLIDER_NR_ESC); } enum element_status_code slider_roll_up_temperature_sensor_status(const struct slider_lff_diag_page2 *pg) { return composite_status(&pg->temp_sensor_sets, SLIDER_NR_TEMP_SENSOR); } enum element_status_code slider_roll_up_fan_status(const struct slider_lff_diag_page2 *pg) { return composite_status(&pg->fan_sets, SLIDER_NR_POWER_SUPPLY * SLIDER_NR_FAN_PER_POWER_SUPPLY); } enum element_status_code slider_roll_up_power_supply_status(const struct slider_lff_diag_page2 *pg) { return composite_status(&pg->ps_status, SLIDER_NR_POWER_SUPPLY); } enum element_status_code slider_roll_up_voltage_sensor_status(const struct slider_lff_diag_page2 *pg) { return composite_status(&pg->voltage_sensor_sets, SLIDER_NR_VOLT_SENSOR_PER_ESM * SLIDER_NR_ESC); } enum element_status_code slider_roll_up_sas_connector_status(const struct slider_lff_diag_page2 *pg) { return composite_status(&pg->sas_connector_status, SLIDER_NR_SAS_CONNECTOR); } unsigned int slider_mean_temperature(const struct slider_lff_diag_page2 *pg) { struct temperature_sensor_status *sensors = (struct temperature_sensor_status *) &pg->temp_sensor_sets; int sum = 0; int i; for (i = 0; i < SLIDER_NR_TEMP_SENSOR; i++) sum += sensors[i].temperature; return sum / (SLIDER_NR_TEMP_SENSOR); } ppc64-diag-2.7.4/diags/test/test_utils.h0000644000000000000000000000605713135275400014677 00000000000000#ifndef __TEST_UTILS_H__ #define __TEST_UTILS_H__ #include #include "bluehawk.h" #include "encl_common.h" #include "homerun.h" #include "slider.h" /* Convert host byte order to network byte order */ static inline void convert_htons(uint16_t *offset) { *offset = htons(*offset); } extern enum element_status_code add_element_status(enum element_status_code cur, const struct element_status_byte0 *byte0); extern enum element_status_code composite_status(const void* first_element, int nel); /* bluehawk specific call */ extern enum element_status_code bh_roll_up_disk_status( const struct bluehawk_diag_page2 *pg); extern enum element_status_code bh_roll_up_esm_status( const struct bluehawk_diag_page2 *pg); extern enum element_status_code bh_roll_up_temperature_sensor_status( const struct bluehawk_diag_page2 *pg); extern enum element_status_code bh_roll_up_fan_status( const struct bluehawk_diag_page2 *pg); extern enum element_status_code bh_roll_up_power_supply_status( const struct bluehawk_diag_page2 *pg); extern enum element_status_code bh_roll_up_voltage_sensor_status( const struct bluehawk_diag_page2 *pg); extern enum element_status_code bh_roll_up_sas_connector_status( const struct bluehawk_diag_page2 *pg); /* Is this valid? */ extern enum element_status_code bh_roll_up_scc_controller_status( const struct bluehawk_diag_page2 *pg); extern unsigned int bh_mean_temperature(const struct bluehawk_diag_page2 *pg); /* homerun specific call */ extern enum element_status_code hr_roll_up_disk_status( const struct hr_diag_page2 *pg); extern enum element_status_code hr_roll_up_esm_status( const struct hr_diag_page2 *pg); extern enum element_status_code hr_roll_up_temperature_sensor_status( const struct hr_diag_page2 *pg); extern enum element_status_code hr_roll_up_fan_status( const struct hr_diag_page2 *pg); extern enum element_status_code hr_roll_up_power_supply_status( const struct hr_diag_page2 *pg); extern enum element_status_code hr_roll_up_voltage_sensor_status( const struct hr_diag_page2 *pg); extern unsigned int hr_mean_temperature(const struct hr_diag_page2 *pg); /* slider specific call */ extern enum element_status_code slider_roll_up_disk_status( const struct slider_lff_diag_page2 *pg); extern enum element_status_code slider_roll_up_esm_status( const struct slider_lff_diag_page2 *pg); extern enum element_status_code slider_roll_up_temperature_sensor_status( const struct slider_lff_diag_page2 *pg); extern enum element_status_code slider_roll_up_fan_status( const struct slider_lff_diag_page2 *pg); extern enum element_status_code slider_roll_up_power_supply_status( const struct slider_lff_diag_page2 *pg); extern enum element_status_code slider_roll_up_voltage_sensor_status( const struct slider_lff_diag_page2 *pg); extern enum element_status_code slider_roll_up_sas_connector_status( const struct slider_lff_diag_page2 *pg); extern unsigned int slider_mean_temperature( const struct slider_lff_diag_page2 *pg); #endif /* __TEST_UTILS_H__ */ ppc64-diag-2.7.4/diags/test/bh_mk_hot_power.c0000644000000000000000000000343013135275400015631 00000000000000#include #include #include #include "encl_common.h" #include "bluehawk.h" #include "test_utils.h" #define TEMPERATURE_OFFSET 20 extern struct bluehawk_diag_page2 healthy_page; static struct bluehawk_diag_page2 page; int main(int argc, char **argv) { int i; struct power_supply_status *ps; struct voltage_sensor_status *vs; struct fan_status *fs; struct temperature_sensor_status *ts; if (argc != 2) { fprintf(stderr, "usage: %s pathname\n", argv[0]); exit(1); } convert_htons(&healthy_page.page_length); convert_htons(&healthy_page.overall_voltage_status.voltage); convert_htons(&healthy_page.voltage_sensor_sets[0].sensor_12V.voltage); convert_htons(&healthy_page.voltage_sensor_sets[0].sensor_3_3VA.voltage); convert_htons(&healthy_page.voltage_sensor_sets[1].sensor_12V.voltage); convert_htons(&healthy_page.voltage_sensor_sets[1].sensor_3_3VA.voltage); memcpy(&page, &healthy_page, sizeof(page)); page.non_crit = 1; ps = &page.ps_status[1]; ps->byte0.status = ES_NONCRITICAL; ps->dc_over_voltage = 1; ps->fail = 1; bh_roll_up_power_supply_status(&page); vs = &page.voltage_sensor_sets[1].sensor_12V; vs->byte0.status = ES_NONCRITICAL; vs->warn_over = 1; bh_roll_up_voltage_sensor_status(&page); fs = &page.fan_sets[1].power_supply; fs->byte0.status = ES_NONCRITICAL; fs->fail = 1; fs->speed_code = 1; bh_roll_up_fan_status(&page); for (i = 0; i < 2; i++) { ts = &page.temp_sensor_sets[1].power_supply[i]; ts->byte0.status = ES_NONCRITICAL; ts->ot_warning = 1; ts->temperature = TEMPERATURE_OFFSET + 60; // 60 deg C } bh_roll_up_temperature_sensor_status(&page); page.overall_temp_sensor_status.temperature = bh_mean_temperature (&page); if (write_page2_to_file(argv[1], &page, sizeof(page)) != 0) exit(2); exit(0); } ppc64-diag-2.7.4/diags/test/bh_structs.c0000644000000000000000000000430113135275400014641 00000000000000/* Copyright (C) 2009, 2012 IBM Corporation */ #include #include #include #include "encl_common.h" #include "bluehawk.h" #define szp(x) printf(#x " %zu\n", sizeof(struct x)) #define ofs(m) printf(#m " %lu\n", (unsigned long) &((struct bluehawk_diag_page2*)0)->m) #define ofc(m) printf(#m " %lu\n", (unsigned long) &((struct bluehawk_ctrl_page2*)0)->m) /* dump bhluehawk element structure details */ int main() { szp(element_status_byte0); szp(overall_disk_status_byte1); szp(disk_element_status_byte1); szp(disk_status); szp(enclosure_status); szp(esm_status); szp(temperature_sensor_status); szp(temperature_sensor_set); szp(fan_status); szp(fan_set); szp(power_supply_status); szp(voltage_sensor_status); szp(voltage_sensor_set); szp(sas_connector_status); szp(scc_controller_overall_status); szp(scc_controller_element_status); szp(midplane_status); szp(bluehawk_diag_page2); printf("\n"); ofs(overall_disk_status); ofs(disk_status); ofs(overall_enclosure_status); ofs(enclosure_element_status); ofs(overall_esm_status); ofs(esm_status); ofs(overall_temp_sensor_status); ofs(temp_sensor_sets); ofs(overall_fan_status); ofs(fan_sets); ofs(overall_power_status); ofs(ps_status); ofs(overall_voltage_status); ofs(voltage_sensor_sets); ofs(overall_sas_connector_status); ofs(sas_connector_status); ofs(overall_scc_controller_status); ofs(scc_controller_status); ofs(overall_midplane_status); ofs(midplane_element_status); printf("\n"); szp(common_ctrl); szp(disk_ctrl); szp(enclosure_ctrl); szp(esm_ctrl); szp(fan_ctrl); szp(fan_ctrl_set); szp(power_supply_ctrl); szp(sas_connector_ctrl); szp(scc_controller_ctrl); szp(midplane_ctrl); szp(bluehawk_ctrl_page2); printf("\n"); ofc(overall_disk_ctrl); ofc(disk_ctrl); ofc(overall_enclosure_ctrl); ofc(enclosure_element_ctrl); ofc(overall_esm_ctrl); ofc(esm_ctrl); ofc(temperature_sensor_ctrl); ofc(overall_fan_ctrl); ofc(fan_sets); ofc(overall_power_ctrl); ofc(ps_ctrl); ofc(voltage_sensor_ctrl); ofc(overall_sas_connector_ctrl); ofc(sas_connector_ctrl); ofc(overall_scc_controller_ctrl); ofc(scc_controller_ctrl); ofc(overall_midplane_ctrl); ofc(midplane_element_ctrl); exit(0); } ppc64-diag-2.7.4/diags/test/encl_dump_pg2.c0000644000000000000000000000333013135275400015200 00000000000000#include #include #include #include #include #include "bluehawk.h" #include "homerun.h" #include "slider.h" /* Dump enclosure pg2 */ int main(int argc, char **argv) { char *sg; char dev_sg[20]; char *path; int fd; void *dp; struct dev_vpd vpd; int result; int size = 0; if (argc != 3) { fprintf(stderr, "usage: %s sgN output_file\n", argv[0]); exit(1); } sg = argv[1]; path = argv[2]; if (strncmp(sg, "sg", 2) != 0 || strlen(sg) > 6) { fprintf(stderr, "bad format of sg argument\n"); exit(2); } snprintf(dev_sg, 20, "/dev/%s", sg); /* Validate enclosure device */ if (valid_enclosure_device(sg)) exit(0); /* Read enclosure vpd */ memset(&vpd, 0, sizeof(vpd)); result = read_vpd_from_lscfg(&vpd, sg); if (vpd.mtm[0] == '\0') { fprintf(stderr, "Unable to find machine type/model for %s\n", sg); exit(1); } if ((!strcmp(vpd.mtm, "5888")) || (!strcmp(vpd.mtm, "EDR1"))) { size = sizeof(struct bluehawk_diag_page2); } else if (!strcmp(vpd.mtm, "5887")) { size = sizeof(struct hr_diag_page2); } else if (!strcmp(vpd.mtm, "ESLL")) { size = sizeof(struct slider_lff_diag_page2); } else if (!strcmp(vpd.mtm, "ESLS")) { size = sizeof(struct slider_sff_diag_page2); } else { fprintf(stderr,"Not a valid enclosure : %s\n", sg); exit (1); } dp = (char *)malloc(size); if (!dp) { perror(dp); exit(2); } fd = open(dev_sg, O_RDWR); if (fd < 0) { free(dp); perror(dev_sg); exit(3); } result = get_diagnostic_page(fd, RECEIVE_DIAGNOSTIC, 2, dp, size); if (result != 0) { free(dp); perror("get_diagnostic_page"); exit(4); } if (write_page2_to_file(path, dp, size) != 0) { free(dp); exit(5); } free(dp); exit(0); } ppc64-diag-2.7.4/diags/test/encl_vpd.c0000644000000000000000000000745713135275400014272 00000000000000#include #include #include #include #include #include #include #include #include #include #include #include "encl_common.h" #include "encl_util.h" #include "bluehawk.h" #include "homerun.h" #include "slider.h" static void get_power_supply_vpd(int fd, void *edp, int size) { int result; memset(edp, 0, size); result = get_diagnostic_page(fd, RECEIVE_DIAGNOSTIC, 7, edp, size); if (result != 0) { perror("get_power_supply_vpd"); fprintf(stderr, "result = %d\n", result); exit(5); } } static void display_encl_element_vpd_data(struct vpd_page *vp) { char temp[20]; printf("FN=%s\n", strzcpy(temp, vp->fru_number, 8)); printf("SN=%s\n", strzcpy(temp, vp->serial_number, 12)); printf("CCIN=%s\n", strzcpy(temp, vp->model_number, 4)); printf("FL=%s\n", strzcpy(temp, vp->fru_label, 5)); } #define DISPLAY_ENCL_PS_VPD(element_desc_page, element) \ do { \ printf("FN=%s\n", strzcpy(temp, \ element_desc_page.element.fru_number, 8)); \ printf("SN=%s\n", strzcpy(temp, \ element_desc_page.element.serial_number, 12)); \ printf("FL=%s\n", strzcpy(temp, \ element_desc_page.element.fru_label, 5)); \ \ } while (0) int main(int argc, char **argv) { int fd; int result; char *sg; char dev_sg[20]; char temp[20]; struct vpd_page vp; struct bh_element_descriptor_page bh_edp; struct hr_element_descriptor_page hr_edp; struct slider_lff_element_descriptor_page slider_l_edp; struct slider_sff_element_descriptor_page slider_s_edp; struct dev_vpd vpd; if (argc != 2) { fprintf(stderr, "usage: %s sgN\n", argv[0]); exit(1); } sg = argv[1]; if (strncmp(sg, "sg", 2) != 0 || strlen(sg) > 6) { fprintf(stderr, "bad format of sg argument\n"); exit(2); } snprintf(dev_sg, 20, "/dev/%s", sg); fd = open(dev_sg, O_RDWR); if (fd < 0) { perror(dev_sg); exit(3); } printf("ESM/ERM:\n"); result = get_diagnostic_page(fd, INQUIRY, 1, &vp, sizeof(vp)); if (result != 0) { perror("get_vpd_page"); fprintf(stderr, "result = %d\n", result); exit(4); } display_encl_element_vpd_data(&vp); printf("\nMidplane:\n"); result = get_diagnostic_page(fd, INQUIRY, 5, &vp, sizeof(vp)); if (result != 0) { perror("get_vpd_page"); fprintf(stderr, "result = %d\n", result); exit(4); } display_encl_element_vpd_data(&vp); /* Read enclosure vpd */ memset(&vpd, 0, sizeof(vpd)); read_vpd_from_lscfg(&vpd, sg); if (vpd.mtm[0] == '\0') { fprintf(stderr, "Unable to find machine type/model for %s\n", sg); exit(1); } if (strcmp(vpd.mtm, "5888") && strcmp(vpd.mtm, "EDR1") && strcmp(vpd.mtm, "5887") && strcmp(vpd.mtm, "ESLL") && strcmp(vpd.mtm, "ESLS")) { fprintf(stderr, "Not a valid enclosure : %s", sg); exit (1); } if ((!strcmp(vpd.mtm, "5888")) || (!strcmp(vpd.mtm, "EDR1"))) { get_power_supply_vpd(fd, &bh_edp, sizeof(bh_edp)); printf("\nPower supply 0:\n"); DISPLAY_ENCL_PS_VPD(bh_edp, ps0_vpd); printf("\nPower supply 1:\n"); DISPLAY_ENCL_PS_VPD(bh_edp, ps1_vpd); } else if (!strcmp(vpd.mtm, "5887")) { get_power_supply_vpd(fd, &hr_edp, sizeof(hr_edp)); printf("\nPower supply 0:\n"); DISPLAY_ENCL_PS_VPD(hr_edp, ps0_vpd); printf("\nPower supply 1:\n"); DISPLAY_ENCL_PS_VPD(hr_edp, ps1_vpd); } else if (!strcmp(vpd.mtm, "ESLL")) { get_power_supply_vpd(fd, &slider_l_edp, sizeof(slider_l_edp)); printf("\nPower supply 0:\n"); DISPLAY_ENCL_PS_VPD(slider_l_edp, ps0_vpd); printf("\nPower supply 1:\n"); DISPLAY_ENCL_PS_VPD(slider_l_edp, ps1_vpd); } else if (!strcmp(vpd.mtm, "ESLS")) { get_power_supply_vpd(fd, &slider_s_edp, sizeof(slider_s_edp)); printf("\nPower supply 0:\n"); DISPLAY_ENCL_PS_VPD(slider_s_edp, ps0_vpd); printf("\nPower supply 1:\n"); DISPLAY_ENCL_PS_VPD(slider_s_edp, ps1_vpd); } exit(0); } ppc64-diag-2.7.4/diags/test/hr_mk_healthy.c0000644000000000000000000000172413135275400015305 00000000000000#include #include #include "encl_common.h" #include "encl_util.h" #include "homerun.h" #include "test_utils.h" extern struct hr_diag_page2 healthy_page; /* healthy pg2 for homerun */ int main(int argc, char **argv) { if (argc != 2) { fprintf(stderr, "usage: %s pathname\n", argv[0]); exit(1); } convert_htons(&healthy_page.page_length); convert_htons(&healthy_page.voltage_sensor_overall_status.voltage); convert_htons(&healthy_page.voltage_sensor_sets[0].sensor_12V.voltage); convert_htons(&healthy_page.voltage_sensor_sets[0].sensor_5V.voltage); convert_htons(&healthy_page.voltage_sensor_sets[0].sensor_5VA.voltage); convert_htons(&healthy_page.voltage_sensor_sets[1].sensor_12V.voltage); convert_htons(&healthy_page.voltage_sensor_sets[1].sensor_5V.voltage); convert_htons(&healthy_page.voltage_sensor_sets[1].sensor_5VA.voltage); if (write_page2_to_file(argv[1], &healthy_page, sizeof(healthy_page)) != 0) exit(2); exit(0); } ppc64-diag-2.7.4/diags/test/hr_healthy.c0000644000000000000000000001014313135275400014611 00000000000000#include "encl_common.h" #include "homerun.h" /* * Note: Initializing struct members to zero is not strictly necessary, * but we explicitly initialize all members that can take on meaningful * values. All other members are unsupported by the SES implementation. */ #define HEALTHY_STATUS_BYTE0 { .swap = 0, .status = 1 } #define HEALTHY_DISK(n) { \ .byte0 = HEALTHY_STATUS_BYTE0, \ .byte1.element_status = { .hot_swap = 1, .slot_address = n }, \ .app_client_bypassed_a = 0, \ .ready_to_insert = 0, \ .rmv = 0, \ .ident = 0, \ .app_client_bypassed_b = 0, \ .fail = 0, \ .bypassed_a = 0, \ .bypassed_b = 0, \ } #define HEALTHY_ENCLOSURE { \ .byte0 = HEALTHY_STATUS_BYTE0, \ .ident = 0, \ .fail = 0, \ .failure_requested = 0 \ } #define HEALTHY_ESM { \ .byte0 = HEALTHY_STATUS_BYTE0, \ .ident = 0, \ .fail = 0, \ .hot_swap = 1, \ } #define ROOM_TEMPERATURE 20 #define TEMPERATURE_OFFSET 20 #define HEALTHY_TEMP_SENSOR(temp) { \ .byte0 = HEALTHY_STATUS_BYTE0, \ .temperature = (temp + TEMPERATURE_OFFSET), \ .ot_failure = 0, \ .ot_warning = 0 \ } #define ROOM_TEMP_SENSOR HEALTHY_TEMP_SENSOR(ROOM_TEMPERATURE) #define HEALTHY_TEMP_SENSOR_SET { \ .controller = ROOM_TEMP_SENSOR, \ .power_supply = { \ ROOM_TEMP_SENSOR, \ ROOM_TEMP_SENSOR, \ ROOM_TEMP_SENSOR \ } \ } #define HEALTHY_FAN_SPEED_CODE 0x3 /* Just a guess */ #define HEALTHY_FAN(spdcd) { \ .byte0 = HEALTHY_STATUS_BYTE0, \ .ident = 0, \ .hot_swap = 1, \ .fail = 0, \ .speed_code = spdcd \ } #define HEALTHY_FAN_SET(spdcd) { \ .fan_element = { \ HEALTHY_FAN(spdcd), \ HEALTHY_FAN(spdcd), \ HEALTHY_FAN(spdcd), \ HEALTHY_FAN(spdcd), \ HEALTHY_FAN(spdcd), \ HEALTHY_FAN(spdcd), \ HEALTHY_FAN(spdcd), \ HEALTHY_FAN(spdcd), \ } \ } #define HEALTHY_POWER_SUPPLY { \ .byte0 = HEALTHY_STATUS_BYTE0, \ .ident = 0, \ .dc_over_voltage = 0, \ .dc_under_voltage = 0, \ .dc_over_current = 0, \ .hot_swap = 1, \ .fail = 0, \ .ovrtmp_fail = 0, \ .ac_fail = 0, \ .dc_fail = 0, \ } #define HEALTHY_VOLTAGE_12V 1200 #define HEALTHY_VOLTAGE_5V 550 #define HEALTHY_VOLTAGE_5VA 550 #define HEALTHY_VOLTAGE_SENSOR(volts) { \ .byte0 = HEALTHY_STATUS_BYTE0, \ .warn_over = 0, \ .warn_under = 0, \ .crit_over = 0, \ .crit_under = 0, \ .voltage = volts \ } #define HEALTHY_VOLTAGE_SENSOR_SET { \ HEALTHY_VOLTAGE_SENSOR(HEALTHY_VOLTAGE_12V), \ HEALTHY_VOLTAGE_SENSOR(HEALTHY_VOLTAGE_5V), \ HEALTHY_VOLTAGE_SENSOR(HEALTHY_VOLTAGE_5VA) \ } struct hr_diag_page2 healthy_page = { .page_code = 2, .non_crit = 0, .crit = 0, .page_length = 0x144, .generation_code = 0, .overall_disk_status = { .byte0 = HEALTHY_STATUS_BYTE0, .byte1.overall_status = { .device_environment = 2, .slot_address = 0 }, .ready_to_insert = 0, .rmv = 0, .ident = 0, .report = 0, .fail = 0 }, .disk_status = { [0] = HEALTHY_DISK(0), [1] = HEALTHY_DISK(1), [2] = HEALTHY_DISK(2), [3] = HEALTHY_DISK(3), [4] = HEALTHY_DISK(4), [5] = HEALTHY_DISK(5), [6] = HEALTHY_DISK(6), [7] = HEALTHY_DISK(7), [8] = HEALTHY_DISK(8), [9] = HEALTHY_DISK(9), [10] = HEALTHY_DISK(10), [11] = HEALTHY_DISK(11), [12] = HEALTHY_DISK(12), [13] = HEALTHY_DISK(13), [14] = HEALTHY_DISK(14), [15] = HEALTHY_DISK(15), [16] = HEALTHY_DISK(16), [17] = HEALTHY_DISK(17), [18] = HEALTHY_DISK(18), [19] = HEALTHY_DISK(19), [20] = HEALTHY_DISK(20), [21] = HEALTHY_DISK(21), [22] = HEALTHY_DISK(22), [23] = HEALTHY_DISK(23), }, .overall_enclosure_status = HEALTHY_ENCLOSURE, .enclosure_element_status = HEALTHY_ENCLOSURE, .overall_esm_status = HEALTHY_ESM, .esm_status = { HEALTHY_ESM, HEALTHY_ESM }, .temp_sensor_overall_status = ROOM_TEMP_SENSOR, .temp_sensor_sets = { HEALTHY_TEMP_SENSOR_SET, HEALTHY_TEMP_SENSOR_SET }, .cooling_element_overall_status = HEALTHY_FAN(0), .fan_sets = { HEALTHY_FAN_SET(HEALTHY_FAN_SPEED_CODE), HEALTHY_FAN_SET(HEALTHY_FAN_SPEED_CODE) }, .power_supply_overall_status = HEALTHY_POWER_SUPPLY, .ps_status = { HEALTHY_POWER_SUPPLY, HEALTHY_POWER_SUPPLY }, .voltage_sensor_overall_status = HEALTHY_VOLTAGE_SENSOR(0), .voltage_sensor_sets = { HEALTHY_VOLTAGE_SENSOR_SET, HEALTHY_VOLTAGE_SENSOR_SET }, }; ppc64-diag-2.7.4/diags/test/hr_mk_hot_power.c0000644000000000000000000000363713135275400015662 00000000000000#include #include #include #include "encl_common.h" #include "homerun.h" #include "test_utils.h" #define TEMPERATURE_OFFSET 20 extern struct hr_diag_page2 healthy_page; static struct hr_diag_page2 page; int main(int argc, char **argv) { int i; struct power_supply_status *ps; struct voltage_sensor_status *vs; struct fan_status *fs; struct temperature_sensor_status *ts; if (argc != 2) { fprintf(stderr, "usage: %s pathname\n", argv[0]); exit(1); } convert_htons(&healthy_page.page_length); convert_htons(&healthy_page.voltage_sensor_overall_status.voltage); convert_htons(&healthy_page.voltage_sensor_sets[0].sensor_12V.voltage); convert_htons(&healthy_page.voltage_sensor_sets[0].sensor_5V.voltage); convert_htons(&healthy_page.voltage_sensor_sets[0].sensor_5VA.voltage); convert_htons(&healthy_page.voltage_sensor_sets[1].sensor_12V.voltage); convert_htons(&healthy_page.voltage_sensor_sets[1].sensor_5V.voltage); convert_htons(&healthy_page.voltage_sensor_sets[1].sensor_5VA.voltage); memcpy(&page, &healthy_page, sizeof(page)); page.non_crit = 1; ps = &page.ps_status[1]; ps->byte0.status = ES_NONCRITICAL; ps->dc_over_voltage = 1; ps->fail = 1; hr_roll_up_power_supply_status(&page); vs = &page.voltage_sensor_sets[1].sensor_12V; vs->byte0.status = ES_NONCRITICAL; vs->warn_over = 1; hr_roll_up_voltage_sensor_status(&page); fs = &page.fan_sets[1].fan_element[1]; fs->byte0.status = ES_NONCRITICAL; fs->fail = 1; fs->speed_code = 1; hr_roll_up_fan_status(&page); for (i = 0; i < 3; i++) { ts = &page.temp_sensor_sets[1].power_supply[i]; ts->byte0.status = ES_NONCRITICAL; ts->ot_warning = 1; ts->temperature = TEMPERATURE_OFFSET + 60; // 60 deg C } hr_roll_up_temperature_sensor_status(&page); page.temp_sensor_overall_status.temperature = hr_mean_temperature(&page); if (write_page2_to_file(argv[1], &page, sizeof(page)) != 0) exit(2); exit(0); } ppc64-diag-2.7.4/diags/test/hr_structs.c0000644000000000000000000000323613135275400014667 00000000000000/* Copyright (C) 2009, 2016 IBM Corporation */ #include #include #include #include "encl_common.h" #include "homerun.h" #define szp(x) printf(#x " %zu\n", sizeof(struct x)) #define ofs(m) printf(#m " %lu\n", (unsigned long) &((struct hr_diag_page2 *)0)->m) #define ofc(m) printf(#m " %lu\n", (unsigned long) &((struct hr_ctrl_page2 *)0)->m) /* dump homerun element structure details */ int main() { szp(element_status_byte0); szp(overall_disk_status_byte1); szp(disk_element_status_byte1); szp(disk_status); szp(enclosure_status); szp(esm_status); szp(temperature_sensor_status); szp(hr_temperature_sensor_set); szp(fan_status); szp(hr_fan_set); szp(power_supply_status); szp(voltage_sensor_status); szp(hr_voltage_sensor_set); szp(hr_diag_page2); printf("\n"); ofs(overall_disk_status); ofs(disk_status); ofs(overall_enclosure_status); ofs(enclosure_element_status); ofs(overall_esm_status); ofs(esm_status); ofs(temp_sensor_overall_status); ofs(temp_sensor_sets); ofs(cooling_element_overall_status); ofs(fan_sets); ofs(power_supply_overall_status); ofs(ps_status); ofs(voltage_sensor_overall_status); ofs(voltage_sensor_sets); printf("\n"); szp(common_ctrl); szp(hr_disk_ctrl); szp(enclosure_ctrl); szp(esm_ctrl); szp(fan_ctrl); szp(hr_fan_ctrl_set); szp(power_supply_ctrl); szp(hr_ctrl_page2); printf("\n"); ofc(overall_disk_ctrl); ofc(disk_ctrl); ofc(overall_enclosure_ctrl); ofc(enclosure_element_ctrl); ofc(overall_esm_ctrl); ofc(esm_ctrl); ofc(temperature_sensor_ctrl); ofc(overall_fan_ctrl); ofc(fan_sets); ofc(overall_power_supply_ctrl); ofc(ps_ctrl); ofc(voltage_sensor_ctrl); exit(0); } ppc64-diag-2.7.4/diags/test/slider_mk_healthy.c0000644000000000000000000000201113135275400016144 00000000000000#include #include #include "slider.h" #include "encl_common.h" #include "encl_util.h" #include "test_utils.h" extern struct slider_lff_diag_page2 healthy_page; /* healthy pg2 for slider lff variant */ int main(int argc, char **argv) { int i; if (argc != 2) { fprintf(stderr, "usage: %s pathname\n", argv[0]); exit(1); } convert_htons(&healthy_page.page_length); convert_htons(&healthy_page.overall_input_power_status.input_power); for (i = 0; i < SLIDER_NR_INPUT_POWER; i++) convert_htons(&healthy_page.input_power_element[i].input_power); for (i = 0; i < SLIDER_NR_ESC; i++) { convert_htons (&healthy_page.voltage_sensor_sets[i].sensor_3V3.voltage); convert_htons (&healthy_page.voltage_sensor_sets[i].sensor_1V0.voltage); convert_htons (&healthy_page.voltage_sensor_sets[i].sensor_1V8.voltage); convert_htons (&healthy_page.voltage_sensor_sets[i].sensor_0V92.voltage); } if (write_page2_to_file(argv[1], &healthy_page, sizeof(healthy_page)) != 0) exit(2); exit(0); } ppc64-diag-2.7.4/diags/test/slider_healthy.c0000644000000000000000000001560613135275400015473 00000000000000#include "encl_common.h" #include "slider.h" /* * Note: Initializing struct members to zero is not strictly necessary, * but we explicitly initialize all members that can take on meaningful * values. All other members are unsupported by the SES implementation. */ /* * Slider Specification : V0.2 * Date : 7/05/2016 * Page reference : Table 5.16 Slider SAS Enclosure Status diagnostic page */ #define SLIDER_LFF_PAGE_LENGTH (sizeof(struct slider_lff_diag_page2) - 4) #define SLIDER_SFF_PAGE_LENGTH (sizeof(struct slider_sff_diag_page2) - 4) #define HEALTHY_STATUS_BYTE0 { .swap = 0, .status = 1 } #define HEALTHY_DISK(n) { \ .byte0 = HEALTHY_STATUS_BYTE0, \ .slot_address = n, \ .app_client_bypassed_a = 0, \ .app_client_bypassed_b = 0, \ .enclosure_bypassed_a = 0, \ .enclosure_bypassed_b = 0, \ .device_bypassed_a = 0, \ .device_bypassed_b = 0, \ .bypassed_a = 0, \ .bypassed_b = 0, \ .ident = 0, \ .fail = 0, \ } #define HEALTHY_POWER_SUPPLY { \ .byte0 = HEALTHY_STATUS_BYTE0, \ .ident = 0, \ .dc_over_voltage = 0, \ .dc_under_voltage = 0, \ .dc_over_current = 0, \ .fail = 0, \ .ovrtmp_fail = 0, \ .ac_fail = 0, \ .dc_fail = 0, \ } #define HEALTHY_ESC { \ .byte0 = HEALTHY_STATUS_BYTE0, \ .ident = 0, \ .fail = 0, \ .reset_reason = 0, \ .vpd_read_fail = 0, \ .vpd_mismatch = 0, \ .vpd_mirror_mismatch = 0, \ .firm_img_unmatch = 0, \ .ierr_asserted = 0, \ .xcc_data_initialised = 0, \ .report = 0, \ .hot_swap = 0, \ } #define HEALTHY_ENCLOSURE { \ .byte0 = HEALTHY_STATUS_BYTE0, \ .ident = 0, \ .fail = 0, \ } #define FAN_SPEED_MSB 4 #define FAN_SPEED_LSB 123 #define HEALTHY_FAN(speed_msb, speed_lsb) { \ .byte0 = HEALTHY_STATUS_BYTE0, \ .ident = 0, \ .fail = 0, \ .fan_speed_msb = speed_msb, \ .fan_speed_lsb = speed_lsb \ } #define HEALTHY_FAN_SET(speed_msb, speed_lsb) { \ .fan_element = { \ HEALTHY_FAN(speed_msb, speed_lsb), \ HEALTHY_FAN(speed_msb, speed_lsb), \ HEALTHY_FAN(speed_msb, speed_lsb), \ HEALTHY_FAN(speed_msb, speed_lsb), \ HEALTHY_FAN(speed_msb, speed_lsb), \ HEALTHY_FAN(speed_msb, speed_lsb), \ HEALTHY_FAN(speed_msb, speed_lsb), \ HEALTHY_FAN(speed_msb, speed_lsb), \ } \ } #define ROOM_TEMPERATURE 20 #define TEMPERATURE_OFFSET 20 #define HEALTHY_TEMP_SENSOR(temp) { \ .byte0 = HEALTHY_STATUS_BYTE0, \ .temperature = (temp + TEMPERATURE_OFFSET), \ .ot_failure = 0, \ .ot_warning = 0, \ .ut_failure = 0, \ .ut_warning = 0 \ } #define ROOM_TEMP_SENSOR HEALTHY_TEMP_SENSOR(ROOM_TEMPERATURE) #define HEALTHY_TEMP_SENSOR_SET { \ .temp_enclosure = ROOM_TEMP_SENSOR, \ .temp_psu = { \ ROOM_TEMP_SENSOR, \ ROOM_TEMP_SENSOR, \ ROOM_TEMP_SENSOR, \ ROOM_TEMP_SENSOR, \ ROOM_TEMP_SENSOR, \ ROOM_TEMP_SENSOR, \ }, \ .temp_esc = { \ ROOM_TEMP_SENSOR, \ ROOM_TEMP_SENSOR, \ ROOM_TEMP_SENSOR, \ ROOM_TEMP_SENSOR, \ } \ } #define HEALTHY_VOLTAGE_3V3 350 #define HEALTHY_VOLTAGE_1V0 100 #define HEALTHY_VOLTAGE_1V8 180 #define HEALTHY_VOLTAGE_0V92 90 #define HEALTHY_VOLTAGE_SENSOR(volts) { \ .byte0 = HEALTHY_STATUS_BYTE0, \ .warn_over = 0, \ .warn_under = 0, \ .crit_over = 0, \ .crit_under = 0, \ .voltage = volts \ } #define HEALTHY_VOLTAGE_SENSOR_SET { \ HEALTHY_VOLTAGE_SENSOR(HEALTHY_VOLTAGE_3V3), \ HEALTHY_VOLTAGE_SENSOR(HEALTHY_VOLTAGE_1V0), \ HEALTHY_VOLTAGE_SENSOR(HEALTHY_VOLTAGE_1V8), \ HEALTHY_VOLTAGE_SENSOR(HEALTHY_VOLTAGE_0V92) \ } #define HEALTHY_SAS_EXPANDER { \ .byte0 = HEALTHY_STATUS_BYTE0, \ .ident = 0, \ .fail = 0 \ } #define HEALTHY_SAS_CONNECTOR { \ .byte0 = HEALTHY_STATUS_BYTE0, \ .ident = 0, \ .connector_physical_link = 0xff, \ .fail = 0 \ } #define HEALTHY_MIDPLANE(stat) { \ .byte0 = { .swap = 0, .status = stat }, \ .vpd1_read_fail1 = 0, \ .vpd1_read_fail2 = 0, \ .vpd2_read_fail1 = 0, \ .vpd2_read_fail2 = 0, \ .vpd_mirror_mismatch = 0, \ } #define HEALTHY_PHY { \ .byte0 = HEALTHY_STATUS_BYTE0, \ .enable = 1,\ .connect = 1,\ } #define HEALTHY_PHY_SET { \ .phy_element = { \ HEALTHY_PHY, \ HEALTHY_PHY, \ HEALTHY_PHY, \ HEALTHY_PHY, \ HEALTHY_PHY, \ HEALTHY_PHY, \ HEALTHY_PHY, \ HEALTHY_PHY, \ HEALTHY_PHY, \ HEALTHY_PHY, \ HEALTHY_PHY, \ HEALTHY_PHY, \ HEALTHY_PHY, \ HEALTHY_PHY, \ HEALTHY_PHY, \ HEALTHY_PHY, \ HEALTHY_PHY, \ HEALTHY_PHY, \ HEALTHY_PHY, \ HEALTHY_PHY, \ HEALTHY_PHY, \ HEALTHY_PHY, \ HEALTHY_PHY, \ HEALTHY_PHY, \ HEALTHY_PHY, \ HEALTHY_PHY, \ HEALTHY_PHY, \ HEALTHY_PHY, \ HEALTHY_PHY, \ HEALTHY_PHY, \ HEALTHY_PHY, \ HEALTHY_PHY, \ HEALTHY_PHY, \ HEALTHY_PHY, \ HEALTHY_PHY, \ HEALTHY_PHY, \ } \ } #define HEALTHY_SSB { \ .byte0 = HEALTHY_STATUS_BYTE0, \ .buffer_status = 0 \ } #define HEALTHY_CPLD { \ .byte0 = HEALTHY_STATUS_BYTE0, \ .fail = 0 \ } #define HEALTHY_INPUT_POWER(value) { \ .byte0 = HEALTHY_STATUS_BYTE0, \ .input_power = value \ } struct slider_lff_diag_page2 healthy_page = { .page_code = 2, .non_crit = 0, .crit = 0, .page_length = SLIDER_LFF_PAGE_LENGTH, .generation_code = 0, .overall_disk_status = { .byte0 = HEALTHY_STATUS_BYTE0 }, .disk_status = { [0] = HEALTHY_DISK(0), [1] = HEALTHY_DISK(1), [2] = HEALTHY_DISK(2), [3] = HEALTHY_DISK(3), [4] = HEALTHY_DISK(4), [5] = HEALTHY_DISK(5), [6] = HEALTHY_DISK(6), [7] = HEALTHY_DISK(7), [8] = HEALTHY_DISK(8), [9] = HEALTHY_DISK(9), [10] = HEALTHY_DISK(10), [11] = HEALTHY_DISK(11) }, .overall_power_status = HEALTHY_POWER_SUPPLY, .ps_status = { HEALTHY_POWER_SUPPLY, HEALTHY_POWER_SUPPLY }, .overall_fan_status = HEALTHY_FAN(FAN_SPEED_MSB, FAN_SPEED_LSB), .fan_sets = { HEALTHY_FAN_SET(FAN_SPEED_MSB, FAN_SPEED_LSB), HEALTHY_FAN_SET(FAN_SPEED_MSB, FAN_SPEED_LSB), }, .overall_temp_sensor_status = ROOM_TEMP_SENSOR, .temp_sensor_sets = HEALTHY_TEMP_SENSOR_SET, .overall_enc_service_ctrl_status = HEALTHY_ESC, .enc_service_ctrl_element = { HEALTHY_ESC, HEALTHY_ESC }, .overall_encl_status = HEALTHY_ENCLOSURE, .encl_element = HEALTHY_ENCLOSURE, .overall_voltage_status = HEALTHY_VOLTAGE_SENSOR(0), .voltage_sensor_sets = { HEALTHY_VOLTAGE_SENSOR_SET, HEALTHY_VOLTAGE_SENSOR_SET }, .overall_sas_expander_status = HEALTHY_SAS_EXPANDER, .sas_expander_element = { HEALTHY_SAS_EXPANDER, HEALTHY_SAS_EXPANDER, }, .overall_sas_connector_status = HEALTHY_SAS_CONNECTOR, .sas_connector_status = { HEALTHY_SAS_CONNECTOR, HEALTHY_SAS_CONNECTOR, HEALTHY_SAS_CONNECTOR, HEALTHY_SAS_CONNECTOR, HEALTHY_SAS_CONNECTOR, HEALTHY_SAS_CONNECTOR }, .overall_midplane_status = HEALTHY_MIDPLANE(0), .midplane_element_status = HEALTHY_MIDPLANE(1), .overall_phy_status = HEALTHY_PHY, .phy_sets = { HEALTHY_PHY_SET, HEALTHY_PHY_SET, }, .overall_ssb_status = HEALTHY_SSB, .ssb_element = { HEALTHY_SSB, HEALTHY_SSB, }, .overall_cpld_status = HEALTHY_CPLD, .cpld_element = { HEALTHY_CPLD, HEALTHY_CPLD, }, .overall_input_power_status = HEALTHY_INPUT_POWER(5), .input_power_element = { HEALTHY_INPUT_POWER(5), HEALTHY_INPUT_POWER(5), HEALTHY_INPUT_POWER(5), HEALTHY_INPUT_POWER(5), }, }; ppc64-diag-2.7.4/diags/test/slider_mk_hot_power.c0000644000000000000000000000366713135275400016536 00000000000000#include #include #include #include "encl_common.h" #include "slider.h" #include "test_utils.h" #define TEMPERATURE_OFFSET 20 extern struct slider_lff_diag_page2 healthy_page; static struct slider_lff_diag_page2 page; int main(int argc, char **argv) { int i; struct fan_status *fs; struct slider_power_supply_status *ps; struct voltage_sensor_status *vs; struct temperature_sensor_status *ts; if (argc != 2) { fprintf(stderr, "usage: %s pathname\n", argv[0]); exit(1); } convert_htons(&healthy_page.page_length); convert_htons(&healthy_page.overall_input_power_status.input_power); for (i = 0; i < SLIDER_NR_INPUT_POWER; i++) convert_htons(&healthy_page.input_power_element[i].input_power); for (i = 0; i < SLIDER_NR_ESC; i++) { convert_htons (&healthy_page.voltage_sensor_sets[i].sensor_3V3.voltage); convert_htons (&healthy_page.voltage_sensor_sets[i].sensor_1V0.voltage); convert_htons (&healthy_page.voltage_sensor_sets[i].sensor_1V8.voltage); convert_htons (&healthy_page.voltage_sensor_sets[i].sensor_0V92.voltage); } memcpy(&page, &healthy_page, sizeof(page)); page.non_crit = 1; ps = &page.ps_status[1]; ps->byte0.status = ES_NONCRITICAL; ps->dc_over_voltage = 1; ps->fail = 1; slider_roll_up_power_supply_status(&page); vs = &page.voltage_sensor_sets[1].sensor_3V3; vs->byte0.status = ES_NONCRITICAL; vs->warn_over = 1; slider_roll_up_voltage_sensor_status(&page); fs = &page.fan_sets[1].fan_element[0]; fs->byte0.status = ES_NONCRITICAL; fs->fail = 1; fs->speed_code = 1; slider_roll_up_fan_status(&page); ts = &page.temp_sensor_sets.temp_enclosure; ts->byte0.status = ES_NONCRITICAL; ts->ot_warning = 1; ts->temperature = TEMPERATURE_OFFSET + 60; slider_roll_up_temperature_sensor_status(&page); page.overall_temp_sensor_status.temperature = slider_mean_temperature(&page); if (write_page2_to_file(argv[1], &page, sizeof(page)) != 0) exit(2); exit(0); } ppc64-diag-2.7.4/diags/test/slider_structs.c0000644000000000000000000001222713135275400015540 00000000000000/* Copyright (C) 2016 IBM Corporation */ #include #include #include #include "encl_common.h" #include "slider.h" #define szp(x) printf(#x " %zu\n", sizeof(struct x)) #define ofsl(m) printf(#m " %lu\n", (unsigned long) &((struct slider_lff_diag_page2*)0)->m) #define ofcl(m) printf(#m " %lu\n", (unsigned long) &((struct slider_lff_ctrl_page2*)0)->m) #define ofss(m) printf(#m " %lu\n", (unsigned long) &((struct slider_sff_diag_page2*)0)->m) #define ofcs(m) printf(#m " %lu\n", (unsigned long) &((struct slider_sff_ctrl_page2*)0)->m) /* dump slider element structure details */ int main() { printf("\n Slider LFF/SFF status structure size :\n\n"); szp(element_status_byte0); szp(slider_disk_status); szp(power_supply_status); szp(fan_status); szp(slider_fan_set); szp(temperature_sensor_status); szp(slider_enc_service_ctrl_status); szp(enclosure_status); szp(voltage_sensor_status); szp(slider_voltage_sensor_set); szp(slider_sas_expander_status); szp(slider_sas_connector_status); szp(slider_midplane_status); szp(slider_phy_status); szp(slider_phy_set); szp(slider_statesave_buffer_status); szp(slider_cpld_status); szp(slider_input_power_status); szp(slider_lff_diag_page2); szp(slider_sff_diag_page2); printf("\n"); printf("\n Slider LFF/SFF cntrl structure size :\n"); szp(common_ctrl); szp(slider_disk_ctrl); szp(slider_power_supply_ctrl); szp(fan_ctrl); szp(slider_fan_ctrl_set); szp(slider_temperature_sensor_ctrl); szp(slider_temperature_sensor_ctrl_set); szp(esm_ctrl); szp(enclosure_ctrl); szp(slider_voltage_sensor_ctrl); szp(slider_voltage_sensor_ctrl_set); szp(slider_sas_expander_ctrl); szp(slider_sas_connector_ctrl); szp(slider_midplane_ctrl); szp(slider_phy_ctrl); szp(slider_phy_ctrl_set); szp(slider_statesave_buffer_ctrl); szp(slider_cpld_ctrl); szp(slider_input_power_ctrl); szp(slider_lff_ctrl_page2); szp(slider_sff_ctrl_page2); printf("\n"); printf("Slider LFF status element offset :\n"); ofsl(overall_disk_status); ofsl(disk_status); ofsl(overall_power_status); ofsl(ps_status); ofsl(overall_fan_status); ofsl(fan_sets); ofsl(overall_temp_sensor_status); ofsl(temp_sensor_sets); ofsl(overall_enc_service_ctrl_status); ofsl(enc_service_ctrl_element); ofsl(overall_encl_status); ofsl(encl_element); ofsl(overall_voltage_status); ofsl(voltage_sensor_sets); ofsl(overall_sas_expander_status); ofsl(sas_expander_element); ofsl(overall_sas_connector_status); ofsl(sas_connector_status); ofsl(overall_midplane_status); ofsl(midplane_element_status); ofsl(overall_phy_status); ofsl(phy_sets); ofsl(overall_ssb_status); ofsl(ssb_element); ofsl(overall_cpld_status); ofsl(cpld_element); ofsl(overall_input_power_status); ofsl(input_power_element); printf("\n"); printf("Slider SFF status element offset :\n"); ofss(overall_disk_status); ofss(disk_status); ofss(overall_power_status); ofss(ps_status); ofss(overall_fan_status); ofss(fan_sets); ofss(overall_temp_sensor_status); ofss(temp_sensor_sets); ofss(overall_enc_service_ctrl_status); ofss(enc_service_ctrl_element); ofss(overall_encl_status); ofss(encl_element); ofss(overall_voltage_status); ofss(voltage_sensor_sets); ofss(overall_sas_expander_status); ofss(sas_expander_element); ofss(overall_sas_connector_status); ofss(sas_connector_status); ofss(overall_midplane_status); ofss(midplane_element_status); ofss(overall_phy_status); ofss(phy_sets); ofss(overall_ssb_status); ofss(ssb_element); ofss(overall_cpld_status); ofss(cpld_element); ofss(overall_input_power_status); ofss(input_power_element); printf("\n"); printf("Slider LFF cntrl element offset :\n"); ofcl(overall_disk_ctrl); ofcl(disk_ctrl); ofcl(overall_power_ctrl); ofcl(ps_ctrl); ofcl(overall_fan_ctrl); ofcl(fan_sets); ofcl(overall_temp_sensor_ctrl); ofcl(temp_sensor_sets); ofcl(overall_enc_service_ctrl_ctrl); ofcl(enc_service_ctrl_element); ofcl(overall_encl_ctrl); ofcl(encl_element); ofcl(overall_voltage_ctrl); ofcl(voltage_sensor_sets); ofcl(overall_sas_expander_ctrl); ofcl(sas_expander_element); ofcl(overall_sas_connector_ctrl); ofcl(sas_connector_ctrl); ofcl(overall_midplane_ctrl); ofcl(midplane_element_ctrl); ofcl(overall_phy_ctrl); ofcl(phy_sets); ofcl(overall_ssb_ctrl); ofcl(ssb_elemnet); ofcl(overall_cpld_ctrl); ofcl(cpld_ctrl_element); ofcl(overall_input_power_ctrl); ofcl(input_power_ctrl_element); printf("\n"); printf("Slider SFF cntrl element offset :\n"); ofcs(overall_disk_ctrl); ofcs(disk_ctrl); ofcs(overall_power_ctrl); ofcs(ps_ctrl); ofcs(overall_fan_ctrl); ofcs(fan_sets); ofcs(overall_temp_sensor_ctrl); ofcs(temp_sensor_sets); ofcs(overall_enc_service_ctrl_ctrl); ofcs(enc_service_ctrl_element); ofcs(overall_encl_ctrl); ofcs(encl_element); ofcs(overall_voltage_ctrl); ofcs(voltage_sensor_sets); ofcs(overall_sas_expander_ctrl); ofcs(sas_expander_element); ofcs(overall_sas_connector_ctrl); ofcs(sas_connector_ctrl); ofcs(overall_midplane_ctrl); ofcs(midplane_element_ctrl); ofcs(overall_phy_ctrl); ofcs(phy_sets); ofcs(overall_ssb_ctrl); ofcs(ssb_elemnet); ofcs(overall_cpld_ctrl); ofcs(cpld_ctrl_element); ofcs(overall_input_power_ctrl); ofcs(input_power_ctrl_element); exit(0); } ppc64-diag-2.7.4/diags/test/bluehawk.vpd0000644000000000000000000000005013135275400014627 000000000000005888 U5888.001.G123789 sn12345 fru67890 ppc64-diag-2.7.4/diags/test/homerun.vpd0000644000000000000000000000005013135275400014502 000000000000005887 U5887.001.G123789 sn12345 fru67890 ppc64-diag-2.7.4/diags/test/slider.vpd0000644000000000000000000000005013135275400014307 00000000000000ESLL UESLL.001.G123789 sn12345 fru67890 ppc64-diag-2.7.4/diags/test/run_tests0000755000000000000000000000326013135275400014274 00000000000000#!/bin/bash export RED='\e[0;31m' export GRN='\e[0;32m' export YLW='\e[0;33m' export NC='\e[0m' # No Colour export TSTDERR=`mktemp -d --tmpdir diag-run_tests.stderr.XXXXXXXXXX` export TSTDOUT=`mktemp -d --tmpdir diag-run_tests.stdout.XXXXXXXXXX` function run_binary { if [[ -x $1 ]] ; then $VALGRIND $1 $2 2>> $TSTDERR/$CUR_TEST.err 1>> $TSTDOUT/$CUR_TEST.out else echo "Fatal error, cannot execute binary '$1'. Did you make?"; rm -rf $TSTDERR $TSTDOUT exit 1; fi } function diff_with_result { # Explicitly diff 2 arbitrary file if [[ $# -eq 2 ]] ; then if ! diff -u $1 $2 ; then register_fail; fi # Explicitly diff a file with an arbitrary result file elif [[ $# -eq 1 ]] ; then if ! diff -u $RESULT $1 ; then register_fail; fi # Otherwise just diff result.out with stdout and result.err with stderr else if ! diff -u ${RESULT}.out $TSTDOUT/$CUR_TEST.out >> /dev/null ; then register_fail; fi if ! diff -u ${RESULT}.err $TSTDERR/$CUR_TEST.err >> /dev/null ; then register_fail; fi fi register_success; } function register_success { /bin/true } function register_fail { echo "FAIL $CUR_TEST "; rm -rf $TSTDERR $TSTDOUT exit ${1:-1}; } Q=0 all_tests="tests/*" while getopts ":qt:" opt; do case "$opt" in q) q=1 ;; t) all_tests=$OPTARG esac done for the_test in $all_tests; do export CUR_TEST=$(basename $the_test) export RESULT="tests-results/$CUR_TEST.result" if [[ $q -eq 1 ]] ; then source "$the_test" else source "$the_test" fi R=$? if [[ $R -ne 0 ]] ; then echo -e "${RED}$the_test FAILED with RC $R${NC}" exit $R fi #reset for next test rm $TSTDOUT/* rm $TSTDERR/* done rm -rf $TSTDERR $TSTDOUT echo PASS exit 0 ppc64-diag-2.7.4/diags/test/tests/0000755000000000000000000000000013135275400013541 500000000000000ppc64-diag-2.7.4/diags/test/tests/test-bh-001-structs0000644000000000000000000000043613135275400016760 00000000000000#!/bin/bash #WARNING: DO NOT RUN THIS FILE DIRECTLY # This file expects to be a part of ppc64-diag test suite # Run this file with ../run_tests -t test-bh-001-structs -q run_binary "./bh_structs" R=$? if [ $R -ne 0 ]; then register_fail $R; fi diff_with_result register_success ppc64-diag-2.7.4/diags/test/tests/test-bh-002-mk_healthy0000644000000000000000000000054713135275400017402 00000000000000#!/bin/bash #WARNING: DO NOT RUN THIS FILE DIRECTLY # This file expects to be a part of ppc64-diag test suite # Run this file with ../run_tests -t test-bh-002-mk_healthy -q run_binary "./bh_mk_healthy" "bluehawk_healthy.pg2" R=$? if [ $R -ne 0 ]; then register_fail $R; fi diff_with_result bluehawk_healthy.pg2 rm bluehawk_healthy.pg2 register_success ppc64-diag-2.7.4/diags/test/tests/test-bh-003-healthy_diag_encl0000644000000000000000000000105613135275400020675 00000000000000#!/bin/bash #WARNING: DO NOT RUN THIS FILE DIRECTLY # This file expects to be a part of ppc64-diag test suite # Run this file with ../run_tests -t test-bh-003-healthy_diag_encl -q #copying vpd file cp bluehawk.vpd bluehawk_healthy.vpd # Generate pg2 file run_binary "./bh_mk_healthy" "bluehawk_healthy.pg2" R=$? if [ $R -ne 0 ]; then register_fail $R; fi run_binary "./../diag_encl" "-v -f bluehawk_healthy.pg2 sg8" R=$? if [ $R -ne 0 ]; then register_fail $R; fi diff_with_result rm bluehawk_healthy.vpd rm bluehawk_healthy.pg2 register_success ppc64-diag-2.7.4/diags/test/tests/test-bh-004-mk_hot_power0000644000000000000000000000057313135275400017753 00000000000000#!/bin/bash #WARNING: DO NOT RUN THIS FILE DIRECTLY # This file expects to be a part of ppc64-diag test suite # Run this file with ../run_tests -t test-bh-004-mk_hot_power -q run_binary "./bh_mk_hot_power" "bluehawk_mk_hot_power.pg2" R=$? if [ $R -ne 0 ]; then register_fail $R; fi diff_with_result bluehawk_mk_hot_power.pg2 rm bluehawk_mk_hot_power.pg2 register_success ppc64-diag-2.7.4/diags/test/tests/test-bh-005-hot_power_diag_encl0000644000000000000000000000110013135275400021235 00000000000000#!/bin/bash #WARNING: DO NOT RUN THIS FILE DIRECTLY # This file expects to be a part of ppc64-diag test suite # Run this file with ../run_tests -t test-bh-005-hot_power_diag_encl -q # Copying fake VPD data cp bluehawk.vpd bluehawk_hot_power.vpd # Generate pg2 file run_binary "./bh_mk_hot_power" "bluehawk_hot_power.pg2" R=$? if [ $R -ne 0 ]; then register_fail $R; fi run_binary "./../diag_encl" "-v -f bluehawk_hot_power.pg2 sg8" R=$? if [ $R -ne 0 ]; then register_fail $R; fi diff_with_result rm bluehawk_hot_power.vpd rm bluehawk_hot_power.pg2 register_success ppc64-diag-2.7.4/diags/test/tests/test-hr-001-structs0000644000000000000000000000043613135275400017000 00000000000000#!/bin/bash #WARNING: DO NOT RUN THIS FILE DIRECTLY # This file expects to be a part of ppc64-diag test suite # Run this file with ../run_tests -t test-hr-001-structs -q run_binary "./hr_structs" R=$? if [ $R -ne 0 ]; then register_fail $R; fi diff_with_result register_success ppc64-diag-2.7.4/diags/test/tests/test-hr-002-mk_healthy0000644000000000000000000000054413135275400017417 00000000000000#!/bin/bash #WARNING: DO NOT RUN THIS FILE DIRECTLY # This file expects to be a part of ppc64-diag test suite # Run this file with ../run_tests -t test-hr-002-mk_healthy -q run_binary "./hr_mk_healthy" "homerun_healthy.pg2" R=$? if [ $R -ne 0 ]; then register_fail $R; fi diff_with_result homerun_healthy.pg2 rm homerun_healthy.pg2 register_success ppc64-diag-2.7.4/diags/test/tests/test-hr-003-healthy_diag_encl0000644000000000000000000000105013135275400020707 00000000000000#!/bin/bash #WARNING: DO NOT RUN THIS FILE DIRECTLY # This file expects to be a part of ppc64-diag test suite # Run this file with ../run_tests -t test-hr-003-healthy_diag_encl -q #copying vpd file cp homerun.vpd homerun_healthy.vpd # Generate pg2 file run_binary "./hr_mk_healthy" "homerun_healthy.pg2" R=$? if [ $R -ne 0 ]; then register_fail $R; fi run_binary "./../diag_encl" "-v -f homerun_healthy.pg2 sg8" R=$? if [ $R -ne 0 ]; then register_fail $R; fi diff_with_result rm homerun_healthy.vpd rm homerun_healthy.pg2 register_success ppc64-diag-2.7.4/diags/test/tests/test-hr-004-mk_hot_power0000644000000000000000000000057013135275400017770 00000000000000#!/bin/bash #WARNING: DO NOT RUN THIS FILE DIRECTLY # This file expects to be a part of ppc64-diag test suite # Run this file with ../run_tests -t test-hr-004-mk_hot_power -q run_binary "./hr_mk_hot_power" "homerun_mk_hot_power.pg2" R=$? if [ $R -ne 0 ]; then register_fail $R; fi diff_with_result homerun_mk_hot_power.pg2 rm homerun_mk_hot_power.pg2 register_success ppc64-diag-2.7.4/diags/test/tests/test-hr-005-hot_power_diag_encl0000644000000000000000000000107213135275400021265 00000000000000#!/bin/bash #WARNING: DO NOT RUN THIS FILE DIRECTLY # This file expects to be a part of ppc64-diag test suite # Run this file with ../run_tests -t test-hr-005-hot_power_diag_encl -q # Copying fake VPD data cp homerun.vpd homerun_hot_power.vpd # Generate pg2 file run_binary "./hr_mk_hot_power" "homerun_hot_power.pg2" R=$? if [ $R -ne 0 ]; then register_fail $R; fi run_binary "./../diag_encl" "-v -f homerun_hot_power.pg2 sg8" R=$? if [ $R -ne 0 ]; then register_fail $R; fi diff_with_result rm homerun_hot_power.vpd rm homerun_hot_power.pg2 register_success ppc64-diag-2.7.4/diags/test/tests/test-slider-001-structs0000644000000000000000000000044613135275400017652 00000000000000#!/bin/bash #WARNING: DO NOT RUN THIS FILE DIRECTLY # This file expects to be a part of ppc64-diag test suite # Run this file with ../run_tests -t test-slider-001-structs -q run_binary "./slider_structs" R=$? if [ $R -ne 0 ]; then register_fail $R; fi diff_with_result register_success ppc64-diag-2.7.4/diags/test/tests/test-slider-002-mk_healthy0000644000000000000000000000056513135275400020273 00000000000000#!/bin/bash #WARNING: DO NOT RUN THIS FILE DIRECTLY # This file expects to be a part of ppc64-diag test suite # Run this file with ../run_tests -t test-slider-002-mk_healthy -q run_binary "./slider_mk_healthy" "slider_lff_healthy.pg2" R=$? if [ $R -ne 0 ]; then register_fail $R; fi diff_with_result slider_lff_healthy.pg2 rm slider_lff_healthy.pg2 register_success ppc64-diag-2.7.4/diags/test/tests/test-slider-003-healthy_diag_encl0000644000000000000000000000105213135275400021562 00000000000000#!/bin/bash #WARNING: DO NOT RUN THIS FILE DIRECTLY # This file expects to be a part of ppc64-diag test suite # Run this file with ../run_tests -t test-slider-003-healthy_diag_encl -q #copying vpd file cp slider.vpd slider_healthy.vpd # Generate pg2 file run_binary "./slider_mk_healthy" "slider_healthy.pg2" R=$? if [ $R -ne 0 ]; then register_fail $R; fi run_binary "./../diag_encl" "-v -f slider_healthy.pg2 sg8" R=$? if [ $R -ne 0 ]; then register_fail $R; fi diff_with_result rm slider_healthy.vpd rm slider_healthy.pg2 register_success ppc64-diag-2.7.4/diags/test/tests/test-slider-004-mk_hot_power0000644000000000000000000000057513135275400020646 00000000000000#!/bin/bash #WARNING: DO NOT RUN THIS FILE DIRECTLY # This file expects to be a part of ppc64-diag test suite # Run this file with ../run_tests -t test-slider-004-mk_hot_power -q run_binary "./slider_mk_hot_power" "slider_mk_hot_power.pg2" R=$? if [ $R -ne 0 ]; then register_fail $R; fi diff_with_result slider_mk_hot_power.pg2 rm slider_mk_hot_power.pg2 register_success ppc64-diag-2.7.4/diags/test/tests/test-slider-005-hot_power_diag_encl0000644000000000000000000000107413135275400022140 00000000000000#!/bin/bash #WARNING: DO NOT RUN THIS FILE DIRECTLY # This file expects to be a part of ppc64-diag test suite # Run this file with ../run_tests -t test-slider-005-hot_power_diag_encl -q # Copying fake VPD data cp slider.vpd slider_hot_power.vpd # Generate pg2 file run_binary "./slider_mk_hot_power" "slider_hot_power.pg2" R=$? if [ $R -ne 0 ]; then register_fail $R; fi run_binary "./../diag_encl" "-v -f slider_hot_power.pg2 sg8" R=$? if [ $R -ne 0 ]; then register_fail $R; fi diff_with_result rm slider_hot_power.vpd rm slider_hot_power.pg2 register_success ppc64-diag-2.7.4/diags/test/tests-results/0000755000000000000000000000000013135275400015240 500000000000000ppc64-diag-2.7.4/diags/test/tests-results/test-bh-001-structs.result.err0000644000000000000000000000000013135275400022546 00000000000000ppc64-diag-2.7.4/diags/test/tests-results/test-bh-001-structs.result.out0000644000000000000000000000270313135275400022601 00000000000000element_status_byte0 1 overall_disk_status_byte1 1 disk_element_status_byte1 1 disk_status 4 enclosure_status 4 esm_status 4 temperature_sensor_status 4 temperature_sensor_set 28 fan_status 4 fan_set 20 power_supply_status 4 voltage_sensor_status 4 voltage_sensor_set 8 sas_connector_status 4 scc_controller_overall_status 4 scc_controller_element_status 4 midplane_status 4 bluehawk_diag_page2 328 overall_disk_status 8 disk_status 12 overall_enclosure_status 132 enclosure_element_status 136 overall_esm_status 140 esm_status 144 overall_temp_sensor_status 152 temp_sensor_sets 156 overall_fan_status 212 fan_sets 216 overall_power_status 256 ps_status 260 overall_voltage_status 268 voltage_sensor_sets 272 overall_sas_connector_status 288 sas_connector_status 292 overall_scc_controller_status 308 scc_controller_status 312 overall_midplane_status 320 midplane_element_status 324 common_ctrl 1 disk_ctrl 4 enclosure_ctrl 4 esm_ctrl 4 fan_ctrl 4 fan_ctrl_set 20 power_supply_ctrl 4 sas_connector_ctrl 4 scc_controller_ctrl 4 midplane_ctrl 4 bluehawk_ctrl_page2 328 overall_disk_ctrl 8 disk_ctrl 12 overall_enclosure_ctrl 132 enclosure_element_ctrl 136 overall_esm_ctrl 140 esm_ctrl 144 temperature_sensor_ctrl 152 overall_fan_ctrl 212 fan_sets 216 overall_power_ctrl 256 ps_ctrl 260 voltage_sensor_ctrl 268 overall_sas_connector_ctrl 288 sas_connector_ctrl 292 overall_scc_controller_ctrl 308 scc_controller_ctrl 312 overall_midplane_ctrl 320 midplane_element_ctrl 324 ppc64-diag-2.7.4/diags/test/tests-results/test-bh-002-mk_healthy.result0000644000000000000000000000051013135275400022404 00000000000000D@€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œ€€€(((((((((((((((€ƒƒƒƒƒƒƒƒƒƒ€€€°^°^ÿÿÿÿÿppc64-diag-2.7.4/diags/test/tests-results/test-bh-003-healthy_diag_encl.result.err0000644000000000000000000000000013135275400024464 00000000000000ppc64-diag-2.7.4/diags/test/tests-results/test-bh-003-healthy_diag_encl.result.out0000644000000000000000000000775113135275400024527 00000000000000DIAGNOSING sg8 Model : 5888 Location : U5888.001.G123789 Overall Status: ok Drive Status Disk 01 (Slot 00): ok Disk 02 (Slot 01): ok Disk 03 (Slot 02): ok Disk 04 (Slot 03): ok Disk 05 (Slot 04): ok Disk 06 (Slot 05): ok Disk 07 (Slot 06): ok Disk 08 (Slot 07): ok Disk 09 (Slot 08): ok Disk 10 (Slot 09): ok Disk 11 (Slot 10): ok Disk 12 (Slot 11): ok Disk 13 (Slot 12): ok Disk 14 (Slot 13): ok Disk 15 (Slot 14): ok Disk 16 (Slot 15): ok Disk 17 (Slot 16): ok Disk 18 (Slot 17): ok Disk 19 (Slot 18): ok Disk 20 (Slot 19): ok Disk 21 (Slot 20): ok Disk 22 (Slot 21): ok Disk 23 (Slot 22): ok Disk 24 (Slot 23): ok Disk 25 (Slot 24): ok Disk 26 (Slot 25): ok Disk 27 (Slot 26): ok Disk 28 (Slot 27): ok Disk 29 (Slot 28): ok Disk 30 (Slot 29): ok Power Supply Status PS0 (Left): ok 12V: ok | VOLTAGE = 12.00 volts 3.3VA: ok | VOLTAGE = 3.50 volts PS1 (Right): ok 12V: ok | VOLTAGE = 12.00 volts 3.3VA: ok | VOLTAGE = 3.50 volts Fan Status Left Fan Assembly: Power Supply: ok | Fan at 34-49% of highest speed Fan Element 0: ok | Fan at 34-49% of highest speed Fan Element 1: ok | Fan at 34-49% of highest speed Fan Element 2: ok | Fan at 34-49% of highest speed Fan Element 3: ok | Fan at 34-49% of highest speed Right Fan Assembly: Power Supply: ok | Fan at 34-49% of highest speed Fan Element 0: ok | Fan at 34-49% of highest speed Fan Element 1: ok | Fan at 34-49% of highest speed Fan Element 2: ok | Fan at 34-49% of highest speed Fan Element 3: ok | Fan at 34-49% of highest speed Temperature Sensors Left: CRoC: ok | TEMPERATURE = 20C PPC: ok | TEMPERATURE = 20C Expander: ok | TEMPERATURE = 20C Ambient 0: ok | TEMPERATURE = 20C Ambient 1: ok | TEMPERATURE = 20C Power Supply 0: ok | TEMPERATURE = 20C Power Supply 1: ok | TEMPERATURE = 20C Right: CRoC: ok | TEMPERATURE = 20C PPC: ok | TEMPERATURE = 20C Expander: ok | TEMPERATURE = 20C Ambient 0: ok | TEMPERATURE = 20C Ambient 1: ok | TEMPERATURE = 20C Power Supply 0: ok | TEMPERATURE = 20C Power Supply 1: ok | TEMPERATURE = 20C Enclosure Status: ok ERM Electronics Status Left: ok Right: ok SAS Connector Status Left - T1: ok Left - T2: ok Right - T1: ok Right - T2: ok PCIe Controller Status Left: ok Right: ok Midplane Status: ok Raw diagnostic page: 0x0000: 02000144 00000000 01400000 01800000 [...D.....@......] 0x0010: 01810000 01820000 01830000 01840000 [................] 0x0020: 01850000 01860000 01870000 01880000 [................] 0x0030: 01890000 018a0000 018b0000 018c0000 [................] 0x0040: 018d0000 018e0000 018f0000 01900000 [................] 0x0050: 01910000 01920000 01930000 01940000 [................] 0x0060: 01950000 01960000 01970000 01980000 [................] 0x0070: 01990000 019a0000 019b0000 019c0000 [................] 0x0080: 019d0000 01000000 01000000 01000080 [................] 0x0090: 01000080 01000080 01002800 01002800 [..........(...(.] 0x00a0: 01002800 01002800 01002800 01002800 [..(...(...(...(.] 0x00b0: 01002800 01002800 01002800 01002800 [..(...(...(...(.] 0x00c0: 01002800 01002800 01002800 01002800 [..(...(...(...(.] 0x00d0: 01002800 01000080 01000083 01000083 [..(.............] 0x00e0: 01000083 01000083 01000083 01000083 [................] 0x00f0: 01000083 01000083 01000083 01000083 [................] 0x0100: 01000080 01000080 01000080 01000000 [................] 0x0110: 010004b0 0100015e 010004b0 0100015e [.......^.......^] 0x0120: 0105ff00 0105ff00 0105ff00 0105ff00 [................] 0x0130: 0105ff00 01000000 01000000 01000000 [................] 0x0140: 00000000 01000000 [........ ] ppc64-diag-2.7.4/diags/test/tests-results/test-bh-004-mk_hot_power.result0000644000000000000000000000051013135275400022756 00000000000000D@€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œ€€€-((((((((((((PP€ƒƒƒƒƒÁƒƒƒƒ€€À°^°^ÿÿÿÿÿppc64-diag-2.7.4/diags/test/tests-results/test-bh-005-hot_power_diag_encl.result.err0000644000000000000000000000000013135275400025036 00000000000000ppc64-diag-2.7.4/diags/test/tests-results/test-bh-005-hot_power_diag_encl.result.out0000644000000000000000000001030413135275400025065 00000000000000DIAGNOSING sg8 Model : 5888 Location : U5888.001.G123789 Overall Status: NON_CRITICAL_FAULT Drive Status Disk 01 (Slot 00): ok Disk 02 (Slot 01): ok Disk 03 (Slot 02): ok Disk 04 (Slot 03): ok Disk 05 (Slot 04): ok Disk 06 (Slot 05): ok Disk 07 (Slot 06): ok Disk 08 (Slot 07): ok Disk 09 (Slot 08): ok Disk 10 (Slot 09): ok Disk 11 (Slot 10): ok Disk 12 (Slot 11): ok Disk 13 (Slot 12): ok Disk 14 (Slot 13): ok Disk 15 (Slot 14): ok Disk 16 (Slot 15): ok Disk 17 (Slot 16): ok Disk 18 (Slot 17): ok Disk 19 (Slot 18): ok Disk 20 (Slot 19): ok Disk 21 (Slot 20): ok Disk 22 (Slot 21): ok Disk 23 (Slot 22): ok Disk 24 (Slot 23): ok Disk 25 (Slot 24): ok Disk 26 (Slot 25): ok Disk 27 (Slot 26): ok Disk 28 (Slot 27): ok Disk 29 (Slot 28): ok Disk 30 (Slot 29): ok Power Supply Status PS0 (Left): ok 12V: ok | VOLTAGE = 12.00 volts 3.3VA: ok | VOLTAGE = 3.50 volts PS1 (Right): NON_CRITICAL_FAULT | DC_OVER_VOLTAGE | FAULT_LED 12V: NON_CRITICAL_FAULT | NON_CRITICAL_OVER_VOLTAGE | VOLTAGE = 12.00 volts 3.3VA: ok | VOLTAGE = 3.50 volts Fan Status Left Fan Assembly: Power Supply: ok | Fan at 34-49% of highest speed Fan Element 0: ok | Fan at 34-49% of highest speed Fan Element 1: ok | Fan at 34-49% of highest speed Fan Element 2: ok | Fan at 34-49% of highest speed Fan Element 3: ok | Fan at 34-49% of highest speed Right Fan Assembly: Power Supply: NON_CRITICAL_FAULT | FAULT_LED | Fan at 1-16% of highest speed Fan Element 0: ok | Fan at 34-49% of highest speed Fan Element 1: ok | Fan at 34-49% of highest speed Fan Element 2: ok | Fan at 34-49% of highest speed Fan Element 3: ok | Fan at 34-49% of highest speed Temperature Sensors Left: CRoC: ok | TEMPERATURE = 20C PPC: ok | TEMPERATURE = 20C Expander: ok | TEMPERATURE = 20C Ambient 0: ok | TEMPERATURE = 20C Ambient 1: ok | TEMPERATURE = 20C Power Supply 0: ok | TEMPERATURE = 20C Power Supply 1: ok | TEMPERATURE = 20C Right: CRoC: ok | TEMPERATURE = 20C PPC: ok | TEMPERATURE = 20C Expander: ok | TEMPERATURE = 20C Ambient 0: ok | TEMPERATURE = 20C Ambient 1: ok | TEMPERATURE = 20C Power Supply 0: NON_CRITICAL_FAULT | OVER_TEMPERATURE_WARNING | TEMPERATURE = 60C Power Supply 1: NON_CRITICAL_FAULT | OVER_TEMPERATURE_WARNING | TEMPERATURE = 60C Enclosure Status: ok ERM Electronics Status Left: ok Right: ok SAS Connector Status Left - T1: ok Left - T2: ok Right - T1: ok Right - T2: ok PCIe Controller Status Left: ok Right: ok Midplane Status: ok Raw diagnostic page: 0x0000: 02040144 00000000 01400000 01800000 [...D.....@......] 0x0010: 01810000 01820000 01830000 01840000 [................] 0x0020: 01850000 01860000 01870000 01880000 [................] 0x0030: 01890000 018a0000 018b0000 018c0000 [................] 0x0040: 018d0000 018e0000 018f0000 01900000 [................] 0x0050: 01910000 01920000 01930000 01940000 [................] 0x0060: 01950000 01960000 01970000 01980000 [................] 0x0070: 01990000 019a0000 019b0000 019c0000 [................] 0x0080: 019d0000 01000000 01000000 01000080 [................] 0x0090: 01000080 01000080 01002d00 01002800 [..........-...(.] 0x00a0: 01002800 01002800 01002800 01002800 [..(...(...(...(.] 0x00b0: 01002800 01002800 01002800 01002800 [..(...(...(...(.] 0x00c0: 01002800 01002800 01002800 03005004 [..(...(...(...P.] 0x00d0: 03005004 01000080 01000083 01000083 [..P.............] 0x00e0: 01000083 01000083 01000083 030000c1 [................] 0x00f0: 01000083 01000083 01000083 01000083 [................] 0x0100: 01000080 01000080 030008c0 01000000 [................] 0x0110: 010004b0 0100015e 030804b0 0100015e [.......^.......^] 0x0120: 0105ff00 0105ff00 0105ff00 0105ff00 [................] 0x0130: 0105ff00 01000000 01000000 01000000 [................] 0x0140: 00000000 01000000 [........ ] ppc64-diag-2.7.4/diags/test/tests-results/test-hr-001-structs.result.err0000644000000000000000000000000013135275400022566 00000000000000ppc64-diag-2.7.4/diags/test/tests-results/test-hr-001-structs.result.out0000644000000000000000000000176413135275400022627 00000000000000element_status_byte0 1 overall_disk_status_byte1 1 disk_element_status_byte1 1 disk_status 4 enclosure_status 4 esm_status 4 temperature_sensor_status 4 hr_temperature_sensor_set 16 fan_status 4 hr_fan_set 32 power_supply_status 4 voltage_sensor_status 4 hr_voltage_sensor_set 12 hr_diag_page2 272 overall_disk_status 8 disk_status 12 overall_enclosure_status 108 enclosure_element_status 112 overall_esm_status 116 esm_status 120 temp_sensor_overall_status 128 temp_sensor_sets 132 cooling_element_overall_status 164 fan_sets 168 power_supply_overall_status 232 ps_status 236 voltage_sensor_overall_status 244 voltage_sensor_sets 248 common_ctrl 1 hr_disk_ctrl 4 enclosure_ctrl 4 esm_ctrl 4 fan_ctrl 4 hr_fan_ctrl_set 32 power_supply_ctrl 4 hr_ctrl_page2 272 overall_disk_ctrl 8 disk_ctrl 12 overall_enclosure_ctrl 108 enclosure_element_ctrl 112 overall_esm_ctrl 116 esm_ctrl 120 temperature_sensor_ctrl 128 overall_fan_ctrl 164 fan_sets 168 overall_power_supply_ctrl 232 ps_ctrl 236 voltage_sensor_ctrl 244 ppc64-diag-2.7.4/diags/test/tests-results/test-hr-002-mk_healthy.result0000644000000000000000000000042013135275400022424 00000000000000D@€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—€€€(((((((((€ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ€€€°&&°&&ppc64-diag-2.7.4/diags/test/tests-results/test-hr-003-healthy_diag_encl.result.err0000644000000000000000000000000013135275400024504 00000000000000ppc64-diag-2.7.4/diags/test/tests-results/test-hr-003-healthy_diag_encl.result.out0000644000000000000000000000726013135275400024542 00000000000000DIAGNOSING sg8 Model : 5887 Location : U5887.001.G123789 Overall Status: ok Drive Status Disk 01 (Slot 00): ok Disk 02 (Slot 01): ok Disk 03 (Slot 02): ok Disk 04 (Slot 03): ok Disk 05 (Slot 04): ok Disk 06 (Slot 05): ok Disk 07 (Slot 06): ok Disk 08 (Slot 07): ok Disk 09 (Slot 08): ok Disk 10 (Slot 09): ok Disk 11 (Slot 10): ok Disk 12 (Slot 11): ok Disk 13 (Slot 12): ok Disk 14 (Slot 13): ok Disk 15 (Slot 14): ok Disk 16 (Slot 15): ok Disk 17 (Slot 16): ok Disk 18 (Slot 17): ok Disk 19 (Slot 18): ok Disk 20 (Slot 19): ok Disk 21 (Slot 20): ok Disk 22 (Slot 21): ok Disk 23 (Slot 22): ok Disk 24 (Slot 23): ok Power Supply Status PS0 (Left): ok 12V: ok | VOLTAGE = 12.00 volts 5V: ok | VOLTAGE = 5.50 volts 5VA: ok | VOLTAGE = 5.50 volts PS1 (Right): ok 12V: ok | VOLTAGE = 12.00 volts 5V: ok | VOLTAGE = 5.50 volts 5VA: ok | VOLTAGE = 5.50 volts Fan Status Left Cooling Assembly: Fan Element 0: ok | Fan at third lowest speed Fan Element 1: ok | Fan at third lowest speed Fan Element 2: ok | Fan at third lowest speed Fan Element 3: ok | Fan at third lowest speed Fan Element 4: ok | Fan at third lowest speed Fan Element 5: ok | Fan at third lowest speed Fan Element 6: ok | Fan at third lowest speed Fan Element 7: ok | Fan at third lowest speed Right Cooling Assembly: Fan Element 0: ok | Fan at third lowest speed Fan Element 1: ok | Fan at third lowest speed Fan Element 2: ok | Fan at third lowest speed Fan Element 3: ok | Fan at third lowest speed Fan Element 4: ok | Fan at third lowest speed Fan Element 5: ok | Fan at third lowest speed Fan Element 6: ok | Fan at third lowest speed Fan Element 7: ok | Fan at third lowest speed Temperature Sensors Left Temperature Sensor Controller: ok | TEMPERATURE = 20C Temperature Sensor Power Supply 0L: ok | TEMPERATURE = 20C Temperature Sensor Power Supply 1L: ok | TEMPERATURE = 20C Temperature Sensor Power Supply 2L: ok | TEMPERATURE = 20C Right Temperature Sensor Controller: ok | TEMPERATURE = 20C Temperature Sensor Power Supply 0R: ok | TEMPERATURE = 20C Temperature Sensor Power Supply 1R: ok | TEMPERATURE = 20C Temperature Sensor Power Supply 2R: ok | TEMPERATURE = 20C Enclosure Status: ok ESM Electronics Status: Left: ok Right: ok Raw diagnostic page: 0x0000: 02000144 00000000 01400000 01800000 [...D.....@......] 0x0010: 01810000 01820000 01830000 01840000 [................] 0x0020: 01850000 01860000 01870000 01880000 [................] 0x0030: 01890000 018a0000 018b0000 018c0000 [................] 0x0040: 018d0000 018e0000 018f0000 01900000 [................] 0x0050: 01910000 01920000 01930000 01940000 [................] 0x0060: 01950000 01960000 01970000 01000000 [................] 0x0070: 01000000 01000080 01000080 01000080 [................] 0x0080: 01002800 01002800 01002800 01002800 [..(...(...(...(.] 0x0090: 01002800 01002800 01002800 01002800 [..(...(...(...(.] 0x00a0: 01002800 01000080 01000083 01000083 [..(.............] 0x00b0: 01000083 01000083 01000083 01000083 [................] 0x00c0: 01000083 01000083 01000083 01000083 [................] 0x00d0: 01000083 01000083 01000083 01000083 [................] 0x00e0: 01000083 01000083 01000080 01000080 [................] 0x00f0: 01000080 01000000 010004b0 01000226 [...............&] 0x0100: 01000226 010004b0 01000226 01000226 [...&.......&...&] ppc64-diag-2.7.4/diags/test/tests-results/test-hr-004-mk_hot_power.result0000644000000000000000000000042013135275400022776 00000000000000D@€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—€€€7(((((PPP€ƒƒƒƒƒƒƒƒƒÁƒƒƒƒƒƒ€€À°&&°&&ppc64-diag-2.7.4/diags/test/tests-results/test-hr-005-hot_power_diag_encl.result.err0000644000000000000000000000000013135275400025056 00000000000000ppc64-diag-2.7.4/diags/test/tests-results/test-hr-005-hot_power_diag_encl.result.out0000644000000000000000000000766113135275400025121 00000000000000DIAGNOSING sg8 Model : 5887 Location : U5887.001.G123789 Overall Status: NON_CRITICAL_FAULT Drive Status Disk 01 (Slot 00): ok Disk 02 (Slot 01): ok Disk 03 (Slot 02): ok Disk 04 (Slot 03): ok Disk 05 (Slot 04): ok Disk 06 (Slot 05): ok Disk 07 (Slot 06): ok Disk 08 (Slot 07): ok Disk 09 (Slot 08): ok Disk 10 (Slot 09): ok Disk 11 (Slot 10): ok Disk 12 (Slot 11): ok Disk 13 (Slot 12): ok Disk 14 (Slot 13): ok Disk 15 (Slot 14): ok Disk 16 (Slot 15): ok Disk 17 (Slot 16): ok Disk 18 (Slot 17): ok Disk 19 (Slot 18): ok Disk 20 (Slot 19): ok Disk 21 (Slot 20): ok Disk 22 (Slot 21): ok Disk 23 (Slot 22): ok Disk 24 (Slot 23): ok Power Supply Status PS0 (Left): ok 12V: ok | VOLTAGE = 12.00 volts 5V: ok | VOLTAGE = 5.50 volts 5VA: ok | VOLTAGE = 5.50 volts PS1 (Right): NON_CRITICAL_FAULT | DC_OVER_VOLTAGE | FAULT_LED 12V: NON_CRITICAL_FAULT | NON_CRITICAL_OVER_VOLTAGE | VOLTAGE = 12.00 volts 5V: ok | VOLTAGE = 5.50 volts 5VA: ok | VOLTAGE = 5.50 volts Fan Status Left Cooling Assembly: Fan Element 0: ok | Fan at third lowest speed Fan Element 1: ok | Fan at third lowest speed Fan Element 2: ok | Fan at third lowest speed Fan Element 3: ok | Fan at third lowest speed Fan Element 4: ok | Fan at third lowest speed Fan Element 5: ok | Fan at third lowest speed Fan Element 6: ok | Fan at third lowest speed Fan Element 7: ok | Fan at third lowest speed Right Cooling Assembly: Fan Element 0: ok | Fan at third lowest speed Fan Element 1: NON_CRITICAL_FAULT | FAULT_LED | Fan at lowest speed Fan Element 2: ok | Fan at third lowest speed Fan Element 3: ok | Fan at third lowest speed Fan Element 4: ok | Fan at third lowest speed Fan Element 5: ok | Fan at third lowest speed Fan Element 6: ok | Fan at third lowest speed Fan Element 7: ok | Fan at third lowest speed Temperature Sensors Left Temperature Sensor Controller: ok | TEMPERATURE = 20C Temperature Sensor Power Supply 0L: ok | TEMPERATURE = 20C Temperature Sensor Power Supply 1L: ok | TEMPERATURE = 20C Temperature Sensor Power Supply 2L: ok | TEMPERATURE = 20C Right Temperature Sensor Controller: ok | TEMPERATURE = 20C Temperature Sensor Power Supply 0R: NON_CRITICAL_FAULT | OVER_TEMPERATURE_WARNING | TEMPERATURE = 60C Temperature Sensor Power Supply 1R: NON_CRITICAL_FAULT | OVER_TEMPERATURE_WARNING | TEMPERATURE = 60C Temperature Sensor Power Supply 2R: NON_CRITICAL_FAULT | OVER_TEMPERATURE_WARNING | TEMPERATURE = 60C Enclosure Status: ok ESM Electronics Status: Left: ok Right: ok Raw diagnostic page: 0x0000: 02040144 00000000 01400000 01800000 [...D.....@......] 0x0010: 01810000 01820000 01830000 01840000 [................] 0x0020: 01850000 01860000 01870000 01880000 [................] 0x0030: 01890000 018a0000 018b0000 018c0000 [................] 0x0040: 018d0000 018e0000 018f0000 01900000 [................] 0x0050: 01910000 01920000 01930000 01940000 [................] 0x0060: 01950000 01960000 01970000 01000000 [................] 0x0070: 01000000 01000080 01000080 01000080 [................] 0x0080: 01003700 01002800 01002800 01002800 [..7...(...(...(.] 0x0090: 01002800 01002800 03005004 03005004 [..(...(...P...P.] 0x00a0: 03005004 01000080 01000083 01000083 [..P.............] 0x00b0: 01000083 01000083 01000083 01000083 [................] 0x00c0: 01000083 01000083 01000083 030000c1 [................] 0x00d0: 01000083 01000083 01000083 01000083 [................] 0x00e0: 01000083 01000083 01000080 01000080 [................] 0x00f0: 030008c0 01000000 010004b0 01000226 [...............&] 0x0100: 01000226 030804b0 01000226 01000226 [...&.......&...&] ppc64-diag-2.7.4/diags/test/tests-results/test-slider-001-structs.result.err0000644000000000000000000000000013135275400023437 00000000000000ppc64-diag-2.7.4/diags/test/tests-results/test-slider-001-structs.result.out0000644000000000000000000000734013135275400023474 00000000000000 Slider LFF/SFF status structure size : element_status_byte0 1 slider_disk_status 4 power_supply_status 4 fan_status 4 slider_fan_set 32 temperature_sensor_status 4 slider_enc_service_ctrl_status 4 enclosure_status 4 voltage_sensor_status 4 slider_voltage_sensor_set 16 slider_sas_expander_status 4 slider_sas_connector_status 4 slider_midplane_status 4 slider_phy_status 4 slider_phy_set 144 slider_statesave_buffer_status 4 slider_cpld_status 4 slider_input_power_status 4 slider_lff_diag_page2 628 slider_sff_diag_page2 676 Slider LFF/SFF cntrl structure size : common_ctrl 1 slider_disk_ctrl 4 slider_power_supply_ctrl 4 fan_ctrl 4 slider_fan_ctrl_set 32 slider_temperature_sensor_ctrl 4 slider_temperature_sensor_ctrl_set 44 esm_ctrl 4 enclosure_ctrl 4 slider_voltage_sensor_ctrl 4 slider_voltage_sensor_ctrl_set 16 slider_sas_expander_ctrl 4 slider_sas_connector_ctrl 4 slider_midplane_ctrl 4 slider_phy_ctrl 4 slider_phy_ctrl_set 144 slider_statesave_buffer_ctrl 4 slider_cpld_ctrl 4 slider_input_power_ctrl 4 slider_lff_ctrl_page2 628 slider_sff_ctrl_page2 676 Slider LFF status element offset : overall_disk_status 8 disk_status 12 overall_power_status 60 ps_status 64 overall_fan_status 72 fan_sets 76 overall_temp_sensor_status 140 temp_sensor_sets 144 overall_enc_service_ctrl_status 188 enc_service_ctrl_element 192 overall_encl_status 200 encl_element 204 overall_voltage_status 208 voltage_sensor_sets 212 overall_sas_expander_status 244 sas_expander_element 248 overall_sas_connector_status 256 sas_connector_status 260 overall_midplane_status 284 midplane_element_status 288 overall_phy_status 292 phy_sets 296 overall_ssb_status 584 ssb_element 588 overall_cpld_status 596 cpld_element 600 overall_input_power_status 608 input_power_element 612 Slider SFF status element offset : overall_disk_status 8 disk_status 12 overall_power_status 108 ps_status 112 overall_fan_status 120 fan_sets 124 overall_temp_sensor_status 188 temp_sensor_sets 192 overall_enc_service_ctrl_status 236 enc_service_ctrl_element 240 overall_encl_status 248 encl_element 252 overall_voltage_status 256 voltage_sensor_sets 260 overall_sas_expander_status 292 sas_expander_element 296 overall_sas_connector_status 304 sas_connector_status 308 overall_midplane_status 332 midplane_element_status 336 overall_phy_status 340 phy_sets 344 overall_ssb_status 632 ssb_element 636 overall_cpld_status 644 cpld_element 648 overall_input_power_status 656 input_power_element 660 Slider LFF cntrl element offset : overall_disk_ctrl 8 disk_ctrl 12 overall_power_ctrl 60 ps_ctrl 64 overall_fan_ctrl 72 fan_sets 76 overall_temp_sensor_ctrl 140 temp_sensor_sets 144 overall_enc_service_ctrl_ctrl 188 enc_service_ctrl_element 192 overall_encl_ctrl 200 encl_element 204 overall_voltage_ctrl 208 voltage_sensor_sets 212 overall_sas_expander_ctrl 244 sas_expander_element 248 overall_sas_connector_ctrl 256 sas_connector_ctrl 260 overall_midplane_ctrl 284 midplane_element_ctrl 288 overall_phy_ctrl 292 phy_sets 296 overall_ssb_ctrl 584 ssb_elemnet 588 overall_cpld_ctrl 596 cpld_ctrl_element 600 overall_input_power_ctrl 608 input_power_ctrl_element 612 Slider SFF cntrl element offset : overall_disk_ctrl 8 disk_ctrl 12 overall_power_ctrl 108 ps_ctrl 112 overall_fan_ctrl 120 fan_sets 124 overall_temp_sensor_ctrl 188 temp_sensor_sets 192 overall_enc_service_ctrl_ctrl 236 enc_service_ctrl_element 240 overall_encl_ctrl 248 encl_element 252 overall_voltage_ctrl 256 voltage_sensor_sets 260 overall_sas_expander_ctrl 292 sas_expander_element 296 overall_sas_connector_ctrl 304 sas_connector_ctrl 308 overall_midplane_ctrl 332 midplane_element_ctrl 336 overall_phy_ctrl 340 phy_sets 344 overall_ssb_ctrl 632 ssb_elemnet 636 overall_cpld_ctrl 644 cpld_ctrl_element 648 overall_input_power_ctrl 656 input_power_ctrl_element 660 ppc64-diag-2.7.4/diags/test/tests-results/test-slider-002-mk_healthy.result0000644000000000000000000000116413135275400023303 00000000000000p   {{{{{{{{{{{{{{{{{((((((((((((^d´Z^d´ZÿÿÿÿÿÿÿÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀppc64-diag-2.7.4/diags/test/tests-results/test-slider-003-healthy_diag_encl.result.err0000644000000000000000000000000013135275400025355 00000000000000ppc64-diag-2.7.4/diags/test/tests-results/test-slider-003-healthy_diag_encl.result.out0000644000000000000000000002005513135275400025410 00000000000000DIAGNOSING sg8 Model : ESLL Location : UESLL.001.G123789 Overall Status: ok Drive Status Disk 01 (Slot 00): ok Disk 02 (Slot 01): ok Disk 03 (Slot 02): ok Disk 04 (Slot 03): ok Disk 05 (Slot 04): ok Disk 06 (Slot 05): ok Disk 07 (Slot 06): ok Disk 08 (Slot 07): ok Disk 09 (Slot 08): ok Disk 10 (Slot 09): ok Disk 11 (Slot 10): ok Disk 12 (Slot 11): ok Power Supply Status PS0 (Left ): ok 3.3V: ok | VOLTAGE = 3.50 volts 1V0 : ok | VOLTAGE = 1.00 volts 1V8 : ok | VOLTAGE = 1.80 volts 0V92: ok | VOLTAGE = 0.90 volts PS1 (Right): ok 3.3V: ok | VOLTAGE = 3.50 volts 1V0 : ok | VOLTAGE = 1.00 volts 1V8 : ok | VOLTAGE = 1.80 volts 0V92: ok | VOLTAGE = 0.90 volts Fan Status Left power supply fans Fan Element 1: ok | speed :11470 rpm Fan Element 2: ok | speed :11470 rpm Fan Element 3: ok | speed :11470 rpm Fan Element 4: ok | speed :11470 rpm Fan Element 5: ok | speed :11470 rpm Fan Element 6: ok | speed :11470 rpm Fan Element 7: ok | speed :11470 rpm Fan Element 8: ok | speed :11470 rpm Right power supply fans Fan Element 1: ok | speed :11470 rpm Fan Element 2: ok | speed :11470 rpm Fan Element 3: ok | speed :11470 rpm Fan Element 4: ok | speed :11470 rpm Fan Element 5: ok | speed :11470 rpm Fan Element 6: ok | speed :11470 rpm Fan Element 7: ok | speed :11470 rpm Fan Element 8: ok | speed :11470 rpm Temperature Sensors Enclosure Ambient air: ok | TEMPERATURE = 20C PSU1: Temp sensor element 1 (Ambient ): ok | TEMPERATURE = 20C Temp sensor element 2 (Hot-Spot): ok | TEMPERATURE = 20C Temp sensor element 3 (Primary ): ok | TEMPERATURE = 20C PSU2: Temp sensor element 1 (Ambient ): ok | TEMPERATURE = 20C Temp sensor element 2 (Hot-Spot): ok | TEMPERATURE = 20C Temp sensor element 3 (Primary ): ok | TEMPERATURE = 20C ENCL Service Cntrl 1: Temp sensor Element 1 (Inlet ): ok | TEMPERATURE = 20C Temp sensor Element 2 (Outlet ): ok | TEMPERATURE = 20C ENCL Service Cntrl 2: Temp sensor Element 1 (Inlet ): ok | TEMPERATURE = 20C Temp sensor Element 2 (Outlet ): ok | TEMPERATURE = 20C Enclosure service controller status Left : ok | First power on Right: ok | First power on Enclosure Status: ok SAS Expander Status Left : ok Right: ok SAS Connector Status Left: Upstream : ok Downstream : ok Uninstalled: ok Right: Upstream : ok Downstream : ok Uninstalled: ok Midplane Status: ok Phy Status Left: Physical link 1: ok Physical link 2: ok Physical link 3: ok Physical link 4: ok Physical link 5: ok Physical link 6: ok Physical link 7: ok Physical link 8: ok Physical link 9: ok Physical link 10: ok Physical link 11: ok Physical link 12: ok Physical link 13: ok Physical link 14: ok Physical link 15: ok Physical link 16: ok Physical link 17: ok Physical link 18: ok Physical link 19: ok Physical link 20: ok Physical link 21: ok Physical link 22: ok Physical link 23: ok Physical link 24: ok Physical link 25: ok Physical link 26: ok Physical link 27: ok Physical link 28: ok Physical link 29: ok Physical link 30: ok Physical link 31: ok Physical link 32: ok Physical link 33: ok Physical link 34: ok Physical link 35: ok Physical link 36: ok Right: Physical link 1: ok Physical link 2: ok Physical link 3: ok Physical link 4: ok Physical link 5: ok Physical link 6: ok Physical link 7: ok Physical link 8: ok Physical link 9: ok Physical link 10: ok Physical link 11: ok Physical link 12: ok Physical link 13: ok Physical link 14: ok Physical link 15: ok Physical link 16: ok Physical link 17: ok Physical link 18: ok Physical link 19: ok Physical link 20: ok Physical link 21: ok Physical link 22: ok Physical link 23: ok Physical link 24: ok Physical link 25: ok Physical link 26: ok Physical link 27: ok Physical link 28: ok Physical link 29: ok Physical link 30: ok Physical link 31: ok Physical link 32: ok Physical link 33: ok Physical link 34: ok Physical link 35: ok Physical link 36: ok Statesave Buffer Status: Element 1 (Left ): ok | No statesave available for retrieval | A statesave Element 2 (Right): ok | No statesave available for retrieval | A statesave CPLD Status: Left : ok Right: ok Input Power Status: PSU1: Average Input Power: ok | Input power : 5 Peak Input Power : ok | Input power : 5 PSU2: Average Input Power: ok | Input power : 5 Peak Input Power : ok | Input power : 5 Raw diagnostic page: 0x0000: 02000270 00000000 01000000 01000000 [...p............] 0x0010: 01010000 01020000 01030000 01040000 [................] 0x0020: 01050000 01060000 01070000 01080000 [................] 0x0030: 01090000 010a0000 010b0000 01000000 [................] 0x0040: 01000000 01000000 01047b00 01047b00 [..........{...{.] 0x0050: 01047b00 01047b00 01047b00 01047b00 [..{...{...{...{.] 0x0060: 01047b00 01047b00 01047b00 01047b00 [..{...{...{...{.] 0x0070: 01047b00 01047b00 01047b00 01047b00 [..{...{...{...{.] 0x0080: 01047b00 01047b00 01047b00 01002800 [..{...{...{...(.] 0x0090: 01002800 01002800 01002800 01002800 [..(...(...(...(.] 0x00a0: 01002800 01002800 01002800 01002800 [..(...(...(...(.] 0x00b0: 01002800 01002800 01002800 01000000 [..(...(...(.....] 0x00c0: 01000000 01000000 01000000 01000000 [................] 0x00d0: 01000000 0100015e 01000064 010000b4 [.......^...d....] 0x00e0: 0100005a 0100015e 01000064 010000b4 [...Z...^...d....] 0x00f0: 0100005a 01000000 01000000 01000000 [...Z............] 0x0100: 0100ff00 0100ff00 0100ff00 0100ff00 [................] 0x0110: 0100ff00 0100ff00 0100ff00 00000000 [................] 0x0120: 01000000 0100c000 0100c000 0100c000 [................] 0x0130: 0100c000 0100c000 0100c000 0100c000 [................] 0x0140: 0100c000 0100c000 0100c000 0100c000 [................] 0x0150: 0100c000 0100c000 0100c000 0100c000 [................] 0x0160: 0100c000 0100c000 0100c000 0100c000 [................] 0x0170: 0100c000 0100c000 0100c000 0100c000 [................] 0x0180: 0100c000 0100c000 0100c000 0100c000 [................] 0x0190: 0100c000 0100c000 0100c000 0100c000 [................] 0x01a0: 0100c000 0100c000 0100c000 0100c000 [................] 0x01b0: 0100c000 0100c000 0100c000 0100c000 [................] 0x01c0: 0100c000 0100c000 0100c000 0100c000 [................] 0x01d0: 0100c000 0100c000 0100c000 0100c000 [................] 0x01e0: 0100c000 0100c000 0100c000 0100c000 [................] 0x01f0: 0100c000 0100c000 0100c000 0100c000 [................] 0x0200: 0100c000 0100c000 0100c000 0100c000 [................] 0x0210: 0100c000 0100c000 0100c000 0100c000 [................] 0x0220: 0100c000 0100c000 0100c000 0100c000 [................] 0x0230: 0100c000 0100c000 0100c000 0100c000 [................] 0x0240: 0100c000 0100c000 01000000 01000000 [................] 0x0250: 01000000 01000000 01000000 01000000 [................] 0x0260: 01000500 01000500 01000500 01000500 [................] 0x0270: 01000500 [.... ] ppc64-diag-2.7.4/diags/test/tests-results/test-slider-004-mk_hot_power.result0000644000000000000000000000116413135275400023655 00000000000000p   @{{{{{{{{{{A{{{{{{{+P((((((((((^d´Z^d´ZÿÿÿÿÿÿÿÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀÀppc64-diag-2.7.4/diags/test/tests-results/test-slider-005-hot_power_diag_encl.result.err0000644000000000000000000000000013135275400025727 00000000000000ppc64-diag-2.7.4/diags/test/tests-results/test-slider-005-hot_power_diag_encl.result.out0000644000000000000000000002033613135275400025764 00000000000000DIAGNOSING sg8 Model : ESLL Location : UESLL.001.G123789 Overall Status: NON_CRITICAL_FAULT Drive Status Disk 01 (Slot 00): ok Disk 02 (Slot 01): ok Disk 03 (Slot 02): ok Disk 04 (Slot 03): ok Disk 05 (Slot 04): ok Disk 06 (Slot 05): ok Disk 07 (Slot 06): ok Disk 08 (Slot 07): ok Disk 09 (Slot 08): ok Disk 10 (Slot 09): ok Disk 11 (Slot 10): ok Disk 12 (Slot 11): ok Power Supply Status PS0 (Left ): ok 3.3V: ok | VOLTAGE = 3.50 volts 1V0 : ok | VOLTAGE = 1.00 volts 1V8 : ok | VOLTAGE = 1.80 volts 0V92: ok | VOLTAGE = 0.90 volts PS1 (Right): NON_CRITICAL_FAULT | DC_OVER_VOLTAGE | FAULT_LED 3.3V: NON_CRITICAL_FAULT | NON_CRITICAL_OVER_VOLTAGE | VOLTAGE = 3.50 volts 1V0 : ok | VOLTAGE = 1.00 volts 1V8 : ok | VOLTAGE = 1.80 volts 0V92: ok | VOLTAGE = 0.90 volts Fan Status Left power supply fans Fan Element 1: ok | speed :11470 rpm Fan Element 2: ok | speed :11470 rpm Fan Element 3: ok | speed :11470 rpm Fan Element 4: ok | speed :11470 rpm Fan Element 5: ok | speed :11470 rpm Fan Element 6: ok | speed :11470 rpm Fan Element 7: ok | speed :11470 rpm Fan Element 8: ok | speed :11470 rpm Right power supply fans Fan Element 1: NON_CRITICAL_FAULT | FAULT_LED | speed :11470 rpm Fan Element 2: ok | speed :11470 rpm Fan Element 3: ok | speed :11470 rpm Fan Element 4: ok | speed :11470 rpm Fan Element 5: ok | speed :11470 rpm Fan Element 6: ok | speed :11470 rpm Fan Element 7: ok | speed :11470 rpm Fan Element 8: ok | speed :11470 rpm Temperature Sensors Enclosure Ambient air: NON_CRITICAL_FAULT | OVER_TEMPERATURE_WARNING | TEMPERATURE = 60C PSU1: Temp sensor element 1 (Ambient ): ok | TEMPERATURE = 20C Temp sensor element 2 (Hot-Spot): ok | TEMPERATURE = 20C Temp sensor element 3 (Primary ): ok | TEMPERATURE = 20C PSU2: Temp sensor element 1 (Ambient ): ok | TEMPERATURE = 20C Temp sensor element 2 (Hot-Spot): ok | TEMPERATURE = 20C Temp sensor element 3 (Primary ): ok | TEMPERATURE = 20C ENCL Service Cntrl 1: Temp sensor Element 1 (Inlet ): ok | TEMPERATURE = 20C Temp sensor Element 2 (Outlet ): ok | TEMPERATURE = 20C ENCL Service Cntrl 2: Temp sensor Element 1 (Inlet ): ok | TEMPERATURE = 20C Temp sensor Element 2 (Outlet ): ok | TEMPERATURE = 20C Enclosure service controller status Left : ok | First power on Right: ok | First power on Enclosure Status: ok SAS Expander Status Left : ok Right: ok SAS Connector Status Left: Upstream : ok Downstream : ok Uninstalled: ok Right: Upstream : ok Downstream : ok Uninstalled: ok Midplane Status: ok Phy Status Left: Physical link 1: ok Physical link 2: ok Physical link 3: ok Physical link 4: ok Physical link 5: ok Physical link 6: ok Physical link 7: ok Physical link 8: ok Physical link 9: ok Physical link 10: ok Physical link 11: ok Physical link 12: ok Physical link 13: ok Physical link 14: ok Physical link 15: ok Physical link 16: ok Physical link 17: ok Physical link 18: ok Physical link 19: ok Physical link 20: ok Physical link 21: ok Physical link 22: ok Physical link 23: ok Physical link 24: ok Physical link 25: ok Physical link 26: ok Physical link 27: ok Physical link 28: ok Physical link 29: ok Physical link 30: ok Physical link 31: ok Physical link 32: ok Physical link 33: ok Physical link 34: ok Physical link 35: ok Physical link 36: ok Right: Physical link 1: ok Physical link 2: ok Physical link 3: ok Physical link 4: ok Physical link 5: ok Physical link 6: ok Physical link 7: ok Physical link 8: ok Physical link 9: ok Physical link 10: ok Physical link 11: ok Physical link 12: ok Physical link 13: ok Physical link 14: ok Physical link 15: ok Physical link 16: ok Physical link 17: ok Physical link 18: ok Physical link 19: ok Physical link 20: ok Physical link 21: ok Physical link 22: ok Physical link 23: ok Physical link 24: ok Physical link 25: ok Physical link 26: ok Physical link 27: ok Physical link 28: ok Physical link 29: ok Physical link 30: ok Physical link 31: ok Physical link 32: ok Physical link 33: ok Physical link 34: ok Physical link 35: ok Physical link 36: ok Statesave Buffer Status: Element 1 (Left ): ok | No statesave available for retrieval | A statesave Element 2 (Right): ok | No statesave available for retrieval | A statesave CPLD Status: Left : ok Right: ok Input Power Status: PSU1: Average Input Power: ok | Input power : 5 Peak Input Power : ok | Input power : 5 PSU2: Average Input Power: ok | Input power : 5 Peak Input Power : ok | Input power : 5 Raw diagnostic page: 0x0000: 02040270 00000000 01000000 01000000 [...p............] 0x0010: 01010000 01020000 01030000 01040000 [................] 0x0020: 01050000 01060000 01070000 01080000 [................] 0x0030: 01090000 010a0000 010b0000 01000000 [................] 0x0040: 01000000 03000840 01047b00 01047b00 [.......@..{...{.] 0x0050: 01047b00 01047b00 01047b00 01047b00 [..{...{...{...{.] 0x0060: 01047b00 01047b00 01047b00 03047b41 [..{...{...{...{A] 0x0070: 01047b00 01047b00 01047b00 01047b00 [..{...{...{...{.] 0x0080: 01047b00 01047b00 01047b00 01002b00 [..{...{...{...+.] 0x0090: 03005004 01002800 01002800 01002800 [..P...(...(...(.] 0x00a0: 01002800 01002800 01002800 01002800 [..(...(...(...(.] 0x00b0: 01002800 01002800 01002800 01000000 [..(...(...(.....] 0x00c0: 01000000 01000000 01000000 01000000 [................] 0x00d0: 01000000 0100015e 01000064 010000b4 [.......^...d....] 0x00e0: 0100005a 0308015e 01000064 010000b4 [...Z...^...d....] 0x00f0: 0100005a 01000000 01000000 01000000 [...Z............] 0x0100: 0100ff00 0100ff00 0100ff00 0100ff00 [................] 0x0110: 0100ff00 0100ff00 0100ff00 00000000 [................] 0x0120: 01000000 0100c000 0100c000 0100c000 [................] 0x0130: 0100c000 0100c000 0100c000 0100c000 [................] 0x0140: 0100c000 0100c000 0100c000 0100c000 [................] 0x0150: 0100c000 0100c000 0100c000 0100c000 [................] 0x0160: 0100c000 0100c000 0100c000 0100c000 [................] 0x0170: 0100c000 0100c000 0100c000 0100c000 [................] 0x0180: 0100c000 0100c000 0100c000 0100c000 [................] 0x0190: 0100c000 0100c000 0100c000 0100c000 [................] 0x01a0: 0100c000 0100c000 0100c000 0100c000 [................] 0x01b0: 0100c000 0100c000 0100c000 0100c000 [................] 0x01c0: 0100c000 0100c000 0100c000 0100c000 [................] 0x01d0: 0100c000 0100c000 0100c000 0100c000 [................] 0x01e0: 0100c000 0100c000 0100c000 0100c000 [................] 0x01f0: 0100c000 0100c000 0100c000 0100c000 [................] 0x0200: 0100c000 0100c000 0100c000 0100c000 [................] 0x0210: 0100c000 0100c000 0100c000 0100c000 [................] 0x0220: 0100c000 0100c000 0100c000 0100c000 [................] 0x0230: 0100c000 0100c000 0100c000 0100c000 [................] 0x0240: 0100c000 0100c000 01000000 01000000 [................] 0x0250: 01000000 01000000 01000000 01000000 [................] 0x0260: 01000500 01000500 01000500 01000500 [................] 0x0270: 01000500 [.... ] ppc64-diag-2.7.4/diags/test/README0000644000000000000000000000126113135275400013177 00000000000000To create a .pg2 file that represents an entirely healthy Bluehawk, run: $ make $ ./bh_mk_healthy xxx.pg2 To create a .pg2 file that represents (sort of) a Bluehawk with an overheating power supply, run: $ make $ ./bh_mk_hot_power xxx.pg2 You can simulate other problems by writing programs similar to mk_hot_power.c. When you feed such a file to diag_encl using the -f option, remember that you also need to provide a .vpd file. Just copy sg8.vpd and rename it. To create .pg2 file from Bluehawk enclosure, run: $ make $ ./bh_dump_pg2 To dump the Bluehawk vpd data, run: $ make $ bh_vpd To dump the Bluehawk structure size, run : $ make $ bh_structs ppc64-diag-2.7.4/diags/Makefile.am0000644000000000000000000000264413135275400013402 00000000000000diag_common_h_files = diags/encl_util.h \ diags/bluehawk.h \ diags/homerun.h \ diags/slider.h \ diags/encl_common.h \ common/platform.h \ common/utils.h diag_encl_h_files = diags/diag_encl.h \ $(diag_common_h_files) encl_led_h_files = diags/encl_led.h \ $(diag_common_h_files) sbin_PROGRAMS += diags/diag_encl diags/encl_led diags_diag_encl_SOURCES = diags/diag_encl.c \ diags/7031_D24_T24.c \ diags/bluehawk.c \ diags/encl_util.c \ diags/encl_common.c \ diags/homerun.c \ diags/slider.c \ diags/diag_disk.c \ common/platform.c \ common/utils.c \ $(diag_encl_h_files) diags_diag_encl_LDADD = -lservicelog diags_encl_led_SOURCES = diags/encl_led.c \ diags/encl_util.c \ diags/bluehawk_led.c \ diags/homerun_led.c \ diags/slider_led.c \ common/platform.c \ common/utils.c \ $(encl_led_h_files) dist_man_MANS += diags/man/diag_encl.8 diags/man/encl_led.8 DIAG_CRONTAB_SCRIPT = diags/run_diag_encl install-exec-hook-diag: install -d --mode=755 $(DESTDIR)/var/log/ppc64-diag/diag_disk install -d --mode=755 $(DESTDIR)/etc/cron.daily/ install -D --mode=744 $(DIAG_CRONTAB_SCRIPT) $(DESTDIR)/etc/cron.daily/ INSTALL_EXEC_HOOKS += install-exec-hook-diag uninstall-hook-diags: rm -f $(DESTDIR)/etc/cron.daily/run_diag_encl UNINSTALL_HOOKS += uninstall-hook-diags EXTRA_DIST += $(DIAG_CRONTAB_SCRIPT) ppc64-diag-2.7.4/diags/diag_encl.c0000644000000000000000000002424213135275400013415 00000000000000/* * Copyright (C) 2009, 2015, 2016 IBM Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "encl_util.h" #include "diag_encl.h" #include "platform.h" #define VPD_PATHNAME_EXTN_MAXLEN 5 static struct option long_options[] = { {"cmp_prev", no_argument, NULL, 'c'}, {"disk", required_argument, NULL, 'd'}, {"fake", required_argument, NULL, 'f'}, {"help", no_argument, NULL, 'h'}, {"leds", no_argument, NULL, 'l'}, {"serv_event", no_argument, NULL, 's'}, {"verbose", no_argument, NULL, 'v'}, {"version", no_argument, NULL, 'V'}, {0, 0, 0, 0} }; int platform; /* Holds PLATFORM_* */ struct cmd_opts cmd_opts; static struct { char *mtm; int (*func)(int, struct dev_vpd *); } encl_diags[] = { {"7031-D24/T24", diag_7031_D24_T24}, /* Pearl enclosure */ {"5888", diag_bluehawk}, /* Bluehawk enclosure */ {"EDR1", diag_bluehawk}, /* Bluehawk enclosure */ {"5887", diag_homerun}, /* Home Run enclosure */ {"ESLL", diag_slider_lff}, /* Slider enclosure - LFF */ {"ESLS", diag_slider_sff}, /* Slider enclosure - SFF */ {NULL, NULL}, }; /** * print_usage * @brief Print the usage message for this command * * @param name the name of this executable */ static void print_usage(const char *name) { printf("Usage: %s [-h] [-V] [-s [-c][-l]] [-v] [-f ]" " []\n" "\n\t-h: print this help message\n" "\t-s: generate serviceable events for any failures and\n" "\t write events to the servicelog\n" "\t-c: compare with previous status; report only new failures\n" "\t-d: collect disk health information\n" "\t-l: turn on fault LEDs for serviceable events\n" "\t-v: verbose output\n" "\t-V: print the version of the command and exit\n" "\t-f: for testing, read SES data from path.pg2 and VPD\n" "\t from path.vpd\n" "\t: the sg device on which to operate, such\n" "\t as sg7; if not specified, all such\n" "\t devices will be diagnosed\n", name); } /* * Given pg2_path = /some/file.pg2, extract the needed VPD values from * /some/file.vpd. */ static int read_fake_vpd(const char *sg, const char *pg2_path, struct dev_vpd *vpd) { char *vpd_path, *dot; char *result; FILE *f; vpd_path = strdup(pg2_path); assert(vpd_path); dot = strrchr(vpd_path, '.'); assert(dot && !strcmp(dot, ".pg2")); strncpy(dot, ".vpd", VPD_PATHNAME_EXTN_MAXLEN - 1); dot[VPD_PATHNAME_EXTN_MAXLEN - 1] = '\0'; f = fopen(vpd_path, "r"); if (!f) { perror(vpd_path); free(vpd_path); return -1; } result = fgets_nonl(vpd->mtm, VPD_LENGTH, f); if (!result) goto missing_vpd; result = fgets_nonl(vpd->full_loc, LOCATION_LENGTH, f); if (!result) goto missing_vpd; result = fgets_nonl(vpd->sn, VPD_LENGTH, f); if (!result) goto missing_vpd; result = fgets_nonl(vpd->fru, VPD_LENGTH, f); if (!result) goto missing_vpd; fclose(f); free(vpd_path); /* Add sg device name */ strncpy(vpd->dev, sg, PATH_MAX - 1); trim_location_code(vpd); return 0; missing_vpd: fprintf(stderr, "%s lacks acceptable mtm, location code, serial number," " and FRU number.\n", vpd_path); fclose(f); free(vpd_path); return -1; } #define DIAG_ENCL_PREV_PAGES_DIR "/etc/ppc64-diag/ses_pages/" static void make_prev_path(const char *encl_loc) { int path_len = strlen(DIAG_ENCL_PREV_PAGES_DIR) + strlen(encl_loc) + 5; free(cmd_opts.prev_path); cmd_opts.prev_path = malloc(path_len); if (!cmd_opts.prev_path) return; memset(cmd_opts.prev_path, 0, path_len); strncpy(cmd_opts.prev_path, DIAG_ENCL_PREV_PAGES_DIR, strlen(DIAG_ENCL_PREV_PAGES_DIR)); path_len -= strlen(DIAG_ENCL_PREV_PAGES_DIR); strncat(cmd_opts.prev_path, encl_loc, path_len - 1); path_len -= strlen(encl_loc); strncat(cmd_opts.prev_path, ".pg2", path_len - 1); } static void free_dev_vpd(struct dev_vpd *vpd) { struct dev_vpd *tmp; while (vpd) { tmp = vpd; vpd = vpd->next; free(tmp); } } /** * diagnose * @brief Diagnose a specific SCSI generic enclosure * * @param sg the SCSI generic device to diagnose (e.g. "sg7") * @return 0 for no failure, 1 if there is a failure on the enclosure */ static int diagnose(const char *sg, struct dev_vpd **diagnosed) { int rc = 0, fd, found = 0, i; struct dev_vpd *vpd = NULL; struct dev_vpd *v; /* Skip sg device validation in test path */ if (!cmd_opts.fake_path) { rc = valid_enclosure_device(sg); if (rc) return -1; } printf("DIAGNOSING %s\n", sg); vpd = calloc(1, sizeof(struct dev_vpd)); if (vpd == NULL) { fprintf(stderr, "Out of memory\n"); return 1; } if (cmd_opts.fake_path) rc = read_fake_vpd(sg, cmd_opts.fake_path, vpd); else rc = read_vpd_from_lscfg(vpd, sg); if (vpd->mtm[0] == '\0') { fprintf(stderr, "Unable to find machine type/model for %s\n", sg); goto error_out; } if (cmd_opts.serv_event && vpd->location[0] == '\0') { fprintf(stderr, "Unable to find location code for %s; needed " "for -s\n", sg); goto error_out; } if (rc != 0) fprintf(stderr, "Warning: unable to find all relevant VPD for " "%s\n", sg); printf("\tModel : %s\n\tLocation : %s\n\n", vpd->mtm, vpd->full_loc); for (i = 0; encl_diags[i].mtm; i++) { if (!strcmp(vpd->mtm, encl_diags[i].mtm)) { for (v = *diagnosed; v; v = v->next) { if (!strcmp(v->location, vpd->location)) { printf("\t(Enclosure already diagnosed)\n\n"); free(vpd); return 0; } } /* fake path ? */ if (cmd_opts.fake_path) fd = -1; else { /* Skip diagnostics if the enclosure is * temporarily disabled for maintenance. */ if (enclosure_maint_mode(sg)) goto error_out; /* Open sg device */ fd = open_sg_device(sg); if (fd < 0) goto error_out; } /* diagnose */ if (cmd_opts.serv_event) make_prev_path(vpd->location); found = 1; rc += encl_diags[i].func(fd, vpd); if (fd != -1) close(fd); break; } } if (found) { vpd->next = *diagnosed; *diagnosed = vpd; } else { fprintf(stderr, "\tSCSI enclosure diagnostics not supported " "for this model.\n"); free(vpd); } return rc; error_out: free(vpd); return 1; } int main(int argc, char *argv[]) { int failure = 0, option_index, rc; char path[PATH_MAX]; DIR *edir, *sdir; struct dirent *sdirent, *edirent; struct dev_vpd *diagnosed = NULL; platform = get_platform(); memset(&cmd_opts, 0, sizeof(cmd_opts)); for (;;) { option_index = 0; rc = getopt_long(argc, argv, "cd::f:hlsvV", long_options, &option_index); if (rc == -1) break; switch (rc) { case 'c': cmd_opts.cmp_prev = 1; break; case 'd': cmd_opts.disk_health = 1; cmd_opts.disk_name = optarg; break; case 'f': if (cmd_opts.fake_path) { fprintf(stderr, "Multiple -f options not " "supported.\n"); return -1; } cmd_opts.fake_path = optarg; break; case 'h': print_usage(argv[0]); return 0; case 'l': cmd_opts.leds = 1; break; case 's': cmd_opts.serv_event = 1; break; case 'v': cmd_opts.verbose = 1; break; case 'V': printf("%s %s\n", argv[0], VERSION); return 0; case '?': print_usage(argv[0]); return -1; default: /* Shouldn't get here. */ fprintf(stderr, "huh?\n"); print_usage(argv[0]); return -1; } } if (cmd_opts.disk_health) { if (cmd_opts.cmp_prev || cmd_opts.fake_path || cmd_opts.leds || cmd_opts.serv_event || cmd_opts.verbose) { fprintf(stderr, "-d option is exclusive to " "all other options\n"); return -1; } return diag_disk(cmd_opts.disk_name); } if (cmd_opts.cmp_prev && !cmd_opts.serv_event) { fprintf(stderr, "No -c option without -s\n"); return -1; } if (cmd_opts.leds && !cmd_opts.serv_event) { fprintf(stderr, "No -l option without -s\n"); return -1; } if ((cmd_opts.serv_event || cmd_opts.leds) && geteuid() != 0) { fprintf(stderr, "-s and -l options require superuser " "privileges\n"); return -1; } if (cmd_opts.fake_path) { const char *dot = strrchr(cmd_opts.fake_path, '.'); if (!dot || strcmp(dot, ".pg2") != 0) { fprintf(stderr, "Name of file with fake diagnostic " "data must end in '.pg2'.\n"); return -1; } if (optind + 1 != argc) { fprintf(stderr, "Please specify an sg device with the " "-f pathname. It need not be an " "enclosure.\n"); return -1; } failure += diagnose(argv[optind++], &diagnosed); } else if (optind < argc) { while (optind < argc) failure += diagnose(argv[optind++], &diagnosed); } else { edir = opendir(SCSI_SES_PATH); if (!edir) { fprintf(stderr, "System does not have SCSI enclosure(s).\n"); return -1; } /* loop over all enclosures */ while ((edirent = readdir(edir)) != NULL) { if (!strcmp(edirent->d_name, ".") || !strcmp(edirent->d_name, "..")) continue; snprintf(path, PATH_MAX, "%s/%s/device/scsi_generic", SCSI_SES_PATH, edirent->d_name); sdir = opendir(path); if (!sdir) continue; while ((sdirent = readdir(sdir)) != NULL) { if (!strcmp(sdirent->d_name, ".") || !strcmp(sdirent->d_name, "..")) continue; /* run diagnostics */ failure += diagnose(sdirent->d_name, &diagnosed); } closedir(sdir); } /* outer while loop */ closedir(edir); } free(cmd_opts.prev_path); free_dev_vpd(diagnosed); return failure; } ppc64-diag-2.7.4/diags/7031_D24_T24.c0000644000000000000000000003346213135275400013150 00000000000000/* * Copyright (C) 2009, 2015 IBM Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include "encl_common.h" #include "encl_util.h" #include "diag_encl.h" #define OK 0 #define EMPTY -1 #define FAULT_CRITICAL 1 #define FAULT_NONCRITICAL 2 #define CRIT_PS 0x120 #define CRIT_FAN 0x130 #define CRIT_REPEATER 0x150 #define CRIT_VPD 0x160 #define UNRECOVER_PS 0x220 #define UNRECOVER_FAN 0x230 #define REDUNDANT 0x310 #define NONCRIT_PS 0x320 #define NONCRIT_FAN 0x330 struct pearl_diag_page2 { uint32_t page_code:8; uint32_t health_status:8; uint32_t page_length:16; uint32_t reserved:32; uint32_t drive_status_overall:32; uint32_t drive_status1:32; uint32_t drive_status2:32; uint32_t drive_status3:32; uint32_t drive_status4:32; uint32_t drive_status5:32; uint32_t drive_status6:32; uint32_t power_status_overall:32; uint32_t power_status1:32; uint32_t power_status2:32; uint32_t fan_status_overall:32; uint32_t fan_status1:32; uint32_t fan_status2:32; uint32_t fan_status3:32; uint32_t repeater_status:32; uint32_t vpd_card_status:32; }; /** * get_enclosure_scsi_id * @brief Retrieve the SCSI ID for the Pearl enclosure * * @param dp the diagnostic page from the enclosure * @return the SCSI ID of the enclosure */ static int get_enclosure_scsi_id(struct pearl_diag_page2 *dp) { return ((dp->repeater_status & 0x000F0000) >> 16); } /** * print_drive status * @brief Print the status of a drive in the enclosure * * @param status the status of the drive from the diagnostic page * @return OK, EMPTY, FAULT_NONCRITICAL, or FAULT_CRITICAL */ static int pearl_print_drive_status(uint32_t status) { int printed = 0, rc = OK; int __attribute__((__unused__)) fail; if ((status & 0x0F000000) == 0x05000000) { printf("(empty) "); rc = EMPTY; } else if ((status & 0x40000000) || (status & 0x00000040) || (status & 0x00000020)) fail = 1; else printf("ok "); if (status & 0x40000000) { printf("PREDICTIVE_FAIL"); rc = FAULT_NONCRITICAL; printed = 1; } if (status & 0x00000040) { if (printed) printf (" | "); printf("FAULT_SENSED"); rc = FAULT_CRITICAL; printed = 1; } if (status & 0x00000020) { if (printed) printf (" | "); printf("FAULT_REQUESTED"); rc = FAULT_CRITICAL; printed = 1; } if (status & 0x00000800) { if (printed) printf (" | "); printf("INSERT"); printed = 1; } if (status & 0x00000400) { if (printed) printf (" | "); printf("REMOVE"); printed = 1; } if (status & 0x00000200) { if (printed) printf (" | "); printf("IDENTIFY"); printed = 1; } printf("\n"); return rc; } /** * print_ps_fan status * @brief Print the status of a power supply or fan in the enclosure * * @param status the status of the part from the diagnostic page * @return OK, EMPTY, FAULT_NONCRITICAL, or FAULT_CRITICAL */ static int print_ps_fan_status(uint32_t status) { int fail = 0, rc = OK; if ((status & 0x0F000000) == 0x01000000) printf("ok "); else if ((status & 0x0F000000) == 0x02000000) { printf("CRITICAL_FAULT"); rc = FAULT_CRITICAL; fail = 1; } else if ((status & 0x0F000000) == 0x03000000) { printf("NON_CRITICAL_FAULT"); rc = FAULT_NONCRITICAL; fail = 1; } else if ((status & 0x0F000000) == 0x05000000) { printf("(empty) "); rc = EMPTY; } if (status & 0x00000200) { if (fail) printf(" | "); printf("IDENTIFY"); } printf("\n"); return rc; } /** * print_repeater_status * @brief Print the status of the repeater and SCSI connectors in the enclosure * * @param status the status of the repeater from the diagnostic page * @return OK or FAULT_CRITICAL */ static int print_repeater_status(uint32_t status) { int printed = 0, rc = OK; int __attribute__((__unused__)) fail; if ((status & 0x0F000000) == 0x01000000) printf("ok "); else if ((status & 0x0F000000) == 0x02000000) { printf("CRITICAL_FAULT"); rc = FAULT_CRITICAL; fail = 1; printed = 1; } if (status & 0x00000040) { if (printed) printf (" | "); printf("FAULT_SENSED"); printed = 1; } if (status & 0x00000020) { if (printed) printf (" | "); printf("FAULT_REQUESTED"); printed = 1; } if (status & 0x00000400) { if (printed) printf(" | "); printf("DRAWER_IDENTIFY"); printed = 1; } if (status & 0x00000200) { if (printed) printf(" | "); printf("REPEATER_IDENTIFY"); printed = 1; } printf("\n\n SCSI Connector Status"); printf("\n Connector 1: "); if (((status & 0x0000000C) >> 2) == 0x00) printf("(empty)"); else if (((status & 0x0000000C) >> 2) == 0x01) printf("Connector installed. Cable not present."); else if (((status & 0x0000000C) >> 2) == 0x03) printf("ok"); printf("\n Connector 2: "); if ((status & 0x00000003) == 0x00) printf("(empty)"); else if ((status & 0x00000003) == 0x01) printf("Connector installed. Cable not present."); else if ((status & 0x00000003) == 0x03) printf("ok"); printf("\n"); return rc; } /** * print_vpd_card status * @brief Print the status of the VPD card in the enclosure * * @param status the status of the VPD card from the diagnostic page * @return OK or FAULT_CRITICAL */ static int print_vpd_card_status(uint32_t status) { int fail = 0, rc = OK; if ((status & 0x0F000000) == 0x01000000) printf("ok "); else if ((status & 0x0F000000) == 0x02000000) { printf("CRITICAL_FAULT"); rc = FAULT_CRITICAL; fail = 1; } if (status & 0x00000200) { if (fail) printf(" | "); printf("IDENTIFY"); } printf("\n"); return rc; } /** * pearl_servevent * @brief Generate a serviceable event for a fault found on a Pearl enclosure * * @param failtype the type of failure (CRIT_PS, REDUNDANT, etc) * @param devnum the number of the failed devices (e.g. 2 for the 2nd fan) * @param interface the SCSI ID of the enclosure * @param vpd structure containing the VPD of the enclosure */ static void pearl_servevent(int failtype, int devnum, int interface, struct dev_vpd *vpd) { char srn[16], *desc; struct sl_callout *callouts = NULL; int sev = SL_SEV_INFO; if (failtype == REDUNDANT) devnum = 1; /* build up the SRN */ snprintf(srn, 16, "807-%03X", failtype + ((devnum - 1) * 4) + (interface - 1)); switch(failtype) { case CRIT_PS: desc = "A critical power supply failure has occurred. " "Refer to the system service documentation for more " "information."; sev = SL_SEV_ERROR; break; case CRIT_FAN: desc = "A critical fan failure has occurred. " "Refer to the system service documentation for more " "information."; sev = SL_SEV_ERROR; break; case CRIT_REPEATER: desc = "A critical repeater card failure has occurred. " "Refer to the system service documentation for more " "information."; sev = SL_SEV_ERROR; break; case CRIT_VPD: desc = "A critical vpd module failure has occurred. " "Refer to the system service documentation for more " "information."; sev = SL_SEV_ERROR; break; case UNRECOVER_PS: desc = "An unrecoverable power supply failure has occurred. " "Refer to the system service documentation for more " "information."; sev = SL_SEV_ERROR; break; case UNRECOVER_FAN: desc = "An unrecoverable fan failure has occurred. " "Refer to the system service documentation for more " "information."; sev = SL_SEV_ERROR; break; case REDUNDANT: desc = "There is a redundant power supply or fan failure. " "Refer to the system service documentation for more " "information."; sev = SL_SEV_WARNING; break; case NONCRIT_PS: desc = "A non-critical power supply failure has occurred. " "Refer to the system service documentation for more " "information."; sev = SL_SEV_WARNING; break; case NONCRIT_FAN: desc = "A non-critical fan failure has occurred. " "Refer to the system service documentation for more " "information."; sev = SL_SEV_WARNING; break; default: desc = "Unknown failure."; break; } add_callout(&callouts, ' ', 0, "n/a", vpd->location, vpd->fru, "", ""); servevent(srn, sev, desc, vpd, callouts); return; } /** * diag_7031_D24_T24 * @brief Diagnose an enclosure with MTM 7031-D24/T24 (a.k.a. Pearl) * * @param fd a file descriptor to the SCSI generic file (e.g. /dev/sg7) * @param vpd structure containing the VPD of the enclosure * @return 0 if no faults were found, or 1 if faults were found */ int diag_7031_D24_T24(int fd, struct dev_vpd *vpd) { struct pearl_diag_page2 dp; int failure = 0, rc, encl_id; int buf_len = sizeof(dp); int ps1, ps2, fan1, fan2, fan3, rpt, vpd_card; if (cmd_opts.fake_path) { fprintf(stderr, "No support for -f option with " "enclosure type %s\n", vpd->mtm); return 1; } /* Usage warning and continue diagnostics */ if (cmd_opts.cmp_prev || cmd_opts.leds) fprintf(stderr, "Option(s) ignored : No support for -c or -l " "options with enclosure type %s\n", vpd->mtm); /* the necessary data is on diagnostic page 2 */ rc = get_diagnostic_page(fd, RECEIVE_DIAGNOSTIC, 2, (void *)&dp, buf_len); if (rc != 0) { fprintf(stderr, "Failed to read SES diagnostic page; " "cannot report status.\n"); return 1; } encl_id = get_enclosure_scsi_id(&dp); printf(" Enclosure SCSI ID: %d\n", encl_id); printf(" Overall Status: "); if (dp.health_status == 0) printf("ok"); if (dp.health_status & 0x02) printf("CRITICAL_FAULT"); else if (dp.health_status & 0x04) printf("NON_CRITICAL_FAULT"); else if (dp.health_status & 0x06) printf("CRITICAL_FAULT | NON_CRITICAL_FAULT"); printf("\n\n Drive Status\n"); printf(" Slot SCSI ID %02d: ", (dp.drive_status1 & 0x000F0000)>>16); rc = pearl_print_drive_status(dp.drive_status1); printf(" Slot SCSI ID %02d: ", (dp.drive_status2 & 0x000F0000)>>16); rc = pearl_print_drive_status(dp.drive_status2); printf(" Slot SCSI ID %02d: ", (dp.drive_status3 & 0x000F0000)>>16); rc = pearl_print_drive_status(dp.drive_status3); printf(" Slot SCSI ID %02d: ", (dp.drive_status4 & 0x000F0000)>>16); rc = pearl_print_drive_status(dp.drive_status4); printf(" Slot SCSI ID %02d: ", (dp.drive_status5 & 0x000F0000)>>16); rc = pearl_print_drive_status(dp.drive_status5); printf(" Slot SCSI ID %02d: ", (dp.drive_status6 & 0x000F0000)>>16); rc = pearl_print_drive_status(dp.drive_status6); printf("\n Power Supply Status\n"); printf(" Power Supply 1: "); ps1 = print_ps_fan_status(dp.power_status1); printf(" Power Supply 2: "); ps2 = print_ps_fan_status(dp.power_status2); printf("\n Fan Status\n"); printf(" Fan 1: "); fan1 = print_ps_fan_status(dp.fan_status1); printf(" Fan 2: "); fan2 = print_ps_fan_status(dp.fan_status2); printf(" Fan 3: "); fan3 = print_ps_fan_status(dp.fan_status3); printf("\n Repeater Status: "); rpt = print_repeater_status(dp.repeater_status); printf("\n VPD Card Status: "); vpd_card = print_vpd_card_status(dp.vpd_card_status); if (cmd_opts.verbose) { printf("\n\nRaw diagnostic page:\n"); print_raw_data(stdout, (char *)&dp, buf_len); } printf("\n"); if ((ps1 > 0) || (ps2 > 0) || (fan1 > 0) || (fan2 > 0) || (fan3 > 0) || (rpt > 0) || (vpd_card > 0)) failure = 1; if (failure && cmd_opts.serv_event) { /* Generate serviceable event(s) */ /* Check power supply 1 */ if (ps1 == FAULT_CRITICAL) { if (ps2 != OK) pearl_servevent(CRIT_PS, 1, encl_id, vpd); else pearl_servevent(REDUNDANT, 1, encl_id, vpd); } else if (ps1 == FAULT_NONCRITICAL) { if (ps2 != OK) pearl_servevent(NONCRIT_PS, 1, encl_id, vpd); else pearl_servevent(REDUNDANT, 1, encl_id, vpd); } /* Check power supply 2 */ if (ps2 == FAULT_CRITICAL) { if (ps1 != OK) pearl_servevent(CRIT_PS, 2, encl_id, vpd); else pearl_servevent(REDUNDANT, 2, encl_id, vpd); } else if (ps2 == FAULT_NONCRITICAL) { if (ps1 != OK) pearl_servevent(NONCRIT_PS, 2, encl_id, vpd); else pearl_servevent(REDUNDANT, 2, encl_id, vpd); } /* Check fan 1 */ if (fan1 == FAULT_CRITICAL) { if ((fan2 != OK) || (fan3 != OK)) pearl_servevent(CRIT_FAN, 1, encl_id, vpd); else pearl_servevent(REDUNDANT, 1, encl_id, vpd); } else if (fan1 == FAULT_NONCRITICAL) { if ((fan2 != OK) || (fan3 != OK)) pearl_servevent(NONCRIT_FAN, 1, encl_id, vpd); else pearl_servevent(REDUNDANT, 1, encl_id, vpd); } /* Check fan 2 */ if (fan2 == FAULT_CRITICAL) { if ((fan1 != OK) || (fan3 != OK)) pearl_servevent(CRIT_FAN, 2, encl_id, vpd); else pearl_servevent(REDUNDANT, 2, encl_id, vpd); } else if (fan2 == FAULT_NONCRITICAL) { if ((fan1 != OK) || (fan3 != OK)) pearl_servevent(NONCRIT_FAN, 2, encl_id, vpd); else pearl_servevent(REDUNDANT, 2, encl_id, vpd); } /* Check fan 3 */ if (fan3 == FAULT_CRITICAL) { if ((fan1 != OK) || (fan2 != OK)) pearl_servevent(CRIT_FAN, 3, encl_id, vpd); else pearl_servevent(REDUNDANT, 3, encl_id, vpd); } else if (fan3 == FAULT_NONCRITICAL) { if ((fan1 != OK) || (fan2 != OK)) pearl_servevent(NONCRIT_FAN, 3, encl_id, vpd); else pearl_servevent(REDUNDANT, 3, encl_id, vpd); } /* Check repeater card */ if (rpt == FAULT_CRITICAL) { pearl_servevent(CRIT_REPEATER, 1, encl_id, vpd); } /* Check VPD card */ if (vpd_card == FAULT_CRITICAL) { pearl_servevent(CRIT_VPD, 1, encl_id, vpd); } } return failure; } ppc64-diag-2.7.4/diags/bluehawk.c0000644000000000000000000004527013135275400013316 00000000000000/* * Copyright (C) 2012, 2015, 2016 IBM Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include #include #include #include #include "encl_common.h" #include "encl_util.h" #include "diag_encl.h" #include "bluehawk.h" static void bh_print_drive_status(struct disk_status *s) { static enum element_status_code valid_codes[] = { ES_OK, ES_CRITICAL, ES_NONCRITICAL, ES_NOT_INSTALLED, ES_EOL }; return print_drive_status(s, valid_codes); } static void bh_print_enclosure_status(struct enclosure_status *s) { /* Note: Deviation from spec V0.7 * Spec author says below are valid state */ static enum element_status_code valid_codes[] = { ES_OK, ES_CRITICAL, ES_NONCRITICAL, ES_EOL }; return print_enclosure_status(s, valid_codes); } static void bh_print_fan_status(struct fan_status *s) { const char *speed[] = { "Fan at lowest speed", "Fan at 1-16% of highest speed", "Fan at 17-33% of highest speed", "Fan at 34-49% of highest speed", "Fan at 50-66% of highest speed", "Fan at 67-83% of highest speed", "Fan at 84-99% of highest speed", "Fan at highest speed" }; static enum element_status_code valid_codes[] = { ES_OK, ES_CRITICAL, ES_NONCRITICAL, ES_NOT_INSTALLED, ES_UNKNOWN, ES_EOL }; return print_fan_status(s, valid_codes, speed); } static void bh_print_sas_connector_status(struct sas_connector_status *s) { enum element_status_code sc = (enum element_status_code) s->byte0.status; static enum element_status_code valid_codes[] = { ES_OK, ES_NONCRITICAL, ES_NOT_INSTALLED, ES_EOL }; printf("%s", status_string(sc, valid_codes)); CHK_IDENT_LED(s); CHK_FAULT_LED(s); printf("\n"); } static void bh_print_scc_controller_status(struct scc_controller_element_status *s) { enum element_status_code sc = (enum element_status_code) s->byte0.status; static enum element_status_code valid_codes[] = { ES_OK, ES_CRITICAL, ES_NOT_INSTALLED, ES_NOT_AVAILABLE, ES_EOL }; printf("%s", status_string(sc, valid_codes)); if (s->report) printf(" | REPORT"); CHK_IDENT_LED(s); CHK_FAULT_LED(s); printf("\n"); } static void bh_print_midplane_status(struct midplane_status *s) { enum element_status_code sc = (enum element_status_code) s->byte0.status; static enum element_status_code valid_codes[] = { ES_OK, ES_CRITICAL, ES_EOL }; printf("%s", status_string(sc, valid_codes)); CHK_IDENT_LED(s); CHK_FAULT_LED(s); printf("\n"); } /* Create a callout for power supply i (i = 0 or 1). */ static int bh_create_ps_callout(struct sl_callout **callouts, char *location, unsigned int i, int fd) { char fru_number[FRU_NUMBER_LEN + 1]; char serial_number[SERIAL_NUMBER_LEN + 1]; int rc; struct power_supply_descriptor *ps_vpd[2]; struct bh_element_descriptor_page *edp; if (fd < 0) { add_location_callout(callouts, location); return 0; } edp = calloc(1, sizeof(struct bh_element_descriptor_page)); if (!edp) { fprintf(stderr, "Failed to allocate memory to " "hold page containing VPD for PS (pg 07h).\n"); return 1; } rc = get_diagnostic_page(fd, RECEIVE_DIAGNOSTIC, 7, edp, sizeof(struct bh_element_descriptor_page)); if (rc) { add_location_callout(callouts, location); goto out; } ps_vpd[0] = &(edp->ps0_vpd); ps_vpd[1] = &(edp->ps1_vpd); strzcpy(fru_number, ps_vpd[i]->fru_number, FRU_NUMBER_LEN); strzcpy(serial_number, ps_vpd[i]->serial_number, SERIAL_NUMBER_LEN); add_callout(callouts, 'M', 0, NULL, location, fru_number, serial_number, NULL); out: free(edp); return 0; } static int bh_report_faults_to_svclog(struct dev_vpd *vpd, struct bluehawk_diag_page2 *dp, int fd) { char location[LOCATION_LENGTH], *loc_suffix; char description[EVENT_DESC_SIZE], crit[ES_STATUS_STRING_MAXLEN]; char srn[SRN_SIZE]; unsigned int i; int sev, loc_suffix_size; char run_diag_encl[] = " Run diag_encl for more detailed status," " and refer to the system service documentation for guidance."; char ref_svc_doc[] = " Refer to the system service documentation for guidance."; struct sl_callout *callouts; const char *left_right[] = { "left", "right" }; struct bluehawk_diag_page2 *prev_dp = NULL; /* for -c */ strncpy(location, vpd->location, LOCATION_LENGTH - 1); location[LOCATION_LENGTH - 1] = '\0'; loc_suffix_size = LOCATION_LENGTH - strlen(location); loc_suffix = location + strlen(location); if (cmd_opts.cmp_prev) { prev_dp = calloc(1, sizeof(struct bluehawk_diag_page2)); if (!prev_dp) { fprintf(stderr, "Failed to allocate memory to hold " "prev. status diagnostics page 02 results.\n"); return 1; } if (read_page2_from_file(cmd_opts.prev_path, false, prev_dp, sizeof(struct bluehawk_diag_page2)) != 0) { free(prev_dp); prev_dp = NULL; } } /* disk drives */ for (i = 0; i < NR_DISKS_PER_BLUEHAWK; i++) { sev = svclog_element_status(&(dp->disk_status[i].byte0), (char *) dp, (char *) prev_dp, crit); if (sev == 0) continue; snprintf(description, EVENT_DESC_SIZE, "%s fault in RAID enclosure disk %u.%s", crit, i + 1, run_diag_encl); snprintf(loc_suffix, loc_suffix_size, "-P1-D%u", i+1); callouts = NULL; /* VPD for disk drives is not available from the SES. */ add_location_callout(&callouts, location); servevent("none", sev, description, vpd, callouts); } /* power supplies */ for (i = 0; i < 2; i++) { sev = svclog_element_status(&(dp->ps_status[i].byte0), (char *) dp, (char *) prev_dp, crit); if (sev == 0) continue; snprintf(description, EVENT_DESC_SIZE, "%s fault in %s power supply in RAID enclosure.%s", crit, left_right[i], run_diag_encl); snprintf(loc_suffix, loc_suffix_size, "-P1-E%u", i+1); build_srn(srn, SRN_RC_CRIT_PS); callouts = NULL; if (bh_create_ps_callout(&callouts, location, i, fd)) goto err_out; servevent(srn, sev, description, vpd, callouts); } /* voltage sensors */ for (i = 0; i < 2; i++) { sev = svclog_composite_status(&(dp->voltage_sensor_sets[i]), (char *) dp, (char *) prev_dp, 2, crit); if (sev == 0) continue; snprintf(description, EVENT_DESC_SIZE, "%s fault associated with %s power supply in RAID " "enclosure: voltage sensor(s) reporting voltage(s) " "out of range.%s", crit, left_right[i], run_diag_encl); snprintf(loc_suffix, loc_suffix_size, "-P1-E%u", i+1); build_srn(srn, SRN_RC_VOLTAGE_THRESHOLD); callouts = NULL; if (bh_create_ps_callout(&callouts, location, i, fd)) goto err_out; servevent(srn, sev, description, vpd, callouts); } /* power-supply fans -- lump with power supplies, not fan assemblies */ for (i = 0; i < 2; i++) { sev = svclog_element_status( &(dp->fan_sets[i].power_supply.byte0), (char *) dp, (char *) prev_dp, crit); if (sev == 0) continue; snprintf(description, EVENT_DESC_SIZE, "%s fault in fan for %s power supply in RAID " "enclosure.%s", crit, left_right[i], run_diag_encl); snprintf(loc_suffix, loc_suffix_size, "-P1-E%u", i+1); build_srn(srn, SRN_RC_CRIT_PS); callouts = NULL; if (bh_create_ps_callout(&callouts, location, i, fd)) goto err_out; servevent(srn, sev, description, vpd, callouts); } /* fan assemblies */ for (i = 0; i < 2; i++) { /* 4 fans for each fan assembly */ sev = svclog_composite_status(&(dp->fan_sets[i].fan_element), (char *) dp, (char *) prev_dp, 4, crit); if (sev == 0) continue; snprintf(description, EVENT_DESC_SIZE, "%s fault in %s fan assembly in RAID enclosure.%s", crit, left_right[i], run_diag_encl); snprintf(loc_suffix, loc_suffix_size, "-P1-C%u-A1", i+1); build_srn(srn, SRN_RC_CRIT_FAN); callouts = NULL; /* VPD for fan assemblies is not available from the SES. */ add_location_callout(&callouts, location); servevent(srn, sev, description, vpd, callouts); } /* power-supply temperature sensors -- lump with power supplies */ for (i = 0; i < 2; i++) { /* 2 sensors for each power supply */ sev = svclog_composite_status( &(dp->temp_sensor_sets[i].power_supply), (char *) dp, (char *) prev_dp, 2, crit); if (sev == 0) continue; snprintf(description, EVENT_DESC_SIZE, "%s fault associated with %s power supply in RAID " "enclosure: temperature sensor(s) reporting " "temperature(s) out of range.%s", crit, left_right[i], run_diag_encl); snprintf(loc_suffix, loc_suffix_size, "-P1-E%u", i+1); build_srn(srn, SRN_RC_PS_TEMP_THRESHOLD); callouts = NULL; if (bh_create_ps_callout(&callouts, location, i, fd)) goto err_out; servevent(srn, sev, description, vpd, callouts); } /* temp sensors, except for those associated with power supplies */ for (i = 0; i < 2; i++) { /* 5 sensors: croc, ppc, expander, 2*ambient */ sev = svclog_composite_status(&(dp->temp_sensor_sets[i]), (char *) dp, (char *) prev_dp, 5, crit); if (sev == 0) continue; snprintf(description, EVENT_DESC_SIZE, "%s fault associated with %s side of RAID " "enclosure: temperature sensor(s) reporting " "temperature(s) out of range.%s", crit, left_right[i], run_diag_encl); /* Not the power supply, so assume the warhawk. */ snprintf(loc_suffix, loc_suffix_size, "-P1-C%u", i+1); build_srn(srn, SRN_RC_TEMP_THRESHOLD); callouts = NULL; create_esm_callout(&callouts, location, i, fd); servevent(srn, sev, description, vpd, callouts); } /* ERM/ESM electronics */ for (i = 0; i < 2; i++) { sev = svclog_element_status(&(dp->esm_status[i].byte0), (char *) dp, (char *) prev_dp, crit); if (sev == 0) continue; snprintf(description, EVENT_DESC_SIZE, "%s electronics fault in %s Enclosure RAID Module.%s", crit, left_right[i], ref_svc_doc); snprintf(loc_suffix, loc_suffix_size, "-P1-C%u", i+1); build_srn(srn, SRN_RC_CRIT_ESM); callouts = NULL; create_esm_callout(&callouts, location, i, fd); servevent(srn, sev, description, vpd, callouts); } /* SAS connectors */ for (i = 0; i < 4; i++) { unsigned int t = i%2 + 1, lr = i/2; sev = svclog_element_status( &(dp->sas_connector_status[i].byte0), (char *) dp, (char *) prev_dp, crit); if (sev == 0) continue; snprintf(description, EVENT_DESC_SIZE, "%s fault in SAS connector T%u of %s RAID Enclosure" " Module.%s", crit, t, left_right[lr], ref_svc_doc); snprintf(loc_suffix, loc_suffix_size, "-P1-C%u-T%u", lr+1, t); callouts = NULL; /* No VPD for SAS connectors in the SES. */ add_location_callout(&callouts, location); servevent("none", sev, description, vpd, callouts); } /* PCIe controllers */ for (i = 0; i < 2; i++) { sev = svclog_element_status( &(dp->scc_controller_status[i].byte0), (char *) dp, (char *) prev_dp, crit); if (sev == 0) continue; snprintf(description, EVENT_DESC_SIZE, "%s fault in PCIe controller for %s RAID Enclosure " "Module.%s", crit, left_right[i], ref_svc_doc); snprintf(loc_suffix, loc_suffix_size, "-P1-C%u-T3", i+1); callouts = NULL; /* No VPD for PCIe controllers in the SES. */ add_location_callout(&callouts, location); servevent("none", sev, description, vpd, callouts); } /* midplane */ sev = svclog_element_status(&(dp->midplane_element_status.byte0), (char *) dp, (char *) prev_dp, crit); if (sev != 0) { snprintf(description, EVENT_DESC_SIZE, "%s fault in midplane of RAID enclosure.%s", crit, ref_svc_doc); strncpy(loc_suffix, "-P1", loc_suffix_size - 1); loc_suffix[loc_suffix_size - 1] = '\0'; callouts = NULL; create_midplane_callout(&callouts, location, fd); servevent("none", sev, description, vpd, callouts); } if (prev_dp) free(prev_dp); return write_page2_to_file(cmd_opts.prev_path, dp, sizeof(struct bluehawk_diag_page2)); err_out: if (prev_dp) free(prev_dp); return 1; } static int bh_turn_on_fault_leds(struct bluehawk_diag_page2 *dp, int fd) { int i; int poked_leds = 0; struct bluehawk_ctrl_page2 *ctrl_page; ctrl_page = calloc(1, sizeof(struct bluehawk_ctrl_page2)); if (!ctrl_page) { fprintf(stderr, "Failed to allocate memory to hold " "control diagnostics page 02.\n"); return 1; } /* disk drives */ for (i = 0; i < NR_DISKS_PER_BLUEHAWK; i++) FAULT_LED(poked_leds, dp, ctrl_page, disk_ctrl[i], disk_status[i]); /* power supplies */ for (i = 0; i < 2; i++) FAULT_LED(poked_leds, dp, ctrl_page, ps_ctrl[i], ps_status[i]); /* No LEDs for voltage sensors */ /* fan assemblies */ for (i = 0; i < 2; i++) { enum element_status_code sc = composite_status(&(dp->fan_sets[i]), 5); if (sc != ES_OK && sc != ES_NOT_INSTALLED) FAULT_LED(poked_leds, dp, ctrl_page, fan_sets[i].fan_element[0], fan_sets[i].fan_element[0]); } /* No LEDs for temperature sensors */ /* ERM/ESM electronics */ for (i = 0; i < 2; i++) FAULT_LED(poked_leds, dp, ctrl_page, esm_ctrl[i], esm_status[i]); /* SAS connectors */ for (i = 0; i < 4; i++) FAULT_LED(poked_leds, dp, ctrl_page, sas_connector_ctrl[i], sas_connector_status[i]); /* PCIe controllers */ for (i = 0; i < 2; i++) FAULT_LED(poked_leds, dp, ctrl_page, scc_controller_ctrl[i], scc_controller_status[i]); /* midplane */ FAULT_LED(poked_leds, dp, ctrl_page, midplane_element_ctrl, midplane_element_status); if (poked_leds) { int result; ctrl_page->page_code = 2; ctrl_page->page_length = sizeof(struct bluehawk_ctrl_page2) - 4; /* Convert host byte order to network byte order */ ctrl_page->page_length = htons(ctrl_page->page_length); ctrl_page->generation_code = 0; result = do_ses_cmd(fd, SEND_DIAGNOSTIC, 0, 0x10, 6, SG_DXFER_TO_DEV, ctrl_page, sizeof(struct bluehawk_ctrl_page2)); if (result != 0) { perror("ioctl - SEND_DIAGNOSTIC"); fprintf(stderr, "result = %d\n", result); fprintf(stderr, "failed to set LED(s) via SES\n"); free(ctrl_page); return -1; } } free(ctrl_page); return 0; } /* @return 0 for success, 1 for failure */ int diag_bluehawk(int fd, struct dev_vpd *vpd) { int i; static const char *power_supply_names[] = { "PS0 (Left)", "PS1 (Right)" }; static const char *fan_set_names[] = { "Left Fan Assembly", "Right Fan Assembly", }; static const char *temp_sensor_set_names[] = { "Left", "Right" }; static const char *esm_names[] = { "Left", "Right" }; static const char *sas_connector_names[] = { "Left - T1", "Left - T2", "Right - T1", "Right - T2" }; static const char *scc_controller_names[] = { "Left", "Right" }; int rc; struct bluehawk_diag_page2 *dp; dp = calloc(1, sizeof(struct bluehawk_diag_page2)); if (!dp) { fprintf(stderr, "Failed to allocate memory to hold " "current status diagnostics page 02 results.\n"); return 1; } if (cmd_opts.fake_path) { rc = read_page2_from_file(cmd_opts.fake_path, true, dp, sizeof(struct bluehawk_diag_page2)); fd = -1; } else rc = get_diagnostic_page(fd, RECEIVE_DIAGNOSTIC, 2, (void *)dp, (int) sizeof(struct bluehawk_diag_page2)); if (rc != 0) { fprintf(stderr, "Failed to read SES diagnostic page; " "cannot report status.\n"); goto err_out; } printf(" Overall Status: "); if (dp->crit) { printf("CRITICAL_FAULT"); if (dp->non_crit) printf(" | NON_CRITICAL_FAULT"); } else if (dp->non_crit) printf("NON_CRITICAL_FAULT"); else printf("ok"); printf("\n\n Drive Status\n"); for (i = 0; i < NR_DISKS_PER_BLUEHAWK; i++) { struct disk_status *ds = &(dp->disk_status[i]); printf(" Disk %02d (Slot %02d): ", i+1, ds->byte1.element_status.slot_address); bh_print_drive_status(ds); } printf("\n Power Supply Status\n"); for (i = 0; i < 2; i++) { printf(" %s: ", power_supply_names[i]); print_power_supply_status(&(dp->ps_status[i])); printf(" 12V: "); print_voltage_sensor_status( &(dp->voltage_sensor_sets[i].sensor_12V)); printf(" 3.3VA: "); print_voltage_sensor_status( &(dp->voltage_sensor_sets[i].sensor_3_3VA)); } printf("\n Fan Status\n"); for (i = 0; i < 2; i++) { int j; printf(" %s:\n", fan_set_names[i]); printf(" Power Supply: "); bh_print_fan_status(&(dp->fan_sets[i].power_supply)); for (j = 0; j < 4; j++) { printf(" Fan Element %d: ", j); bh_print_fan_status(&(dp->fan_sets[i].fan_element[j])); } } printf("\n Temperature Sensors\n"); for (i = 0; i < 2; i++) { int j; struct temperature_sensor_set *tss = &(dp->temp_sensor_sets[i]); printf(" %s:\n", temp_sensor_set_names[i]); printf(" CRoC: "); print_temp_sensor_status(&tss->croc); printf(" PPC: "); print_temp_sensor_status(&tss->ppc); printf(" Expander: "); print_temp_sensor_status(&tss->expander); for (j = 0; j < 2; j++) { printf(" Ambient %d: ", j); print_temp_sensor_status(&tss->ambient[j]); } for (j = 0; j < 2; j++) { printf(" Power Supply %d: ", j); print_temp_sensor_status(&tss->power_supply[j]); } } printf("\n Enclosure Status: "); bh_print_enclosure_status(&(dp->enclosure_element_status)); printf("\n ERM Electronics Status\n"); for (i = 0; i < 2; i++) { printf(" %s: ", esm_names[i]); print_esm_status(&(dp->esm_status[i])); } printf("\n SAS Connector Status\n"); for (i = 0; i < 4; i++) { printf(" %s: ", sas_connector_names[i]); bh_print_sas_connector_status(&(dp->sas_connector_status[i])); } printf("\n PCIe Controller Status\n"); for (i = 0; i < 2; i++) { printf(" %s: ", scc_controller_names[i]); bh_print_scc_controller_status(&(dp->scc_controller_status[i])); } printf("\n Midplane Status: "); bh_print_midplane_status(&(dp->midplane_element_status)); if (cmd_opts.verbose) { printf("\n\nRaw diagnostic page:\n"); print_raw_data(stdout, (char *) dp, sizeof(struct bluehawk_diag_page2)); } printf("\n\n"); /* * Report faults to servicelog, and turn on LEDs as appropriate. * LED status reported previously may not be accurate after we * do this, but the alternative is to report faults first and then * read the diagnostic page a second time. And unfortunately, the * changes to LED settings don't always show up immediately in * the next query of the SES. */ if (cmd_opts.serv_event) { rc = bh_report_faults_to_svclog(vpd, dp, fd); if (rc != 0) goto err_out; } /* -l is not supported for fake path */ if (fd != -1 && cmd_opts.leds) rc = bh_turn_on_fault_leds(dp, fd); err_out: free(dp); return (rc != 0); } ppc64-diag-2.7.4/diags/encl_util.c0000644000000000000000000002744313135275400013474 00000000000000/* * Copyright (C) 2012, 2015 IBM Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "utils.h" #include "encl_util.h" /** * print_raw_data * @brief Dump a section of raw data * * @param ostream stream to which output should be written * @param data pointer to data to dump * @param data_len length of data to dump * @return number of bytes written */ int print_raw_data(FILE *ostream, char *data, int data_len) { char *h, *a; char *end = data + data_len; unsigned int offset = 0; int i, j; int len = 0; len += fprintf(ostream, "\n"); h = a = data; while (h < end) { /* print offset */ len += fprintf(ostream, "0x%04x: ", offset); offset += 16; /* print hex */ for (i = 0; i < 4; i++) { for (j = 0; j < 4; j++) { if (h < end) len += fprintf(ostream, "%02x", *h++); else len += fprintf(ostream, " "); } len += fprintf(ostream, " "); } /* print ascii */ len += fprintf(ostream, " ["); for (i = 0; i < 16; i++) { if (a < end) { if ((*a >= ' ') && (*a <= '~')) len += fprintf(ostream, "%c", *a); else len += fprintf(ostream, "."); a++; } else len += fprintf(ostream, " "); } len += fprintf(ostream, "]\n"); } return len; } /** * open_sg_device * @brief Open sg device for read/write operation * * @param encl sg device name */ int open_sg_device(const char *encl) { char dev_sg[PATH_MAX]; int fd; snprintf(dev_sg, PATH_MAX, "/dev/%s", encl); fd = open(dev_sg, O_RDWR); if (fd < 0) perror(dev_sg); return fd; } /** * close_sg_device * @brief Close sg device * * @param opened encl sg device file descriptor */ int close_sg_device(int fd) { if (fd < 0) return 0; return close(fd); } /** * read_page2_from_file * @brief Read enclosure status diagnostics structure from file */ int read_page2_from_file(const char *path, bool display_error_msg, void *pg, int size) { FILE *f; f = fopen(path, "r"); if (!f) { if (display_error_msg || errno != ENOENT) perror(path); return -1; } if (fread(pg, size, 1, f) != 1) { if (display_error_msg) perror(path); fclose(f); return -2; } fclose(f); return 0; } /** * write_page2_to_file * @brief Write enclosure status diagnostics structure to file */ int write_page2_to_file(const char *path, void *pg, int size) { FILE *f; f = fopen(path, "w"); if (!f) { perror(path); return -1; } if (fwrite(pg, size, 1, f) != 1) { perror(path); fclose(f); return -2; } fclose(f); return 0; } /* * enclosure_maint_mode * @brief Check the state of SCSI enclosure * * Returns: * -1 on failure * 1 if sg is offline * 0 if sg is running */ int enclosure_maint_mode(const char *sg) { char devsg[PATH_MAX]; char sgstate[128]; FILE *fp; snprintf(devsg, PATH_MAX, "/sys/class/scsi_generic/%s/device/state", sg); fp = fopen(devsg, "r"); if (!fp) { perror(devsg); fprintf(stderr, "Unable to open enclosure " "state file : %s\n", devsg); return -1; } if (fgets_nonl(sgstate, 128, fp) == NULL) { fprintf(stderr, "Unable to read the state of " "enclosure device : %s\n", sg); fclose(fp); return -1; } /* Check device state */ if (!strcmp(sgstate, "offline")) { fprintf(stderr, "Enclosure \"%s\" is offline.\n Cannot run" " diagnostics/LED operations.\n", sg); fclose(fp); return 1; } fclose(fp); return 0; } /** * do_ses_cmd * @brief Make the necessary sg ioctl() to do the indicated SES command * * @param fd a file descriptor to the appropriate /dev/sg file * @param cmd the command code -- e.g., SEND_DIAGNOSTIC * @param page_nr the SES page number to be read or written -- 0 for write * @param flags flags for the second byte of the SCSI command buffer * @param cmd_len length in bytes of relevant data in SCSI command buffer * @paran dxfer_direction SG_DXFER_FROM_DEV or SG_DXFER_TO_DEV * @param buf the contents of the page * @param buf_len the length of the previous parameter * @return 0 on success, -EIO on invalid I/O status, or CHECK_CONDITION */ int do_ses_cmd(int fd, uint8_t cmd, uint8_t page_nr, uint8_t flags, uint8_t cmd_len, int dxfer_direction, void *buf, int buf_len) { int data_length_start_index; unsigned char scsi_cmd_buf[16] = { cmd, flags, page_nr, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; struct sense_data_t sense_data; sg_io_hdr_t hdr; int i, rc; /* * scsi_command_range command_length data_length_msb * 0x00h-0x1Fh 6 3 * 0x20h-0x5Fh 10 7 * * for more details refer, * https://en.wikipedia.org/wiki/SCSI_command */ if ((cmd >= 0x00) && (cmd <= 0x1F)) /* scsi opcode */ data_length_start_index = 3; /* msb */ else if ((cmd >= 0x20) && (cmd <= 0x5F)) data_length_start_index = 7; else return -1; /* not supported yet */ scsi_cmd_buf[data_length_start_index] = (buf_len >> 8) & 0xff; scsi_cmd_buf[data_length_start_index + 1] = buf_len & 0xff; for (i = 0; i < 3; i++) { memset(&hdr, 0, sizeof(hdr)); memset(&sense_data, 0, sizeof(struct sense_data_t)); hdr.interface_id = 'S'; hdr.dxfer_direction = dxfer_direction; hdr.cmd_len = cmd_len; hdr.mx_sb_len = sizeof(sense_data); hdr.iovec_count = 0; /* scatter gather not necessary */ hdr.dxfer_len = buf_len; hdr.dxferp = buf; hdr.cmdp = scsi_cmd_buf; hdr.sbp = (unsigned char *)&sense_data; hdr.timeout = 120 * 1000; /* set timeout to 2 minutes */ hdr.flags = 0; hdr.pack_id = 0; hdr.usr_ptr = 0; rc = ioctl(fd, SG_IO, &hdr); if ((rc == 0) && (hdr.masked_status == CHECK_CONDITION)) rc = CHECK_CONDITION; else if ((rc == 0) && (hdr.host_status || hdr.driver_status)) rc = -EIO; if (rc == 0 || hdr.host_status == 1) break; } return rc; } int get_diagnostic_page(int fd, uint8_t cmd, uint8_t page_nr, void *buf, int buf_len) { return do_ses_cmd(fd, cmd, page_nr, 0x1, 16, SG_DXFER_FROM_DEV, buf, buf_len); } /* Read a line and strip the newline. */ char * fgets_nonl(char *buf, int size, FILE *s) { char *nl; if (!fgets(buf, size, s)) return NULL; nl = strchr(buf, '\n'); if (nl == NULL) return NULL; *nl = '\0'; return buf; } /* * Find at least 2 consecutive periods after pos, skip to the end of that * set of periods, and return a pointer to the next character. * * For example, if pos points at the 'S' in * Serial Number.............24099050 * return a pointer to the '2'. * * Return NULL if there aren't 2 consecutive periods. */ static char * skip_dots(const char *pos) { pos = strstr(pos, ".."); if (!pos) return NULL; while (*pos == '.') pos++; return (char *) pos; } /* * Some versions of iprconfig/lscfg report the location code of the ESM/ERM * -- e.g., UEDR1.001.G12W34S-P1-C1. For our purposes, we usually don't want * the -P1-C1. (Don't trim location codes for disks and such.) * * TODO: This adjustment is appropriate for Bluehawks. Need to understand * what, if anything, needs to be done for (e.g.) Pearl enclosures. */ void trim_location_code(struct dev_vpd *vpd) { char *hyphen; strncpy(vpd->location, vpd->full_loc, LOCATION_LENGTH - 1); vpd->location[LOCATION_LENGTH - 1] = '\0'; hyphen = strchr(vpd->location, '-'); if (hyphen && (!strcmp(hyphen, "-P1-C1") || !strcmp(hyphen, "-P1-C2"))) *hyphen = '\0'; } /** * strzcpy * @brief Copy src to dest and append NULL char */ char * strzcpy(char *dest, const char *src, size_t n) { memcpy(dest, src, n); dest[n] = '\0'; return dest; } /* * Get enclosure type, etc. for sgN device. Caller has nulled out vpd * fields. */ int read_vpd_from_lscfg(struct dev_vpd *vpd, const char *sg) { int status = 0; char buf[128], *pos; FILE *fp; pid_t cpid; char *args[] = {LSCFG_PATH, "-vl", NULL, NULL}; /* use lscfg to find the MTM and location for the specified device */ /* Command exists and has exec permissions ? */ if (access(LSCFG_PATH, F_OK|X_OK) == -1) { fprintf(stderr, "Unable to retrieve the MTM or location code.\n" "Check that %s is installed and has execute " "permissions.", LSCFG_PATH); return -1; } args[2] = (char *const) sg; fp = spopen(args, &cpid); if (fp == NULL) { fprintf(stderr, "Unable to retrieve the MTM or location code.\n" "Failed to execute \"%s -vl %s\" command.\n", LSCFG_PATH, sg); return -1; } while (fgets_nonl(buf, 128, fp) != NULL) { if ((pos = strstr(buf, "Machine Type")) != NULL) { if (!(pos = skip_dots(pos))) continue; strncpy(vpd->mtm, pos, VPD_LENGTH - 1); } else if ((pos = strstr(buf, "Device Specific.(YL)")) != NULL) { /* Old-style label for YL */ if (!(pos = skip_dots(pos))) continue; strncpy(vpd->full_loc, pos, LOCATION_LENGTH - 1); } else if ((pos = strstr(buf, "Location Code")) != NULL) { /* Newer label for YL */ if (!(pos = skip_dots(pos))) continue; strncpy(vpd->full_loc, pos, LOCATION_LENGTH - 1); } else if ((pos = strstr(buf, "Serial Number")) != NULL) { if (!(pos = skip_dots(pos))) continue; strncpy(vpd->sn, pos, VPD_LENGTH - 1); } else if ((pos = strstr(buf, "..FN ")) != NULL) { pos += 5; while (*pos == ' ') pos++; strncpy(vpd->fru, pos, VPD_LENGTH - 1); } } trim_location_code(vpd); /* Add sg device name */ strncpy(vpd->dev, sg, PATH_MAX - 1); status = spclose(fp, cpid); /* spclose failed */ if (status == -1) { fprintf(stderr, "%s : %d -- Failed in spclose(), " "error : %s\n", __func__, __LINE__, strerror(errno)); return -1; } /* spclose() succeeded, but command failed */ if (status != 0) { fprintf(stdout, "%s : %d -- spclose() exited with status : " "%d\n", __func__, __LINE__, status); return -1; } return 0; } /* * Validate sg device. * * Note: * /sys/class/enclosure//device/scsi_generic/ dir * will have the 'scsi' generic name of the device. * * Returns: 0 on valid enclosure device, -1 on invalid enclosure device. */ int valid_enclosure_device(const char *sg) { struct dirent *edirent, *sdirent; DIR *edir, *sdir; char path[PATH_MAX]; edir = opendir(SCSI_SES_PATH); if (!edir) { fprintf(stderr, "System does not have SCSI enclosure(s).\n"); return -1; } /* loop over all enclosures */ while ((edirent = readdir(edir)) != NULL) { if (!strcmp(edirent->d_name, ".") || !strcmp(edirent->d_name, "..")) continue; snprintf(path, PATH_MAX, "%s/%s/device/scsi_generic", SCSI_SES_PATH, edirent->d_name); sdir = opendir(path); if (!sdir) continue; while ((sdirent = readdir(sdir)) != NULL) { if (!strcmp(sdirent->d_name, ".") || !strcmp(sdirent->d_name, "..")) continue; /* found sg device */ if (!strcmp(sdirent->d_name, sg)) goto out; } closedir(sdir); } closedir(edir); fprintf(stderr, "%s is not a valid enclosure device\n", sg); return -1; out: closedir(sdir); closedir(edir); return 0; } void element_check_range(unsigned int n, unsigned int min, unsigned int max, const char *lc) { if (n < min || n > max) { fprintf(stderr, "Number %u out of range in location code %s\n", n, lc); exit(1); } } ppc64-diag-2.7.4/diags/encl_common.c0000644000000000000000000004277713135275400014016 00000000000000/* * Copyright (C) 2015 IBM Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include #include #include #include #include "encl_common.h" #include "encl_util.h" #include "diag_encl.h" #include "platform.h" struct event_severity_map { int severity; char *desc; }; static struct event_severity_map event_severity_map[] = { {SL_SEV_FATAL, "Fatal"}, {SL_SEV_ERROR, "Critical"}, {SL_SEV_ERROR_LOCAL, "Critical"}, {SL_SEV_WARNING, "Non-Critical"}, {SL_SEV_EVENT, "Normal"}, {SL_SEV_INFO, "Infomational"}, {SL_SEV_DEBUG, "Debug"}, {-1, "Unknown"}, }; /** Helper function to print enclosure component status **/ int status_is_valid(enum element_status_code sc, enum element_status_code valid_codes[]) { enum element_status_code *v; for (v = valid_codes; *v < ES_EOL; v++) if (sc == *v) return 1; return 0; } const char * status_string(enum element_status_code sc, enum element_status_code valid_codes[]) { static char invalid_msg[40]; /* So we're not reentrant. */ if (!status_is_valid(sc, valid_codes)) { snprintf(invalid_msg, 40, "(UNEXPECTED_STATUS_CODE=%u)", sc); return invalid_msg; } switch (sc) { default: case ES_UNSUPPORTED: return "UNSUPPORTED"; case ES_OK: return "ok"; case ES_CRITICAL: return "CRITICAL_FAULT"; case ES_NONCRITICAL: return "NON_CRITICAL_FAULT"; case ES_UNRECOVERABLE: return "UNRECOVERABLE_FAULT"; case ES_NOT_INSTALLED: return "(empty)"; case ES_UNKNOWN: return "UNKNOWN"; case ES_NOT_AVAILABLE: return "NOT_AVAILABLE"; case ES_NO_ACCESS_ALLOWED: return "NO_ACCESS_ALLOWED"; } /*NOTREACHED*/ } void print_enclosure_status(struct enclosure_status *s, enum element_status_code valid_codes[]) { enum element_status_code sc = (enum element_status_code) s->byte0.status; printf("%s", status_string(sc, valid_codes)); if (s->failure_requested) printf(" | FAILURE_REQUESTED"); CHK_IDENT_LED(s); CHK_FAULT_LED(s); printf("\n"); } void print_drive_status(struct disk_status *s, enum element_status_code valid_codes[]) { enum element_status_code sc = (enum element_status_code) s->byte0.status; printf("%s", status_string(sc, valid_codes)); if (s->ready_to_insert) printf(" | INSERT"); if (s->rmv) printf(" | REMOVE"); if (s->app_client_bypassed_a) printf(" | APP_CLIENT_BYPASSED_A"); if (s->app_client_bypassed_b) printf(" | APP_CLIENT_BYPASSED_B"); if (s->bypassed_a) printf(" | BYPASSED_A"); if (s->bypassed_b) printf(" | BYPASSED_B"); CHK_IDENT_LED(s); CHK_FAULT_LED(s); printf("\n"); } void print_esm_status(struct esm_status *s) { enum element_status_code sc = (enum element_status_code) s->byte0.status; static enum element_status_code valid_codes[] = { ES_OK, ES_CRITICAL, ES_NONCRITICAL, ES_NOT_INSTALLED, ES_EOL }; printf("%s", status_string(sc, valid_codes)); CHK_IDENT_LED(s); CHK_FAULT_LED(s); printf("\n"); } void print_temp_sensor_status(struct temperature_sensor_status *s) { enum element_status_code sc = (enum element_status_code) s->byte0.status; static enum element_status_code valid_codes[] = { ES_OK, ES_CRITICAL, ES_NONCRITICAL, ES_NOT_INSTALLED, ES_UNKNOWN, ES_EOL }; printf("%s", status_string(sc, valid_codes)); if (s->ot_failure) printf(" | OVER_TEMPERATURE_FAILURE"); if (s->ot_warning) printf(" | OVER_TEMPERATURE_WARNING"); if (cmd_opts.verbose) /* between -19 and +235 degrees Celsius */ printf(" | TEMPERATURE = %dC", s->temperature - 20); printf("\n"); } void print_fan_status(struct fan_status *s, enum element_status_code valid_codes[], const char *speed[]) { enum element_status_code sc = (enum element_status_code) s->byte0.status; printf("%s", status_string(sc, valid_codes)); CHK_IDENT_LED(s); CHK_FAULT_LED(s); if (cmd_opts.verbose) printf(" | %s", speed[s->speed_code]); printf("\n"); } void print_power_supply_status(struct power_supply_status *s) { enum element_status_code sc = (enum element_status_code) s->byte0.status; static enum element_status_code valid_codes[] = { ES_OK, ES_CRITICAL, ES_NONCRITICAL, ES_NOT_INSTALLED, ES_EOL }; printf("%s", status_string(sc, valid_codes)); if (s->dc_fail) printf(" | DC_FAIL"); if (s->dc_over_voltage) printf(" | DC_OVER_VOLTAGE"); if (s->dc_under_voltage) printf(" | DC_UNDER_VOLTAGE"); if (s->dc_over_current) printf(" | DC_OVER_CURRENT"); if (s->ac_fail) printf(" | AC_FAIL"); CHK_IDENT_LED(s); CHK_FAULT_LED(s); printf("\n"); } void print_voltage_sensor_status(struct voltage_sensor_status *s) { enum element_status_code sc = (enum element_status_code) s->byte0.status; static enum element_status_code valid_codes[] = { ES_OK, ES_CRITICAL, ES_NONCRITICAL, ES_NOT_INSTALLED, ES_UNKNOWN, ES_EOL }; printf("%s", status_string(sc, valid_codes)); if (s->warn_over) printf(" | NON_CRITICAL_OVER_VOLTAGE"); if (s->warn_under) printf(" | NON_CRITICAL_UNDER_VOLTAGE"); if (s->crit_over) printf(" | CRITICAL_OVER_VOLTAGE"); if (s->crit_under) printf(" | CRITICAL_UNDER_VOLTAGE"); if (cmd_opts.verbose) /* between +327.67 to -327.68 */ printf(" | VOLTAGE = %.2f volts", ntohs(s->voltage) / 100.0); printf("\n"); } /* Helper functions for reporting faults to servicelog start here. */ /* * Factor new status into the composite status cur. A missing element * (ES_NOT_INSTALLED) is ignored. A non-critical status is less severe * than critical. Otherwise assume that an increasing value of * element_status_code indicates an increasing severity. Return the more * severe of new and cur. */ static enum element_status_code worse_element_status(enum element_status_code cur, enum element_status_code new) { if (new == ES_OK || new == ES_NOT_INSTALLED) return cur; if ((cur == ES_OK || cur == ES_NONCRITICAL) && new > ES_OK) return new; return cur; } /* * Calculate the composite status for the nel elements starting at * address first_element. We exploit the fact that every status element * is 4 bytes and starts with an element_status_byte0 struct. */ enum element_status_code composite_status(const void *first_element, int nel) { int i; const char *el = (const char *)first_element; enum element_status_code s = ES_OK; const struct element_status_byte0 *new_byte0; for (i = 0; i < nel; i++, el += 4) { new_byte0 = (const struct element_status_byte0 *) el; s = worse_element_status(s, (enum element_status_code) new_byte0->status); } return s; } static int status_worsened(enum element_status_code old, enum element_status_code new) { return (worse_element_status(old, new) != old); } /* * b is the address of a status byte 0 in dp (i.e., the status page we just * read from the SES). If prev_dp has been populated, compare the old and * new status, and return 1 if the new status is worse, 0 otherwise. If * prev_dp isn't valid, return 1. */ static int element_status_reportable(const struct element_status_byte0 *new, const char * const dp, const char * const prev_dp) { ptrdiff_t offset; struct element_status_byte0 *old; if (!prev_dp) return 1; offset = ((char *) new) - dp; old = (struct element_status_byte0 *) (prev_dp + offset); return status_worsened((enum element_status_code) old->status, (enum element_status_code) new->status); } /* * If the status byte indicates a fault that needs to be reported, return * the appropriate servicelog status and start the description text * accordingly. Else return 0. */ static uint8_t svclog_status(enum element_status_code sc, char *crit) { if (sc == ES_CRITICAL) { strncpy(crit, "Critical", ES_STATUS_STRING_MAXLEN - 1); crit[ES_STATUS_STRING_MAXLEN - 1] = '\0'; return SL_SEV_ERROR; } else if (sc == ES_NONCRITICAL) { strncpy(crit, "Non-critical", ES_STATUS_STRING_MAXLEN - 1); crit[ES_STATUS_STRING_MAXLEN - 1] = '\0'; return SL_SEV_WARNING; } else return 0; } uint8_t svclog_element_status(struct element_status_byte0 *b, const char * const dp, const char * const prev_dp, char *crit) { if (!element_status_reportable(b, dp, prev_dp)) return 0; return svclog_status(b->status, crit); } /* * Like element_status_reportable(), except we return 1 if the status of any * of the nel elements has worsened. */ static int composite_status_reportable(const void *first_element, const char * const dp, const char * const prev_dp, int nel) { int i; const char *el = (const char *) first_element; if (!prev_dp) return 1; for (i = 0; i < nel; i++, el += 4) { if (element_status_reportable( (const struct element_status_byte0 *) el, (char *) dp, (char *) prev_dp)) return 1; } return 0; } uint8_t svclog_composite_status(const void *first_element, const char * const dp, const char * const prev_dp, int nel, char *crit) { if (!composite_status_reportable(first_element, dp, prev_dp, nel)) return 0; return svclog_status(composite_status(first_element, nel), crit); } /* Get severity description */ static char * get_event_severity_desc(int severity) { int i; for (i = 0; event_severity_map[i].severity != -1; i++) if (severity == event_severity_map[i].severity) return event_severity_map[i].desc; return "Unknown"; } /** * Get service action based on severity * * Presently we are clasifying event into two category: * - Service action and call home required * - No service action required * * In future we may add below event type for WARNING events * (similar to ELOG): * - Service action required **/ static char * get_event_action_desc(int severity) { switch (severity) { case SL_SEV_FATAL: case SL_SEV_ERROR: case SL_SEV_ERROR_LOCAL: return "Service action and call home required"; case SL_SEV_WARNING: /* Fall through */ case SL_SEV_EVENT: case SL_SEV_INFO: case SL_SEV_DEBUG: default: break; } return "No service action required"; } /** * add_callout * @brief Create a new sl_callout struct * * @param callouts address of pointer to callout list * @param priority callout priority * @param type callout type * @param proc_id callout procedure ID * @param location callout location code * @param fru callout FRU number * @param sn callout FRU serial number * @param ccin callout FRU ccin */ void add_callout(struct sl_callout **callouts, char priority, uint32_t type, char *proc_id, char *location, char *fru, char *sn, char *ccin) { struct sl_callout *c; if (*callouts == NULL) { *callouts = calloc(1, sizeof(struct sl_callout)); c = *callouts; } else { c = *callouts; while (c->next != NULL) c = c->next; c->next = calloc(1, sizeof(struct sl_callout)); c = c->next; } if (c == NULL) { fprintf(stderr, "Out of memory\n"); return; } c->priority = priority; c->type = type; if (proc_id) { c->procedure = strdup(proc_id); if (c->procedure == NULL) goto err_out; } if (location) { c->location = strdup(location); if (c->location == NULL) goto err_out; } if (fru) { c->fru = strdup(fru); if (c->fru == NULL) goto err_out; } if (sn) { c->serial = strdup(sn); if (c->serial == NULL) goto err_out; } if (ccin) { c->ccin = strdup(ccin); if (c->ccin == NULL) goto err_out; } return; err_out: free(c->procedure); free(c->location); free(c->fru); free(c->serial); free(c->ccin); free(c); fprintf(stderr, "%s : %d - Failed to allocate memory.\n", __func__, __LINE__); } /* Add a callout with just the location code */ void add_location_callout(struct sl_callout **callouts, char *location) { add_callout(callouts, 'M', 0, NULL, location, NULL, NULL, NULL); } /* Add VPD info from VPD inquiry page */ void add_callout_from_vpd_page(struct sl_callout **callouts, char *location, struct vpd_page *vpd) { char fru_number[8+1]; char serial_number[12+1]; char ccin[4+1]; strzcpy(fru_number, vpd->fru_number, 8); strzcpy(serial_number, vpd->serial_number, 12); strzcpy(ccin, vpd->model_number, 4); add_callout(callouts, 'M', 0, NULL, location, fru_number, serial_number, ccin); } /** * servicelog_log_event * @brief Generate a serviceable event and an entry to the servicelog * * @param refcode the SRN or SRC for the serviceable event * @param sev the severity of the event * @param text the description of the serviceable event * @param vpd a structure containing the VPD of the target * @param callouts a linked list of FRU callouts * @return key of the new servicelog entry */ static uint32_t servicelog_log_event(const char *refcode, int sev, const char *text, struct dev_vpd *vpd, struct sl_callout *callouts) { struct servicelog *slog; struct sl_event *entry = NULL; struct sl_data_enclosure *encl = NULL; uint64_t key; int rc; if ((refcode == NULL) || (text == NULL) || (vpd == NULL)) return 0; entry = calloc(1, sizeof(struct sl_event)); if (entry == NULL) { fprintf(stderr, "Out of memory\n"); return 0; } encl = calloc(1, sizeof(struct sl_data_enclosure)); if (encl == NULL) { free(entry); fprintf(stderr, "Out of memory\n"); return 0; } entry->addl_data = encl; entry->time_event = time(NULL); entry->type = SL_TYPE_ENCLOSURE; entry->severity = sev; /* * Add service action and call home flag for event * with severity > WARNING */ if (sev > SL_SEV_WARNING) { entry->disposition = SL_DISP_UNRECOVERABLE; entry->serviceable = 1; entry->call_home_status = SL_CALLHOME_CANDIDATE; } else { entry->disposition = SL_DISP_RECOVERABLE; entry->serviceable = 0; entry->call_home_status = SL_CALLHOME_NONE; } entry->description = strdup(text); if (entry->description == NULL) goto err0; entry->refcode = strdup(refcode); if (entry->refcode == NULL) goto err1; encl->enclosure_model = strdup(vpd->mtm); if (encl->enclosure_model == NULL) goto err2; encl->enclosure_serial = strdup(vpd->sn); if (encl->enclosure_serial == NULL) goto err3; entry->callouts = callouts; rc = servicelog_open(&slog, 0); if (rc != 0) { fprintf(stderr, "%s", servicelog_error(slog)); servicelog_event_free(entry); return 0; } rc = servicelog_event_log(slog, entry, &key); servicelog_event_free(entry); servicelog_close(slog); if (rc != 0) { fprintf(stderr, "%s", servicelog_error(slog)); return 0; } return key; err3: free(encl->enclosure_model); err2: free(entry->refcode); err1: free(entry->description); err0: free(entry); free(encl); fprintf(stderr, "%s : %d - Failed to allocate memory.\n", __func__, __LINE__); return 0; } /** * syslog_log_event * @brief Generate a serviceable event and an entry to syslog * * @param refcode the SRN or SRC for the serviceable event * @param sev the severity of the event * @param vpd a structure containing the VPD of the target */ static int syslog_log_event(const char *refcode, int sev, struct dev_vpd *vpd) { char *action, *severity_desc; int log_options; severity_desc = get_event_severity_desc(sev); action = get_event_action_desc(sev); /* syslog initialization */ setlogmask(LOG_UPTO(LOG_NOTICE)); log_options = LOG_CONS | LOG_PID | LOG_NDELAY; openlog("DIAG_ENCL", log_options, LOG_LOCAL1); syslog(LOG_NOTICE, "TM[%s]::SN[%s]::SRN[%s]::%s::%s", vpd->mtm, vpd->sn, refcode, severity_desc, action); syslog(LOG_NOTICE, "Run 'diag_encl %s' for the details", vpd->dev); closelog(); return 0; } /** * servevent * @brief Call platform specific event logging function */ uint32_t servevent(const char *refcode, int sev, const char *text, struct dev_vpd *vpd, struct sl_callout *callouts) { if ((refcode == NULL) || (text == NULL) || (vpd == NULL)) return -1; switch (platform) { case PLATFORM_PSERIES_LPAR: case PLATFORM_POWERKVM_GUEST: return servicelog_log_event(refcode, sev, text, vpd, callouts); case PLATFORM_POWERNV: return syslog_log_event(refcode, sev, vpd); default: break; } return -1; } /* * The fru_label should be "P1-C1" or "P1-C2" (without the terminating null). * i is 0 or 1. */ static int esm_location_match(int i, const char *fru_label) { return ('0'+i+1 == fru_label[4]); } /* * Create a callout for ESM i (left=0, right=1). VPD page 1 contains VPD * for only one of the element. If it's the wrong one, just do without the * VPD. * * TODO: Figure out how to get VPD for the other ESM by inquiring via a * different sg device. */ void create_esm_callout(struct sl_callout **callouts, char *location, unsigned int i, int fd) { int result = -1; struct vpd_page element_vpdp; if (fd >= 0) result = get_diagnostic_page(fd, INQUIRY, 1, &element_vpdp, sizeof(element_vpdp)); if ((result == 0) && esm_location_match(i, element_vpdp.fru_label)) add_callout_from_vpd_page(callouts, location, &element_vpdp); else add_location_callout(callouts, location); } /* midplane callout, with VPD from page 5 */ void create_midplane_callout(struct sl_callout **callouts, char *location, int fd) { int result = -1; struct vpd_page mp; if (fd >= 0) result = get_diagnostic_page(fd, INQUIRY, 5, &mp, sizeof(mp)); if (result == 0) add_callout_from_vpd_page(callouts, location, &mp); else add_location_callout(callouts, location); } ppc64-diag-2.7.4/diags/homerun.c0000644000000000000000000003460213135275400013166 00000000000000/* * Copyright (C) 2015, 2016 IBM Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include #include #include "diag_encl.h" #include "encl_util.h" #include "homerun.h" /* Retruns true if ESM has access to this component */ static inline bool hr_element_access_allowed(enum element_status_code sc) { if (sc == ES_NO_ACCESS_ALLOWED) return false; return true; } /** Helper functions to print various component status **/ static void hr_print_drive_status(struct disk_status *s) { static enum element_status_code valid_codes[] = { ES_OK, ES_CRITICAL, ES_NONCRITICAL, ES_NOT_INSTALLED, ES_NO_ACCESS_ALLOWED, ES_EOL }; return print_drive_status(s, valid_codes); } static void hr_print_enclosure_status(struct enclosure_status *s) { static enum element_status_code valid_codes[] = { ES_OK, ES_CRITICAL, ES_NONCRITICAL, ES_EOL }; return print_enclosure_status(s, valid_codes); } static void hr_print_fan_status(struct fan_status *s) { const char *speed[] = { "Fan at lowest speed", "Fan at lowest speed", "Fan at second lowest speed", "Fan at third lowest speed", "Fan at intermediate speed", "Fan at third highest speed", "Fan at second highest speed", "Fan at highest speed" }; static enum element_status_code valid_codes[] = { ES_OK, ES_CRITICAL, ES_NONCRITICAL, ES_NOT_INSTALLED, ES_UNKNOWN, ES_EOL }; return print_fan_status(s, valid_codes, speed); } /* Create a callout for power supply i (i = 0 or 1). */ static int hr_create_ps_callout(struct sl_callout **callouts, char *location, unsigned int i, int fd) { char fru_number[FRU_NUMBER_LEN + 1]; char serial_number[SERIAL_NUMBER_LEN + 1]; int rc; struct hr_element_descriptor_page *edp; struct power_supply_descriptor *ps_vpd[HR_NR_POWER_SUPPLY]; if (fd < 0) { add_location_callout(callouts, location); return 0; } edp = calloc(1, sizeof(struct hr_element_descriptor_page)); if (!edp) { fprintf(stderr, "%s: Failed to allocate memory\n", __func__); return 1; } rc = get_diagnostic_page(fd, RECEIVE_DIAGNOSTIC, 7, edp, sizeof(struct hr_element_descriptor_page)); if (rc) { add_location_callout(callouts, location); goto out; } ps_vpd[0] = &(edp->ps0_vpd); ps_vpd[1] = &(edp->ps1_vpd); strzcpy(fru_number, ps_vpd[i]->fru_number, FRU_NUMBER_LEN); strzcpy(serial_number, ps_vpd[i]->serial_number, SERIAL_NUMBER_LEN); add_callout(callouts, 'M', 0, NULL, location, fru_number, serial_number, NULL); out: free(edp); return 0; } static int hr_report_faults_to_svclog(int fd, struct dev_vpd *vpd, struct hr_diag_page2 *dp) { const char *left_right[] = { "left", "right" }; const char run_diag_encl[] = " Run diag_encl for more detailed status," " and refer to the system service documentation for guidance."; const char ref_svc_doc[] = " Refer to the system service documentation for guidance."; char srn[SRN_SIZE]; char crit[ES_STATUS_STRING_MAXLEN]; char description[EVENT_DESC_SIZE]; char location[LOCATION_LENGTH], *loc_suffix; int i; int sev; int rc; int loc_suffix_size; struct sl_callout *callouts; struct hr_diag_page2 *prev_dp = NULL; /* for -c */ strncpy(location, vpd->location, LOCATION_LENGTH - 1); location[LOCATION_LENGTH - 1] = '\0'; loc_suffix_size = LOCATION_LENGTH - strlen(location); loc_suffix = location + strlen(location); if (cmd_opts.cmp_prev) { prev_dp = calloc(1, sizeof(struct hr_diag_page2)); if (!prev_dp) { fprintf(stderr, "%s: Failed to allocate memory\n", __func__); return 1; } rc = read_page2_from_file(cmd_opts.prev_path, false, prev_dp, sizeof(struct hr_diag_page2)); if (rc) { free(prev_dp); prev_dp = NULL; } } /* disk drives */ for (i = 0; i < HR_NR_DISKS; i++) { if (!hr_element_access_allowed(dp->disk_status[i].byte0.status)) continue; sev = svclog_element_status(&(dp->disk_status[i].byte0), (char *) dp, (char *) prev_dp, crit); if (sev == 0) continue; snprintf(description, EVENT_DESC_SIZE, "%s fault in enclosure disk %u.%s", crit, i + 1, run_diag_encl); snprintf(loc_suffix, loc_suffix_size, "-P1-D%u", i+1); callouts = NULL; /* VPD for disk drives is not available from the SES. */ add_location_callout(&callouts, location); servevent("none", sev, description, vpd, callouts); } /* power supplies */ for (i = 0; i < HR_NR_POWER_SUPPLY; i++) { sev = svclog_element_status(&(dp->ps_status[i].byte0), (char *) dp, (char *) prev_dp, crit); if (sev == 0) continue; snprintf(description, EVENT_DESC_SIZE, "%s fault in %s power supply in enclosure.%s", crit, left_right[i], run_diag_encl); snprintf(loc_suffix, loc_suffix_size, "-P1-E%u", i+1); build_srn(srn, SRN_RC_CRIT_PS); callouts = NULL; rc = hr_create_ps_callout(&callouts, location, i, fd); if (rc == 0) servevent(srn, sev, description, vpd, callouts); } /* voltage sensors */ for (i = 0; i < HR_NR_VOLTAGE_SENSOR_SET; i++) { sev = svclog_composite_status(&(dp->voltage_sensor_sets[i]), (char *) dp, (char *) prev_dp, 3, crit); if (sev == 0) continue; snprintf(description, EVENT_DESC_SIZE, "%s fault associated with %s power supply in " "enclosure: voltage sensor(s) reporting voltage(s) " "out of range.%s", crit, left_right[i], run_diag_encl); snprintf(loc_suffix, loc_suffix_size, "-P1-E%u", i+1); build_srn(srn, SRN_RC_VOLTAGE_THRESHOLD); callouts = NULL; rc = hr_create_ps_callout(&callouts, location, i, fd); if (rc == 0) servevent(srn, sev, description, vpd, callouts); } /* Cooling elements (8 per element) */ for (i = 0; i < HR_NR_FAN_SET; i++) { sev = svclog_composite_status(&(dp->fan_sets[i].fan_element), (char *) dp, (char *) prev_dp, HR_NR_FAN_ELEMENT_PER_SET, crit); if (sev == 0) continue; snprintf(description, EVENT_DESC_SIZE, "%s fault in cooling element for %s power supply in" " enclosure.%s", crit, left_right[i], run_diag_encl); snprintf(loc_suffix, loc_suffix_size, "-P1-E%u", i+1); build_srn(srn, SRN_RC_CRIT_FAN); callouts = NULL; rc = hr_create_ps_callout(&callouts, location, i, fd); if (rc == 0) servevent(srn, sev, description, vpd, callouts); } /* Temperature Sensors (3 each per PS) */ for (i = 0; i < HR_NR_TEMP_SENSOR_SET; i++) { sev = svclog_composite_status( &(dp->temp_sensor_sets[i].power_supply), (char *) dp, (char *) prev_dp, HR_NR_TEMP_SENSORS_PER_SET, crit); if (sev == 0) continue; snprintf(description, EVENT_DESC_SIZE, "%s fault in temperature sensor(s) for %s power" " supply in enclosure.%s", crit, left_right[i], run_diag_encl); snprintf(loc_suffix, loc_suffix_size, "-P1-E%u", i+1); build_srn(srn, SRN_RC_PS_TEMP_THRESHOLD); callouts = NULL; rc = hr_create_ps_callout(&callouts, location, i, fd); if (rc == 0) servevent(srn, sev, description, vpd, callouts); } /* Temperature Sensors (1 per ESM) */ for (i = 0; i < HR_NR_ESM_CONTROLLERS; i++) { sev = svclog_element_status( &(dp->temp_sensor_sets[i].controller.byte0), (char *) dp, (char *) prev_dp, crit); if (sev == 0) continue; snprintf(description, EVENT_DESC_SIZE, "%s fault associated with ESM-%c side of the " "enclosure: temperature sensor(s) reporting " "temperature(s) out of range.%s", crit, 'A' + i, run_diag_encl); snprintf(loc_suffix, loc_suffix_size, "-P1-C%u", i+1); build_srn(srn, SRN_RC_TEMP_THRESHOLD); callouts = NULL; create_esm_callout(&callouts, location, i, fd); if (rc == 0) servevent(srn, sev, description, vpd, callouts); } /* ESM electronics */ for (i = 0; i < HR_NR_ESM_CONTROLLERS; i++) { sev = svclog_element_status(&(dp->esm_status[i].byte0), (char *) dp, (char *) prev_dp, crit); if (sev == 0) continue; snprintf(description, EVENT_DESC_SIZE, "%s electronics fault in %s ESM Module.%s", crit, left_right[i], ref_svc_doc); snprintf(loc_suffix, loc_suffix_size, "-P1-C%u", i+1); build_srn(srn, SRN_RC_CRIT_ESM); callouts = NULL; create_esm_callout(&callouts, location, i, fd); servevent(srn, sev, description, vpd, callouts); } return write_page2_to_file(cmd_opts.prev_path, dp, sizeof(struct hr_diag_page2)); } static int hr_turn_on_fault_leds(struct hr_diag_page2 *dp, int fd) { int i; int poked_leds = 0; struct hr_ctrl_page2 *ctrl_page; ctrl_page = calloc(1, sizeof(struct hr_ctrl_page2)); if (!ctrl_page) { fprintf(stderr, "%s: Failed to allocate memory\n", __func__); return 1; } /* disk drives */ for (i = 0; i < HR_NR_DISKS; i++) { if (!hr_element_access_allowed(dp->disk_status[i].byte0.status)) continue; FAULT_LED(poked_leds, dp, ctrl_page, disk_ctrl[i], disk_status[i]); } /* ERM/ESM electronics */ for (i = 0; i < HR_NR_ESM_CONTROLLERS; i++) FAULT_LED(poked_leds, dp, ctrl_page, esm_ctrl[i], esm_status[i]); /* No LEDs for temperature sensors */ /* fan assemblies */ for (i = 0; i < HR_NR_FAN_SET; i++) { enum element_status_code sc = composite_status(&(dp->fan_sets[i]), HR_NR_FAN_ELEMENT_PER_SET); if (sc != ES_OK && sc != ES_NOT_INSTALLED) FAULT_LED(poked_leds, dp, ctrl_page, fan_sets[i].fan_element[0], fan_sets[i].fan_element[0]); } /* power supplies */ for (i = 0; i < HR_NR_POWER_SUPPLY; i++) FAULT_LED(poked_leds, dp, ctrl_page, ps_ctrl[i], ps_status[i]); /* No LEDs for voltage sensors */ if (poked_leds) { int result; ctrl_page->page_code = 2; ctrl_page->page_length = sizeof(struct hr_ctrl_page2) - 4; /* Convert host byte order to network byte order */ ctrl_page->page_length = htons(ctrl_page->page_length); ctrl_page->generation_code = 0; result = do_ses_cmd(fd, SEND_DIAGNOSTIC, 0, 0x10, 6, SG_DXFER_TO_DEV, ctrl_page, sizeof(struct hr_ctrl_page2)); if (result != 0) { perror("ioctl - SEND_DIAGNOSTIC"); fprintf(stderr, "result = %d\n", result); fprintf(stderr, "failed to set LED(s) via SES\n"); free(ctrl_page); return -1; } } free(ctrl_page); return 0; } /* @return 0 for success, 1 for failure */ int diag_homerun(int fd, struct dev_vpd *vpd) { static const char *power_supply_names[] = { "PS0 (Left)", "PS1 (Right)" }; static const char *fan_set_names[] = { "Left Cooling Assembly", "Right Cooling Assembly", }; static const char *temp_sensor_set_names[] = { "Left Temperature Sensor Controller", "Right Temperature Sensor Controller" }; static const char *esm_names[] = { "Left", "Right" }; int i, j, rc; struct hr_diag_page2 *dp; dp = calloc(1, sizeof(struct hr_diag_page2)); if (!dp) { fprintf(stderr, "%s: Failed to allocate memory\n", __func__); return 1; } if (cmd_opts.fake_path) { rc = read_page2_from_file(cmd_opts.fake_path, true, dp, sizeof(struct hr_diag_page2)); fd = -1; } else { rc = get_diagnostic_page(fd, RECEIVE_DIAGNOSTIC, 2, (void *)dp, sizeof(struct hr_diag_page2)); } if (rc != 0) { fprintf(stderr, "Failed to read SES diagnostic page; " "cannot report status.\n"); goto err_out; } printf("\n"); printf(" Overall Status: "); if (dp->crit) { printf("CRITICAL_FAULT"); if (dp->non_crit) printf(" | NON_CRITICAL_FAULT"); } else if (dp->non_crit) { printf("NON_CRITICAL_FAULT"); } else { printf("ok"); } printf("\n\n Drive Status\n"); for (i = 0; i < HR_NR_DISKS; i++) { if (!hr_element_access_allowed(dp->disk_status[i].byte0.status)) continue; struct disk_status *ds = &(dp->disk_status[i]); printf(" Disk %02d (Slot %02d): ", i+1, ds->byte1.element_status.slot_address); hr_print_drive_status(ds); } printf("\n Power Supply Status\n"); for (i = 0; i < HR_NR_POWER_SUPPLY; i++) { printf(" %s: ", power_supply_names[i]); print_power_supply_status(&(dp->ps_status[i])); printf(" 12V: "); print_voltage_sensor_status( &(dp->voltage_sensor_sets[i].sensor_12V)); printf(" 5V: "); print_voltage_sensor_status( &(dp->voltage_sensor_sets[i].sensor_5V)); printf(" 5VA: "); print_voltage_sensor_status( &(dp->voltage_sensor_sets[i].sensor_5VA)); } printf("\n Fan Status\n"); for (i = 0; i < HR_NR_FAN_SET; i++) { printf(" %s:\n", fan_set_names[i]); for (j = 0; j < HR_NR_FAN_ELEMENT_PER_SET; j++) { printf(" Fan Element %d: ", j); hr_print_fan_status(&(dp->fan_sets[i].fan_element[j])); } } printf("\n Temperature Sensors\n"); for (i = 0; i < HR_NR_TEMP_SENSOR_SET; i++) { struct hr_temperature_sensor_set *tss = &(dp->temp_sensor_sets[i]); printf(" %s: ", temp_sensor_set_names[i]); print_temp_sensor_status(&tss->controller); for (j = 0; j < HR_NR_TEMP_SENSORS_PER_SET; j++) { printf(" Temperature Sensor Power Supply %d%c: ", j, i == 0?'L':'R'); print_temp_sensor_status(&tss->power_supply[j]); } } printf("\n Enclosure Status: "); hr_print_enclosure_status(&(dp->enclosure_element_status)); printf("\n ESM Electronics Status: \n"); for (i = 0; i < HR_NR_ESM_CONTROLLERS; i++) { printf(" %s: ", esm_names[i]); print_esm_status(&(dp->esm_status[i])); } if (cmd_opts.verbose) { printf("\n\nRaw diagnostic page:\n"); print_raw_data(stdout, (char *) dp, sizeof(struct hr_diag_page2)); } printf("\n\n"); /* * Log fault event, and turn on LEDs as appropriate. * LED status reported previously may not be accurate after we * do this, but the alternative is to report faults first and then * read the diagnostic page a second time. And unfortunately, the * changes to LED settings don't always show up immediately in * the next query of the SES. */ if (cmd_opts.serv_event) { rc = hr_report_faults_to_svclog(fd, vpd, dp); if (rc != 0) goto err_out; } /* -l is not supported for fake path */ if (fd != -1 && cmd_opts.leds) rc = hr_turn_on_fault_leds(dp, fd); err_out: free(dp); return (rc != 0); } ppc64-diag-2.7.4/diags/slider.c0000644000000000000000000012766113135275400013003 00000000000000/* * Copyright (C) 2016 IBM Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, * USA. */ #include #include #include #include #include #include #include #include #include "diag_encl.h" #include "encl_common.h" #include "encl_util.h" #include "slider.h" /* Global definition, as it is used by multiple caller */ static const char * const sas_connector_names[] = { "Upstream", "Downstream", "Uninstalled" }; static const char * const input_power_names[] = { "Average Input Power", "Peak Input Power" }; static const char * const left_right[] = { "Left", "Right" }; static const char * const psu_temp_sensor_names[] = { "Ambient", "Hot-Spot", "Primary" }; static const char * const esc_temp_sensor_names[] = { "Inlet", "Outlet" }; char run_diag_encl[] = " Run diag_encl for more detailed status," " and refer to the system service documen" "tation for guidance."; char ref_svc_doc[] = " Refer to the system service documentation" " for guidance."; /* Holds FRU location code */ static char location_code[LOCATION_LENGTH]; /* Common valid status for all elements */ static enum element_status_code valid_codes[] = { ES_UNSUPPORTED, ES_OK, ES_CRITICAL, ES_NONCRITICAL, ES_UNRECOVERABLE, ES_NOT_INSTALLED, ES_UNKNOWN, ES_NOT_AVAILABLE, ES_NO_ACCESS_ALLOWED, ES_EOL }; enum slider_variant slider_variant_flag; /* Slider variant page size/number of disk */ uint16_t slider_v_diag_page2_size; uint16_t slider_v_ctrl_page2_size; uint8_t slider_v_nr_disk; /* Create a callout for power supply i (i = 0 or 1). */ static int slider_create_ps_callout(struct sl_callout **callouts, char *location, unsigned int i, int fd) { char fru_number[FRU_NUMBER_LEN + 1]; char serial_number[SERIAL_NUMBER_LEN + 1]; char *buffer; int rc; uint32_t size; struct slider_lff_element_descriptor_page *edpl; struct slider_sff_element_descriptor_page *edps; struct power_supply_descriptor *ps_vpd[SLIDER_NR_POWER_SUPPLY]; if (fd < 0) { add_location_callout(callouts, location); return 0; } /* Check slider varient */ if (slider_variant_flag == SLIDER_V_LFF) size = sizeof(struct slider_lff_element_descriptor_page); else if (slider_variant_flag == SLIDER_V_SFF) size = sizeof(struct slider_sff_element_descriptor_page); else return 1; buffer = calloc(1, size); if (!buffer) { fprintf(stderr, "%s: Failed to allocate memory\n", __func__); return 1; } rc = get_diagnostic_page(fd, RECEIVE_DIAGNOSTIC, 7, buffer, size); if (rc) { add_location_callout(callouts, location); free(buffer); return 0; } if (slider_variant_flag == SLIDER_V_LFF) { edpl = (struct slider_lff_element_descriptor_page *)buffer; ps_vpd[0] = &(edpl->ps0_vpd); ps_vpd[1] = &(edpl->ps1_vpd); } else if (slider_variant_flag == SLIDER_V_SFF) { edps = (struct slider_sff_element_descriptor_page *)buffer; ps_vpd[0] = &(edps->ps0_vpd); ps_vpd[1] = &(edps->ps1_vpd); } strzcpy(fru_number, ps_vpd[i]->fru_number, FRU_NUMBER_LEN); strzcpy(serial_number, ps_vpd[i]->serial_number, SERIAL_NUMBER_LEN); add_callout(callouts, 'M', 0, NULL, location, fru_number, serial_number, NULL); return 0; } /* Used to get location code with location_suffix_code */ static void get_location_code(struct dev_vpd *vpd, char *loc_suffix_code) { static char *loc_suffix = NULL; static int loc_suffix_size; if (location_code[0] == '\0') { strncpy(location_code, vpd->location, LOCATION_LENGTH - 1); location_code[LOCATION_LENGTH - 1] = '\0'; loc_suffix_size = LOCATION_LENGTH - strlen(location_code); loc_suffix = location_code + strlen(location_code); } if (loc_suffix_code) snprintf(loc_suffix, loc_suffix_size, "%s", loc_suffix_code); else *loc_suffix = '\0'; } /* Report slider disk fault to svclog */ static void report_slider_disk_fault_to_svclog(void *dp, void *prev_dp, struct dev_vpd *vpd) { char loc_suffix_code[LOCATION_LENGTH]; char description[EVENT_DESC_SIZE], crit[ES_STATUS_STRING_MAXLEN]; int i, sev; struct sl_callout *callouts; struct slider_disk_status *disk_status = (struct slider_disk_status *)(dp + element_offset(disk_status)); for (i = 0; i < slider_v_nr_disk; i++) { if (disk_status[i].byte0.status == ES_NO_ACCESS_ALLOWED) continue; sev = svclog_element_status(&(disk_status[i].byte0), (char *) dp, (char *) prev_dp, crit); if (sev == 0) continue; snprintf(description, EVENT_DESC_SIZE, "%s fault in enclosure disk %u.%s", crit, i + 1, run_diag_encl); snprintf(loc_suffix_code, LOCATION_LENGTH, "-P1-D%u", i+1); get_location_code(vpd, loc_suffix_code); callouts = NULL; /* VPD for disk drives is not available from the SES. */ add_location_callout(&callouts, location_code); servevent("none", sev, description, vpd, callouts); } } /* Report slider power supply fault to svclog */ static void report_slider_power_supply_fault_to_svclog( void *dp, void *prev_dp, struct dev_vpd *vpd, int fd) { char description[EVENT_DESC_SIZE], crit[ES_STATUS_STRING_MAXLEN]; char srn[SRN_SIZE]; char loc_suffix_code[LOCATION_LENGTH]; int i, sev, rc; struct sl_callout *callouts; struct slider_power_supply_status *ps_status = (struct slider_power_supply_status *)(dp + element_offset(ps_status)); for (i = 0; i < SLIDER_NR_POWER_SUPPLY; i++) { sev = svclog_element_status(&(ps_status[i].byte0), (char *) dp, (char *) prev_dp, crit); if (sev == 0) continue; snprintf(description, EVENT_DESC_SIZE, "%s fault in %s power supply in enclosure.%s", crit, left_right[i], run_diag_encl); snprintf(loc_suffix_code, LOCATION_LENGTH, "-P1-E%u", i+1); get_location_code(vpd, loc_suffix_code); build_srn(srn, SRN_RC_CRIT_PS); callouts = NULL; rc = slider_create_ps_callout(&callouts, location_code, i, fd); if (rc == 0) servevent(srn, sev, description, vpd, callouts); } } /* Report slider cooling element fault to svclog */ static void report_slider_cooling_element_fault_to_svclog( void *dp, void *prev_dp, struct dev_vpd *vpd, int fd) { int i, j, sev, rc; char description[EVENT_DESC_SIZE], crit[ES_STATUS_STRING_MAXLEN]; struct sl_callout *callouts; char srn[SRN_SIZE]; char loc_suffix_code[LOCATION_LENGTH]; struct slider_fan_set *fan_sets = (struct slider_fan_set *)(dp + element_offset(fan_sets)); for (i = 0; i < SLIDER_NR_POWER_SUPPLY; i++) { for (j = 0; j < SLIDER_NR_FAN_PER_POWER_SUPPLY; j++) { sev = svclog_element_status (&(fan_sets[i].fan_element[j].byte0), (char *) dp, (char *) prev_dp, crit); if (sev == 0) continue; snprintf(description, EVENT_DESC_SIZE, "%s fault in fan element %d of %s power" " supply in enclosure.%s", crit, j + 1, left_right[i], run_diag_encl); snprintf(loc_suffix_code, LOCATION_LENGTH, "-P1-E%u", i+1); get_location_code(vpd, loc_suffix_code); build_srn(srn, SRN_RC_CRIT_FAN); callouts = NULL; rc = slider_create_ps_callout(&callouts, location_code, i, fd); if (rc == 0) servevent(srn, sev, description, vpd, callouts); } } } /* Report slider temperture sensor fault to svclog */ static void report_slider_temp_sensor_fault_to_svclog( void *dp, void *prev_dp, struct dev_vpd *vpd, int fd) { int i, j, sev, rc; char description[EVENT_DESC_SIZE], crit[ES_STATUS_STRING_MAXLEN]; struct sl_callout *callouts; char srn[SRN_SIZE]; char loc_suffix_code[LOCATION_LENGTH]; struct slider_temperature_sensor_set *temp_sensor_sets = (struct slider_temperature_sensor_set *) (dp + element_offset(temp_sensor_sets)); /* Temperature sensor for enclosure */ for (i = 0; i < SLIDER_NR_ENCLOSURE; i++) { sev = svclog_element_status (&(temp_sensor_sets->temp_enclosure.byte0), (char *) dp, (char *) prev_dp, crit); if (sev == 0) continue; snprintf(description, EVENT_DESC_SIZE, "%s fault in Ambient air temperature sensor of" " enclosure.%s", crit, run_diag_encl); snprintf(loc_suffix_code, LOCATION_LENGTH, "-P1"); get_location_code(vpd, loc_suffix_code); build_srn(srn, SRN_RC_TEMP_THRESHOLD); callouts = NULL; create_esm_callout(&callouts, location_code, i, fd); servevent(srn, sev, description, vpd, callouts); } /* Temperature sensor for PSU */ for (i = 0; i < SLIDER_NR_PSU; i++) { for (j = 0; j < SLIDER_NR_TEMP_SENSOR_PER_PSU; j++) { sev = svclog_element_status (&(temp_sensor_sets->temp_psu [(i * SLIDER_NR_TEMP_SENSOR_PER_PSU) + j] .byte0), (char *) dp, (char *) prev_dp, crit); if (sev == 0) continue; snprintf(description, EVENT_DESC_SIZE, "%s fault in %s temp sensor of %s power" " supply unit in enclosure.%s", crit, psu_temp_sensor_names[j], left_right[i], run_diag_encl); snprintf(loc_suffix_code, LOCATION_LENGTH, "-P1-E%u", i+1); get_location_code(vpd, loc_suffix_code); build_srn(srn, SRN_RC_PS_TEMP_THRESHOLD); callouts = NULL; rc = slider_create_ps_callout(&callouts, location_code, i, fd); if (rc == 0) servevent(srn, sev, description, vpd, callouts); } } /* Temperature sensor for ESC */ for (i = 0; i < SLIDER_NR_ESC; i++) { for (j = 0; j < SLIDER_NR_TEMP_SENSOR_PER_ESC; j++) { sev = svclog_element_status (&(temp_sensor_sets->temp_psu [(i * SLIDER_NR_TEMP_SENSOR_PER_ESC) + j] .byte0), (char *) dp, (char *) prev_dp, crit); if (sev == 0) continue; snprintf(description, EVENT_DESC_SIZE, "%s fault in %s temp sensor of %s enclosure " "service controller in enclosure.%s", crit, esc_temp_sensor_names[j], left_right[i], run_diag_encl); snprintf(loc_suffix_code, LOCATION_LENGTH, "-P1-C%u", i+1); get_location_code(vpd, loc_suffix_code); build_srn(srn, SRN_RC_TEMP_THRESHOLD); callouts = NULL; create_esm_callout(&callouts, location_code, i, fd); servevent(srn, sev, description, vpd, callouts); } } } /* Report slider enclosure service controller fault to svclog */ static void report_slider_esc_fault_to_svclog( void *dp, void *prev_dp, struct dev_vpd *vpd, int fd) { int i, sev; char description[EVENT_DESC_SIZE], crit[ES_STATUS_STRING_MAXLEN]; struct sl_callout *callouts; char srn[SRN_SIZE]; char loc_suffix_code[LOCATION_LENGTH]; struct slider_enc_service_ctrl_status *enc_service_ctrl_element = (struct slider_enc_service_ctrl_status *) (dp + element_offset(enc_service_ctrl_element)); for (i = 0; i < SLIDER_NR_ESC; i++) { sev = svclog_element_status(&(enc_service_ctrl_element[i] .byte0), (char *) dp, (char *) prev_dp, crit); if (sev == 0) continue; snprintf(description, EVENT_DESC_SIZE, "%s fault in %s enclosure service controller.%s", crit, left_right[i], ref_svc_doc); snprintf(loc_suffix_code, LOCATION_LENGTH, "-P1-C%u", i+1); get_location_code(vpd, loc_suffix_code); build_srn(srn, SRN_RC_CRIT_ESM); callouts = NULL; create_esm_callout(&callouts, location_code, i, fd); servevent(srn, sev, description, vpd, callouts); } } /* Report slider enclosure fault to svclog */ static void report_slider_enclosure_fault_to_svclog( void *dp, void *prev_dp, struct dev_vpd *vpd) { int i, sev; char description[EVENT_DESC_SIZE], crit[ES_STATUS_STRING_MAXLEN]; struct sl_callout *callouts; char loc_suffix_code[LOCATION_LENGTH]; struct enclosure_status *encl_element = (struct enclosure_status *) (dp + element_offset(encl_element)); for (i = 0; i < SLIDER_NR_ENCLOSURE; i++) { sev = svclog_element_status(&(encl_element->byte0),(char *) dp, (char *) prev_dp, crit); if (sev == 0) continue; snprintf(description, EVENT_DESC_SIZE, "%s fault in enclosure.%s", crit, run_diag_encl); snprintf(loc_suffix_code, LOCATION_LENGTH, "-P1"); get_location_code(vpd, loc_suffix_code); callouts = NULL; add_location_callout(&callouts, location_code); servevent("none", sev, description, vpd, callouts); } } /* Report slider voltage sensor fault to svclog */ static void report_slider_volt_sensor_fault_to_svclog( void *dp, void *prev_dp, struct dev_vpd *vpd, int fd) { int i, sev; char description[EVENT_DESC_SIZE], crit[ES_STATUS_STRING_MAXLEN]; struct sl_callout *callouts; char srn[SRN_SIZE]; char loc_suffix_code[LOCATION_LENGTH]; struct slider_voltage_sensor_set *voltage_sensor_sets = (struct slider_voltage_sensor_set *)(dp + element_offset(voltage_sensor_sets)); for (i = 0; i < SLIDER_NR_ESC; i++) { sev = svclog_composite_status(&(voltage_sensor_sets[i]), (char *) dp, (char *) prev_dp, SLIDER_NR_VOLT_SENSOR_PER_ESM, crit); if (sev == 0) continue; snprintf(description, EVENT_DESC_SIZE, "%s fault associated with %s enclosure service" " controller in enclosure: voltage sensor(s)" " reporting voltage(s) out of range.%s", crit, left_right[i], run_diag_encl); snprintf(loc_suffix_code, LOCATION_LENGTH, "-P1-C%u", i+1); get_location_code(vpd, loc_suffix_code); build_srn(srn, SRN_RC_VOLTAGE_THRESHOLD); callouts = NULL; create_esm_callout(&callouts, location_code, i, fd); servevent(srn, sev, description, vpd, callouts); } } /* Report slider sas expander fault to svclog */ static void report_slider_sas_expander_fault_to_svclog( void *dp, void *prev_dp, struct dev_vpd *vpd) { int i, sev; char description[EVENT_DESC_SIZE], crit[ES_STATUS_STRING_MAXLEN]; struct sl_callout *callouts; char srn[SRN_SIZE]; char loc_suffix_code[LOCATION_LENGTH]; struct slider_sas_expander_status *sas_expander_element = (struct slider_sas_expander_status *)(dp + element_offset(sas_expander_element)); /* SAS Expander */ for (i = 0; i < SLIDER_NR_SAS_EXPANDER; i++) { sev = svclog_element_status(&(sas_expander_element[i].byte0), (char *) dp, (char *) prev_dp, crit); if (sev == 0) continue; snprintf(description, EVENT_DESC_SIZE, "%s fault in SAS expander of %s enclosure service" " controller.%s", crit, left_right[i], ref_svc_doc); snprintf(loc_suffix_code, LOCATION_LENGTH, "-P1-C%u", i+1); get_location_code(vpd, loc_suffix_code); build_srn(srn, SRN_RC_CRIT_ESM); callouts = NULL; add_location_callout(&callouts, location_code); servevent(srn, sev, description, vpd, callouts); } } /* Report slider sas connector fault to svclog */ static void report_slider_sas_connector_fault_to_svclog( void *dp, void *prev_dp, struct dev_vpd *vpd) { int i, j, sev; char description[EVENT_DESC_SIZE], crit[ES_STATUS_STRING_MAXLEN]; struct sl_callout *callouts; char loc_suffix_code[LOCATION_LENGTH]; struct slider_sas_connector_status *sas_connector_status = (struct slider_sas_connector_status *)(dp + element_offset(sas_connector_status)); for (i = 0; i < SLIDER_NR_SAS_EXPANDER; i++) { for (j = 0; j < SLIDER_NR_SAS_CONNECTOR_PER_EXPANDER ; j++) { sev = svclog_element_status(&(sas_connector_status [(i * SLIDER_NR_SAS_CONNECTOR_PER_EXPANDER) + j].byte0), (char *) dp, (char *) prev_dp, crit); if (sev == 0) continue; snprintf(description, EVENT_DESC_SIZE, "%s fault in %s SAS connector of %s sas" " expander of enclosure module.%s", crit, sas_connector_names[j], left_right[i], ref_svc_doc); snprintf(loc_suffix_code, LOCATION_LENGTH, "-C%u-T%u", i+1, j+1); get_location_code(vpd, loc_suffix_code); callouts = NULL; /* No VPD for SAS connectors in the SES. */ add_location_callout(&callouts, location_code); servevent("none", sev, description, vpd, callouts); } } } /* Report slider midplane fault to svclog */ static void report_slider_midplane_fault_to_svclog( void *dp, void *prev_dp, struct dev_vpd *vpd, int fd) { int sev; char description[EVENT_DESC_SIZE], crit[ES_STATUS_STRING_MAXLEN]; struct sl_callout *callouts; char loc_suffix_code[LOCATION_LENGTH]; struct slider_midplane_status *midplane_element_status = (struct slider_midplane_status *) (dp + element_offset(midplane_element_status)); sev = svclog_element_status(&(midplane_element_status->byte0), (char *) dp, (char *) prev_dp, crit); if (sev != 0) { snprintf(description, EVENT_DESC_SIZE, "%s fault in midplane of enclosure.%s", crit, ref_svc_doc); snprintf(loc_suffix_code, LOCATION_LENGTH, "-P1"); get_location_code(vpd, loc_suffix_code); callouts = NULL; create_midplane_callout(&callouts, location_code, fd); servevent("none", sev, description, vpd, callouts); } } /* Report slider phy fault to svclog */ static void report_slider_phy_fault_to_svclog( void *dp, void *prev_dp, struct dev_vpd *vpd) { int i, j, sev; char description[EVENT_DESC_SIZE], crit[ES_STATUS_STRING_MAXLEN]; struct sl_callout *callouts; char loc_suffix_code[LOCATION_LENGTH]; struct slider_phy_set *phy_sets = (struct slider_phy_set *)(dp + element_offset(phy_sets)); for (i = 0; i < SLIDER_NR_SAS_EXPANDER; i++) { for (j = 0; j < SLIDER_NR_PHY_PER_SAS_EXPANDER; j++) { sev = svclog_element_status (&(phy_sets[i].phy_element[j].byte0), (char *) dp, (char *) prev_dp, crit); if (sev == 0) continue; snprintf(description, EVENT_DESC_SIZE, "%s fault in physical link[%d] of %s SAS" " expander.%s", crit, j + 1, left_right[i], ref_svc_doc); snprintf(loc_suffix_code, LOCATION_LENGTH, "-P1-C%u", i+1); get_location_code(vpd, loc_suffix_code); callouts = NULL; add_location_callout(&callouts, location_code); servevent("none", sev, description, vpd, callouts); } } } /* Report slider statesave buffer fault to svclog */ static void report_slider_statesave_buffer_fault_to_svclog( void *dp, void *prev_dp, struct dev_vpd *vpd) { int i, sev; char description[EVENT_DESC_SIZE], crit[ES_STATUS_STRING_MAXLEN]; struct sl_callout *callouts; char loc_suffix_code[LOCATION_LENGTH]; struct slider_statesave_buffer_status *ssb_element = (struct slider_statesave_buffer_status *) (dp + element_offset(ssb_element)); for (i = 0; i < SLIDER_NR_SSB; i++) { sev = svclog_element_status(&(ssb_element[i].byte0), (char *) dp, (char *) prev_dp, crit); if (sev == 0) continue; snprintf(description, EVENT_DESC_SIZE, "%s fault in statesave of %s enclosure service" " controller.%s", crit, left_right[i], ref_svc_doc); snprintf(loc_suffix_code, LOCATION_LENGTH, "-P1-C%u", i+1); get_location_code(vpd, loc_suffix_code); callouts = NULL; add_location_callout(&callouts, location_code); servevent("none", sev, description, vpd, callouts); } } /* Report slider cpld fault to svclog */ static void report_slider_cpld_fault_to_svclog( void *dp, void *prev_dp, struct dev_vpd *vpd) { int i, sev; char description[EVENT_DESC_SIZE], crit[ES_STATUS_STRING_MAXLEN]; struct sl_callout *callouts; char loc_suffix_code[LOCATION_LENGTH]; struct slider_cpld_status *cpld_element = (struct slider_cpld_status *) (dp + element_offset(cpld_element)); for (i = 0; i < SLIDER_NR_ESC; i++) { sev = svclog_element_status(&(cpld_element[i].byte0), (char *) dp, (char *) prev_dp, crit); if (sev == 0) continue; snprintf(description, EVENT_DESC_SIZE, "%s fault in CPLD of %s enclosure.%s", crit, left_right[i], ref_svc_doc); snprintf(loc_suffix_code, LOCATION_LENGTH, "-P1-C%u", i+1); get_location_code(vpd, loc_suffix_code); callouts = NULL; add_location_callout(&callouts, location_code); servevent("none", sev, description, vpd, callouts); } } /* Report slider input power fault to svclog */ static void report_slider_input_power_fault_to_svclog( void *dp, void *prev_dp, struct dev_vpd *vpd) { int i, j, sev; char description[EVENT_DESC_SIZE], crit[ES_STATUS_STRING_MAXLEN]; struct sl_callout *callouts; char srn[SRN_SIZE]; char loc_suffix_code[LOCATION_LENGTH]; struct slider_input_power_status *input_power_element = (struct slider_input_power_status *) (dp + element_offset(input_power_element)); for (i = 0; i < SLIDER_NR_PSU; i++) { for (j = 0; j < SLIDER_NR_INPUT_POWER_PER_PSU; j++) { sev = svclog_element_status (&(input_power_element [(i * SLIDER_NR_INPUT_POWER_PER_PSU) + j] .byte0), (char *) dp, (char *) prev_dp, crit); if (sev == 0) continue; snprintf(description, EVENT_DESC_SIZE, "%s fault in input power(%s) of %s power" " supply unit in enclosure.%s", crit, input_power_names[j], left_right[i], run_diag_encl); snprintf(loc_suffix_code, LOCATION_LENGTH, "-P1-E%u", i+1); get_location_code(vpd, loc_suffix_code); build_srn(srn, SRN_RC_CRIT_PS); callouts = NULL; add_location_callout(&callouts, location_code); servevent(srn, sev, description, vpd, callouts); } } } static int slider_read_previous_page2(void **buffer) { int rc; if (!cmd_opts.cmp_prev) return 0; *buffer = calloc(1, slider_v_diag_page2_size); if (!(*buffer)) { fprintf(stderr, "%s : Failed to allocate memory\n", __func__); return 1; } rc = read_page2_from_file(cmd_opts.prev_path, false, *buffer, slider_v_diag_page2_size); if (rc != 0) { free(*buffer); *buffer = NULL; } return 0; } /* * Report slider fault to sericelog for both variant of slider by calculating * offset of different element */ static int report_slider_fault_to_svclog(void *dp, struct dev_vpd *vpd, int fd) { int rc; void *prev_dp = NULL; rc = slider_read_previous_page2((void *)&prev_dp); if (rc) return 1; /* report disk fault */ report_slider_disk_fault_to_svclog(dp, prev_dp, vpd); /* report power supply fault */ report_slider_power_supply_fault_to_svclog(dp, prev_dp, vpd, fd); /* report cooling element fault */ report_slider_cooling_element_fault_to_svclog(dp, prev_dp, vpd, fd); /* report temp sensor fault */ report_slider_temp_sensor_fault_to_svclog(dp, prev_dp, vpd, fd); /* report esc fault */ report_slider_esc_fault_to_svclog(dp, prev_dp, vpd, fd); /* report enclosure fault */ report_slider_enclosure_fault_to_svclog(dp, prev_dp, vpd); /* report voltage sensor fault */ report_slider_volt_sensor_fault_to_svclog(dp, prev_dp, vpd, fd); /* report sas expander fault */ report_slider_sas_expander_fault_to_svclog(dp, prev_dp, vpd); /* report sas connector fault */ report_slider_sas_connector_fault_to_svclog(dp, prev_dp, vpd); /* report midplane fault */ report_slider_midplane_fault_to_svclog(dp, prev_dp, vpd, fd); /* report phy fault */ report_slider_phy_fault_to_svclog(dp, prev_dp, vpd); /* report statesave buffer fault */ report_slider_statesave_buffer_fault_to_svclog(dp, prev_dp, vpd); /* report cpld fault */ report_slider_cpld_fault_to_svclog(dp, prev_dp, vpd); /* report input power fault */ report_slider_input_power_fault_to_svclog(dp, prev_dp, vpd); if (prev_dp) free(prev_dp); return write_page2_to_file(cmd_opts.prev_path, dp, slider_v_diag_page2_size); } #define SLIDER_FAULT_LED(poked_leds, dp, ctrl_page, ctrl_element, \ status_element) \ do { \ if (slider_variant_flag == SLIDER_V_LFF) { \ struct slider_lff_diag_page2 *d \ = (struct slider_lff_diag_page2 *)dp; \ struct slider_lff_ctrl_page2 *c \ = (struct slider_lff_ctrl_page2 *)ctrl_page; \ FAULT_LED(poked_leds, d, c, ctrl_element, \ status_element);\ } else { \ struct slider_sff_diag_page2 *d \ = (struct slider_sff_diag_page2 *)dp; \ struct slider_sff_ctrl_page2 *c \ = (struct slider_sff_ctrl_page2 *)ctrl_page; \ FAULT_LED(poked_leds, d, c, ctrl_element, \ status_element); \ } \ } while (0) /* Turn on led in case of failure of any element of enclosure */ static int slider_turn_on_fault_leds(void *dp, int fd) { int i, j, result; void *ctrl_page; int poked_leds = 0; ctrl_page = calloc(1, slider_v_ctrl_page2_size); if (!ctrl_page) { fprintf(stderr, "Failed to allocate memory to hold " "control diagnostics page 02.\n"); return 1; } /* Disk */ for (i = 0; i < slider_v_nr_disk; i++) { SLIDER_FAULT_LED(poked_leds, dp, ctrl_page, disk_ctrl[i], disk_status[i]); } /* Power supply */ for (i = 0; i < SLIDER_NR_POWER_SUPPLY; i++) { SLIDER_FAULT_LED(poked_leds, dp, ctrl_page, ps_ctrl[i], ps_status[i]); } /* Cooling element */ for (i = 0; i < SLIDER_NR_POWER_SUPPLY; i++) { for (j = 0; j < SLIDER_NR_FAN_PER_POWER_SUPPLY; j++) { SLIDER_FAULT_LED(poked_leds, dp, ctrl_page, fan_sets[i].fan_element[j], fan_sets[i].fan_element[j]); } } /* ERM/ESM electronics */ for (i = 0; i < SLIDER_NR_ESC; i++) { SLIDER_FAULT_LED(poked_leds, dp, ctrl_page, enc_service_ctrl_element[i], enc_service_ctrl_element[i]); } /* SAS Connector*/ for (i = 0; i < SLIDER_NR_SAS_CONNECTOR; i++) { SLIDER_FAULT_LED(poked_leds, dp, ctrl_page, sas_connector_ctrl[i], sas_connector_status[i]); } /* Enclosure */ SLIDER_FAULT_LED(poked_leds, dp, ctrl_page, encl_element, encl_element); if (poked_leds) { SLIDER_ASSIGN_CTRL_PAGE(ctrl_page); result = do_ses_cmd(fd, SEND_DIAGNOSTIC, 0, 0x10, 6, SG_DXFER_TO_DEV, ctrl_page, slider_v_ctrl_page2_size); if (result != 0) { perror("ioctl - SEND_DIAGNOSTIC"); fprintf(stderr, "result = %d\n", result); fprintf(stderr, "failed to set LED(s) via SES\n"); free(ctrl_page); return -1; } } free(ctrl_page); return 0; } /* Print slider temperature sensor status */ static void print_slider_temp_sensor_status( struct temperature_sensor_status *s) { enum element_status_code sc = (enum element_status_code) s->byte0.status; printf("%s", status_string(sc, valid_codes)); if (s->ot_failure) printf(" | OVER_TEMPERATURE_FAILURE"); if (s->ot_warning) printf(" | OVER_TEMPERATURE_WARNING"); if (s->ut_failure) printf(" | UNDER_TEMPERATURE_FAILURE"); if (s->ut_warning) printf(" | UNDER_TEMPERATURE_WARNING"); if (cmd_opts.verbose) /* between -19 and +235 degrees Celsius */ printf(" | TEMPERATURE = %dC", s->temperature - 20); printf("\n"); } /* Print slider voltage sensor status */ static void print_slider_voltage_sensor_status( struct voltage_sensor_status *s) { enum element_status_code sc = (enum element_status_code) s->byte0.status; printf("%s", status_string(sc, valid_codes)); if (s->warn_over) printf(" | NON_CRITICAL_OVER_VOLTAGE"); if (s->warn_under) printf(" | NON_CRITICAL_UNDER_VOLTAGE"); if (s->crit_over) printf(" | CRITICAL_OVER_VOLTAGE"); if (s->crit_under) printf(" | CRITICAL_UNDER_VOLTAGE"); if (cmd_opts.verbose) /* between +327.67 to -327.67 */ printf(" | VOLTAGE = %.2f volts", ntohs(s->voltage) / 100.0); printf("\n"); } static void print_slider_drive_status(struct slider_disk_status *s) { enum element_status_code sc = (enum element_status_code) s->byte0.status; printf("%-19s", status_string(sc, valid_codes)); if (sc == ES_NOT_INSTALLED) { printf("\n"); return; } if (s->hot_swap) printf(" | Hotswap enabled"); if (s->app_client_bypassed_a) printf(" | APP_CLIENT_BYPASSED_A"); if (s->app_client_bypassed_b) printf(" | APP_CLIENT_BYPASSED_B"); if (s->enclosure_bypassed_a) printf(" | ENCLOSURE_BYPASSED_A"); if (s->enclosure_bypassed_b) printf(" | ENCLOSURE_BYPASSED_B"); if (s->device_bypassed_a) printf(" | DEVICE_BYPASSED_A"); if (s->device_bypassed_b) printf(" | DEVICE_BYPASSED_B"); if (s->bypassed_a) printf(" | BYPASSED_A"); if (s->bypassed_b) printf(" | BYPASSED_B"); CHK_IDENT_LED(s); CHK_FAULT_LED(s); printf("\n"); } /* Print slider disk status */ static void print_slider_disk_status(struct slider_disk_status *disk_status) { int i; struct slider_disk_status *ds; printf("\n\n Drive Status\n"); for (i = 0; i < slider_v_nr_disk; i++) { ds = &(disk_status[i]); /* Print only if disk element access bit is set */ if (ds->byte0.status == ES_NO_ACCESS_ALLOWED) continue; printf(" Disk %02d (Slot %02d): ", i+1, ds->slot_address); print_slider_drive_status(ds); } } static void slider_print_power_supply_status(struct slider_power_supply_status *s) { enum element_status_code sc = (enum element_status_code) s->byte0.status; printf("%s", status_string(sc, valid_codes)); if (s->cycled) printf(" | CYCLED"); if (s->dc_fail) printf(" | DC_FAIL"); if (s->dc_over_voltage) printf(" | DC_OVER_VOLTAGE"); if (s->dc_under_voltage) printf(" | DC_UNDER_VOLTAGE"); if (s->dc_over_current) printf(" | DC_OVER_CURRENT"); if (s->ac_fail) printf(" | AC_FAIL"); if (s->temp_warn) printf(" | TEMPERATURE_WARNING"); if (s->ovrtmp_fail) printf(" | OVER_TEMPERATURE_FAILURE"); CHK_IDENT_LED(s); CHK_FAULT_LED(s); printf("\n"); } /* Print slider power supply status */ static void print_slider_power_supply_status( struct slider_power_supply_status *ps_status, struct slider_voltage_sensor_set *voltage_sensor_sets) { int i; printf("\n Power Supply Status\n"); for (i = 0; i < SLIDER_NR_POWER_SUPPLY; i++) { printf(" PS%d (%-5s): ", i, left_right[i]); slider_print_power_supply_status(&(ps_status[i])); printf(" 3.3V: "); print_slider_voltage_sensor_status( &(voltage_sensor_sets[i].sensor_3V3)); printf(" 1V0 : "); print_slider_voltage_sensor_status( &(voltage_sensor_sets[i].sensor_1V0)); printf(" 1V8 : "); print_slider_voltage_sensor_status( &(voltage_sensor_sets[i].sensor_1V8)); printf(" 0V92: "); print_slider_voltage_sensor_status( &(voltage_sensor_sets[i].sensor_0V92)); } } /* Print slider enclosure status */ static void print_slider_enclosure_status(struct enclosure_status *s) { printf("\n Enclosure Status: "); return print_enclosure_status(s, valid_codes); } /* Print slider midplane status */ static void print_slider_midplane_status(struct slider_midplane_status *s) { enum element_status_code sc = (enum element_status_code) s->byte0.status; printf("\n Midplane Status: "); printf("%s", status_string(sc, valid_codes)); if (s->vpd1_read_fail1) printf(" | Last read on VPD1 via ESC1 was failed"); if (s->vpd1_read_fail2) printf(" | Last read on VPD1 via ESC2 failed"); if (s->vpd2_read_fail1) printf(" | Last read on VPD2 via ESC1 was failed"); if (s->vpd2_read_fail2) printf(" | Last read on VPD2 via ESC2 failed"); if (s->vpd_mirror_mismatch) printf(" | Mismatch between copies of VPD"); printf("\n"); } /* Print slider fan status */ static void print_slider_fan_status(struct slider_fan_set *fan_sets) { int i, j; struct fan_status *s; enum element_status_code sc; printf("\n Fan Status\n"); for (i = 0; i < SLIDER_NR_POWER_SUPPLY; i++) { printf(" %s %s\n", left_right[i], "power supply fans"); for (j = 0; j < SLIDER_NR_FAN_PER_POWER_SUPPLY; j++) { printf(" Fan Element %d: ", j + 1); s = &(fan_sets[i].fan_element[j]); sc = (enum element_status_code) s->byte0.status; printf("%s", status_string(sc, valid_codes)); CHK_IDENT_LED(s); CHK_FAULT_LED(s); if (cmd_opts.verbose) printf(" | speed :%d rpm", (((s->fan_speed_msb) << 8) | (s->fan_speed_lsb)) * SLIDER_FAN_SPEED_FACTOR); printf("\n"); } } } /* Print slider temperature sensor status */ static void print_slider_temp_sensor_sets( struct slider_temperature_sensor_set *tss) { int i, j; printf("\n Temperature Sensors\n"); printf(" Enclosure Ambient air: "); print_slider_temp_sensor_status(&tss->temp_enclosure); for (i = 0; i < SLIDER_NR_PSU; i++) { printf(" PSU%d:\n", i + 1); for (j = 0; j < SLIDER_NR_TEMP_SENSOR_PER_PSU; j++) { printf(" Temp sensor element %d (%-8s): ", j + 1, psu_temp_sensor_names[j]); print_slider_temp_sensor_status(&tss->temp_psu [(i * SLIDER_NR_TEMP_SENSOR_PER_PSU) + j]); } } for (i = 0; i < SLIDER_NR_ESC; i++) { printf(" ENCL Service Cntrl %d:\n", i + 1); for (j = 0; j < SLIDER_NR_TEMP_SENSOR_PER_ESC; j++) { printf(" Temp sensor Element %d (%-8s): ", j + 1, esc_temp_sensor_names[j]); print_slider_temp_sensor_status(&tss->temp_esc [(i * SLIDER_NR_TEMP_SENSOR_PER_ESC) + j]); } } } /* Print slider ESC reset reason */ static void slider_print_esc_reset_reason(uint8_t reset_reason) { switch (reset_reason) { case 0: printf(" | First power on"); break; case 1: printf(" | Application (host) requested"); break; case 2: printf(" | Self initiated"); break; case 3: printf(" | Firmware download"); break; case 4: printf(" | Exception"); break; case 5: printf(" | Error"); break; case 6: printf(" | Unknown"); break; case 7: printf(" | Partner request"); break; case 8: printf(" | Watchdog"); break; case 9: printf(" | Address load exception"); break; case 10: printf(" | Address store exception"); break; case 11: printf(" | Instruction fetch exception"); break; case 12: printf(" | Data load or store exception"); break; case 13: printf(" | Illegal instruction exception"); break; case 14: printf(" | System reset"); break; } } /* Print slider enclosure service controller status */ static void print_esc_status( struct slider_enc_service_ctrl_status *enc_service_ctrl_element) { int i; struct slider_enc_service_ctrl_status *s; enum element_status_code sc; printf("\n Enclosure service controller status\n"); for (i = 0; i < SLIDER_NR_ESC; i++) { printf(" %-5s: ", left_right[i]); s = &(enc_service_ctrl_element[i]); sc = (enum element_status_code) s->byte0.status; printf("%s", status_string(sc, valid_codes)); if (s->vpd_read_fail) printf(" | VPD read fail"); slider_print_esc_reset_reason (enc_service_ctrl_element->reset_reason); if (s->vpd_mismatch) printf(" | VPD mismatch"); if (s->vpd_mirror_mismatch) printf(" | VPD mirror mismatch"); if (s->firm_img_unmatch) printf(" | Fw image unmatch"); if (s->ierr_asserted) printf(" | IERR asserted"); if (s->xcc_data_initialised) printf(" | Cross card data initialized"); if (s->report) printf(" | Report active"); if (s->hot_swap) printf(" | Hotswap enabled"); CHK_IDENT_LED(s); CHK_FAULT_LED(s); printf("\n"); } } /* Print slider sas expander status */ static void print_slider_sas_expander_status( struct slider_sas_expander_status *sas_expander_element) { int i; struct slider_sas_expander_status *s; enum element_status_code sc; printf("\n SAS Expander Status\n"); for (i = 0; i < SLIDER_NR_ESC; i++) { printf(" %-5s: ", left_right[i]); s = &(sas_expander_element[i]); sc = (enum element_status_code) s->byte0.status; printf("%s", status_string(sc, valid_codes)); printf("\n"); } } /* Print slider sas connector status */ static void print_slider_sas_connector_status( struct slider_sas_connector_status *sas_connector_status) { int i, j; struct slider_sas_connector_status *s; enum element_status_code sc; printf("\n SAS Connector Status\n"); for (i = 0; i < SLIDER_NR_SAS_EXPANDER; i++) { printf(" %s:\n", left_right[i]); for (j = 0; j < SLIDER_NR_SAS_CONNECTOR_PER_EXPANDER; j++) { printf(" %-11s: ", sas_connector_names[j]); s = &(sas_connector_status [(i * SLIDER_NR_SAS_CONNECTOR_PER_EXPANDER) + j]); sc = (enum element_status_code) s->byte0.status; printf("%s", status_string(sc, valid_codes)); CHK_IDENT_LED(s); CHK_FAULT_LED(s); printf("\n"); } } } /* Print slider phy status */ static void print_slider_phy_status(struct slider_phy_set *phy_sets) { int i, j; struct slider_phy_status *s; enum element_status_code sc; printf("\n Phy Status\n"); for (i = 0; i < SLIDER_NR_SAS_EXPANDER; i++) { printf(" %s:\n", left_right[i]); for (j = 0; j < SLIDER_NR_PHY_PER_SAS_EXPANDER; j++) { s = &(phy_sets[i].phy_element[j]); if (s->enable) { printf(" Physical link %2d: ", j + 1); sc = (enum element_status_code)s->byte0.status; printf("%s", status_string(sc, valid_codes)); } printf("\n"); } } } /* Print slider statesave buffer status */ static void print_slider_ssb_status( struct slider_statesave_buffer_status *ssb_element) { int i; struct slider_statesave_buffer_status *s; enum element_status_code sc; printf("\n Statesave Buffer Status:\n"); for (i = 0; i < SLIDER_NR_SSB; i++) { printf(" Element %d (%-5s): ", i + 1, left_right[i]); s = &(ssb_element[i]); sc = (enum element_status_code) s->byte0.status; printf("%s", status_string(sc, valid_codes)); if (cmd_opts.verbose) { switch (s->buffer_status) { case 0: printf(" | No statesave available for " "retrieval"); break; case 1: printf(" | At least one statesave available" " for retrieval"); break; case 2: printf(" | Statesave collection in progress" " and no prior statesave available" " for retrieval"); break; case 0xFF: printf(" | Unknown buffer status"); break; } if (s->buffer_type == 0x00) printf(" | A statesave"); else if (s->buffer_type == 0x01) printf(" | Host"); else if (s->buffer_type == 0x02) printf(" | Self informational"); else if ((s->buffer_type >= 0x03) && (s->buffer_type <= 0x7F)) printf(" | Future host type"); else if (s->buffer_type == 0x80) printf(" | Self"); else if ((s->buffer_type >= 0x81) && (s->buffer_type <= 0xFF)) printf(" | Future self type"); } printf("\n"); } } /* Print slider cpld status */ static void print_slider_cpld_status(struct slider_cpld_status *cpld_element) { int i; struct slider_cpld_status *s; enum element_status_code sc; printf("\n CPLD Status:\n"); for (i = 0; i < SLIDER_NR_ESC; i++) { printf(" %-5s: ", left_right[i]); s = &(cpld_element[i]); sc = (enum element_status_code) s->byte0.status; printf("%s", status_string(sc, valid_codes)); if (s->fail) printf(" | Unrecoverable Issue found"); printf("\n"); } } /* Print slider input power status */ static void print_slider_input_power_status( struct slider_input_power_status *input_power_element) { int i, j; struct slider_input_power_status *s; enum element_status_code sc; printf("\n Input Power Status:\n"); for (i = 0; i < SLIDER_NR_PSU; i++) { printf(" PSU%d:\n", i + 1); for (j = 0; j < SLIDER_NR_INPUT_POWER_PER_PSU; j++) { printf(" %-19s: ", input_power_names[j]); s = &(input_power_element [(i * SLIDER_NR_INPUT_POWER_PER_PSU) + j]); sc = (enum element_status_code) s->byte0.status; printf("%-28s", status_string(sc, valid_codes)); if (cmd_opts.verbose) { printf(" | Input power : %d", ntohs(s->input_power)); } printf("\n"); } } } /* @return 0 for success, !0 for failure */ static int slider_read_diag_page2(char **page, int *fdp) { char *buffer; int rc; /* Allocating status diagnostics page */ buffer = calloc(1, slider_v_diag_page2_size); if (!buffer) { fprintf(stderr, "Failed to allocate memory to hold " "current status diagnostics page 02 results.\n"); return 1; } if (cmd_opts.fake_path) { rc = read_page2_from_file(cmd_opts.fake_path, true, buffer, slider_v_diag_page2_size); *fdp = -1; } else { rc = get_diagnostic_page(*fdp, RECEIVE_DIAGNOSTIC, 2, (void *)buffer, (int)slider_v_diag_page2_size); } if (rc != 0) { fprintf(stderr, "Failed to read SES diagnostic page; " "cannot report status.\n"); free(buffer); } *page = buffer; return rc; } /* Slider variant details */ static int fill_slider_v_specific_details(void) { if (slider_variant_flag == SLIDER_V_LFF) { slider_v_diag_page2_size = sizeof(struct slider_lff_diag_page2); slider_v_ctrl_page2_size = sizeof(struct slider_lff_ctrl_page2); slider_v_nr_disk = SLIDER_NR_LFF_DISK; } else if (slider_variant_flag == SLIDER_V_SFF) { slider_v_diag_page2_size = sizeof(struct slider_sff_diag_page2); slider_v_ctrl_page2_size = sizeof(struct slider_sff_ctrl_page2); slider_v_nr_disk = SLIDER_NR_SFF_DISK; } else { return -1; } return 0; } /* Prints slider element status */ static void diag_print_slider_status(void *dp) { print_slider_disk_status ((struct slider_disk_status *) (dp + element_offset(disk_status))); print_slider_power_supply_status ((struct slider_power_supply_status *) (dp + element_offset(ps_status)), (struct slider_voltage_sensor_set *) (dp + element_offset(voltage_sensor_sets))); print_slider_fan_status ((struct slider_fan_set *) (dp + element_offset(fan_sets))); print_slider_temp_sensor_sets ((struct slider_temperature_sensor_set *) (dp + element_offset(temp_sensor_sets))); print_esc_status ((struct slider_enc_service_ctrl_status *) (dp + element_offset(enc_service_ctrl_element))); print_slider_enclosure_status ((struct enclosure_status *) (dp + element_offset(encl_element))); print_slider_sas_expander_status ((struct slider_sas_expander_status *) (dp + element_offset(sas_expander_element))); print_slider_sas_connector_status ((struct slider_sas_connector_status *) (dp + element_offset(sas_connector_status))); print_slider_midplane_status ((struct slider_midplane_status *) (dp + element_offset(midplane_element_status))); print_slider_phy_status((struct slider_phy_set *) (dp + element_offset(phy_sets))); print_slider_ssb_status ((struct slider_statesave_buffer_status *) (dp + element_offset(ssb_element))); print_slider_cpld_status ((struct slider_cpld_status *) (dp + element_offset(cpld_element))); print_slider_input_power_status ((struct slider_input_power_status *) (dp + element_offset(input_power_element))); } static void diag_print_slider_overall_lff_status(void *buffer) { struct slider_lff_diag_page2 *dp = (struct slider_lff_diag_page2 *)buffer; printf(" Overall Status: "); if (dp->crit) { printf("CRITICAL_FAULT"); if (dp->non_crit) printf(" | NON_CRITICAL_FAULT"); } else if (dp->non_crit) printf("NON_CRITICAL_FAULT"); else if (dp->unrecov) printf("UNRECOVERABLE_FAULT"); else printf("ok"); } static void diag_print_slider_overall_sff_status(void *buffer) { struct slider_sff_diag_page2 *dp = (struct slider_sff_diag_page2 *)buffer; printf(" Overall Status: "); if (dp->crit) { printf("CRITICAL_FAULT"); if (dp->non_crit) printf(" | NON_CRITICAL_FAULT"); } else if (dp->non_crit) printf("NON_CRITICAL_FAULT"); else if (dp->unrecov) printf("UNRECOVERABLE_FAULT"); else printf("ok"); } static inline int diag_print_slider_overall_status(void *buffer) { if (slider_variant_flag == SLIDER_V_LFF) { diag_print_slider_overall_lff_status(buffer); } else if (slider_variant_flag == SLIDER_V_SFF) { diag_print_slider_overall_sff_status(buffer); } else { return 1; } return 0; } /* * Slider diagnostics * Returns 0 in success and 1 in failure */ static int diag_slider(int slider_type, int fd, struct dev_vpd *vpd) { char *buffer; int rc; /* Slider variant flag */ slider_variant_flag = slider_type; /* Fill slider variant specific details */ if (fill_slider_v_specific_details()) return 1; /* Read diag page */ if (slider_read_diag_page2(&buffer, &fd)) return 1; /* Print enclosure overall status */ rc = diag_print_slider_overall_status((void *)buffer); if (rc) goto err_out; /* Print slider element status */ diag_print_slider_status(buffer); /* Print raw data */ if (cmd_opts.verbose) { printf("\n\nRaw diagnostic page:\n"); print_raw_data(stdout, buffer, slider_v_diag_page2_size); } printf("\n\n"); /* * Report faults to syslog(in powerNV)/servicelog(powerVM), and turn * on LEDs as appropriate. LED status reported previously may not be * accurate after we do this, but the alternative is to report faults * first and then read the diagnostic page a second time. * And unfortunately, the changes to LED settings don't always show up * immediately in the next query of the SES. */ if (cmd_opts.serv_event) { rc = report_slider_fault_to_svclog(buffer, vpd, fd); if (rc) goto err_out; } /* Set led state (option -l is not supported for fake path) */ if (fd != -1 && cmd_opts.leds) rc = slider_turn_on_fault_leds(buffer, fd); err_out: free(buffer); return rc; } /* * callback function for lff variant of slider * @return 0 for success, 1 for failure */ int diag_slider_lff(int fd, struct dev_vpd *vpd) { if (diag_slider(SLIDER_V_LFF, fd, vpd)) return 1; return 0; } /* * callback function for sff variant of slider * @return 0 for success, 1 for failure */ int diag_slider_sff(int fd, struct dev_vpd *vpd) { if (diag_slider(SLIDER_V_SFF, fd, vpd)) return 1; return 0; } ppc64-diag-2.7.4/diags/diag_disk.c0000644000000000000000000002523613135275400013432 00000000000000/** * @file disk_health.c * @brief Collect disk health information and store it in xml file * * Copyright (C) 2017 IBM Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * @author Ankit Kumar */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "encl_util.h" #define OUTPUT_PATH "/var/log/ppc64-diag/diag_disk" #define SYSFS_SG_PATH "/sys/class/scsi_generic" #define DEVICE_TREE "/proc/device-tree/" #define DEVICE_TREE_SYSTEM_ID DEVICE_TREE"system-id" #define DEVICE_TREE_MODEL DEVICE_TREE"model" #define SERIAL_NUM_LEN 8 #define MACHINE_MODEL_LEN 8 /* Disk firmware, part number length */ #define FIRM_VER_LEN 16 #define PART_NUM_LEN 12 /* SCSI command length */ #define CCB_CDB_LEN 16 /* Smart data page for disk */ #define SMART_DATA_PAGE 0x34 #define LOG_SENSE_PROBE_ALLOC_LEN 4 #define DISK_HEALTH_VERSION "1.0.0" /* xml output file descriptor */ static FILE *result_file; /* * Length of cdb (command descriptor block) for different scsi opcode. * For more details, go through scsi command opcode details. */ static const int cdb_size[] = {6, 10, 10, 0, 16, 12, 16, 16}; struct page_c4 { #if defined (__BIG_ENDIAN_BITFIELD) uint8_t peri_qual:3; uint8_t peri_dev_type:5; #elif defined (__LITTLE_ENDIAN_BITFIELD) uint8_t peri_dev_type:5; uint8_t peri_qual:3; #endif uint8_t page_code; uint8_t reserved1; uint8_t page_length; uint8_t endurance; uint8_t endurance_val; uint8_t reserved2[5]; uint8_t revision; uint8_t serial_num[SERIAL_NUM_LEN]; uint8_t supp_serial_num[SERIAL_NUM_LEN]; uint8_t master_drive_part_num[PART_NUM_LEN]; } __attribute__((packed)); struct page_3 { uint8_t peri_qual_dev_type; uint8_t page_code; uint8_t reserved1; uint8_t page_length; uint8_t ascii_len; uint8_t reserved2[3]; uint8_t load_id[4]; uint8_t release_level[4]; uint8_t ptf_num[4]; uint8_t patch_num[4]; } __attribute__((packed)); static int get_page_34_data(int device_fd) { uint8_t *buff; int rc, i, buff_len; char first_4_bytes[4] = { 0 }; /* Read first four byte to know actual length of smart data page */ rc = do_ses_cmd(device_fd, LOG_SENSE, SMART_DATA_PAGE, 0x01, cdb_size[(LOG_SENSE >> 5) & 0x7], SG_DXFER_FROM_DEV, first_4_bytes, sizeof(first_4_bytes)); if (rc) return rc; /* Second (MSB) and third byte contains data length field */ buff_len = (first_4_bytes[2] << 8) + first_4_bytes[3] + 4; buff = (uint8_t *)calloc(1, buff_len); if (!buff) return -1; rc = do_ses_cmd(device_fd, LOG_SENSE, SMART_DATA_PAGE, 0x01, cdb_size[(LOG_SENSE >> 5) & 0x7], SG_DXFER_FROM_DEV, buff, buff_len); if (rc) { free(buff); return rc; } fprintf(result_file, "\n"); for (i = 0; i < buff_len; i++) fprintf(result_file, "%02x", buff[i]); free(buff); fprintf(result_file, "\n"); fprintf(result_file, "\n"); return 0; } static inline int open_output_xml_file(const char *xml_filename) { char filename[PATH_MAX]; snprintf(filename, sizeof(filename) - 1, "%s/%s", OUTPUT_PATH, xml_filename); result_file = fopen(filename, "w"); if (!result_file) return -1; return 0; } static inline void close_output_xml_file(void) { fclose(result_file); } /* In UTC format */ static inline int get_current_time(struct tm *tmptr) { time_t t = time(NULL); *tmptr = *gmtime(&t); if (tmptr == NULL) return -1; return 0; } static void populate_xml_header(char *result_file_name, char *time_stamp, char *machine_type, char *machine_model, char *machine_serial) { fprintf(result_file, "\n"); fprintf(result_file, "\n", DISK_HEALTH_VERSION); fprintf(result_file, "\n", result_file_name, time_stamp); fprintf(result_file, "\n", machine_type, machine_model, machine_serial); } static inline void populate_xml_footer(void) { fprintf(result_file, "\n"); } static int get_system_vpd(char *machine_serial, char *machine_type, char **machine_model) { int device_fd; int rc; int start_index = 0; char serial[SERIAL_NUM_LEN + 1] = {0}; char model[MACHINE_MODEL_LEN + 1] = {0}; char *temp; device_fd = open(DEVICE_TREE_SYSTEM_ID, O_RDONLY); if (device_fd < 0) return -1; rc = read(device_fd, serial, SERIAL_NUM_LEN); close(device_fd); if (rc <= 0) return -1; /* Last 5 bytes contains serial number */ if (strlen(serial) > 5) start_index = strlen(serial) - 5; strncpy(machine_serial, serial + start_index, SERIAL_NUM_LEN); device_fd = open(DEVICE_TREE_MODEL, O_RDONLY); if (device_fd < 0) return -1; rc = read(device_fd, model, MACHINE_MODEL_LEN); close(device_fd); if (rc <= 0) return -1; temp = model; /* Discard manufacturer name (valid on PowerVM) */ if (strchr(model, ',') != NULL) temp = strchr(model, ',') + 1; strncpy(machine_type, temp, MACHINE_MODEL_LEN + 1); *machine_model = strchr(machine_type, '-'); if (*machine_model == NULL) /* Failed to get model name */ return -1; **machine_model = '\0'; (*machine_model)++; return 0; } static int get_disk_vpd(int device_fd) { char serial_num[SERIAL_NUM_LEN + 1] = { 0 }; struct page_3 page3_inq = { 0 }; char firm_num[FIRM_VER_LEN + 1] = { 0 }; struct page_c4 pagec4 = { 0 }; char master_drive_part_num[PART_NUM_LEN + 1] = { 0 }; int rc; char *temp = NULL; /* get device specific details */ fprintf(result_file, "> 5) & 0x7], SG_DXFER_FROM_DEV, &pagec4, sizeof(pagec4)); if (!rc) { strncpy(serial_num, (char *)pagec4.serial_num, sizeof(serial_num - 1)); strncpy(master_drive_part_num, (char *)pagec4.master_drive_part_num, sizeof(master_drive_part_num) - 1); /* discard data after first occurance of space */ temp = strchr(master_drive_part_num, ' '); if (temp) *temp = '\0'; fprintf(result_file, "pn=\"%s\" sn=\"%s\" ", master_drive_part_num, serial_num); } /* firmware details */ rc = do_ses_cmd(device_fd, INQUIRY, 0x03, 0x01, cdb_size[(INQUIRY >> 5) & 0x7], SG_DXFER_FROM_DEV, &page3_inq, sizeof(page3_inq)); if (!rc) { snprintf(firm_num, sizeof(firm_num) - 1, "%c%c%c%c", page3_inq.release_level[0], page3_inq.release_level[1], page3_inq.release_level[2], page3_inq.release_level[3]); fprintf(result_file, "fw=\"%s\"", firm_num); } fprintf(result_file, ">\n"); /* get page_34 data */ rc = get_page_34_data(device_fd); fprintf(result_file, "\n"); return 0; } static int sysfs_sg_disk_scan(const char *dir_name, char *disk_name) { DIR *d; bool disk_found = false; int device_fd; int rc = 0; struct sg_scsi_id sg_dat; struct dirent *namelist; d = opendir(dir_name); if (!d) return -errno; /* scan and get disk data */ while ((namelist = readdir(d)) != NULL) { if (namelist->d_name[0] == '.') continue; /* query for specific disk */ if (disk_name) { if (strcmp(disk_name, namelist->d_name)) continue; } device_fd = open_sg_device(namelist->d_name); if (device_fd < 0) continue; if (ioctl(device_fd, SG_GET_SCSI_ID, &sg_dat) < 0) { close_sg_device(device_fd); continue; } if (sg_dat.scsi_type == TYPE_DISK || sg_dat.scsi_type == 14) { disk_found = true; get_disk_vpd(device_fd); } close_sg_device(device_fd); } if (disk_name && disk_found == false) { fprintf(stderr, "\nUnable to validate disk name[%s].\n\n", disk_name); rc = -1; } closedir(d); return rc; } static int remove_old_log_file(char *xml_filename) { DIR *d; struct dirent *namelist; char filename[PATH_MAX]; int dir_fd; d = opendir(OUTPUT_PATH); if (!d) return -errno; while ((namelist = readdir(d)) != NULL) { if (namelist->d_name[0] == '.') continue; if (!strcmp(xml_filename, namelist->d_name)) continue; snprintf(filename, sizeof(filename) - 1, "%s/%s", OUTPUT_PATH, namelist->d_name); if (unlink(filename) < 0) { fprintf(stderr, "\nUnable to remove old log file[%s]. continuing.\n\n", filename); } } closedir(d); dir_fd = open(OUTPUT_PATH, O_RDONLY|O_DIRECTORY); if (dir_fd >= 0) { fsync(dir_fd); close(dir_fd); } return 0; } /* * @param: it takes disk name as an input. If disk_name is NULL, it collects * data for all available disk. * @return : zero on success. non zero on failure. */ int diag_disk(char *disk_name) { char serial_num[SERIAL_NUM_LEN + 1]; char mach_type_model[MACHINE_MODEL_LEN + 1]; char *mach_model = NULL; char time_stamp[256]; char xml_filename[PATH_MAX]; struct tm tm; int ret; /* get system vpd */ ret = get_system_vpd(serial_num, mach_type_model, &mach_model); if (ret) { fprintf(stderr, "Unable to read system vpd.\n"); return -1; } /* get current time */ ret = get_current_time(&tm); if (ret) { fprintf(stderr, "Unable to read current time.\n"); return -1; } snprintf(time_stamp, sizeof(time_stamp) - 1, "%d-%d-%dT%d:%d:%dZ\n", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec); /* file format */ snprintf(xml_filename, sizeof(xml_filename) - 1, "%s~%s~%s~diskAnalytics~%d%02d%02d%02d%02d%02d.xml", mach_type_model, mach_model, serial_num, tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec); /* open file */ ret = open_output_xml_file(xml_filename); if (ret) { fprintf(stderr, "Unable to open output xml file.\n"); return -1; } /* populate xml header */ populate_xml_header(xml_filename, time_stamp, mach_type_model, mach_model, serial_num); /* get scsi device name */ sysfs_sg_disk_scan(SYSFS_SG_PATH, disk_name); /* populate xml footer */ populate_xml_footer(); /* close output xml file descriptor */ close_output_xml_file(); /* remove old log file */ ret = remove_old_log_file(xml_filename); if (ret) { fprintf(stderr, "Unable to remove old output log file.\n"); return -1; } return 0; } ppc64-diag-2.7.4/diags/diag_encl.h0000644000000000000000000000264313135275400013423 00000000000000/* * Copyright (C) 2009, 2015 IBM Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _DIAG_ENCL_H #define _DIAG_ENCL_H #include #include "encl_util.h" struct cmd_opts { int cmp_prev; /* -c */ int leds; /* -l */ int serv_event; /* -s */ int verbose; /* -v */ int disk_health; char *disk_name; char *fake_path; /* -f */ char *prev_path; /* for -c */ }; extern struct cmd_opts cmd_opts; extern int platform; extern int diag_7031_D24_T24(int, struct dev_vpd *); extern int diag_bluehawk(int, struct dev_vpd *); extern int diag_homerun(int, struct dev_vpd *); extern int diag_slider_lff(int, struct dev_vpd *); extern int diag_slider_sff(int, struct dev_vpd *); extern int diag_disk(char *disk_name); #endif /* _DIAG_ENCL_H */ ppc64-diag-2.7.4/diags/encl_util.h0000644000000000000000000000520013135275400013464 00000000000000/* * Copyright (C) 2012, 2015 IBM Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _ENCL_UTIL_H #define _ENCL_UTIL_H #include #include #include /* SES sys path */ #define SCSI_SES_PATH "/sys/class/enclosure" #define LSVPD_PATH "/usr/sbin/lsvpd" #define LSCFG_PATH "/usr/sbin/lscfg" #define VPD_LENGTH 128 #define LOCATION_LENGTH 80 /* device vpd */ struct dev_vpd { char dev[PATH_MAX]; char mtm[VPD_LENGTH]; char location[LOCATION_LENGTH]; /* like full_loc, but truncated at '-' */ char full_loc[LOCATION_LENGTH]; char sn[VPD_LENGTH]; char fru[VPD_LENGTH]; struct dev_vpd *next; }; struct sense_data_t { uint8_t error_code; uint8_t segment_numb; uint8_t sense_key; uint8_t info[4]; uint8_t add_sense_len; uint8_t cmd_spec_info[4]; uint8_t add_sense_code; uint8_t add_sense_code_qual; uint8_t field_rep_unit_code; uint8_t sense_key_spec[3]; uint8_t add_sense_bytes[0]; }; extern int print_raw_data(FILE *ostream, char *data, int data_len); extern int open_sg_device(const char *encl); extern int close_sg_device(int fd); extern int read_page2_from_file(const char *path, bool display_error_msg, void *pg, int size); extern int write_page2_to_file(const char *path, void *pg, int size); extern int enclosure_maint_mode(const char *sg); extern int do_ses_cmd(int fd, uint8_t cmd, uint8_t page_nr, uint8_t flags, uint8_t cmd_len, int dxfer_direction, void *buf, int buf_len); extern int get_diagnostic_page(int fd, uint8_t cmd, uint8_t page_nr, void *buf, int buf_len); extern char *fgets_nonl(char *buf, int size, FILE *s); extern int read_vpd_from_lscfg(struct dev_vpd *vpd, const char *sg); extern void trim_location_code(struct dev_vpd *vpd); extern char *strzcpy(char *dest, const char *src, size_t n); extern int valid_enclosure_device(const char *sg); extern void element_check_range(unsigned int n, unsigned int min, unsigned int max, const char *lc); #endif /* _ENCL_UTIL_H */ ppc64-diag-2.7.4/diags/bluehawk.h0000644000000000000000000002136413135275400013321 00000000000000/* * Copyright (C) 2012, 2015, 2016 IBM Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef __BLUEHAWK_H__ #define __BLUEHAWK_H__ #include #include #include "encl_common.h" #define NR_DISKS_PER_BLUEHAWK 30 /* * Common structures across enclosure are defined in encl_common.h * Reference : Bluehawk SAS Expander Specification v0.7 * - disk_status - table 4.3.5 and 4.3.6 * - enclosure_status - table 4.3.7 * - esm_status - table 4.3.8, 4.3.9 * - temperature_sensor_status - table 4.3.10, 4.3.11 * - fan_status - table 4.3.12, 4.3.13 * - power_supply_status - table 4.3.14, 4.3.15 * - voltage_sensor_status - table 4.3.16, 4.3.17 */ struct temperature_sensor_set { struct temperature_sensor_status croc; struct temperature_sensor_status ppc; struct temperature_sensor_status expander; struct temperature_sensor_status ambient[2]; struct temperature_sensor_status power_supply[2]; }; struct fan_set { struct fan_status power_supply; struct fan_status fan_element[4]; }; struct voltage_sensor_set { struct voltage_sensor_status sensor_12V; struct voltage_sensor_status sensor_3_3VA; }; struct sas_connector_status { /* from 4.3.18, 4.3.19 */ struct element_status_byte0 byte0; #if defined (__BIG_ENDIAN_BITFIELD) uint8_t ident:1; uint8_t connector_type:7; /* = 5 */ uint8_t connector_physical_link; /* = 0xff */ uint8_t reserved2:1; uint8_t fail:1; uint8_t reserved3:6; #elif defined (__LITTLE_ENDIAN_BITFIELD) uint8_t connector_type:7; /* = 5 */ uint8_t ident:1; uint8_t connector_physical_link; /* = 0xff */ uint8_t reserved3:6; uint8_t fail:1; uint8_t reserved2:1; #endif }; struct scc_controller_overall_status { /* from 4.3.20 */ struct element_status_byte0 byte0; #if defined (__BIG_ENDIAN_BITFIELD) uint8_t ident:1; uint8_t fail:1; uint8_t reserved2:6; #elif defined (__LITTLE_ENDIAN_BITFIELD) uint8_t reserved2:6; uint8_t fail:1; uint8_t ident:1; #endif uint8_t reserved3; uint8_t reserved4; }; struct scc_controller_element_status { /* from 4.3.21 */ struct element_status_byte0 byte0; #if defined (__BIG_ENDIAN_BITFIELD) uint8_t ident:1; uint8_t fail:1; uint8_t reserved2:6; uint8_t reserved3:7; uint8_t report:1; #elif defined (__LITTLE_ENDIAN_BITFIELD) uint8_t reserved2:6; uint8_t fail:1; uint8_t ident:1; uint8_t report:1; uint8_t reserved3:7; #endif uint8_t reserved4; }; struct midplane_status { /* from 4.3.22, 4.3.23 */ struct element_status_byte0 byte0; #if defined (__BIG_ENDIAN_BITFIELD) uint8_t ident:1; uint8_t fail:1; uint8_t reserved2:6; #elif defined (__LITTLE_ENDIAN_BITFIELD) uint8_t reserved2:6; uint8_t fail:1; uint8_t ident:1; #endif uint8_t reserved3; uint8_t reserved4; }; /* * Note: This data structure matches the layout described in v0.7 of * the Bluehawk SAS Expander Specification, Table 4.16, ... Status * Diagnostic Page, and the element counts in Table 4.15, Configuration * Diagnostic Page. */ struct bluehawk_diag_page2 { uint8_t page_code; #if defined (__BIG_ENDIAN_BITFIELD) uint8_t reserved1:3; uint8_t invop:1; uint8_t info:1; uint8_t non_crit:1; uint8_t crit:1; uint8_t unrecov:1; #elif defined (__LITTLE_ENDIAN_BITFIELD) uint8_t unrecov:1; uint8_t crit:1; uint8_t non_crit:1; uint8_t info:1; uint8_t invop:1; uint8_t reserved1:3; #endif uint16_t page_length; uint32_t generation_code; struct disk_status overall_disk_status; struct disk_status disk_status[NR_DISKS_PER_BLUEHAWK]; struct enclosure_status overall_enclosure_status; struct enclosure_status enclosure_element_status; struct esm_status overall_esm_status; struct esm_status esm_status[2]; /* L and R, AKA A and B */ struct temperature_sensor_status overall_temp_sensor_status; struct temperature_sensor_set temp_sensor_sets[2]; /* L and R */ struct fan_status overall_fan_status; struct fan_set fan_sets[2]; /* L and R */ struct power_supply_status overall_power_status; struct power_supply_status ps_status[2]; /* PS0=L, PS1=R */ struct voltage_sensor_status overall_voltage_status; struct voltage_sensor_set voltage_sensor_sets[2]; /* PS0, PS1 */ struct sas_connector_status overall_sas_connector_status; struct sas_connector_status sas_connector_status[4]; /* 1L,2L,1R,2R*/ struct scc_controller_overall_status overall_scc_controller_status; struct scc_controller_element_status scc_controller_status[2]; /* L, R*/ struct midplane_status overall_midplane_status; struct midplane_status midplane_element_status; } __attribute__((packed)); struct disk_ctrl { struct common_ctrl common_ctrl; uint8_t reserved2; #if defined (__BIG_ENDIAN_BITFIELD) uint8_t reserved3:1; uint8_t do_not_remove:1; uint8_t reserved4:1; uint8_t rqst_missing:1; uint8_t rqst_insert:1; uint8_t rqst_remove:1; uint8_t rqst_ident:1; uint8_t reserved5:1; uint8_t reserved6:2; uint8_t rqst_fail:1; /* AKA rqst_fault */ uint8_t device_off:1; uint8_t enable_byp_a:1; uint8_t enable_byp_b:1; uint8_t reserved7:2; #elif defined (__LITTLE_ENDIAN_BITFIELD) uint8_t reserved5:1; uint8_t rqst_ident:1; uint8_t rqst_remove:1; uint8_t rqst_insert:1; uint8_t rqst_missing:1; uint8_t reserved4:1; uint8_t do_not_remove:1; uint8_t reserved3:1; uint8_t reserved7:2; uint8_t enable_byp_b:1; uint8_t enable_byp_a:1; uint8_t device_off:1; uint8_t rqst_fail:1; /* AKA rqst_fault */ uint8_t reserved6:2; #endif }; struct fan_ctrl_set { struct fan_ctrl power_supply; struct fan_ctrl fan_element[4]; }; /* Same format as power_supply_ctrl */ struct sas_connector_ctrl { struct common_ctrl common_ctrl; #if defined (__BIG_ENDIAN_BITFIELD) uint8_t rqst_ident:1; uint8_t reserved2:7; uint8_t reserved3; uint8_t reserved4:1; uint8_t rqst_fail:1; uint8_t reserved5:6; #elif defined (__LITTLE_ENDIAN_BITFIELD) uint8_t reserved2:7; uint8_t rqst_ident:1; uint8_t reserved3; uint8_t reserved5:6; uint8_t rqst_fail:1; uint8_t reserved4:1; #endif }; struct scc_controller_ctrl { struct common_ctrl common_ctrl; #if defined (__BIG_ENDIAN_BITFIELD) uint8_t rqst_ident:1; uint8_t rqst_fail:1; uint8_t reserved2:6; #elif defined (__LITTLE_ENDIAN_BITFIELD) uint8_t reserved2:6; uint8_t rqst_fail:1; uint8_t rqst_ident:1; #endif uint16_t reserved3; }; /* Same format as scc_controller_ctrl */ struct midplane_ctrl { struct common_ctrl common_ctrl; #if defined (__BIG_ENDIAN_BITFIELD) uint8_t rqst_ident:1; uint8_t rqst_fail:1; uint8_t reserved2:6; #elif defined (__LITTLE_ENDIAN_BITFIELD) uint8_t reserved2:6; uint8_t rqst_fail:1; uint8_t rqst_ident:1; #endif uint16_t reserved3; }; struct bluehawk_ctrl_page2 { uint8_t page_code; #if defined (__BIG_ENDIAN_BITFIELD) uint8_t reserved1:4; uint8_t info:1; uint8_t non_crit:1; uint8_t crit:1; uint8_t unrecov:1; #elif defined (__LITTLE_ENDIAN_BITFIELD) uint8_t unrecov:1; uint8_t crit:1; uint8_t non_crit:1; uint8_t info:1; uint8_t reserved1:4; #endif uint16_t page_length; uint32_t generation_code; struct disk_ctrl overall_disk_ctrl; struct disk_ctrl disk_ctrl[NR_DISKS_PER_BLUEHAWK]; struct enclosure_ctrl overall_enclosure_ctrl; struct enclosure_ctrl enclosure_element_ctrl; struct esm_ctrl overall_esm_ctrl; struct esm_ctrl esm_ctrl[2]; /* L and R, AKA A and B */ unsigned char temperature_sensor_ctrl[60]; /* per spec 56, all zeroes */ struct fan_ctrl overall_fan_ctrl; struct fan_ctrl_set fan_sets[2]; /* L and R */ struct power_supply_ctrl overall_power_ctrl; struct power_supply_ctrl ps_ctrl[2]; /* PS0=L, PS1=R */ unsigned char voltage_sensor_ctrl[20]; /* all zeroes */ struct sas_connector_ctrl overall_sas_connector_ctrl; struct sas_connector_ctrl sas_connector_ctrl[4]; /* 1L,1R,2L,2R */ struct scc_controller_ctrl overall_scc_controller_ctrl; struct scc_controller_ctrl scc_controller_ctrl[2]; /* L, R */ struct midplane_ctrl overall_midplane_ctrl; struct midplane_ctrl midplane_element_ctrl; } __attribute__((packed)); /* Obtains VPD for power supplies (page 7) via RECEIVE_DIAGNOSTIC command */ struct bh_element_descriptor_page { char ignored1[1074]; struct power_supply_descriptor ps0_vpd; uint16_t reserved; struct power_supply_descriptor ps1_vpd; char ignored2[137]; } __attribute__((packed)); #endif /* __BLUEHAWK_H__ */ ppc64-diag-2.7.4/diags/homerun.h0000644000000000000000000001563413135275400013177 00000000000000/* * Copyright (C) 2015, 2016 IBM Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef __HOMERUN_H__ #define __HOMERUN_H__ #include #include #include "encl_common.h" /* * Home Run contains: * - 2 ESM * - 24 disks * - 2 power supply * - 1 fan element/power supply containing 8 fan elements * - 2 voltage sensors * - 2 temperature sensor containing 3 elements */ #define HR_NR_ESM_CONTROLLERS 2 #define HR_NR_DISKS 24 #define HR_NR_POWER_SUPPLY 2 #define HR_NR_FAN_SET 2 #define HR_NR_FAN_ELEMENT_PER_SET 8 #define HR_NR_VOLTAGE_SENSOR_SET 2 #define HR_NR_TEMP_SENSOR_SET 2 #define HR_NR_TEMP_SENSORS_PER_SET 3 /* 8 cooling element */ struct hr_fan_set { struct fan_status fan_element[HR_NR_FAN_ELEMENT_PER_SET]; }; /* 2 temperature controller and 3 temperature sensor/controller */ struct hr_temperature_sensor_set { struct temperature_sensor_status controller; struct temperature_sensor_status power_supply[HR_NR_TEMP_SENSORS_PER_SET]; }; /* Voltage sensors status. */ struct hr_voltage_sensor_set { struct voltage_sensor_status sensor_12V; struct voltage_sensor_status sensor_5V; struct voltage_sensor_status sensor_5VA; }; /* * Status diagnostics page * * Note: This data structure matches the layout described in v1.1 * of the Home Run Drive Enclosure Specification, Table 5.16. */ struct hr_diag_page2 { /* byte 0 */ uint8_t page_code; /* 0x02 */ /* byte 1 */ #if defined (__BIG_ENDIAN_BITFIELD) uint8_t reserved1:3; uint8_t invop:1; uint8_t info:1; uint8_t non_crit:1; uint8_t crit:1; uint8_t unrecov:1; #elif defined (__LITTLE_ENDIAN_BITFIELD) uint8_t unrecov:1; uint8_t crit:1; uint8_t non_crit:1; uint8_t info:1; uint8_t invop:1; uint8_t reserved1:3; #endif /* byte 2-3 */ uint16_t page_length; /* 0x10C */ /* byte 4-7 */ uint32_t generation_code; /* 0x00000000 */ /* Disk */ struct disk_status overall_disk_status; struct disk_status disk_status[HR_NR_DISKS]; /* Enclosure */ struct enclosure_status overall_enclosure_status; struct enclosure_status enclosure_element_status; /* ESM Electronics */ struct esm_status overall_esm_status; struct esm_status esm_status[HR_NR_ESM_CONTROLLERS]; /* Temperature Sensor */ struct temperature_sensor_status temp_sensor_overall_status; /* A and B */ struct hr_temperature_sensor_set temp_sensor_sets[HR_NR_TEMP_SENSOR_SET]; /* Cooling element */ struct fan_status cooling_element_overall_status; /* L & R cooling element */ struct hr_fan_set fan_sets[HR_NR_FAN_SET]; /* Power Supply */ struct power_supply_status power_supply_overall_status; /* PS0(L) and PS1(R) */ struct power_supply_status ps_status[HR_NR_POWER_SUPPLY]; /* Voltage Sensor */ struct voltage_sensor_status voltage_sensor_overall_status; /* PS0, PS1 */ struct hr_voltage_sensor_set voltage_sensor_sets[HR_NR_VOLTAGE_SENSOR_SET]; } ; /* * Holds VPD for Power Supplies (page 7) got via RECEIVE DIAGNOSTICS command * with a PCV bit set to one and a PAGE CODE field set to 07h. * * This data structure holds a list of variable-length ASCII strings, one * for each element in the Configuration diagnostic page. * * The Element Descriptor diagnostic page is read by the RECEIVE DIAGNOSTIC * RESULTS command with a PCV bit set to one and a PAGE CODE field set to 07h. * Table 5.37 defines the Element Descriptor diagnostic page. */ struct hr_element_descriptor_page { /** * Note: Deviation from spec V0.7. As per spec, Power supply * descriptor starts at offset 638, but actual offset is 642. */ char ignored1[642]; struct power_supply_descriptor ps0_vpd; uint16_t reserved; /* bytes 698-699 */ struct power_supply_descriptor ps1_vpd; char ignored2[28]; } ; /* --- Diagnostic page 2 layout for SEND DIAGNOSTIC command --- */ /* * Device element manages a SCSI device. * Please see Table 5.48 from v1.1 of the Home Run Drive * Enclosure Specification. */ struct hr_disk_ctrl { struct common_ctrl common_ctrl; uint8_t reserved2; #if defined (__BIG_ENDIAN_BITFIELD) uint8_t rqst_active:1; uint8_t do_not_remove:1; uint8_t reserved3:1; uint8_t rqst_missing:1; uint8_t rqst_insert:1; uint8_t rqst_remove:1; uint8_t rqst_ident:1; uint8_t reserved4:1; uint8_t reserved5:2; uint8_t rqst_fail:1; uint8_t device_off:1; uint8_t enable_bypa:1; uint8_t enable_bypb:1; uint8_t reserved6:2; #elif defined (__LITTLE_ENDIAN_BITFIELD) uint8_t reserved4:1; uint8_t rqst_ident:1; uint8_t rqst_remove:1; uint8_t rqst_insert:1; uint8_t rqst_missing:1; uint8_t reserved3:1; uint8_t do_not_remove:1; uint8_t rqst_active:1; uint8_t reserved6:2; uint8_t enable_bypb:1; uint8_t enable_bypa:1; uint8_t device_off:1; uint8_t rqst_fail:1; uint8_t reserved5:2; #endif }; struct hr_fan_ctrl_set { struct fan_ctrl fan_element[HR_NR_FAN_ELEMENT_PER_SET]; }; /* * This data structure implements the Home Run SAS Enclosure Control * diagnostic page. Please check Table 5.46 from v1.1 of the Home Run * Drive Enclosure Specification. */ struct hr_ctrl_page2 { /* byte 1 */ uint8_t page_code; /* 0x02 */ /* byte 2 */ #if defined (__BIG_ENDIAN_BITFIELD) uint8_t reserved1:4; uint8_t info:1; uint8_t non_crit:1; uint8_t crit:1; uint8_t unrecov:1; #elif defined (__LITTLE_ENDIAN_BITFIELD) uint8_t unrecov:1; uint8_t crit:1; uint8_t non_crit:1; uint8_t info:1; uint8_t reserved1:4; #endif /* byte 3 */ uint16_t page_length; /* 0x10c */ /* byte 4-7 */ uint32_t generation_code; /* 0x0000 */ /* Disk element status - byte 8-11 */ struct hr_disk_ctrl overall_disk_ctrl; /* byte 12-107 */ struct hr_disk_ctrl disk_ctrl[HR_NR_DISKS]; /* Enclosure status - byte 108-111 */ struct enclosure_ctrl overall_enclosure_ctrl; /* byte 112-115 */ struct enclosure_ctrl enclosure_element_ctrl; /* ESM electronics status - byte 116-119 */ struct esm_ctrl overall_esm_ctrl; /* for A and B */ struct esm_ctrl esm_ctrl[HR_NR_ESM_CONTROLLERS]; /* Temperature sensor */ unsigned char temperature_sensor_ctrl[36]; /* all zeros */ /* bytes 168-231 */ struct fan_ctrl overall_fan_ctrl; /* L & R */ struct hr_fan_ctrl_set fan_sets[HR_NR_FAN_SET]; /* Power supply */ struct power_supply_ctrl overall_power_supply_ctrl; /* 0L & 1R */ struct power_supply_ctrl ps_ctrl[HR_NR_POWER_SUPPLY]; unsigned char voltage_sensor_ctrl[28]; /* all zeroes */ } ; #endif /* __HOMERUN_H__ */ ppc64-diag-2.7.4/diags/slider.h0000644000000000000000000006357513135275400013013 00000000000000/* * Copyright (C) 2016 IBM Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, * USA. */ #ifndef __SLIDER_H__ #define __SLIDER_H__ #include #include #include "encl_common.h" /* Get slider element offset */ #define lff_offset(element) ((unsigned long) &((struct slider_lff_diag_page2 *)0)->element) #define sff_offset(element) ((unsigned long) &((struct slider_sff_diag_page2 *)0)->element) #define element_offset(element) ((slider_variant_flag == SLIDER_V_LFF) ? \ lff_offset(element) : sff_offset(element)) #define SLIDER_ASSIGN_CTRL_PAGE(ctrl_page) \ do { \ if (slider_variant_flag == SLIDER_V_LFF) { \ struct slider_lff_ctrl_page2 *c \ = (struct slider_lff_ctrl_page2 *)ctrl_page; \ c->page_code = 2; \ c->page_length = slider_v_ctrl_page2_size - 4; \ c->page_length = htons(c->page_length); \ c->generation_code = 0; \ } else { \ struct slider_sff_ctrl_page2 *c \ = (struct slider_sff_ctrl_page2 *)ctrl_page; \ c->page_code = 2; \ c->page_length = slider_v_ctrl_page2_size - 4; \ c->page_length = htons(c->page_length); \ c->generation_code = 0; \ } \ } while (0); /* Slider variant flag */ enum slider_variant { SLIDER_V_LFF, SLIDER_V_SFF }; #define SLIDER_NR_LFF_DISK 12 #define SLIDER_NR_SFF_DISK 24 #define SLIDER_NR_ESC 2 #define SLIDER_NR_ENCLOSURE 1 #define SLIDER_NR_FAN_PER_POWER_SUPPLY 8 #define SLIDER_NR_POWER_SUPPLY 2 #define SLIDER_NR_PHY_PER_SAS_EXPANDER 36 #define SLIDER_NR_SAS_EXPANDER 2 #define SLIDER_NR_SAS_CONNECTOR_PER_EXPANDER 3 #define SLIDER_NR_PSU 2 #define SLIDER_NR_TEMP_SENSOR_PER_PSU 3 #define SLIDER_NR_INPUT_POWER_PER_PSU 2 #define SLIDER_NR_TEMP_SENSOR_PER_ESC 2 #define SLIDER_NR_SSB 2 #define SLIDER_NR_SAS_CONNECTOR 6 #define SLIDER_NR_INPUT_POWER 4 #define SLIDER_NR_PSU_TEMP_SENSOR 6 #define SLIDER_NR_ESC_TEMP_SENSOR 4 #define SLIDER_NR_TEMP_SENSOR 11 #define SLIDER_NR_VOLT_SENSOR_PER_ESM 4 #define SLIDER_FAN_SPEED_FACTOR 10 /* * Common structures across enclosure are defined in encl_common.h * * ******************Status Registers:******************************** * - slider_disk_status : sec - 5.4.2, table - 48 * - slider_power_supply_status : sec - 6.3.4.2,table -5.19 * - slider_enc_serv_ctrl_status : sec - 5.4.7, table - 53 * - slider_sas_expander_status : sec - 5.4.11, table - 57 * - slider_sas_connector_status : sec - 5.4.12, table - 58 * - slider_midplane_status : sec - 5.4.13, table - 59 * - slider_phy_status : sec - 5.4.15, table - 61 * - slider_statesave_buffer_status : sec - 5.4.16, table - 62 * - slider_cpld_status : sec - 5.4.17, table - 63 * - sllider_input_power_status : sec - 5.4.18, table - 64 * * ******************Ctrl Registers:******************************** * - slider_disk_ctrl : sec - 5.3.2, table - 26 * - slider_power_supply_ctrl : sec - 5.3.4, table - 28 * - slider_temperature_sensor_ctrl: sec - 5.3.6, table - 30 * - slider_voltage_sensor_ctrl : sec - 5.3.10, table - 34 * - slider_sas_expander_ctrl : sec - 5.3.11, table - 35 * - slider_sas_connector_ctrl : sec - 5.3.12, table - 36 * - slider_midplane_ctrl : sec - 5.3.13, table - 37 * - slider_phy_ctrl : sec - 5.3.15, table - 39 * - slider_cpld_ctrl : sec - 5.3.17, table - 42 * - slider_input_power_ctrl : sec - 5.3.18, table - 43 */ /* Slider disk status */ struct slider_disk_status { struct element_status_byte0 byte0; #if defined (__BIG_ENDIAN_BITFIELD) uint8_t hot_swap:1; uint8_t slot_address:7; uint8_t app_client_bypassed_a:1; uint8_t do_not_remove:1; uint8_t enclosure_bypassed_a:1; uint8_t enclosure_bypassed_b:1; uint8_t ready_to_insert:1; uint8_t rmv:1; uint8_t ident:1; uint8_t report:1; uint8_t app_client_bypassed_b:1; uint8_t fault_sensed:1; uint8_t fail:1; /* AKA fault_reqstd */ uint8_t device_off:1; uint8_t bypassed_a:1; uint8_t bypassed_b:1; uint8_t device_bypassed_a:1; uint8_t device_bypassed_b:1; #elif defined (__LITTLE_ENDIAN_BITFIELD) uint8_t slot_address:7; uint8_t hot_swap:1; uint8_t report:1; uint8_t ident:1; uint8_t rmv:1; uint8_t ready_to_insert:1; uint8_t enclosure_bypassed_b:1; uint8_t enclosure_bypassed_a:1; uint8_t do_not_remove:1; uint8_t app_client_bypassed_a:1; uint8_t device_bypassed_b:1; uint8_t device_bypassed_a:1; uint8_t bypassed_b:1; uint8_t bypassed_a:1; uint8_t device_off:1; uint8_t fail:1; /* AKA fault_reqstd */ uint8_t fault_sensed:1; uint8_t app_client_bypassed_b:1; #endif }; /* Slider power supply status */ struct slider_power_supply_status { struct element_status_byte0 byte0; #if defined (__BIG_ENDIAN_BITFIELD) uint8_t ident:1; uint8_t reserved2:7; uint8_t reserved3:4; uint8_t dc_over_voltage:1; uint8_t dc_under_voltage:1; uint8_t dc_over_current:1; uint8_t cycled:1; uint8_t hot_swap:1; uint8_t fail:1; uint8_t rqsted_on:1; uint8_t off:1; uint8_t ovrtmp_fail:1; uint8_t temp_warn:1; uint8_t ac_fail:1; uint8_t dc_fail:1; #elif defined (__LITTLE_ENDIAN_BITFIELD) uint8_t reserved2:7; uint8_t ident:1; uint8_t cycled:1; uint8_t dc_over_current:1; uint8_t dc_under_voltage:1; uint8_t dc_over_voltage:1; uint8_t reserved3:4; uint8_t dc_fail:1; uint8_t ac_fail:1; uint8_t temp_warn:1; uint8_t ovrtmp_fail:1; uint8_t off:1; uint8_t rqsted_on:1; uint8_t fail:1; uint8_t hot_swap:1; #endif }; /* Slider fan set - fan per power supply */ struct slider_fan_set { struct fan_status fan_element[SLIDER_NR_FAN_PER_POWER_SUPPLY]; }; /* Temperature sensor set - per slider enclosure */ struct slider_temperature_sensor_set { struct temperature_sensor_status temp_enclosure; struct temperature_sensor_status temp_psu[SLIDER_NR_PSU_TEMP_SENSOR]; struct temperature_sensor_status temp_esc[SLIDER_NR_ESC_TEMP_SENSOR]; }; /* Enclosure service controller status */ struct slider_enc_service_ctrl_status { struct element_status_byte0 byte0; #if defined (__BIG_ENDIAN_BITFIELD) uint8_t ident:1; uint8_t fail:1; uint8_t comm_fail:1; uint8_t vpd_read_fail:1; uint8_t reset_reason:4; uint8_t vpd_mismatch:1; uint8_t vpd_mirror_mismatch:1; uint8_t reserved2:2; uint8_t firm_img_unmatch:1; uint8_t ierr_asserted:1; uint8_t xcc_data_initialised:1; uint8_t report:1; uint8_t hot_swap:1; uint8_t reserved3:7; #elif defined (__LITTLE_ENDIAN_BITFIELD) uint8_t reset_reason:4; uint8_t vpd_read_fail:1; uint8_t comm_fail:1; uint8_t fail:1; uint8_t ident:1; uint8_t report:1; uint8_t xcc_data_initialised:1; uint8_t ierr_asserted:1; uint8_t firm_img_unmatch:1; uint8_t reserved2:2; uint8_t vpd_mirror_mismatch:1; uint8_t vpd_mismatch:1; uint8_t reserved3:7; uint8_t hot_swap:1; #endif }; /* Slider voltage sensor set - per esc */ struct slider_voltage_sensor_set { struct voltage_sensor_status sensor_3V3; struct voltage_sensor_status sensor_1V0; struct voltage_sensor_status sensor_1V8; struct voltage_sensor_status sensor_0V92; }; /* Sas expander status */ struct slider_sas_expander_status { struct element_status_byte0 byte0; #if defined (__BIG_ENDIAN_BITFIELD) uint8_t ident:1; uint8_t fail:1; uint8_t reserved2:6; #elif defined (__LITTLE_ENDIAN_BITFIELD) uint8_t reserved2:6; uint8_t fail:1; uint8_t ident:1; #endif uint16_t reserved3; }; /* Slider sas connector status */ struct slider_sas_connector_status { struct element_status_byte0 byte0; #if defined (__BIG_ENDIAN_BITFIELD) uint8_t ident:1; uint8_t connector_type:7; #elif defined (__LITTLE_ENDIAN_BITFIELD) uint8_t connector_type:7; uint8_t ident:1; #endif uint8_t connector_physical_link; #if defined (__BIG_ENDIAN_BITFIELD) uint8_t client_bypassed:1; uint8_t fail:1; uint8_t enclosure_bypassed:1; uint8_t reserved2:5; #elif defined (__LITTLE_ENDIAN_BITFIELD) uint8_t reserved2:5; uint8_t enclosure_bypassed:1; uint8_t fail:1; uint8_t client_bypassed:1; #endif }; /* Midplane status */ struct slider_midplane_status { struct element_status_byte0 byte0; #if defined (__BIG_ENDIAN_BITFIELD) uint8_t vpd1_read_fail1:1; uint8_t vpd1_read_fail2:1; uint8_t vpd2_read_fail1:1; uint8_t vpd2_read_fail2:1; uint8_t vpd_mismatch1:1; uint8_t vpd_mismatch2:1; uint8_t vpd_mirror_mismatch:1; uint8_t reserved2:1; #elif defined (__LITTLE_ENDIAN_BITFIELD) uint8_t reserved2:1; uint8_t vpd_mirror_mismatch:1; uint8_t vpd_mismatch2:1; uint8_t vpd_mismatch1:1; uint8_t vpd2_read_fail2:1; uint8_t vpd2_read_fail1:1; uint8_t vpd1_read_fail2:1; uint8_t vpd1_read_fail1:1; #endif uint16_t reserved3; }; /* Phy status */ struct slider_phy_status { struct element_status_byte0 byte0; uint8_t phy_identifier; #if defined (__BIG_ENDIAN_BITFIELD) uint8_t enable:1; uint8_t connect:1; uint8_t reserved2:6; #elif defined (__LITTLE_ENDIAN_BITFIELD) uint8_t reserved2:6; uint8_t connect:1; uint8_t enable:1; #endif uint8_t phy_change_count; }; /* Phy set */ struct slider_phy_set { struct slider_phy_status phy_element[SLIDER_NR_PHY_PER_SAS_EXPANDER]; }; /* Statesave buffer */ struct slider_statesave_buffer_status { struct element_status_byte0 byte0; uint8_t buffer_status; uint8_t buffer_type; uint8_t reserved2; } __attribute__((packed)); /* CPLD status */ struct slider_cpld_status { struct element_status_byte0 byte0; #if defined (__BIG_ENDIAN_BITFIELD) uint8_t fail:1; uint8_t reserved2:7; #elif defined (__LITTLE_ENDIAN_BITFIELD) uint8_t reserved2:7; uint8_t fail:1; #endif uint16_t reserved3; } __attribute__((packed)); /* Input power status */ struct slider_input_power_status { struct element_status_byte0 byte0; uint16_t input_power; uint8_t reserved2; } __attribute__((packed)); /* * This data structure matches the layout described in Slider * specification, Table 45 and the element counts in sec 2.1.2. */ struct slider_lff_diag_page2 { uint8_t page_code; #if defined (__BIG_ENDIAN_BITFIELD) uint8_t reserved1:3; uint8_t invop:1; uint8_t info:1; uint8_t non_crit:1; uint8_t crit:1; uint8_t unrecov:1; #elif defined (__LITTLE_ENDIAN_BITFIELD) uint8_t unrecov:1; uint8_t crit:1; uint8_t non_crit:1; uint8_t info:1; uint8_t invop:1; uint8_t reserved1:3; #endif /* Page length : n-3 */ uint16_t page_length; uint32_t generation_code; /* Disk */ struct slider_disk_status overall_disk_status; struct slider_disk_status disk_status[SLIDER_NR_LFF_DISK]; /* Power supply */ struct slider_power_supply_status overall_power_status; struct slider_power_supply_status ps_status[SLIDER_NR_POWER_SUPPLY]; /* Cooling element */ struct fan_status overall_fan_status; struct slider_fan_set fan_sets[SLIDER_NR_POWER_SUPPLY]; /* Temperature sensor */ struct temperature_sensor_status overall_temp_sensor_status; struct slider_temperature_sensor_set temp_sensor_sets; /* Enclosure service controller */ struct slider_enc_service_ctrl_status overall_enc_service_ctrl_status; struct slider_enc_service_ctrl_status enc_service_ctrl_element[SLIDER_NR_ESC]; /* Enclosure */ struct enclosure_status overall_encl_status; struct enclosure_status encl_element; /* Voltage sensor */ struct voltage_sensor_status overall_voltage_status; struct slider_voltage_sensor_set voltage_sensor_sets[SLIDER_NR_ESC]; /* Sas expander */ struct slider_sas_expander_status overall_sas_expander_status; struct slider_sas_expander_status sas_expander_element[SLIDER_NR_ESC]; /* Sas connector */ struct slider_sas_connector_status overall_sas_connector_status; struct slider_sas_connector_status sas_connector_status[SLIDER_NR_SAS_CONNECTOR]; /* Disk midplane */ struct slider_midplane_status overall_midplane_status; struct slider_midplane_status midplane_element_status; /* Phy */ struct slider_phy_status overall_phy_status; struct slider_phy_set phy_sets[SLIDER_NR_SAS_EXPANDER]; /* Statesave Buffer */ struct slider_statesave_buffer_status overall_ssb_status; struct slider_statesave_buffer_status ssb_element[SLIDER_NR_SSB]; /* CPLD */ struct slider_cpld_status overall_cpld_status; struct slider_cpld_status cpld_element[SLIDER_NR_ESC]; /* Input power */ struct slider_input_power_status overall_input_power_status; struct slider_input_power_status input_power_element[SLIDER_NR_INPUT_POWER]; } __attribute__((packed)); /* * This data structure matches the layout described in Slider * specification, Table 45 and the element counts in sec 2.1.2. */ struct slider_sff_diag_page2 { uint8_t page_code; #if defined (__BIG_ENDIAN_BITFIELD) uint8_t reserved1:3; uint8_t invop:1; uint8_t info:1; uint8_t non_crit:1; uint8_t crit:1; uint8_t unrecov:1; #elif defined (__LITTLE_ENDIAN_BITFIELD) uint8_t unrecov:1; uint8_t crit:1; uint8_t non_crit:1; uint8_t info:1; uint8_t invop:1; uint8_t reserved1:3; #endif /* Page length : n-3 */ uint16_t page_length; uint32_t generation_code; /* Disk */ struct slider_disk_status overall_disk_status; struct slider_disk_status disk_status[SLIDER_NR_SFF_DISK]; /* Power supply */ struct slider_power_supply_status overall_power_status; struct slider_power_supply_status ps_status[SLIDER_NR_POWER_SUPPLY]; /* Cooling element */ struct fan_status overall_fan_status; struct slider_fan_set fan_sets[SLIDER_NR_POWER_SUPPLY]; /* Temperature sensor */ struct temperature_sensor_status overall_temp_sensor_status; struct slider_temperature_sensor_set temp_sensor_sets; /* Enclosure service controller */ struct slider_enc_service_ctrl_status overall_enc_service_ctrl_status; struct slider_enc_service_ctrl_status enc_service_ctrl_element[SLIDER_NR_ESC]; /* Enclosure */ struct enclosure_status overall_encl_status; struct enclosure_status encl_element; /* Voltage sensor */ struct voltage_sensor_status overall_voltage_status; struct slider_voltage_sensor_set voltage_sensor_sets[SLIDER_NR_ESC]; /* Sas expander */ struct slider_sas_expander_status overall_sas_expander_status; struct slider_sas_expander_status sas_expander_element[SLIDER_NR_ESC]; /* Sas connector */ struct slider_sas_connector_status overall_sas_connector_status; struct slider_sas_connector_status sas_connector_status[SLIDER_NR_SAS_CONNECTOR]; /* Disk midplane */ struct slider_midplane_status overall_midplane_status; struct slider_midplane_status midplane_element_status; /* Phy */ struct slider_phy_status overall_phy_status; struct slider_phy_set phy_sets[SLIDER_NR_SAS_EXPANDER]; /* Statesave Buffer */ struct slider_statesave_buffer_status overall_ssb_status; struct slider_statesave_buffer_status ssb_element[SLIDER_NR_SSB]; /* CPLD */ struct slider_cpld_status overall_cpld_status; struct slider_cpld_status cpld_element[SLIDER_NR_ESC]; /* Input power */ struct slider_input_power_status overall_input_power_status; struct slider_input_power_status input_power_element[SLIDER_NR_INPUT_POWER]; } __attribute__((packed)); /* Disk control register */ struct slider_disk_ctrl { struct common_ctrl common_ctrl; uint8_t reserved2; #if defined (__BIG_ENDIAN_BITFIELD) uint8_t rqst_active:1; uint8_t do_not_remove:1; uint8_t reserved3:1; uint8_t rqst_missing:1; uint8_t rqst_insert:1; uint8_t rqst_remove:1; uint8_t rqst_ident:1; uint8_t reserved4:1; uint8_t reserved5:2; uint8_t rqst_fail:1; uint8_t device_off:1; uint8_t enable_byp_a:1; uint8_t enable_byp_b:1; uint8_t reserved6:2; #elif defined (__LITTLE_ENDIAN_BITFIELD) uint8_t reserved4:1; uint8_t rqst_ident:1; uint8_t rqst_remove:1; uint8_t rqst_insert:1; uint8_t rqst_missing:1; uint8_t reserved3:1; uint8_t do_not_remove:1; uint8_t rqst_active:1; uint8_t reserved6:2; uint8_t enable_byp_b:1; uint8_t enable_byp_a:1; uint8_t device_off:1; uint8_t rqst_fail:1; uint8_t reserved5:2; #endif }; /* Power supply ctrl sec - 5.3.4, table - 28 */ struct slider_power_supply_ctrl { struct common_ctrl common_ctrl; #if defined (__BIG_ENDIAN_BITFIELD) uint8_t rqst_ident:1; uint8_t reserved2:7; uint8_t reserved3:7; uint8_t cycled:1; uint8_t reserved4:1; uint8_t rqst_fail:1; uint8_t rqst_on:1; uint8_t reserved5:5; #elif defined (__LITTLE_ENDIAN_BITFIELD) uint8_t reserved2:7; uint8_t rqst_ident:1; uint8_t cycled:1; uint8_t reserved3:7; uint8_t reserved5:5; uint8_t rqst_on:1; uint8_t rqst_fail:1; uint8_t reserved4:1; #endif }; /* Temp sensor cntrl sec - 5.3.6, table - 30 */ struct slider_temperature_sensor_ctrl { struct common_ctrl common_ctrl; #if defined (__BIG_ENDIAN_BITFIELD) uint8_t rqst_ident:1; uint8_t rqst_fail:1; uint8_t reserved2:6; #elif defined (__LITTLE_ENDIAN_BITFIELD) uint8_t reserved2:6; uint8_t rqst_fail:1; uint8_t rqst_ident:1; #endif uint16_t reserved3; }; /* Temperature sensor set - per slider enclosure */ struct slider_temperature_sensor_ctrl_set { struct slider_temperature_sensor_ctrl temp_enclosure; struct slider_temperature_sensor_ctrl temp_psu[SLIDER_NR_PSU_TEMP_SENSOR]; struct slider_temperature_sensor_ctrl temp_esc[SLIDER_NR_ESC_TEMP_SENSOR]; }; /* Voltage sensor ctrl register sec - 5.3.10, table - 34 */ struct slider_voltage_sensor_ctrl { struct common_ctrl common_ctrl; #if defined (__BIG_ENDIAN_BITFIELD) uint8_t rqst_ident:1; uint8_t rqst_fail:1; uint8_t reserved2:6; #elif defined (__LITTLE_ENDIAN_BITFIELD) uint8_t reserved2:6; uint8_t rqst_fail:1; uint8_t rqst_ident:1; #endif uint16_t reserved3; }; /* Voltage_sensor_set - per esc */ struct slider_voltage_sensor_ctrl_set { struct slider_voltage_sensor_ctrl sensor_3V3; struct slider_voltage_sensor_ctrl sensor_1V0; struct slider_voltage_sensor_ctrl sensor_1V8; struct slider_voltage_sensor_ctrl sensor_0V92; }; /* Sas expander enclosure ctrl register sec - 5.3.11, table - 35 */ struct slider_sas_expander_ctrl { struct common_ctrl common_ctrl; #if defined (__BIG_ENDIAN_BITFIELD) uint8_t rqst_ident:1; uint8_t rqst_fail:1; uint8_t reserved2:6; #elif defined (__LITTLE_ENDIAN_BITFIELD) uint8_t reserved2:6; uint8_t rqst_fail:1; uint8_t rqst_ident:1; #endif uint16_t reserved3; }; /* Sas expander enclosure ctrl register sec - 5.3.12, table - 36 */ struct slider_sas_connector_ctrl { struct common_ctrl common_ctrl; #if defined (__BIG_ENDIAN_BITFIELD) uint8_t rqst_ident:1; uint8_t rqst_bypass:1; uint8_t reserved2:6; #elif defined (__LITTLE_ENDIAN_BITFIELD) uint8_t reserved2:6; uint8_t rqst_bypass:1; uint8_t rqst_ident:1; #endif uint8_t reserved3; #if defined (__BIG_ENDIAN_BITFIELD) uint8_t reserved4:1; uint8_t rqst_fail:1; uint8_t reserved5:6; #elif defined (__LITTLE_ENDIAN_BITFIELD) uint8_t reserved5:6; uint8_t rqst_fail:1; uint8_t reserved4:1; #endif }; /* Midplane ctrl register sec - 5.3.13, table - 37 */ struct slider_midplane_ctrl { struct common_ctrl common_ctrl; uint8_t reserved2; uint16_t reserved3; } __attribute__((packed)); /* Phy ctrl register sec - 5.3.15, table - 39 */ struct slider_phy_ctrl { struct common_ctrl common_ctrl; uint8_t reserved2; uint8_t phy_operation; uint8_t reserved3; }; /* Phy set */ struct slider_phy_ctrl_set { struct slider_phy_ctrl phy_element[SLIDER_NR_PHY_PER_SAS_EXPANDER]; }; /* Statesave buffer ctrl register sec - 5.3.16, table - 40 */ struct slider_statesave_buffer_ctrl { struct common_ctrl common_ctrl; uint8_t mode; uint16_t reserved2; } __attribute__((packed)); /* CPLD ctrl register sec - 5.3.17, table - 42 */ struct slider_cpld_ctrl { struct common_ctrl common_ctrl; uint8_t reserved2; uint16_t reserved3; } __attribute__((packed)); /* Input power ctrl register sec - 5.3.18, table - 43 */ struct slider_input_power_ctrl { struct common_ctrl common_ctrl; uint8_t reserved2; uint16_t reserved3; } __attribute__((packed)); /* Fan ctrl register */ struct slider_fan_ctrl_set { struct fan_ctrl fan_element[SLIDER_NR_FAN_PER_POWER_SUPPLY]; }; /* Slider LFF control page layout */ struct slider_lff_ctrl_page2 { uint8_t page_code; #if defined (__BIG_ENDIAN_BITFIELD) uint8_t reserved1:4; uint8_t info:1; uint8_t non_crit:1; uint8_t crit:1; uint8_t unrecov:1; #elif defined (__LITTLE_ENDIAN_BITFIELD) uint8_t unrecov:1; uint8_t crit:1; uint8_t non_crit:1; uint8_t info:1; uint8_t reserved1:4; #endif /* Page length : n-3 */ uint16_t page_length; uint32_t generation_code; /* Disk */ struct slider_disk_ctrl overall_disk_ctrl; struct slider_disk_ctrl disk_ctrl[SLIDER_NR_LFF_DISK]; /* Power supply */ struct slider_power_supply_ctrl overall_power_ctrl; struct slider_power_supply_ctrl ps_ctrl[SLIDER_NR_POWER_SUPPLY]; /* Cooling element */ struct fan_ctrl overall_fan_ctrl; struct slider_fan_ctrl_set fan_sets[SLIDER_NR_POWER_SUPPLY]; /* Temperature sensor */ struct slider_temperature_sensor_ctrl overall_temp_sensor_ctrl; struct slider_temperature_sensor_ctrl_set temp_sensor_sets; /* Enclosure service controller */ struct esm_ctrl overall_enc_service_ctrl_ctrl; struct esm_ctrl enc_service_ctrl_element[SLIDER_NR_ESC]; /* Enclosure */ struct enclosure_ctrl overall_encl_ctrl; struct enclosure_ctrl encl_element; /* Voltage sensor */ struct slider_voltage_sensor_ctrl overall_voltage_ctrl; struct slider_voltage_sensor_ctrl_set voltage_sensor_sets[SLIDER_NR_ESC]; /* Sas expander */ struct slider_sas_expander_ctrl overall_sas_expander_ctrl; struct slider_sas_expander_ctrl sas_expander_element[SLIDER_NR_ESC]; /* Sas connector */ struct slider_sas_connector_ctrl overall_sas_connector_ctrl; struct slider_sas_connector_ctrl sas_connector_ctrl[SLIDER_NR_SAS_CONNECTOR]; /* Disk midplane */ struct slider_midplane_ctrl overall_midplane_ctrl; struct slider_midplane_ctrl midplane_element_ctrl; /* Phy */ struct slider_phy_ctrl overall_phy_ctrl; struct slider_phy_ctrl_set phy_sets[SLIDER_NR_SAS_EXPANDER]; /* Statesave buffer */ struct slider_statesave_buffer_ctrl overall_ssb_ctrl; struct slider_statesave_buffer_ctrl ssb_elemnet[SLIDER_NR_SSB]; /* CPLD */ struct slider_cpld_ctrl overall_cpld_ctrl; struct slider_cpld_ctrl cpld_ctrl_element[SLIDER_NR_ESC]; /* Input power */ struct slider_input_power_ctrl overall_input_power_ctrl; struct slider_input_power_ctrl input_power_ctrl_element[SLIDER_NR_INPUT_POWER]; } __attribute__((packed)); /* Slider SFF control page layout */ struct slider_sff_ctrl_page2 { uint8_t page_code; #if defined (__BIG_ENDIAN_BITFIELD) uint8_t reserved1:4; uint8_t info:1; uint8_t non_crit:1; uint8_t crit:1; uint8_t unrecov:1; #elif defined (__LITTLE_ENDIAN_BITFIELD) uint8_t unrecov:1; uint8_t crit:1; uint8_t non_crit:1; uint8_t info:1; uint8_t reserved1:4; #endif /* Page length : n-3 */ uint16_t page_length; uint32_t generation_code; /* Disk */ struct slider_disk_ctrl overall_disk_ctrl; struct slider_disk_ctrl disk_ctrl[SLIDER_NR_SFF_DISK]; /* Power supply */ struct slider_power_supply_ctrl overall_power_ctrl; struct slider_power_supply_ctrl ps_ctrl[SLIDER_NR_POWER_SUPPLY]; /* Cooling element */ struct fan_ctrl overall_fan_ctrl; struct slider_fan_ctrl_set fan_sets[SLIDER_NR_POWER_SUPPLY]; /* Temperature sensor */ struct slider_temperature_sensor_ctrl overall_temp_sensor_ctrl; struct slider_temperature_sensor_ctrl_set temp_sensor_sets; /* Enclosure service controller */ struct esm_ctrl overall_enc_service_ctrl_ctrl; struct esm_ctrl enc_service_ctrl_element[SLIDER_NR_ESC]; /* Enclosure */ struct enclosure_ctrl overall_encl_ctrl; struct enclosure_ctrl encl_element; /* Voltage sensor */ struct slider_voltage_sensor_ctrl overall_voltage_ctrl; struct slider_voltage_sensor_ctrl_set voltage_sensor_sets[SLIDER_NR_ESC]; /* Sas expander */ struct slider_sas_expander_ctrl overall_sas_expander_ctrl; struct slider_sas_expander_ctrl sas_expander_element[SLIDER_NR_ESC]; /* Sas connector */ struct slider_sas_connector_ctrl overall_sas_connector_ctrl; struct slider_sas_connector_ctrl sas_connector_ctrl[SLIDER_NR_SAS_CONNECTOR]; /* Disk midplane */ struct slider_midplane_ctrl overall_midplane_ctrl; struct slider_midplane_ctrl midplane_element_ctrl; /* Phy */ struct slider_phy_ctrl overall_phy_ctrl; struct slider_phy_ctrl_set phy_sets[SLIDER_NR_SAS_EXPANDER]; /* Statesave buffer */ struct slider_statesave_buffer_ctrl overall_ssb_ctrl; struct slider_statesave_buffer_ctrl ssb_elemnet[SLIDER_NR_SSB]; /* CPLD */ struct slider_cpld_ctrl overall_cpld_ctrl; struct slider_cpld_ctrl cpld_ctrl_element[SLIDER_NR_ESC]; /* Input power */ struct slider_input_power_ctrl overall_input_power_ctrl; struct slider_input_power_ctrl input_power_ctrl_element[SLIDER_NR_INPUT_POWER]; } __attribute__((packed)); /* Element descriptor page */ #define SLIDER_NR_LFF_ELEMENT_DES_PAGE_SIZE 952 #define SLIDER_NR_SFF_ELEMENT_DES_PAGE_SIZE 1192 #define SLIDER_NR_PS_ELEMENT_DES_PAGE_SIZE 122 /* Power supply start offset in element descriptor page */ #define SLIDER_NR_LFF_PS_ELEMENT_DES_PAGE_START_OFFSET 258 #define SLIDER_NR_SFF_PS_ELEMENT_DES_PAGE_START_OFFSET 498 /* * Slider LFF element descriptor page layout * Used only for power supply, so ignored other elements */ struct slider_lff_element_descriptor_page { char ignored1[SLIDER_NR_LFF_PS_ELEMENT_DES_PAGE_START_OFFSET]; struct power_supply_descriptor ps0_vpd; uint16_t reserved; struct power_supply_descriptor ps1_vpd; char ignored2[SLIDER_NR_LFF_ELEMENT_DES_PAGE_SIZE - SLIDER_NR_LFF_PS_ELEMENT_DES_PAGE_START_OFFSET - SLIDER_NR_PS_ELEMENT_DES_PAGE_SIZE]; /* 572 */ } __attribute__((packed)); /* * Slider SFF element descriptor page layout * Used only for power supply, so ignored other elements */ struct slider_sff_element_descriptor_page { char ignored1[SLIDER_NR_SFF_PS_ELEMENT_DES_PAGE_START_OFFSET]; struct power_supply_descriptor ps0_vpd; uint16_t reserved; struct power_supply_descriptor ps1_vpd; char ignored2[SLIDER_NR_SFF_ELEMENT_DES_PAGE_SIZE - SLIDER_NR_SFF_PS_ELEMENT_DES_PAGE_START_OFFSET - SLIDER_NR_PS_ELEMENT_DES_PAGE_SIZE]; /* 812 */ } __attribute__((packed)); #endif /* __SLIDER_H__ */ ppc64-diag-2.7.4/diags/encl_common.h0000644000000000000000000003205713135275400014011 00000000000000/* * Copyright (C) 2015, 2016 IBM Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _ENCL_COMMON_H #define _ENCL_COMMON_H /* * This file contains macros, structures and function definations * which are common across enclosures. Enclosure specific details * can be found in enclosure specific header file. * * Presently it supports 5887 and EDR1 enclosures. */ #include #include #include #include "encl_util.h" #define ES_STATUS_STRING_MAXLEN 32 #define EVENT_DESC_SIZE 512 #define FRU_NUMBER_LEN 8 #define SERIAL_NUMBER_LEN 12 /* SRN Format : * FFC-xxx * for SAS FFC = 2667 * * Note: * These SRN's are valid for Bluehawk and Homerun enclosures. */ /* Failing Function Code : SAS SCSI Enclosure Services */ #define SRN_FFC_SAS 0x2667 /* Return code for SAS SES components */ #define SRN_RC_CRIT_PS 0x125 #define SRN_RC_CRIT_FAN 0x135 #define SRN_RC_CRIT_ESM 0x155 #define SRN_RC_CRIT_EN 0x175 #define SRN_RC_DEVICE_CONFIG_ERROR 0x201 #define SRN_RC_ENCLOSURE_OPEN_FAILURE 0x202 #define SRN_RC_ENQUIRY_DATA_FAIL 0x203 #define SRN_RC_MEDIA_BAY 0x210 #define SRN_RC_VOLTAGE_THRESHOLD 0x239 #define SRN_RC_PS_TEMP_THRESHOLD 0x145 #define SRN_RC_TEMP_THRESHOLD 0x246 /* Build SRN */ #define SRN_SIZE 16 #define build_srn(srn, element) \ snprintf(srn, SRN_SIZE, "%03X-%03X", SRN_FFC_SAS, element) /* * If the indicated status element reports a fault, turn on the fault component * of the LED if it's not already on. Keep the identify LED element unchanged. */ #define FAULT_LED(poked_leds, dp, ctrl_page, ctrl_element, status_element) \ do { \ enum element_status_code sc = dp->status_element.byte0.status; \ if (!dp->status_element.fail && \ (sc == ES_CRITICAL || sc == ES_NONCRITICAL || \ sc == ES_UNRECOVERABLE)) { \ ctrl_page->ctrl_element.common_ctrl.select = 1; \ ctrl_page->ctrl_element.rqst_fail = 1; \ ctrl_page->ctrl_element.rqst_ident = dp->status_element.ident; \ poked_leds++; \ } \ } while (0) #define CHK_IDENT_LED(s) if ((s)->ident) printf(" | IDENT_LED") #define CHK_FAULT_LED(s) if ((s)->fail) printf(" | FAULT_LED") enum element_status_code { ES_UNSUPPORTED, /* invalid status */ ES_OK, ES_CRITICAL, /* usually valid */ ES_NONCRITICAL, /* usually valid */ ES_UNRECOVERABLE, /* invalid status */ ES_NOT_INSTALLED, ES_UNKNOWN, /* usually invalid */ ES_NOT_AVAILABLE, /* usually invalid */ ES_NO_ACCESS_ALLOWED, /* invalid status */ ES_EOL /* end of list of status codes */ }; struct element_status_byte0 { #if defined (__BIG_ENDIAN_BITFIELD) uint8_t reserved1:1; /* = 0 */ uint8_t prdfail:1; /* not implemented */ uint8_t disabled:1; /* not implemented */ uint8_t swap:1; uint8_t status:4; /* 0/1 or element_status_code */ #elif defined (__LITTLE_ENDIAN_BITFIELD) uint8_t status:4; /* 0/1 or element_status_code */ uint8_t swap:1; uint8_t disabled:1; /* not implemented */ uint8_t prdfail:1; /* not implemented */ uint8_t reserved1:1; /* = 0 */ #endif }; struct overall_disk_status_byte1 { #if defined (__BIG_ENDIAN_BITFIELD) uint8_t device_environment:3; /* = 010b */ uint8_t slot_address:5; #elif defined (__LITTLE_ENDIAN_BITFIELD) uint8_t slot_address:5; uint8_t device_environment:3; /* = 010b */ #endif }; struct disk_element_status_byte1 { #if defined (__BIG_ENDIAN_BITFIELD) uint8_t hot_swap:1; /* = 1 */ uint8_t slot_address:7; #elif defined (__LITTLE_ENDIAN_BITFIELD) uint8_t slot_address:7; uint8_t hot_swap:1; /* = 1 */ #endif }; struct disk_status { struct element_status_byte0 byte0; /* Overall status = worst status of all disks. */ union { struct overall_disk_status_byte1 overall_status; struct disk_element_status_byte1 element_status; } byte1; #if defined (__BIG_ENDIAN_BITFIELD) uint8_t app_client_bypassed_a:1; uint8_t do_not_remove:1; uint8_t enclosure_bypassed_a:1; uint8_t enclosure_bypassed_b:1; uint8_t ready_to_insert:1; uint8_t rmv:1; uint8_t ident:1; uint8_t report:1; uint8_t app_client_bypassed_b:1; uint8_t fault_sensed:1; uint8_t fail:1; /* AKA fault_reqstd */ uint8_t device_off:1; uint8_t bypassed_a:1; uint8_t bypassed_b:1; uint8_t device_bypassed_a:1; uint8_t device_bypassed_b:1; #elif defined (__LITTLE_ENDIAN_BITFIELD) uint8_t report:1; uint8_t ident:1; uint8_t rmv:1; uint8_t ready_to_insert:1; uint8_t enclosure_bypassed_b:1; uint8_t enclosure_bypassed_a:1; uint8_t do_not_remove:1; uint8_t app_client_bypassed_a:1; uint8_t device_bypassed_b:1; uint8_t device_bypassed_a:1; uint8_t bypassed_b:1; uint8_t bypassed_a:1; uint8_t device_off:1; uint8_t fail:1; /* AKA fault_reqstd */ uint8_t fault_sensed:1; uint8_t app_client_bypassed_b:1; #endif }; struct enclosure_status { struct element_status_byte0 byte0; /* status is always 1. */ #if defined (__BIG_ENDIAN_BITFIELD) uint8_t ident:1; uint8_t reserved2:7; uint8_t reserved3:6; uint8_t fail:1; /* AKA failure_indication */ uint8_t warning_indication:1; uint8_t reserved4:6; uint8_t failure_requested:1; uint8_t warning_requested:1; #elif defined (__LITTLE_ENDIAN_BITFIELD) uint8_t reserved2:7; uint8_t ident:1; uint8_t warning_indication:1; uint8_t fail:1; /* AKA failure_indication */ uint8_t reserved3:6; uint8_t warning_requested:1; uint8_t failure_requested:1; uint8_t reserved4:6; #endif }; struct esm_status { struct element_status_byte0 byte0; #if defined (__BIG_ENDIAN_BITFIELD) uint8_t ident:1; uint8_t fail:1; uint8_t reserved2:6; uint8_t reserved3:7; uint8_t report:1; uint8_t hot_swap:1; uint8_t reserved4:7; #elif defined (__LITTLE_ENDIAN_BITFIELD) uint8_t reserved2:6; uint8_t fail:1; uint8_t ident:1; uint8_t report:1; uint8_t reserved3:7; uint8_t reserved4:7; uint8_t hot_swap:1; #endif }; struct temperature_sensor_status { struct element_status_byte0 byte0; #if defined (__BIG_ENDIAN_BITFIELD) uint8_t ident:1; uint8_t reserved2:7; uint8_t temperature; uint8_t reserved3:4; uint8_t ot_failure:1; uint8_t ot_warning:1; uint8_t ut_failure:1; uint8_t ut_warning:1; #elif defined (__LITTLE_ENDIAN_BITFIELD) uint8_t reserved2:7; uint8_t ident:1; uint8_t temperature; uint8_t ut_warning:1; uint8_t ut_failure:1; uint8_t ot_warning:1; uint8_t ot_failure:1; uint8_t reserved3:4; #endif }; struct fan_status { struct element_status_byte0 byte0; #if defined (__BIG_ENDIAN_BITFIELD) uint8_t ident:1; uint8_t reserved2:4; uint8_t fan_speed_msb:3; uint8_t fan_speed_lsb; uint8_t hot_swap:1; uint8_t fail:1; uint8_t rqsted_on:1; uint8_t off:1; uint8_t reserved3:1; uint8_t speed_code:3; #elif defined (__LITTLE_ENDIAN_BITFIELD) uint8_t fan_speed_msb:3; uint8_t reserved2:4; uint8_t ident:1; uint8_t fan_speed_lsb; uint8_t speed_code:3; uint8_t reserved3:1; uint8_t off:1; uint8_t rqsted_on:1; uint8_t fail:1; uint8_t hot_swap:1; #endif } __attribute__((packed)); struct power_supply_status { struct element_status_byte0 byte0; #if defined (__BIG_ENDIAN_BITFIELD) uint8_t ident:1; uint8_t reserved2:7; uint8_t reserved3:4; uint8_t dc_over_voltage:1; uint8_t dc_under_voltage:1; uint8_t dc_over_current:1; uint8_t reserved4:1; uint8_t hot_swap:1; uint8_t fail:1; uint8_t rqsted_on:1; uint8_t off:1; uint8_t ovrtmp_fail:1; uint8_t temp_warn:1; uint8_t ac_fail:1; uint8_t dc_fail:1; #elif defined (__LITTLE_ENDIAN_BITFIELD) uint8_t reserved2:7; uint8_t ident:1; uint8_t reserved4:1; uint8_t dc_over_current:1; uint8_t dc_under_voltage:1; uint8_t dc_over_voltage:1; uint8_t reserved3:4; uint8_t dc_fail:1; uint8_t ac_fail:1; uint8_t temp_warn:1; uint8_t ovrtmp_fail:1; uint8_t off:1; uint8_t rqsted_on:1; uint8_t fail:1; uint8_t hot_swap:1; #endif }; struct voltage_sensor_status { struct element_status_byte0 byte0; #if defined (__BIG_ENDIAN_BITFIELD) uint8_t ident:1; uint8_t reserved2:3; uint8_t warn_over:1; uint8_t warn_under:1; uint8_t crit_over:1; uint8_t crit_under:1; #elif defined (__LITTLE_ENDIAN_BITFIELD) uint8_t crit_under:1; uint8_t crit_over:1; uint8_t warn_under:1; uint8_t warn_over:1; uint8_t reserved2:3; uint8_t ident:1; #endif uint16_t voltage; }; /* Diagnostic page 2 layout for SEND DIAGNOSTIC command */ struct common_ctrl { #if defined (__BIG_ENDIAN_BITFIELD) uint8_t select:1; uint8_t prdfail:1; uint8_t disable:1; uint8_t rst_swap:1; uint8_t reserved1:4; #elif defined (__LITTLE_ENDIAN_BITFIELD) uint8_t reserved1:4; uint8_t rst_swap:1; uint8_t disable:1; uint8_t prdfail:1; uint8_t select:1; #endif }; struct enclosure_ctrl { struct common_ctrl common_ctrl; #if defined (__BIG_ENDIAN_BITFIELD) uint8_t rqst_ident:1; uint8_t reserved2:7; uint8_t reserved3; uint8_t reserved4:6; uint8_t rqst_fail:1; uint8_t rqst_warn:1; #elif defined (__LITTLE_ENDIAN_BITFIELD) uint8_t reserved2:7; uint8_t rqst_ident:1; uint8_t reserved3; uint8_t rqst_warn:1; uint8_t rqst_fail:1; uint8_t reserved4:6; #endif }; struct esm_ctrl { struct common_ctrl common_ctrl; #if defined (__BIG_ENDIAN_BITFIELD) uint8_t rqst_ident:1; uint8_t rqst_fail:1; uint8_t reserved2:6; uint8_t reserved3:7; uint8_t select_element:1; #elif defined (__LITTLE_ENDIAN_BITFIELD) uint8_t reserved2:6; uint8_t rqst_fail:1; uint8_t rqst_ident:1; uint8_t select_element:1; uint8_t reserved3:7; #endif uint8_t reserved4; }; struct fan_ctrl { struct common_ctrl common_ctrl; #if defined (__BIG_ENDIAN_BITFIELD) uint8_t rqst_ident:1; uint8_t reserved2:7; uint8_t reserved3; uint8_t reserved4:1; uint8_t rqst_fail:1; uint8_t rqst_on:1; uint8_t reserved5:2; uint8_t requested_speed_code:3; #elif defined (__LITTLE_ENDIAN_BITFIELD) uint8_t reserved2:7; uint8_t rqst_ident:1; uint8_t reserved3; uint8_t requested_speed_code:3; uint8_t reserved5:2; uint8_t rqst_on:1; uint8_t rqst_fail:1; uint8_t reserved4:1; #endif }; struct power_supply_ctrl { struct common_ctrl common_ctrl; #if defined (__BIG_ENDIAN_BITFIELD) uint8_t rqst_ident:1; uint8_t reserved2:7; uint8_t reserved3; uint8_t reserved4:1; uint8_t rqst_fail:1; uint8_t reserved5:6; #elif defined (__LITTLE_ENDIAN_BITFIELD) uint8_t reserved2:7; uint8_t rqst_ident:1; uint8_t reserved3; uint8_t reserved5:6; uint8_t rqst_fail:1; uint8_t reserved4:1; #endif }; /* Obtains VPD for esm (page 1), midplane (page 5) via INQUIRY command */ struct vpd_page { uint8_t peripheral_qualifier; uint8_t page_code; uint8_t reserved1; uint8_t page_length; uint8_t ascii_length; char fn[3]; /* "FN " */ char fru_number[8]; uint8_t reserved2; char sn[3]; /* "SN " */ char serial_number[12]; uint8_t reserved3; char cc[3]; /* "CC " */ char model_number[4]; /* CCIN */ uint8_t reserved4; char fl[3]; /* "FL " */ char fru_label[5]; uint8_t reserved5; }; struct power_supply_descriptor { uint16_t descriptor_length; char fn[3]; /* "FN " */ char fru_number[8]; char sn[3]; /* "SN " */ char serial_number[12]; char vendor[12]; char date_of_manufacture[12]; char fl[3]; /* "FL " */ char fru_label[5]; } __attribute__((packed)); extern int status_is_valid(enum element_status_code, enum element_status_code []); extern const char *status_string(enum element_status_code , enum element_status_code []); extern void print_enclosure_status(struct enclosure_status *, enum element_status_code []); extern void print_drive_status(struct disk_status *, enum element_status_code []); extern void print_esm_status(struct esm_status *); extern void print_temp_sensor_status(struct temperature_sensor_status *); extern void print_fan_status(struct fan_status *, enum element_status_code [], const char **); extern void print_power_supply_status(struct power_supply_status *); extern void print_voltage_sensor_status(struct voltage_sensor_status *); extern enum element_status_code composite_status(const void *, int); extern uint8_t svclog_element_status(struct element_status_byte0 *, const char * const , const char * const , char *); extern uint8_t svclog_composite_status(const void *, const char * const , const char * const , int , char *); extern void add_callout(struct sl_callout **, char, uint32_t, char *, char *, char *, char *, char *); extern void add_location_callout(struct sl_callout **, char *); extern void add_callout_from_vpd_page(struct sl_callout **, char *, struct vpd_page *); extern uint32_t servevent(const char *, int, const char *, struct dev_vpd *, struct sl_callout *); void create_esm_callout(struct sl_callout **, char *, unsigned int, int); void create_midplane_callout(struct sl_callout **, char *, int); #endif /* _ENCL_COMMON_H */ ppc64-diag-2.7.4/diags/encl_led.c0000644000000000000000000001616113135275400013256 00000000000000/* * Copyright (C) 2012, 2015 IBM Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include #include #include #include #include #include "encl_util.h" #include "encl_led.h" #include "utils.h" static struct { char *mtm; int (*list_leds)(const char *, const char *, int); int (*set_led)(const char *, const char *, int, int, int); } encl_list[] = { {"5888", bluehawk_list_leds, bluehawk_set_led}, /* Bluehawk enclosure */ {"EDR1", bluehawk_list_leds, bluehawk_set_led}, /* Bluehawk enclosure */ {"5887", homerun_list_leds, homerun_set_led}, /* Homerun enclosure */ {"ESLL", slider_lff_list_leds, slider_lff_set_led}, /* slider LFF */ {"ESLS", slider_sff_list_leds, slider_sff_set_led}, /* slider SFF */ {NULL, NULL} }; const char *progname; static struct option long_options[] = { { "fault", required_argument, NULL, 'f' }, { "help", no_argument, NULL, 'h' }, { "ident", required_argument, NULL, 'i' }, { "list", no_argument, NULL, 'l' }, { "verbose", no_argument, NULL, 'v' }, { "version", no_argument, NULL, 'V' }, { 0, 0, 0, 0} }; static void usage(void) { fprintf(stderr, "Usage: %s { -l | settings } [-v] enclosure [ component ]\n" "\t-l | --list : report settings\n" "\t-v | --verbose : verbose report\n" "\t-V | --version : print the version of the command " "and exit\n" "\t-h | --help : print this usage message and exit\n" "\tsettings: [ -f on|off ] [ -i on|off ]\n" "\t -f | --fault: turn component's fault LED element on/off.\n" "\t -i | --ident: turn component's ident LED element on/off.\n" "\tenclosure: sgN device name or location code of enclosure\n" "\tcomponent: component's location sub-code -- e.g., P1-E2\n", progname); } /** * Get SCSI generic device name for the given location code. * * Returns : * 0 on success / -1 on failure */ static int loc_code_device(const char *loccode, char *sg, int sg_size) { int rc, found = 0, status = 0; FILE *fp; pid_t cpid; char buf[128]; char *dev; char *args[] = {LSVPD_PATH, "-l", NULL, NULL}; /* Command exists and has exec permissions ? */ if (access(LSVPD_PATH, F_OK|X_OK) == -1) { fprintf(stderr, "Failed to obtain the sg device details.\n" "Check that %s is installed and has " "execute permissions.", LSVPD_PATH); return -1; } args[2] = (char *const) loccode; fp = spopen(args, &cpid); if (fp == NULL) { fprintf(stderr, "Could not obtain the sg device details.\n" "Failed to execute \"%s -l %s\" command.\n", LSVPD_PATH, loccode); return -1; } while (fgets_nonl(buf, 128, fp) != NULL) { if (found) /* read until pipe becomes empty*/ continue; /* Handle both old and new formats. */ if (strstr(buf, "/dev/sg") || strstr(buf, "*AX sg")) { dev = strstr(buf, "sg"); /* validate sg device */ rc = valid_enclosure_device(dev); if (rc) continue; strncpy(sg, dev, sg_size); found = 1; } } status = spclose(fp, cpid); /* spclose() failed */ if (status == -1) { fprintf(stderr, "%s : %d - failed in spclose(), " "error : %s\n", __func__, __LINE__, strerror(errno)); return -1; } /* spclose() succeeded, but command failed */ if (status != 0) { fprintf(stdout, "%s : %d - spclose() exited with status : " "%d\n", __func__, __LINE__, status); return -1; } if (found) return 0; fprintf(stderr, "%s is not a valid enclosure device\n", loccode); return -1; } /** * Get SCSI generic device name * * @encl sg device name or location code * @sg sg dev name * @sg_size sizeof(sg) * * Returns : * 0 on success / -1 on failure */ static int enclosure_dev_name(const char *encl, char *sg, int sg_size) { if (!strncmp(encl, "sg", 2) && strlen(encl) < PATH_MAX - 6) { strncpy(sg, encl, sg_size); return valid_enclosure_device(sg); } return loc_code_device(encl, sg, sg_size); } static void too_many_settings(void) { fprintf(stderr, "%s: cannot set fault or ident multiple times.\n", progname); exit(1); } static int parse_on_off(const char *on_off) { if (!strcmp(on_off, "on")) return LED_ON; else if (!strcmp(on_off, "off")) return LED_OFF; fprintf(stderr, "%s: expected 'on' or 'off'; saw '%s'.\n", progname, on_off); exit(1); } int main(int argc, char **argv) { int rc, option_index, i; int list_opt = 0, verbose = 0, found = 0; int fault_setting = LED_SAME, ident_setting = LED_SAME; const char *enclosure = NULL, *component = NULL; char sg[128]; struct dev_vpd vpd; progname = argv[0]; for (;;) { option_index = 0; rc = getopt_long(argc, argv, "f:hi:lvV", long_options, &option_index); if (rc == -1) break; switch (rc) { case 'f': if (fault_setting != LED_SAME) too_many_settings(); fault_setting = parse_on_off(optarg); break; case 'h': usage(); exit(0); case 'i': if (ident_setting != LED_SAME) too_many_settings(); ident_setting = parse_on_off(optarg); break; case 'l': list_opt = 1; break; case 'v': verbose = 1; break; case 'V': printf("%s %s\n", argv[0], VERSION); exit(0); case '?': default: usage(); exit(1); } } if (optind < argc) enclosure = argv[optind++]; else { usage(); exit(1); } if (optind < argc) component = argv[optind++]; if (optind < argc) { usage(); exit(1); } if (!list_opt && fault_setting == LED_SAME && ident_setting == LED_SAME) { usage(); exit(1); } /* Get sg dev name for the given sg/location code */ memset(sg, 0, sizeof(sg)); if (enclosure_dev_name(enclosure, sg, sizeof(sg)) != 0) exit(1); /* Make sure sg is in running state */ if (enclosure_maint_mode(sg) != 0) exit(1); /* Get enclosure type as "Machine Type" from VPD. */ memset(&vpd, 0, sizeof(vpd)); if (read_vpd_from_lscfg(&vpd, sg) != 0) exit(1); for (i = 0; encl_list[i].mtm; i++) if (!strcmp(vpd.mtm, encl_list[i].mtm)) { found = 1; break; } if (!found) { fprintf(stderr, "No indicator support for device type/model :" " %s\n", vpd.mtm); exit(0); } if (list_opt) { if (fault_setting != LED_SAME || ident_setting != LED_SAME) { usage(); exit(1); } if (encl_list[i].list_leds(sg, component, verbose) != 0) exit(2); } else { if (geteuid() != 0) { fprintf(stderr, "%s: Turning LEDs on/off requires " "superuser privileges.\n", progname); exit(1); } if (encl_list[i].set_led(sg, component, fault_setting, ident_setting, verbose) != 0) exit(2); } exit(0); } ppc64-diag-2.7.4/diags/bluehawk_led.c0000644000000000000000000002141113135275400014131 00000000000000/* * Copyright (C) 2012, 2015, 2016 IBM Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "encl_util.h" #include "encl_led.h" #include "bluehawk.h" enum bh_component_type { BHC_ENCLOSURE, BHC_MIDPLANE, BHC_DISK, BHC_POWER_SUPPLY, BHC_ERM, BHC_PCI_CONTROLLER, BHC_SAS_CONNECTOR, BHC_FAN_ASSEMBLY }; static int bh_decode_component_loc(const char *loc, enum bh_component_type *type, unsigned int *index) { unsigned int n, n2; char g; /* catch trailing garbage */ if (!loc || !strcmp(loc, "-")) { *type = BHC_ENCLOSURE; *index = 0; } else if (!strcmp(loc, "P1")) { *type = BHC_MIDPLANE; *index = 0; } else if (sscanf(loc, "P1-D%u%c", &n, &g) == 1) { element_check_range(n, 1, 30, loc); *type = BHC_DISK; *index = n - 1; } else if (sscanf(loc, "P1-C%u%c", &n, &g) == 1) { element_check_range(n, 1, 2, loc); *type = BHC_ERM; *index = n-1; } else if (sscanf(loc, "P1-E%u%c", &n, &g) == 1) { element_check_range(n, 1, 2, loc); *type = BHC_POWER_SUPPLY; *index = n-1; } else if (sscanf(loc, "P1-C%u-T%u%c", &n, &n2, &g) == 2) { element_check_range(n, 1, 2, loc); if (n2 == 3) { *type = BHC_PCI_CONTROLLER; *index = n-1; } else { element_check_range(n2, 1, 2, loc); *type = BHC_SAS_CONNECTOR; *index = (n-1)*2 + (n2-1); } } else if (sscanf(loc, "P1-C%u-A%u%c", &n, &n2, &g) == 2) { element_check_range(n, 1, 2, loc); element_check_range(n2, 1, 1, loc); *type = BHC_FAN_ASSEMBLY; *index = n-1; } else { fprintf(stderr, "%s: unrecognized location code: %s\n", progname, loc); return -1; } return 0; } static const char *on_off_string[] = { "off", "on" }; static void bh_report_component(struct bluehawk_diag_page2 *dp, int fault, int ident, enum bh_component_type type, unsigned int i, int verbose) { char loc_code[COMP_LOC_CODE]; char desc[COMP_DESC_SIZE]; static const char *left_right[] = { "left", "right" }; switch (type) { case BHC_ENCLOSURE: REPORT_COMPONENT(dp, enclosure_element_status, fault, ident, "-", "enclosure", verbose); break; case BHC_MIDPLANE: REPORT_COMPONENT(dp, midplane_element_status, fault, ident, "P1", "midplane", verbose); break; case BHC_DISK: snprintf(loc_code, COMP_LOC_CODE, "P1-D%u", i+1); snprintf(desc, COMP_DESC_SIZE, "disk %u", i+1); REPORT_COMPONENT(dp, disk_status[i], fault, ident, loc_code, desc, verbose); break; case BHC_POWER_SUPPLY: snprintf(loc_code, COMP_LOC_CODE, "P1-E%u", i+1); snprintf(desc, COMP_DESC_SIZE, "%s power supply", left_right[i]); REPORT_COMPONENT(dp, ps_status[i], fault, ident, loc_code, desc, verbose); break; case BHC_ERM: snprintf(loc_code, COMP_LOC_CODE, "P1-C%u", i+1); snprintf(desc, COMP_DESC_SIZE, "%s Enclosure RAID Module", left_right[i]); REPORT_COMPONENT(dp, esm_status[i], fault, ident, loc_code, desc, verbose); break; case BHC_PCI_CONTROLLER: snprintf(loc_code, COMP_LOC_CODE, "P1-C%u-T3", i+1); snprintf(desc, COMP_DESC_SIZE, "%s PCIe controller", left_right[i]); REPORT_COMPONENT(dp, scc_controller_status[i], fault, ident, loc_code, desc, verbose); break; case BHC_SAS_CONNECTOR: snprintf(loc_code, COMP_LOC_CODE, "P1-C%u-T%u", (i/2)+1, (i%2)+1); snprintf(desc, COMP_DESC_SIZE, "%s SAS connector T%d", left_right[i/2], (i%2)+1); REPORT_COMPONENT(dp, sas_connector_status[i], fault, ident, loc_code, desc, verbose); break; case BHC_FAN_ASSEMBLY: snprintf(loc_code, COMP_LOC_CODE, "P1-C%u-A1", i+1); snprintf(desc, COMP_DESC_SIZE, "%s fan assembly", left_right[i]); REPORT_COMPONENT(dp, fan_sets[i].fan_element[0], fault, ident, loc_code, desc, verbose); break; default: fprintf(stderr, "%s internal error: unexpected component type %u\n", progname, type); exit(3); } } static void bh_report_component_from_ses(struct bluehawk_diag_page2 *dp, enum bh_component_type type, unsigned int i, int verbose) { bh_report_component(dp, LED_SAME, LED_SAME, type, i, verbose); } int bluehawk_list_leds(const char *enclosure, const char *component, int verbose) { int fd, rc; struct bluehawk_diag_page2 dp; fd = open_sg_device(enclosure); if (fd < 0) return -1; rc = get_diagnostic_page(fd, RECEIVE_DIAGNOSTIC, 2, &dp, sizeof(dp)); if (rc != 0) { fprintf(stderr, "%s: cannot read diagnostic page from SES for %s\n", progname, enclosure); close(fd); return -1; } printf("fault ident location description\n"); if (component) { unsigned int cindex; enum bh_component_type ctype; rc = bh_decode_component_loc(component, &ctype, &cindex); if (rc != 0) { close(fd); return -1; } bh_report_component_from_ses(&dp, ctype, cindex, verbose); } else { unsigned int i; bh_report_component_from_ses(&dp, BHC_ENCLOSURE, 0, verbose); bh_report_component_from_ses(&dp, BHC_MIDPLANE, 0, verbose); for (i = 0; i < NR_DISKS_PER_BLUEHAWK; i++) bh_report_component_from_ses(&dp, BHC_DISK, i, verbose); for (i = 0; i < 2; i++) bh_report_component_from_ses(&dp, BHC_POWER_SUPPLY, i, verbose); for (i = 0; i < 2; i++) bh_report_component_from_ses(&dp, BHC_ERM, i, verbose); for (i = 0; i < 2; i++) bh_report_component_from_ses(&dp, BHC_PCI_CONTROLLER, i, verbose); for (i = 0; i < 4; i++) bh_report_component_from_ses(&dp, BHC_SAS_CONNECTOR, i, verbose); for (i = 0; i < 2; i++) bh_report_component_from_ses(&dp, BHC_FAN_ASSEMBLY, i, verbose); } close(fd); return 0; } int bluehawk_set_led(const char *enclosure, const char *component, int fault, int ident, int verbose) { int fd, rc; unsigned int index; enum bh_component_type type; struct bluehawk_diag_page2 dp; struct bluehawk_ctrl_page2 cp; fd = open_sg_device(enclosure); if (fd < 0) return -1; rc = bh_decode_component_loc(component, &type, &index); if (rc != 0) { close(fd); return -1; } if (fault == LED_SAME || ident == LED_SAME) { memset(&dp, 0, sizeof(dp)); rc = get_diagnostic_page(fd, RECEIVE_DIAGNOSTIC, 2, &dp, sizeof(dp)); if (rc != 0) { fprintf(stderr, "%s: cannot read diagnostic page" " from SES for %s\n", progname, enclosure); close(fd); return -1; } } memset(&cp, 0, sizeof(cp)); switch (type) { case BHC_ENCLOSURE: if (fault == LED_ON) { fprintf(stderr, "%s: Cannot directly enable enclosure" " fault indicator\n", enclosure); close(fd); return -1; } SET_LED(&cp, &dp, fault, ident, enclosure_element_ctrl, enclosure_element_status); break; case BHC_MIDPLANE: SET_LED(&cp, &dp, fault, ident, midplane_element_ctrl, midplane_element_status); break; case BHC_DISK: SET_LED(&cp, &dp, fault, ident, disk_ctrl[index], disk_status[index]); break; case BHC_POWER_SUPPLY: SET_LED(&cp, &dp, fault, ident, ps_ctrl[index], ps_status[index]); break; case BHC_ERM: SET_LED(&cp, &dp, fault, ident, esm_ctrl[index], esm_status[index]); break; case BHC_PCI_CONTROLLER: SET_LED(&cp, &dp, fault, ident, scc_controller_ctrl[index], scc_controller_status[index]); break; case BHC_SAS_CONNECTOR: SET_LED(&cp, &dp, fault, ident, sas_connector_ctrl[index], sas_connector_status[index]); break; case BHC_FAN_ASSEMBLY: SET_LED(&cp, &dp, fault, ident, fan_sets[index].fan_element[0], fan_sets[index].fan_element[0]); break; default: fprintf(stderr, "%s internal error: unexpected component type %u\n", progname, type); close(fd); exit(3); } cp.page_code = 2; /* Convert host byte order to network byte order */ cp.page_length = htons(sizeof(cp) - 4); cp.generation_code = 0; rc = do_ses_cmd(fd, SEND_DIAGNOSTIC, 0, 0x10, 6, SG_DXFER_TO_DEV, &cp, sizeof(cp)); if (rc != 0) { fprintf(stderr, "%s: failed to set LED(s) via SES for %s.\n", progname, enclosure); close(fd); exit(2); } if (verbose) bh_report_component(&dp, fault, ident, type, index, verbose); close(fd); return 0; } ppc64-diag-2.7.4/diags/homerun_led.c0000644000000000000000000001552013135275400014010 00000000000000/* * Copyright (C) 2015, 2016 IBM Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include #include #include #include "encl_util.h" #include "encl_led.h" #include "homerun.h" enum hr_component_type { HR_ENCLOSURE, HR_DISK, HR_POWER_SUPPLY, HR_ESM, }; /* Retruns true if ESM has access to this element */ static inline bool hr_element_access_allowed(enum element_status_code sc) { if (sc == ES_NO_ACCESS_ALLOWED) return false; return true; } static int hr_decode_component_loc(struct hr_diag_page2 *dp, const char *loc, enum hr_component_type *type, unsigned int *index) { unsigned int n; char g; /* catch trailing garbage */ if (!loc || !strcmp(loc, "-")) { /* Enclosure */ *type = HR_ENCLOSURE; *index = 0; } else if (sscanf(loc, "P1-D%u%c", &n, &g) == 1) { /* Disk */ element_check_range(n, 1, HR_NR_DISKS, loc); *type = HR_DISK; *index = n - 1; if (!hr_element_access_allowed( dp->disk_status[*index].byte0.status)) { fprintf(stderr, "Doesn't have access to element : %s\n\n", loc); return -1; } } else if (sscanf(loc, "P1-C%u%c", &n, &g) == 1) { /* ESM */ element_check_range(n, 1, HR_NR_ESM_CONTROLLERS, loc); *type = HR_ESM; *index = n-1; } else if (sscanf(loc, "P1-E%u%c", &n, &g) == 1) { /* Power supply */ element_check_range(n, 1, HR_NR_POWER_SUPPLY, loc); *type = HR_POWER_SUPPLY; *index = n-1; } else { fprintf(stderr, "%s: unrecognized location code: %s\n", progname, loc); return -1; } return 0; } static const char *on_off_string[] = { "off", "on" }; static void hr_report_component(struct hr_diag_page2 *dp, int fault, int ident, enum hr_component_type type, unsigned int i, int verbose) { char loc_code[COMP_LOC_CODE]; char desc[COMP_DESC_SIZE]; static const char *left_right[] = { "left", "right" }; switch (type) { case HR_ENCLOSURE: REPORT_COMPONENT(dp, enclosure_element_status, fault, ident, "-", "enclosure", verbose); break; case HR_DISK: snprintf(loc_code, COMP_LOC_CODE, "P1-D%u", i+1); snprintf(desc, COMP_DESC_SIZE, "disk %u", i+1); REPORT_COMPONENT(dp, disk_status[i], fault, ident, loc_code, desc, verbose); break; case HR_POWER_SUPPLY: snprintf(loc_code, COMP_LOC_CODE, "P1-E%u", i+1); snprintf(desc, COMP_DESC_SIZE, "%s power supply", left_right[i]); REPORT_COMPONENT(dp, ps_status[i], fault, ident, loc_code, desc, verbose); break; case HR_ESM: snprintf(loc_code, COMP_LOC_CODE, "P1-C%u", i+1); snprintf(desc, COMP_DESC_SIZE, "%s Enclosure RAID Module", left_right[i]); REPORT_COMPONENT(dp, esm_status[i], fault, ident, loc_code, desc, verbose); break; default: fprintf(stderr, "%s internal error: unexpected component type %u\n", progname, type); exit(3); } } static void hr_report_component_from_ses(struct hr_diag_page2 *dp, enum hr_component_type type, unsigned int i, int verbose) { hr_report_component(dp, LED_SAME, LED_SAME, type, i, verbose); } int homerun_list_leds(const char *enclosure, const char *component, int verbose) { enum hr_component_type ctype; int fd; int rc; unsigned int i; unsigned int cindex; struct hr_diag_page2 dp; fd = open_sg_device(enclosure); if (fd < 0) return -1; rc = get_diagnostic_page(fd, RECEIVE_DIAGNOSTIC, 2, &dp, sizeof(dp)); if (rc != 0) { fprintf(stderr, "%s: cannot read diagnostic page from SES for %s\n", progname, enclosure); close(fd); return -1; } if (component) { rc = hr_decode_component_loc(&dp, component, &ctype, &cindex); if (rc != 0) { close(fd); return -1; } printf("fault ident location description\n"); hr_report_component_from_ses(&dp, ctype, cindex, verbose); } else { printf("fault ident location description\n"); /* Enclosure LED */ hr_report_component_from_ses(&dp, HR_ENCLOSURE, 0, verbose); /* Disk LED */ for (i = 0; i < HR_NR_DISKS; i++) { if (!hr_element_access_allowed( dp.disk_status[i].byte0.status)) continue; hr_report_component_from_ses(&dp, HR_DISK, i, verbose); } /* Power Supply LED */ for (i = 0; i < HR_NR_POWER_SUPPLY; i++) hr_report_component_from_ses(&dp, HR_POWER_SUPPLY, i, verbose); /* ESM LED */ for (i = 0; i < HR_NR_ESM_CONTROLLERS; i++) hr_report_component_from_ses(&dp, HR_ESM, i, verbose); } close(fd); return 0; } int homerun_set_led(const char *enclosure, const char *component, int fault, int ident, int verbose) { enum hr_component_type type; int fd, rc; unsigned int index; struct hr_diag_page2 dp; struct hr_ctrl_page2 cp; fd = open_sg_device(enclosure); if (fd < 0) return -1; memset(&dp, 0, sizeof(dp)); rc = get_diagnostic_page(fd, RECEIVE_DIAGNOSTIC, 2, &dp, sizeof(dp)); if (rc != 0) { fprintf(stderr, "%s: cannot read diagnostic page" " from SES for %s\n", progname, enclosure); close(fd); return -1; } rc = hr_decode_component_loc(&dp, component, &type, &index); if (rc != 0) { close(fd); return -1; } memset(&cp, 0, sizeof(cp)); switch (type) { case HR_ENCLOSURE: if (fault == LED_ON) { fprintf(stderr, "%s: Cannot directly enable enclosure" " fault indicator\n", enclosure); close(fd); return -1; } SET_LED(&cp, &dp, fault, ident, enclosure_element_ctrl, enclosure_element_status); break; case HR_DISK: SET_LED(&cp, &dp, fault, ident, disk_ctrl[index], disk_status[index]); break; case HR_POWER_SUPPLY: SET_LED(&cp, &dp, fault, ident, ps_ctrl[index], ps_status[index]); break; case HR_ESM: SET_LED(&cp, &dp, fault, ident, esm_ctrl[index], esm_status[index]); break; default: fprintf(stderr, "%s internal error: unexpected component type %u\n", progname, type); close(fd); exit(3); } cp.page_code = 2; /* Convert host byte order to network byte order */ cp.page_length = htons(sizeof(cp) - 4); cp.generation_code = 0; rc = do_ses_cmd(fd, SEND_DIAGNOSTIC, 0, 0x10, 6, SG_DXFER_TO_DEV, &cp, sizeof(cp)); if (rc != 0) { fprintf(stderr,"%s: failed to set LED(s) via SES for %s.\n", progname, enclosure); close(fd); exit(2); } if (verbose) hr_report_component(&dp, fault, ident, type, index, verbose); close(fd); return 0; } ppc64-diag-2.7.4/diags/slider_led.c0000644000000000000000000003004213135275400013611 00000000000000/* * Copyright (C) 2016 IBM Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, * USA. */ #include #include #include #include #include #include #include #include "encl_led.h" #include "encl_util.h" #include "slider.h" enum slider_component_type { SLIDER_DISK, SLIDER_ESC, SLIDER_PS, SLIDER_SAS_CONNECTOR, SLIDER_ENCLOSURE, }; enum slider_variant slider_variant_flag; /* Slider variant page size/number of disk */ static uint16_t slider_v_diag_page2_size; static uint16_t slider_v_ctrl_page2_size; static uint8_t slider_v_nr_disk; static const char * const on_off_string[] = { "off", "on" }; /* Returns true if ESC has access to this element */ static inline bool slider_element_access_allowed(enum element_status_code sc) { if (sc == ES_NO_ACCESS_ALLOWED) return false; return true; } static int slider_decode_component_loc(struct slider_disk_status *disk_status, const char *loc, enum slider_component_type *type, unsigned int *index) { unsigned int n, n2; char g; /* catch trailing garbage */ int nr_disk; nr_disk = ((slider_variant_flag == SLIDER_V_LFF) ? SLIDER_NR_LFF_DISK: SLIDER_NR_SFF_DISK); if (!loc || !strcmp(loc, "-")) { /* Enclosure */ *type = SLIDER_ENCLOSURE; *index = 0; } else if (sscanf(loc, "P1-D%u%c", &n, &g) == 1) { /* Disk */ element_check_range(n, 1, nr_disk, loc); *type = SLIDER_DISK; *index = n - 1; if (!slider_element_access_allowed( disk_status[*index].byte0.status)) { fprintf(stderr, "Doesn't have access to element : %s\n\n", loc); return -1; } } else if (sscanf(loc, "P1-C%u%c", &n, &g) == 1) { /* ESC */ element_check_range(n, 1, SLIDER_NR_ESC, loc); *type = SLIDER_ESC; *index = n-1; } else if (sscanf(loc, "P1-E%u%c", &n, &g) == 1) { /* PS */ element_check_range(n, 1, SLIDER_NR_POWER_SUPPLY, loc); *type = SLIDER_PS; *index = n-1; } else if (sscanf(loc, "P1-C%u-T%u%c", &n, &n2, &g) == 2) { /* SAS connector */ element_check_range(n, 1, SLIDER_NR_ESC, loc); element_check_range(n2, 1, SLIDER_NR_SAS_CONNECTOR_PER_EXPANDER, loc); *type = SLIDER_SAS_CONNECTOR; *index = (((n - 1) * SLIDER_NR_SAS_CONNECTOR_PER_EXPANDER)) + (n2 - 1); } else { fprintf(stderr, "%s: unrecognized location code: %s\n", progname, loc); return -1; } return 0; } #define SLIDER_REPORT_COMPONENT(dp, status_element, fault, ident, \ loc_code, desc, verbose) \ do { \ if (slider_variant_flag == SLIDER_V_LFF) { \ struct slider_lff_diag_page2 *d \ = (struct slider_lff_diag_page2 *)dp; \ REPORT_COMPONENT(d, status_element, \ fault, ident, loc_code, desc, verbose); \ } else { \ struct slider_sff_diag_page2 *d \ = (struct slider_sff_diag_page2 *)dp; \ REPORT_COMPONENT(d, status_element, \ fault, ident, loc_code, desc, verbose); \ } \ } while (0) static int slider_report_component(void *dp, int fault, int ident, enum slider_component_type type, unsigned int i, int verbose) { char loc_code[COMP_LOC_CODE]; char desc[COMP_DESC_SIZE]; static const char * const left_right[] = { "left", "right" }; switch (type) { case SLIDER_ENCLOSURE: SLIDER_REPORT_COMPONENT(dp, encl_element, fault, ident, "-", "enclosure", verbose); break; case SLIDER_DISK: snprintf(loc_code, COMP_LOC_CODE, "P1-D%u", i+1); snprintf(desc, COMP_DESC_SIZE, "disk %u", i+1); SLIDER_REPORT_COMPONENT(dp, disk_status[i], fault, ident, loc_code, desc, verbose); break; case SLIDER_ESC: snprintf(loc_code, COMP_LOC_CODE, "P1-C%u", i+1); snprintf(desc, COMP_DESC_SIZE, "%s Enclosure RAID Module", left_right[i]); SLIDER_REPORT_COMPONENT(dp, enc_service_ctrl_element[i], fault, ident, loc_code, desc, verbose); break; case SLIDER_PS: snprintf(loc_code, COMP_LOC_CODE, "P1-E%u", i+1); snprintf(desc, COMP_DESC_SIZE, "%s power supply", left_right[i]); SLIDER_REPORT_COMPONENT(dp, ps_status[i], fault, ident, loc_code, desc, verbose); break; case SLIDER_SAS_CONNECTOR: snprintf(loc_code, COMP_LOC_CODE, "P1-C%u-T%u", i/SLIDER_NR_SAS_CONNECTOR_PER_EXPANDER + 1, i - ((i/SLIDER_NR_SAS_CONNECTOR_PER_EXPANDER) * SLIDER_NR_SAS_CONNECTOR_PER_EXPANDER) + 1); snprintf(desc, COMP_DESC_SIZE, "SAS connector on %s ESM ", left_right[i/SLIDER_NR_SAS_CONNECTOR_PER_EXPANDER]); SLIDER_REPORT_COMPONENT(dp, sas_connector_status[i], fault, ident, loc_code, desc, verbose); break; default: fprintf(stderr, "%s internal error: unexpected component " "type %u\n", progname, type); return -1; } return 0; } /* @return 0 for success, !0 for failure */ static int slider_read_diag_page2(char **page, int *fdp, const char *enclosure) { char *buffer; int rc = -1; *fdp = open_sg_device(enclosure); if (*fdp < 0) return rc; /* Allocating status diagnostics page */ buffer = calloc(1, slider_v_diag_page2_size); if (!buffer) { fprintf(stderr, "Failed to allocate memory to hold " "current status diagnostics page 02 results.\n"); goto close_fd; } rc = get_diagnostic_page(*fdp, RECEIVE_DIAGNOSTIC, 2, (void *)buffer, (int)slider_v_diag_page2_size); if (rc != 0) { fprintf(stderr, "Failed to read SES diagnostic page; " "cannot report status.\n"); free(buffer); goto close_fd; } *page = buffer; return rc; close_fd: close(*fdp); return rc; } /* Slider variant details */ static int fill_slider_v_specific_details(void) { if (slider_variant_flag == SLIDER_V_LFF) { slider_v_diag_page2_size = sizeof(struct slider_lff_diag_page2); slider_v_ctrl_page2_size = sizeof(struct slider_lff_ctrl_page2); slider_v_nr_disk = SLIDER_NR_LFF_DISK; } else if (slider_variant_flag == SLIDER_V_SFF) { slider_v_diag_page2_size = sizeof(struct slider_sff_diag_page2); slider_v_ctrl_page2_size = sizeof(struct slider_sff_ctrl_page2); slider_v_nr_disk = SLIDER_NR_SFF_DISK; } else { return -1; } return 0; } int slider_list_leds(int slider_type, const char *enclosure, const char *component, int verbose) { char *status_page; int fd; int rc = -1; enum slider_component_type ctype; unsigned int cindex, i; /* Slider variant flag */ slider_variant_flag = slider_type; /* Fill slider variant specific details */ if (fill_slider_v_specific_details()) return rc; /* Read diag page */ if (slider_read_diag_page2(&status_page, &fd, enclosure)) return rc; if (component) { rc = slider_decode_component_loc ((struct slider_disk_status *) (status_page + element_offset(disk_status)), component, &ctype, &cindex); if (rc != 0) goto comp_decode_fail; printf("fault ident location description\n"); rc = slider_report_component(status_page, LED_SAME, LED_SAME, ctype, cindex, verbose); } else { printf("fault ident location description\n"); /* Enclosure LED */ rc = slider_report_component(status_page, LED_SAME, LED_SAME, SLIDER_ENCLOSURE, 0, verbose); /* Disk LED */ for (i = 0; i < slider_v_nr_disk; i++) { struct slider_disk_status *disk_status = (struct slider_disk_status *) (status_page + element_offset(disk_status)); if (!slider_element_access_allowed(disk_status[i].byte0.status)) continue; rc = slider_report_component(status_page, LED_SAME, LED_SAME, SLIDER_DISK, i, verbose); } /* ESC LED */ for (i = 0; i < SLIDER_NR_ESC; i++) rc = slider_report_component(status_page, LED_SAME, LED_SAME, SLIDER_ESC, i, verbose); /* PS LED */ for (i = 0; i < SLIDER_NR_POWER_SUPPLY; i++) rc = slider_report_component(status_page, LED_SAME, LED_SAME, SLIDER_PS, i, verbose); /* SAS connector LED */ for (i = 0; i < SLIDER_NR_SAS_CONNECTOR; i++) rc = slider_report_component(status_page, LED_SAME, LED_SAME, SLIDER_SAS_CONNECTOR, i, verbose); } comp_decode_fail: free(status_page); close(fd); return rc; } int slider_sff_list_leds(const char *enclosure, const char *component, int verbose) { return slider_list_leds(SLIDER_V_SFF, enclosure, component, verbose); } int slider_lff_list_leds(const char *enclosure, const char *component, int verbose) { return slider_list_leds(SLIDER_V_LFF, enclosure, component, verbose); } #define SLIDER_SET_LED(ctrl_page, dp, fault, ident, ctrl_element, \ status_element) \ do { \ if (slider_variant_flag == SLIDER_V_LFF) { \ struct slider_lff_diag_page2 *d \ = (struct slider_lff_diag_page2 *)dp; \ struct slider_lff_ctrl_page2 *c \ = (struct slider_lff_ctrl_page2 *)ctrl_page; \ SET_LED(c, d, fault, ident, ctrl_element, \ status_element); \ } else { \ struct slider_sff_diag_page2 *d \ = (struct slider_sff_diag_page2 *)dp; \ struct slider_sff_ctrl_page2 *c \ = (struct slider_sff_ctrl_page2 *)ctrl_page; \ SET_LED(c, d, fault, ident, ctrl_element, \ status_element); \ } \ } while (0) static int slider_set_led(int slider_type, const char *enclosure, const char *component, int fault, int ident, int verbose) { int rc = -1; char *ctrl_page; char *status_page; int fd; enum slider_component_type type; unsigned int index; /* Slider variant flag */ slider_variant_flag = slider_type; /* Fill slider variant specific details */ if (fill_slider_v_specific_details()) return rc; /* Read diag page */ if (slider_read_diag_page2(&status_page, &fd, enclosure)) return rc; rc = slider_decode_component_loc((struct slider_disk_status *) (status_page + element_offset(disk_status)), component, &type, &index); if (rc != 0) goto free_alloc_dp; /* Allocate ctrl page buffer */ ctrl_page = calloc(1, slider_v_ctrl_page2_size); if (!ctrl_page) { fprintf(stderr, "Failed to allocate memory to hold " "current ctrl diagnostics page 02 results.\n"); goto free_alloc_dp; } switch (type) { case SLIDER_ENCLOSURE: if (fault == LED_ON) { fprintf(stderr, "%s: Cannot directly enable enclosure" " fault indicator\n", enclosure); goto free_alloc_cp; } SLIDER_SET_LED(ctrl_page, status_page, fault, ident, encl_element, encl_element); break; case SLIDER_DISK: SLIDER_SET_LED(ctrl_page, status_page, fault, ident, disk_ctrl[index], disk_status[index]); break; case SLIDER_ESC: SLIDER_SET_LED(ctrl_page, status_page, fault, ident, enc_service_ctrl_element[index], enc_service_ctrl_element[index]); break; case SLIDER_PS: SLIDER_SET_LED(ctrl_page, status_page, fault, ident, ps_ctrl[index], ps_status[index]); break; case SLIDER_SAS_CONNECTOR: SLIDER_SET_LED(ctrl_page, status_page, fault, ident, sas_connector_ctrl[index], sas_connector_status[index]); break; default: fprintf(stderr, "%s internal error: unexpected component type %u\n", progname, type); goto free_alloc_cp; } SLIDER_ASSIGN_CTRL_PAGE(ctrl_page); rc = do_ses_cmd(fd, SEND_DIAGNOSTIC, 0, 0x10, 6, SG_DXFER_TO_DEV, ctrl_page, slider_v_ctrl_page2_size); if (rc != 0) { fprintf(stderr, "%s: failed to set LED(s) via SES for %s.\n", progname, enclosure); goto free_alloc_cp; } if (verbose) rc = slider_report_component(status_page, fault, ident, type, index, verbose); free_alloc_cp: free(ctrl_page); free_alloc_dp: free(status_page); close(fd); return rc; } int slider_sff_set_led(const char *enclosure, const char *component, int fault, int ident, int verbose) { return slider_set_led(SLIDER_V_SFF, enclosure, component, fault, ident, verbose); } int slider_lff_set_led(const char *enclosure, const char *component, int fault, int ident, int verbose) { return slider_set_led(SLIDER_V_LFF, enclosure, component, fault, ident, verbose); } ppc64-diag-2.7.4/diags/encl_led.h0000644000000000000000000000447013135275400013263 00000000000000/* * Copyright (C) 2012, 2015 IBM Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _ENCL_LED_H #define _ENCL_LED_H #define COMP_DESC_SIZE 64 #define COMP_LOC_CODE 16 #define LED_SAME -1 #define LED_OFF 0 #define LED_ON 1 /* * It'd be nicer to do all this with functions, but different components * have their fail, ident, rqst_fail, and rqst_ident bits in different * locations. */ #define SET_LED(cp, dp, fault, idnt, ctrl_element, status_element) \ do { \ (cp)->ctrl_element.common_ctrl.select = 1; \ (cp)->ctrl_element.rqst_fail = (fault == LED_SAME ? \ (dp)->status_element.fail : fault); \ (cp)->ctrl_element.rqst_ident = (idnt == LED_SAME ? \ (dp)->status_element.ident : idnt); \ } while (0) #define REPORT_COMPONENT(dp, element, fault, idnt, loc_code, desc, verbose) \ do { \ printf("%-5s %-5s %-9s", \ on_off_string[fault == LED_SAME ? dp->element.fail : fault], \ on_off_string[idnt == LED_SAME ? dp->element.ident : idnt], \ loc_code); \ if (verbose) \ printf(" %s", desc); \ printf("\n"); \ } while (0) extern const char *progname; extern int bluehawk_list_leds(const char *, const char *, int); extern int bluehawk_set_led(const char *, const char *, int, int, int); extern int homerun_list_leds(const char *, const char *, int); extern int homerun_set_led(const char *, const char *, int, int, int); extern int slider_lff_list_leds(const char *, const char *, int); extern int slider_lff_set_led(const char *, const char *, int, int, int); extern int slider_sff_list_leds(const char *, const char *, int); extern int slider_sff_set_led(const char *, const char *, int, int, int); #endif /* _ENCL_LED_H */ ppc64-diag-2.7.4/diags/run_diag_encl0000755000000000000000000000014313135275400014055 00000000000000#!/bin/bash if [ -x /usr/sbin/diag_encl ]; then /usr/sbin/diag_encl -c -s -l > /dev/null 2>&1 fi ppc64-diag-2.7.4/ela/0000755000000000000000000000000013135275553011103 500000000000000ppc64-diag-2.7.4/ela/man/0000755000000000000000000000000013135275553011656 500000000000000ppc64-diag-2.7.4/ela/man/syslog_to_svclog.80000644000000000000000000000652513135275400015265 00000000000000.\" .\" (C) Copyright IBM Corporation 2010 .\" .TH SYSLOG_TO_SVCLOG 8 "March 2010" Linux "Diagnostic Tools" .SH NAME syslog_to_svclog - log syslog messages to servicelog .SH SYNOPSIS .B syslog_to_svclog [ .B \-b .I begin_time ] [ .B \-e .I end_time | .B \-F ] .br [ .B \-m .I message_file | .B \-M ] [ .B \-C .I catalog_dir ] [ .B \-h ] [ .B \-d ] .SH DESCRIPTION The .B syslog_to_svclog command reads the specified message file (defaults to stdin), which should be in the format produced by the .B syslogd daemon. For each line that matches a message documented in the message catalog, .B syslog_to_svclog logs an event to the .B servicelog database, as appropriate. Typically, .B syslog_to_svclog logs only warning and error messages to .BR servicelog , not debug or informational messages. .P When .I /var/log/messages or .I /var/log/syslog is the message file, .B syslog_to_svclog maintains a little "last-message" file that contains a copy of the last line read from .I /var/log/messages or .I /var/log/syslog that matched a message from the message catalog. When a subsequent instance of .B syslog_to_svclog begins reading from .I /var/log/messages or .IR /var/log/syslog , and no .B \-b option is specified, .B syslog_to_svclog begins with the next message after the one in the "last message" file. The intent is to avoid logging the same event to .B servicelog multiple times. .SH OPTIONS .TP \fB\-b\fP \fIbegin_time\fP Ignore messages with timestamps prior to .IR begin_time . See "Timestamps." .TP \fB\-C\fP \fIcatalog_dir\fP Use the message catalog in .IR catalog_dir . The default is .IR /etc/ppc64-diag/message_catalog . .TP \fB\-d\fP Print debugging output on stderr. .TP \fB\-e\fP \fIend_time\fP Ignore messages with timestamps after .IR end_time . See "Timestamps." .TP \fB\-F\fP Do not terminate upon reaching the end of the message file. Continue watching for, and processing, new messages as they arrive, as with "\fBtail \-F\fP". To terminate .BR syslog_to_svclog , send it a termination signal, as with CTRL-C. .TP \fB\-h\fP Print help text and exit. .TP \fB\-m\fP \fImessage_file\fP Read syslog messages from the specified file instead of stdin. .TP \fB\-M\fP Read syslog messages from system default location .I /var/log/messages or .IR /var/log/syslog . .B \-M implies .BR \-F . .SH TIMESTAMPS The following timestamp formats are recognized by .BR syslog_to_svclog : .br .I month .I day [ .I year ] [\fIhh\fP:\fImm\fP[:\fIss\fP]] \(em e.g., Feb 12 2010 14:30 .br .I month .I day \fIhh\fP:\fImm\fP[:\fIss\fP] [ .I year ] .br .I day .I month [ .I year ] [\fIhh\fP:\fImm\fP[:\fIss\fP]] \(em e.g., 12 Feb 14:30 .br .I day .I month \fIhh\fP:\fImm\fP[:\fIss\fP] [ .I year ] .br \fIyear\fP-\fImonth\fP-\fIday\fP [\fIhh\fP:\fImm\fP[:\fIss\fP]] \(em e.g., 2010-2-12 14:30:00 .P If no year is specified, .B syslog_to_svclog assumes that the timestamp is from the prior 12 months. If no \fIhh\fP:\fImm\fP is specified, .B syslog_to_svclog assumes 00:00:00. .SH AUTHOR Written by Jim Keniston (jkenisto@us.ibm.com). Conversion of format strings to regular expressions (for matching syslog messages to catalog entries) written by Jesse Larrew (jlarrew@us.ibm.com). .SH FILES .I /etc/ppc64-diag/message_catalog/* \(em message catalog .br .I /var/log/ppc64-diag/last_syslog_event \(em last message matched from /var/log/messages .SH "SEE ALSO" .IR explain_syslog (8), .IR servicelog (8), .IR syslog (3) ppc64-diag-2.7.4/ela/man/explain_syslog.80000644000000000000000000000430413135275400014717 00000000000000.\" .\" (C) Copyright IBM Corporation 2010 .\" .TH EXPLAIN_SYSLOG 8 "March 2010" Linux "Diagnostic Tools" .SH NAME explain_syslog - explain syslog messages .SH SYNOPSIS .B explain_syslog [ .B \-b .I begin_time ] [ .B \-e .I end_time ] .br [ .B \-m .I message_file | .B \-M ] [ .B \-C .I catalog_dir ] [ .B \-h ] [ .B \-d ] .SH DESCRIPTION The .B explain_syslog command reads the specified message file (defaults to stdin), which should be in the format produced by the .B syslogd daemon. For each line that matches a message documented in the message catalog, .B explain_syslog prints an explanation, including probable cause and recommended action. .SH OPTIONS .TP \fB\-b\fP \fIbegin_time\fP Ignore messages with timestamps prior to .IR begin_time . See "Timestamps." .TP \fB\-C\fP \fIcatalog_dir\fP Use the message catalog in .IR catalog_dir . The default is .IR /etc/ppc64-diag/message_catalog . .TP \fB\-d\fP Print debugging output on stderr. .TP \fB\-e\fP \fIend_time\fP Ignore messages with timestamps after .IR end_time . See "Timestamps." .TP \fB\-h\fP Print help text and exit. .TP \fB\-m\fP \fImessage_file\fP Read syslog messages from the specified file instead of stdin. .TP \fB\-M\fP Read syslog messages from system default location. .SH TIMESTAMPS The following timestamp formats are recognized by .BR explain_syslog : .br .I month .I day [ .I year ] [\fIhh\fP:\fImm\fP[:\fIss\fP]] \(em e.g., Feb 12 2010 14:30 .br .I month .I day \fIhh\fP:\fImm\fP[:\fIss\fP] [ .I year ] .br .I day .I month [ .I year ] [\fIhh\fP:\fImm\fP[:\fIss\fP]] \(em e.g., 12 Feb 14:30 .br .I day .I month \fIhh\fP:\fImm\fP[:\fIss\fP] [ .I year ] .br \fIyear\fP-\fImonth\fP-\fIday\fP [\fIhh\fP:\fImm\fP[:\fIss\fP]] \(em e.g., 2010-2-12 14:30:00 .P If no year is specified, .B explain_syslog assumes that the timestamp is from the prior 12 months. If no \fIhh\fP:\fImm\fP is specified, .B explain_syslog assumes 00:00:00. .SH AUTHOR Written by Jim Keniston (jkenisto@us.ibm.com). Conversion of format strings to regular expressions (for matching syslog messages to catalog entries) written by Jesse Larrew (jlarrew@us.ibm.com). .SH FILES .I /etc/ppc64-diag/message_catalog/* \(em message catalog .SH "SEE ALSO" .IR syslog_to_servicelog (8), .IR syslog (3) ppc64-diag-2.7.4/ela/Makefile.am0000644000000000000000000000527713135275400013061 00000000000000BUILT_SOURCE = ela/ev.tab.h ela/rr.tab.h \ ela/ev.tab.cc ela/rr.tab.cc \ ela/lex.rr.cc ela/lex.ev.cc ela_h_files = ela/catalogs.h CATALOG = ela/message_catalog/cxgb3 ela/message_catalog/e1000e \ ela/message_catalog/exceptions ela/message_catalog/reporters \ ela/message_catalog/gpfs CATALOG_REGEX = ela/message_catalog/with_regex/cxgb3 \ ela/message_catalog/with_regex/e1000e \ ela/message_catalog/with_regex/gpfs ela/rr.tab.h: ela/rr.tab.cc ela/ev.tab.h: ela/ev.tab.cc ela/ev.tab.cc: ela/event_gram.y yacc -dl -b ev -p ev ela/event_gram.y mv ev.tab.c ela/ev.tab.cc mv ev.tab.h ela/ev.tab.h ela/rr.tab.cc: ela/reporter_gram.y yacc -dl -b rr -p rr ela/reporter_gram.y mv rr.tab.c ela/rr.tab.cc mv rr.tab.h ela/rr.tab.h ela/lex.rr.cc: ela/reporter_lex.l flex -Prr ela/reporter_lex.l mv lex.rr.c ela/lex.rr.cc ela/lex.ev.cc: ela/event_lex.l flex -Pev ela/event_lex.l mv lex.ev.c ela/lex.ev.cc sbin_PROGRAMS += ela/explain_syslog ela/add_regex ela_explain_syslog_SOURCES = ela/explain_syslog.cpp \ ela/catalogs.cpp \ ela/date.c \ $(BUILT_SOURCE) \ $(ela_h_files) ela_explain_syslog_LDADD = -lstdc++ if WITH_LIBRTAS sbin_PROGRAMS += ela/syslog_to_svclog ela_syslog_to_svclog_SOURCES = ela/syslog_to_svclog.cpp \ ela/catalogs.cpp \ ela/date.c \ $(BUILT_SOURCE) \ $(ela_h_files) ela_syslog_to_svclog_LDADD = -lservicelog -lvpd -lvpd_cxx -lrtasevent dist_man_MANS += ela/man/syslog_to_svclog.8 endif ela_add_regex_SOURCES = ela/add_regex.cpp \ ela/catalogs.cpp \ ela/date.c \ $(BUILT_SOURCE) \ $(ela_h_files) dist_man_MANS += ela/man/explain_syslog.8 clean-local-ela: rm -f $(BUILT_SOURCE) CLEAN_LOCALS += clean-local-ela install-exec-hook-ela: install -d --mode=755 $(DESTDIR)/etc/ppc64-diag/message_catalog/with_regex/ install -D --mode=744 $(CATALOG) $(DESTDIR)/etc/ppc64-diag/message_catalog/ install -D --mode=744 $(CATALOG_REGEX) \ $(DESTDIR)/etc/ppc64-diag/message_catalog/with_regex/ INSTALL_EXEC_HOOKS += install-exec-hook-ela uninstall-hook-ela: rm -f $(DESTDIR)/etc/ppc64-diag/message_catalog/cxgb3 rm -f $(DESTDIR)/etc/ppc64-diag/message_catalog/e1000e rm -f $(DESTDIR)/etc/ppc64-diag/message_catalog/exceptions rm -f $(DESTDIR)/etc/ppc64-diag/message_catalog/reporters rm -f $(DESTDIR)/etc/ppc64-diag/message_catalog/gpfs rm -f $(DESTDIR)/etc/ppc64-diag/message_catalog/with_regex/cxgb3 rm -f $(DESTDIR)/etc/ppc64-diag/message_catalog/with_regex/e1000e rm -f $(DESTDIR)/etc/ppc64-diag/message_catalog/with_regex/gpfs UNINSTALL_HOOKS += uninstall-hook-ela EXTRA_DIST += ela/README ela/message_catalog \ ela/event_lex.l ela/event_gram.y \ ela/reporter_lex.l ela/reporter_gram.y ppc64-diag-2.7.4/ela/add_regex.cpp0000644000000000000000000000151213135275400013437 00000000000000using namespace std; #include #include #include #include "catalogs.h" extern "C" { #include "platform.c" } static const char *progname; static void usage(void) { cerr << "usage: " << progname << " [-C catalog_dir]" << endl; exit(1); } int main(int argc, char **argv) { const char *catalog_dir = ELA_CATALOG_DIR; int c; int platform = 0; progname = argv[0]; platform = get_platform(); cout << progname << ": is not supported on the " << __power_platform_name(platform) << " platform" << endl; exit(0); opterr = 0; while ((c = getopt(argc, argv, "C:")) != -1) { switch (c) { case 'C': catalog_dir = optarg; break; case '?': usage(); } } if (optind != argc) usage(); regex_text_policy = RGXTXT_WRITE; if (EventCatalog::parse(catalog_dir) != 0) exit(2); exit(0); } ppc64-diag-2.7.4/ela/catalogs.cpp0000644000000000000000000012224213135275400013316 00000000000000/* * event/message and reporter catalogs for syslog analysis * * Copyright (C) International Business Machines Corp., 2009 * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ using namespace std; #include #include #include #include #include #include #include #include #include #include #include #include #include #include "catalogs.h" #include extern FILE *spopen(char **, pid_t *) __attribute__((weak)); extern FILE *spclose(FILE *, pid_t) __attribute__((weak)); //Workaround for deprecated warning #pragma GCC diagnostic ignored "-Wwrite-strings" enum regex_text_policy regex_text_policy = RGXTXT_READ; static CatalogCopy *catalog_copy = NULL; ReporterCtlgParser reporter_ctlg_parser; extern int rrparse(); extern void rrerror(const char *s); ReporterCatalog reporter_catalog; EventCtlgParser event_ctlg_parser; extern int evparse(void); extern void everror(const char *s); EventCatalog event_catalog; ExceptionCatalog exception_catalog; Parser *cur_parser = NULL; Parser::Parser() { pathname = NULL; file = NULL; } int Parser::parse_file(const string& path) { int result; cur_parser = this; pathname = path.c_str(); file = fopen(pathname, "r"); if (!file) { fprintf(stderr, "can't open catalog file\n"); perror(pathname); return -1; } init_lex(); result = parse(); if (semantic_errors > 0) result = semantic_errors; fclose(file); return result; } void Parser::semantic_error(const string& msg) { error(msg.c_str()); semantic_errors++; } #define MYEOF '\0' /* * Collect the 1-to-3-digit octal number following a \. * If is_char_const is true, we're accumulating a char constant, so we flag * an error if there are excess digits. * Returns value > UCHAR_MAX if there's an error. */ int Parser::get_octal_escape(const char *digits, int is_char_const) { int n = 0; int nDigits = 0; const char *c; for (c = digits; '0' <= *c && *c <= '7'; c++) { n *= 8; n += *c - '0'; if (++nDigits == 3 && !is_char_const) { return n; } else if (nDigits > 3 && is_char_const) { return UCHAR_MAX+1; } } return n; } int Parser::get_char_escape(char c) { switch (c) { case '\'': return '\''; case '\"': return '\"'; case '\?': return '\?'; case '\\': return '\\'; case 'a': return '\a'; case 'b': return '\b'; case 'f': return '\f'; case 'n': return '\n'; case 'r': return '\r'; case 't': return '\t'; case 'v': return '\v'; case '\n': return -1; default: return c; } } /* * Return a version of s that contains only printable characters, by * converting non-printing characters to \ escapes. */ string add_escapes(const string& s) { int i; string es; int slen = s.length(); for (i = 0; i < slen; i++) { char c = s[i]; switch (c) { case '\\': es += "\\\\"; break; case '\"': es += "\\\""; break; case '\?': es += "\\?"; break; case '\a': es += "\\a"; break; case '\b': es += "\\b"; break; case '\f': es += "\\f"; break; case '\n': es += "\\n"; break; case '\r': es += "\\r"; break; case '\t': es += "\\t"; break; case '\v': es += "\\v"; break; default: if (isprint(c)) { es += c; } else { char octal_esc[4]; sprintf(octal_esc, "\\%o", (unsigned char) c); es += octal_esc; } break; } } return es; } void Parser::collect_octal_digits(char *digits, char first_digit) { int nDigits = 1; int c; digits[0] = first_digit; while (nDigits <= 3) { c = p_input(); if ('0' <= c && c <= '7') { digits[nDigits++] = c; } else { p_unput(c); break; } } digits[nDigits] = '\0'; } #define MAXSTRLEN (10*1024) #define STRSLOP 10 /* e.g., to handle a multibyte character at the end */ static char strbuf[MAXSTRLEN+STRSLOP]; /* * We have eaten the leading " in a quoted string. Collect the characters * of the string into strbuf, and then return a strdup-ed copy of the string. * We end after eating the terminating ". */ char * Parser::get_string(int quoted) { int nc = 0; int c; int end_of_string = (quoted ? '\"' : MYEOF); for (;;) { c = p_input(); if (c == end_of_string) { break; } else if (c == MYEOF) { /* EOF in middle of quoted string. */ return 0; } else if (c == '\\') { /* Collect and decode the escape sequence. */ c = p_input(); if (c == MYEOF) { /* End of input */ if (quoted) { return 0; } else { /* Allow \ as the last character. */ strbuf[nc++] = '\\'; break; } } else if ('0' <= c && c <= '7') { char digits[3+1]; collect_octal_digits(digits, c); strbuf[nc++] = get_octal_escape(digits, 0); } else { int ce = get_char_escape(c); /* Elide escaped newlines (ce == -1). */ if (ce == -1) { lineno++; } else { strbuf[nc++] = ce; } } } else { if (c == '\n') { lineno++; } strbuf[nc++] = c; } if (nc > MAXSTRLEN) { return 0; } } strbuf[nc] = '\0'; return strdup(strbuf); } /* * We have already eaten the leading / and *. Skip past the trailing * and /. */ int Parser::skip_comment() { int c; int orig_lineno = lineno; while ((c = p_input()) != MYEOF) { if (c == '\n') { lineno++; } /* Correctly handle multiple *s followed by /. */ check_star: while (c == '*') { c = p_input(); if (c == '/') { /* End of comment */ return 0; } else if (c == MYEOF) { /* EOF after a '*'. */ return -1; } else if (c == '\n') { lineno++; } } /* This is just to warn about nested comments. */ while (c == '/') { c = p_input(); if (c == '*') { fprintf(stderr, "%s:%d: warning: comment here" " nested inside comment starting at" " line %d\n", pathname, lineno, orig_lineno); goto check_star; } else if (c == MYEOF) { return -1; } else if (c == '\n') { lineno++; } } } /* End of file */ return -1; } /* * We've eaten the leading {{ in a text block. Collect the characters * of the block into strbuf, and then return a strdup-ed copy of the string. * We end after eating the terminating }}. Leading and trailing space * characters, including newlines, are stripped off. */ char * Parser::get_text_block(void) { int nc = 0; int c; int last_non_space = -1; for (;;) { c = p_input(); if (c == 0) { /* EOF in middle of text block */ return NULL; } else if (isspace(c)) { if (c == '\n') lineno++; if (last_non_space >= 0) strbuf[nc++] = c; } else { if (c == '}') { c = p_input(); if (c == '}') { /* End of block */ break; } else { /* Lone } */ p_unput(c); c = '}'; } } last_non_space = nc; strbuf[nc++] = c; } if (nc > MAXSTRLEN) return NULL; } if (last_non_space < 0) return strdup(""); strbuf[last_non_space+1] = '\0'; return strdup(strbuf); } ReporterCtlgParser::ReporterCtlgParser() : Parser() { parse = rrparse; error = rrerror; } EventCtlgParser::EventCtlgParser() : Parser() { parse = evparse; error = everror; } void MemberSet::tally(void *addr, const string& name) { if (seen.find(addr) == seen.end()) seen.insert(addr); else parser->semantic_error(name + " statement seen multiple times" " in same catalog entry."); } void MemberSet::require(void *addr, const string& name) { if (seen.find(addr) == seen.end()) parser->semantic_error(name + " statement required but missing."); } int nvp_lookup(string name, NameValuePair *nvp, string member) { const char *nm = name.c_str(); int i; for (i = 0; nvp[i].name != NULL; i++) { if (!strcmp(nm, nvp[i].name)) return nvp[i].value; } cur_parser->semantic_error("unrecognized value for " + member + ": " + name); return nvp[i].value; } string nvp_lookup_value(int value, NameValuePair *nvp) { int i; for (i = 0; nvp[i].name != NULL; i++) { if (nvp[i].value == value) return string(nvp[i].name); } return "badval"; } static struct NameValuePair severity_nvp[] = { { "emerg", LOG_EMERG }, { "alert", LOG_ALERT }, { "crit", LOG_CRIT }, { "err", LOG_ERR }, { "warning", LOG_WARNING }, { "notice", LOG_NOTICE }, { "info", LOG_INFO }, { "debug", LOG_DEBUG }, { "unknown", LOG_SEV_UNKNOWN }, { "any", LOG_SEV_ANY }, { "KERN_EMERG", LOG_EMERG }, { "KERN_ALERT", LOG_ALERT }, { "KERN_CRIT", LOG_CRIT }, { "KERN_ERR", LOG_ERR }, { "KERN_WARNING", LOG_WARNING }, { "KERN_NOTICE", LOG_NOTICE }, { "KERN_INFO", LOG_INFO }, { "KERN_DEBUG", LOG_DEBUG }, { "LOG_EMERG", LOG_EMERG }, { "LOG_ALERT", LOG_ALERT }, { "LOG_CRIT", LOG_CRIT }, { "LOG_ERR", LOG_ERR }, { "LOG_WARNING", LOG_WARNING }, { "LOG_NOTICE", LOG_NOTICE }, { "LOG_INFO", LOG_INFO }, { "LOG_DEBUG", LOG_DEBUG }, { NULL, LOG_SEV_UNKNOWN } }; string severity_name(int sev) { return nvp_lookup_value(sev, severity_nvp); } ReporterAlias::ReporterAlias(const string& nm, const string& sev) { reporter = NULL; name = nm; severity = nvp_lookup(sev, severity_nvp, "severity level"); } ostream& operator<<(ostream& os, const ReporterAlias& ra) { os << ra.name << '(' << severity_name(ra.severity) << ')'; return os; } static struct NameValuePair source_nvp[] = { { "kernel", 1 }, { "user", 0 }, { NULL, 1 } }; Reporter::Reporter(ReporterAlias *ra) : members(&reporter_ctlg_parser) { name = ra->name; base_alias = ra; aliases = NULL; from_kernel = false; prefix_format = ""; prefix_args = NULL; device_arg = ""; parser = &reporter_ctlg_parser; } void Reporter::set_source(const string& source) { members.tally(&from_kernel, "source"); from_kernel = nvp_lookup(source, source_nvp, "source"); } void Reporter::set_aliases(vector *alist) { members.tally(&aliases, "aliases"); if (!aliases) aliases = alist; } void Reporter::set_prefix_format(const string& format) { members.tally(&prefix_format, "prefix_format"); prefix_format = format; } void Reporter::set_prefix_args(vector *args) { members.tally(&prefix_args, "prefix_args"); if (!prefix_args) prefix_args = args; } bool Reporter::prefix_arg_exists(const string& arg) { if (!prefix_args) return false; vector::iterator it; for (it = prefix_args->begin(); it < prefix_args->end(); it++) { if (*it == arg) return true; } return false; } void Reporter::set_device_arg(const string& arg) { members.tally(&device_arg, "device_arg"); device_arg = arg; if (arg != "none") { if (!prefix_arg_exists(arg)) parser->semantic_error("device_arg " + arg + " not in prefix_args"); } } void Reporter::validate(void) { if (device_arg == "") { if (prefix_args) { if (prefix_arg_exists("device")) device_arg = "device"; else parser->semantic_error( "No \"device\" arg in prefix_args, " "so device_arg statement must specify " "a prefix arg or none."); } else device_arg = "none"; } } static void cout_name_list(ostream& os, const vector *list) { if (list) { vector::const_iterator it; for (it = list->begin(); it < list->end(); it++) os << " " << *it; } else os << " [NONE]"; } static void cout_alias_list(ostream& os, const vector *list) { if (list) { vector::const_iterator it; for (it = list->begin(); it < list->end(); it++) os << " " << **it; } else os << " [NONE]"; } ostream& operator<<(ostream& os, const Reporter& r) { os << "reporter: " << *(r.base_alias) << endl; os << "source: " << (r.from_kernel ? "kernel" : "user") << endl; os << "aliases:"; cout_alias_list(os, r.aliases); os << endl; os << "prefix_format: \"" << r.prefix_format << "\"" << endl; os << "prefix_args:"; cout_name_list(os, r.prefix_args); os << endl; os << "device_arg: " << r.device_arg << endl; return os; } MetaReporter::MetaReporter(const string& nm) : members(&reporter_ctlg_parser) { name = nm; parser = &reporter_ctlg_parser; variant_names = NULL; } ostream& operator<<(ostream& os, const MetaReporter& mr) { os << "meta_reporter: " << mr.name << endl; os << "variants:"; cout_alias_list(os, &mr.variants); os << endl; return os; } void MetaReporter::set_variant_names(vector *vnames) { members.tally(&variant_names, "variants"); if (!variant_names) variant_names = vnames; } /* * This MetaReporter's variant_names list contains the name of a previously * defined MetaReporter, mr. Copy mr's variants list into this's. (A * MetaReporter's variants list is always ReporterAliases, never MetaReporters.) * * Note that it's possible to get the same ReporterAlias multiple times in * the same MetaReporter's variants list (e.g., if multiple nested * MetaReporters refer to it), but that won't break anything. */ void MetaReporter::handle_nested_meta_reporter(MetaReporter *mr) { vector::iterator it; for (it = mr->variants.begin(); it < mr->variants.end(); it++) variants.push_back(*it); } void MetaReporter::validate(ReporterCatalog *catalog) { members.require(&variant_names, "variants"); if (!variant_names) return; vector::iterator it; set names_seen; for (it = variant_names->begin(); it < variant_names->end(); it++) { string vname = *it; if (names_seen.find(vname) != names_seen.end()) { parser->semantic_error( "duplicate name in variants list:" + vname); continue; } names_seen.insert(vname); ReporterAlias *ra = catalog->find(vname); if (ra) { variants.push_back(ra); } else { MetaReporter *mr = catalog->find_meta_reporter(vname); if (mr) handle_nested_meta_reporter(mr); else parser->semantic_error("unknown reporter: " + vname); } } /* Make sure all variants are consistent about necessary stuff. */ bool first_variant = true; bool from_kernel = true; vector::iterator rit; for (rit = variants.begin(); rit < variants.end(); rit++) { ReporterAlias *ra = *rit; if (first_variant) { from_kernel = ra->reporter->from_kernel; first_variant = false; } else if (ra->reporter->from_kernel != from_kernel) parser->semantic_error("meta_reporter variants " "can't be from both kernel and user space."); } } void ReporterCatalog::register_reporter(Reporter* r) { if (!r) /* called as a result of a syntax error */ return; rlist.push_back(r); register_alias(r->base_alias, r); if (r->aliases) { vector::iterator it; for (it = r->aliases->begin(); it < r->aliases->end(); it++) register_alias(*it, r); } r->validate(); } void ReporterCatalog::register_meta_reporter(MetaReporter *mr) { if (!mr) return; mr->validate(this); if (find(mr->name) || find_meta_reporter(mr->name)) { cur_parser->semantic_error( "meta_reporter name already in use: " + mr->name); } else { mrmap[mr->name] = mr; mrlist.push_back(mr); } } void ReporterCatalog::register_alias(ReporterAlias *ra, Reporter *reporter) { /* * To avoid the possibility of a mapping to a Reporter that * has been deleted due to a syntax error, we don't register * aliases until the Reporter entry has been successfully * parsed. This may mean that on a duplicate, the error * message's line number is slightly off. NBD. */ ra->reporter = reporter; ReporterAlias *dup = find(ra->name); if (dup) cur_parser->semantic_error("duplicate reporter name: " + ra->name); else rmap[ra->name] = ra; } ReporterAlias * ReporterCatalog::find(const string& name) { map::iterator it = rmap.find(name); if (it == rmap.end()) return NULL; return it->second; } MetaReporter * ReporterCatalog::find_meta_reporter(const string& name) { map::iterator it = mrmap.find(name); if (it == mrmap.end()) return NULL; return it->second; } void ExceptionCatalog::add(Parser *pc, const string& type, const string& description, const string &action) { if (find(type) == NULL) exceptions[type] = new ExceptionMsg(type, description, action); else pc->semantic_error("multiple entries for exception " + type); } ExceptionMsg * ExceptionCatalog::find(const string& type) { map::iterator it = exceptions.find(type); if (it == exceptions.end()) return NULL; return it->second; } /* * The severity should be implied by the reporter (alias) or specified * explicitly in the message statement, but not both. * * Report bogus severity name in message stmt in any case. */ int MatchVariant::resolve_severity(int msg_severity) { int reporter_sev, sev; sev = reporter_sev = reporter_alias->severity; if (reporter_sev == LOG_SEV_UNKNOWN && msg_severity == LOG_SEV_UNKNOWN) parent->parser->semantic_error("message statement must specify" " severity because reporter " + reporter_alias->name + " does not."); else if (reporter_sev != LOG_SEV_UNKNOWN && msg_severity != LOG_SEV_UNKNOWN) { parent->parser->semantic_error("reporter " + reporter_alias->name + " specifies severity, so message statement" + " should not."); if (reporter_sev != msg_severity) parent->parser->semantic_error("severity specified by" " message statement conflicts with" " severity specified by reporter " + reporter_alias->name); } else if (reporter_sev == LOG_SEV_UNKNOWN) sev = msg_severity; return sev; } void SyslogEvent::mk_match_variants(const string& rp, const string& sev_name) { int msg_severity; if (!sev_name.compare("")) msg_severity = LOG_SEV_UNKNOWN; else if (!sev_name.compare("default")) /* * Some printks don't include a KERN_* prefix. printk() * uses default_message_loglevel in those cases. For all * practical purposes, that's KERN_WARNING. */ msg_severity = LOG_WARNING; else msg_severity = nvp_lookup(sev_name, severity_nvp, "severity level"); ReporterAlias *ra = reporter_catalog.find(rp); if (ra) { match_variants.push_back(new MatchVariant(ra, msg_severity, this)); } else { MetaReporter *mr = reporter_catalog.find_meta_reporter(rp); if (mr) { vector::iterator it; for (it = mr->variants.begin(); it != mr->variants.end(); it++) match_variants.push_back(new MatchVariant(*it, msg_severity, this)); } else { parser->semantic_error("logging function not found in" " reporter catalog: " + rp); } } } SyslogEvent::SyslogEvent(const string& rp, const string& sev, const string& fmt, EventCtlgFile *drv) : members(&event_ctlg_parser) { parser = &event_ctlg_parser; driver = drv; source_file = driver->cur_source_file; format = fmt; escaped_format = add_escapes(format); reporter_name = rp; mk_match_variants(rp, sev); err_type = SYTY_BOGUS; // zero sl_severity = 0; priority = 'L'; exception_msg = NULL; from_kernel = false; if (match_variants.size() > 0) { MatchVariant *first = match_variants.front(); from_kernel = first->reporter_alias->reporter->from_kernel; } } /* * POSIX recommends that portable programs use regex patterns less than 256 * characters. */ #define REGEX_MAXLEN 256 /* * Form the full format string by prepending the reporter's prefix; * generate the corresponding regular-expression text, and compile * the regex. * * If the associated Reporter supplies prefix args (e.g., dev_err * provides driver and device), create and compile the regular expression * such that the values of the prefix args can be extracted from a * matching message using regexec's pmatch feature. * * Failures are logged as parser semantic errors. * * NOTE: compute_regex_text() has been split off from compile_regex() * now that regex_text can be read in from the catalog. */ void MatchVariant::compute_regex_text(void) { int __attribute__((__unused__))get_prefix_args = 0; FILE *in; char regex_cstr[REGEX_MAXLEN]; std::ostringstream regex_maxlen; string regex_max_s; char *regex_len, *format; char *args[4]; pid_t cpid; Reporter *reporter = reporter_alias->reporter; string full_format = reporter->prefix_format + parent->format; size_t nl = full_format.find_last_of('\n'); // Strip trailing newline. if (nl) { if (full_format.substr(nl+1) != "") parent->parser->semantic_error( "in format string, newline is not last"); full_format = full_format.substr(0, nl); } if (reporter->prefix_args && reporter->prefix_args->size() > 0) get_prefix_args = 1; regex_maxlen << REGEX_MAXLEN; regex_max_s = regex_maxlen.str(); regex_len = strdup(regex_max_s.c_str()); format = strdup(full_format.c_str()); if ((!regex_len) || (!format)) { parent->parser->semantic_error("Memory allocation failed"); goto free_mem; } args[0] = "/usr/bin/regex_converter"; args[1] = regex_len; args[2] = format; args[3] = NULL; if (!(in = spopen(args, &cpid))) { parent->parser->semantic_error("cannot create regex text," "regex_converter may not be installed"); goto free_mem; } fgets(regex_cstr,REGEX_MAXLEN, in); spclose(in, cpid); if (!strcmp(regex_cstr, "regex parser failure")) { parent->parser->semantic_error( "cannot create regex text from format"); goto free_mem; } regex_text = regex_cstr; nl = regex_text.find_last_of('\n'); // Strip trailing newline. if (nl) { regex_text = regex_text.substr(0, nl); } // Change expr to ^expr$ so we match only the full message. regex_text = "^" + regex_text + "$"; free_mem: if (regex_len) free(regex_len); if (format) free(format); } void MatchVariant::compile_regex(void) { int result; int regcomp_flags = REG_EXTENDED | REG_NEWLINE; Reporter *reporter = reporter_alias->reporter; if (!reporter->prefix_args || reporter->prefix_args->size() == 0) regcomp_flags |= REG_NOSUB; result = regcomp(®ex, regex_text.c_str(), regcomp_flags); if (result != 0) { char reason[200]; (void) regerror(result, ®ex, reason, 200); parent->parser->semantic_error("cannot compile regex: " + string(reason)); } } void SyslogEvent::except(const string& reason) { exception_msg = exception_catalog.find(reason); if (!exception_msg) parser->semantic_error("unknown exception type: " + reason); } string SyslogEvent::paste_copies(const string &text) { string s = text; string paste = "@paste "; size_t i = 0; while (i < s.length()) { i = s.find(paste, i); if (i == string::npos) break; size_t j, start = i + paste.length(); size_t end = s.length(); for (j = start; j < end; j++) { char c = s.at(j); if (!isalpha(c) && !isdigit(c) && c != '_') break; } /* j points to the first character after the name. */ if (j == start) { parser->semantic_error("malformed @paste"); return s; } string name = s.substr(start, j-start); string copy = driver->find_text_copy(name); if (copy == "") { parser->semantic_error( "cannot find text copy to paste: " + name); return s; } s.replace(i, j-i, copy); i = j; } return s; } void SyslogEvent::set_description(const string& desc) { members.tally(&description, "description"); description = paste_copies(desc); } void SyslogEvent::set_action(const string& act) { members.tally(&action, "action"); action = paste_copies(act); } static struct NameValuePair class_nvp[] = { { "unknown", SYCL_UNKNOWN }, { "hardware", SYCL_HARDWARE }, { "software", SYCL_SOFTWARE }, { "firmware", SYCL_FIRMWARE }, { NULL, SYCL_UNKNOWN } }; void SyslogEvent::set_class(const string& cls) { members.tally(&err_class, "class"); err_class = (ErrorClass) nvp_lookup(cls, class_nvp, "class"); } static struct NameValuePair type_nvp[] = { { "unknown", SYTY_UNKNOWN }, { "perm", SYTY_PERM }, { "temp", SYTY_TEMP }, { "config", SYTY_CONFIG }, { "pend", SYTY_PEND }, { "perf", SYTY_PERF }, { "info", SYTY_INFO }, { NULL, SYTY_UNKNOWN } }; void SyslogEvent::set_type(const string& ty) { members.tally(&err_type, "type"); err_type = (ErrorType) nvp_lookup(ty, type_nvp, "type"); } static struct NameValuePair sl_severity_nvp[] = { { "debug", SL_SEV_DEBUG }, { "info", SL_SEV_INFO }, { "event", SL_SEV_EVENT }, { "warning", SL_SEV_WARNING }, { "error_local", SL_SEV_ERROR_LOCAL }, { "error", SL_SEV_ERROR }, { "fatal", SL_SEV_FATAL }, { NULL, 0 } }; void SyslogEvent::set_sl_severity(const string& s) { members.tally(&sl_severity, "sl_severity"); sl_severity = nvp_lookup(s, sl_severity_nvp, "sl_severity"); } void SyslogEvent::set_refcode(const string& s) { members.tally(&refcode, "refcode"); refcode = s; } static struct NameValuePair priority_nvp[] = { { "H", 'H' }, { "M", 'M' }, { "A", 'A' }, { "B", 'B' }, { "C", 'C' }, { "L", 'L' }, { NULL, '\0' } }; void SyslogEvent::set_priority(const string& s) { members.tally(&priority, "priority"); priority = (char) nvp_lookup(s, priority_nvp, "priority"); } void SyslogEvent::verify_complete(void) { if (!exception_msg) { members.require(&description, "description"); members.require(&action, "action"); members.require(&err_class, "class"); if ((err_type && sl_severity) || (!err_type && !sl_severity)) { parser->semantic_error("You must specify either " "type or sl_severity, but not both."); } } vector::iterator it; for (it = match_variants.begin(); it != match_variants.end(); it++) { if ((*it)->regex_text.empty()) parser->semantic_error("Catalog doesn't provide regex" " for this message (reporter " + (*it)->reporter_alias->name + ") and it can't be computed."); } } void SyslogEvent::set_regex(const string& rpt, const string& rgxtxt) { vector::iterator it; for (it = match_variants.begin(); it != match_variants.end(); it++) { if ((*it)->reporter_alias->name == rpt) { (*it)->set_regex(rgxtxt); return; } } parser->semantic_error("regex statement: reporter " + rpt + + " is not associated with this message."); } /* * If msg matches the regular expression of one of the events's MatchVariants, * set this->matched_variant to that MatchVariant, and return a pointer to it. * If get_prefix_args is true, also populate msg->prefix_args. Return NULL, * and set this->matched_variant=NULL, if no match. */ MatchVariant * SyslogEvent::match(SyslogMessage *msg, bool get_prefix_args) { matched_variant = NULL; assert(msg); if (!msg->parsed) return NULL; if (msg->from_kernel != from_kernel) return NULL; vector::iterator it; for (it = match_variants.begin(); it < match_variants.end(); it++) { if ((*it)->match(msg, get_prefix_args)) { matched_variant = *it; break; } } return matched_variant; } int SyslogEvent::get_severity(void) { if (matched_variant) return matched_variant->severity; if (match_variants.size() > 0) { MatchVariant *first = match_variants.front(); return first->severity; } return LOG_SEV_UNKNOWN; } /* * Called by SyslogEvent::match() to test this variant. */ bool MatchVariant::match(SyslogMessage *msg, bool get_prefix_args) { bool result; size_t nr_prefix_args, nmatch; regmatch_t *pmatch; Reporter *reporter = reporter_alias->reporter; if (get_prefix_args && reporter->prefix_args) { nr_prefix_args = reporter->prefix_args->size(); nmatch = nr_prefix_args + 1; pmatch = new regmatch_t[nmatch]; } else { nr_prefix_args = 0; nmatch = 0; pmatch = NULL; } result = regexec(®ex, msg->message.c_str(), nmatch, pmatch, 0); if (result != 0) { if (pmatch) delete[] pmatch; return 0; } if (nr_prefix_args > 0) { unsigned int i; for (i = 0; i < nr_prefix_args; i++) { /* pmatch[0] matches the whole line. */ regmatch_t *subex = &pmatch[i+1]; string arg_name = reporter->prefix_args->at(i); msg->prefix_args[arg_name] = msg->message.substr(subex->rm_so, subex->rm_eo - subex->rm_so); } delete[] pmatch; if (!parent->driver->message_passes_filters(msg)) { /* Message is from a different driver, perhaps. */ msg->prefix_args.clear(); return 0; } } return 1; } MatchVariant::MatchVariant(ReporterAlias *ra, int msg_severity, SyslogEvent *pa) { assert(pa); assert(ra); parent = pa; reporter_alias = ra; severity = resolve_severity(msg_severity); if (regex_text_policy != RGXTXT_READ) { compute_regex_text(); compile_regex(); if (catalog_copy) { string regex_stmt = "regex " + ra->name + " \"" + add_escapes(regex_text) + "\"\n"; catalog_copy->inject_text(regex_stmt, cur_parser->lineno); } } } void MatchVariant::set_regex(const string& rgxtxt) { if (regex_text_policy == RGXTXT_READ) { regex_text = rgxtxt; compile_regex(); } else if (regex_text_policy == RGXTXT_WRITE) { static bool reported = false; if (!reported) { cur_parser->semantic_error("Adding regex statements " "to file that already has them."); reported = true; } } } void MatchVariant::report(ostream& os, bool sole_variant) { string indent; if (sole_variant) { indent = ""; } else { // Need to distinguish this variant from the others. os << "variant: " << reporter_alias->name << endl; indent = " "; } os << indent << "regex_text: " << regex_text << endl; os << indent << "severity: " << severity_name(severity) << endl; } ostream& operator<<(ostream& os, const SyslogEvent& e) { os << "message: " << e.reporter_name << " \"" << e.escaped_format << "\"" << endl; bool sole_variant = (e.match_variants.size() == 1); vector::const_iterator it; for (it = e.match_variants.begin(); it < e.match_variants.end(); it++) (*it)->report(os, sole_variant); os << "subsystem: " << e.driver->subsystem << endl; if (e.source_file) os << "file: " << "\"" << *(e.source_file) << "\"" << endl; if (e.exception_msg) { os << "exception: " << e.exception_msg->type << endl; return os; } os << "description {{" << endl; os << e.description << endl << "}}" << endl; os << "action {{" << endl; os << e.action << endl << "}}" << endl; os << "class: " << nvp_lookup_value(e.err_class, class_nvp) << endl; if (e.err_type) os << "type: " << nvp_lookup_value(e.err_type, type_nvp) << endl; else os << "sl_severity: " << nvp_lookup_value(e.sl_severity, sl_severity_nvp) << endl; if (e.priority != '\0') os << "priority: " << e.priority << endl; os << "refcode: \"" << e.refcode << "\"" << endl; return os; } MessageFilter::MessageFilter(const string& name, int op, const string& value) { if (op != '=') cur_parser->semantic_error("filter op must be '='"); arg_name = name; arg_value = value; } /* * If msg has a prefix arg named arg_name (e.g., reporter), then that * arg's value must be arg_value to pass the filter. */ bool MessageFilter::message_passes_filter(SyslogMessage *msg) { map::iterator it = msg->prefix_args.find(arg_name); return (it == msg->prefix_args.end() || it->second == arg_value); } EventCtlgFile::EventCtlgFile(const string& path, const string& subsys) { pathname = path; subsystem = subsys; cur_source_file = NULL; size_t last_slash = pathname.rfind("/"); if (last_slash == string::npos) name = pathname; else name = pathname.substr(last_slash+1); } void EventCtlgFile::add_text_copy(const string& name, const string& text) { if (find_text_copy(name) != "") cur_parser->semantic_error("duplicate name for text copy: " + name); else text_copies[name] = text; } string EventCtlgFile::find_text_copy(const string& name) { map::iterator it = text_copies.find(name); if (it == text_copies.end()) return ""; return it->second; } DevspecMacro * EventCtlgFile::find_devspec(const string& name) { map::iterator it = devspec_macros.find(name); if (it == devspec_macros.end()) return NULL; return it->second; } void EventCtlgFile::add_devspec(const string& nm, const string& path) { DevspecMacro *dm = new DevspecMacro(nm, path); if (!dm->valid) delete dm; else if (find_devspec(nm)) { cur_parser->semantic_error("duplicate devspec entry for " + nm); delete dm; } else devspec_macros[nm] = dm; } void EventCtlgFile::add_filter(MessageFilter *filter) { filters.push_back(filter); } bool EventCtlgFile::message_passes_filters(SyslogMessage *msg) { vector::iterator it; for (it = filters.begin(); it != filters.end(); it++) { if (!(*it)->message_passes_filter(msg)) return false; } return true; } void EventCtlgFile::set_source_file(const string& path) { cur_source_file = new string(path); source_files.push_back(cur_source_file); } DevspecMacro::DevspecMacro(const string& nm, const string& path) { valid = false; name = nm; string embedded_name = "/$" + nm + "/"; size_t pos1 = path.find(embedded_name); if (pos1 == string::npos) { cur_parser->semantic_error("could not find $" + nm + " component of " + path); return; } size_t pos2 = path.rfind("/devspec"); if (pos2 == string::npos || pos2+strlen("/devspec") != path.length()) { cur_parser->semantic_error("devspec is not final component of " + path); return; } prefix = path.substr(0, pos1 + 1); suffix = path.substr(pos1 + embedded_name.length() - 1); valid = true; } string DevspecMacro::get_devspec_path(const string& device_id) { if (!valid) return ""; return prefix + device_id + suffix; } /* * Parse all the catalog files in the specified directory, populating * reporter_catalog, exceptions catalog, and event_catalog. */ int EventCatalog::parse(const string& directory) { string path; string dir_w_regex, event_ctlg_dir; int result; DIR *d; struct dirent *dent; path = directory + "/reporters"; result = reporter_ctlg_parser.parse_file(path); if (result != 0) return result; path = directory + "/exceptions"; result = event_ctlg_parser.parse_file(path); if (result != 0) return result; dir_w_regex = directory + "/with_regex"; if (regex_text_policy == RGXTXT_READ) event_ctlg_dir = dir_w_regex; else event_ctlg_dir = directory; d = opendir(event_ctlg_dir.c_str()); if (!d) { perror(event_ctlg_dir.c_str()); return -1; } while ((dent = readdir(d)) != NULL) { string name = dent->d_name; if (name == "reporters" || name == "exceptions") continue; path = event_ctlg_dir + "/" + name; /* Skip directories and such. */ struct stat st; if (stat(path.c_str(), &st) != 0) { perror(path.c_str()); continue; } if (!S_ISREG(st.st_mode)) continue; if (regex_text_policy == RGXTXT_WRITE) { /* * As we parse this catalog, emit a copy of it that * adds a regex statement for each computed regex. * We assume that dir_w_regex has been created and * has appropriate permissions. */ catalog_copy = new CatalogCopy(path, dir_w_regex + "/" + name); result |= event_ctlg_parser.parse_file(path); catalog_copy->finish_copy(); delete catalog_copy; catalog_copy = NULL; } else result |= event_ctlg_parser.parse_file(path); } (void) closedir(d); return result; } void EventCatalog::register_driver(EventCtlgFile *driver) { if (driver) drivers.push_back(driver); } void EventCatalog::register_event(SyslogEvent *event) { if (event) { events.push_back(event); event->verify_complete(); } } // regex to match "[%5lu.%06lu] ", as used by printk() static const char *printk_timestamp_regex_text = // "^\\[[ ]{0,4}[0-9]{1,}\\.[0]{0,5}[0-9]{1,}] "; "^\\[[ ]{0,4}[0-9]{1,}\\.[0-9]{6}] "; static regex_t printk_timestamp_regex; static bool printk_timestamp_regex_computed = false; static void compute_printk_timestamp_regex(void) { int result = regcomp(&printk_timestamp_regex, printk_timestamp_regex_text, REG_EXTENDED | REG_NOSUB | REG_NEWLINE); if (result != 0) { char reason[100]; (void) regerror(result, &printk_timestamp_regex, reason, 100); fprintf(stderr, "Internal error: can't compile regular " "expression for printk timestamp:\n%s\n", reason); exit(2); } printk_timestamp_regex_computed = true; } /* * If the message begins with what looks like a timestamp emitted by printk() * under the CONFIG_PRINTK_TIME option, skip past that. Return a pointer to * where the message seems to start. */ static const char* skip_printk_timestamp(const char *msg) { if (!printk_timestamp_regex_computed) compute_printk_timestamp_regex(); if (msg[0] == '[' && regexec(&printk_timestamp_regex, msg, 0, NULL, 0) == 0) { msg = strstr(msg, "] "); assert(msg); msg += 2; } return msg; } SyslogMessage::SyslogMessage(const string& s) { line = s; parsed = false; char *s2 = strdup(s.c_str()); assert(s2); char *saveptr = NULL; char *date_end, *host, *prefix, *colon_space, *final_nul; /* Zap newline, if any. */ char *nl = strchr(s2, '\n'); if (nl) { if (strcmp(nl, "\n") != 0) { fprintf(stderr, "multi-line string passed to " "SyslogMessage constructor\n"); goto done; } *nl = '\0'; } final_nul = s2 + strlen(s2); /* ": " should divide the prefix from the message. */ colon_space = strstr(s2, ": "); if (!colon_space) { /* * Could be a line like * "Sep 21 11:56:10 myhost last message repeated 3 times" * which we currently ignore. */ goto done; } /* Assume the date is the first 3 words, and the hostname is the 4th. */ date = parse_syslog_date(s2, &date_end); if (!date) goto done; host = strtok_r(date_end, " ", &saveptr); if (!host) goto done; hostname = host; /* * Careful here. If the message is not from the kernel, the prefix * could be multiple words -- e.g., gconfd messages. */ prefix = strtok_r(NULL, " ", &saveptr); if (!prefix || prefix > colon_space) goto done; if (!strcmp(prefix, "kernel:")) { from_kernel = true; message = skip_printk_timestamp(colon_space + 2); } else { /* * For non-kernel messages, the message includes the prefix. * So the last strtok_r() call probably replaced a space with * a null character in our message. Fix that. */ from_kernel = false; char *nul = prefix + strlen(prefix); if (nul < final_nul) *nul = ' '; message = prefix; } parsed = true; done: free(s2); } string SyslogMessage::echo(void) { char cdate[32]; struct tm tm; (void) localtime_r(&date, &tm); (void) strftime(cdate, 32, "%b %d %T", &tm); string sdate(cdate); if (from_kernel) return sdate + " " + hostname + " kernel: " + message; else return sdate + " " + hostname + " " + message; } /* * Compute the path to the /sys/.../devspec node for the device (if any) * specified in this message. We assume that this message has been * matched to the specified event. Returns 0 if this->devspec_path is * successfully set, or -1 otherwise. */ int SyslogMessage::set_devspec_path(SyslogEvent *event) { EventCtlgFile *driver; if (!event) return -1; driver = event->driver; if (!driver || driver->devspec_macros.size() == 0) return -1; if (prefix_args.size() == 0) return -1; /* * Iterate through the driver's devspec macros, trying to find * a prefix arg in this message that will plug in. Use the * first match we find. */ map::iterator it; for (it = driver->devspec_macros.begin(); it != driver->devspec_macros.end(); it++) { string name = it->first; map::iterator arg = prefix_args.find(name); if (arg != prefix_args.end()) { DevspecMacro *dm = it->second; devspec_path = dm->get_devspec_path(arg->second); return 0; } } return -1; } /* Get the device ID from the (matched) message. */ string SyslogMessage::get_device_id(MatchVariant *mv) { if (!mv) return ""; Reporter *reporter = mv->reporter_alias->reporter; if (reporter->device_arg == "none") return ""; return prefix_args[reporter->device_arg]; } CatalogCopy::CatalogCopy(const string& rd_path, const string& wr_path) { valid = false; orig_file = NULL; copy_file = NULL; orig_path = rd_path; copy_path = wr_path; orig_file = fopen(orig_path.c_str(), "r"); if (!orig_file) { fprintf(stderr, "can't open catalog file\n"); perror(orig_path.c_str()); return; } copy_file = fopen(copy_path.c_str(), "w"); if (!copy_file) { fprintf(stderr, "can't open new catalog file\n"); perror(copy_path.c_str()); return; } last_line_copied = 0; valid = true; } /* * Copy lines from orig_file to copy_file 'til we've copied through * line line_nr in orig_file. Returns 0 if all lines copied, EOF * otherwise. A negative line_nr says copy through EOF (and return EOF). */ int CatalogCopy::copy_through(int line_nr) { int copied; char buf[1024]; // Longer lines are OK. if (line_nr < 0) line_nr = 1000*1000; copied = last_line_copied; while (copied < line_nr && fgets(buf, 1024, orig_file)) { fputs(buf, copy_file); if (strchr(buf, '\n')) copied++; } last_line_copied = copied; return (last_line_copied == line_nr ? 0 : EOF); } /* * Copy through line line_nr in orig_file, then append text, which is * assumed to end in a newline, if appropriate. */ void CatalogCopy::inject_text(const string& text, int line_nr) { if (!valid) return; if (copy_through(line_nr) == EOF) { fprintf(stderr, "%s truncated at line %d\n", orig_path.c_str(), last_line_copied); valid = false; } fputs(text.c_str(), copy_file); } void CatalogCopy::finish_copy(void) { if (valid) (void) copy_through(-1); } CatalogCopy::~CatalogCopy() { if (orig_file) fclose(orig_file); if (copy_file) fclose(copy_file); } string indent_text_block(const string& s1, size_t nspaces) { if (nspaces == 0) return s1; string s2 = s1; size_t pos = 0, skip_nl = 0; do { s2.insert(pos + skip_nl, nspaces, ' '); pos += nspaces + skip_nl; skip_nl = 1; } while ((pos = s2.find_first_of('\n', pos)) != string::npos); return s2; } ppc64-diag-2.7.4/ela/date.c0000644000000000000000000000651313135275400012100 00000000000000#define _XOPEN_SOURCE #include #include #include #include typedef enum { false, true } bool; static int cur_year = 0; // year - 1900 static time_t end_of_cur_year; // January 1 00:00:00 of next year /* Called at beginning of time and each time a new year begins. */ static void compute_cur_year(time_t now) { struct tm tm; localtime_r(&now, &tm); cur_year = tm.tm_year; tm.tm_mon = 0; tm.tm_mday = 1; tm.tm_year++; tm.tm_hour = 0; tm.tm_min = 0; tm.tm_sec = 0; tm.tm_isdst = -1; end_of_cur_year = mktime(&tm); } /* * Call strptime() to parse the date string starting at start, according * to fmt. * * The year defaults to either this year or last year -- whatever will * yield a date in the preceding 12 months. If yr_in_fmt == true, * it's assumed that fmt will provide the year, and that'll be used * instead of the default. * * If end isn't NULL, *end is set pointing to the next character after * the parsed date string. Returns the date as a time_t. * * If the string can't be parsed according to fmt, *end is unchanged * and 0 is returned. */ time_t parse_date(const char *start, char **end, const char *fmt, bool yr_in_fmt) { struct tm tm; time_t now, date; char *date_end; if (!yr_in_fmt) { now = time(NULL); if (!cur_year || difftime(now, end_of_cur_year) >= 0) compute_cur_year(now); } memset(&tm, 0, sizeof(tm)); tm.tm_isdst = -1; tm.tm_year = cur_year; date_end = strptime(start, fmt, &tm); if (date_end == NULL) return (time_t) 0; if (tm.tm_year < 69) { /* year < 1969. Mistook hour for year? */ return (time_t) 0; } date = mktime(&tm); if (date == -1) return (time_t) 0; if (!yr_in_fmt && difftime(date, now) > 0) { /* Date is in future. Assume it's from last year. */ tm.tm_isdst = -1; tm.tm_year--; date = mktime(&tm); } if (end) *end = date_end; return date; } time_t parse_syslog_date(const char *start, char **end) { return parse_date(start, end, "%b %d %T", false); } struct date_fmt { const char *fmt; bool has_year; }; /* Order is important: try longest match first. */ static struct date_fmt day_fmts[] = { { "%b %d %Y", true }, // Jan 15 2010 { "%b %d", false }, { "%Y-%m-%d", true }, // 2010-1-15 { "%d %b %Y", true }, // 15 Jan 2010 { "%d %b", false }, { NULL, false } }; static struct date_fmt time_fmts[] = { { "%T %Y", true }, { "%T", false }, { "%H:%M %Y", true }, { "%H:%M", false }, { "", false }, { NULL, false } }; /* * Parse the date and time pointed to by start, trying all valid * combinations of date and time formats from the above lists. * See parse_date() for more semantics. */ time_t parse_syslogish_date(const char *start, char **end) { time_t t; struct date_fmt *day, *time; char fmt[100]; for (day = day_fmts; day->fmt; day++) { for (time = time_fmts; time->fmt; time++) { if (day->has_year && time->has_year) continue; (void) strcpy(fmt, day->fmt); if (time->fmt[0] != '\0') { (void) strcat(fmt, " "); (void) strcat(fmt, time->fmt); } t = parse_date(start, end, fmt, (day->has_year || time->has_year)); if (t) return t; } } return 0; } #ifdef TEST main() { time_t t; char line[100]; while (fgets(line, 100, stdin)) { t = parse_syslogish_date(line, NULL); if (!t) printf("no match\n"); else printf("%s", ctime(&t)); } exit(0); } #endif /* TEST */ ppc64-diag-2.7.4/ela/ev.tab.h0000644000000000000000000000144413135275552012355 00000000000000#define KW_ACTION 257 #define KW_CLASS 258 #define KW_COPY 259 #define KW_DESCRIPTION 260 #define KW_DEVSPEC 261 #define KW_EXCEPTION 262 #define KW_FILE 263 #define KW_FILTER 264 #define KW_MESSAGE 265 #define KW_PRIORITY 266 #define KW_REFCODE 267 #define KW_REGEX 268 #define KW_SL_SEVERITY 269 #define KW_SUBSYSTEM 270 #define KW_TYPE 271 #define TK_STRING 272 #define TK_NAME 273 #define TK_TEXTBLOCK 274 #define ERRTOK 275 #ifdef YYSTYPE #undef YYSTYPE_IS_DECLARED #define YYSTYPE_IS_DECLARED 1 #endif #ifndef YYSTYPE_IS_DECLARED #define YYSTYPE_IS_DECLARED 1 typedef union { int ival; /* keyword, punctuation */ char *sval; /* string, name, text block */ SyslogEvent *event; EventCtlgFile *driver; MessageFilter *filter; } YYSTYPE; #endif /* !YYSTYPE_IS_DECLARED */ extern YYSTYPE evlval; ppc64-diag-2.7.4/ela/rr.tab.h0000644000000000000000000000127213135275552012365 00000000000000#define KW_ALIASES 257 #define KW_META_REPORTER 258 #define KW_PREFIX_ARGS 259 #define KW_PREFIX_FORMAT 260 #define KW_REPORTER 261 #define KW_SOURCE 262 #define KW_VARIANTS 263 #define KW_DEVICE_ARG 264 #define TK_STRING 265 #define TK_NAME 266 #define ERRTOK 267 #ifdef YYSTYPE #undef YYSTYPE_IS_DECLARED #define YYSTYPE_IS_DECLARED 1 #endif #ifndef YYSTYPE_IS_DECLARED #define YYSTYPE_IS_DECLARED 1 typedef union { int ival; /* keyword, punctuation */ char *sval; /* string, name */ Reporter *reporter; MetaReporter *meta_reporter; vector *name_list; ReporterAlias *alias; vector *alias_list; } YYSTYPE; #endif /* !YYSTYPE_IS_DECLARED */ extern YYSTYPE rrlval; ppc64-diag-2.7.4/ela/ev.tab.cc0000644000000000000000000006215713135275552012523 00000000000000#ifndef lint static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; #endif #define YYBYACC 1 #define YYMAJOR 1 #define YYMINOR 9 #define YYPATCH 20130304 #define YYEMPTY (-1) #define yyclearin (yychar = YYEMPTY) #define yyerrok (yyerrflag = 0) #define YYRECOVERING() (yyerrflag != 0) #ifndef yyparse #define yyparse evparse #endif /* yyparse */ #ifndef yylex #define yylex evlex #endif /* yylex */ #ifndef yyerror #define yyerror everror #endif /* yyerror */ #ifndef yychar #define yychar evchar #endif /* yychar */ #ifndef yyval #define yyval evval #endif /* yyval */ #ifndef yylval #define yylval evlval #endif /* yylval */ #ifndef yydebug #define yydebug evdebug #endif /* yydebug */ #ifndef yynerrs #define yynerrs evnerrs #endif /* yynerrs */ #ifndef yyerrflag #define yyerrflag everrflag #endif /* yyerrflag */ #ifndef yylhs #define yylhs evlhs #endif /* yylhs */ #ifndef yylen #define yylen evlen #endif /* yylen */ #ifndef yydefred #define yydefred evdefred #endif /* yydefred */ #ifndef yydgoto #define yydgoto evdgoto #endif /* yydgoto */ #ifndef yysindex #define yysindex evsindex #endif /* yysindex */ #ifndef yyrindex #define yyrindex evrindex #endif /* yyrindex */ #ifndef yygindex #define yygindex evgindex #endif /* yygindex */ #ifndef yytable #define yytable evtable #endif /* yytable */ #ifndef yycheck #define yycheck evcheck #endif /* yycheck */ #ifndef yyname #define yyname evname #endif /* yyname */ #ifndef yyrule #define yyrule evrule #endif /* yyrule */ #define YYPREFIX "ev" #define YYPURE 0 /* * Grammars for events catalog and exceptions catalog * * Copyright (C) International Business Machines Corp., 2009 * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #define CATALOGS_IMPLEMENTATION #include #include "catalogs.h" extern EventCtlgParser event_ctlg_parser; static EventCtlgParser *pc = &event_ctlg_parser; extern EventCatalog event_catalog; static SyslogEvent *event; static EventCtlgFile *driver; extern ExceptionCatalog exception_catalog; /* Why doesn't yacc declare this? */ extern int yylex(void); void yyerror(const char *s); #ifdef YYSTYPE #undef YYSTYPE_IS_DECLARED #define YYSTYPE_IS_DECLARED 1 #endif #ifndef YYSTYPE_IS_DECLARED #define YYSTYPE_IS_DECLARED 1 typedef union { int ival; /* keyword, punctuation */ char *sval; /* string, name, text block */ SyslogEvent *event; EventCtlgFile *driver; MessageFilter *filter; } YYSTYPE; #endif /* !YYSTYPE_IS_DECLARED */ /* compatibility with bison */ #ifdef YYPARSE_PARAM /* compatibility with FreeBSD */ # ifdef YYPARSE_PARAM_TYPE # define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM) # else # define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM) # endif #else # define YYPARSE_DECL() yyparse(void) #endif /* Parameters sent to lex. */ #ifdef YYLEX_PARAM # define YYLEX_DECL() yylex(void *YYLEX_PARAM) # define YYLEX yylex(YYLEX_PARAM) #else # define YYLEX_DECL() yylex(void) # define YYLEX yylex() #endif /* Parameters sent to yyerror. */ #ifndef YYERROR_DECL #define YYERROR_DECL() yyerror(const char *s) #endif #ifndef YYERROR_CALL #define YYERROR_CALL(msg) yyerror(msg) #endif extern int YYPARSE_DECL(); #define KW_ACTION 257 #define KW_CLASS 258 #define KW_COPY 259 #define KW_DESCRIPTION 260 #define KW_DEVSPEC 261 #define KW_EXCEPTION 262 #define KW_FILE 263 #define KW_FILTER 264 #define KW_MESSAGE 265 #define KW_PRIORITY 266 #define KW_REFCODE 267 #define KW_REGEX 268 #define KW_SL_SEVERITY 269 #define KW_SUBSYSTEM 270 #define KW_TYPE 271 #define TK_STRING 272 #define TK_NAME 273 #define TK_TEXTBLOCK 274 #define ERRTOK 275 #define YYERRCODE 256 static const short evlhs[] = { -1, 0, 0, 1, 3, 5, 14, 14, 15, 15, 16, 16, 16, 17, 18, 19, 6, 13, 13, 20, 20, 21, 7, 7, 7, 8, 8, 22, 22, 24, 24, 25, 23, 23, 9, 9, 26, 26, 27, 27, 27, 27, 27, 27, 27, 12, 10, 11, 28, 29, 30, 31, 32, 2, 2, 4, }; static const short evlen[] = { 2, 1, 1, 2, 2, 3, 1, 0, 1, 2, 1, 1, 1, 4, 6, 3, 3, 1, 2, 1, 1, 3, 3, 2, 1, 4, 5, 1, 0, 1, 2, 3, 1, 1, 7, 8, 1, 2, 1, 1, 1, 1, 1, 1, 1, 3, 2, 2, 3, 3, 3, 3, 3, 1, 2, 3, }; static const short evdefred[] = { 0, 0, 0, 0, 1, 0, 0, 53, 0, 0, 0, 0, 54, 24, 0, 0, 19, 0, 0, 0, 17, 20, 0, 0, 0, 4, 0, 8, 10, 11, 12, 0, 0, 45, 5, 0, 0, 0, 0, 0, 0, 29, 23, 18, 0, 0, 0, 9, 46, 0, 55, 21, 0, 0, 0, 0, 0, 0, 0, 0, 38, 39, 33, 22, 0, 36, 40, 41, 42, 43, 44, 30, 0, 0, 15, 0, 47, 25, 0, 0, 31, 0, 0, 0, 0, 0, 37, 0, 0, 13, 26, 0, 48, 51, 52, 50, 49, 0, 16, 0, 14, 34, 0, 35, }; static const short evdgoto[] = { 3, 4, 5, 6, 7, 8, 74, 16, 17, 18, 60, 61, 9, 19, 25, 26, 27, 28, 29, 30, 20, 21, 39, 63, 40, 41, 64, 65, 66, 67, 68, 69, 70, }; static const short evsindex[] = { -259, -50, -48, 0, 0, -250, -233, 0, -64, -245, -252, -246, 0, 0, -20, -56, 0, -226, -226, -233, 0, 0, 4, -7, -205, 0, -64, 0, 0, 0, 0, -219, -201, 0, 0, -215, -214, -213, -212, -253, -226, 0, 0, 0, -211, -210, -209, 0, 0, -208, 0, 0, -247, -35, -207, 9, 10, 11, 12, 13, 0, 0, 0, 0, -221, 0, 0, 0, 0, 0, 0, 0, 31, 14, 0, -200, 0, 0, -199, 18, 0, -196, -195, -193, -192, -191, 0, 19, -189, 0, 0, -188, 0, 0, 0, 0, 0, -186, 0, -220, 0, 0, -185, 0, }; static const short evrindex[] = { 0, 0, 0, 0, 0, 84, 0, 0, -222, 0, 0, 0, 0, 0, 0, 0, 0, -238, 6, 88, 0, 0, 0, 0, 0, 0, -216, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; static const short evgindex[] = { 0, 0, 0, 0, 85, 0, 0, 0, 0, 0, 80, 59, 53, 0, 0, 0, 67, 0, 0, 0, 75, 0, 77, 0, 0, 56, 0, 33, 0, 0, 0, 0, 0, }; #define YYTABLESIZE 282 static const short evtable[] = { 24, 27, 36, 1, 49, 55, 28, 31, 10, 1, 11, 2, 1, 56, 57, 31, 58, 32, 59, 28, 28, 33, 28, 13, 28, 77, 78, 34, 28, 28, 14, 28, 15, 28, 7, 37, 49, 55, 35, 31, 6, 7, 38, 7, 44, 56, 57, 6, 58, 6, 59, 45, 101, 102, 46, 48, 49, 51, 79, 52, 53, 54, 72, 73, 75, 80, 76, 81, 82, 83, 84, 85, 87, 90, 89, 88, 91, 92, 93, 94, 97, 95, 96, 98, 2, 99, 100, 103, 3, 32, 12, 50, 62, 47, 43, 42, 71, 86, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 27, 27, 0, 27, 28, 27, 27, 0, 27, 27, 27, 28, 27, 28, 27, 32, 0, 0, 0, 0, 0, 0, 32, 0, 32, }; static const short evcheck[] = { 64, 0, 58, 262, 257, 258, 0, 260, 58, 262, 58, 270, 262, 266, 267, 260, 269, 0, 271, 257, 258, 273, 260, 256, 262, 272, 273, 273, 266, 267, 263, 269, 265, 271, 256, 91, 257, 258, 58, 260, 256, 263, 268, 265, 40, 266, 267, 263, 269, 265, 271, 58, 272, 273, 259, 274, 257, 272, 93, 273, 273, 273, 273, 273, 273, 272, 274, 58, 58, 58, 58, 58, 41, 272, 274, 61, 58, 273, 273, 272, 61, 273, 273, 272, 0, 273, 272, 272, 0, 9, 5, 32, 39, 26, 19, 18, 40, 64, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 261, -1, -1, 264, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 256, 257, 258, -1, 260, 256, 262, 263, -1, 265, 266, 267, 263, 269, 265, 271, 256, -1, -1, -1, -1, -1, -1, 263, -1, 265, }; #define YYFINAL 3 #ifndef YYDEBUG #define YYDEBUG 0 #endif #define YYMAXTOKEN 275 #if YYDEBUG static const char *yyname[] = { "end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,"'('","')'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"':'",0,0,"'='",0,0, "'@'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'['",0,"']'",0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, "KW_ACTION","KW_CLASS","KW_COPY","KW_DESCRIPTION","KW_DEVSPEC","KW_EXCEPTION", "KW_FILE","KW_FILTER","KW_MESSAGE","KW_PRIORITY","KW_REFCODE","KW_REGEX", "KW_SL_SEVERITY","KW_SUBSYSTEM","KW_TYPE","TK_STRING","TK_NAME","TK_TEXTBLOCK", "ERRTOK", }; static const char *yyrule[] = { "$accept : catalog_file", "catalog_file : driver_file", "catalog_file : exceptions_file", "driver_file : header entries", "header : subsystem_stmt optional_header_stmts", "subsystem_stmt : KW_SUBSYSTEM ':' TK_NAME", "optional_header_stmts : header_stmts", "optional_header_stmts :", "header_stmts : header_stmt", "header_stmts : header_stmts header_stmt", "header_stmt : copy", "header_stmt : devspec_stmt", "header_stmt : filter_stmt", "copy : '@' KW_COPY TK_NAME TK_TEXTBLOCK", "devspec_stmt : KW_DEVSPEC '(' TK_NAME ')' '=' TK_STRING", "filter_stmt : KW_FILTER ':' filter_expr", "filter_expr : TK_NAME '=' TK_STRING", "entries : entry_or_file", "entries : entries entry_or_file", "entry_or_file : entry", "entry_or_file : file_stmt", "file_stmt : KW_FILE ':' TK_STRING", "entry : message_stmt optional_regex_stmts explanation", "entry : message_exception_stmt optional_regex_stmts", "entry : error", "message_stmt : KW_MESSAGE ':' TK_NAME TK_STRING", "message_stmt : KW_MESSAGE ':' TK_NAME TK_NAME TK_STRING", "optional_regex_stmts : regex_stmts", "optional_regex_stmts :", "regex_stmts : regex_stmt", "regex_stmts : regex_stmts regex_stmt", "regex_stmt : KW_REGEX TK_NAME TK_STRING", "explanation : addl_stmts", "explanation : exception_stmt", "message_exception_stmt : KW_MESSAGE '[' TK_NAME ']' ':' TK_NAME TK_STRING", "message_exception_stmt : KW_MESSAGE '[' TK_NAME ']' ':' TK_NAME TK_NAME TK_STRING", "addl_stmts : addl_stmt", "addl_stmts : addl_stmts addl_stmt", "addl_stmt : description_stmt", "addl_stmt : action_stmt", "addl_stmt : class_stmt", "addl_stmt : type_stmt", "addl_stmt : sl_severity_stmt", "addl_stmt : priority_stmt", "addl_stmt : refcode_stmt", "exception_stmt : KW_EXCEPTION ':' TK_NAME", "description_stmt : KW_DESCRIPTION TK_TEXTBLOCK", "action_stmt : KW_ACTION TK_TEXTBLOCK", "class_stmt : KW_CLASS ':' TK_NAME", "type_stmt : KW_TYPE ':' TK_NAME", "sl_severity_stmt : KW_SL_SEVERITY ':' TK_NAME", "priority_stmt : KW_PRIORITY ':' TK_NAME", "refcode_stmt : KW_REFCODE ':' TK_STRING", "exceptions_file : exception", "exceptions_file : exceptions_file exception", "exception : exception_stmt description_stmt action_stmt", }; #endif int yydebug; int yynerrs; int yyerrflag; int yychar; YYSTYPE yyval; YYSTYPE yylval; /* define the initial stack-sizes */ #ifdef YYSTACKSIZE #undef YYMAXDEPTH #define YYMAXDEPTH YYSTACKSIZE #else #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else #define YYSTACKSIZE 10000 #define YYMAXDEPTH 500 #endif #endif #define YYINITSTACKSIZE 500 typedef struct { unsigned stacksize; short *s_base; short *s_mark; short *s_last; YYSTYPE *l_base; YYSTYPE *l_mark; } YYSTACKDATA; /* variables for the parser stack */ static YYSTACKDATA yystack; /* AKA everror() */ void yyerror(const char *s) { fprintf(stderr, "%s:%d: %s\n", pc->pathname, pc->lineno, s); } #if YYDEBUG #include /* needed for printf */ #endif #include /* needed for malloc, etc */ #include /* needed for memset */ /* allocate initial stack or double stack size, up to YYMAXDEPTH */ static int yygrowstack(YYSTACKDATA *data) { int i; unsigned newsize; short *newss; YYSTYPE *newvs; if ((newsize = data->stacksize) == 0) newsize = YYINITSTACKSIZE; else if (newsize >= YYMAXDEPTH) return -1; else if ((newsize *= 2) > YYMAXDEPTH) newsize = YYMAXDEPTH; i = (int) (data->s_mark - data->s_base); newss = (short *)realloc(data->s_base, newsize * sizeof(*newss)); if (newss == 0) return -1; data->s_base = newss; data->s_mark = newss + i; newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); if (newvs == 0) return -1; data->l_base = newvs; data->l_mark = newvs + i; data->stacksize = newsize; data->s_last = data->s_base + newsize - 1; return 0; } #if YYPURE || defined(YY_NO_LEAKS) static void yyfreestack(YYSTACKDATA *data) { free(data->s_base); free(data->l_base); memset(data, 0, sizeof(*data)); } #else #define yyfreestack(data) /* nothing */ #endif #define YYABORT goto yyabort #define YYREJECT goto yyabort #define YYACCEPT goto yyaccept #define YYERROR goto yyerrlab int YYPARSE_DECL() { int yym, yyn, yystate; #if YYDEBUG const char *yys; if ((yys = getenv("YYDEBUG")) != 0) { yyn = *yys; if (yyn >= '0' && yyn <= '9') yydebug = yyn - '0'; } #endif yynerrs = 0; yyerrflag = 0; yychar = YYEMPTY; yystate = 0; #if YYPURE memset(&yystack, 0, sizeof(yystack)); #endif if (yystack.s_base == NULL && yygrowstack(&yystack)) goto yyoverflow; yystack.s_mark = yystack.s_base; yystack.l_mark = yystack.l_base; yystate = 0; *yystack.s_mark = 0; yyloop: if ((yyn = yydefred[yystate]) != 0) goto yyreduce; if (yychar < 0) { if ((yychar = YYLEX) < 0) yychar = 0; #if YYDEBUG if (yydebug) { yys = 0; if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; if (!yys) yys = "illegal-symbol"; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, yystate, yychar, yys); } #endif } if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && yyn <= YYTABLESIZE && yycheck[yyn] == yychar) { #if YYDEBUG if (yydebug) printf("%sdebug: state %d, shifting to state %d\n", YYPREFIX, yystate, yytable[yyn]); #endif if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) { goto yyoverflow; } yystate = yytable[yyn]; *++yystack.s_mark = yytable[yyn]; *++yystack.l_mark = yylval; yychar = YYEMPTY; if (yyerrflag > 0) --yyerrflag; goto yyloop; } if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && yyn <= YYTABLESIZE && yycheck[yyn] == yychar) { yyn = yytable[yyn]; goto yyreduce; } if (yyerrflag) goto yyinrecovery; yyerror("syntax error"); goto yyerrlab; yyerrlab: ++yynerrs; yyinrecovery: if (yyerrflag < 3) { yyerrflag = 3; for (;;) { if ((yyn = yysindex[*yystack.s_mark]) && (yyn += YYERRCODE) >= 0 && yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) { #if YYDEBUG if (yydebug) printf("%sdebug: state %d, error recovery shifting\ to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]); #endif if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) { goto yyoverflow; } yystate = yytable[yyn]; *++yystack.s_mark = yytable[yyn]; *++yystack.l_mark = yylval; goto yyloop; } else { #if YYDEBUG if (yydebug) printf("%sdebug: error recovery discarding state %d\n", YYPREFIX, *yystack.s_mark); #endif if (yystack.s_mark <= yystack.s_base) goto yyabort; --yystack.s_mark; --yystack.l_mark; } } } else { if (yychar == 0) goto yyabort; #if YYDEBUG if (yydebug) { yys = 0; if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; if (!yys) yys = "illegal-symbol"; printf("%sdebug: state %d, error recovery discards token %d (%s)\n", YYPREFIX, yystate, yychar, yys); } #endif yychar = YYEMPTY; goto yyloop; } yyreduce: #if YYDEBUG if (yydebug) printf("%sdebug: state %d, reducing by rule %d (%s)\n", YYPREFIX, yystate, yyn, yyrule[yyn]); #endif yym = yylen[yyn]; if (yym) yyval = yystack.l_mark[1-yym]; else memset(&yyval, 0, sizeof yyval); switch (yyn) { case 4: { event_catalog.register_driver(yystack.l_mark[-1].driver); yyval.ival = 0; /* avoid yacc warning */ } break; case 5: { driver = new EventCtlgFile(pc->pathname, yystack.l_mark[0].sval); yyval.driver = driver; free(yystack.l_mark[0].sval); } break; case 13: { driver->add_text_copy(yystack.l_mark[-1].sval, yystack.l_mark[0].sval); free(yystack.l_mark[-1].sval); free(yystack.l_mark[0].sval); } break; case 14: { driver->add_devspec(yystack.l_mark[-3].sval, yystack.l_mark[0].sval); free(yystack.l_mark[-3].sval); free(yystack.l_mark[0].sval); } break; case 15: { driver->add_filter(yystack.l_mark[0].filter); } break; case 16: { yyval.filter = new MessageFilter(yystack.l_mark[-2].sval, '=', yystack.l_mark[0].sval); free(yystack.l_mark[-2].sval); free(yystack.l_mark[0].sval); } break; case 19: { event_catalog.register_event(yystack.l_mark[0].event); } break; case 21: { driver->set_source_file(yystack.l_mark[0].sval); free(yystack.l_mark[0].sval); } break; case 22: { yyval.event = yystack.l_mark[-2].event; } break; case 24: { yyval.event = NULL; } break; case 25: { event = new SyslogEvent(yystack.l_mark[-1].sval, "", yystack.l_mark[0].sval, driver); yyval.event = event; free(yystack.l_mark[-1].sval); free(yystack.l_mark[0].sval); } break; case 26: { event = new SyslogEvent(yystack.l_mark[-2].sval, yystack.l_mark[-1].sval, yystack.l_mark[0].sval, driver); yyval.event = event; free(yystack.l_mark[-2].sval); free(yystack.l_mark[-1].sval); free(yystack.l_mark[0].sval); } break; case 31: { event->set_regex(yystack.l_mark[-1].sval, yystack.l_mark[0].sval); free(yystack.l_mark[-1].sval); free(yystack.l_mark[0].sval); } break; case 33: { event->except(yystack.l_mark[0].sval); free(yystack.l_mark[0].sval); } break; case 34: { event = new SyslogEvent(yystack.l_mark[-1].sval, "", yystack.l_mark[0].sval, driver); yyval.event = event; event->except(yystack.l_mark[-4].sval); free(yystack.l_mark[-4].sval); free(yystack.l_mark[-1].sval); free(yystack.l_mark[0].sval); } break; case 35: { event = new SyslogEvent(yystack.l_mark[-2].sval, yystack.l_mark[-1].sval, yystack.l_mark[0].sval, driver); yyval.event = event; event->except(yystack.l_mark[-5].sval); free(yystack.l_mark[-5].sval); free(yystack.l_mark[-2].sval); free(yystack.l_mark[-1].sval); free(yystack.l_mark[0].sval); } break; case 38: { event->set_description(yystack.l_mark[0].sval); free(yystack.l_mark[0].sval); /* $$ = 0;*/ } break; case 39: { event->set_action(yystack.l_mark[0].sval); free(yystack.l_mark[0].sval); /* $$ = 0;*/ } break; case 45: { yyval.sval = yystack.l_mark[0].sval; } break; case 46: { yyval.sval = yystack.l_mark[0].sval; } break; case 47: { yyval.sval = yystack.l_mark[0].sval; } break; case 48: { event->set_class(yystack.l_mark[0].sval); free(yystack.l_mark[0].sval); } break; case 49: { event->set_type(yystack.l_mark[0].sval); free(yystack.l_mark[0].sval); } break; case 50: { event->set_sl_severity(yystack.l_mark[0].sval); free(yystack.l_mark[0].sval); } break; case 51: { event->set_priority(yystack.l_mark[0].sval); free(yystack.l_mark[0].sval); } break; case 52: { event->set_refcode(yystack.l_mark[0].sval); free(yystack.l_mark[0].sval); } break; case 55: { exception_catalog.add(pc, yystack.l_mark[-2].sval, yystack.l_mark[-1].sval, yystack.l_mark[0].sval); free(yystack.l_mark[-2].sval); free(yystack.l_mark[-1].sval); free(yystack.l_mark[0].sval); yyval.ival = 0; } break; } yystack.s_mark -= yym; yystate = *yystack.s_mark; yystack.l_mark -= yym; yym = yylhs[yyn]; if (yystate == 0 && yym == 0) { #if YYDEBUG if (yydebug) printf("%sdebug: after reduction, shifting from state 0 to\ state %d\n", YYPREFIX, YYFINAL); #endif yystate = YYFINAL; *++yystack.s_mark = YYFINAL; *++yystack.l_mark = yyval; if (yychar < 0) { if ((yychar = YYLEX) < 0) yychar = 0; #if YYDEBUG if (yydebug) { yys = 0; if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; if (!yys) yys = "illegal-symbol"; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, YYFINAL, yychar, yys); } #endif } if (yychar == 0) goto yyaccept; goto yyloop; } if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && yyn <= YYTABLESIZE && yycheck[yyn] == yystate) yystate = yytable[yyn]; else yystate = yydgoto[yym]; #if YYDEBUG if (yydebug) printf("%sdebug: after reduction, shifting from state %d \ to state %d\n", YYPREFIX, *yystack.s_mark, yystate); #endif if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) { goto yyoverflow; } *++yystack.s_mark = (short) yystate; *++yystack.l_mark = yyval; goto yyloop; yyoverflow: yyerror("yacc stack overflow"); yyabort: yyfreestack(&yystack); return (1); yyaccept: yyfreestack(&yystack); return (0); } ppc64-diag-2.7.4/ela/rr.tab.cc0000644000000000000000000005155713135275552012536 00000000000000#ifndef lint static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; #endif #define YYBYACC 1 #define YYMAJOR 1 #define YYMINOR 9 #define YYPATCH 20130304 #define YYEMPTY (-1) #define yyclearin (yychar = YYEMPTY) #define yyerrok (yyerrflag = 0) #define YYRECOVERING() (yyerrflag != 0) #ifndef yyparse #define yyparse rrparse #endif /* yyparse */ #ifndef yylex #define yylex rrlex #endif /* yylex */ #ifndef yyerror #define yyerror rrerror #endif /* yyerror */ #ifndef yychar #define yychar rrchar #endif /* yychar */ #ifndef yyval #define yyval rrval #endif /* yyval */ #ifndef yylval #define yylval rrlval #endif /* yylval */ #ifndef yydebug #define yydebug rrdebug #endif /* yydebug */ #ifndef yynerrs #define yynerrs rrnerrs #endif /* yynerrs */ #ifndef yyerrflag #define yyerrflag rrerrflag #endif /* yyerrflag */ #ifndef yylhs #define yylhs rrlhs #endif /* yylhs */ #ifndef yylen #define yylen rrlen #endif /* yylen */ #ifndef yydefred #define yydefred rrdefred #endif /* yydefred */ #ifndef yydgoto #define yydgoto rrdgoto #endif /* yydgoto */ #ifndef yysindex #define yysindex rrsindex #endif /* yysindex */ #ifndef yyrindex #define yyrindex rrrindex #endif /* yyrindex */ #ifndef yygindex #define yygindex rrgindex #endif /* yygindex */ #ifndef yytable #define yytable rrtable #endif /* yytable */ #ifndef yycheck #define yycheck rrcheck #endif /* yycheck */ #ifndef yyname #define yyname rrname #endif /* yyname */ #ifndef yyrule #define yyrule rrrule #endif /* yyrule */ #define YYPREFIX "rr" #define YYPURE 0 /* * Grammar for reporters catalog * * Copyright (C) International Business Machines Corp., 2009 * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #define CATALOGS_IMPLEMENTATION #include #include "catalogs.h" extern ReporterCtlgParser reporter_ctlg_parser; static ReporterCtlgParser *pc = &reporter_ctlg_parser; extern ReporterCatalog reporter_catalog; static Reporter *reporter; static MetaReporter *meta_reporter; static vector *name_list; static vector *alias_list; /* Why doesn't yacc declare this? */ extern int yylex(void); void yyerror(const char *s); #ifdef YYSTYPE #undef YYSTYPE_IS_DECLARED #define YYSTYPE_IS_DECLARED 1 #endif #ifndef YYSTYPE_IS_DECLARED #define YYSTYPE_IS_DECLARED 1 typedef union { int ival; /* keyword, punctuation */ char *sval; /* string, name */ Reporter *reporter; MetaReporter *meta_reporter; vector *name_list; ReporterAlias *alias; vector *alias_list; } YYSTYPE; #endif /* !YYSTYPE_IS_DECLARED */ /* compatibility with bison */ #ifdef YYPARSE_PARAM /* compatibility with FreeBSD */ # ifdef YYPARSE_PARAM_TYPE # define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM) # else # define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM) # endif #else # define YYPARSE_DECL() yyparse(void) #endif /* Parameters sent to lex. */ #ifdef YYLEX_PARAM # define YYLEX_DECL() yylex(void *YYLEX_PARAM) # define YYLEX yylex(YYLEX_PARAM) #else # define YYLEX_DECL() yylex(void) # define YYLEX yylex() #endif /* Parameters sent to yyerror. */ #ifndef YYERROR_DECL #define YYERROR_DECL() yyerror(const char *s) #endif #ifndef YYERROR_CALL #define YYERROR_CALL(msg) yyerror(msg) #endif extern int YYPARSE_DECL(); #define KW_ALIASES 257 #define KW_META_REPORTER 258 #define KW_PREFIX_ARGS 259 #define KW_PREFIX_FORMAT 260 #define KW_REPORTER 261 #define KW_SOURCE 262 #define KW_VARIANTS 263 #define KW_DEVICE_ARG 264 #define TK_STRING 265 #define TK_NAME 266 #define ERRTOK 267 #define YYERRCODE 256 static const short rrlhs[] = { -1, 0, 0, 9, 9, 9, 1, 3, 4, 14, 2, 5, 6, 6, 7, 7, 8, 8, 10, 10, 11, 11, 12, 12, 13, 13, }; static const short rrlen[] = { 2, 1, 2, 1, 1, 1, 6, 2, 3, 3, 3, 3, 1, 2, 1, 4, 1, 2, 3, 0, 3, 0, 3, 0, 3, 0, }; static const short rrdefred[] = { 0, 5, 0, 0, 0, 3, 0, 4, 0, 1, 0, 0, 2, 0, 0, 0, 7, 8, 0, 10, 0, 0, 0, 0, 0, 11, 0, 0, 0, 12, 0, 0, 16, 0, 0, 0, 0, 13, 15, 17, 20, 0, 0, 6, 0, 0, 24, }; static const short rrdgoto[] = { 4, 5, 6, 7, 8, 14, 30, 19, 33, 9, 22, 28, 36, 43, 16, }; static const short rrsindex[] = { -253, 0, -56, -54, -253, 0, -256, 0, -254, 0, -255, -252, 0, -46, -244, -43, 0, 0, -24, 0, -248, -39, -240, -245, -243, 0, -252, -36, -234, 0, -239, -15, 0, -252, -236, -28, -233, 0, 0, 0, 0, -245, -25, 0, -239, -232, 0, }; static const short rrrindex[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 1, 0, 0, 0, 24, 0, 0, 0, 0, 0, 28, 0, 39, 0, 0, 17, 0, 0, 45, 0, 0, 0, 0, 0, 0, 0, 35, 0, 0, }; static const short rrgindex[] = { 0, 0, 0, 0, 0, 0, -9, -26, 0, 32, 0, 0, 0, 0, 0, }; #define YYTABLESIZE 306 static const short rrtable[] = { 32, 14, 10, 1, 11, 2, 13, 39, 3, 15, 19, 17, 20, 21, 18, 23, 24, 18, 25, 26, 27, 29, 34, 31, 21, 35, 38, 37, 23, 40, 41, 42, 44, 45, 46, 22, 12, 0, 0, 9, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 14, 14, 14, 14, 14, 0, 14, 19, 14, 19, 19, 19, 19, 0, 18, 19, 18, 18, 18, 18, 0, 21, 18, 21, 21, 23, 21, 23, 0, 21, 23, 0, 22, 23, 22, 0, 9, 22, 9, 0, 22, 9, 25, 0, 25, 0, 0, 25, }; static const short rrcheck[] = { 26, 0, 58, 256, 58, 258, 262, 33, 261, 263, 0, 266, 58, 257, 266, 58, 40, 0, 266, 58, 260, 266, 58, 266, 0, 259, 41, 266, 0, 265, 58, 264, 41, 58, 266, 0, 4, -1, -1, 0, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 256, -1, 258, 259, 260, 261, 262, -1, 264, 256, 266, 258, 259, 260, 261, -1, 256, 264, 258, 259, 260, 261, -1, 256, 264, 258, 259, 256, 261, 258, -1, 264, 261, -1, 256, 264, 258, -1, 256, 261, 258, -1, 264, 261, 256, -1, 258, -1, -1, 261, }; #define YYFINAL 4 #ifndef YYDEBUG #define YYDEBUG 0 #endif #define YYMAXTOKEN 267 #if YYDEBUG static const char *yyname[] = { "end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,"'('","')'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"':'",0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"KW_ALIASES", "KW_META_REPORTER","KW_PREFIX_ARGS","KW_PREFIX_FORMAT","KW_REPORTER", "KW_SOURCE","KW_VARIANTS","KW_DEVICE_ARG","TK_STRING","TK_NAME","ERRTOK", }; static const char *yyrule[] = { "$accept : catalog", "catalog : entry", "catalog : catalog entry", "entry : reporter_entry", "entry : meta_reporter_entry", "entry : error", "reporter_entry : reporter_stmt source_stmt aliases_stmt prefix_format_stmt prefix_args_stmt device_arg_stmt", "meta_reporter_entry : meta_reporter_stmt variants_stmt", "meta_reporter_stmt : KW_META_REPORTER ':' TK_NAME", "variants_stmt : KW_VARIANTS ':' name_list", "reporter_stmt : KW_REPORTER ':' name_and_lvl", "source_stmt : KW_SOURCE ':' TK_NAME", "name_list : TK_NAME", "name_list : name_list TK_NAME", "name_and_lvl : TK_NAME", "name_and_lvl : TK_NAME '(' TK_NAME ')'", "alias_list : name_and_lvl", "alias_list : alias_list name_and_lvl", "aliases_stmt : KW_ALIASES ':' alias_list", "aliases_stmt :", "prefix_format_stmt : KW_PREFIX_FORMAT ':' TK_STRING", "prefix_format_stmt :", "prefix_args_stmt : KW_PREFIX_ARGS ':' name_list", "prefix_args_stmt :", "device_arg_stmt : KW_DEVICE_ARG ':' TK_NAME", "device_arg_stmt :", }; #endif int yydebug; int yynerrs; int yyerrflag; int yychar; YYSTYPE yyval; YYSTYPE yylval; /* define the initial stack-sizes */ #ifdef YYSTACKSIZE #undef YYMAXDEPTH #define YYMAXDEPTH YYSTACKSIZE #else #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else #define YYSTACKSIZE 10000 #define YYMAXDEPTH 500 #endif #endif #define YYINITSTACKSIZE 500 typedef struct { unsigned stacksize; short *s_base; short *s_mark; short *s_last; YYSTYPE *l_base; YYSTYPE *l_mark; } YYSTACKDATA; /* variables for the parser stack */ static YYSTACKDATA yystack; /* AKA rrerror() */ void yyerror(const char *s) { fprintf(stderr, "%s:%d: %s\n", pc->pathname, pc->lineno, s); } #if YYDEBUG #include /* needed for printf */ #endif #include /* needed for malloc, etc */ #include /* needed for memset */ /* allocate initial stack or double stack size, up to YYMAXDEPTH */ static int yygrowstack(YYSTACKDATA *data) { int i; unsigned newsize; short *newss; YYSTYPE *newvs; if ((newsize = data->stacksize) == 0) newsize = YYINITSTACKSIZE; else if (newsize >= YYMAXDEPTH) return -1; else if ((newsize *= 2) > YYMAXDEPTH) newsize = YYMAXDEPTH; i = (int) (data->s_mark - data->s_base); newss = (short *)realloc(data->s_base, newsize * sizeof(*newss)); if (newss == 0) return -1; data->s_base = newss; data->s_mark = newss + i; newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); if (newvs == 0) return -1; data->l_base = newvs; data->l_mark = newvs + i; data->stacksize = newsize; data->s_last = data->s_base + newsize - 1; return 0; } #if YYPURE || defined(YY_NO_LEAKS) static void yyfreestack(YYSTACKDATA *data) { free(data->s_base); free(data->l_base); memset(data, 0, sizeof(*data)); } #else #define yyfreestack(data) /* nothing */ #endif #define YYABORT goto yyabort #define YYREJECT goto yyabort #define YYACCEPT goto yyaccept #define YYERROR goto yyerrlab int YYPARSE_DECL() { int yym, yyn, yystate; #if YYDEBUG const char *yys; if ((yys = getenv("YYDEBUG")) != 0) { yyn = *yys; if (yyn >= '0' && yyn <= '9') yydebug = yyn - '0'; } #endif yynerrs = 0; yyerrflag = 0; yychar = YYEMPTY; yystate = 0; #if YYPURE memset(&yystack, 0, sizeof(yystack)); #endif if (yystack.s_base == NULL && yygrowstack(&yystack)) goto yyoverflow; yystack.s_mark = yystack.s_base; yystack.l_mark = yystack.l_base; yystate = 0; *yystack.s_mark = 0; yyloop: if ((yyn = yydefred[yystate]) != 0) goto yyreduce; if (yychar < 0) { if ((yychar = YYLEX) < 0) yychar = 0; #if YYDEBUG if (yydebug) { yys = 0; if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; if (!yys) yys = "illegal-symbol"; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, yystate, yychar, yys); } #endif } if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && yyn <= YYTABLESIZE && yycheck[yyn] == yychar) { #if YYDEBUG if (yydebug) printf("%sdebug: state %d, shifting to state %d\n", YYPREFIX, yystate, yytable[yyn]); #endif if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) { goto yyoverflow; } yystate = yytable[yyn]; *++yystack.s_mark = yytable[yyn]; *++yystack.l_mark = yylval; yychar = YYEMPTY; if (yyerrflag > 0) --yyerrflag; goto yyloop; } if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && yyn <= YYTABLESIZE && yycheck[yyn] == yychar) { yyn = yytable[yyn]; goto yyreduce; } if (yyerrflag) goto yyinrecovery; yyerror("syntax error"); goto yyerrlab; yyerrlab: ++yynerrs; yyinrecovery: if (yyerrflag < 3) { yyerrflag = 3; for (;;) { if ((yyn = yysindex[*yystack.s_mark]) && (yyn += YYERRCODE) >= 0 && yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) { #if YYDEBUG if (yydebug) printf("%sdebug: state %d, error recovery shifting\ to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]); #endif if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) { goto yyoverflow; } yystate = yytable[yyn]; *++yystack.s_mark = yytable[yyn]; *++yystack.l_mark = yylval; goto yyloop; } else { #if YYDEBUG if (yydebug) printf("%sdebug: error recovery discarding state %d\n", YYPREFIX, *yystack.s_mark); #endif if (yystack.s_mark <= yystack.s_base) goto yyabort; --yystack.s_mark; --yystack.l_mark; } } } else { if (yychar == 0) goto yyabort; #if YYDEBUG if (yydebug) { yys = 0; if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; if (!yys) yys = "illegal-symbol"; printf("%sdebug: state %d, error recovery discards token %d (%s)\n", YYPREFIX, yystate, yychar, yys); } #endif yychar = YYEMPTY; goto yyloop; } yyreduce: #if YYDEBUG if (yydebug) printf("%sdebug: state %d, reducing by rule %d (%s)\n", YYPREFIX, yystate, yyn, yyrule[yyn]); #endif yym = yylen[yyn]; if (yym) yyval = yystack.l_mark[1-yym]; else memset(&yyval, 0, sizeof yyval); switch (yyn) { case 3: { reporter_catalog.register_reporter(yystack.l_mark[0].reporter); } break; case 4: { reporter_catalog.register_meta_reporter(yystack.l_mark[0].meta_reporter); } break; case 6: { yyval.reporter = yystack.l_mark[-5].reporter; } break; case 7: { yyval.meta_reporter = yystack.l_mark[-1].meta_reporter; } break; case 8: { meta_reporter = new MetaReporter(yystack.l_mark[0].sval); free(yystack.l_mark[0].sval); yyval.meta_reporter = meta_reporter; } break; case 9: { meta_reporter->set_variant_names(yystack.l_mark[0].name_list); } break; case 10: { reporter = new Reporter(yystack.l_mark[0].alias); yyval.reporter = reporter; } break; case 11: { reporter->set_source(yystack.l_mark[0].sval); free(yystack.l_mark[0].sval); } break; case 12: { name_list = new vector(); name_list->push_back(yystack.l_mark[0].sval); yyval.name_list = name_list; free(yystack.l_mark[0].sval); } break; case 13: { name_list->push_back(yystack.l_mark[0].sval); yyval.name_list = name_list; free(yystack.l_mark[0].sval); } break; case 14: { yyval.alias = new ReporterAlias(yystack.l_mark[0].sval); free(yystack.l_mark[0].sval); } break; case 15: { yyval.alias = new ReporterAlias(yystack.l_mark[-3].sval, yystack.l_mark[-1].sval); free(yystack.l_mark[-3].sval); free(yystack.l_mark[-1].sval); } break; case 16: { alias_list = new vector(); alias_list->push_back(yystack.l_mark[0].alias); yyval.alias_list = alias_list; } break; case 17: { alias_list->push_back(yystack.l_mark[0].alias); yyval.alias_list = alias_list; } break; case 18: { reporter->set_aliases(yystack.l_mark[0].alias_list); } break; case 20: { reporter->set_prefix_format(yystack.l_mark[0].sval); free(yystack.l_mark[0].sval); } break; case 22: { reporter->set_prefix_args(yystack.l_mark[0].name_list); } break; case 24: { reporter->set_device_arg(yystack.l_mark[0].sval); free(yystack.l_mark[0].sval); } break; } yystack.s_mark -= yym; yystate = *yystack.s_mark; yystack.l_mark -= yym; yym = yylhs[yyn]; if (yystate == 0 && yym == 0) { #if YYDEBUG if (yydebug) printf("%sdebug: after reduction, shifting from state 0 to\ state %d\n", YYPREFIX, YYFINAL); #endif yystate = YYFINAL; *++yystack.s_mark = YYFINAL; *++yystack.l_mark = yyval; if (yychar < 0) { if ((yychar = YYLEX) < 0) yychar = 0; #if YYDEBUG if (yydebug) { yys = 0; if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; if (!yys) yys = "illegal-symbol"; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, YYFINAL, yychar, yys); } #endif } if (yychar == 0) goto yyaccept; goto yyloop; } if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && yyn <= YYTABLESIZE && yycheck[yyn] == yystate) yystate = yytable[yyn]; else yystate = yydgoto[yym]; #if YYDEBUG if (yydebug) printf("%sdebug: after reduction, shifting from state %d \ to state %d\n", YYPREFIX, *yystack.s_mark, yystate); #endif if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) { goto yyoverflow; } *++yystack.s_mark = (short) yystate; *++yystack.l_mark = yyval; goto yyloop; yyoverflow: yyerror("yacc stack overflow"); yyabort: yyfreestack(&yystack); return (1); yyaccept: yyfreestack(&yystack); return (0); } ppc64-diag-2.7.4/ela/lex.rr.cc0000644000000000000000000014170713135275552012555 00000000000000 #line 3 "lex.rr.c" #define YY_INT_ALIGNED short int /* A lexical scanner generated by flex */ #define yy_create_buffer rr_create_buffer #define yy_delete_buffer rr_delete_buffer #define yy_flex_debug rr_flex_debug #define yy_init_buffer rr_init_buffer #define yy_flush_buffer rr_flush_buffer #define yy_load_buffer_state rr_load_buffer_state #define yy_switch_to_buffer rr_switch_to_buffer #define yyin rrin #define yyleng rrleng #define yylex rrlex #define yylineno rrlineno #define yyout rrout #define yyrestart rrrestart #define yytext rrtext #define yywrap rrwrap #define yyalloc rralloc #define yyrealloc rrrealloc #define yyfree rrfree #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 #define YY_FLEX_SUBMINOR_VERSION 37 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ #include #include #include #include /* end standard C headers. */ /* flex integer type definitions */ #ifndef FLEXINT_H #define FLEXINT_H /* C99 systems have . Non-C99 systems may or may not. */ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 #endif #include typedef int8_t flex_int8_t; typedef uint8_t flex_uint8_t; typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; /* Limits of integral types. */ #ifndef INT8_MIN #define INT8_MIN (-128) #endif #ifndef INT16_MIN #define INT16_MIN (-32767-1) #endif #ifndef INT32_MIN #define INT32_MIN (-2147483647-1) #endif #ifndef INT8_MAX #define INT8_MAX (127) #endif #ifndef INT16_MAX #define INT16_MAX (32767) #endif #ifndef INT32_MAX #define INT32_MAX (2147483647) #endif #ifndef UINT8_MAX #define UINT8_MAX (255U) #endif #ifndef UINT16_MAX #define UINT16_MAX (65535U) #endif #ifndef UINT32_MAX #define UINT32_MAX (4294967295U) #endif #endif /* ! C99 */ #endif /* ! FLEXINT_H */ #ifdef __cplusplus /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST #else /* ! __cplusplus */ /* C99 requires __STDC__ to be defined as 1. */ #if defined (__STDC__) #define YY_USE_CONST #endif /* defined (__STDC__) */ #endif /* ! __cplusplus */ #ifdef YY_USE_CONST #define yyconst const #else #define yyconst #endif /* Returned upon end-of-file. */ #define YY_NULL 0 /* Promotes a possibly negative, possibly signed char to an unsigned * integer for use as an array index. If the signed char is negative, * we want to instead treat it as an 8-bit unsigned char, hence the * double cast. */ #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN (yy_start) = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define YY_NEW_FILE rrrestart(rrin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #ifndef YY_BUF_SIZE #define YY_BUF_SIZE 16384 #endif /* The state buf must be large enough to hold one state per character in the main buffer. */ #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T typedef size_t yy_size_t; #endif extern yy_size_t rrleng; extern FILE *rrin, *rrout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 #define YY_LESS_LINENO(n) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up rrtext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ *yy_cp = (yy_hold_char); \ YY_RESTORE_YY_MORE_OFFSET \ (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up rrtext again */ \ } \ while ( 0 ) #define unput(c) yyunput( c, (yytext_ptr) ) #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state { FILE *yy_input_file; char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ yy_size_t yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ yy_size_t yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int yy_is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int yy_is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int yy_at_bol; int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as YY_EOF_PENDING, to indicate that we * shouldn't try reading from the input source any more. We might * still have a bunch of tokens to match, though, because of * possible backing-up. * * When we actually see the EOF, we change the status to "new" * (via rrrestart()), so that the user can continue scanning by * just pointing rrin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". * * Returns the top of the stack, or NULL. */ #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ : NULL) /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] /* yy_hold_char holds the character lost when rrtext is formed. */ static char yy_hold_char; static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ yy_size_t rrleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ /* Flag which is used to allow rrwrap()'s to do buffer switches * instead of setting up a fresh rrin. A bit of a hack ... */ static int yy_did_buffer_switch_on_eof; void rrrestart (FILE *input_file ); void rr_switch_to_buffer (YY_BUFFER_STATE new_buffer ); YY_BUFFER_STATE rr_create_buffer (FILE *file,int size ); void rr_delete_buffer (YY_BUFFER_STATE b ); void rr_flush_buffer (YY_BUFFER_STATE b ); void rrpush_buffer_state (YY_BUFFER_STATE new_buffer ); void rrpop_buffer_state (void ); static void rrensure_buffer_stack (void ); static void rr_load_buffer_state (void ); static void rr_init_buffer (YY_BUFFER_STATE b,FILE *file ); #define YY_FLUSH_BUFFER rr_flush_buffer(YY_CURRENT_BUFFER ) YY_BUFFER_STATE rr_scan_buffer (char *base,yy_size_t size ); YY_BUFFER_STATE rr_scan_string (yyconst char *yy_str ); YY_BUFFER_STATE rr_scan_bytes (yyconst char *bytes,yy_size_t len ); void *rralloc (yy_size_t ); void *rrrealloc (void *,yy_size_t ); void rrfree (void * ); #define yy_new_buffer rr_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ rrensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ rr_create_buffer(rrin,YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ rrensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ rr_create_buffer(rrin,YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ #define rrwrap() 1 #define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; FILE *rrin = (FILE *) 0, *rrout = (FILE *) 0; typedef int yy_state_type; extern int rrlineno; int rrlineno = 1; extern char *rrtext; #define yytext_ptr rrtext static yy_state_type yy_get_previous_state (void ); static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); static int yy_get_next_buffer (void ); static void yy_fatal_error (yyconst char msg[] ); /* Done after the current pattern has been matched and before the * corresponding action - sets up rrtext. */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ rrleng = (size_t) (yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; #define YY_NUM_RULES 15 #define YY_END_OF_BUFFER 16 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info { flex_int32_t yy_verify; flex_int32_t yy_nxt; }; static yyconst flex_int16_t yy_accept[82] = { 0, 0, 0, 16, 14, 11, 12, 10, 14, 9, 9, 9, 9, 9, 9, 9, 9, 13, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 7, 9, 1, 9, 9, 9, 9, 9, 9, 9, 9, 9, 6, 8, 9, 9, 9, 9, 2, 9, 9, 9, 9, 4, 9, 9, 9, 3, 5, 0 } ; static yyconst flex_int32_t yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 4, 1, 1, 1, 1, 1, 1, 1, 5, 1, 1, 1, 1, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 1, 1, 1, 1, 1, 1, 1, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 1, 1, 1, 1, 9, 1, 10, 8, 11, 12, 13, 14, 15, 8, 16, 8, 8, 17, 18, 19, 20, 21, 8, 22, 23, 24, 25, 26, 8, 27, 8, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; static yyconst flex_int32_t yy_meta[28] = { 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 } ; static yyconst flex_int16_t yy_base[83] = { 0, 0, 0, 92, 93, 93, 93, 93, 86, 0, 73, 76, 75, 65, 73, 65, 74, 93, 0, 67, 56, 57, 67, 58, 53, 55, 66, 59, 64, 59, 52, 49, 54, 46, 57, 58, 50, 43, 53, 53, 49, 48, 38, 32, 34, 44, 37, 32, 45, 40, 43, 38, 0, 26, 0, 39, 27, 18, 25, 23, 23, 24, 21, 22, 0, 0, 26, 18, 24, 16, 0, 13, 13, 17, 21, 0, 23, 9, 6, 0, 0, 93, 27 } ; static yyconst flex_int16_t yy_def[83] = { 0, 81, 1, 81, 81, 81, 81, 81, 81, 82, 82, 82, 82, 82, 82, 82, 82, 81, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 0, 81 } ; static yyconst flex_int16_t yy_nxt[121] = { 0, 4, 5, 6, 7, 4, 8, 4, 9, 9, 10, 9, 11, 9, 9, 9, 9, 9, 12, 9, 9, 13, 14, 15, 9, 9, 16, 9, 62, 18, 80, 79, 63, 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, 68, 67, 66, 65, 64, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 17, 81, 3, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81 } ; static yyconst flex_int16_t yy_chk[121] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 57, 82, 78, 77, 57, 76, 74, 73, 72, 71, 69, 68, 67, 66, 63, 62, 61, 60, 59, 58, 56, 55, 53, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 16, 15, 14, 13, 12, 11, 10, 8, 3, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81 } ; static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; extern int rr_flex_debug; int rr_flex_debug = 0; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. */ #define REJECT reject_used_but_not_detected #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *rrtext; #line 1 "ela/reporter_lex.l" #line 2 "ela/reporter_lex.l" /* * Tokenizer for reporters catalog * * Copyright (C) International Business Machines Corp., 2009, 2010 * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #define CATALOGS_IMPLEMENTATION #include "catalogs.h" #include "rr.tab.h" #include #include extern ReporterCtlgParser reporter_ctlg_parser; static ReporterCtlgParser *pc = &reporter_ctlg_parser; #line 552 "lex.rr.c" #define INITIAL 0 #ifndef YY_NO_UNISTD_H /* Special case for "unistd.h", since it is non-ANSI. We include it way * down here because we want the user's section 1 to have been scanned first. * The user has a chance to override it with an option. */ #include #endif #ifndef YY_EXTRA_TYPE #define YY_EXTRA_TYPE void * #endif static int yy_init_globals (void ); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ int rrlex_destroy (void ); int rrget_debug (void ); void rrset_debug (int debug_flag ); YY_EXTRA_TYPE rrget_extra (void ); void rrset_extra (YY_EXTRA_TYPE user_defined ); FILE *rrget_in (void ); void rrset_in (FILE * in_str ); FILE *rrget_out (void ); void rrset_out (FILE * out_str ); yy_size_t rrget_leng (void ); char *rrget_text (void ); int rrget_lineno (void ); void rrset_lineno (int line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus extern "C" int rrwrap (void ); #else extern int rrwrap (void ); #endif #endif static void yyunput (int c,char *buf_ptr ); #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ); #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * ); #endif #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void ); #else static int input (void ); #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #define YY_READ_BUF_SIZE 8192 #endif /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define ECHO do { if (fwrite( rrtext, rrleng, 1, rrout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ size_t n; \ for ( n = 0; n < max_size && \ (c = getc( rrin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ if ( c == EOF && ferror( rrin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else \ { \ errno=0; \ while ( (result = fread(buf, 1, max_size, rrin))==0 && ferror(rrin)) \ { \ if( errno != EINTR) \ { \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ break; \ } \ errno=0; \ clearerr(rrin); \ } \ }\ \ #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */ #ifndef yyterminate #define yyterminate() return YY_NULL #endif /* Number of entries by which start-condition stack grows. */ #ifndef YY_START_STACK_INCR #define YY_START_STACK_INCR 25 #endif /* Report a fatal error. */ #ifndef YY_FATAL_ERROR #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) #endif /* end tables serialization structures and prototypes */ /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL_IS_OURS 1 extern int rrlex (void); #define YY_DECL int rrlex (void) #endif /* !YY_DECL */ /* Code executed at the beginning of each rule, after rrtext and rrleng * have been set up. */ #ifndef YY_USER_ACTION #define YY_USER_ACTION #endif /* Code executed at the end of each rule. */ #ifndef YY_BREAK #define YY_BREAK break; #endif #define YY_RULE_SETUP \ YY_USER_ACTION /** The main scanner function which does all the work. */ YY_DECL { register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; #line 35 "ela/reporter_lex.l" #line 736 "lex.rr.c" if ( !(yy_init) ) { (yy_init) = 1; #ifdef YY_USER_INIT YY_USER_INIT; #endif if ( ! (yy_start) ) (yy_start) = 1; /* first start state */ if ( ! rrin ) rrin = stdin; if ( ! rrout ) rrout = stdout; if ( ! YY_CURRENT_BUFFER ) { rrensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = rr_create_buffer(rrin,YY_BUF_SIZE ); } rr_load_buffer_state( ); } while ( 1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); /* Support of rrtext. */ *yy_cp = (yy_hold_char); /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; yy_current_state = (yy_start); yy_match: do { register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 82 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } while ( yy_base[yy_current_state] != 93 ); yy_find_action: yy_act = yy_accept[yy_current_state]; if ( yy_act == 0 ) { /* have to back up */ yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); yy_act = yy_accept[yy_current_state]; } YY_DO_BEFORE_ACTION; do_action: /* This label is used only to access EOF actions. */ switch ( yy_act ) { /* beginning of action switch */ case 0: /* must back up */ /* undo the effects of YY_DO_BEFORE_ACTION */ *yy_cp = (yy_hold_char); yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); goto yy_find_action; case 1: YY_RULE_SETUP #line 36 "ela/reporter_lex.l" { return KW_ALIASES; } YY_BREAK case 2: YY_RULE_SETUP #line 37 "ela/reporter_lex.l" { return KW_DEVICE_ARG; } YY_BREAK case 3: YY_RULE_SETUP #line 38 "ela/reporter_lex.l" { return KW_META_REPORTER; } YY_BREAK case 4: YY_RULE_SETUP #line 39 "ela/reporter_lex.l" { return KW_PREFIX_ARGS; } YY_BREAK case 5: YY_RULE_SETUP #line 40 "ela/reporter_lex.l" { return KW_PREFIX_FORMAT; } YY_BREAK case 6: YY_RULE_SETUP #line 41 "ela/reporter_lex.l" { return KW_REPORTER; } YY_BREAK case 7: YY_RULE_SETUP #line 42 "ela/reporter_lex.l" { return KW_SOURCE; } YY_BREAK case 8: YY_RULE_SETUP #line 43 "ela/reporter_lex.l" { return KW_VARIANTS; } YY_BREAK case 9: YY_RULE_SETUP #line 45 "ela/reporter_lex.l" { char *name; if (! (name = strdup((const char*)rrtext)) ) { perror("strdup"); return ERRTOK; } rrlval.sval = name; return TK_NAME; } YY_BREAK case 10: YY_RULE_SETUP #line 55 "ela/reporter_lex.l" { char *s = pc->get_string(1); if (!s) return ERRTOK; rrlval.sval = s; return TK_STRING; } YY_BREAK case 11: YY_RULE_SETUP #line 63 "ela/reporter_lex.l" ; /* Skip white space. */ YY_BREAK case 12: /* rule 12 can match eol */ YY_RULE_SETUP #line 65 "ela/reporter_lex.l" { pc->lineno++; } YY_BREAK case 13: YY_RULE_SETUP #line 67 "ela/reporter_lex.l" { if (pc->skip_comment() < 0) return ERRTOK; } YY_BREAK case 14: YY_RULE_SETUP #line 72 "ela/reporter_lex.l" { return rrtext[0]; /* Pass through any other characters. */ } YY_BREAK case 15: YY_RULE_SETUP #line 73 "ela/reporter_lex.l" ECHO; YY_BREAK #line 912 "lex.rr.c" case YY_STATE_EOF(INITIAL): yyterminate(); case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ *yy_cp = (yy_hold_char); YY_RESTORE_YY_MORE_OFFSET if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed rrin at a new source and called * rrlex(). If so, then we have to assure * consistency between YY_CURRENT_BUFFER and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; YY_CURRENT_BUFFER_LVALUE->yy_input_file = rrin; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position * of the first EOB in the buffer, since yy_c_buf_p will * already have been incremented past the NUL character * (since all states make transitions on EOB to the * end-of-buffer state). Contrast this with the test * in input(). */ if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) { /* This was really a NUL. */ yy_state_type yy_next_state; (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * yy_get_previous_state() go ahead and do it * for us because it doesn't know how to deal * with the possibility of jamming (and we don't * want to build jamming into it because then it * will run more slowly). */ yy_next_state = yy_try_NUL_trans( yy_current_state ); yy_bp = (yytext_ptr) + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ yy_cp = ++(yy_c_buf_p); yy_current_state = yy_next_state; goto yy_match; } else { yy_cp = (yy_c_buf_p); goto yy_find_action; } } else switch ( yy_get_next_buffer( ) ) { case EOB_ACT_END_OF_FILE: { (yy_did_buffer_switch_on_eof) = 0; if ( rrwrap( ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up * rrtext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * YY_NULL, it'll still work - another * YY_NULL will get returned. */ (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; } else { if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: (yy_c_buf_p) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_find_action; } break; } default: YY_FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of rrlex */ /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: * EOB_ACT_LAST_MATCH - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ static int yy_get_next_buffer (void) { register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; register char *source = (yytext_ptr); register int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; } } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; else { yy_size_t num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; int yy_c_buf_p_offset = (int) ((yy_c_buf_p) - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { yy_size_t new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; else b->yy_buf_size *= 2; b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ rrrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); } else /* Can't grow it, we don't own it. */ b->yy_ch_buf = 0; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), (yy_n_chars), num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } if ( (yy_n_chars) == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; rrrestart(rrin ); } else { ret_val = EOB_ACT_LAST_MATCH; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) rrrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); } (yy_n_chars) += number_to_move; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ static yy_state_type yy_get_previous_state (void) { register yy_state_type yy_current_state; register char *yy_cp; yy_current_state = (yy_start); for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 82 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; } return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { register int yy_is_jam; register char *yy_cp = (yy_c_buf_p); register YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 82 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 81); return yy_is_jam ? 0 : yy_current_state; } static void yyunput (int c, register char * yy_bp ) { register char *yy_cp; yy_cp = (yy_c_buf_p); /* undo effects of setting up rrtext */ *yy_cp = (yy_hold_char); if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ register yy_size_t number_to_move = (yy_n_chars) + 2; register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; register char *source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) *--dest = *--source; yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); } *--yy_cp = (char) c; (yytext_ptr) = yy_bp; (yy_hold_char) = *yy_cp; (yy_c_buf_p) = yy_cp; } #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) #else static int input (void) #endif { int c; *(yy_c_buf_p) = (yy_hold_char); if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) /* This was really a NUL. */ *(yy_c_buf_p) = '\0'; else { /* need more input */ yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() * sees that we've accumulated a * token and flags that we need to * try matching the token before * proceeding. But for input(), * there's no matching to consider. * So convert the EOB_ACT_LAST_MATCH * to EOB_ACT_END_OF_FILE. */ /* Reset buffer status. */ rrrestart(rrin ); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { if ( rrwrap( ) ) return EOF; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; #ifdef __cplusplus return yyinput(); #else return input(); #endif } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + offset; break; } } } c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ *(yy_c_buf_p) = '\0'; /* preserve rrtext */ (yy_hold_char) = *++(yy_c_buf_p); return c; } #endif /* ifndef YY_NO_INPUT */ /** Immediately switch to a different input stream. * @param input_file A readable stream. * * @note This function does not reset the start condition to @c INITIAL . */ void rrrestart (FILE * input_file ) { if ( ! YY_CURRENT_BUFFER ){ rrensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = rr_create_buffer(rrin,YY_BUF_SIZE ); } rr_init_buffer(YY_CURRENT_BUFFER,input_file ); rr_load_buffer_state( ); } /** Switch to a different input buffer. * @param new_buffer The new input buffer. * */ void rr_switch_to_buffer (YY_BUFFER_STATE new_buffer ) { /* TODO. We should be able to replace this entire function body * with * rrpop_buffer_state(); * rrpush_buffer_state(new_buffer); */ rrensure_buffer_stack (); if ( YY_CURRENT_BUFFER == new_buffer ) return; if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } YY_CURRENT_BUFFER_LVALUE = new_buffer; rr_load_buffer_state( ); /* We don't actually know whether we did this switch during * EOF (rrwrap()) processing, but the only time this flag * is looked at is after rrwrap() is called, so it's safe * to go ahead and always set it. */ (yy_did_buffer_switch_on_eof) = 1; } static void rr_load_buffer_state (void) { (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; rrin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; (yy_hold_char) = *(yy_c_buf_p); } /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. * * @return the allocated buffer state. */ YY_BUFFER_STATE rr_create_buffer (FILE * file, int size ) { YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) rralloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in rr_create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->yy_ch_buf = (char *) rralloc(b->yy_buf_size + 2 ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in rr_create_buffer()" ); b->yy_is_our_buffer = 1; rr_init_buffer(b,file ); return b; } /** Destroy the buffer. * @param b a buffer created with rr_create_buffer() * */ void rr_delete_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) rrfree((void *) b->yy_ch_buf ); rrfree((void *) b ); } /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a rrrestart() or at EOF. */ static void rr_init_buffer (YY_BUFFER_STATE b, FILE * file ) { int oerrno = errno; rr_flush_buffer(b ); b->yy_input_file = file; b->yy_fill_buffer = 1; /* If b is the current buffer, then rr_init_buffer was _probably_ * called from rrrestart() or through yy_get_next_buffer. * In that case, we don't want to reset the lineno or column. */ if (b != YY_CURRENT_BUFFER){ b->yy_bs_lineno = 1; b->yy_bs_column = 0; } b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * */ void rr_flush_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; b->yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes * a transition to the end-of-buffer state. The second causes * a jam in that state. */ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; b->yy_buf_pos = &b->yy_ch_buf[0]; b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) rr_load_buffer_state( ); } /** Pushes the new state onto the stack. The new state becomes * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. * */ void rrpush_buffer_state (YY_BUFFER_STATE new_buffer ) { if (new_buffer == NULL) return; rrensure_buffer_stack(); /* This block is copied from rr_switch_to_buffer. */ if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } /* Only push if top exists. Otherwise, replace top. */ if (YY_CURRENT_BUFFER) (yy_buffer_stack_top)++; YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from rr_switch_to_buffer. */ rr_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. * */ void rrpop_buffer_state (void) { if (!YY_CURRENT_BUFFER) return; rr_delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; if ((yy_buffer_stack_top) > 0) --(yy_buffer_stack_top); if (YY_CURRENT_BUFFER) { rr_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } } /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ static void rrensure_buffer_stack (void) { yy_size_t num_to_alloc; if (!(yy_buffer_stack)) { /* First allocation is just for 2 elements, since we don't know if this * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ num_to_alloc = 1; (yy_buffer_stack) = (struct yy_buffer_state**)rralloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in rrensure_buffer_stack()" ); memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_top) = 0; return; } if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ int grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; (yy_buffer_stack) = (struct yy_buffer_state**)rrrealloc ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in rrensure_buffer_stack()" ); /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; } } /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE rr_scan_buffer (char * base, yy_size_t size ) { YY_BUFFER_STATE b; if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; b = (YY_BUFFER_STATE) rralloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in rr_scan_buffer()" ); b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; b->yy_input_file = 0; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; rr_switch_to_buffer(b ); return b; } /** Setup the input buffer state to scan a string. The next call to rrlex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * rr_scan_bytes() instead. */ YY_BUFFER_STATE rr_scan_string (yyconst char * yystr ) { return rr_scan_bytes(yystr,strlen(yystr) ); } /** Setup the input buffer state to scan the given bytes. The next call to rrlex() will * scan from a @e copy of @a bytes. * @param yybytes the byte buffer to scan * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE rr_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) { YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; buf = (char *) rralloc(n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in rr_scan_bytes()" ); for ( i = 0; i < _yybytes_len; ++i ) buf[i] = yybytes[i]; buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; b = rr_scan_buffer(buf,n ); if ( ! b ) YY_FATAL_ERROR( "bad buffer in rr_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. */ b->yy_is_our_buffer = 1; return b; } #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif static void yy_fatal_error (yyconst char* msg ) { (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ do \ { \ /* Undo effects of setting up rrtext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ rrtext[rrleng] = (yy_hold_char); \ (yy_c_buf_p) = rrtext + yyless_macro_arg; \ (yy_hold_char) = *(yy_c_buf_p); \ *(yy_c_buf_p) = '\0'; \ rrleng = yyless_macro_arg; \ } \ while ( 0 ) /* Accessor methods (get/set functions) to struct members. */ /** Get the current line number. * */ int rrget_lineno (void) { return rrlineno; } /** Get the input stream. * */ FILE *rrget_in (void) { return rrin; } /** Get the output stream. * */ FILE *rrget_out (void) { return rrout; } /** Get the length of the current token. * */ yy_size_t rrget_leng (void) { return rrleng; } /** Get the current token. * */ char *rrget_text (void) { return rrtext; } /** Set the current line number. * @param line_number * */ void rrset_lineno (int line_number ) { rrlineno = line_number; } /** Set the input stream. This does not discard the current * input buffer. * @param in_str A readable stream. * * @see rr_switch_to_buffer */ void rrset_in (FILE * in_str ) { rrin = in_str ; } void rrset_out (FILE * out_str ) { rrout = out_str ; } int rrget_debug (void) { return rr_flex_debug; } void rrset_debug (int bdebug ) { rr_flex_debug = bdebug ; } static int yy_init_globals (void) { /* Initialization is the same as for the non-reentrant scanner. * This function is called from rrlex_destroy(), so don't allocate here. */ (yy_buffer_stack) = 0; (yy_buffer_stack_top) = 0; (yy_buffer_stack_max) = 0; (yy_c_buf_p) = (char *) 0; (yy_init) = 0; (yy_start) = 0; /* Defined in main.c */ #ifdef YY_STDINIT rrin = stdin; rrout = stdout; #else rrin = (FILE *) 0; rrout = (FILE *) 0; #endif /* For future reference: Set errno on error, since we are called by * rrlex_init() */ return 0; } /* rrlex_destroy is for both reentrant and non-reentrant scanners. */ int rrlex_destroy (void) { /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ rr_delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; rrpop_buffer_state(); } /* Destroy the stack itself. */ rrfree((yy_buffer_stack) ); (yy_buffer_stack) = NULL; /* Reset the globals. This is important in a non-reentrant scanner so the next time * rrlex() is called, initialization will occur. */ yy_init_globals( ); return 0; } /* * Internal utility routines. */ #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) { register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s ) { register int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif void *rralloc (yy_size_t size ) { return (void *) malloc( size ); } void *rrrealloc (void * ptr, yy_size_t size ) { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter * because both ANSI C and C++ allow castless assignment from * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ return (void *) realloc( (char *) ptr, size ); } void rrfree (void * ptr ) { free( (char *) ptr ); /* see rrrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" #line 73 "ela/reporter_lex.l" /* unput is a macro, but we need a function pointer. */ static void unput_func(int c) { unput(c); } void ReporterCtlgParser::init_lex(void) { YY_FLUSH_BUFFER; rrrestart(file); lineno = 1; p_input = yyinput; p_unput = unput_func; } ppc64-diag-2.7.4/ela/lex.ev.cc0000644000000000000000000014501213135275552012535 00000000000000 #line 3 "lex.ev.c" #define YY_INT_ALIGNED short int /* A lexical scanner generated by flex */ #define yy_create_buffer ev_create_buffer #define yy_delete_buffer ev_delete_buffer #define yy_flex_debug ev_flex_debug #define yy_init_buffer ev_init_buffer #define yy_flush_buffer ev_flush_buffer #define yy_load_buffer_state ev_load_buffer_state #define yy_switch_to_buffer ev_switch_to_buffer #define yyin evin #define yyleng evleng #define yylex evlex #define yylineno evlineno #define yyout evout #define yyrestart evrestart #define yytext evtext #define yywrap evwrap #define yyalloc evalloc #define yyrealloc evrealloc #define yyfree evfree #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 #define YY_FLEX_SUBMINOR_VERSION 37 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ #include #include #include #include /* end standard C headers. */ /* flex integer type definitions */ #ifndef FLEXINT_H #define FLEXINT_H /* C99 systems have . Non-C99 systems may or may not. */ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 #endif #include typedef int8_t flex_int8_t; typedef uint8_t flex_uint8_t; typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; /* Limits of integral types. */ #ifndef INT8_MIN #define INT8_MIN (-128) #endif #ifndef INT16_MIN #define INT16_MIN (-32767-1) #endif #ifndef INT32_MIN #define INT32_MIN (-2147483647-1) #endif #ifndef INT8_MAX #define INT8_MAX (127) #endif #ifndef INT16_MAX #define INT16_MAX (32767) #endif #ifndef INT32_MAX #define INT32_MAX (2147483647) #endif #ifndef UINT8_MAX #define UINT8_MAX (255U) #endif #ifndef UINT16_MAX #define UINT16_MAX (65535U) #endif #ifndef UINT32_MAX #define UINT32_MAX (4294967295U) #endif #endif /* ! C99 */ #endif /* ! FLEXINT_H */ #ifdef __cplusplus /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST #else /* ! __cplusplus */ /* C99 requires __STDC__ to be defined as 1. */ #if defined (__STDC__) #define YY_USE_CONST #endif /* defined (__STDC__) */ #endif /* ! __cplusplus */ #ifdef YY_USE_CONST #define yyconst const #else #define yyconst #endif /* Returned upon end-of-file. */ #define YY_NULL 0 /* Promotes a possibly negative, possibly signed char to an unsigned * integer for use as an array index. If the signed char is negative, * we want to instead treat it as an 8-bit unsigned char, hence the * double cast. */ #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN (yy_start) = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define YY_NEW_FILE evrestart(evin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #ifndef YY_BUF_SIZE #define YY_BUF_SIZE 16384 #endif /* The state buf must be large enough to hold one state per character in the main buffer. */ #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T typedef size_t yy_size_t; #endif extern yy_size_t evleng; extern FILE *evin, *evout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 #define YY_LESS_LINENO(n) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up evtext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ *yy_cp = (yy_hold_char); \ YY_RESTORE_YY_MORE_OFFSET \ (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up evtext again */ \ } \ while ( 0 ) #define unput(c) yyunput( c, (yytext_ptr) ) #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state { FILE *yy_input_file; char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ yy_size_t yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ yy_size_t yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int yy_is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int yy_is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int yy_at_bol; int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as YY_EOF_PENDING, to indicate that we * shouldn't try reading from the input source any more. We might * still have a bunch of tokens to match, though, because of * possible backing-up. * * When we actually see the EOF, we change the status to "new" * (via evrestart()), so that the user can continue scanning by * just pointing evin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". * * Returns the top of the stack, or NULL. */ #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ : NULL) /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] /* yy_hold_char holds the character lost when evtext is formed. */ static char yy_hold_char; static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ yy_size_t evleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ /* Flag which is used to allow evwrap()'s to do buffer switches * instead of setting up a fresh evin. A bit of a hack ... */ static int yy_did_buffer_switch_on_eof; void evrestart (FILE *input_file ); void ev_switch_to_buffer (YY_BUFFER_STATE new_buffer ); YY_BUFFER_STATE ev_create_buffer (FILE *file,int size ); void ev_delete_buffer (YY_BUFFER_STATE b ); void ev_flush_buffer (YY_BUFFER_STATE b ); void evpush_buffer_state (YY_BUFFER_STATE new_buffer ); void evpop_buffer_state (void ); static void evensure_buffer_stack (void ); static void ev_load_buffer_state (void ); static void ev_init_buffer (YY_BUFFER_STATE b,FILE *file ); #define YY_FLUSH_BUFFER ev_flush_buffer(YY_CURRENT_BUFFER ) YY_BUFFER_STATE ev_scan_buffer (char *base,yy_size_t size ); YY_BUFFER_STATE ev_scan_string (yyconst char *yy_str ); YY_BUFFER_STATE ev_scan_bytes (yyconst char *bytes,yy_size_t len ); void *evalloc (yy_size_t ); void *evrealloc (void *,yy_size_t ); void evfree (void * ); #define yy_new_buffer ev_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ evensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ ev_create_buffer(evin,YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ evensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ ev_create_buffer(evin,YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ #define evwrap() 1 #define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; FILE *evin = (FILE *) 0, *evout = (FILE *) 0; typedef int yy_state_type; extern int evlineno; int evlineno = 1; extern char *evtext; #define yytext_ptr evtext static yy_state_type yy_get_previous_state (void ); static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); static int yy_get_next_buffer (void ); static void yy_fatal_error (yyconst char msg[] ); /* Done after the current pattern has been matched and before the * corresponding action - sets up evtext. */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ evleng = (size_t) (yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; #define YY_NUM_RULES 23 #define YY_END_OF_BUFFER 24 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info { flex_int32_t yy_verify; flex_int32_t yy_nxt; }; static yyconst flex_int16_t yy_accept[109] = { 0, 0, 0, 24, 22, 19, 20, 17, 22, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 22, 21, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 18, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 3, 16, 16, 16, 7, 16, 16, 16, 16, 16, 16, 16, 15, 16, 2, 16, 16, 16, 16, 16, 16, 16, 12, 16, 16, 1, 16, 16, 16, 8, 16, 16, 16, 16, 16, 16, 5, 16, 9, 16, 11, 16, 16, 16, 16, 10, 16, 16, 16, 6, 16, 14, 16, 16, 4, 13, 0 } ; static yyconst flex_int32_t yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 4, 1, 1, 1, 1, 1, 1, 1, 5, 1, 1, 1, 1, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 1, 1, 1, 1, 1, 1, 1, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 1, 1, 1, 1, 9, 1, 10, 11, 12, 13, 14, 15, 16, 8, 17, 8, 8, 18, 19, 20, 21, 22, 8, 23, 24, 25, 26, 27, 8, 28, 29, 8, 30, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; static yyconst flex_int32_t yy_meta[31] = { 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1 } ; static yyconst flex_int16_t yy_base[110] = { 0, 0, 0, 118, 119, 119, 119, 119, 112, 0, 104, 13, 101, 86, 96, 98, 88, 96, 14, 80, 78, 119, 0, 82, 96, 83, 9, 92, 85, 78, 84, 22, 91, 88, 76, 119, 80, 72, 66, 82, 69, 78, 21, 67, 69, 77, 74, 63, 62, 71, 63, 59, 0, 59, 59, 58, 0, 65, 68, 54, 55, 47, 60, 44, 0, 52, 0, 54, 56, 44, 45, 51, 49, 52, 0, 37, 39, 0, 40, 49, 43, 0, 45, 33, 43, 42, 30, 29, 0, 32, 0, 23, 0, 28, 36, 32, 28, 0, 30, 26, 23, 0, 18, 0, 22, 12, 0, 0, 119, 37 } ; static yyconst flex_int16_t yy_def[110] = { 0, 108, 1, 108, 108, 108, 108, 108, 108, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 108, 108, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 108, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 0, 108 } ; static yyconst flex_int16_t yy_nxt[150] = { 0, 4, 5, 6, 7, 4, 8, 4, 9, 9, 10, 9, 11, 12, 13, 14, 9, 9, 9, 15, 9, 9, 16, 17, 18, 19, 9, 9, 9, 9, 20, 24, 32, 39, 25, 56, 40, 45, 46, 22, 33, 107, 106, 105, 104, 103, 57, 102, 101, 100, 99, 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, 68, 67, 66, 65, 64, 63, 62, 61, 60, 59, 58, 55, 54, 53, 52, 51, 50, 49, 48, 47, 44, 43, 42, 41, 38, 37, 36, 35, 34, 31, 30, 29, 28, 27, 26, 23, 21, 108, 3, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108 } ; static yyconst flex_int16_t yy_chk[150] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 11, 18, 26, 11, 42, 26, 31, 31, 109, 18, 105, 104, 102, 100, 99, 42, 98, 96, 95, 94, 93, 91, 89, 87, 86, 85, 84, 83, 82, 80, 79, 78, 76, 75, 73, 72, 71, 70, 69, 68, 67, 65, 63, 62, 61, 60, 59, 58, 57, 55, 54, 53, 51, 50, 49, 48, 47, 46, 45, 44, 43, 41, 40, 39, 38, 37, 36, 34, 33, 32, 30, 29, 28, 27, 25, 24, 23, 20, 19, 17, 16, 15, 14, 13, 12, 10, 8, 3, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108 } ; static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; extern int ev_flex_debug; int ev_flex_debug = 0; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. */ #define REJECT reject_used_but_not_detected #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *evtext; #line 1 "ela/event_lex.l" #line 2 "ela/event_lex.l" /* * Tokenizer for event catalog * * Copyright (C) International Business Machines Corp., 2009 * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #define CATALOGS_IMPLEMENTATION #include "catalogs.h" #include "ev.tab.h" #include #include #include #include extern EventCtlgParser event_ctlg_parser; static EventCtlgParser *pc = &event_ctlg_parser; #line 569 "lex.ev.c" #define INITIAL 0 #ifndef YY_NO_UNISTD_H /* Special case for "unistd.h", since it is non-ANSI. We include it way * down here because we want the user's section 1 to have been scanned first. * The user has a chance to override it with an option. */ #include #endif #ifndef YY_EXTRA_TYPE #define YY_EXTRA_TYPE void * #endif static int yy_init_globals (void ); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ int evlex_destroy (void ); int evget_debug (void ); void evset_debug (int debug_flag ); YY_EXTRA_TYPE evget_extra (void ); void evset_extra (YY_EXTRA_TYPE user_defined ); FILE *evget_in (void ); void evset_in (FILE * in_str ); FILE *evget_out (void ); void evset_out (FILE * out_str ); yy_size_t evget_leng (void ); char *evget_text (void ); int evget_lineno (void ); void evset_lineno (int line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus extern "C" int evwrap (void ); #else extern int evwrap (void ); #endif #endif static void yyunput (int c,char *buf_ptr ); #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ); #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * ); #endif #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void ); #else static int input (void ); #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #define YY_READ_BUF_SIZE 8192 #endif /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define ECHO do { if (fwrite( evtext, evleng, 1, evout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ size_t n; \ for ( n = 0; n < max_size && \ (c = getc( evin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ if ( c == EOF && ferror( evin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else \ { \ errno=0; \ while ( (result = fread(buf, 1, max_size, evin))==0 && ferror(evin)) \ { \ if( errno != EINTR) \ { \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ break; \ } \ errno=0; \ clearerr(evin); \ } \ }\ \ #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */ #ifndef yyterminate #define yyterminate() return YY_NULL #endif /* Number of entries by which start-condition stack grows. */ #ifndef YY_START_STACK_INCR #define YY_START_STACK_INCR 25 #endif /* Report a fatal error. */ #ifndef YY_FATAL_ERROR #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) #endif /* end tables serialization structures and prototypes */ /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL_IS_OURS 1 extern int evlex (void); #define YY_DECL int evlex (void) #endif /* !YY_DECL */ /* Code executed at the beginning of each rule, after evtext and evleng * have been set up. */ #ifndef YY_USER_ACTION #define YY_USER_ACTION #endif /* Code executed at the end of each rule. */ #ifndef YY_BREAK #define YY_BREAK break; #endif #define YY_RULE_SETUP \ YY_USER_ACTION /** The main scanner function which does all the work. */ YY_DECL { register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; #line 37 "ela/event_lex.l" #line 753 "lex.ev.c" if ( !(yy_init) ) { (yy_init) = 1; #ifdef YY_USER_INIT YY_USER_INIT; #endif if ( ! (yy_start) ) (yy_start) = 1; /* first start state */ if ( ! evin ) evin = stdin; if ( ! evout ) evout = stdout; if ( ! YY_CURRENT_BUFFER ) { evensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = ev_create_buffer(evin,YY_BUF_SIZE ); } ev_load_buffer_state( ); } while ( 1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); /* Support of evtext. */ *yy_cp = (yy_hold_char); /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; yy_current_state = (yy_start); yy_match: do { register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 109 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } while ( yy_base[yy_current_state] != 119 ); yy_find_action: yy_act = yy_accept[yy_current_state]; if ( yy_act == 0 ) { /* have to back up */ yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); yy_act = yy_accept[yy_current_state]; } YY_DO_BEFORE_ACTION; do_action: /* This label is used only to access EOF actions. */ switch ( yy_act ) { /* beginning of action switch */ case 0: /* must back up */ /* undo the effects of YY_DO_BEFORE_ACTION */ *yy_cp = (yy_hold_char); yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); goto yy_find_action; case 1: YY_RULE_SETUP #line 38 "ela/event_lex.l" { return KW_ACTION; } YY_BREAK case 2: YY_RULE_SETUP #line 39 "ela/event_lex.l" { return KW_CLASS; } YY_BREAK case 3: YY_RULE_SETUP #line 40 "ela/event_lex.l" { return KW_COPY; } YY_BREAK case 4: YY_RULE_SETUP #line 41 "ela/event_lex.l" { return KW_DESCRIPTION; } YY_BREAK case 5: YY_RULE_SETUP #line 42 "ela/event_lex.l" { return KW_DEVSPEC; } YY_BREAK case 6: YY_RULE_SETUP #line 43 "ela/event_lex.l" { return KW_EXCEPTION; } YY_BREAK case 7: YY_RULE_SETUP #line 44 "ela/event_lex.l" { return KW_FILE; } YY_BREAK case 8: YY_RULE_SETUP #line 45 "ela/event_lex.l" { return KW_FILTER; } YY_BREAK case 9: YY_RULE_SETUP #line 46 "ela/event_lex.l" { return KW_MESSAGE; } YY_BREAK case 10: YY_RULE_SETUP #line 47 "ela/event_lex.l" { return KW_PRIORITY; } YY_BREAK case 11: YY_RULE_SETUP #line 48 "ela/event_lex.l" { return KW_REFCODE; } YY_BREAK case 12: YY_RULE_SETUP #line 49 "ela/event_lex.l" { return KW_REGEX; } YY_BREAK case 13: YY_RULE_SETUP #line 50 "ela/event_lex.l" { return KW_SL_SEVERITY; } YY_BREAK case 14: YY_RULE_SETUP #line 51 "ela/event_lex.l" { return KW_SUBSYSTEM; } YY_BREAK case 15: YY_RULE_SETUP #line 52 "ela/event_lex.l" { return KW_TYPE; } YY_BREAK case 16: YY_RULE_SETUP #line 54 "ela/event_lex.l" { char *name; if (! (name = strdup((const char*)evtext)) ) { perror("strdup"); return ERRTOK; } evlval.sval = name; return TK_NAME; } YY_BREAK case 17: YY_RULE_SETUP #line 64 "ela/event_lex.l" { char *s = pc->get_string(1); if (!s) return ERRTOK; evlval.sval = s; return TK_STRING; } YY_BREAK case 18: YY_RULE_SETUP #line 72 "ela/event_lex.l" { char *s = pc->get_text_block(); if (!s) return ERRTOK; evlval.sval = s; return TK_TEXTBLOCK; } YY_BREAK case 19: YY_RULE_SETUP #line 80 "ela/event_lex.l" ; /* Skip white space. */ YY_BREAK case 20: /* rule 20 can match eol */ YY_RULE_SETUP #line 82 "ela/event_lex.l" { pc->lineno++; } YY_BREAK case 21: YY_RULE_SETUP #line 84 "ela/event_lex.l" { if (pc->skip_comment() < 0) return ERRTOK; } YY_BREAK case 22: YY_RULE_SETUP #line 89 "ela/event_lex.l" { return evtext[0]; /* Pass through any other characters. */ } YY_BREAK case 23: YY_RULE_SETUP #line 90 "ela/event_lex.l" ECHO; YY_BREAK #line 975 "lex.ev.c" case YY_STATE_EOF(INITIAL): yyterminate(); case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ *yy_cp = (yy_hold_char); YY_RESTORE_YY_MORE_OFFSET if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed evin at a new source and called * evlex(). If so, then we have to assure * consistency between YY_CURRENT_BUFFER and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; YY_CURRENT_BUFFER_LVALUE->yy_input_file = evin; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position * of the first EOB in the buffer, since yy_c_buf_p will * already have been incremented past the NUL character * (since all states make transitions on EOB to the * end-of-buffer state). Contrast this with the test * in input(). */ if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) { /* This was really a NUL. */ yy_state_type yy_next_state; (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * yy_get_previous_state() go ahead and do it * for us because it doesn't know how to deal * with the possibility of jamming (and we don't * want to build jamming into it because then it * will run more slowly). */ yy_next_state = yy_try_NUL_trans( yy_current_state ); yy_bp = (yytext_ptr) + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ yy_cp = ++(yy_c_buf_p); yy_current_state = yy_next_state; goto yy_match; } else { yy_cp = (yy_c_buf_p); goto yy_find_action; } } else switch ( yy_get_next_buffer( ) ) { case EOB_ACT_END_OF_FILE: { (yy_did_buffer_switch_on_eof) = 0; if ( evwrap( ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up * evtext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * YY_NULL, it'll still work - another * YY_NULL will get returned. */ (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; } else { if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: (yy_c_buf_p) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_find_action; } break; } default: YY_FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of evlex */ /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: * EOB_ACT_LAST_MATCH - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ static int yy_get_next_buffer (void) { register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; register char *source = (yytext_ptr); register int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; } } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; else { yy_size_t num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; int yy_c_buf_p_offset = (int) ((yy_c_buf_p) - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { yy_size_t new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; else b->yy_buf_size *= 2; b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ evrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); } else /* Can't grow it, we don't own it. */ b->yy_ch_buf = 0; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), (yy_n_chars), num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } if ( (yy_n_chars) == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; evrestart(evin ); } else { ret_val = EOB_ACT_LAST_MATCH; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) evrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); } (yy_n_chars) += number_to_move; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ static yy_state_type yy_get_previous_state (void) { register yy_state_type yy_current_state; register char *yy_cp; yy_current_state = (yy_start); for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 109 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; } return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { register int yy_is_jam; register char *yy_cp = (yy_c_buf_p); register YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 109 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 108); return yy_is_jam ? 0 : yy_current_state; } static void yyunput (int c, register char * yy_bp ) { register char *yy_cp; yy_cp = (yy_c_buf_p); /* undo effects of setting up evtext */ *yy_cp = (yy_hold_char); if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ register yy_size_t number_to_move = (yy_n_chars) + 2; register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; register char *source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) *--dest = *--source; yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); } *--yy_cp = (char) c; (yytext_ptr) = yy_bp; (yy_hold_char) = *yy_cp; (yy_c_buf_p) = yy_cp; } #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) #else static int input (void) #endif { int c; *(yy_c_buf_p) = (yy_hold_char); if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) /* This was really a NUL. */ *(yy_c_buf_p) = '\0'; else { /* need more input */ yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() * sees that we've accumulated a * token and flags that we need to * try matching the token before * proceeding. But for input(), * there's no matching to consider. * So convert the EOB_ACT_LAST_MATCH * to EOB_ACT_END_OF_FILE. */ /* Reset buffer status. */ evrestart(evin ); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { if ( evwrap( ) ) return EOF; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; #ifdef __cplusplus return yyinput(); #else return input(); #endif } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + offset; break; } } } c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ *(yy_c_buf_p) = '\0'; /* preserve evtext */ (yy_hold_char) = *++(yy_c_buf_p); return c; } #endif /* ifndef YY_NO_INPUT */ /** Immediately switch to a different input stream. * @param input_file A readable stream. * * @note This function does not reset the start condition to @c INITIAL . */ void evrestart (FILE * input_file ) { if ( ! YY_CURRENT_BUFFER ){ evensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = ev_create_buffer(evin,YY_BUF_SIZE ); } ev_init_buffer(YY_CURRENT_BUFFER,input_file ); ev_load_buffer_state( ); } /** Switch to a different input buffer. * @param new_buffer The new input buffer. * */ void ev_switch_to_buffer (YY_BUFFER_STATE new_buffer ) { /* TODO. We should be able to replace this entire function body * with * evpop_buffer_state(); * evpush_buffer_state(new_buffer); */ evensure_buffer_stack (); if ( YY_CURRENT_BUFFER == new_buffer ) return; if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } YY_CURRENT_BUFFER_LVALUE = new_buffer; ev_load_buffer_state( ); /* We don't actually know whether we did this switch during * EOF (evwrap()) processing, but the only time this flag * is looked at is after evwrap() is called, so it's safe * to go ahead and always set it. */ (yy_did_buffer_switch_on_eof) = 1; } static void ev_load_buffer_state (void) { (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; evin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; (yy_hold_char) = *(yy_c_buf_p); } /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. * * @return the allocated buffer state. */ YY_BUFFER_STATE ev_create_buffer (FILE * file, int size ) { YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) evalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in ev_create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->yy_ch_buf = (char *) evalloc(b->yy_buf_size + 2 ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in ev_create_buffer()" ); b->yy_is_our_buffer = 1; ev_init_buffer(b,file ); return b; } /** Destroy the buffer. * @param b a buffer created with ev_create_buffer() * */ void ev_delete_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) evfree((void *) b->yy_ch_buf ); evfree((void *) b ); } /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a evrestart() or at EOF. */ static void ev_init_buffer (YY_BUFFER_STATE b, FILE * file ) { int oerrno = errno; ev_flush_buffer(b ); b->yy_input_file = file; b->yy_fill_buffer = 1; /* If b is the current buffer, then ev_init_buffer was _probably_ * called from evrestart() or through yy_get_next_buffer. * In that case, we don't want to reset the lineno or column. */ if (b != YY_CURRENT_BUFFER){ b->yy_bs_lineno = 1; b->yy_bs_column = 0; } b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * */ void ev_flush_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; b->yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes * a transition to the end-of-buffer state. The second causes * a jam in that state. */ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; b->yy_buf_pos = &b->yy_ch_buf[0]; b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) ev_load_buffer_state( ); } /** Pushes the new state onto the stack. The new state becomes * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. * */ void evpush_buffer_state (YY_BUFFER_STATE new_buffer ) { if (new_buffer == NULL) return; evensure_buffer_stack(); /* This block is copied from ev_switch_to_buffer. */ if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } /* Only push if top exists. Otherwise, replace top. */ if (YY_CURRENT_BUFFER) (yy_buffer_stack_top)++; YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from ev_switch_to_buffer. */ ev_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. * */ void evpop_buffer_state (void) { if (!YY_CURRENT_BUFFER) return; ev_delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; if ((yy_buffer_stack_top) > 0) --(yy_buffer_stack_top); if (YY_CURRENT_BUFFER) { ev_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } } /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ static void evensure_buffer_stack (void) { yy_size_t num_to_alloc; if (!(yy_buffer_stack)) { /* First allocation is just for 2 elements, since we don't know if this * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ num_to_alloc = 1; (yy_buffer_stack) = (struct yy_buffer_state**)evalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in evensure_buffer_stack()" ); memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_top) = 0; return; } if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ int grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; (yy_buffer_stack) = (struct yy_buffer_state**)evrealloc ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in evensure_buffer_stack()" ); /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; } } /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE ev_scan_buffer (char * base, yy_size_t size ) { YY_BUFFER_STATE b; if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; b = (YY_BUFFER_STATE) evalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in ev_scan_buffer()" ); b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; b->yy_input_file = 0; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; ev_switch_to_buffer(b ); return b; } /** Setup the input buffer state to scan a string. The next call to evlex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * ev_scan_bytes() instead. */ YY_BUFFER_STATE ev_scan_string (yyconst char * yystr ) { return ev_scan_bytes(yystr,strlen(yystr) ); } /** Setup the input buffer state to scan the given bytes. The next call to evlex() will * scan from a @e copy of @a bytes. * @param yybytes the byte buffer to scan * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE ev_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) { YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; buf = (char *) evalloc(n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in ev_scan_bytes()" ); for ( i = 0; i < _yybytes_len; ++i ) buf[i] = yybytes[i]; buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; b = ev_scan_buffer(buf,n ); if ( ! b ) YY_FATAL_ERROR( "bad buffer in ev_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. */ b->yy_is_our_buffer = 1; return b; } #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif static void yy_fatal_error (yyconst char* msg ) { (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ do \ { \ /* Undo effects of setting up evtext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ evtext[evleng] = (yy_hold_char); \ (yy_c_buf_p) = evtext + yyless_macro_arg; \ (yy_hold_char) = *(yy_c_buf_p); \ *(yy_c_buf_p) = '\0'; \ evleng = yyless_macro_arg; \ } \ while ( 0 ) /* Accessor methods (get/set functions) to struct members. */ /** Get the current line number. * */ int evget_lineno (void) { return evlineno; } /** Get the input stream. * */ FILE *evget_in (void) { return evin; } /** Get the output stream. * */ FILE *evget_out (void) { return evout; } /** Get the length of the current token. * */ yy_size_t evget_leng (void) { return evleng; } /** Get the current token. * */ char *evget_text (void) { return evtext; } /** Set the current line number. * @param line_number * */ void evset_lineno (int line_number ) { evlineno = line_number; } /** Set the input stream. This does not discard the current * input buffer. * @param in_str A readable stream. * * @see ev_switch_to_buffer */ void evset_in (FILE * in_str ) { evin = in_str ; } void evset_out (FILE * out_str ) { evout = out_str ; } int evget_debug (void) { return ev_flex_debug; } void evset_debug (int bdebug ) { ev_flex_debug = bdebug ; } static int yy_init_globals (void) { /* Initialization is the same as for the non-reentrant scanner. * This function is called from evlex_destroy(), so don't allocate here. */ (yy_buffer_stack) = 0; (yy_buffer_stack_top) = 0; (yy_buffer_stack_max) = 0; (yy_c_buf_p) = (char *) 0; (yy_init) = 0; (yy_start) = 0; /* Defined in main.c */ #ifdef YY_STDINIT evin = stdin; evout = stdout; #else evin = (FILE *) 0; evout = (FILE *) 0; #endif /* For future reference: Set errno on error, since we are called by * evlex_init() */ return 0; } /* evlex_destroy is for both reentrant and non-reentrant scanners. */ int evlex_destroy (void) { /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ ev_delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; evpop_buffer_state(); } /* Destroy the stack itself. */ evfree((yy_buffer_stack) ); (yy_buffer_stack) = NULL; /* Reset the globals. This is important in a non-reentrant scanner so the next time * evlex() is called, initialization will occur. */ yy_init_globals( ); return 0; } /* * Internal utility routines. */ #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) { register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s ) { register int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif void *evalloc (yy_size_t size ) { return (void *) malloc( size ); } void *evrealloc (void * ptr, yy_size_t size ) { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter * because both ANSI C and C++ allow castless assignment from * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ return (void *) realloc( (char *) ptr, size ); } void evfree (void * ptr ) { free( (char *) ptr ); /* see evrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" #line 90 "ela/event_lex.l" /* unput is a macro, but we need a function pointer. */ static void unput_func(int c) { unput(c); } void EventCtlgParser::init_lex(void) { YY_FLUSH_BUFFER; evrestart(file); lineno = 1; p_input = yyinput; p_unput = unput_func; } ppc64-diag-2.7.4/ela/catalogs.h0000644000000000000000000002666113135275400012773 00000000000000#ifndef _CATALOGS_H #define _CATALOGS_H /* * Catalogs: reporters and events/messages, and parsers therefor * * Copyright (C) International Business Machines Corp., 2009, 2010 * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ using namespace std; #include #include #include #include #include #include #include #include #include #define ELA_CATALOG_DIR "/etc/ppc64-diag/message_catalog" class Parser { protected: virtual void init_lex() = 0; // defined in .l file // yacc-generated parser -- AKA yyparse() int (*parse)(); // flex-generated [yy]input() and unput(). // input and unput can be magic names in lex.*.c files, so avoid // them here. int (*p_input)(); void (*p_unput)(int); void (*error)(const char *s); int semantic_errors; int get_octal_escape(const char *digits, int isCharConst); int get_char_escape(char c); void collect_octal_digits(char *digits, char firstDigit); public: Parser(); const char *pathname; FILE *file; int lineno; int parse_file(const string& path); void semantic_error(const string& msg); /* public because they're called by the lexical analyzers. */ char *get_string(int quoted); int skip_comment(); char *get_text_block(); }; extern Parser *cur_parser; /* Parses the reporters catalog */ class ReporterCtlgParser : public Parser { protected: virtual void init_lex(); // defined in .l file public: ReporterCtlgParser(); }; /* Parses a file in the message catalog, yielding an EventCtlgFile */ class EventCtlgParser : public Parser { protected: virtual void init_lex(); // defined in .l file public: EventCtlgParser(); }; struct NameValuePair { const char *name; int value; }; class MemberSet { protected: set seen; Parser *parser; public: void tally(void *addr, const string& name); void require(void *addr, const string& name); MemberSet(Parser *p) { parser = p; } }; extern int nvp_lookup(string name, NameValuePair *nvp, string member); extern string nvp_lookup_value(int value, NameValuePair *nvp); extern string severity_name(int sev); class Reporter; class ReporterCatalog; /* e.g., dev_err is an alias for dev_printk. */ class ReporterAlias { friend ostream& operator<<(ostream& os, const ReporterAlias& ra); public: Reporter *reporter; string name; #define LOG_SEV_UNKNOWN 8 #define LOG_SEV_ANY 9 /* used only for catchall-ish messages */ int severity; /* LOG_EMERG ... LOG_DEBUG or unknown or any */ ReporterAlias(const string& nm, const string& sev = "unknown"); }; /* * A Reporter is a function or macro like dev_printk or pr_err that * is used to report an event. Different Reporters supply different * prefixes. */ class Reporter { friend class ReporterCatalog; friend ostream& operator<<(ostream& os, const Reporter& r); protected: MemberSet members; Parser *parser; bool prefix_arg_exists(const string& arg); public: string name; ReporterAlias *base_alias; vector *aliases; bool from_kernel; string prefix_format; vector *prefix_args; string device_arg; Reporter(ReporterAlias *ra); void set_source(const string& source); void set_aliases(vector *alist); void set_prefix_format(const string& format); void set_prefix_args(vector *args); void set_device_arg(const string& arg); void validate(void); }; /* * In some cases, the macro used to log a message may produce either * of two (or more) prefix formats. Such a macro is represented by * a MetaReporter, which maps to two or more ReporterAliases, each * representing a prefix format. */ class MetaReporter { friend class ReporterCatalog; friend ostream& operator<<(ostream& os, const MetaReporter& mr); protected: MemberSet members; Parser *parser; vector *variant_names; void handle_nested_meta_reporter(MetaReporter *mr); public: string name; vector variants; MetaReporter(const string& nm); void set_variant_names(vector *vnames); void validate(ReporterCatalog *catalog); }; class ReporterCatalog { public: vector rlist; vector mrlist; map rmap; map mrmap; void register_reporter(Reporter*); void register_meta_reporter(MetaReporter*); void register_alias(ReporterAlias *ra, Reporter*); ReporterAlias *find(const string& name); MetaReporter *find_meta_reporter(const string& name); }; class EventCtlgFile; class SyslogEvent; class SyslogMessage; class CatalogCopy; class ExceptionMsg { public: string type; string description; string action; ExceptionMsg(const string& ty, const string& desc, const string &act) { type = ty; description = desc; action = act; } }; class ExceptionCatalog { protected: map exceptions; public: void add(Parser *parser, const string& type, const string& description, const string &action); ExceptionMsg *find(const string& type); }; enum ErrorClass { SYCL_HARDWARE, SYCL_SOFTWARE, SYCL_FIRMWARE, SYCL_UNKNOWN }; enum ErrorType { SYTY_PERM=1, SYTY_TEMP, SYTY_CONFIG, SYTY_PEND, SYTY_PERF, SYTY_INFO, SYTY_UNKNOWN, SYTY_BOGUS=0 }; #ifndef SL_SEV_FATAL /* defines for sl_event.severity */ #define SL_SEV_FATAL 7 #define SL_SEV_ERROR 6 #define SL_SEV_ERROR_LOCAL 5 #define SL_SEV_WARNING 4 #define SL_SEV_EVENT 3 #define SL_SEV_INFO 2 #define SL_SEV_DEBUG 1 #endif /* * This contains the information necessary to match a SyslogMessage to a * SyslogEvent. Typically, there is just one per SyslogEvent. But if the * ReporterAlias named in the message statement is actually a MetaReporter, * then a MatchVariant is created for each of the MetaReporter's * ReporterAliases. */ class MatchVariant { friend class SyslogEvent; protected: // string regex_text; int resolve_severity(int msg_severity); void compute_regex_text(void); void compile_regex(void); public: string regex_text; ReporterAlias *reporter_alias; int severity; // from ReporterAlias regex_t regex; SyslogEvent *parent; MatchVariant(ReporterAlias *ra, int msg_severity, SyslogEvent *pa); bool match(SyslogMessage*, bool get_prefix_args); void report(ostream& os, bool sole_variant); void set_regex(const string& rgxtxt); }; /* A message/event from the message catalog */ class SyslogEvent { friend class MatchVariant; friend ostream& operator<<(ostream& os, const SyslogEvent& e); protected: Parser *parser; MemberSet members; vector match_variants; string paste_copies(const string &text); void mk_match_variants(const string& rp, const string& sev); public: string reporter_name; // Could be a reporter, alias, or meta-reporter MatchVariant *matched_variant; // set by match() bool from_kernel; EventCtlgFile *driver; string format; string escaped_format; /* e.g., newline replaced with slash, n */ string *source_file; string description; string action; ErrorClass err_class; // err_type or sl_severity, not both ErrorType err_type; int sl_severity; // one of SL_SEV_* string refcode; char priority; ExceptionMsg *exception_msg; SyslogEvent(const string& rpt, const string& sev, const string& fmt, EventCtlgFile *drv); void set_description(const string& s); void set_action(const string& s); void set_class(const string& s); void set_type(const string& s); void set_sl_severity(const string& s); void set_refcode(const string& s); void set_priority(const string& s); void set_regex(const string& rpt, const string& rgxtxt); void except(const string& reason); void verify_complete(void); MatchVariant *match(SyslogMessage*, bool get_prefix_args); int get_severity(void); }; /* Maps a string such as device ID to the corresponding /sys/.../devspec file */ class DevspecMacro { protected: string name; // e.g., device, netdev, adapter string prefix; // /sys/... string suffix; // .../devspec public: DevspecMacro(const string& nm, const string& path); string get_devspec_path(const string& device_id); bool valid; }; /* * Typically used to filter out messages from other drivers, by looking * at the "driver" arg of the message prefix. */ class MessageFilter { protected: string arg_name; string arg_value; public: MessageFilter(const string& name, int op, const string& value); bool message_passes_filter(SyslogMessage *msg); }; /* * Contains the header information for a particular catalog file (which * typically represents a particular driver) */ class EventCtlgFile { public: string pathname; string name; // driver name, from pathname string subsystem; map text_copies; map devspec_macros; vector filters; /* not strictly needed, but handy if we ever want to do destructors */ vector source_files; string *cur_source_file; EventCtlgFile(const string& path, const string& subsys); void add_text_copy(const string& name, const string& text); string find_text_copy(const string& name); void set_source_file(const string& path); void add_devspec(const string& nm, const string& path); DevspecMacro *find_devspec(const string& name); void add_filter(MessageFilter *filter); bool message_passes_filters(SyslogMessage *msg); }; /* * The overall event/message catalog, comprising all the EventCtlgFiles * in the directory */ class EventCatalog { protected: vector drivers; public: vector events; EventCatalog() {} static int parse(const string& directory); void register_driver(EventCtlgFile *driver); void register_event(SyslogEvent *event); }; /* A line of text logged by syslog */ class SyslogMessage { public: string line; bool parsed; time_t date; string hostname; bool from_kernel; string message; map prefix_args; string devspec_path; // path to devspec node in /sys SyslogMessage(const string& s); string echo(void); int set_devspec_path(SyslogEvent *event); string get_device_id(MatchVariant *mv); }; /* * regex_text_policy = RGXTXT_WRITE adds regex_text statements to * the message catalogs. */ enum regex_text_policy { RGXTXT_COMPUTE, /* Compute regex_text from format string */ RGXTXT_WRITE, /* ... and also write it out to catalog file */ RGXTXT_READ /* Read regex_text from catalog file */ }; extern regex_text_policy regex_text_policy; class CatalogCopy { protected: FILE *orig_file; FILE *copy_file; string orig_path; string copy_path; int last_line_copied; // in orig_file int copy_through(int line_nr); public: bool valid; CatalogCopy(const string& rd_path, const string& wr_path); ~CatalogCopy(); void inject_text(const string& text, int line_nr); void finish_copy(void); }; extern string indent_text_block(const string& s1, size_t nspaces); extern "C" { extern time_t parse_date(const char *start, char **end, const char *fmt, bool yr_in_fmt); extern time_t parse_syslog_date(const char *start, char **end); extern time_t parse_syslogish_date(const char *start, char **end); } #endif /* _CATALOGS_H */ ppc64-diag-2.7.4/ela/explain_syslog.cpp0000644000000000000000000001516613135275400014567 00000000000000using namespace std; #include #include #include #include #include #include #include #include #include "catalogs.h" extern "C" { #include "platform.c" } static const char *progname; bool debug = 0; extern ReporterCatalog reporter_catalog; extern EventCatalog event_catalog; static void usage_message(FILE *out) { fprintf(out, "usage: %s [-b date] [-e date] [-m msgfile | -M]\n" "\t[-C catalog_dir] [-h] [-d]\n", progname); } static void usage(void) { usage_message(stderr); exit(1); } static void report_event(SyslogEvent *event, SyslogMessage *msg, const char *line) { MatchVariant *mv = event->matched_variant; Reporter *reporter = mv->reporter_alias->reporter; cout << endl << line; cout << "matches: " << event->reporter_name << " \"" << event->escaped_format << "\"" << endl; size_t nr_prefix_args = msg->prefix_args.size(); if (nr_prefix_args > 0) { unsigned int i; for (i = 0; i < nr_prefix_args; i++) { string arg_name = reporter->prefix_args->at(i); if (i > 0) cout << " "; cout << arg_name << "=" << msg->prefix_args[arg_name]; } cout << endl; if (msg->set_devspec_path(event) == 0) cout << "devspec: " << msg->devspec_path << endl; } cout << "subsystem: " << event->driver->subsystem << endl; cout << "severity: " << severity_name(mv->severity) << endl; if (event->source_file) cout << "file: " << "\"" << *(event->source_file) << "\"" << endl; ExceptionMsg *em = event->exception_msg; string description, action; if (em) { description = em->description; action = em->action; } else { description = event->description; action = event->action; } cout << "description:" << endl << indent_text_block(description, 2) << endl; cout << "action:" << endl << indent_text_block(action, 2) << endl; } static time_t parse_date_arg(const char *date_str, const char *arg_name) { char *date_end = NULL; time_t t = parse_syslogish_date(date_str, &date_end); if (!t || *date_end != '\0') { cerr << "unrecognized date format for " << arg_name << " option" << endl; exit(1); } return t; } static void print_help(void) { usage_message(stdout); printf( "-b begin_time\tIgnore messages with timestamps prior to begin_time.\n" "-C catalog_dir\tUse message catalog in catalog_dir. Defaults to\n" "\t\t\t/etc/ppc64-diag/message_catalog.\n" "-d\t\tPrint debugging output on stderr.\n" "-e end_time\tStop upon reading message with timestamp after end_time.\n" "-h\t\tPrint this help text and exit.\n" "-m message_file\tRead syslog messages from message_file, not stdin.\n" "-M\t\tRead syslog messages from system default location.\n" ); } int main(int argc, char **argv) { int c; int platform = 0; time_t begin_date = 0, end_date = 0; const char *catalog_dir = ELA_CATALOG_DIR; const char *msg_path = NULL; FILE *msg_file = stdin; vector::iterator ie; progname = argv[0]; platform = get_platform(); cout << progname << ": is not supported on the " << __power_platform_name(platform) << " platform" << endl; exit(0); opterr = 0; while ((c = getopt(argc, argv, "b:C:de:hm:M")) != -1) { switch (c) { case 'b': begin_date = parse_date_arg(optarg, "-b"); break; case 'C': catalog_dir = optarg; break; case 'd': debug = true; break; case 'e': end_date = parse_date_arg(optarg, "-e"); break; case 'h': print_help(); exit(0); case 'm': msg_path = optarg; break; case 'M': msg_path = "/var/log/messages"; if (access(msg_path, R_OK)) { /* check /var/log/syslog too */ msg_path = "/var/log/syslog"; if (access(msg_path, R_OK)) { perror("syslog file"); exit(2); } } break; case '?': usage(); } } if (optind != argc) usage(); if (msg_path) { msg_file = fopen(msg_path, "r"); if (!msg_file) { perror(msg_path); exit(2); } } if (EventCatalog::parse(catalog_dir) != 0) { if (msg_path) fclose(msg_file); exit(2); } if (debug) { vector::iterator ir; for (ir = reporter_catalog.rlist.begin(); ir < reporter_catalog.rlist.end(); ir++) { cout << "-----" << endl; cout << **ir; } vector::iterator imr; for (imr = reporter_catalog.mrlist.begin(); imr < reporter_catalog.mrlist.end(); imr++) { cout << "-----" << endl; cout << **imr; } for (ie = event_catalog.events.begin(); ie < event_catalog.events.end(); ie++) { cout << "-----" << endl; cout << **ie; } } #define LINESZ 256 char line[LINESZ]; int skipped = 0; bool prev_line_truncated = false, cur_line_truncated; while (fgets(line, LINESZ, msg_file)) { if (strchr(line, '\n')) cur_line_truncated = false; else { /* * syslog-ng "Log statistics" messages can be very * long, so don't complain about such monstrosities * by default. */ if (debug) cerr << "message truncated to " << LINESZ-1 << " characters!" << endl; line[LINESZ-2] = '\n'; line[LINESZ-1] = '\0'; cur_line_truncated = true; } bool skip_fragment = prev_line_truncated; prev_line_truncated = cur_line_truncated; if (skip_fragment) continue; SyslogMessage msg(line); if (!msg.parsed) { if (debug) cerr << "unparsed message: " << line; skipped++; continue; } if (begin_date && difftime(msg.date, begin_date) < 0) continue; if (end_date && difftime(msg.date, end_date) > 0) { /* * We used to break here (i.e., skip all the rest * of the lines in the file). But timestamps in * syslog files sometimes jump backward, so it's * possible to find lines in the desired timeframe * even after we hit lines that are beyond it. */ continue; } SyslogEvent *unreported_exception = NULL; bool reported = false; for (ie = event_catalog.events.begin(); ie < event_catalog.events.end(); ie++) { SyslogEvent *event = *ie; if (event->exception_msg && (reported || unreported_exception)) { /* * We've already matched an event, so * don't bother trying to match exception * catch-alls. */ continue; } if (event->match(&msg, true)) { if (skipped > 0) { cout << endl << "[Skipped " << skipped << " unrecognized messages]" << endl; skipped = 0; } if (event->exception_msg) unreported_exception = event; else { report_event(event, &msg, line); reported = true; } } } if (!reported) { if (unreported_exception) report_event(unreported_exception, &msg, line); else skipped++; } } if (skipped > 0) cout << endl << "[Skipped " << skipped << " unrecognized messages]" << endl; if (msg_path) fclose(msg_file); exit(0); } ppc64-diag-2.7.4/ela/syslog_to_svclog.cpp0000644000000000000000000005006613135275400015124 00000000000000using namespace std; #include #include #include #include #include #include #include #include #include #include #include /* * This is needed for RTAS_FRUID_COMP_* (callout type, which Mike S. thinks * is largely ignored). */ #include #include #include #include #include #include #include #include #include #include using namespace lsvpd; #include "catalogs.h" #include extern "C" { #include "platform.c" #include "utils.c" } //Workaround for deprecated warning. #pragma GCC diagnostic ignored "-Wwrite-strings" #define LAST_EVENT_PATH "/var/log/ppc64-diag/last_syslog_event" #define LAST_EVENT_PATH_BAK LAST_EVENT_PATH ".bak" static const char *progname; static bool debug = 0; static time_t begin_date = 0, end_date = 0; static const char *catalog_dir = ELA_CATALOG_DIR; static const char *syslog_path = NULL; static const char *msg_path = NULL; static FILE *msg_file = stdin; static bool follow = false, follow_default = false; static string last_msg_matched; // read from LAST_EVENT_PATH static bool skipping_old_messages; extern ReporterCatalog reporter_catalog; extern EventCatalog event_catalog; static servicelog *slog = NULL; static void usage_message(FILE *out) { fprintf(out, "usage: %s [-b date] [-e date | -F] [-m msgfile | -M]\n" "\t[-C catalog_dir] [-h] [-d]\n", progname); } static void usage(void) { usage_message(stderr); exit(1); } /* * Convert a C++ string to a strdup-ed C string, or a NULL pointer. * If -d is specified, don't return any NULL pointers, because we're * going to call servicelog_event_print(), and that doesn't handle * NULLs well. */ static char * svclog_string(const string& s, bool force=false) { if (s.empty()) { if (debug || force) return strdup("none"); return NULL; } return strdup(s.c_str()); } /* * Used, in debug mode, to ensure we don't pass any null char pointers to * servicelog_event_print(). */ static char * fake_val(const char *valname) { return strdup(valname); } /* Stuff for querying the Vital Product Data (VPD) database starts here. */ static System *vpd_root = NULL; static bool vpd_uptodate_flag = false; static bool vpd_up_to_date(void) { return vpd_uptodate_flag; } static System * collect_vpd(void) { VpdRetriever *vpd = NULL; /* Either succeed or give up forever. */ vpd_uptodate_flag = true; try { vpd = new VpdRetriever(); } catch (exception& e) { cerr << progname << ": VpdRetriever constructor threw exception" << endl; return NULL; } try { vpd_root = vpd->getComponentTree(); } catch (VpdException& ve) { cerr << progname << ": getComponentTree() failed: " << ve.what() << endl; vpd_root = NULL; } delete vpd; if (!vpd_root) { cerr << progname << ": getComponentTree() returned null root" << endl; } return vpd_root; } /* * Recursive search for the Component with the specified location code, * among the specified list of Components, which are the children of the * System root or of a Component. Recursion is a bit weird because a * System is not a Component. */ static Component * get_device_by_location_code(const vector& components, const string& location_code) { vector::const_iterator i, end; for (i = components.begin(), end = components.end(); i != end; i++) { Component *c = *i; if (c->getPhysicalLocation() == location_code) return c; else { Component *k = get_device_by_location_code( c->getLeaves(), location_code); if (k) return k; } } return NULL; } static Component * get_device_by_location_code(const System *root, const string& location_code) { if (root) return get_device_by_location_code(root->getLeaves(), location_code); return NULL; } static ssize_t read_thing_from_file(const char *path, char *buf, size_t bufsz) { int fd; ssize_t nbytes; fd = open(path, O_RDONLY); if (fd < 0) return -1; nbytes = read(fd, buf, bufsz); close(fd); return nbytes; } /* * Try to find the /sys/.../devspec node associated with the device * that this syslog message is about. That node contains the pathname * of the directory in /proc/device-tree for that device. (The * pathname is not null- or newline-terminated.) The device's * (null-terminated) location code is in the file ibm,loc-code in * that directory. Using the location code, we look up the other * Vital Product Data for that device, as required to fill out the callout. * * Return 0 on (at least partial) success. Caller has nulled out the * various members we might populate. */ static int populate_callout_from_vpd(SyslogEvent *sys, SyslogMessage *msg, struct sl_event *svc, struct sl_callout *callout) { #define PROC_DEVICE_TREE_DIR "/proc/device-tree" #define LOCATION_CODE_FILE "/ibm,loc-code" int result; char dev_tree_path[PATH_MAX]; char *next, *end = dev_tree_path + PATH_MAX; char location_code[1000]; ssize_t nbytes; result = msg->set_devspec_path(sys); if (result != 0) return result; next = dev_tree_path; (void) strcpy(next, PROC_DEVICE_TREE_DIR); next += strlen(PROC_DEVICE_TREE_DIR); /* /proc/device-tree^ */ nbytes = read_thing_from_file(msg->devspec_path.c_str(), next, end - next); if (nbytes <= 0) return -1; /* /proc/device-tree^/xxx/yyy -- typically NOT newline-terminated */ if (!strncmp(next, "none\n", 5)) return -1; next += nbytes; /* /proc/device-tree/xxx/yyy^ */ if ((unsigned)(end - next) < sizeof(LOCATION_CODE_FILE)) return -1; strcpy(next, LOCATION_CODE_FILE); /* /proc/device-tree/xxx/yyy^/ibm,loc-code */ nbytes = read_thing_from_file(dev_tree_path, location_code, 1000); if (nbytes < 0 || nbytes >= 1000) return -1; if (!vpd_up_to_date()) vpd_root = collect_vpd(); if (!vpd_root) return -1; Component *device = get_device_by_location_code(vpd_root, location_code); if (!device) return -1; callout->location = svclog_string(location_code); callout->fru = svclog_string(device->getFRU()); callout->serial = svclog_string(device->getSerialNumber()); const DataItem *ccin = device->getDeviceSpecific("CC"); callout->ccin = svclog_string(ccin ? ccin->getValue() : ""); return 0; } /* End of VPD query functions */ static bool is_informational_event(SyslogEvent *sys) { int severity = sys->get_severity(); if (severity == LOG_DEBUG || severity == LOG_INFO) return true; /* Don't log catch-all events. */ if (severity == LOG_SEV_UNKNOWN || severity == LOG_SEV_ANY) return true; if (sys->sl_severity == SL_SEV_DEBUG || sys->sl_severity == SL_SEV_INFO) return true; if (sys->err_type == SYTY_INFO) return true; return false; } /* * Use the servicelog severity if it's specified. Otherwise estimate it * from the syslog severity and error type. */ static uint8_t get_svclog_severity(SyslogEvent *sys) { if (sys->sl_severity != 0) return sys->sl_severity; switch (sys->get_severity()) { case LOG_DEBUG: return SL_SEV_DEBUG; case LOG_NOTICE: case LOG_INFO: return SL_SEV_INFO; case LOG_WARNING: return SL_SEV_WARNING; default: /* * If we get here, the syslog error level is at least LOG_ERR. */ switch (sys->err_type) { case SYTY_PERM: case SYTY_CONFIG: case SYTY_PEND: case SYTY_PERF: case SYTY_UNKNOWN: return SL_SEV_ERROR; case SYTY_BOGUS: case SYTY_TEMP: return SL_SEV_WARNING; case SYTY_INFO: return SL_SEV_INFO; } } /* NOTREACHED */ return 0; } static int get_svclog_disposition(SyslogEvent *sys) { if (sys->sl_severity != 0) { // sl_severity provided in lieu of err_type if (sys->sl_severity >= SL_SEV_ERROR_LOCAL) return SL_DISP_UNRECOVERABLE; else return SL_DISP_RECOVERABLE; } switch (sys->err_type) { case SYTY_PERM: case SYTY_CONFIG: case SYTY_PEND: return SL_DISP_UNRECOVERABLE; case SYTY_TEMP: case SYTY_INFO: case SYTY_BOGUS: return SL_DISP_RECOVERABLE; case SYTY_PERF: return SL_DISP_BYPASSED; case SYTY_UNKNOWN: /* LOG_EMERG = 0, LOG_DEBUG = 7 */ return (sys->get_severity() <= LOG_ERR ? SL_DISP_UNRECOVERABLE : SL_DISP_RECOVERABLE); } /* NOTREACHED */ return 0; } static uint32_t get_svclog_callout_type(SyslogEvent *sys) { /* err_type is valid only if sl_severity not specified */ if (sys->sl_severity == 0 && sys->err_type == SYTY_CONFIG) return RTAS_FRUID_COMP_CONFIG_ERROR; if (sys->err_class == SYCL_HARDWARE) return RTAS_FRUID_COMP_HARDWARE; return RTAS_FRUID_COMP_CODE; } /* We couldn't find VPD for the device. Provide null values. */ static void zap_callout_vpd(struct sl_callout *callout) { callout->location = svclog_string(""); callout->fru = svclog_string(""); callout->serial = svclog_string(""); callout->ccin = svclog_string(""); } static void create_svclog_callout(SyslogEvent *sys, SyslogMessage *msg, struct sl_event *svc, struct sl_callout *callout) { memset(callout, 0, sizeof(*callout)); callout->priority = sys->priority; callout->type = get_svclog_callout_type(sys); callout->procedure = strdup("see explain_syslog"); if (populate_callout_from_vpd(sys, msg, svc, callout) != 0) zap_callout_vpd(callout); svc->callouts = callout; } static void create_addl_data(SyslogEvent *sys, SyslogMessage *msg, struct sl_event *svc, struct sl_data_os *os) { memset(os, 0, sizeof(*os)); /* version set by servicelog_event_log() */ if (debug) os->version = fake_val("version"); os->subsystem = svclog_string(sys->driver->subsystem, true); os->driver = svclog_string(sys->driver->name, true); os->device = svclog_string(msg->get_device_id(sys->matched_variant), true); svc->addl_data = (struct sl_data_os*) os; } /* * servicelog can't handle apostrophes in inserted text strings, so * replace them with back-quotes. */ static void sanitize_syslog_line(string& s) { size_t pos, len = s.length(); for (pos = 0; pos < len; pos++) { if (s[pos] == '\'') s[pos] = '`'; } } static int log_event(SyslogEvent *sys, SyslogMessage *msg) { struct sl_event *svc; struct sl_callout *callout; struct sl_data_os *os_data; string description,action; svc = (struct sl_event*) malloc(sizeof(*svc)); callout = (struct sl_callout*) malloc(sizeof(*callout)); os_data = (struct sl_data_os*) malloc(sizeof(*os_data)); if (!svc || !callout || !os_data) { free(svc); free(callout); free(os_data); cerr << "Failed to log servicelog event: out of memory." << endl; return -1; } memset(svc, 0, sizeof(*svc)); /* next, id set by servicelog_event_log() */ (void) time(&svc->time_event); /* time_last_update set by servicelog_event_log() */ svc->type = SL_TYPE_OS; svc->severity = get_svclog_severity(sys); /* * platform, machine_serial, machine_model, nodename set by * servicelog_event_log() */ if (debug) { svc->platform = fake_val("platform"); svc->machine_serial = fake_val("mserial"); svc->machine_model = fake_val("model"); svc->nodename = fake_val("nodename"); } svc->refcode = svclog_string(sys->refcode); string msg_line = msg->line; sanitize_syslog_line(msg_line); description = sys->description; action = sys->action; svc->description = svclog_string("Message forwarded from syslog:\n" + msg_line + "\n Description: " + description + "\n Action: " + action ); svc->serviceable = (svc->severity >= SL_SEV_ERROR_LOCAL); svc->predictive = (sys->err_type == SYTY_PEND || sys->err_type == SYTY_PERF || sys->err_type == SYTY_UNKNOWN || sys->err_type == SYTY_TEMP); svc->disposition = get_svclog_disposition(sys); svc->call_home_status = (svc->serviceable ? SL_CALLHOME_CANDIDATE : SL_CALLHOME_NONE); svc->closed = 0; /* repair set by servicelog_event_log() */ create_svclog_callout(sys, msg, svc, callout); svc->raw_data_len = 0; svc->raw_data = NULL; create_addl_data(sys, msg, svc, os_data); int result = 0; if (debug) servicelog_event_print(stdout, svc, 1); else result = servicelog_event_log(slog, svc, NULL); if (result != 0) { cerr << "servicelog_event_log() failed, returning " << result << endl; cerr << servicelog_error(slog) << endl; } servicelog_event_free(svc); return result; } static time_t parse_date_arg(const char *date_str, const char *arg_name) { char *date_end = NULL; time_t t = parse_syslogish_date(date_str, &date_end); if (!t || *date_end != '\0') { cerr << "unrecognized date format for " << arg_name << " option" << endl; exit(1); } return t; } /* Note: Call this only with skipping_old_messages == true. */ static bool is_old_message(const char *line) { time_t t = parse_syslog_date(line, NULL); if (!t || difftime(t, begin_date) < 0) return true; if (t == begin_date && !last_msg_matched.empty()) { if (line == last_msg_matched) /* This is the last one we have to skip. */ skipping_old_messages = false; return true; } skipping_old_messages = false; return false; } /* Rename @path to @path_bak, and write @data to new file called @path. */ static void safe_overwrite(const string& data, const string& path, const string& path_bak) { const char *cpath = path.c_str(); const char *cpath_bak = path_bak.c_str(); if (rename(cpath, cpath_bak) != 0) { if (errno != ENOENT) { if (debug) { string msg = "Can't rename " + path + " to " + path_bak; perror(msg.c_str()); } return; } } FILE *f = fopen(cpath, "w"); if (!f) { if (debug) perror(cpath); goto recover; } if (fputs(data.c_str(), f) == EOF) { if (debug) perror(cpath); goto recover; } fclose(f); return; recover: if (rename(cpath_bak, cpath) != 0 && debug) { string msg = "Can't recover " + path + " from " + path_bak; perror(msg.c_str()); } fclose(f); return; } static void remember_matched_event(const string& msg) { if (msg_path && !strcmp(msg_path, syslog_path)) safe_overwrite(msg, LAST_EVENT_PATH, LAST_EVENT_PATH_BAK); } static void compute_begin_date(void) { if (msg_path && !strcmp(msg_path, syslog_path)) { /* * Read the saved copy of the last syslog message we matched. * Use that message's date as the begin date, and don't * match any events before or at that line in the message file. */ FILE *f = fopen(LAST_EVENT_PATH, "r"); if (!f) { if (errno != ENOENT && debug) perror(LAST_EVENT_PATH); return; } char line[256]; if (fgets(line, 256, f)) { last_msg_matched = line; begin_date = parse_syslog_date(line, NULL); } if (!begin_date) { fprintf(stderr, "Cannot read date from %s\n", LAST_EVENT_PATH); fclose(f); exit(3); } fclose(f); } } /* * Read msg_path by piping it through tail -F. This returns the result of * the popen() call. */ static FILE * tail_message_file(pid_t *cpid) { char *system_args[8] = {0,}; FILE *p; /* * Avoid stuff like popen("tail -F ... file; rm -rf /", "r") * when nasty msg_path = 'file; rm -rf /'. To be extra safe, * we enclose the pathname in quotes. * * Meta characters are . & ; ` ' \ " | * ? ~ < > ^ ( ) [ ] { } $ \n \r */ const char *bad_chars = ".&;`'|*?~<>^()[]{}$"; if (strpbrk(msg_path, bad_chars) || strchr(msg_path, '"') || strchr(msg_path, '\n') || strchr(msg_path, '\r')) { fprintf(stderr, "message pathname must not contain any of" " these characters: %s\n", bad_chars); return NULL; } /* * tail -F will get us past interruptions injected by logrotate * and such, but we require that the message file exist when we * start up. */ int fd = open(msg_path, O_RDONLY); if (fd < 0) { perror(msg_path); return NULL; } close(fd); system_args[0] = "/usr/bin/tail"; system_args[1] = "-F"; system_args[2] = "-n"; system_args[3] = "+0"; system_args[4] = "-s"; system_args[5] = "2"; system_args[6] = (char *)msg_path; system_args[7] = NULL; p = spopen(system_args, cpid); if (!p) { perror("tail -F of message file"); return NULL; } return p; } static FILE * open_message_file(pid_t *cpid) { FILE *f; if (follow) return tail_message_file(cpid); f = fopen(msg_path, "r"); if (!f) perror(msg_path); return f; } static void close_message_file(pid_t *cpid) { if (msg_file) { if (follow) { if (spclose(msg_file, *cpid) != 0) perror("tail -F of message file"); } else fclose(msg_file); } } static void print_help(void) { usage_message(stdout); printf( "-b begin_time\tIgnore messages with timestamps prior to begin_time.\n" "-C catalog_dir\tUse message catalog in catalog_dir. Defaults to\n" "\t\t\t/etc/ppc64-diag/message_catalog.\n" "-d\t\tPrint debugging output on stderr.\n" "-e end_time\tStop upon reading message with timestamp after end_time.\n" "-F\t\tDon't stop at EOF; process newly logged messages as they occur.\n" "-h\t\tPrint this help text and exit.\n" "-m message_file\tRead syslog messages from message_file, not stdin.\n" "-M\t\tRead syslog messages from system default location.\n" ); } int main(int argc, char **argv) { int c, result; int args_seen[0x100] = { 0 }; int platform = 0; pid_t cpid; progname = argv[0]; platform = get_platform(); cout << progname << ": is not supported on the " << __power_platform_name(platform) << " platform" << endl; exit(0); syslog_path = "/var/log/messages"; if (access(syslog_path, R_OK)) { /* use /var/log/syslog if that exists */ if (!access("/var/log/syslog", R_OK)) { syslog_path = "/var/log/syslog"; } } opterr = 0; while ((c = getopt(argc, argv, "b:C:de:Fhm:M")) != -1) { if (isalpha(c)) args_seen[c]++; switch (c) { case 'b': begin_date = parse_date_arg(optarg, "-b"); break; case 'C': catalog_dir = optarg; break; case 'd': debug = true; break; case 'e': end_date = parse_date_arg(optarg, "-e"); break; case 'F': follow = true; break; case 'h': print_help(); exit(0); case 'm': msg_path = optarg; break; case 'M': msg_path = syslog_path; follow_default = true; break; case '?': usage(); } } if (optind != argc) usage(); for (c = 0; c < 0x100; c++) { if (args_seen[c] > 1) { cerr << progname << ": duplicate " << (char) c << " args" << endl; usage(); } } if (args_seen['m'] && args_seen['M']) usage(); if (follow && !msg_path) { cerr << progname << ": cannot specify -F when messages come" " from stdin" << endl; exit(1); } if (end_date && follow) { cerr << progname << ": cannot specify both -e and -F" << endl; exit(1); } if (begin_date && end_date && difftime(begin_date, end_date) > 0) { // Note: ctime stupidly appends a newline. cerr << progname << ": end date = " << ctime(&end_date) << "precedes begin date = " << ctime(&begin_date) << endl; exit(1); } /* follow defaults to true for syslog messages, false for others. */ if (!end_date && !follow) follow = follow_default; if (!begin_date) compute_begin_date(); if (msg_path) { msg_file = open_message_file(&cpid); if (!msg_file) { perror(msg_path); exit(1); } } if (EventCatalog::parse(catalog_dir) != 0) { close_message_file(&cpid); exit(2); } result = servicelog_open(&slog, 0); if (result != 0) { cerr << "servicelog_open() failed, returning " << result << endl; close_message_file(&cpid); exit(3); } #define LINESZ 512 char line[LINESZ]; skipping_old_messages = (begin_date != 0); vector::iterator ie; while (fgets(line, LINESZ, msg_file)) { if (!strchr(line, '\n')) { /* * syslog-ng "Log statistics" messages can be very * long, so don't complain about such monstrosities * by default. */ if (debug) cerr << "message truncated to " << LINESZ-1 << " characters!" << endl; line[LINESZ-2] = '\n'; line[LINESZ-1] = '\0'; } if (skipping_old_messages && is_old_message(line)) continue; SyslogMessage msg(line); if (!msg.parsed) { if (debug) cerr << "unparsed message: " << line; continue; } if (end_date && difftime(msg.date, end_date) > 0) break; for (ie = event_catalog.events.begin(); ie < event_catalog.events.end(); ie++) { SyslogEvent *event = *ie; if (event->match(&msg, true)) { remember_matched_event(line); if (!event->exception_msg && !is_informational_event(event)) log_event(event, &msg); break; } } } servicelog_close(slog); close_message_file(&cpid); exit(0); } ppc64-diag-2.7.4/ela/README0000644000000000000000000000367013135275400011700 00000000000000Here's code to match lines from syslog output to selected messages from device drivers, and take appropriate action. For the explain_syslog program, the "appropriate action" is to report the matching line and format string, plus advice in the form of "description" and "action" text blocks. catalogs.cpp catalogs.h date.c event_gram.y event_lex.l reporter_gram.y reporter_lex.l These files implement the lexer, parser, and C++ classes for the reporter and message/event catalogs. message_catalog/ This directory contains a sample reporter catalog and some sample message-catalog files. message_catalog/with_regex/ This directory contains copies of the message-catalog files from message_catalog/, augmented by add_regex to include the regular expression(s) associated with each message statement. These are the message-catalog files that explain_syslog and syslog_to_svclog actually read. msgs This file contains a smattering of syslog messages, some of which match the patterns in the message catalog. explain_syslog.cpp This C++ program uses the aforementioned C++ classes to read the message catalog, then reads lines from syslog and prints description and action advice for each line matching a pattern in the message catalog. Typical usage, when testing: $ (cd ../lib; make) $ make $ ./explain_syslog [-d] -C message_catalog < msgs -d specifies debug output, including a dump of the message-catalog data structures. syslog_to_svclog.cpp This C++ program uses the aforementioned C++ classes to read the message catalog, then reads lines from syslog, and for each error or warning message matching one in the message catalog, logs an event to servicelog. This works only on powerpc, and only if you have the needed dependencies installed (libservicelog, libvpd, and libvpd_cxx). See the man page. doc/ man pages for explain_syslog and syslog_to_svclog add_regex.cpp This C++ program creates message_catalog/with_regex/* (which see) from message_catalog/*. ppc64-diag-2.7.4/ela/message_catalog/0000755000000000000000000000000013135275400014210 500000000000000ppc64-diag-2.7.4/ela/message_catalog/cxgb30000644000000000000000000002673513135275400015076 00000000000000subsystem: net devspec(device) = "/sys/bus/pci/devices/$device/devspec" filter: driver = "cxgb3" /* * This text is used repeatedly, so make it paste-able. * We also need to explain what to do with the info we get from #1 and #2. */ @copy version_diags_replace {{ 1. Run the "ethtool -i" command to determine the driver software level. 2. Execute diagnostics on the adapter, using "ethtool -t". 3. Replace the adapter board. }} /* cxgb3 kernel driver files have moved from drivers/net/cxgb3 to * drivers/net/ethernet/chelsio/cxgb3. */ file: " drivers/net/ethernet/chelsio/cxgb3/ael1002.c" message[defensive]: CH_WARN "PHY %u i2c read of dev.addr %#x.%#x timed out\n" file: "drivers/net/ethernet/chelsio/cxgb3/aq100x.c" message[defensive]: CH_WARN "PHY%d: reset failed (0x%x).\n" message[defensive]: CH_WARN "PHY%d: reset failed (0x%x, 0x%x).\n" message[defensive]: CH_WARN "PHY%d: reset timed out (0x%x).\n" message[defensive]: CH_WARN "PHY%d: reset took %ums\n" message[defensive]: CH_WARN "PHY%d: unsupported firmware %d\n" message[defensive]: CH_WARN "PHY%d does not start in low power mode.\n" message[defensive]: CH_WARN "PHY%d: incorrect XAUI settings (0x%x, 0x%x).\n" file: "drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c" message[chatter]: printk KERN_INFO "%s: link down\n" message[chatter]: printk KERN_INFO "%s: link up, %s, %s-duplex\n" message[chatter]: printk KERN_INFO "%s: PHY module unplugged\n" message[chatter]: printk KERN_INFO "%s: %s PHY module inserted\n" message[defensive]: CH_ERR "firmware image too large %u, expected %d\n" message[defensive]: CH_ERR "corrupted firmware image, checksum %u\n" message: dev_err "could not upgrade firmware: unable to load %s\n" description {{ The firmware on the adapter doesn't match what the driver requires. }} action {{ Verify that /lib/firmware/cxgb3 contains the correct firmware. [Where do they get the correct firmware?] [Re: your recommended action: Under what circumstances should you verify the driver software level, execute diagnostics, and/or replace the adapter?] }} class: software type: temp refcode: "cxgb3007" message[chatter]: dev_info "successful upgrade to firmware %d.%d.%d\n" message: dev_err "failed to upgrade to firmware %d.%d.%d\n" description {{ The adapter contains the wrong firmware version, so the driver tried to update the firmware to the version stored in /lib/firmware/cxgb3. This update failed. }} action {{ Verify that /lib/firmware/cxgb3 contains the correct firmware. [Under what circumstances should you verify the driver software level, execute diagnostics, and/or replace the adapter?] }} class: software type: temp refcode: "cxgb3008" message: dev_err "could not load TP SRAM: unable to load %s\n" description {{ The adapter contains the wrong microcode version, so the driver tried to update the TP SRAM to the version stored in /lib/firmware. This update failed. }} action {{ @paste version_diags_replace [Why don't we advise verifying that the correct microcode is in /lib/firmware?] }} class: software type: temp refcode: "cxgb3009" message[chatter]: dev_info "successful update of protocol engine to %d.%d.%d\n" /* This is reported right before the next message. */ message[redundant]: dev_err "failed to update of protocol engine %d.%d.%d\n" message: dev_err "loading protocol SRAM failed\n" description {{ The required version of microcode could not be written to the adapter. }} action {{ @paste version_diags_replace }} /* Shouldn't this be hardware/perm? */ class: software type: temp refcode: "cxgb3010" message: CH_WARN "FW upgrade to %d.%d.%d %s\n" description {{ The adapter's firmware is out of sync with the driver. The driver will attempt to load the correct version of firmware into the adapter. }} action {{ Refer to subsequent messages to determine whether the firmware upgrade was successful. }} class: software type: info message: CH_WARN "TP upgrade to %d.%d.%d %s\n" description {{ The adapter's microcode is out of sync with the driver. The driver will attempt to load the correct version of microcode into the adapter. }} action {{ Refer to subsequent messages to determine whether the microcode upgrade was successful. }} class: software type: info /* This next one can result from ENOMEM. */ message: CH_ERR "failed to bind qsets, err %d\n" description {{ The adapter failed to start up correctly, possibly due to a low-memory condition. }} action {{ Free up memory and retry the failed operation, or add memory to your system. If the problem persists, try the following: @paste version_diags_replace }} class: software type: perm refcode: "cxgb3011" message[defensive]: CH_ERR "request_irq failed, err %d\n" message[defensive]: dev_dbg "cannot create sysfs group\n" message[defensive]: printk KERN_WARNING "Could not initialize offload capabilities\n" message[defensive]: dev_err "Cannot re-enable PCI device after reset.\n" message[defensive]: dev_err "can't bring device back up after reset\n" message[defensive]: CH_ALERT "adapter reset %s\n" message: CH_ALERT "encountered fatal error, operation suspended\n" description {{ Adapter goes to recovery. [What does that mean?] }} action {{ @paste version_diags_replace }} class: software type: temp refcode: "cxgb3005" message[defensive]: CH_ALERT "FW status: 0x%x, 0x%x, 0x%x, 0x%x\n" message[defensive]: CH_ALERT "adapter recovering, PEX ERR 0x%x\n" message[chatter]: dev_info "Port %d using %d queue sets.\n" message[chatter]: printk KERN_INFO "%s: %s %s %sNIC (rev %d) %s%s\n" message[chatter]: printk KERN_INFO "%s: %uMB CM, %uMB PMTX, %uMB PMRX, S/N: %s\n" message[chatter]: printk KERN_INFO "%s - version %s\n" /* Replaced DRV_NAME with "cxgb3" in this next one. */ message: printk KERN_ERR "cxgb3: cannot initialize work queue\n" description {{ The driver could not initialize a work queue while probing for devices, probably because of a low-memory condition. }} action {{ Free up memory and retry the failed operation, or add memory to your system. }} class: hardware type: perm priority: H refcode: "cxgb3001" message[chatter]: dev_info "cannot obtain PCI resources\n" message: dev_err "cannot enable PCI device\n" description {{ Can't enable PCI IO and memory resources for this adapter }} action {{ @paste version_diags_replace }} class: hardware type: perm priority: H refcode: "cxgb3002" message: dev_err "unable to obtain 64-bit DMA for coherent allocations\n" description {{ Cannot obtain 64-bit DMA allocations for this adapter now. }} action {{ @paste version_diags_replace }} class: hardware type: perm priority: H refcode: "cxgb3003" message[defensive]: dev_err "no usable DMA configuration\n" message[defensive]: dev_err "cannot allocate nofail buffer\n" message: dev_err "cannot map device registers\n" description {{ Couldn't map device registers for MMIO registers access. }} action {{ @paste version_diags_replace }} class: hardware type: perm priority: H refcode: "cxgb3004" message[defensive]: dev_warn "cannot register net device %s, skipping\n" message[defensive]: dev_err "could not register any net devices\n" file: "drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c" message[chatter]: printk KERN_INFO "%s, iscsi set MaxRxData to 16224 (0x%x).\n" message[chatter]: printk KERN_INFO "%s, setting iscsi pgsz 0x%x, %u,%u,%u,%u.\n" message[defensive]: printk KERN_ERR "Unexpected SMT_WRITE_RPL status %u for entry %u\n" message[defensive]: printk KERN_ERR "Unexpected L2T_WRITE_RPL status %u for entry %u\n" message[defensive]: printk KERN_ERR "Unexpected RTE_WRITE_RPL status %u for entry %u\n" message[defensive]: printk KERN_ERR "%s: received clientless CPL command 0x%x\n" /* dup: printk KERN_ERR "%s: received clientless CPL command 0x%x\n" */ /* dup: printk KERN_ERR "%s: received clientless CPL command 0x%x\n" */ message[defensive]: printk default "%s: passive open TID %u too large\n" /* dup: printk KERN_ERR "%s: received clientless CPL command 0x%x\n" */ message[enomem]: printk default "do_abort_req_rss: couldn't get skb!\n" message[defensive]: printk default "%s: active establish TID %u too large\n" /* dup: printk KERN_ERR "%s: received clientless CPL command 0x%x\n" */ /* dup: printk KERN_ERR "%s: received clientless CPL command 0x%x\n" */ message[defensive]: printk KERN_ERR "%s: received bad CPL command 0x%x\n" message[defensive]: printk KERN_ERR "T3C: handler registration for opcode %x failed\n" message[defensive]: printk KERN_ERR "%s: CPL message (opcode %u) had unknown TID %u\n" message[enomem]: printk KERN_ERR "%s: cannot allocate skb!\n" message[defensive]: printk KERN_WARNING "%s: Redirect to non-offload device ignored.\n" message[defensive]: printk KERN_WARNING "%s: Redirect to different offload device ignored.\n" message[defensive]: printk KERN_ERR "%s: couldn't allocate new l2t entry!\n" file: "drivers/net/ethernet/chelsio/cxgb3/mc5.c" message[defensive]: CH_ERR "MC5 timeout writing to TCAM address 0x%x\n" message[defensive]: CH_ERR "TCAM reset timed out\n" message[defensive]: CH_ERR "Unsupported TCAM type %d\n" message[defensive]: CH_ALERT "MC5 parity error\n" message[defensive]: CH_ALERT "MC5 request queue parity error\n" message[defensive]: CH_ALERT "MC5 dispatch queue parity error\n" file: "drivers/net/ethernet/chelsio/cxgb3/sge.c" message[defensive]: dev_err "%s: Tx ring %u full while queue awake!\n" message[defensive]: CH_ALERT "SGE parity error (0x%x)\n" message[defensive]: CH_ALERT "SGE framing error (0x%x)\n" message[defensive]: CH_ALERT "SGE response queue credit overflow\n" message[defensive]: CH_ALERT "packet delivered to disabled response queue (0x%x)\n" message[defensive]: CH_ALERT "SGE dropped %s priority doorbell\n" message[defensive]: CH_ALERT "free list queue 0 initialization failed\n" message[defensive]: CH_WARN "free list queue 0 enabled with %d credits\n" message[defensive]: CH_WARN "free list queue 1 enabled with %d credits\n" file: "drivers/net/ethernet/chelsio/cxgb3/t3_hw.c" message[defensive]: CH_ERR "reading EEPROM address 0x%x failed\n" message[defensive]: CH_ERR "write to EEPROM address 0x%x failed\n" message[defensive]: CH_ERR "found wrong TP version (%u.%u), driver compiled for version %d.%d\n" message[defensive]: CH_ERR "corrupted protocol SRAM image, checksum %u\n" message[defensive]: CH_WARN "found old FW minor version(%u.%u), driver compiled for version %u.%u\n" message[defensive]: CH_WARN "found newer FW version(%u.%u), driver compiled for version %u.%u\n" message[defensive]: CH_ERR "corrupted firmware image, checksum %u\n" message[defensive]: CH_ERR "firmware download failed, error %d\n" message[defensive]: CH_ALERT "%s (0x%x)\n" message[defensive]: CH_WARN "%s (0x%x)\n" message[defensive]: CH_ALERT "PEX error code 0x%x\n" message[defensive]: CH_WARN "%s MC7 correctable error at addr 0x%x, data 0x%x 0x%x 0x%x\n" message[defensive]: CH_ALERT "%s MC7 uncorrectable error at addr 0x%x, data 0x%x 0x%x 0x%x\n" message[defensive]: CH_ALERT "%s MC7 parity error 0x%x\n" message[defensive]: CH_ALERT "%s MC7 address error: 0x%x\n" message[defensive]: CH_ALERT "port%d: MAC TX FIFO parity error\n" message[defensive]: CH_ALERT "port%d: MAC RX FIFO parity error\n" message[defensive]: CH_ERR "TP initialization timed out\n" message[defensive]: CH_ERR "MAC calibration failed\n" message[defensive]: CH_ERR "write to MC7 register 0x%x timed out\n" message[defensive]: CH_ERR "%s MC7 calibration timed out\n" message[defensive]: CH_ERR "%s MC7 BIST timed out\n" message[defensive]: CH_ERR "uP initialization timed out\n" message[defensive]: CH_ALERT "Invalid port type index %d\n" file: "drivers/net/ethernet/chelsio/cxgb3/xgmac.c" message[defensive]: CH_ERR "MAC %d XAUI SERDES CMU lock failed\n" message[defensive]: CH_ERR "MAC %d Rx fifo drain failed\n" ppc64-diag-2.7.4/ela/message_catalog/e1000e0000644000000000000000000007731213135275400014757 00000000000000subsystem: net devspec(device) = "/sys/bus/pci/devices/$device/devspec" devspec(netdev) = "/sys/class/net/$netdev/device/devspec" @copy diags_eeprom_replace {{ 1. Execute diagnostics on the adapter, using "ethtool -t". 2. Check the EEPROM level on the failing adapter. 3. Replace the adapter. }} /* Where do they see the errno they should check against errno.h? */ /* Note: e1000e kernel driver files have been moved from drivers/net/e1000e to * drivers/net/ethernet/intel/e1000e folder. */ file: "drivers/net/ethernet/intel/e1000e/82571.c" /* * Note: hw_dbg is now e_dbg since * kernel commit 3bb99fe226ead584a4db674dab546689f705201f * * Skip debug code. * e_dbg "Error getting PHY ID\n" * e_dbg "PHY ID unknown: type = 0x%08x\n" * e_dbg "Please update your 82571 Bootagent\n" * e_dbg "Driver can't access device - SMBI bit is set.\n" * e_dbg "Driver can't access the NVM\n" * e_dbg "Driver can't access the PHY\n" * e_dbg "nvm parameter(s) out of bounds\n" * e_dbg "MNG configuration cycle has not completed.\n" * e_dbg "PCI-E Master disable polling has failed.\n" * e_dbg "Masking off all interrupts\n" * e_dbg "Cannot acquire MDIO ownership\n" * e_dbg "Issuing a global reset to MAC\n" * e_dbg "Error initializing identification LED\n" * e_dbg "Initializing the IEEE VLAN\n" * e_dbg "Zeroing the MTA\n" * e_dbg "AN_UP -> AN_PROG\n" * e_dbg "FORCED_UP -> AN_PROG\n" * e_dbg "AN_PROG -> AN_UP\n" * e_dbg "AN_PROG -> DOWN\n" * e_dbg "Error config flow control\n" * e_dbg "AN_PROG -> FORCED_UP\n" * e_dbg "DOWN -> AN_PROG\n" * e_dbg "ANYSTATE -> DOWN\n" * e_dbg "ANYSTATE -> DOWN\n" * e_dbg "ANYSTATE -> AN_PROG\n" * e_dbg "NVM Read Error\n" */ file: "drivers/net/ethernet/intel/e1000e/80003es2lan.c" /* * e_dbg "Driver can't access resource, SW_FW_SYNC timeout.\n" * e_dbg "MNG configuration cycle has not completed.\n" * e_dbg "GG82563 PSCR: %X\n" * e_dbg "Waiting for forced speed/duplex link on GG82563 phy.\n" * e_dbg "PCI-E Master disable polling has failed.\n" * e_dbg "Masking off all interrupts\n" * e_dbg "Issuing a global reset to MAC\n" * e_dbg "Error initializing identification LED\n" * e_dbg "Initializing the IEEE VLAN\n" * e_dbg "Zeroing the MTA\n" * e_dbg "Error Resetting the PHY\n" */ file: "drivers/net/ethernet/intel/e1000e/ethtool.c" message: e_err "Unsupported Speed/Duplex configuration\n" description {{ Using the "ethtool -s" command, an attempt has been made to configure an incompatible combination of speed and duplex parameters. In particular, the only combination available for fiber is 1000 Mbps, full duplex. }} action {{ Specify a speed/duplex combination that is supported by your adapter and driver. }} class: software type: config refcode: "UnsupportSpeed/Duplex" /* dup: e_err "Unsupported Speed/Duplex configuration\n" */ message: e_err "Cannot change link characteristics when SoL/IDER is active.\n" description {{ Using the "ethtool -s" command, an attempt has been made to change link settings while a PHY (physical layer device) reset is blocked by firmware. }} action {{ 1. Try again later. 2. Execute diagnostics on the adapter, using "ethtool -t". }} class: hardware type: temp refcode: "BLKRstPHY" message: e_err "forcing MDI/MDI-X state is not supported when link speed and/or duplex are forced\n" description {{ MDI setting is only allowed when autoneg enabled because some hardware doesn't allow MDI setting when speed or duplex is forced. }} action {{ 1. Enable autoneg to allow MDI setting. 2. Don't force speed and/or duplex. }} class: hardware type: temp refcode: "MDIreqAutoneg" message[chatter]: e_info "TSO is %s\n" message[defensive]: e_err "pattern test reg %04X failed: got 0x%08X expected 0x%08X\n" message[defensive]: e_err "set/check reg %04X test failed: got 0x%08X expected 0x%08X\n" message: e_err "failed STATUS register test got: 0x%08X expected: 0x%08X\n" description {{ An adapter self-test, run with "ethtool -t ... offline", has failed reading the STATUS register. }} action {{ Run "ethtool -d" to obtain a register dump, and contact your service provider. }} class: hardware type: temp refcode: "RegTestFail" message[chatter]: e_info "testing %s interrupt\n" message: e_err "Cannot setup 1Gbps loopback.\n" description {{ Workaround: K1 must be disabled for stable 1Gbps operation 82577/8 must acquire h/w semaphore before workaround. }} action {{ 1. Re-try after some time. (?) 2. TBD }} class: hardware type: temp refcode: "AcqHwSemaphore" message: e_err "Cannot do PHY loopback test when SoL/IDER is active.\n" description {{ In an adapter self-test, run with the "ethtool -t ... offline" command, a loopback test has been cancelled because a PHY (physical layer device) reset is blocked by firmware. }} action {{ 1. Try again later. 2. In the absence of any other problem reports, it's probably OK to ignore this failure. }} class: hardware type: temp refcode: "BLKRstPHY" message[chatter]: e_info "offline testing starting\n" message[chatter]: e_info "online testing starting\n" message[defensive]: e_err "Interface does not support directed (unicast) frame wake-up packets\n" file: "drivers/net/ethernet/intel/e1000e/ich8lan.c" /* * e_dbg "Failed to initialize PHY flow\n" * e_dbg "Required LANPHYPC toggle blocked by ME\n" * e_dbg "Toggling LANPHYPC\n" * e_dbg "Cannot determine PHY addr. Erroring out\n" * e_dbg "ERROR: Flash registers not mapped\n" * e_dbg "Error configuring flow control\n" * e_dbg "contention for Phy access\n" * e_dbg "SW has already locked the resource.\n" * e_dbg "Failed to acquire the semaphore, FW or HW has it: FWSM=0x%8.8x EXTCNF_CTRL=0x%8.8x)\n" * e_dbg "Semaphore unexpectedly released by sw/fw/hw\n" * e_dbg "SHRA[%d] might be locked by ME - FWSM=0x%8.8x\n" * e_dbg "Failed to write receive address at index %d\n" * e_dbg "Unsupported SMB frequency in PHY\n" * e_dbg "SW/FW/HW has locked the resource for too long.\n" * e_dbg "Failed to acquire the semaphore.\n" * e_dbg "IFE PMC: %X\n" * e_dbg "Waiting for forced speed/duplex link on IFE phy.\n" * e_dbg "Link taking longer than expected.\n" * e_dbg "LAN_INIT_DONE not set, increase timeout\n" * e_dbg "Phy info is only valid if link is up\n" * e_dbg "Unable to determine valid NVM bank via EEC - reading flash signature\n" * e_dbg "ERROR: No valid NVM bank present\n" * e_dbg "nvm parameter(s) out of bounds\n" * e_dbg "Could not detect valid bank, assuming bank 0\n" * e_dbg "NVM read error: %d\n" * e_dbg "Flash descriptor invalid. SW Sequencing must be used." sic * e_dbg "Flash controller busy, cannot get access" sic * e_dbg "Timeout error - flash cycle did not complete." sic * e_dbg "nvm parameter(s) out of bounds\n" * e_dbg "Could not detect valid bank, assuming bank 0\n" * e_dbg "Flash commit failed.\n" * e_dbg "NVM update error: %d\n" * e_dbg "Timeout error - flash cycle did not complete." sic * e_dbg "Retrying Byte %2.2X at offset %u\n" * e_dbg "NVM Read Error\n" * e_dbg "PCI-E Master disable polling has failed.\n" * e_dbg "Masking off all interrupts\n" * e_dbg "Issuing a global reset to ich8lan\n" * e_dbg "Auto Read Done did not complete\n" * e_dbg "Error initializing identification LED\n" * e_dbg "Zeroing the MTA\n" * e_dbg "After fix-ups FlowControl is now = %x\n" * e_dbg "Workaround applies to ICH8 only.\n" * e_dbg "Failed to init PHY flow ret_val=%d\n" * e_dbg "Failed to setup iRST\n" * e_dbg "Error %d in resume workarounds\n" * e_dbg "Auto Read Done did not complete\n" * e_dbg "PHY Reset Asserted not set - needs delay\n" * e_dbg "EEPROM not present\n" */ file: "drivers/net/ethernet/intel/e1000e/mac.c" /* * e_dbg "Programming MAC Address into RAR[0]\n" * e_dbg "Clearing RAR[1-%u]\n" */ message[defensive]: printk KERN_ERR "multicast array memory allocation failed\n" /* * e_dbg "Hash value = 0x%03X\n" */ message: e_dbg "Error configuring flow control\n" description {{ After detecting a link change, the driver failed to reconfigure and restore the flow-control parameters. The failure was probably either in autonegotiation or in forcing the desired speed and duplex parameters. }} action {{ Run the ethtool command (e.g., "ethtool eth0") to check the adapter's speed/duplex and flow-control settings. }} class: hardware sl_severity: warning refcode: "ErrCfgFC" message: e_dbg "NOT RXing /C/, disable AutoNeg and force link.\n" /* Wen has: "NOT RXing, disable AutoNeg and force link" */ description {{ Autonegotiation with the adapter's link partner has failed, or the link partner is not trying to autonegotiate. The adapter will treat the link as up. }} action {{ 1. Verify that the adapter's cable to the network is plugged in. 2. Run the ethtool command (e.g., "ethtool eth0") to verify that autonegotiation is enabled. }} class: software sl_severity: warning refcode: "ErrCfgFC" /* * e_dbg "Ignoring Alternate Mac Address with MC bit set\n" * e_dbg "Error configuring flow control\n" * e_dbg "RXing /C/, enable AutoNeg and stop forcing link.\n" * dup: e_dbg "NOT RXing /C/, disable AutoNeg and force link.\n" * dup: e_dbg "Error configuring flow control\n" * dup: e_dbg "RXing /C/, enable AutoNeg and stop forcing link.\n" * e_dbg "SERDES: Link up - forced.\n" * e_dbg "SERDES: Link down - force failed.\n" * e_dbg "SERDES: Link up - autoneg completed successfully.\n" * e_dbg "SERDES: Link down - invalidcodewords detected in autoneg.\n" * e_dbg "SERDES: Link down - no sync.\n" * e_dbg "SERDES: Link down - autoneg failed\n" */ message: e_dbg "NVM Read Error\n" description {{ In an attempt to set the adapters's default flow control setting, a read from the adapter's EEPROM failed. }} action {{ @paste diags_eeprom_replace }} class: hardware sl_severity: warning refcode: "BF778E00" /* * e_dbg "After fix-ups FlowControl is now = %x\n" * e_dbg "Initializing the Flow Control address, type and timer regs\n" */ message: e_dbg "Flow control param set incorrectly\n" description {{ For a copper or forced fiber connection, the driver tried to adjust the flow-control setting, but the current setting is in error. }} action {{ 1. Run diagnostics using the "ethtool -t" command. 2. Check the flow-control settings in drivers/net/e1000e/param.c in the kernel source. [I don't see any mention of flow control in param.c] 3. Check the EEPROM level on the failing adapter. }} class: software sl_severity: warning refcode: "FCParaWrong" /* * e_dbg "Never got a valid link from auto-neg!!!\n" */ message: e_dbg "Error while checking for link\n" description {{ After autonegotiation failed, the adapter attempted to force the link up, but that also failed; no signal was detected. }} action {{ 1. Run diagnostics using the "ethtool -t" command. [And then what?] }} class: software sl_severity: warning refcode: "FCParaWrong" /* * e_dbg "Valid Link Found\n" * e_dbg "Auto-negotiation enabled\n" * e_dbg "No signal detected\n" * e_dbg "hw->fc.current_mode = %u\n" * dup: e_dbg "Flow control param set incorrectly\n" */ message: e_dbg "Error forcing flow control settings\n" description {{ For a copper or forced fiber connection, the driver's attempt to adjust the flow-control setting failed. }} action {{ 1. Run diagnostics using the "ethtool -t" command. 2. Check the flow-control settings in drivers/net/e1000e/param.c in the kernel source. [I don't see any mention of flow control in param.c] 3. Check the EEPROM level on the failing adapter. }} class: software sl_severity: warning refcode: "ErrForceFC" /* * e_dbg "Copper PHY and Auto Neg has not completed.\n" * e_dbg "Flow Control = FULL.\r\n" * e_dbg "Flow Control = RX PAUSE frames only.\r\n" * e_dbg "Flow Control = Tx PAUSE frames only.\r\n" * e_dbg "Flow Control = Rx PAUSE frames only.\r\n" * e_dbg "Flow Control = NONE.\r\n" */ message: e_dbg "Error getting link speed and duplex\n" description {{ After establishing a link, the adapter failed to obtain the link speed and duplex. }} action {{ Run the ethtool command (e.g., "ethtool eth0") to check the adapter's speed/duplex and flow-control settings. }} class: software sl_severity: warning refcode: "ErrSpeedDlx" /* * dup: e_dbg "Error forcing flow control settings\n" * e_dbg "1000 Mbs, "); sic * e_dbg "100 Mbs, "); sic * e_dbg "10 Mbs, "); sic * e_dbg "Full Duplex\n" * e_dbg "Half Duplex\n" */ message: e_dbg "Driver can't access device - SMBI bit is set.\n" description {{ The driver could not obtain exclusive access to the PHY (physical layer device) and/or NVM (non-volatile memory) as needed. }} action {{ @paste diags_eeprom_replace }} class: software sl_severity: warning refcode: "SMBIset" message: e_dbg "Driver can't access the NVM\n" description {{ The driver could not obtain exclusive access to the PHY (physical layer device) and/or NVM (non-volatile memory) as needed. }} action {{ @paste diags_eeprom_replace }} class: hardware type: perm refcode: "ErrAcessNVM" message: e_dbg "Auto read by HW from NVM has not completed.\n" description {{ The driver timed out while preparing to access the adapter's non-volatile memory. }} action {{ @paste diags_eeprom_replace }} class: hardware type: perm refcode: "AutoReadFail" /* * e_dbg "NVM Read Error\n" * e_dbg "Master requests are pending.\n" * e_dbg "Not in Adaptive IFS mode!\n" */ message: e_dbg "Could not acquire NVM grant\n" description {{ While preparing to write to the adapter's non-volatile memory, the driver timed out trying to obtain exclusive access. }} action {{ 1. Run the "ethtool -i" command to check the adapter's firmware version. 2. Check the level of the adapter's EEPROM or NVRAM. [How do you do that? What do you do with this info once you have it?] 3. Replace the adapter. }} class: hardware type: perm refcode: "GrantNVMFail" message: e_dbg "SPI NVM Status error\n" description {{ While preparing to read or write the adapter's EEPROM, the driver timed out trying to read a status register. }} action {{ @paste diags_eeprom_replace }} class: hardware type: perm refcode: "SPINVMErr" message: e_dbg "nvm parameter(s) out of bounds\n" description {{ An attempt to read or write the adapter's EEPROM failed, apparently due to an internal error or hardware error. }} action {{ @paste diags_eeprom_replace }} class: hardware type: perm refcode: "ErrCfgNVM" /* * dup: e_dbg "nvm parameter(s) out of bounds\n" * dup: e_dbg "NVM Read Error\n" * dup: e_dbg "NVM Read Error\n" * dup: e_dbg "NVM Read Error\n" * dup: e_dbg "NVM Read Error\n" * e_dbg "NVM Checksum Invalid\n" */ message: e_dbg "NVM Read Error while updating checksum.\n" description {{ At attempt to read the adapter's EEPROM (in order to compute a new checksum) failed. }} action {{ 1. Run the "ethtool -i" command to check the adapter's firmware version. 2. Check the level of the adapter's EEPROM or NVRAM. [How do you do that? What do you do with this info once you have it?] }} class: hardware type: perm refcode: "ReadNVMFail" message: e_dbg "NVM Write Error while updating checksum.\n" description {{ An attempt to write a new EEPROM checksum failed. }} action {{ 1. Run the "ethtool -i" command to check the adapter's firmware version. 2. Check the level of the adapter's EEPROM or NVRAM. [How do you do that? What do you do with this info once you have it?] }} class: hardware type: perm refcode: "WriteNVMFail" /* * e_dbg "E1000_HOST_EN bit disabled.\n" * e_dbg "Previous command timeout failed .\n" * e_dbg "NVM Read Error\n" * e_dbg "NVM Read Error\n" */ file: "drivers/net/ethernet/intel/e1000e/netdev.c" message: dev_err "RX DMA map failed\n" description {{ The driver failed to create a DMA mapping for the adapter's receive buffer. }} action {{ 1. Reduce your current use of DMA mappings. [How?] 2. Delay bringing up the network interface; try again later. 3. Reboot the system. }} class: software sl_severity: error refcode: "RxDMAFail" message[defensive]: dev_err "RX DMA page map failed\n" /* duplicate: dev_err "RX DMA map failed\n" */ /* e_dbg "%s: Receive packet consumed multiple buffers\n" */ message[defensive]: e_err "Detected Tx Unit Hang:\n" /* e_dbg "%s: Packet Split buffers didn't pick up the full packet\n" */ /* e_dbg "%s: Last part of the packet spanning multiple descriptors\n" */ /* e_dbg "failed to enable jumbo frame workaround mode\n" */ message[defensive]: e_err "ME firmware caused invalid RDT - resetting\n" message[defensive]: e_err "ME firmware caused invalid TDT - resetting\n" /* See desc in kernel commit c6e7f51e73c1bc6044bce989ec503ef2e4758d55 */ message[defensive]: e_err "Detected Hardware Unit Hang:\n" /* Kernel commit: 41cec6f1160c110bd69597c2a5611b46e8287801 */ message: e_err "Try turning off Tx pause (flow control) via ethtool\n" description {{ There is a known issue in the 82577 and 82578 device that can cause a hang in the device hardware during traffic stress; the current workaround in the driver is to disable transmit flow control by default. }} action {{ 1. Try turning off Tx pause (flow control) via ethtool 2. Re-try after disabling transmit flow control }} class: software type: config refcode: "DisableFlowCtrl" message[defensive]: e_err "pskb_may_pull failed.\n" message: e_err "Failed to initialize MSI-X interrupts. Falling back to MSI interrupts.\n" description {{ MSI-X interrupts could not be enabled for this adapter, because either the kernel or the hardware doesn't support MSI-X mode. The driver will try to use MSI mode. }} action {{ 1. Execute diagnostics on the adapter, using "ethtool -t". 2. Verify that the adapter hardware and firmware support MSI-X mode. 3. Verify that the kernel supports MSI-X mode. }} class: software type: config refcode: "EnableMSIXFailed" message: e_err "Failed to initialize MSI interrupts. Falling back to legacy interrupts.\n" description {{ MSI interrupts could not be enabled for this adapter, because either the kernel or the hardware doesn't support MSI mode. The driver will try to use LSI mode. }} action {{ 1. Execute diagnostics on the adapter, using "ethtool -t". 2. Verify that the adapter hardware and firmware support MSI mode. 3. Verify that the kernel supports MSI mode. }} class: software type: config refcode: "EnableMSIFailed" message: e_err "Unable to allocate interrupt, Error: %d\n" description {{ While bringing up a network interface, the driver failed to configure interrupts for this adapter. }} action {{ 1. Find the error code in errno.h to determine the reason for the error. 2. Execute diagnostics on the adapter, using "ethtool -t". }} class: software sl_severity: error refcode: "ReqItrFail" message: e_err "Unable to allocate memory for the transmit descriptor ring\n" description {{ While bringing up a network interface, the driver failed to allocate memory for the transmit descriptor ring, probably because the system is low on memory. }} action {{ 1. With the ethtool command (-g and -G options), reduce the size of the adapter's transmit descriptor ring. 2. Free up memory and retry the failed operation. 3. Add memory to your system. }} class: software sl_severity: error refcode: "TxDMemFail" message: e_err "Unable to allocate memory for the receive descriptor ring\n" description {{ While bringing up a network interface, the driver failed to allocate memory for the receive descriptor ring, probably because the system is low on memory. }} action {{ 1. With the ethtool command (-g and -G options), reduce the size of the adapter's receive descriptor ring. 2. Free up memory and retry the failed operation. 3. Add memory to your system. }} class: software sl_severity: error refcode: "RxDMemFail" message: e_err "Unable to allocate memory for queues\n" description {{ While bringing up a network interface, the driver failed to allocate memory for the transmit and receive queues, probably because the system is low on memory. }} action {{ 1. With the ethtool command (-g and -G options), reduce the size of the adapter's transmit and/or descriptor rings. 2. Free up memory and retry the failed operation. 3. Add memory to your system. }} class: software sl_severity: error refcode: "QueueMemFail" message: e_err "Hardware Error\n" description {{ While bringing up a network interface, the driver failed to initialize the identification LED or failed to set up link and flow control. This is a non-fatal error. }} action {{ 1. Execute diagnostics on the adapter, using "ethtool -t". 2. Check the cable connections. }} class: hardware sl_severity: warning refcode: "HrdErr" /* e_dbg "%s: icr is %08X\n" */ message[chatter]: e_info "MSI interrupt test failed!\n" /* e_dbg "%s: MSI interrupt test succeeded!\n" */ message: e_warn "MSI interrupt test failed, using legacy interrupt.\n" description {{ One of the tests run via the "ethtool -t" command failed. MSI interrupt mode is not available, so the driver will try to use LSI mode. }} action {{ 1. Find the error code in errno.h to determine the reason for the error. 2. Verify that the adapter hardware and firmware support MSI mode. 3. Verify that the kernel supports MSI mode. }} class: software sl_severity: warning refcode: "MSIFailed" /* dup: e_info "MSI interrupt test failed, using legacy interrupt.\n" */ /* TODO: Is the explanation provided by Wen (#18) correct? */ message[defensive]: e_err "Interrupt allocation failed\n" message[defensive]: e_warn "Unable to create IPMI pass-through filter\n" message: e_warn "Error reading PHY register\n" description {{ This is only a warning message. }} action {{ No action necessary. }} class: software sl_severity: warning refcode: "ErrPHY" message[chatter]: printk KERN_INFO "e1000e: %s NIC Link is Up %d Mbps %s, Flow Control: %s\n" message[chatter]: e_info "Gigabit has been disabled, downgrading speed\n" message[chatter]: e_info "Autonegotiated half duplex but link partner cannot autoneg. Try forcing full duplex if link gets many collisions.\n" message[chatter]: e_info "10/100 speed: disabling TSO\n" message[chatter]: printk KERN_INFO "e1000e: %s NIC Link is Down\n" message[defensive]: e_warn "checksum_partial proto=%x!\n" message: dev_err "TX DMA map failed\n" description {{ The driver failed to create a DMA mapping for the adapter's transmit buffer. }} action {{ 1. Reduce your current use of DMA mappings. [How?] 2. Delay bringing up the network interface; try again later. 3. Reboot the system. }} class: software sl_severity: error refcode: "TxDMAFail" message[defensive]: e_err "__pskb_pull_tail failed.\n" message: e_err "Reset adapter\n" description {{ An unexpected reset has been called because of some unexpected behaviour. }} action {{ Reset (restart?) the network interface. }} class: software type: config refcode: "ResetAdapter" message: e_err "Jumbo Frames not supported.\n" description {{ The configured MTU size is appropriate for Jumbo Frames; however, the adapter doesn't support Jumbo Frames. The default size for Jumbo Frames is 9234 bytes. }} action {{ Use the ifconfig command to set the MTU value to within the proper range. }} class: software type: config refcode: "JmbFrames" message: e_err "Unsupported MTU setting\n" description {{ Different adapters support different ranges for the MTU (maximum transmit unit) parameter. A system administrator has apparently configured an MTU value that is too small or too big. }} action {{ Use the ifconfig command to set the MTU value to within the proper range. }} class: software type: config refcode: "badMtu" message: e_err "Jumbo Frames not supported on this device when CRC stripping is disabled.\n" description {{ Jumbo frames on 82579 and newer devcies requires CRC be stripped. }} action {{ Enable CRC stripping on this device. }} class: software type: config refcode: "JmbFramesCRCStrip" message[chatter]: e_info "changing MTU from %d to %d\n" message[defensive]: e_err "Could not acquire PHY\n" message[defensive]: e_err "Could not read PHY page 769\n" message[defensive]: e_err "Could not set PHY Host Wakeup bit\n" message[defensive]: dev_warn "Disabling L1 ASPM\n" message[defensive]: dev_err "Cannot enable PCI device from suspend\n" message[chatter]: e_info "PHY Wakeup cause - %s\n" message[chatter]: e_info "MAC Wakeup cause - %s\n" message[defensive]: dev_err "Cannot re-enable PCI device after reset.\n" message: dev_err "can't bring device back up after reset\n" description {{ This error happens during Enhanced Error Handling (EEH) on the PowerPC platform. During error recovery, the attempt to resume normal operation after a PCI bus reset failed. }} action {{ 1. Obtain a dump of the kernel stack and registers, and report the problem to your service provider. [How do you obtain a strack trace that's relevant to this problem?] 2. On a PowerPC platform, you can use the hotplug command to attempt to recover the adapter, rather than rebooting the Linux partition. [Where is the hotplug command documented? Under what circumstances SHOULD you reboot the partition?] }} class: software sl_severity: error refcode: "AEREnfail" message[chatter]: e_info "(PCI Express:2.5GB/s:%s) %pM\n" message[chatter]: e_info "Intel(R) PRO/%s Network Connection\n" message[chatter]: e_info "MAC: %d, PHY: %d, PBA No: %06x-%03x\n" message[defensive]: dev_warn "Warning: detected DSPD enabled in EEPROM\n" message[defensive]: dev_warn "Warning: detected ASPM enabled in EEPROM\n" message: dev_err "No usable DMA configuration, aborting\n" description {{ Unable to enable DMA for either 32 or 64 bits with device_mask. The device driver couldn't continue to initialize the adapter because the adapter couldn't perform DMA properly on the system. [Explain device_mask, or omit the ref to it.] }} action {{ 1. Reboot Linux. 2. Verify that your kernel supports DMA mode for data transfer. [How? Is DMA support configurable?] }} class: software sl_severity: error refcode: "noDmaCfg" message: dev_err "pci_enable_pcie_error_reporting failed 0x%x\n" /* Note: Wen has this as "pci_enable_error_reporting failed\n" */ description {{ This is a non-fatal error. The driver unsuccessfully attempted to enable AER on the adapter. This error means either the system doesn't support AER or the adapter doesn't support AER. The driver will continue to initialize the adapter. }} action {{ 1. Verify that your Linux kernel supports AER. 2. Verify that your adapter supports AER. }} class: software sl_severity: warning refcode: "AEREnfail" message: e_info "PHY reset is blocked due to SOL/IDER session.\n" description {{ The reset of the PHY (physical layer device) is blocked, but the driver continues to initialize the adapter. }} action {{ No action required. }} class: software type: info refcode: "PhyRstBlk" message: e_err "The NVM Checksum Is Not Valid\n" description {{ The driver has given up trying to initialize the adapter because the adapter's EEPROM checksum is incorrect. }} action {{ @paste diags_eeprom_replace }} class: hardware type: perm refcode: "BF778E00" priority: H /* dup: dev_err "The NVM Checksum Is Not Valid\n" */ message: e_err "NVM Read Error while reading MAC address\n" description {{ The driver was unable to read the MAC address from the adapter's EEPROM. }} action {{ @paste diags_eeprom_replace }} class: software sl_severity: warning refcode: "RdMAC" /* dup: dev_err "NVM Read Error while reading MAC address\n" */ message: e_err "Invalid MAC Address: %pM\n" description {{ The MAC address read from the adapter's EEPROM is not a valid Ethernet address. }} action {{ @paste diags_eeprom_replace }} class: hardware type: perm refcode: "BF778E00" priority: H /* dup: dev_err "Invalid MAC Address: %pM\n" */ message: dev_err "pci_disable_pcie_error_reporting failed 0x%x\n" /* Note: Wen has this as "pci_disable_error_reporting failed\n" */ description {{ This is a non-fatal error. The driver unsuccessfully attempted to disable AER on the adapter. This error means either the system doesn't support AER or the adapter doesn't support AER. }} action {{ Verify that the adapter supports AER. If it doesn't, don't try to enable or disable AER for it. [How can the customer affect this?] }} class: software sl_severity: warning refcode: "AERDisfail" message[chatter]: printk KERN_INFO "%s: Intel(R) PRO/1000 Network Driver - %s\n" message[chatter]: printk KERN_INFO "%s: Copyright (c) 1999-2008 Intel Corporation.\n" file: "drivers/net/ethernet/intel/e1000e/param.c" message[chatter]: e_info "%s Enabled\n" message[chatter]: e_info "%s Disabled\n" message[chatter]: e_info "%s set to %i\n" /* Omit this: it would match everything. e_info "%s\n" */ message[chatter]: e_info "Invalid %s value specified (%i) %s\n" message: e_notice "Warning: no configuration for board #%i\n" description {{ The number of network adapters in the system that are associated with the e1000e driver exceeds E1000_MAX_NIC, as defined in e1000_param.c of the driver source. }} action {{ Change E1000_MAX_NIC in e1000_param.c and rebuild the driver. ["(ii) Change the startup module parameter." How would this work? It appears that E1000_MAX_NIC is a compile-time constant.] }} class: software type: config refcode: "noBoard" message[defensive]: e_notice "Using defaults for all values\n" message[chatter]: dev_info "%s set to default %d\n" message[chatter]: e_info "%s turned off\n" message[chatter]: e_info "%s set to dynamic mode\n" message[chatter]: e_info "%s set to dynamic conservative mode\n" message[chatter]: dev_info "%s set to simplified (2000-8000 ints) mode\n" file: "drivers/net/ethernet/intel/e1000e/phy.c" /* * e_dbg "PHY Address %d is out of range\n" * e_dbg "MDI Read did not complete\n" * e_dbg "MDI Error\n" * e_dbg "PHY Address %d is out of range\n" * e_dbg "MDI Write did not complete\n" * e_dbg "MDI Error\n" * e_dbg "Setting page 0x%x\n" * e_dbg "Error committing the PHY changes\n" * e_dbg "Error resetting the PHY.\n" * e_dbg "Error Disabling LPLU D0\n" * e_dbg "autoneg_advertised %x\n" * e_dbg "Advertise 10mb Half duplex\n" * e_dbg "Advertise 10mb Full duplex\n" * e_dbg "Advertise 100mb Half duplex\n" * e_dbg "Advertise 100mb Full duplex\n" * e_dbg "Advertise 1000mb Half duplex request denied!\n" * e_dbg "Advertise 1000mb Full duplex\n" * e_dbg "Flow control param set incorrectly\n" * e_dbg "Auto-Neg Advertising %x\n" * e_dbg "Reconfiguring auto-neg advertisement params\n" * e_dbg "Error Setting up Auto-Negotiation\n" * e_dbg "Restarting Auto-Neg\n" * e_dbg "Error while waiting for autoneg to complete\n" * e_dbg "Forcing Speed and Duplex\n" * e_dbg "Error Forcing Speed and Duplex\n" * e_dbg "Valid link established!!!\n" * e_dbg "Unable to establish link!!!\n" * e_dbg "IGP PSCR: %X\n" * e_dbg "Waiting for forced speed/duplex link on IGP phy.\n" * e_dbg "Link taking longer than expected.\n" * e_dbg "M88E1000 PSCR: %X\n" * e_dbg "Waiting for forced speed/duplex link on M88 phy.\n" * e_dbg "Link taking longer than expected.\n" * e_dbg "IFE PMC: %X\n" * e_dbg "Waiting for forced speed/duplex link on IFE phy.\n" * e_dbg "Link taking longer than expected.\n" * e_dbg "Half Duplex\n" * e_dbg "Full Duplex\n" * e_dbg "Forcing 100mb\n" * e_dbg "Forcing 10mb\n" * e_dbg "Phy info is only valid for copper media\n" * e_dbg "Phy info is only valid if link is up\n" * e_dbg "Phy info is only valid if link is up\n" * e_dbg "Running IGP 3 PHY init script\n" * e_dbg "Could not set Port Control page\n" * e_dbg "Could not read PHY register %d.%d\n" * e_dbg "Could not write PHY register %d.%d\n" * e_dbg "Could not set Port Control page\n" * e_dbg "Could not restore PHY register %d.%d\n" * e_dbg "Attempting to access page %d while gig enabled.\n" * e_dbg "Could not enable PHY wakeup reg access\n" * e_dbg "Accessing PHY page %d reg 0x%x\n" * e_dbg "Could not write address opcode to page %d\n" * e_dbg "Could not access PHY reg %d.%d\n" * e_dbg "reading PHY page %d (or 0x%x shifted) reg 0x%x\n" * e_dbg "writing PHY page %d (or 0x%x shifted) reg 0x%x\n" * e_dbg "Could not write the Address Offset port register\n" * e_dbg "Could not access the Data port register\n" * e_dbg "Attempting to access page 800 while gig enabled\n" * e_dbg "Could not acquire PHY\n" * e_dbg "Could not write PHY the HV address register\n" * e_dbg "Could not read data value from HV data register\n" * e_dbg "I82577_PHY_CTRL_2: %X\n" * e_dbg "Waiting for forced speed/duplex link on 82577 phy\n" * e_dbg "Link taking longer than expected.\n" * e_dbg "Phy info is only valid if link is up\n" */ ppc64-diag-2.7.4/ela/message_catalog/exceptions0000644000000000000000000000524313135275400016240 00000000000000/* * The exceptions catalog. Can also be thought of as the "fallbacks" * catalog, since it provides a convenient shorthand for classifying * messages that we don't have explicit advice for. * * Given these fallbacks, there's very little excuse for excluding * any of your driver's messages from the catalog. * * Note that there's no exception type specifically for messages * that you deem self-explanatory. If it's a self-explanatory, * low-severity message (e.g., notice, info, debug), label it * "chatter". Otherwise it probably warrants a servicelog record, * so you need to provide the appropriate info. */ exception: chatter description {{ This message is logged as part of normal operations. }} action {{ No action required. }} exception: redundant description {{ No explanation is provided for this message because it typically accompanies one or more other messages for which explanations are provided. }} action {{ Refer to explanations for other messages logged at about the same time. If no such explanations can be found, please report this situation to your service provider. }} exception: fragment description {{ This line is the second or subsequent line in a multi-line message. }} action {{ Refer to explanations for messages logged previously at about the same time. }} /* * Use this for those defensive printks used to log failures that you * never expect to see. */ exception: defensive description {{ This message is not expected to be logged during normal operation or any anticipated failure scenario. No explanation is currently available. }} action {{ Refer to explanations of related messages, if any. Report this situation to your service provider. }} /* * Typically used with printks associated with ENOMEM failures. * A special case of "defensive" printks. */ exception: enomem description {{ This message typically indicates that the system is low on memory. }} action {{ Free up memory and retry the failed operation, or add memory to your system. }} exception: unknown description {{ We don't know why this message was logged. }} action {{ Refer to explanations of related messages, if any. Report this situation to your service provider. }} /* * Used to match messages that appear to come from our driver, but * are missing from our driver's message catalog. Typical usage: * message[catchall]: printk any "cxgb3 %s\n" * message[catchall]: printk any "cxgb3: %s\n" */ exception: catchall description {{ There is no match for this message in the message catalog. The message catalog may be out of sync with the related system software. }} action {{ Refer to explanations of related messages, if any. Report this situation to your service provider. }} ppc64-diag-2.7.4/ela/message_catalog/gpfs0000755000000000000000000000215713135275400015022 00000000000000subsystem: gpfs message: mmfs_failed "\n" description {{ A disk has failed or is not responding. The filesystem is still operational. }} action {{ Ignore }} class: software sl_severity: warning refcode: "" message: mmfs_pathfail "\n" description {{ A path to a disk is no longer usable. Probable cause: SAS adapter, cable, port expander or disk carrier. }} action {{ Ignore }} class: software sl_severity: warning refcode: "" message: mmfs_recovered "\n" description {{ A disk previously reported as not responding has been found and is working. }} action {{ Ignore }} class: software sl_severity: warning refcode: "" message: mmfs_replace "\n" description {{ The disk replacement threshold has been met for the given failed disk. The disk must be replaced. }} action {{ Notify administrator. }} class: software sl_severity: error refcode: "EF000001" message: mmfs_rebuild "\n" description {{ There is not enough available spare space to reestablish full redundancy in a declustered array. Customer may be in danger of data loss. }} action {{ Notify administrator. }} class: software sl_severity: error refcode: "EF000002" ppc64-diag-2.7.4/ela/message_catalog/ipr0000644000000000000000000010162613135275400014653 00000000000000subsystem: scsi file: "drivers/scsi/ipr.c" message[defensive]: dev_err "Failed to save PCI-X command register\n" message[defensive]: dev_err "Failed to setup PCI-X command register\n" message[defensive]: dev_err "Host RCB failed with IOASC: 0x%08X\n" /***** * Skipping all of the following because they report additional info * subsequent to "real" error messages. 979: ipr_hcam_err(hostrcb, "%s VPID/SN: %s\n" 998: ipr_err("Vendor/Product ID: %s\n" 1002: ipr_err(" Serial Number: %s\n" 1018: ipr_hcam_err(hostrcb, "%s WWN: %08X%08X\n" 1032: ipr_err(" WWN: %08X%08X\n" 1050: ipr_err("-----Current Configuration-----\n" 1051: ipr_err("Cache Directory Card Information:\n" 1053: ipr_err("Adapter Card Information:\n" 1056: ipr_err("-----Expected Configuration-----\n" 1057: ipr_err("Cache Directory Card Information:\n" 1059: ipr_err("Adapter Card Information:\n" 1062: ipr_err("Additional IOA Data: %08X %08X %08X\n" 1082: ipr_err("-----Current Configuration-----\n" 1083: ipr_err("Cache Directory Card Information:\n" 1085: ipr_err("Adapter Card Information:\n" 1088: ipr_err("-----Expected Configuration-----\n" 1089: ipr_err("Cache Directory Card Information:\n" 1091: ipr_err("Adapter Card Information:\n" 1094: ipr_err("Additional IOA Data: %08X %08X %08X\n" 1118: ipr_err("Device Errors Detected/Logged: %d/%d\n" 1126: ipr_phys_res_err(ioa_cfg, dev_entry->dev_res_addr, "Device %d", i + 1); 1129: ipr_err("-----New Device Information-----\n" 1132: ipr_err("Cache Directory Card Information:\n" 1135: ipr_err("Adapter Card Information:\n" 1158: ipr_err("Device Errors Detected/Logged: %d/%d\n" 1166: ipr_phys_res_err(ioa_cfg, dev_entry->dev_res_addr, "Device %d", i + 1); 1169: ipr_err("-----New Device Information-----\n" 1172: ipr_err("Cache Directory Card Information:\n" 1175: ipr_err("Adapter Card Information:\n" 1178: ipr_err("Additional IOA Data: %08X %08X %08X %08X %08X\n" 1207: ipr_err("RAID %s Array Configuration: %d:%d:%d:%d\n" 1225: ipr_err("Exposed Array Member %d:\n" 1227: ipr_err("Array Member %d:\n" 1230: ipr_phys_res_err(ioa_cfg, array_entry->dev_res_addr, "Current Location"); 1231: ipr_phys_res_err(ioa_cfg, array_entry->expected_dev_res_addr, "Expected Location"); 1258: ipr_err("RAID %s Array Configuration: %d:%d:%d:%d\n" 1274: ipr_err("Exposed Array Member %d:\n" 1276: ipr_err("Array Member %d:\n" 1280: ipr_phys_res_err(ioa_cfg, array_entry->dev_res_addr, "Current Location"); 1281: ipr_phys_res_err(ioa_cfg, array_entry->expected_dev_res_addr, "Expected Location"); 1313: ipr_err("%08X: %08X %08X %08X %08X\n" *****/ /***** * Omitting these because they could report any of a number of errors. 1338: ipr_hcam_err(hostrcb, "%s [PRC: %08X]\n" 1364: ipr_hcam_err(hostrcb, "%s [PRC: %08X]\n" *****/ /***** * Skipping all of the following because they report additional info * subsequent to "real" error messages. 1417: ipr_hcam_err(hostrcb, "%s %s: IOA Port=%d\n" 1421: ipr_hcam_err(hostrcb, "%s %s: IOA Port=%d, Phy=%d\n" 1425: ipr_hcam_err(hostrcb, "%s %s: IOA Port=%d, Cascade=%d\n" 1429: ipr_hcam_err(hostrcb, "%s %s: IOA Port=%d, Cascade=%d, Phy=%d\n" 1437: ipr_err("Path state=%02X IOA Port=%d Cascade=%d Phy=%d\n" 1509: ipr_hcam_err(hostrcb, "%s %s: Phy=%d, Link rate=%s, WWN=%08X%08X\n" 1515: ipr_hcam_err(hostrcb, "%s %s: Link rate=%s, WWN=%08X%08X\n" 1520: ipr_hcam_err(hostrcb, "%s %s: Phy=%d, Link rate=%s, " 1526: ipr_hcam_err(hostrcb, "%s %s: Cascade=%d, Link rate=%s, " 1532: ipr_hcam_err(hostrcb, "%s %s: Cascade=%d, Phy=%d, Link rate=%s " 1543: ipr_hcam_err(hostrcb, "Path element=%02X: Cascade=%d Phy=%d Link rate=%s " *****/ /***** * Omitting this because it could report any of a number of errors. 1567: ipr_hcam_err(hostrcb, "%s\n" *****/ message[defensive]: dev_err "Error notifications lost\n" message[defensive]: dev_err "Host RCB failed with IOASC: 0x%08X\n" message[defensive]: dev_err "Adapter being reset due to command timeout.\n" message[defensive]: dev_err "Adapter timed out transitioning to operational.\n" message[defensive]: dev_err "IOA dump long data transfer timeout\n" message[defensive]: dev_err "IOA dump short data transfer timeout\n" message[defensive]: dev_err "Invalid dump table format: %lx\n" message[defensive]: dev_err "Dump of IOA initiated\n" message[defensive]: dev_err "Dump of IOA failed. Dump table not valid: %d, %X.\n" message[defensive]: dev_err "Dump of IOA completed.\n" message[chatter]: dev_info "%s adapter write cache.\n" message[defensive]: dev_err "Microcode download already in progress\n" message[defensive]: dev_err "Failed to map microcode download buffer!\n" message[defensive]: dev_err "Firmware file %s not found\n" message[defensive]: dev_err "Invalid microcode buffer\n" message[defensive]: dev_err "Microcode buffer allocation failed\n" message[defensive]: dev_err "Microcode buffer copy to DMA buffer failed\n" message[defensive]: ipr_err "Dump memory allocation failed\n" message[defensive]: dev_err "Adapter being reset as a result of error recovery.\n" message[defensive]: scmd_printk KERN_ERR "Resetting device\n" message[defensive]: sdev_printk KERN_ERR "Abort timed out. Resetting bus.\n" message[defensive]: scmd_printk KERN_ERR "Aborting command: %02X\n" message[defensive]: dev_err "Permanent IOA failure. 0x%08X\n" message[defensive]: dev_err "Invalid response handle from IOA\n" message[defensive]: dev_err "pci_map_sg failed!\n" message[defensive]: scmd_printk KERN_ERR "Request Sense failed with IOASC: 0x%08X\n" /***** * Skipping the following because they report additional info * subsequent to "real" error messages. 4568: ipr_err("IOASA Dump:\n" 4571: ipr_err("%08X: %08X %08X %08X %08X\n" *****/ message[chatter]: dev_info "IOA initialized.\n" message[defensive]: dev_err "Term power is absent on scsi bus %d\n" message[defensive]: dev_err "Invalid resource address reported: 0x%08X\n" message[defensive]: dev_err "0x%02X failed with IOASC: 0x%08X\n" message[defensive]: dev_err "Microcode download required\n" message[defensive]: dev_err "Too many devices attached\n" message[chatter]: dev_info "Adapter firmware version: %02X%02X%02X%02X\n" message[chatter]: dev_info "Starting IOA initialization sequence.\n" message[chatter]: dev_info "Initializing IOA.\n" message[defensive]: dev_err "IOA unit check with no data\n" message[defensive]: dev_err "IOA taken offline - error recovery failed\n" message[defensive]: dev_dbg "ioa_cfg adx: 0x%p\n" message[defensive]: dev_err "Adapter not supported in this hardware configuration.\n" message[defensive]: dev_err "Can not assign irq %d\n" message[chatter]: dev_info "IRQ assigned: %d\n" message[chatter]: dev_info "MSI test failed. Falling back to LSI.\n" message[chatter]: dev_info "MSI test succeeded.\n" message[defensive]: dev_err "Cannot enable adapter\n" message[chatter]: dev_info "Found IOA with IRQ: %d\n" message[defensive]: dev_err "call to scsi_host_alloc failed!\n" message[defensive]: dev_err "Unknown adapter chipset 0x%04X 0x%04X\n" message[defensive]: dev_err "Couldn't register memory range of registers\n" message[defensive]: dev_err "Couldn't map memory range of registers\n" message[defensive]: dev_err "Failed to set PCI DMA mask\n" message[defensive]: dev_err "Write of cache line size failed\n" message[chatter]: dev_info "MSI enabled with IRQ: %d\n" message[chatter]: dev_info "Cannot enable MSI.\n" message[defensive]: dev_err "Failed to save PCI config space\n" message[defensive]: dev_err "Couldn't allocate enough memory for device driver!\n" message[defensive]: dev_err "Couldn't register IRQ %d! rc=%d\n" message[chatter]: ipr_info "IBM Power RAID SCSI Device Driver version: %s %s\n" /***** ***** The rest of this catlog was generated automatically from ***** ipr_error_table[]. *****/ message: ipr_hcam_err "FFF9: Device sector reassign successful\n" description {{ Device sector reassign successful. }} action {{ None required }} class: software type: info refcode: "" message: ipr_hcam_err "FFF7: Media error recovered by device rewrite procedures\n" description {{ Media error recovered by device rewrite procedures. }} action {{ None required }} class: unknown type: info refcode: "" message: ipr_hcam_err "7001: IOA sector reassignment successful\n" description {{ IOA sector reassignment successful }} action {{ If three 7001 messages have occurred for the same disk drive location, then exchange the failing items in the Failing Items list one at a time. If the problem is not resolved, perform “MAP 3351†on page 104 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "FFF9: Soft media error. Sector reassignment recommended\n" description {{ Soft media error. Sector reassignment recommended. }} action {{ None required }} class: software type: info refcode: "" message: ipr_hcam_err "FFF7: Media error recovered by IOA rewrite procedures\n" description {{ Media error recovered by IOA rewrite procedures. }} action {{ None required }} class: unknown type: info refcode: "" message: ipr_hcam_err "FF3D: Soft PCI bus error recovered by the IOA\n" description {{ Soft PCI bus error recovered by the IOA. }} action {{ If 10 FF3D messages have occurred for the same I/O Adapter physical location within a week, then exchange the failing items in the Failing Items list one at a time. }} class: hardware sl_severity: error refcode: "" message: ipr_res_err "FFF6: Device hardware error recovered by the IOA\n" description {{ Device hardware error recovered by the IOA. }} action {{ None required }} class: hardware type: info refcode: "" message: ipr_hcam_err "FFF6: Device hardware error recovered by the IOA\n" description {{ Device hardware error recovered by the IOA. }} action {{ None required }} class: hardware type: info refcode: "" message: ipr_hcam_err "FFF6: Device hardware error recovered by the device\n" description {{ Device hardware error recovered by the device. }} action {{ None required }} class: hardware type: info refcode: "" message: ipr_res_err "FF3D: Soft IOA error recovered by the IOA\n" description {{ Soft IOA error recovered by the IOA. }} action {{ If 10 FF3D messages have occurred for the same I/O Adapter physical location within a week, then exchange the failing items in the Failing Items list one at a time. }} class: unknown sl_severity: error refcode:"" message: ipr_hcam_err "FF3D: Soft IOA error recovered by the IOA\n" description {{ Soft IOA error recovered by the IOA. }} action {{ If 10 FF3D messages have occurred for the same I/O Adapter physical location within a week, then exchange the failing items in the Failing Items list one at a time. }} class: unknown type: info refcode: "" message: ipr_hcam_err "FFFA: Undefined device response recovered by the IOA\n" description {{ Undefined device response recovered by the IOA. }} action {{ If 10 FFFA messages have occurred for the same disk drive location in a one-week time period, then exchange the failing items in the Failing Items list one at a time. If the problem is not resolved, perform “MAP 3351†on page 104 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "FFF6: Failure prediction threshold exceeded\n" description {{ Failure prediction threshold exceeded. }} action {{ Exchange the failing items in the Failing Items list one at a time. If the problem is not resolved, perform “MAP 3351†on page 104 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown type: info refcode: "" message: ipr_hcam_err "8009: Impending cache battery pack failure\n" description {{ Impending cache battery pack failure. }} action {{ Perform “MAP 3300†on page 90 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: hardware sl_severity: error refcode: "" message: ipr_hcam_err "3020: Storage subsystem configuration error\n" description {{ Storage subsystem configuration error. }} action {{ Perform “MAP 3350†on page 101 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: software sl_severity: error refcode: "" message: ipr_hcam_err "FFF3: Disk media format bad\n" description {{ Disk media format bad. }} action {{ Perform “MAP 3335†on page 97 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: hardware sl_severity: error refcode: "" message: ipr_hcam_err "3002: Addressed device failed to respond to selection\n" description {{ Addressed device failed to respond to selection. }} action {{ Exchange the failing items in the Failing Items list one at a time. If the problem is not resolved, perform “MAP 3351†on page 104 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: hardware sl_severity: error refcode: "" message: ipr_res_err "3100: Device bus error\n" description {{ Device bus error. }} action {{ A SAS fabric error occurred. Perform “MAP 3350†on page 101 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: hardware sl_severity: error refcode: "" message: ipr_hcam_err "3100: Device bus error\n" description {{ Device bus error. }} action {{ A SAS fabric error occurred. Perform “MAP 3350†on page 101 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: hardware sl_severity: error refcode: "" message: ipr_hcam_err "3109: IOA timed out a device command\n" description {{ IOA timed out a device command. }} action {{ Perform “MAP 3350†on page 101 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "4100: Hard device bus fabric error\n" description {{ Hard device bus fabric error. }} action {{ Perform “MAP 3352†on page 105 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "9000: IOA reserved area data check\n" description {{ IOA reserved area data check. }} action {{ Perform “MAP 3390†on page 106 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: software type: info refcode: "" message: ipr_hcam_err "9001: IOA reserved area invalid data pattern\n" description {{ IOA reserved area invalid data pattern. }} action {{ Perform “MAP 3337†on page 98 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "9002: IOA reserved area LRC error\n" description {{ IOA reserved area LRC error. }} action {{ Perform “MAP 3390†on page 106 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "102E: Out of alternate sectors for disk storage\n" description {{ Out of alternate sectors for disk storage. }} action {{ Exchange the failing items in the Failing Items list one at a time. If the problem is not resolved, perform MAP 3351 on page 104 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: error refcode: "" message: ipr_res_err "FFF4: Data transfer underlength error\n" description {{ Data transfer underlength error. }} action{{ Exchange the failing items in the Failing Items list one at a time. If the problem is not resolved, perform “MAP 3351†on page 104 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "FFF4: Data transfer underlength error\n" description {{ Data transfer underlength error. }} action {{ Exchange the failing items in the Failing Items list one at a time. If the problem is not resolved, perform “MAP 3351†on page 104 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: error refcode: "" message: ipr_res_err "FFF4: Data transfer overlength error\n" description {{ Data transfer overlength error. }} action {{ Exchange the failing items in the Failing Items list one at a time. If the problem is not resolved, perform “MAP 3351†on page 104 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: software sl_severity: error refcode: "" message: ipr_hcam_err "FFF4: Data transfer overlength error\n" description {{ Data transfer overlength error. }} action {{ Exchange the failing items in the Failing Items list one at a time. If the problem is not resolved, perform “MAP 3351†on page 104 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "3400: Logical unit failure\n" description {{ Device, I/O Adapter, Any device on I/O bus, Signal cables. }} action {{ Exchange the failing items in the Failing Items list one at a time. }} class: hardware sl_severity: error refcode: "" message: ipr_hcam_err "FFF4: Device microcode is corrupt\n" description {{ Device microcode is corrupt. }} action {{ Exchange the failing items in the Failing Items list one at a time. If the problem is not resolved, perform “MAP 3351†on page 104 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: error refcode: "" message: ipr_res_err "8150: PCI bus error\n" description {{ PCI bus error. }} action {{ If two errors have occurred for the same I/O adapter in 24 hours, exchange the failing items in the Failing Items list one at a time. }} class: hardware sl_severity: error refcode: "" message: ipr_hcam_err "8150: PCI bus error\n" description {{ PCI bus error. }} action {{ If two errors have occurred for the same I/O adapter in 24 hours, exchange the failing items in the Failing Items list one at a time. }} class: hardware sl_severity: error refcode: "" message: ipr_res_err "FFF4: Disk device problem\n" description {{ Disk device problem. }} action {{ Exchange the failing items in the Failing Items list one at a time. If the problem is not resolved, perform “MAP 3351†on page 104 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: hardware sl_severity: error refcode: "" message: ipr_hcam_err "FFF4: Disk device problem\n" description {{ Disk device problem. }} action {{ Exchange the failing items in the Failing Items list one at a time. If the problem is not resolved, perform “MAP 3351†on page 104 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: hardware sl_severity: error refcode: "" message: ipr_res_err "8150: Permanent IOA failure\n" description {{ Permanent IOA failure. }} action {{ Exchange the failing items in the Failing Items list one at a time. }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "8150: Permanent IOA failure\n" description {{ Permanent IOA failure. }} action {{ Exchange the failing items in the Failing Items list one at a time. }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "3010: Disk device returned wrong response to IOA\n" description {{ Disk device returned wrong response to IOA. }} action {{ Exchange the failing items in the Failing Items list one at a time. If the problem is not resolved, perform “MAP 3351†on page 104 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "8151: IOA microcode error\n" description {{ IOA microcode error. }} action {{ Update adapter microcode. See “Updating the controller microcode†on page 63 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf If the problem is not resolved, exchange the failing items in the Failing Items list one at a time. }} class: unknown sl_severity: error refcode:"" message: ipr_hcam_err "8157: IOA error requiring IOA reset to recover\n" description {{ IOA error requiring IOA reset to recover. }} action {{ If two 8157 messages have occurred for the same I/O adapter location, exchange the failing items in the Failing Items list one at a time. }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "8008: A permanent cache battery pack failure occurred\n" description {{ A permanent cache battery pack failure occurred. }} action {{ Perform “MAP 3300†on page 90 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: hardware sl_severity: error refcode: "" message: ipr_hcam_err "9090: Disk unit has been modified after the last known status\n" description {{ Disk unit has been modified after the last known status. }} action {{ Perform “MAP 3333†on page 95 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: hardware sl_severity: warning refcode: "" message: ipr_hcam_err "9081: IOA detected device error\n" description {{ IOA detected device error. }} action {{ Exchange the failing items in the Failing Items list one at a time. }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "9082: IOA detected device error\n" description {{ IOA detected device error. }} action {{ Exchange the failing items in the Failing Items list one at a time. }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "9091: Incorrect hardware configuration change has been detected\n" description {{ Incorrect hardware configuration change has been detected. }} action {{ Perform “MAP 3333†on page 95 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: hardware sl_severity: error refcode: "" message: ipr_hcam_err "4010: Incorrect connection between cascaded expanders\n" description {{ Incorrect connection between cascaded expanders. }} action {{ Perform “MAP 3342†on page 99 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: hardware sl_severity: error refcode: "" message: ipr_hcam_err "4020: Connections exceed IOA design limits\n" description {{ Connections exceed IOA design limits. }} action {{ Perform “MAP 3343†on page 99 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "4030: Incorrect multipath connection\n" description {{ Incorrect multipath connection. }} action {{ Perform “MAP 3344†on page 100 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: hardware sl_severity: error refcode: "" message: ipr_hcam_err "4110: Unsupported enclosure function\n" description {{ Unsupported enclosure function. }} action {{ Perform “MAP 3345†on page 100 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "FFF4: Command to logical unit failed\n" description {{ Command to logical unit failed. }} action {{ Exchange the failing items in the Failing Items list one at a time. If the problem is not resolved, perform “MAP 3351†on page 104 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "9031: Array protection temporarily suspended, protection resuming\n" description {{ Array protection temporarily suspended, protection resuming. }} action {{ Perform “MAP 3310†on page 91 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown type: info refcode: "" message: ipr_hcam_err "9040: Array protection temporarily suspended, protection resuming\n" description {{ Array protection temporarily suspended, protection resuming. }} action {{ No action required. The array is synching. Wait until the synch is complete. }} class: unknown type: info refcode: "" message: ipr_hcam_err "3020: IOA detected a SCSI bus configuration error\n" description {{ IOA detected a SCSI bus configuration error. }} action {{ Perform “MAP 3350†on page 101 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "4040: Incomplete multipath connection between IOA and enclosure\n" description {{ Incomplete multipath connection between IOA and enclosure. }} action {{ Perform “MAP 3344†on page 100 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "4041: Incomplete multipath connection between enclosure and device\n" description {{ Incomplete multipath connection between enclosure and device. }} action {{ Perform “MAP 3346†on page 100 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "9075: Incomplete multipath connection between IOA and remote IOA\n" description {{ Incomplete multipath connection between IOA and remote IOA. }} action {{ Perform “MAP 3349†on page 101 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "4050: Enclosure does not support a required multipath function\n" description {{ Enclosure does not support a required multipath function. }} action {{ Perform “MAP 3348†on page 101 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "9041: Array protection temporarily suspended\n" description {{ Array protection temporarily suspended. }} action {{ Background array parity checking detected and errors corrected. Perform “MAP 3390†on page 106 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: warning refcode: "" message: ipr_hcam_err "9042: Corrupt array parity detected on specified device\n" description {{ Corrupt array parity detected on specified device. }} action {{ Perform “MAP 3390†on page 106 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "9030: Array no longer protected due to missing or failed disk unit\n" description {{ Array no longer protected due to missing or failed disk unit. }} action {{ Perform “MAP 3310†on page 91 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "9032: Array exposed but still protected\n" description {{ Array exposed but still protected. }} action {{ Perform “MAP 3310†on page 91 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "4061: Multipath redundancy level got better\n" description {{ Multipath redundancy level got better. }} action {{ None required }} class: unknown type: info refcode: "" message: ipr_hcam_err "4060: Multipath redundancy level got worse\n" description {{ Multipath redundancy level got worse. }} action {{ Perform “MAP 3353†on page 106 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "9008: IOA does not support functions expected by devices\n" description {{ IOA does not support functions expected by devices. }} action {{ Perform “MAP 3330†on page 94 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: warning refcode: "" message: ipr_hcam_err "9020: Array missing 2 or more devices with only 1 device present\n" description {{ Array missing 2 or more devices with only 1 device present. }} action {{ Perform “MAP 3311†on page 92 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: hardware sl_severity: error refcode: "" message: ipr_hcam_err "9021: Array missing 2 or more devices with 2 or more devices present\n" description {{ Array missing 2 or more devices with 2 or more devices present. }} action {{ Perform “MAP 3311†on page 92 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: hardware sl_severity: error refcode: "" message: ipr_hcam_err "9022: Exposed array is missing a required device\n" description {{ Exposed array is missing a required device. }} action {{ Perform “MAP 3311†on page 92 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: hardware sl_severity: error refcode: "" message: ipr_hcam_err "9023: Array member(s) not at required physical locations\n" description {{ Array member(s) not at required physical locations. }} action {{ Perform “MAP 3312†on page 93 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: hardware sl_severity: error refcode: "" message: ipr_hcam_err "9024: Array not functional due to present hardware configuration\n" description {{ Array not functional due to present hardware configuration. }} action {{ Perform “MAP 3390†on page 106 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: hardware sl_severity: error refcode: "" message: ipr_hcam_err "9054: IOA resources not available due to previous problems\n" description {{ IOA resources not available due to previous problems. }} action {{ Perform “MAP 3321†on page 94 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "9092: Disk unit requires initialization before use\n" description {{ Disk unit requires initialization before use. }} action {{ Perform “MAP 3334†on page 96 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "9029: Incorrect hardware configuration change has been detected\n" description {{ Incorrect hardware configuration change has been detected. }} action {{ Perform “MAP 3390†on page 106 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: hardware sl_severity: error refcode: "" message: ipr_hcam_err "9060: One or more disk pairs are missing from an array\n" description {{ One or more disk pairs are missing from an array. }} action {{ Perform “MAP 3311†on page 92 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: hardware sl_severity: error refcode: "" message: ipr_hcam_err "9061: One or more disks are missing from an array\n" description {{ One or more disks are missing from an array. }} action {{ Perform “MAP 3311†on page 92 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: hardware sl_severity: error refcode: "" message: ipr_hcam_err "9062: One or more disks are missing from an array\n" description {{ One or more disks are missing from an array. }} action {{ Perform “MAP 3311†on page 92 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: hardware sl_severity: error refcode: "" message: ipr_hcam_err "9063: Maximum number of functional arrays has been exceeded\n" description {{ Maximum number of functional arrays has been exceeded. }} action {{ Perform “MAP 3390†on page 106 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: hardware sl_severity: error refcode: "" ppc64-diag-2.7.4/ela/message_catalog/ixgb0000644000000000000000000001554013135275400015011 00000000000000subsystem: net file: "drivers/net/ixgb/ixgb_main.c" message[chatter]: netif_info "Intel(R) PRO/10GbE Network Connection\n" message[defensive]: netif_err "Unable to allocate interrupt Error: %d\n" message[defensive]: netif_err "ixgb_init_hw failed\n" message[defensive]: netif_err "The EEPROM Checksum Is Not Valid\n" message[defensive]: netif_err "Invalid MAC Address\n" message[defensive]: netif_err "unsupported device id\n" message[defensive]: netif_err "Unable to allocate transmit descriptor ring memory\n" message[defensive]: netif_err "Unable to allocate transmit descriptor memory\n" message[defensive]: netif_err "Unable to allocate receive descriptor ring\n" message[defensive]: netif_err "Unable to allocate receive descriptors\n" message[defensive]: netif_err "Invalid MTU setting %d\n" message[defensive]: netif_err "Cannot re-enable PCI device after reset\n" message[defensive]: netif_err "After reset, the EEPROM checksum is not valid\n" message[defensive]: netif_err "After reset, invalid MAC address\n" message[defensive]: dev_err "TX DMA map failed\n" message[defensive]: printk err "ixgb: No usable DMA configuration, aborting\n" message[chatter]: printk err "ixgb: %s NIC Link is Up 10 Gbps Full Duplex, Flow Control: %s\n" message[chatter]: printk err "ixgb: %s NIC Link is Down\n" file: "drivers/net/ixgb/ixgb_param.c" message[chatter]: printk err "Invalid %s specified (%i) %s\n" message[chatter]: printk err "Warning: no configuration for board #%i\n" message[chatter]: printk info "Using defaults for all values\n" message[chatter]: printk info "Ignoring RxFCHighThresh when no RxFC\n" message[chatter]: printk info "Ignoring RxFCLowThresh when no RxFC\n" message[chatter]: printk info "Ignoring FCReqTimeout when no RxFC\n" file: "drivers/net/ixgbe/ixgbe_main.c" message[chatter]: dev_info "MAC: %d, PHY: %d, SFP+: %d, PBA No: %06x-%03x\n" message[chatter]: dev_info "MAC: %d, PHY: %d, PBA No: %06x-%03x\n" message[chatter]: dev_info "Intel(R) 10 Gigabit Network Connection\n" message[chatter]: dev_warn "PCI-Express bandwidth available for this card is not sufficient for optimal performance.\n" message[chatter]: dev_warn "For optimal performance a x8 PCI-Express slot is required.\n" message[defensive]: dev_err "master disable timed out\n" message[defensive]: dev_err "Hardware Error: %d\n" message[defensive]: dev_err "EEPROM initialization failed\n" message[defensive]: dev_err "TX DMA map failed\n" message[defensive]: dev_err "No usable DMA configuration, aborting\n" message[defensive]: dev_err "pci_request_selected_regions failed 0x%x\n" message[defensive]: dev_err "HW Init failed: %d\n" message[defensive]: dev_err "The EEPROM Checksum Is Not Valid\n" message[defensive]: dev_err "invalid MAC address\n" message[defensive]: dev_err "pci_cleanup_aer_uncorrect_error_status failed 0x%0x\n" message[defensive]: printk err "ixgbe: Cannot enable PCI device from suspend\n" message[defensive]: printk err "ixgbe: Cannot initialize interrupts for device\n" message[chatter]: printk err "ixgbe: %s NIC Link is Up %s, Flow Control: %s\n" message[chatter]: printk err "ixgbe: %s NIC Link is Down\n" file: "drivers/net/ixgbe/ixgbe_sriov.c" message[defensive]: printk err "Error receiving message from VF\n" file: "drivers/net/ixgbe/ixgbe_82598.c" message[defensive]: hw_dbg "Flow control param set incorrectly\n" message[defensive]: hw_dbg "Autonegotiation did not complete.\n" message[defensive]: hw_dbg "Link was indicated but link is down\n" message[defensive]: hw_dbg "PCI-E Master disable polling has failed.\n" message[defensive]: hw_dbg "Reset polling failed to complete.\n" message[defensive]: hw_dbg "RAR index %d is out of range.\n" message[defensive]: hw_dbg "EEPROM read did not pass.\n" file: "drivers/net/ixgbe/ixgbe_82599.c" message[defensive]: hw_dbg "Autoneg did not complete.\n" message[defensive]: hw_dbg "ixgbe_setup_mac_link_smartspeed.\n" message[defensive]: hw_dbg "PCI-E Master disable polling has failed.\n" message[defensive]: hw_dbg "Reset polling failed to complete.\n" message[defensive]: hw_dbg "RAR index %d is out of range.\n" message[defensive]: hw_dbg "RAR index %d is out of range.\n" message[defensive]: hw_dbg "No space in VLVF.\n" message[defensive]: hw_dbg "Flow Director previous command isn't complete, aborting table re-initialization. \n" message[defensive]: hw_dbg "Flow Director Signature poll time exceeded!\n" message[defensive]: hw_dbg "Flow Director Perfect poll time exceeded!\n" message[defensive]: hw_dbg "Error on l4type input\n" message[defensive]: hw_dbg "Rx unit being enabled before security path fully disabled. Continuing with init.\n" file: "drivers/net/ixgbe/ ixgbe_common.c" message[defensive]: hw_dbg "NVM Read Error\n" message[defensive]: hw_dbg "PCI-E Master disable polling has failed.\n" message[defensive]: hw_dbg "Eeprom read timed out\n" message[defensive]: hw_dbg "Could not acquire EEPROM grant\n" message[defensive]: hw_dbg "SPI EEPROM Status error\n" message[defensive]: hw_dbg "EEPROM read failed\n" message[defensive]: hw_dbg "RAR index %d is out of range.\n" message[defensive]: hw_dbg "Overriding MAC Address in RAR[0]\n" message[defensive]: hw_dbg "Clearing RAR[1-%d]\n" message[defensive]: hw_dbg "Added a secondary address to RAR[%d]\n" message[defensive]: hw_dbg "ixgbe_add_uc_addr Complete\n" message[defensive]: hw_dbg "Clearing RAR[1-%d]\n" message[defensive]: hw_dbg "ixgbe_update_uc_addr_list_generic Complete\n" message[defensive]: hw_dbg "MC filter type param set incorrectly\n" message[defensive]: hw_dbg "ixgbe_update_mc_addr_list_generic Complete\n" message[defensive]: hw_dbg "Flow control param set incorrectly\n" message[defensive]: hw_dbg "Invalid packet buffer number [%d], expected range is 0-7\n" message[defensive]: hw_dbg "Invalid water mark configuration\n" message[defensive]: hw_dbg "ixgbe_fc_rx_pause not valid in strict IEEE mode\n" message[defensive]: hw_dbg "Driver can't access resource, GSSR timeout.\n" file: "drivers/net/ixgbe/ixgbe_phy.c" message[defensive]: hw_dbg "PHY address command did not complete.\n" message[defensive]: hw_dbg "PHY read command didn't complete\n" message[defensive]: hw_dbg "PHY address cmd didn't complete\n" message[defensive]: hw_dbg "PHY address cmd didn't complete\n" message[defensive]: hw_dbg "PHY reset did not complete.\n" message[defensive]: hw_dbg "Bad control value\n" message[defensive]: hw_dbg "Bad control type\n" message[defensive]: hw_dbg "SFP+ module not supported\n" message[defensive]: hw_dbg "SFP+ module not supported\n" message[defensive]: hw_dbg "No matching SFP+ module found\n" message[defensive]: hw_dbg "I2C byte read error - Retrying.\n" message[defensive]: hw_dbg "I2C byte read error.\n" message[defensive]: hw_dbg "I2C byte write error - Retrying.\n" message[defensive]: hw_dbg "I2C byte write error.\n" message[defensive]: hw_dbg "I2C ack was not received.\n" message[defensive]: hw_dbg "I2C data was not set to %X\n" message[defensive]: hw_dbg "Error - I2C data was not set to %X.\n" ppc64-diag-2.7.4/ela/message_catalog/lpfc0000644000000000000000000032546713135275400015020 00000000000000subsystem:net message: lpfc_printf_log KERN_WARNING "Abort outstanding I/O on NPort x%x\n" description {{ All outstanding I/Os are cleaned up on the specified remote NPort. DATA: (1) nlp_flag (2) nlp_state (3) nlp_rpi }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_WARNING "Active Mailbox cleared - mailbox timeout exiting\n" description {{ The mailbox timeout handler has determined that the driver is in the process of completing this mailbox command. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_ERR "Adapter failed init, mbxCmd x%x READ_SPARM mbxStatus x%x\n" description {{ Adapter initialization failed when issuing a READ_SPARM mailbox command. }} action {{ This error could indicate a hardware or firmware problem. If the problem persists, report the error to Technical Support. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Adapter failed to get Option ROM version status x%x\n" description {{ The driver could not read the HBA’s option ROM. }} action {{ Reset the HBA. Ensure the adapter’s firmware is current. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Adapter failed to init, chipset, status reg x%x, FW Data: A8 x%x AC x%x\n" description {{ The adapter failed during powerup diagnostics after it was reset. }} action {{ This error could indicate a hardware or firmware problem.If the problem persists, report the error to Technical Support. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Adapter failed to init. Data: x%x x%x x%x\n" description {{ An error occurred when processing queue related tags for an HBA in a particular slot. DATA: (1) mbxCommand (2) mbxStatus (3) hbaqno }} action {{ Software driver error. If this problem persists, report these errors to Technical Support. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Adapter failed to init, mbxCmd x%x CONFIG_PORT, mbxStatus x%x Data: x%x\n" description {{ Adapter initialization failed when issuing a CONFIG_PORT mailbox command. DATA: (1) hbainit }} action {{ This error could indicate a hardware or firmware problem. Update the firmware. If the problem persists, report the error to Technical Support. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Adapter failed to init, mbxCmd x%x INIT_LINK, mbxStatus x%x\n" description {{ Adapter initialization failed when issuing an INIT_LINK mailbox command. }} action {{ This error could indicate a hardware or firmware problem. Update the firmware.If the problem persists,report the error to Technical Support. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Adapter failed to init, mbxCmd x%x READ_CONFIG, mbxStatus x%x\n" description {{ Adapter initialization failed when issuing a READ_CONFIG mailbox command. }} action {{ This error could indicate a hardware or firmware problem. Update the firmware.If the problem persists,report the error to Technical Support. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Adapter failed to init, mbxCmd x%x READ_REV, mbxStatus x%x\n" description {{ Adapter initialization failed when issuing a READ_REV mailbox command. }} action {{ This error could indicate a hardware or firmware problem. Update the firmware.If the problem persists,report the error to Technical Support. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Adapter failed to init, READ_REV has missing revision information.\n" description {{ A firmware revision initialization error was detected. }} action {{ This error could indicate a hardware or firmware problem. Update the firmware.If the problem persists,report the error to Technical Support. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Adapter failed to init, timeout, status reg x%x, FW Data: A8 x%x AC x%x\n" description {{ The adapter failed during powerup diagnostics after it was reset. }} action {{ This error could indicate a hardware or firmware problem.If the problem persists, report the error to Technical Support. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Adapter failed to issue ASYNCEVT_ENABLE mbox status x%x\n" description {{ The mailbox command to enable an asynchronous event notification failed. }} action {{ Ensure the adapter firmware is current. Reload the driver. }} class: firmware sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Adapter failed to issue DOWN_LINK mbox command rc 0x%x\n" description {{ The driver was unable to issue the Down Link Mailbox command. }} action {{ None required }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Adapter Hardware Error Data: x%x x%x x%x\n" description {{ The driver received an interrupt indicating a possible hardware problem. Data: (1) status (2) status1 (3) status2 }} action {{ This error could indicate a hardware or firmware problem. If the problem persists, report the error to Technical Support. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Adapter heartbeat failure, taking this port offline.\n" description {{ The Heartbeat mailbox command failed. }} action {{ Ensure the adapter firmware is current. Reload the driver. }} class: firmware sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Adapter is very hot, please take corrective action. temperature : %d Celsius\n" description {{ Adapter temperature is above normal range. DATA: Temperature in Celsius }} action {{ Shutdown and remove the HBA. Contact Technical Support. }} class: hardware sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Adapter Link is disabled.\n" description {{ The adapterl link has been disabled. }} action {{ None required }} class: unknown sl_severity: warning refcode: "" message: lpfc_printf_log KERN_INFO "Adapter temperature is OK now. temperature : %d Celsius\n" description {{ Adapter temperature has reverted to normal range. DATA: Temperature in Celsius }} action {{ No action needed, informational. }} class: hardware type: info refcode: "" message: lpfc_printf_log KERN_ERR "ADD_FCF_RECORD mailbox failed with status 0x%x\n" description {{ The mailbox command to add the FCF record has failed. }} action {{ None required }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "ADD_FCF_RECORD mailbox failed with status x%x add_status x%x\n" description {{ The mailbox command to add the FCF record has failed. }} action {{ None required }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Bad hbq tag. Data: x%x x%x\n" description {{ An error occurred when processing queue related tags for an HBA in a particular slot. DATA: (1) tag (2) buffer_count }} action {{ Software driver error. If this problem persists, report these errors to Technical Support. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_WARNING "Block sgl registration required DMA size (%d) great than a page\n" description {{ The request to post SGL pages does not fit on a page. }} action {{ No action needed, informational. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_INFO "Bring Adapter offline\n" description {{ The FC driver has received a request to bring the adapter offline. This may occur when running lputil. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_INFO "Bring Adapter online\n" description {{ The FC driver has received a request to bring the adapter online. This may occur when running lputil. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_ERR "Cannot find virtual addr for buffer tag on ring %d Data x%lx x%p x%p x%x\n" description {{ DMA buffer is not available for this unsolicited command. DATA: (1) tag (2) next (3) prev (4) postbufq_cnt }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Cannot find virtual addr for mapped buf on ring %d Data x%llx x%p x%p x%x\n" description {{ The driver cannot find the specified buffer in its mapping table. Thus it cannot find the virtual address needed to access the data. DATA: (1) phys (2) next (3) prev (4) postbufq_cnt }} action {{ This error could indicate a software driver or firmware problem. If the problem persists report these errors to Technical Support. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Cannot re-enable interrupt after slot reset.\n" description {{ The driver was not able to enable the interrupt after an HBA reset. }} action {{ Unload and reload the driver. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Clear Virtual Link Received for VPI 0x%x tag 0x%x\n" description {{ A Clear virtual link was received from the Fabric for this VPI. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_WARNING "Config MSI mailbox command failed, mbxCmd x%x, mbxStatus x%x\n" description {{ The mailbox command sent to the firmware to configure the HBA to use MSI-X has failed. }} action {{ Ensure the hardware platform supports MSI-X. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Config Port initialization error, mbxCmd x%x READ_NVPARM, mbxStatus x%x\n" description {{ A read nvparams mailbox command failed during port configuration. }} action {{ This error could indicate a software driver, firmware or hardware problem. Report these errors to Technical Support. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Config region 23 has bad signature\n" description {{ Configuration region 23 has an invalid signature. }} action {{ None required. }} class: unknown sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Config region 23 has bad version\n" description {{ The driver was unable to read Config Region 23 because it is an invalid version. }} action {{ None required. }} class: unknown sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Could not manually add FCF record 0, status %d\n" description {{ Could not add FCF record to the FCF list. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "CQ_CREATE mailbox failed with status x%x add_status x%x, mbx status x%x\n" description {{ The mailbox command sent to create the completion queue has failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "CQ_DESTROY mailbox failed with status x%x add_status x%x, mbx status x%x\n" description {{ The mailbox command sent to delete the completion queue has failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Create VPORT failed: Cannot get instance number\n" description {{ The driver failed to allocate resources for an adapter and could not assign an instance number. }} action {{ Software driver error. If this problem persists, report these errors to Technical Support. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Create VPORT failed: Max VPORTs (%d) exceeded\n" description {{ The driver failed to create a port because the maximum number of port supported by the driver will be exceeded. DATA: (1) max_vpi }} action {{ No Action. The driver can not create any more VPorts. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Create VPORT failed: NPIV is not enabled: SLImode:%d\n" description {{ The driver failed to create a port because the HBA was in wrong mode or was not capable of NPIV. DATA: (1) sli_rev }} action {{ Load the driver with npiv enabled on an HBA that supports SLI-3. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Create VPORT failed: vpi x%x\n" description {{ The driver failed to create a port and had to eliminate all its resources. DATA: (1) vpi }} action {{ Software driver error. If this problem persists, report these errors to Technical Support. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "CT command failed to delete objects on fabric\n" description {{ A command issued to the fabric to delete an associated resource for an object such as for a port, failed. }} action {{ Software driver error. If this problem persists, report these errors to Technical Support. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Deferred Adapter Hardware Error Data: x%x x%x x%x\n" description {{ An adapter hardware error was sent to the driver. DATA: (1) work_hs, (2) work_status[0], (3) work_status[1] }} action {{ Perform a dump using hbacmd. }} class: hardware sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "DEL FCF of default FCF Index failed mbx status x%x, status x%x add_status x%x\n" description {{ The mailbox command to delete the FCF record has failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Dropped frame rctl:%s type:%s\n" description {{ An unsupported frame was received by the port and dropped. DATA: (1) rctl_names[fc_hdr->fh_r_ctl], (2) type_names[fc_hdr->fh_type] }} action {{ None required. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_INFO "ELS complete with no corresponding cmdiocb: iotag (%d)\n" description {{ The completion that the ISR is handling cannot find a tag associated with the IOTAG }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_ERR "EQ_CREATE mailbox failed with status x%x add_status x%x, mbx status x%x\n" description {{ The mailbox command sent to create the event queue has failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "EQ_DESTROY mailbox failed with status x%x add_status x%x, mbx status x%x\n" description {{ The mailbox command sent to delete the event queue has failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Error Could not grow rpi count\n" description {{ An error occurred because the RPI count could not be increased. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Error %d during queue setup.\n" description {{ Could not set up all the queues that driver requires to exchange IOs with the HBA. }} action {{ Reload the driver. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Error %d during rpi post operation\n" description {{ The driver was trying to post pages to the firmware to keep target login information and encountered a failure. }} action {{ Unload and reload the driver. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_WARNING "Error %d during scsi sgl post operation\n" description {{ The SGL entries could not be registered with the HBA. }} action {{ Reset the HBA using hbacmd. }} class: hardware sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Error %d during sgl post operation\n" description {{ The SGL post operation failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Error %d parsing vpd. Using defaults.\n" description {{ Could not parse the VPD data, so the driver is using the default values. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Error %d posting all rpi headers\n" description {{ The RPI headers could not be posted to the firmware. }} action {{ None required. }} class: firmware sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Error during rpi post operation\n" description {{ The driver was trying to post pages to the firmware to be used to keep target login information and encountered a failure. }} action {{ Unload and reload the driver. }} class: firmware sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Failed allocate fast-path FCP CQ (%d)\n" description {{ The completion queue event for the fast path could not be allocated. }} action {{ Unload and reload the driver. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Failed allocate memory for fast-path CQ record array\n" description {{ Failed to allocate memory for the fast-path EQ record array. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Failed allocate memory for fast-path EQ record array\n" description {{ Failed to allocate memory for the fast-path EQ record array. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Failed allocate memory for fast-path per-EQ handle array\n" description {{ Failed to allocate memory for the fast-path per-EQ handle array. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Failed allocate memory for fast-path WQ record array\n" description {{ Failed to allocate memory for the fast-path EQ record array. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Failed allocate memory for msi-x interrupt vector entries\n" description {{ The driver was unable to allocate memory during initialization of the MSI-X interrupt array. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Failed allocate slow-path ELS CQ\n" description {{ Failed allocate slow-path ELS CQ. }} action {{ None required. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Failed allocate slow-path ELS WQ\n" description {{ Failed to allocate slow-path ELS WQ. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Failed allocate slow-path EQ\n" description {{ The event queue for the slow path was not allocated. }} action {{ Unload and reload the driver. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_WARNING "Failed allocate slow-path mailbox CQ\n" description {{ Failed to allocate slow-path mailbox CQ. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Failed to allocate CQ_EVENT entry\n" description {{ The asynchronous event handler was not able to allocate an event queue entry to which to transfer the asynchronous event. }} action {{ This could be a V-LINK clear from the switch or a fatal error from the firmware. Perform a dump from the OneCommand Manager application. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Failed to allocate IOTAG.last IOTAG is %d\n" description {{ The driver cannot allocate an IoTag. Display the last value used. }} action {{ This message indicates the adapter HBA I/O queue is full. Typically this happens when heavy I/O is running on a low-end (3 digit) adapter. We suggest you upgrade to a higher-end adapter. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Failed to allocate mbox cmd memory\n" description {{ Mailbox allocation error. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Failed to allocate mbox for ADD_FCF cmd\n" description {{ Failed to allocate mailbox for ADD_FCF command. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Failed to allocate mbox for query firmware config cmd\n" description {{ Failed to allocate mailbox memory. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Failed to allocate mbox for READ_FCF cmd\n" description {{ Failed to allocate mbox for READ_FCF command. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Failed to allocate memory for ELS XRI management array of size %d.\n" description {{ Initialization failed to allocate memory for the ELS XRI management array. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Failed to allocate memory for SCSI XRI management array of size %d.\n" description {{ Initialization could not allocate memory to hold the XRIs. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Failed to allocate non-embedded SGE array.\n" description {{ Failed to allocate the non-embedded SGE array. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Failed to allocate sysfs attr\n" description {{ Initialization failed to sysfs attribute. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_INFO "Failed to allocate XRI.last XRITAG is %d Max XRI is %d, Used XRI is %d\n" description {{ All XRIs are in use. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_ERR "Failed to create scsi host.\n" description {{ Initialization failed to create SCSI host. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Failed to enable interrupt.\n" description {{ The driver failed to start the interrupt. }} action {{ Unload and reload the driver. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Failed to enable pci device.\n" description {{ Failed to enable PCI device during initialization. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Failed to get the non-embedded SGE virtual address\n" description {{ The READ_FCF_RECORD mailbox command could not retrieve the Scatter Gather Entry that was requested. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Failed to initialize iocb list.\n" description {{ Driver resource initialization failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Failed to initialize rpi headers.\n" description {{ Failed to initialize RPI headers. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Failed to initialize sgl list.\n" description {{ Failed to initialize SGL list during initialization. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Failed to read FCoE parameters\n" description {{ The driver failed to read FCoE parameters. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Failed to set up driver resource.\n" description {{ Driver resource initialization failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Failed to set up hba\n" description {{ Initialization failed to set up the HBA. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Failed to set up pci memory space.\n" description {{ PCI initialization failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_WARNING "Failure HBA POST Status: sta_reg=0x%x, perr=x%x, sfi=x%x, nip=x%x, ipc=x%x, xrom=x%x, dl=x%x, pstatus=x%x\n" description {{ The HBA’s power on self test has failed. }} action {{ None required. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_INFO "Fast-path wqe consume event carries miss-matched qid: wcqe-qid=x%x\n" description {{ The consumed entry does not have the fast path’s queueID. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_ERR "FCF disconnected from network index 0x%x tag 0x%x\n" description {{ The FCF has disconnected from the network. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "FCF Table full count 0x%x tag 0x%x\n" description {{ The FCF table is full. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "FCoE Function not supported by firmware. Function mode = %08x\n" description {{ FCoE is not supported by this firmware. }} action {{ Use the OneCommand Manager application to update to the latest firmware. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_INFO "FCP cmdiocb not callback function iotag: (%d)\n" description {{ The IOCB found for this iotag does not have a completion handler set in it. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_INFO "FCP complete error: status=x%x, hw_status=x%x, total_data_specified=%d, parameter=x%x, word3=x%x\n" description {{ Logs the FCP failure. Status and parameter are equivalent to ulpStatus and ulpWord[4]. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_INFO "FCP complete with no corresponding cmdiocb: iotag (%d)\n" description {{ There was no IOCB on the in-progress list that matched this iotag. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_INFO "Feature Mismatch Data: x%08x %08x x%x x%x x%x\n" description {{ The features passed in to the driver as module parameters do not match what the firmware can do. Setting to default values. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_INFO "Find ndlp returned NULL for oxid:x%x SID:x%x\n" description {{ Could not find the node for this DID. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_ERR "HBA not supporting SLI-3 or later SLI Revision: 0x%x\n" description {{ The HBA does not support SLI-3 or SLI-4. }} action {{ This HBA does not support msi. Set lpfc_use_msi=0. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "HBA Unrecoverable error: uerr_lo_reg=0x%x, uerr_hi_reg=0x%x, ue_mask_lo_reg=0x%x, ue_mask_hi_reg=0x%x\n" description {{ The HBA has notified the driver that it has encountered an unrecoverable error. }} action {{ A dump from the OneCommand Manager application should be taken. Then, the driver should be unloaded and reloaded. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "HBQ %d: local_hbqGetIdx %u is > than hbqp->entry_count %u\n" description {{ An error occurred when processing queue related to an HBA in a particular slot. DATA: (1) hbqno (2) local_hbqGetIdx (3) entry_count }} action {{ Software driver error. If this problem persists, report these errors to Technical Support. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Ignoring ELS cmd tag x%x completion Data: x%x x%x x%x\n" description {{ This ELS command was aborted. DATA: (1) ulpStatus (2) ulpWord[4] (3) ulpTimeout }} action {{ None required. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_INFO "Ignoring unsolicited CT No HBQ status = x%x\n" description {{ Received an unsolicited ct command without a BDE. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_INFO "Ignoring unsolicted CT HBQ Size:%d status = x%x\n" description {{ Received an unsolicited ct command with an invalid size. DATA: ulpStatus }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_ERR "INIT VPI Mailbox failed status %d, mbxStatus x%x\n" description {{ The INIT VPI mailbox command has failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Invalid asynchrous event code: x%x\n" description {{ The asynchronous event code that the firmware passed to the driver is invalid. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Invalid command 0x%x\n" description {{ The IOCB command is invalid. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Invalid completion queue type (%d)\n" description {{ The event queue entry is not for a mailbox or a work queue entry. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Invalid CT %x command 0x%x\n" description {{ Invalid Command-Type in the IOCB is not supported. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Invalid device group (x%x)\n" description {{ While unloading the driver, the driver detect a PCI device that it should not have claimed. }} action {{ None required. }} class: hardware sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Invalid HBA PCI-device group: 0x%x\n" description {{ Invalid HBA PCI-device group detected. }} action {{ None required. }} class: hardware sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Invalid link-attention link speed: x%x\n" description {{ The link speed reported in the link attention interrupt is invalid. }} action {{ Check the switch configuration. }} class: hardware sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Invalid link attention type: x%x\n" description {{ The READ_LA mailbox command has returned an invalid link type. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Invalid link fault code: x%x\n" description {{ The attempt to read the link attention register has returned an unknown value. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Invalid param:\n" description {{ SLI-4: The post SGL function was passed an invalid XRI }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Invalid SLI revision (%d)\n" description {{ While processing a host attention or unrecoverable error, the driver detected an invalid SLI revision. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_INFO "Invalid speed for this board: Reset link speed to auto: x%x\n" description {{ The driver is reinitializing the link speed to auto-detect. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_ERR "Invalid work queue CQE subtype (x%x)\n" description {{ Invalid work queue CQE. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_INFO "IOCB wait issue failed, Data x%x\n" description {{ The LPFC driver failed to issue an IOCB. DATA:(1) retval }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_ERR "IOCB wake NOT set, Data x%x x%lx\n" description {{ The completion handler associated with the IOCB was never called. DATA:(1) timeout (2) timeleft/jiffies }} action {{ This error could indicate a software driver, firmware or hardware problem.If the problem persists,report the error to Technical Support. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_log KERN_WARNING "IOCB wake signaled\n" description {{ The IOCB completed successfully. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_ERR "IOCB x%x failed. No vport\n" description {{ An IOCB command could not be communicated because there was no VPort associated with the mailbox command. DATA: (1) ulpCommand }} action {{ Software driver error. If this problem persists, report these errors to Technical Support. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "iotag x%x is out off range: max iotag (x%x)\n" description {{ The IOCB lookup cannot be performed because the iocb_tag is out of range. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "iotag x%x is out off range: max iotag x%x wd0 x%x\n" description {{ The IoTag in the completed IOCB is out of range. }} action {{ This error could indicate a software driver, firmware or hardware problem. Report these errors to Technical Support. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "LATT: Cannot issue READ_LA: Data:%d\n" description {{ The link attention handler could not issue a READ_LA mailbox command. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Link Down Event x%x received Data: x%x x%x x%x\n" description {{ A link down event was received. DATA: (1) fc_eventTag (2) hba_state (3) fc_flag }} action {{ If numerous link events are occurring, check the physical connections to the Fibre Channel network. }} class: hardware sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Link Up Event in loop back mode x%x received Data: x%x x%x x%x x%x\n" description {{ Link up notification; configured for loopback. DATA: (1) fc_eventTag (2) granted_AL_PA (3) UlnkSpeed (4) alpa_map[0] }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Link Up Event npiv not supported in loop topology\n" description {{ NPIV is not supported in loop topology. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Loopback test did not receive expected data length. actual length 0x%x expected length 0x%x\n" description {{ The loopback test did not receive the same amount of data that it transmitted. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "lpfc_create_static_vport bad information header 0x%x 0x%x\n" description {{ Invalid information header; the signature or revision is invalid. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "lpfc_create_static_vport failed to allocate mailbox memory\n" description {{ Failed to allocate mailbox memory for VPort creation. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "lpfc_create_static_vport failed to allocate vport_info\n" description {{ Failed to allocate vport_info. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "lpfc_create_static_vport failed to create vport\n" description {{ Failed to create vport }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "lpfc_create_static_vport failed to issue dump mailbox command ret 0x%x status 0x%x\n" description {{ Failed to issue a dump mailbox command for statis VPort creation. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "lpfc_dump_fcoe_param: memory allocation failed\n" description {{ Memory allocation has failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "lpfc_dump_static_vport: memory allocation failed\n" description {{ Failed to allocate mailbox memory. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "lpfc_sli_read_serdes_param failed to allocate mailbox memory\n" description {{ Failed to allocate mailbox memory. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_WARNING "lpfc_soft_wwpn attribute set failed to reinit adapter - %d\n" description {{ The adapter failed to restart after setting a new WWPN. }} action {{ Perform a dump using the hbacmd. }} class: hardware sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Mailbox failed , mbxCmd x%x READ_CONFIG, mbxStatus x%x\n" description {{ The READ_CONFIG mailbox command failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_INFO "mbox: Issued mailbox cmd 0x%x while in stopped state.\n" description {{ Only the dump mailbox command and reset HBA mailbox command are allowed when in the stopped state. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_ERR "Mbox x%x failed, no vport\n" description {{ The vport field of this mailbox command was not completed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Menlo Maint Mode Link up Event x%x rcvd Data: x%x x%x x%x\n" description {{ The link is up in maintenance mode; only management commands are allowed. DATA: (1) fc_eventTag (2) port_state (3) vport fc_flag }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Miss-matched fast-path completion queue identifier: eqcqid=%d, fcpcqid=%d\n" description {{ The CQID in the event queue entry does not match the fcp_cqid that was passed into the routine. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "MQ_CREATE mailbox failed with status x%x add_status x%x, mbx status x%x\n" description {{ The mailbox command sent to create the mailbox queue has failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "MQ_DESTROY mailbox failed with status x%x add_status x%x, mbx status x%x\n" description {{ The mailbox command sent to delete the mailbox queue has failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_WARNING "MSI request_irq failed (%d)\n" description {{ The request_irq kernel API has failed. }} action {{ Set lpfc_use_msi = 0. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_WARNING "MSI-X fast-path request_irq failed (%d)\n" description {{ The driver received an error for the request_irq_call. }} action {{ Unload and reload the driver. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_INFO "MSI-X interrupt with no EQE\n" description {{ SLI-4 HBA interrupt on the slow path but there is no associated EQE. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_WARNING "MSI-X slow-path request_irq failed (%d)\n" description {{ The kernel API to request an IRQ has failed. }} action {{ Use module parameter lpfc_use_msi = 0 (IntX). }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_INFO "ndlp null for oxid %x SID %x\n" description {{ The Node value for this SID is not in the node list. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_INFO "New FCF found index 0x%x tag 0x%x\n" description {{ The driver has detected a new FCF in the SAN. DATA: (1) macqe_fcoe->fcf_index (2) acqe_fcoe->event_tag }} action {{ No action needed, informational. }} class: hardware type: info refcode: "" message: lpfc_printf_log KERN_ERR "No entry from fast-path completion queue fcpcqid=%d\n" description {{ There were no completions in the completion queue referenced by fcpcqid. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "No entry from the CQ: identifier (x%x), type (%d)\n" description {{ There was no completion queue event for this event queue entry. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_WARNING "NOP mailbox command failed status x%x add_status x%x mbx status x%x\n" description {{ The NOP mailbox command failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "No room left for SCSI XRI allocation: max_xri=%d, els_xri=%d\n" description {{ The number of allocated XRIs has reached the max_xri value. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_INFO "No support for fcpi mode.\n" description {{ Could not configure the port to run in FCP initiator mode. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_ERR "Not a valid fast-path completion event: majorcode=x%x, minorcode=x%x\n" description {{ The major or minor code in the Event Queue field is not valid. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Not a valid slow-path completion event: majorcode=x%x, minorcode=x%x\n" description {{ SLI-4: The EQE is not valid. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Not a valid WCQE code: x%x\n" description {{ The completion queue handler detected an invalid type. }} action {{ None required. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Not configured for supporting MSI-X cfg_use_msi: 0x%x\n" description {{ The lpfc_use_msi module parameter should have been set to 2. }} action {{ Set module parameter lpfc_use_msi = 2. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "NPIV enabled: Override lpfc_sli_mode parameter (%d) to auto (0).\n" description {{ The lpfc_enable_npiv and lpfc_sli_mode driver parameter settings conflict. The HBA must be configured for SLI-3 mode to support NPIV. DATA: (1) lpfc_sli_mode }} action {{ This is an informational message that indicates that the lpfc_enable_npiv and lpfc_sli_mod parameter settings are not compatible. Resolve the parameter conflict by setting the SLI mode to 0 or 3 or, if SLI-2 mode is required then disable NPIV. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Only Limited Edition cmd Format supported 0x%x\n" description {{ The SGL pages could not be unregistered from the firmware. }} action {{ None required. }} class: firmware sl_severity: warning refcode: "" message: lpfc_printf_log KERN_INFO "Outstanding IO when bringing Adapter offline\n" description {{ IO is still pending while attempting to stop the driver. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_INFO "PCI enable MSI mode success.\n" description {{ MSI has been enabled for the port. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_ERR "PM resume Failed to enable interrupt\n" description {{ The PCI resume (hotplug) could not get an interrupt vector. }} action {{ Unload and reload the driver. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "PM resume failed to start worker thread: error=x%x.\n" description {{ The PCI resume (hotplug) could not start the worker thread for the driver. }} action {{ Unload and reload the driver. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "POST_RPI_HDR mailbox failed with status x%x add_status x%x, mbx status x%x\n" description {{ The mailbox command sent to post the RPUI header pages to the firmware has failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "POST_SGL_BLOCK mailbox command failed status x%x add_status x%x mbx status x%x\n" description {{ The mailbox command sent to post the SGL pages to the firmware has failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "POST_SGL mailbox failed with status x%x add_status x%x, mbx status x%x\n" description {{ The mailbox command sent to post the SGL pages to the firmware has failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Query Firmware Config failed mbx status x%x, status x%x add_status x%x\n" description {{ Could not read the firmware configuration. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "rc should be MBX_SUCCESS\n" description {{ The next mailbox command on the mailbox queue has failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "rc should have been MBX_BUSY\n" description {{ Attempting to unregister a default RPI from an interrupt context and the mailbox state is not busy. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Read FCF record failed 0x%x\n" description {{ Could not read the FCF record from the firmware. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "READ_FCF_RECORD Indicates empty FCF table.\n" description {{ The driver requested the firmware provide a list of FCF entries to connect to and the firmware responded that the FCF table is empty. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "READ_FCF_RECORD mailbox failed with status x%x add_status x%x, mbx\n" description {{ The READ_FCF_RECORD mailbox command failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_WARNING "READ_LA mbox error x%x state x%x\n" description {{ The driver cannot determine what type of link event occurred. }} action {{ If numerous link events are occurring, check the physical connections to the Fibre Channel network. May indicate a possible hardware or firmware problem. }} class: hardware sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "READ_REV Error. SLI Level %d FCoE enabled %d\n" description {{ This SLI-4 only HBA setup function was called for a non-SLI-4 device. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "READ_SPARAM command failed status %d, mbxStatus x%x\n" description {{ The READ_SPARAM mailbox command has failed during initialization. The HBA has been set to error state. }} action {{ Take a dump with hbacmd and then try reloading the driver. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_WARNING "READ_SPARAM: no buffers\n" description {{ The driver attempted to issue a READ_SPARAM mailbox command to the HBA, but there were no buffers available. }} action {{ This message indicates: (1) Kernel virtual memory is depleted. Check that the system meets minimum RAM requirements for the Emulex Fibre Channel adapter. Try closing other applications to freesome memory. (2) A possible driver buffer management problem. If the problem persists, report the error to Technical Support. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Receive Frame Truncated!!\n" description {{ The receive unsolicited handler detected a truncated frame. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_WARNING "Re-establishing Link Data: x%x x%x x%x\n" description {{ The driver detected a condition in which it had to re-initialize the link. DATA: (1) status (2) status1 (3) status2 }} action {{ If numerous link events are occurring, check the physical connections to the Fibre Channel network. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_WARNING "REG_LOGIN: no buffers, VPI:%d DID:x%x, flag x%x\n" description {{ The driver attempted to issue a REG_LOGIN mailbox command to the HBA, but there were no buffers available. DATA: (1) Did (2) flag }} action {{ This message indicates: (1) Kernel virtual memory is depleted. Check that the system meets minimum RAM requirements for the Emulex Fibre Channel adapter. Try closing other applications to free some memory. (2) A possible driver buffer management problem. If the problem persists, report the error to Technical Support. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "REMOVE_ALL_SGL_PAGES mailbox failed with status x%x add_status x%x, mbx status x%x\n" description {{ The mailbox command sent to delete the SGL pages from the firmware has failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_INFO "Reset HBA Data: x%x x%x\n" description {{ An HBA has been reset. DATA: (1) hba_state (2) sli_flag }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_ERR "Resetting board due to mailbox timeout\n" description {{ A mailbox command failed to complete. The driver is resetting the port. }} action {{ If the mailbox command fails again, set the lpfc_log_verbose to LOG_MBOX and retry. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_INFO "Restart HBA Data: x%x x%x\n" description {{ The driver has been told to restart the HBA }} action {{ No action required, informational message. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_ERR "Ring %d Cannot find buffer for an unsolicited iocb. tag 0x%x\n" description {{ There are no more pre-allocated buffers available to handle unsolicited buffers. }} action {{ Ensure this port is not being managed by multiple ports. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Ring %d handler: Failed to allocate iocb Rctl x%x Type x%x received\n" description {{ The driver was unable to allocate memory to send a query config mailbox command }} action {{ None required. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Ring %d handler: portRspPut %d is bigger than rsp ring %d\n" description {{ The port rsp ring put index is larger than the size of the rsp ring. }} action {{ This error could indicate a software driver, firmware or hardware problem. Report these errors to Technical Support. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Ring %d handler: unexpected ASYNC_STATUS evt_code 0x%x\n" description {{ The HBA received an asynchronous event that was not a temperature event. }} action {{ None required. }} class: hardware sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Ring %d handler: unexpected completion IoTag x%x Data: x%x x%x x%x x%x\n" description {{ The driver could not find a matching command for the completion received on the specified ring. DATA: (1) ulpStatus (2) ulpWord[4] (3) ulpCommand (4) ulpContext }} action {{ This error could indicate a firmware or hardware problem. Report these errors to Technical Support. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Ring %d handler: unexpected Rctl x%x Type x%x received\n" description {{ The Rctl/Type of a received frame did not match any for the configured masks for the specified ring. }} action {{ This error could indicate a software driver, firmware or hardware problem. Report these errors to Technical Support. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Ring %d issue: portCmdGet %d is bigger than cmd ring %d\n" description {{ The port cmd ring get index is greater than the size of cmd ring. }} action {{ This error could indicate a software driver, firmware or hardware problem. Report these errors to Technical Support. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "RQ_CREATE mailbox failed with status x%x add_status x%x, mbx status x%x\n" description {{ The mailbox command sent to create the receive queue has failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "RQ_DESTROY mailbox failed with status x%x add_status x%x, mbx status x%x\n" description {{ The mailbox command sent to delete the work queue has failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_WARNING "Rsp Ring %d error: IOCB Data: x%x x%x x%x x%x x%x x%x x%x x%x\n" description {{ An IOCB error has occurred on the specified ring. DATA: (1) ulpWord[0] (2) ulpWord[1] (3) ulpWord[2] (4) ulpWord[3] (5) ulpWord[4] (6) ulpWord[5] (7) irsp+6 (8) irsp+7 }} action {{ If the problem persists, check the targets. If the targets are okay, report the error to Technical Support. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_INFO "Rsp Ring %d error: IOCB Data: x%x x%x x%x x%x x%x x%x x%x x%x x%x x%x x%x x%x x%x x%x x%x x%x\n" description {{ The firmware has returned an error for this IOCB. DATA: (1) (2) }} action {{ No action needed, informational. }} class: firmware type: info refcode: "" message: lpfc_printf_log KERN_ERR "SLI4 Adapter Hardware Error Data: x%x x%x\n" description {{ The HBA has encountered an unrecoverable error. }} action {{ Use hbacmd to retrieve a dump file. }} class: hardware sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "SLI_CONFIG_SPECIAL mailbox failed with status x%x\n" description {{ Mailbox command failed. }} action {{ Ensure the adapter’s firmware is current. Unload and reload the driver. }} class: firmware sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "SLI_FUNCTION_RESET mailbox failed with status x%x add_status x%x, mbx status x%x\n" description {{ Mailbox command failed. }} action {{ Reset the HBA. }} class: hardware sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Slow-path CQ identifier (%d) does not exist:\n" description {{ The Completion Queue ID passed in the Event Queue entry does not reference a valid completion queue. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_INFO "Slow-path wqe consume event carries miss-matched qid: wcqe-qid=x%x, sp-qid=x%x\n" description {{ The consumed entry does not have the slow path’s queueID. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_ERR "The lpfc_dmabuf allocation failed\n" description {{ The asynchronous link event handler could not allocate a mailbox command to issue the READ_LA (read link attention) mailbox command. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "The mboxq allocation failed\n" description {{ The asynchronous link event handler could not allocate a mailbox command to issue the READ_LA (read link attention) mailbox command. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "The mbuf allocation failed\n" description {{ The asynchronous link event handler could not allocate DMA-able memory for the READ_LA mailbox command. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "There is pending active mailbox cmd\n" description {{ The mailbox commands have overlapped. This command should have been added to the mailbox queue. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "The SLI4 DCBX asynchronous event is not handled yet\n" description {{ The SLI-4 DCBX asynchronous event is not handled yet. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Unable to allocate memory for issuing MBOX_CONFIG_MSI command\n" description {{ Mailbox memory pool allocation error. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Unable to allocate memory for issuing NOP mailbox command\n" description {{ Memory allocation for this mailbox command has failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Unable to allocate memory for issuing SLI_CONFIG_SPECIAL mailbox command\n" description {{ Mailbox memory pool allocation error. }} action {{ None required. }} class: unknown sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Unable to allocate memory for issuing SLI_FUNCTION_RESET mailbox command\n" description {{ Mailbox memory pool allocation error. }} action {{ None required. }} class: unknown sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Unable to deregister pages from HBA: %x\n" description {{ The SGL pages could not be unregistered from the firmware. }} action {{ None required. }} class: firmware sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Unable to select SLI-3. Not supported by adapter.\n" description {{ The HBA is not capable of operating in a given mode. }} action {{ SLI-3 mode is only available on some HBAs. Do not attempt to force the SLI mode to 3 on HBAs that do not support SLI-3 mode. This is an informational message. HBAs that do not support SLI-3 will be configured to run in SLI-2 mode, but it is recommended to use the auto setting (0). }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Unknown FCoE event type 0x%x event tag 0x%x\n" description {{ The firmware has detected an unknown FCoE event. }} action {{ Check the FCoE switch configuration and the HBA DCBX mode. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Unknown IOCB command Data: x%x x%x x%x x%x\n" description {{ Received an unknown IOCB command completion. DATA: (1) ulpCommand (2) ulpStatus (3) ulpIoTag (4) ulpContext }} action {{ This error could indicate a software driver or firmware problem. If these problems persist, report these errors to Technical Support. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Unknown IOCB command Data: x%x, x%x x%x x%x x%x\n" description {{ eceived an unknown IOCB command completion. DATA: (1) type (2) ulpCommand (3) ulpStatus (4) ulpIoTag (5) ulpContext }} action {{ This error could indicate a software driver or firmware problem. If these problems persist, report these errors to Technical Support. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Unrecognized lpfc_sli_mode parameter: %d.\n" description {{ The user has attempted to set the SLI mode to an invalid value. The only valid values for the SLI mode are 0, 2, and 3. DATA: (1) lpfc_sli_mode }} action {{ The lpfc_sli_mode driver parameter setting must be corrected. Valid values are 0, 2, and 3. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "UNREG_FCFI issue mbox failed\n" description {{ Could not issue the UNREG_FCFI mailbox command. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "UNREG_FCFI mbox allocation failed HBA state x%x\n" description {{ allocation for the UNREG_FCFI mailbox command has failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "UNREG_FCFI mbox allocation failed\n" description {{ Failed to allocate mailbox memory. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "UNREG_FCFI mbxStatus error x%x HBA state x%x\n" description {{ The Unregister FCFI mailbox failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Unregister FCFI command failed status %d, mbxStatus x%x\n" description {{ The driver was unable to unregister the FCFI from the firmware. }} action {{ None required. }} class: unknown sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "UNREG_VFI issue mbox failed rc x%x HBA state x%x\n" description {{ Could not issue the UNREG_VFI mailbox command. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "UNREG_VFI mbox allocation failed HBA state x%x\n" description {{ Could not allocate memory for UNREG_VFI mailbox command. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "UNREG_VFI mbxStatus error x%x HBA state x%x\n" description {{ The Unregister VFI mailbox command failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Unsupported CQ count. (%d)\n" description {{ Cannot create an completion queue of this size. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Unsupported EQ count. (%d)\n" description {{ Cannot create an event queue of this size. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Unsupported MQ count. (%d)\n" description {{ Cannot create MQ of this size. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Unsupported RQ count. (%d)\n" description {{ The receive queue ring can only be 512, 1024, 2048, or 4096. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_INFO "Vital Product Data: x%x x%x x%x x%x\n" description {{ Vital product data (VPD) contained in the HBA flash. DATA: (1) vpd[0] (2) vpd[1] (3) vpd[2] (4) vpd[3] }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_WARNING "VPD not present on adapter, mbxCmd x%x DUMP VPD, mbxStatus x%x\n" description {{ The DUMP_VPD mailbox command failed. }} action {{ This error could indicate a hardware or firmware problem. If the problem persists, report the error to Technical Support. }} class: unknown sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Wakeup on signal: rc=x%x\n" description {{ A signal other than the LPFC_DATA_READY was received on the worker thread. }} action {{ Unload and reload the driver. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "WQ_CREATE mailbox failed with status x%x add_status x%x, mbx status x%x\n" description {{ The mailbox command sent to create the work queue has failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "WQ_DESTROY mailbox failed with status x%x add_status x%x, mbx status x%x\n" description {{ The mailbox command sent to delete the work queue has failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_INFO "Abort outstanding I/O on NPort x%x Data: x%x x%x x%x\n" description {{ All outstanding I/Os are cleaned up on the specified remote NPort. DATA: (1) nlp_flag (2) nlp_state (3) nlp_rpi }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "ACC to LOGO completes to NPort x%x Data: x%x x%x x%x\n" description {{ The driver received a LOGO from a remote NPort and successfully issued an ACC response. DATA: (1) nlp_flag (2) nlp_state (3) nlp_rpi }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "ADISC completes to NPort x%x Data: x%x x%x x%x x%x x%x\n" description {{ The HBA performed a ADISC into a remote NPort. DATA: (1) ulpStatus (2) ulpWord[4] (3) ulpTimeout (4) disc (5) num_disc_nodes }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "Allocation request of %d command buffers did not succeed. Allocated %d buffers.\n" description {{ The allocation request for the specified command buffers did not succeed. However,the specified number of buffers has been allocated. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "Allocation request of %d command buffers will exceed max of %d. Reducing allocation request to %d.\n" description {{ The number of command buffers requested will exceed the maximum so a smaller quantity will be allocated. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_ERR "An FLOGI ELS command x%x was received from DID x%x in Loop Mode\n" description {{ While in Loop Mode an unknown or unsupported ELS command was received. }} action {{ Check device DID. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_INFO "At limitation of %d preallocated command buffers\n" description {{ The maximum number of command buffers have already been allocated. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_ERR "Bus Reset on target %d failed\n" description {{ The bus reset for the specified target failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_INFO "Cancel Discovery Timer state x%x Data: x%x x%x x%x\n" description {{ Cancel the device discovery / RSCN rescue timer. DATA: (1) fc_flag (2) fc_plogi_cnt (3) fc_adisc_cnt }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_ERR "Cannot issue NameServer login\n" description {{ Could not issue an ELS PLOGI to the nameserver DID. }} action {{ Check the port connection and the switch configuration. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "Cannot issue Register Fabric login: Err %d\n" description {{ Could not issue the fabric reg login, the err value is unique for each possible failure. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "Cannot Register NameServer login\n" description {{ Either a memory allocation issue or an invalid parameter was sent to the REG_LOGIN. }} action {{ At least one message (0142 0121 0133 0134 0135) should precede this message. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_INFO "Cleanup node for NPort x%x Data: x%x x%x x%x\n" description {{ The driver node table entry for a remote NPort was removed. DATA: (1) nlp_flag (2) nlp_state (3) nlp_rpi }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_ERR "CLEAR_LA mbxStatus error x%x hba state x%x\n" description {{ The driver issued a CLEAR_LA mbox command to the HBA that failed. }} action {{ This error could indicate a firmware or hardware problem. Report these errors to Technical Support. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "CLEAR LA timeout\n" description {{ The driver issued a CLEAR_LA that never completed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "CONFIG_LINK bad hba state x%x\n" description {{ A CONFIG_LINK mbox command completed and the driver was not in the right state. }} action {{ Software driver error. If this problem persists, report these errors to Technical Support. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "CONFIG_LINK mbxStatus error x%x HBA state x%x\n" description {{ The driver issued a CONFIG_LINK mbox command to the HBA that failed. }} action {{ This error could indicate a firmware or hardware problem. Report these errors to Technical Support. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_INFO "Continue discovery with %d ADISCs to go Data: x%x x%x x%x\n" description {{ A device discovery is in progress. DATA: (1) fc_adisc_cnt (2) fc_flag (3) phba->hba_state }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "Continue discovery with %d PLOGIs to go Data: x%x x%x x%x\n" description {{ Device discovery is in progress. DATA: (1) fc_plogi_cnt (2) fc_flag (3) phba->hba_state }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_ERR "Could not issue unreg_did (default rpis) status %d\n" description {{ Attempt to unregister rpi failed. }} action {{ Software driver error. If this problem persists, report these errors to Technical Support. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "Could not issue unreg_login(all_rpis) status %d\n" description {{ The unreg_login cannot be issued. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "Could not issue unreg_vpi\n" description {{ Driver attempt to unregister vpi failed. }} action {{ Software driver error. If this problem persists, report these errors to Technical Support. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "Create VPORT failed. Cannot get sparam\n" description {{ The port could not be created because it could not be initialized possibly due to unavailable resources. }} action {{ Software driver error. If this problem persists, report these errors to Technical Support. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "Create VPORT failed. Duplicate WWN on HBA\n" description {{ The port could not be created because it would duplicate an existing WWNN HBA address. The resources for the port had to be discarded. }} action {{ Provide a WWN that is unique. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "Create VPORT failed. Invalid WWN format\n" description {{ The port could not be created due to an invalid WWNN or WWPN format. }} action {{ Provide a valid WWN when creating Vports. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "Create VPORT Interrupted.\n" description {{ The port creation process was unexpectedly interrupted at a critical time and the operation was unsuccessful. }} action {{ The process was interrupted while creating a VPort. Retry the command. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_WARNING "Create vport work array FAILED: cannot do scsi_host_get\n" description {{ The driver was unable to get a reference to a SCSI host. }} action {{ Software driver error. If this problem persists, report these errors to Technical Support. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_INFO "CT Request completes, latt %d, ulpStatus x%x CmdRsp x%x, Context x%x, Tag x%x\n" description {{ A RFT request that was sent to the fabric completed. DATA: (1) latt (2) ulpStatus (3) CmdRsp (4) Context (5) Tag }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "Deferred RSCN Data: x%x x%x x%x\n" description {{ The driver has received multiple RSCNs and has deferred the processing of the most recent RSCN. DATA: (1) fc_rscn_id_cnt (2) fc_flag (3) hba_state }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "Device Discovery completes\n" description {{ This indicates successful completion of device (re)discovery after a link up. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_ERR "Device Discovery completion error\n" description {{ This indicates that an uncorrectable error was encountered during device (re)discovery after a link up. Fibre Channel devices will not be accessible if this message is displayed. }} action {{ Reboot the system. If the problem persists, report the error to Technical Support. Run with verbose mode on for more details. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "Device Reset rport failure: rdata x%p\n" description {{ The reset of the Rport failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "Discovery Mailbox error: state: 0x%x : %p %p\n" description {{ Either the driver could not allocate resources or it could not send sparam_mbox or cfglink_mbox. DATA: (1) address of sparam_mbox command (2) address of cfglink_mbox command }} action {{ Attempt to unload and reload the driver when it is convenient. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "Dropping received ELS cmd Data: x%x x%x x%x\n" description {{ The driver decided to drop an ELS Response ring entry. DATA: (1) ulpStatus (2) ulpWord[4] (3) ulpTimeout }} action {{ This error could indicate a software driver or firmware problem. If problems persist report these errors to Technical Support. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_INFO "DSM in event x%x on NPort x%x in state %d Data: x%x\n" description {{ The driver Discovery State Machine is processing an event. DATA: (1) nlp_flag }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "DSM out state %d on NPort free\n" description {{ The driver Discovery State Machine completed processing an event. DATA: (1) nlp_flag }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "DSM out state %d on NPort x%x Data: x%x\n" description {{ The driver Discovery State Machine completed processing an event. DATA: (1) nlp_flag }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "ELS cmd tag x%x completes Data: x%x x%x x%x\n" description {{ The specific ELS command was completed by the firmware. DATA: (1) ulpStatus (2) ulpWord[4] (3) ulpTimeout }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "ELS command x%x received from NPORT x%x Data: x%x\n" description {{ Received the specific ELS command from a remote NPort. DATA: (1) hba_state }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "ELS response tag x%x completes Data: x%x x%x x%x x%x x%x x%x x%x\n" description {{ The specific ELS response was completed by the firmware. DATA: (1) ulpStatus (2) ulpWord[4] (3) ulptimeout (4) nlp_DID (5) nlp_flag (6) nlp_state (7) nlp_rpi }} action {{ No action needed, informational. }} class: firmware type: info refcode: "" message: lpfc_printf_vlog KERN_ERR "ELS rsp: Cannot issue reg_login for x%x Data: x%x x%x x%x\n" description {{ REG_LOGIN mailbox command failed. DATA: (1) nlp_DID (2) nlp_state (3) nlp_flag (4) nlp_rpi }} action {{ None required. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "ELS timeout Data: x%x x%x x%x x%x\n" description {{ An ELS IOCB command was posted to a ring and did not complete within ULP timeout seconds. DATA: (1) elscmd (2) remote_id (3) ulpcommand (4) ulpIoTag }} action {{ If no ELS command is going through the adapter, reboot the system; If problem persists, contact Technical Support. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_INFO "Fabric does not support NPIV - configuring single port mode.\n" description {{ The fabric reports no support for NPIV upon FLOGI. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_ERR "Failed to allocate init_vpi mailbox\n" description {{ Failed to allocate init_vpi mailbox\n. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "Failed to allocate memory for ELS event\n" description {{ Memory could not be allocated to send the ELS event to the FC transport. }} action {{ None required. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "Failed to allocate memory for LOGO event\n" description {{ Memory could not be allocated to send the LOGO event to the FC transport. }} action {{ None required. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "Failed to allocate memory for RSCN event\n" description {{ Memory could not be allocated to send the RSCN event to the management application. }} action {{ None required. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "Failed to issue INIT_VPI mailbox command\n" description {{ Failed to INIT_VPI. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "Failed to issue init_vpi mailbox\n" description {{ The driver was unable to send an initialize VPI mailbox command. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_WARNING "FAN timeout\n" description {{ A link up event was received without the login bit set, so the driver waits E_D_TOV for the Fabric to send a FAN. If no FAN if received, a FLOGI will be sent after the timeout. }} action {{ None required. The driver recovers from this condition by issuing a FLOGI to the fabric. }} class: hardware sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_INFO "FARP-REQ received from DID x%x\n" description {{ An unsolicited FARP request was received. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_WARNING "FCP cmd x%x failed <%d/%d> status: x%x result: x%x Data: x%x x%x\n" description {{ The specified device failed an FCP command. DATA: (1) ulpContext (2) iotag }} action {{ Check the state of the target in question. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_WARNING "FCP command x%x failed: x%x SNS x%x x%x Data: x%x x%x x%x x%x x%x\n" description {{ The FCP command failed with a response error. DATA: (1) resp_info (2) scsi_status (3) ResId (4) SnsLen (5) RspLen (6)rspInfo3 }} action {{ Check the state of the target in question. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_INFO "FCP command x%x residual overrun error. Data: x%x x%x\n" description {{ A residual overrun error has occurred while processing the specified FCP command. DATA: (1) request_bufflen (2) resid }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "FCP command x%x residual underrun converted to error Data: x%x x%x x%x\n" description {{ The driver converted this underrun condition to an error based on the underflow field in the SCSI command. DATA: (1) len (2) resid (3) underflow }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "FCP Read Check Error and Underrun Data: x%x x%x x%x x%x\n" description {{ HBA reported under run from storage array. DATA: (1) vpi (2) fcpDI (3) res_id (4) fcpi_parm }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_WARNING "FCP Read Check Error Data: x%x x%x x%x x%x\n" description {{ The issued FCP command returned a read check error. DATA: (1) fcpDl (2) rspResId (3) fcpi_parm (4) cmd[0] }} action {{ Check the state of the target in question. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_INFO "FCP Read Underrun, expected %d, residual %d Data: x%x x%x x%x\n" description {{ An FCP device provided less data than was requested. DATA: (1) fcpi_parm (2) cmnd[0] (3) underflow }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_ERR "FDISC failed. (%d/%d)\n" description {{ DATA: lsRjtError }} action {{ Reconfigure the switch to support more NPIV logins. If problem persists, contact Technical Support. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "FDISC Failed (x%x).\n" description {{ DATA: lsRjtError }} action {{ Reconfigure the switch to support more NPIV logins. If problem persists, contact Technical Support. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_INFO "FDMI Request Data: x%x x%x x%x\n" description {{ The driver is sending an FDMI request to the fabric. DATA: (1) fc_flag (2) hba_state (3) cmdcode }} action {{ No action needed, informational. }} class: unknown type: info refcode: "" message: lpfc_printf_vlog KERN_WARNING "FDMI rsp failed Data: x%x\n" description {{ An error response was received to FDMI request. DATA:(1) SWAP_DATA16(fdmi_cmd) }} action {{ The fabric does not support FDMI, check fabric configuration. }} class: unknown sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_INFO "FIND node did x%x NOT FOUND.\n" description {{ The driver was searching for a node table entry based on the DID and the entry was not found. DATA: (1) order }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "FLOGI completes successfully Data: x%x x%x x%x x%x\n" description {{ An ELS FLOGI command that was sent to the fabric succeeded. DATA: (1) ulpWord[4] (2) e_d_tov (3) r_a_tov (4) edtovResolution }} action {{ No action needed, informational. }} class: unknown type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "FLOGI failure Data: x%x x%x x%x\n" description {{ An ELS FLOGI command that was sent to the fabric failed. DATA: (1) ulpStatus (2) ulpWord[4] (3) ulpTimeout }} action {{ No action needed, informational. }} class: unknown type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "FLOGI NPIV supported, response data 0x%x\n" description {{ The fabric reports support for NPIV upon FLOGI. DATA: (1) response_multiple_NPort }} action {{ No action needed, informational. }} class: unknown type: info refcode: "" message: lpfc_printf_vlog KERN_ERR "GID_FT Query error: 0x%x 0x%x\n" description {{ The GID_FT CT request for the nameserver has failed. }} action {{ Check the switch configuration. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "Ignoring change to nodev_tmo because devloss_tmo is set.\n" description {{ Attempting to change the nodev timeout when the devloss has already been set. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "Ignoring nodev_tmo module parameter because devloss_tmo is set.\n" description {{ Both module parameters (nodev and devloss) were set so the driver is ignoring the nodev parameter. }} action {{ Only one of these parameters must be set. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "Illegal State Transition: node x%x event x%x, state x%x Data: x%x x%x\n" description {{ The current node state does not have a handler for this event. DATA: (1) nlp_rpi (2) nlp_flag }} action {{ Verify that all targets are still visible to the SCSI mid-layer. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "Init VPI mailbox failed 0x%x\n" description {{ The Initialize VPI mailbox command failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "Invalid response length: tgt x%x lun x%x cmnd x%x rsplen x%x\n" description {{ The response length for this FCP command is not supported. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_INFO "Iodone <%d/%d> cmd %p, error x%x SNS x%x x%x Data: x%x x%x\n" description {{ This error indicates that the Fibre Channel driver is returning a SCSI command to the SCSI layer in error or with sense data. DATA: (1) retry (2) resid }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_ERR "I/O flush failure for context %s : cnt x%x\n" description {{ The I/O flush to the {LUN TARGET or HOST] has failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "Issue FDISC: Cannot send IOCB\n" description {{ Unable to send the fabric IOCB. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "Issue FDISC: no IOCB\n" description {{ All of the pre-allocated IOCBs are in use. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_WARNING "Issue FDMI request failed Data: x%x\n" description {{ Cannot issue an FDMI request to the HBA. DATA: (1) cmdcode }} action {{ No action needed, informational. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_INFO "Issue GEN REQ IOCB to NPORT x%x Data: x%x x%x\n" description {{ Issue a GEN REQ IOCB for remote NPORT. These are typically used for CT request. DATA: (1) ulpIoTag (2) hba_state }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_ERR "Issue NameServer Req x%x err %d Data: x%x x%x\n" description {{ The driver was not able to send the nameserver CT command. DATA: (1) vports fc_flag (2) vports fc_rscn_id_cn }} action {{ Check the port and switch configurations. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "Issue Register VFI failed: Err %d\n" description {{ The driver could not register the Virtual Fabric Index for the FCFI. }} action {{ Check the switch and port configurations. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_INFO "LOGO completes to NPort x%x Data: x%x x%x x%x x%x\n" description {{ The HBA performed a LOGO to a remote NPort. DATA: (1) ulpStatus (2) ulpWord[4] (3) ulpTimeout (4) num_disc_nodes }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_ERR "lpfc_alloc_bucket failed to allocate statistical data buffer DID 0x%x\n" description {{ Memory allocation failed for node’s statistical data. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_INFO "lpfc_cleanup_node: ndlp:x%p usgmap:x%x refcnt:%d\n" description {{ Node clean-up wascalled to prepare the node for release. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_ERR "lpfc_devloss_tmo attribute cannot be set to %d, allowed range is [%d, %d]\n" description {{ Attempt to set the devloss timeout value is outside the allowed range. }} action {{ Set the devloss timeout between the minimum and maximum devloss range. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_WARNING "lpfc_enable_node: ndlp:x%p usgmap:x%x refcnt:%d\n" description {{ Enable node was attempted on an inactive node. }} action {{ No action needed, informational. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_WARNING "lpfc_nlp_get: ndlp:x%p usgmap:x%x refcnt:%d\n" description {{ A kref_get was attempted on a node that was being released. }} action {{ No action needed, informational. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_WARNING "lpfc_nlp_put: ndlp:x%p usgmap:x%x refcnt:%d\n" description {{ A kref_put was called again after the node was already inactive. }} action {{ No action needed, informational. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "lpfc_nlp_state_cleanup failed to allocate statistical data buffer DID 0x%x\n" description {{ Memory allocation failed for node’s statistical data. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "lpfc_nodev_tmo attribute cannot be set to %d, allowed range is [%d, %d]\n" description {{ The attempt to set the devloss timeout value failed because the value is out of the allowable range. }} action {{ Use a value between the minimum and maximum values. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "lpfc_restrict_login attribute cannot be set to %d, allowed range is [0, 1]\n" description {{ The module parameter lpfc_restrict_login can only be set to 0 (off) or 1 (on). }} action {{ Set lpfc_restrict_login=[0,1]. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "lpfc_restrict_login must be 0 for Physical ports.\n" description {{ Attempt to set the restrict login parameter to something other than on or off. }} action {{ Use 0 (Off) or 1 (On). }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "NameServer GFF Rsp x%x Error (%d %d) Data: x%x x%x\n" description {{ The nameServer GFF CT request failed. DATA: (1) vports fc_flag (2) vports fc_rscn_id_cnt }} action {{ Check the port and switch configurations. }} class: hardware sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "NameServer login: node freed\n" description {{ The enable mode failed to free up the nameserver login. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "NameServer login: no memory\n" description {{ Could not allocate memory for the NDLP structure. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "NameServer Query timeout Data: x%x x%x\n" description {{ Node authentication timeout, node Discovery timeout. A NameServer Query to the Fabric or discovery of reported remote NPorts is not acknowledged within R_A_TOV. DATA: (1) fc_ns_retry (2) fc_max_ns_retry }} action {{ Check Fabric configuration. The driver recovers from this and continues with device discovery. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "NameServer Rsp Data: x%x\n" description {{ The driver received a NameServer response containing a status error. DATA: (1) CommandResponse.bits.CmdRsp (2) ReasonCode (3) Explanation (4) fc_flag }} action {{ Check the fabric configuration. The driver recovers from this and continues with device discovery. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "Node Authentication timeout\n" description {{ The driver has lost track of what NPORTs are being authenticated. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "Nodelist not empty\n" description {{ Driver unloaded or hotplug detected a node still in use. }} action {{ None required. }} class: unknown sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "No NPIV Fabric support\n" description {{ The driver was unable to create an NPIV Vport because it is not supported by the attached fabric. DATA: (1) rctl_names[fc_hdr->fh_r_ctl], (2) type_names[fc_hdr->fh_type]) }} action {{ Reconfigure the switch to support NPIV. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "No retry ELS command x%x to remote NPORT x%x Retried:%d Error:x%x/%x\n" description {{ (1) ulpStatus (2) ulpWord[4] }} action {{ None required. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "NS cmd %x Error (%d %d)\n" description {{ The nameServer CT request failed. }} action {{ Check the port and switch configurations. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "Pending Link Event during Discovery: State x%x\n" description {{ Received link event during discovery. Causes discovery restart. }} action {{ None required unless problem persists. If persistent check cabling. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "PLOGI: cannot format reg_login Data: x%x x%x x%x x%x\n" description {{ Could not allocate an RPI or DMA buffer for the mailbox command. DATA: (1) nlp_DID (2) nlp_state (3) nlp_flag (4) nlp_rpi }} action {{ None required. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "PLOGI: cannot issue reg_login Data: x%x x%x x%x x%x\n" description {{ The ELS PLOGI mailbox command has failed. DATA: (1) nlp_DID 92) nlp_state (3) nlp_flag (4) nlp_rpi }} action {{ Check the port and switch configuration. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_INFO "PLOGI chkparm OK Data: x%x x%x x%x x%x\n" description {{ Received a PLOGI from a remote NPORT and its Fibre Channel service parameters match this HBA. Request can be accepted. DATA: (1) nlp_DID (2) nlp_state (3) nlp_flag (4) nlp_Rpi }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "PLOGI completes to NPort x%x Data: x%x x%x x%x x%x x%x\n" description {{ The HBA performed a PLOGI into a remote NPort. DATA: (1) ulpStatus (2) ulpWord[4] (3) ulpTimeout (4)disc (5) num_disc_nodes }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_ERR "PLOGI completes to NPort x%x with no ndlp. Data: x%x x%x x%x\n" description {{ A PLOGI has completed for which there is no NDLP. DATA: (1) ulpStatus (2) ulpWord[4] }} action {{ None required. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "PLOGI: no memory for reg_login Data: x%x x%x x%x x%x\n" description {{ Memory allocation error. DATA: (1) nlp_DID (2) nlp_state (3) nlp_flag (4) nlp_rpi }} action {{ Memory allocation error. Check system resources. Unload unused modules. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "PLOGI Reject: invalid nname\n" description {{ Invalid node WWN provided. }} action {{ None required. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "PLOGI RSP: Invalid WWN.\n" description {{ The PLOGI sent to the port by a remote port had an invalid WWN. }} action {{ None required. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_INFO "PRLI completes to NPort x%x Data: x%x x%x x%x x%x\n" description {{ The HBA performed a PRLI into a remote NPort. DATA: (1) ulpStatus (2) ulpWord[4] (3) ulpTimeout (4) num_disc_nodes }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "Process x%x NameServer Rsp Data: x%x x%x x%x\n" description {{ The driver received a NameServer response. DATA: (1) nlp_flag (2) fc_flag (3) fc_rscn_id_cnt }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_ERR "READ_SPARAM mbxStatus error x%x hba state x%x>\n" description {{ The driver issued a READ_SPARAM mbox command to the HBA that failed. }} action {{ This error could indicate a firmware or hardware problem. Report these errors to Technical Support. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_INFO "ReDiscovery RSCN Data: x%x x%x x%x\n" description {{ The number / type of RSCNs has forced the driver to go to the nameserver and rediscover all NPORTs. DATA: (1) fc_rscn_id_cnt (2) fc_flag (3) hba_state }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_ERR "REG_FCFI mbxStatus error x%x HBA state x%x\n" description {{ The REG_FCFI mailbox command has failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "Register Fabric login error: 0x%x\n" description {{ The REG_LOGIN for the fabric has failed. }} action {{ Check the port connection and the switch configuration. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "Register NameServer error: 0x%x\n" description {{ The REG_LOGIN mailbox command has failed for the nameserver. }} action {{ Check the switch configuration }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "Register VPI: Can't send mbox\n" description {{ Could not issue the REG_LOGIN command for this VPort. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "Register VPI: no memory\n" description {{ Could not allocate memory for the REG_LOGIN mailbox command. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "RegLogin failed Data: x%x x%x x%x\n" description {{ The firmware returned a failure for the specified RegLogin. DATA: (1) Did (2) mbxStatus (3) hbaState }} action {{ This message indicates that the firmware could not do RegLogin for the specified Did. There may be a limitation on how many nodes an HBA can see. }} class: firmware sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "REG_VFI mbxStatus error x%x HBA state x%x\n" description {{ The REG_VFI mailbox command has failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_INFO "Retry ELS command x%x to remote NPORT x%x Data: x%x x%x\n" description {{ The driver is retrying the specific ELS command. DATA: (1) retry (2) delay }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "RSCN processed Data: x%x x%x x%x x%x\n" description {{ An RSCN ELS command was received from a fabric and processed. DATA: (1) fc_flag (2) cnt (3) fc_rscn_id_cnt (4) hba_state }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "RSCN received Data: x%x x%x x%x x%x\n" description {{ An RSCN ELS command was received from a fabric. DATA: (1) fc_flag (2) payload_len (3) *lp (4)fc_rscn_id_cnt }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_ERR "RSCN timeout Data: x%x x%x\n" description {{ The driver has lost track of what NPORTs have RSCNs pending. DATA: (1) fc_ns_retry (2) lpfc_max_ns_retry }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "SCSI layer issued Bus Reset Data: x%x\n" description {{ The SCSI layer is requesting the driver to abort all I/Os to all targets on this HBA. DATA: (1) ret }} action {{ Check the state of the targets in question. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "Signal aborted mbxCmd x%x\n" description {{ A pending mailbox command was aborted because the thread received a signal. }} action {{ You should retry the attempted command. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_INFO "Skip x%x NameServer Rsp Data: x%x x%x\n" description {{ The driver received a NameServer response. DATA: (1) size (2) fc_flag (3) fc_rscn_id_cnt (4)no_rscn_id_cnt }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "Start Discovery hba state x%x Data: x%x x%x x%x\n" description {{ Device discovery / rediscovery after FLOGI, FAN or RSCN has started. DATA: (1) fc_flag (2) fc_plogi_cnt (3) fc_adisc_cnt }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "Start Discovery Timer state x%x Data: x%x x%lx x%x x%x\n" description {{ Start the device discovery / RSCN rescue timer. DATA: (1) tmo (2) fc_disctmo (3) fc_plogi_cnt (4) fc_adisc_cnt }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_ERR "Target Reset rport failure: rdata x%p\n" description {{ The reset of the target failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "Timeout while waiting for NameServer login\n" description {{ Our login request to the NameServer was not acknowledged within RATOV. }} action {{ Check the fabric configuration. The driver recovers from this and continues with device discovery. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "TMF %s to TGT %d LUN %d failed (%d, %d)\n" description {{ The task management command failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "Unexpected discovery timeout, vport State x%x\n" description {{ The discovery process has timed out. }} action {{ Verify that all targets are still visible. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "Unexpected timeout, hba link state x%x\n" description {{ Discovery has timed out and the HBA state is not ready. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "Unknown ELS command x%x received from NPORT x%x\n" description {{ Received an unsupported ELS command from a remote NPORT. }} action {{ Check remote NPORT for potential problem. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_INFO "Vport Created.\n" description {{ This message is displayed to indicate that a port was created in the system. It is displayed at this level to ensure it is always appears at all log levels. }} action {{ None required. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_ERR "Vport Disabled.\n" description {{ The port had to be disabled in the system. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "vport_delete failed: Cannot delete physical host\n" description {{ An attempt to delete a port failed because it was to delete a physical port and not a virtual port. Only VPorts on physical ports can be deleted on an NPIV system. }} action {{ Software driver error. If this problem persists, report these errors to Technical Support. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "vport_delete failed: Cannot delete static vport.\n" description {{ Static VPorts cannot be deleted. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "Vport Deleted.\n" description {{ A Vport was deleted. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "Vport discovery quiesce Wait: state x%x fc_flags x%x num_nodes x%x, waiting 1000 msecs total wait msecs x%x\n" description {{ Could not pause discovery on this VPort. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "Vport Enabled.\n" description {{ The port had to be enabled after possible recovery from some errors. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "VPort failed init, mbxCmd x%x READ_SPARM mbxStatus x%x, rc = x%x\n" description {{ A pending mailbox command issued to initialize port, failed. DATA: (1) mbxCommand (2) mbxStatus (3) rc }} action {{ Software driver error. If this problem persists, report these errors to Technical Support. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_INFO "Xmit ADISC ACC response iotag x%x xri: x%x, did x%x, nlp_flag x%x, nlp_state x%x rpi x%x\n" description {{ An ADISC ACC response for the specified IO tag has been sent. DATA: (1) xri (for SLI-4) (2) ulpContext (3) nlp_DID (4) nlp_flag (5) nlp_state (6) nlp_rpi }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "Xmit ELS ACC response tag x%x, XRI: x%x, DID: x%x, nlp_flag: x%x nlp_state: x%x RPI: x%x\n" description {{ An ELS accept response for the specified IO tag has been sent. DATA: (1) ulpContext (2) nlp_DID (3) nlp_flag (4) nlp_state (5) nlp_rpi }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "Xmit ELS command x%x to remote NPORT x%x I/O tag: x%x, port state: x%x\n" description {{ Xmit ELS command to remote NPORT. DATA: (1) icmd->ulpIoTag (2) hba_state }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "Xmit ELS response x%x to remote NPORT x%x I/O tag: x%x, size: x%x\n" description {{ Xmit ELS response to remote NPORT. DATA: (1) icmd->ulpIoTag (2) size }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "Xmit ELS RJT x%x response tag x%x xri x%x, did x%x, nlp_flag x%x, nlp_state x%x, rpi x%x\n" description {{ An ELS reject response with the specified error for the specified IO tag has been sent. DATA: (1) xri (for SLI-4) (2) ulpContext (3) nlp_DID (4) nlp_flag (5) nlp_state (6) nlp_rpi }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "Xmit ELS RPL ACC response tag x%x xri x%x, did x%x, nlp_flag x%x, nlp_state x%x, rpi x%x\n" description {{ An RPL ACC response for the specified IO tag has been sent. DATA: (1) xri (for SLI-4) (2) ulpContext (3) nlp_DID (4) nlp_flag (5) nlp_state (6) nlp_rpi }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "Xmit ELS RPS ACC response tag x%x xri x%x, did x%x, nlp_flag x%x, nlp_state x%x, rpi x%x\n" description {{ An RPS ACC response for the specified IO tag has been sent. DATA: (1) xri (for SLI-4) (2) ulpContext (3) nlp_DID (4) nlp_flag (5) nlp_state (6) nlp_rpi }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "Xmit PRLI ACC response tag x%x xri x%x, did x%x, nlp_flag x%x, nlp_state x%x, rpi x%x\n" description {{ A PRLI ACC response for the specified IO tag has been sent. DATA: (1) xri (for SLI-4) (2) ulpContext (3) nlp_DID (4) nlp_flag (5) nlp_state (6) nlp_rpi }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "Xmit RNID ACC response tag x%x xri x%x\n" description {{ A RNID ACC response for the specified IO tag has been sent. DATA: (1) ulpContext }} action {{ No action needed, informational. }} class: software type: info refcode: "" ppc64-diag-2.7.4/ela/message_catalog/qla2xxx0000644000000000000000000011066613135275400015474 00000000000000subsystem: scsi file: "drivers/scsi/qla2xxx/qla_attr.c" message: qla_printk KERN_INFO "Firmware dump cleared on (%ld).\n" description {{ Previous firmware dump was cleared from memory. }} action {{ None recommended. }} class: firmware type: info refcode: "" message: qla_printk KERN_WARNING "Raw firmware dump ready for read on (%ld).\n" description {{ Firmware dump now ready to be read. }} action {{ None recommended. }} class: firmware type: info refcode: "" message: qla_printk KERN_ERR "HBA not online, failing NVRAM update.\n" description {{ Application tried to write to NVRAM of adapter that is offline. }} action {{ None recommended. }} class: hardware sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to allocate memory for optrom retrieval (%x).\n" description {{ System has low memory. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Invalid start region 0x%x/0x%x.\n" description {{ Invalid starting address of option rom memory. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to allocate memory for optrom update (%x).\n" description {{ System has low memory. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "HBA not online, failing flash update.\n" description {{ Application tried to write to flash memory of adapter that is offline. }} action {{ None recommended. }} class: hardware sl_severity: warning refcode: "" message: qla_printk KERN_ERR "HBA not online, failing VPD update.\n" description {{ Application tried to write to vital product data of adapter that is offline. }} action {{ None recommended. }} class: hardware sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to allocate memory for VPD information update.\n" description {{ System has low memory. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to allocate memory for SFP read-data.\n" description {{ System has low memory. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to read SFP data (%x/%x/%x).\n" description {{ Firmware did not return any information for requested SFP data. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_INFO "Issuing ISP reset on (%ld).\n" description {{ Debug ASIC reset. }} action {{ None recommended. }} class: software type: info refcode: "" message: qla_printk KERN_INFO "Issuing MPI reset on (%ld).\n" description {{ Debug reset of 81xx MP firmware. }} action {{ None recommended. }} class: software type: info refcode: "" message: qla_printk KERN_ERR "MPI reset failed on (%ld).\n" description {{ MPI firmware reset failed during loopback test. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to allocate memory for XGMAC read-data.\n" description {{ System has low memory. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to read XGMAC data (%x).\n" description {{ Unable to ethernet transmission statistics. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to allocate memory for DCBX TLV read-data.\n" description {{ System has low memory. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to read DCBX TLV data (%x).\n" description {{ Unable to read data center bridging type-length-value data. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to create sysfs %s binary attribute (%d).\n" description {{ Error creating sysfs attribute. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_WARNING "Abort ISP active -- ignoring beacon request.\n" description {{ Request to blink beacon ignored. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_INFO "VP entry id %d assigned.\n" description {{ Virtual port index of new NPIV port. }} action {{ None recommended. }} class: software type: info refcode: "" message: qla_printk KERN_WARNING "Can't create request queue for vp_idx:%d\n" description {{ Could not create a separate request queue for new virtual port. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_WARNING "Queue delete failed.\n" description {{ Could not delete request queue specific to a virtual port being deleted. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_INFO "vport %d deleted\n" description {{ Virtual port successfully deleted. }} action {{ None recommended. }} class: software type: info refcode: "" file: "drivers/scsi/qla2xxx/qla_bsg.c" message: qla_printk KERN_ERR "MPI reset failed on (%ld).\n" description {{ MPI firmware reset failed during loopback test. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" file: "drivers/scsi/qla2xxx/qla_dbg.c" message: qla_printk KERN_ERR "Failed to dump firmware (%x)!!!\n" description {{ Procedure to produce a firmware dump failed. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_INFO "Firmware dump saved to temp buffer (%ld/%p).\n" description {{ Procedure to produce firmware dump succeeded and is ready for retrieval. }} action {{ None recommended. }} class: software type: info refcode: "" message: qla_printk KERN_ERR "No buffer available for dump!!!\n" description {{ Memory buffer for firmware dump was never allocated. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" file: "drivers/scsi/qla2xxx/qla_dfs.c" message: qla_printk KERN_ERR "DebugFS: Unable to disable FCE (%d).\n" description {{ Error flushing fibre channel event buffer. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "DebugFS: Unable to reinitialize FCE (%d).\n" description {{ Error reinitializing trace when ending a trace session. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "DebugFS: Unable to create root directory.\n" description {{ Unable to create the qla2xxx directory in the debugFS filesystem. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "DebugFS: Unable to create ha directory.\n" description {{ Unable to create a directory for this adapter in DebugFS. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "DebugFS: Unable to fce node.\n" description {{ Unable to create fibre channel event node in DebugFS. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" file: "drivers/scsi/qla2xxx/qla_init.c" message: qla_printk KERN_WARNING "Configuring PCI space...\n" description {{ Driver is configuring PCI configuration registers. }} action {{ None recommended. }} class: software type: info refcode: "" message: qla_printk KERN_INFO "Configure NVRAM parameters...\n" description {{ Driver is reading NVRAM parameters and configuring driver settings with them. }} action {{ None recommended. }} class: software type: info refcode: "" message: qla_printk KERN_WARNING "Masking HBA WWPN %02x%02x%02x%02x%02x%02x%02x%02x (via NVRAM).\n" description {{ Masking this HBA from operating system based on NVRAM parameters. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_INFO "Verifying loaded RISC code...\n" description {{ Verifying that the firmware image is valid. }} action {{ None recommended. }} class: software type: info refcode: "" message: qla_printk KERN_ERR "Unable to configure ISP84XX.\n" description {{ Error configuring 84xx CNA specific settings. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to initialize ISP84XX.\n" description {{ Error initializing 84xx CNA specific firmware. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_WARNING "RISC CODE NOT loaded\n" description {{ Not loading firmware from flash memory. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Wrong product ID = 0x%x,0x%x,0x%x\n" description {{ Bad product ID detected for 1Gb/s or 2Gb/s adapter. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Failed mailbox send register test\n" description {{ Register communication test for adapter failed. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_WARNING "Firmware dump previously allocated.\n" description {{ Memory for a firmware dump has already been allocated. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to allocate (%d KB) for FCE.\n" description {{ System has low memory. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to initialize FCE (%d).\n" description {{ Mailbox command to initialize the fibre channel event buffer. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_INFO "Allocated (%d KB) for FCE...\n" description {{ Information about how much memory was allocated for the fibre channel event buffer. }} action {{ None recommended. }} class: software type: info refcode: "" message: qla_printk KERN_ERR "Unable to allocate (%d KB) for EFT.\n" description {{ System has low memory. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to initialize EFT (%d).\n" description {{ Mailbox command to initialize the event trace buffer failed. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_INFO "Allocated (%d KB) for EFT...\n" description {{ Information about how much memory was allocated for the event trace buffer. }} action {{ None recommended. }} class: software type: info refcode: "" message: qla_printk KERN_ERR "Unable to allocate (%d KB) for firmware dump!!!\n" description {{ System has low memory. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_INFO "Allocated (%d KB) for firmware dump...\n" description {{ Informational about how much memory was allocated for firmware dump. }} action {{ None recommended. }} class: software type: info refcode: "" message: qla_printk KERN_ERR "Unsupported FAC firmware (%d.%02d.%02d).\n" description {{ Error getting information about flash access commands. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to update Serial Link options (%x).\n" description {{ Error setting link parameters. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_WARNING "MSIX Handshake Disable Mode turned on\n" description {{ No MSI-X handshaking needed for this adapter. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_INFO "Waiting for LIP to complete...\n" description {{ Waiting for link to stabilize. }} action {{ None recommended. }} class: software type: info refcode: "" message: qla_printk KERN_INFO "scsi(%ld): Waiting for LIP to complete...\n" description {{ Waiting for link to stabilize. }} action {{ None recommended. }} class: software type: info refcode: "" message: qla_printk KERN_WARNING "Cable is unplugged...\n" description {{ Adapter not connected to another physical port. }} action {{ None recommended. }} class: hardware sl_severity: warning refcode: "" message: qla_printk KERN_ERR "ERROR -- Unable to get host loop ID.\n" description {{ Could not get handle for local port. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Cannot get topology - retrying.\n" description {{ Error getting connection type. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_WARNING "Topology - %s, Host Loop address 0x%x\n" description {{ Local port handle. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Inconsistent NVRAM detected: checksum=0x%x id=%c version=0x%x.\n" description {{ NVRAM signature was invalid. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Falling back to functioning (yet invalid -- WWPN) defaults.\n" description {{ Using driver default NVRAM settings. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_WARNING "ZIO mode %d enabled; timer delay (%d us).\n" description {{ Zero interrupt i/o enabled. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to allocate fc remote port!\n" description {{ FC transport could not create remote port object. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "SNS scan failed -- assuming zero-entry result...\n" description {{ All name server queries failed. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_WARNING "Performing ISP error recovery - ha= %p.\n" description {{ About to perform an ASIC reset. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "ISP error recovery failed - board disabled\n" description {{ ASIC reset failed so the adapter is being disabled. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "qla2x00_abort_isp: **** FAILED ****\n" description {{ ASIC reset failed. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_WARNING "FW: Loading from flash (%x)...\n" description {{ Firmware is loading from onboard flash memory. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to verify integrity of flash firmware image! Firmware data: %08x %08x %08x %08x!\n" description {{ Firmware image from onboard flash memory is invalid. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "[ERROR] Failed to load segment %d of firmware\n" description {{ Error copying firmware image to onboard RAM. }} action {{ None recommended. }} class: firmware sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Firmware image unavailable.\n" description {{ Retrieving firmware image via request_firmware failed. }} action {{ None recommended. }} class: firmware sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to verify integrity of firmware image (%Zd)!\n" description {{ Firmware image retrieved via request_firmware is invalid. }} action {{ None recommended. }} class: firmware sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to verify integrity of firmware image!\n" description {{ Firmware image retrieved via request_firmware is invalid. }} action {{ None recommended. }} class: firmware sl_severity: warning refcode: "" message: qla_printk KERN_WARNING "FW: Loading via request-firmware...\n" description {{ Firmware image was retrieved via request_firmware. }} action {{ None recommended. }} class: firmware sl_severity: warning refcode: "" message: qla_printk KERN_WARNING "FW: Attempting to fallback to golden firmware...\n" description {{ Falling back to golden firmware for 81xx adapter. }} action {{ None recommended. }} class: firmware sl_severity: warning refcode: "" message: qla_printk KERN_ERR "FW: Please update operational firmware...\n" description {{ The operational firmware image of a 81xx adapter is corrupt and needs to be reloaded. }} action {{ None recommended. }} class: firmware sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Attempting retry of stop-firmware command...\n" description {{ Trying orderly shutdown of firmware. }} action {{ None recommended. }} class: firmware sl_severity: warning refcode: "" file: "drivers/scsi/qla2xxx/qla_isr.c" message: qla_printk KERN_ERR "Parity error -- HCCR=%x, Dumping firmware!\n" description {{ A parity error was detected in a register or onboard RAM so perform a ASIC reset. }} action {{ None recommended. }} class: firmware sl_severity: warning refcode: "" message: qla_printk KERN_ERR "RISC paused -- HCCR=%x, Dumping firmware!\n" description {{ The ASIC was frozen so perform a reset of the ASIC. }} action {{ None recommended. }} class: firmware sl_severity: warning refcode: "" message: qla_printk KERN_ERR "IDC failed to post ACK.\n" description {{ Driver failed to ACK 81xx inter-driver communication event. }} action {{ None recommended. }} class: unknown sl_severity: warning refcode: "" message: qla_printk KERN_ERR "ISP System Error - mbx1=%xh mbx2=%xh mbx3=%xh mbx7=%xh.\n" description {{ An internal system error occurred. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unrecoverable Hardware Error: adapter marked OFFLINE!\n" description {{ An internal parity error occurred and the adapter may need to be replaced. }} action {{ None recommended. }} class: hardware sl_severity: warning refcode: "" message: qla_printk KERN_ERR "ISP Request Transfer Error (%x).\n" description {{ Error transferring data from request queue. }} action {{ None recommended. }} class: unknown sl_severity: warning refcode: "" message: qla_printk KERN_ERR "ISP Response Transfer Error.\n" description {{ Error transferring data from firmware to host response queue. }} action {{ None recommended. }} class: unknown sl_severity: warning refcode: "" message: qla_printk KERN_WARNING "LIP occurred (%x).\n" description {{ Fibre channel LIP occurred on the link. }} action {{ None recommended. }} class: unknown sl_severity: warning refcode: "" message: qla_printk KERN_WARNING "LOOP UP detected (%s Gbps).\n" description {{ Local port link is up. }} action {{ None recommended. }} class: unknown sl_severity: warning refcode: "" message: qla_printk KERN_WARNING "LOOP DOWN detected (%x %x %x %x).\n" description {{ Local port link is down. }} action {{ None recommended. }} class: unknown sl_severity: warning refcode: "" message: qla_printk KERN_WARNING "LIP reset occurred (%x).\n" description {{ Fibre channel LIP reset occurred. }} action {{ None recommended. }} class: unknown sl_severity: warning refcode: "" message: qla_printk KERN_WARNING "Configuration change detected: value=%x.\n" description {{ There was a change in the connection status of the local port. }} action {{ None recommended. }} class: unknown sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Alert 84XX: panic recovery %04x %04x\n" description {{ Internal panic recovered on a 84xx adapter. }} action {{ None recommended. }} class: unknown sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Alert 84XX: firmware version %x\n" description {{ Unknown asynchronous event from 84xx adapter. }} action {{ None recommended. }} class: firmware sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Alert 84xx: Invalid Alert %04x %04x %04x\n" description {{ Unknown asynchronous event from 84xx adapter. }} action {{ None recommended. }} class: unknown sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Invalid SCSI completion handle %d.\n" description {{ Command completion is for invalid command. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Invalid ISP SCSI completion handle\n" description {{ Command completion is for invalid command. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "%s: Invalid completion handle (%x).\n" description {{ Command completion is for invalid command. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "%s: Invalid completion handle (%x) -- timed-out.\n" description {{ SCSI layer has already timed out command. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "%s: SRB handle (%x) mismatch %x.\n" description {{ Command completion is for invalid command. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_WARNING "Command is NULL: already returned to OS (sp=%p)\n" description {{ Command already completed back to SCSI layer. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Error entry - invalid handle\n" description {{ Error status entry is invalid. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Additional code -- 0x55AA.\n" description {{ Extra debug information from checking the ASIC when it is frozen. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_WARNING "MSI-X: Failed to enable support -- %d/%d Retry with %d vectors\n" description {{ System could not give us the number of MSI-X vectors request so retry with less. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_WARNING "MSI-X: Failed to enable support, giving up -- %d/%d\n" description {{ Could not enable MSI-X support for this adapter. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "MSI-X: Unable to register handler -- %x/%d.\n" description {{ Unable to register a specific MSI-X handler callback. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "MSI-X: Falling back-to INTa mode -- %d.\n" description {{ Could not enable MSI so falling back to INTx for interrupt handling. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Failed to reserve interrupt %d already in use.\n" description {{ Could not reserve INTx IRQ. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" file: "drivers/scsi/qla2xxx/qla_mbx.c" message: qla_printk KERN_ERR "Mailbox command timeout occurred. Scheduling ISP abort. eeh_busy: 0x%x\n" description {{ Mailbox command to firmware timed out, reset ASIC. }} action {{ None recommended. }} class: firmware sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Mailbox command timeout occurred. Issuing ISP abort.\n" description {{ Mailbox command to firmware timed out, reset ASIC. }} action {{ None recommended. }} class: firmware sl_severity: warning refcode: "" file: "drivers/scsi/qla2xxx/qla_mid.c" message: qla_printk KERN_ERR "Couldn't delete req que %d\n" description {{ Couldn't delete a request queue associated with a virtual port. }} action {{ None recommended. }} class: unknown sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Couldn't delete rsp que %d\n" description {{ Couldn't delete a response queue associated with a virtual port. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "could not allocate memory for request que\n" description {{ System has low memory. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Memory Allocation failed - request_ring\n" description {{ Coherant DMA memory allocation failed. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "No resources to create additional request queue\n" description {{ Adapter has no more resources to create another request queue. }} action {{ None recommended. }} class: unknown sl_severity: warning refcode: "" message: qla_printk KERN_ERR "qla25xx_create_req_que failed\n" description {{ Failed to create a new request queue (beyond the base request queue). }} action {{ None recommended. }} class: unknown sl_severity: warning refcode: "" message: qla_printk KERN_ERR "could not allocate memory for response que\n" description {{ System has low memory. }} action {{ None recommended. }} class: unknown sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Memory Allocation failed - response_ring\n" description {{ Coherant DMA memory allocation failed. }} action {{ None recommended. }} class: unknown sl_severity: warning refcode: "" message: qla_printk KERN_ERR "No resources to create additional response queue\n" description {{ Adapter has no more resources to create another response queue. }} action {{ None recommended. }} class: unknown sl_severity: warning refcode: "" message: qla_printk KERN_WARNING "msix not enabled\n" description {{ Adapter is not using MSI-X. }} action {{ None recommended. }} class: unknown sl_severity: warning refcode: "" message: qla_printk KERN_ERR "qla25xx_create_rsp_que failed\n" description {{ Failed to create a new response queue (beyond the base response queue). }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" file: "drivers/scsi/qla2xxx/qla_os.c" message: qla_printk KERN_ERR "Unable to allocate memory for request queue ptrs\n" description {{ System low on memory. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to allocate memory for response queue ptrs\n" description {{ System low on memory. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_WARNING "Firmware is not multi-queue capable\n" description {{ The firmware for this adapter is not capable of multiple request or response queues. }} action {{ None recommended. }} class: firmware sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Can't create request queue\n" description {{ A request to create a new request queue could not be fulfilled. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Response Queue create failed\n" description {{ A request to create a new response queue failed. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "scsi(%ld:%d:%d): Abort handler timed out -- %lx\n" description {{ A request to abort a command timed out. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "scsi(%ld:%d:%d): Abort command issued -- %d %lx %x.\n" description {{ A request to abort a command was issued from the SCSI layer. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_INFO "scsi(%ld:%d:%d): %s RESET ISSUED.\n" description {{ A reset of a LUN was requested by the SCSI layer. }} action {{ None recommended. }} class: software type: info refcode: "" message: qla_printk KERN_INFO "scsi(%ld:%d:%d): %s RESET SUCCEEDED.\n" description {{ LUN reset succeeded. }} action {{ None recommended. }} class: software type: info refcode: "" message: qla_printk KERN_ERR "scsi(%ld:%d:%d): %s RESET FAILED: %s.\n" description {{ LUN reset failed. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_INFO "scsi(%ld:%d:%d): BUS RESET ISSUED.\n" description {{ A bus reset was requested by the SCSI layer. }} action {{ None recommended. }} class: software type: info refcode: "" message: qla_printk KERN_INFO "qla2xxx_eh_bus_reset reset succeeded.\n" description {{ bus reset succeeded. }} action {{ None recommended. }} class: software type: info refcode: "" message: qla_printk KERN_INFO "scsi(%ld:%d:%d): ADAPTER RESET ISSUED.\n" description {{ A reset of the adapter was requested by the SCSI layer. }} action {{ None recommended. }} class: software type: info refcode: "" message: qla_printk KERN_INFO "qla2xxx_eh_host_reset reset succeeded.\n" description {{ Adapter reset succeeded. }} action {{ None recommended. }} class: software type: info refcode: "" message: qla_printk KERN_ERR "Failed to reserve PIO/MMIO regions (%s)\n" description {{ PCI layer could not reserve device resources. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Invalid PCI I/O region size (%s)...\n" description {{ PCI I/O memory region for this adapter is an invalid size. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_WARNING "region #0 not a PIO resource (%s)...\n" description {{ Memory region 0 on the adapter is not a port I/O resource. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "region #1 not an MMIO resource (%s), aborting\n" description {{ Memory region 1 on the adapter isn't a memory-mapped I/O resource so abort configuration. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Invalid PCI mem region size (%s), aborting\n" description {{ The memory-mapped I/O region of the adapter is an invalid size so abort configuration. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "cannot remap MMIO (%s), aborting\n" description {{ ioremap() operation to map device memory into the kernel address space failed so abort configuration. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_INFO "MSI-X vector count: %d\n" description {{ Number of MSI-X vectors for this adapter. }} action {{ None recommended. }} class: software type: info refcode: "" message: qla_printk KERN_WARNING "BAR 3 not enabled\n" description {{ This adapter is not capable of multiple request and response queues. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_INFO "Found an ISP%04X, irq %d, iobase 0x%p\n" description {{ Information about adapter just found in probe routine. }} action {{ None recommended. }} class: software type: info refcode: "" message: qla_printk KERN_ERR "[ERROR] Failed to allocate memory for adapter\n" description {{ System has low memory. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "[ERROR] Failed to allocate memory for scsi_host\n" description {{ System has low memory. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "[ERROR] Failed to allocate memory for queue pointers\n" description {{ System has low memory. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Failed to initialize adapter\n" description {{ Error starting firmware. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_WARNING "Can't create queues, falling back to single queue mode\n" description {{ Setting up multiqueue mode failed so fall back to a single request and response queue. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to start DPC thread!\n" description {{ Could not start deferred procedure kernel thread. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_INFO " QLogic Fibre Channel HBA Driver: %s QLogic %s - %s ISP%04X: %s @ %s hdma%c, host#=%ld, fw=%s\n" description {{ Info about adapter just configured. }} action {{ None recommended. }} class: software type: info refcode: "" message: qla_printk KERN_ERR "Unable to allocate memory for rsp\n" description {{ System low on memory. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to allocate memory for rsp_ring\n" description {{ System low on memory. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to allocate memory for npiv info\n" description {{ System low on memory. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "qla2x00_do_dpc: dpc_flags: %lx\n" description {{ Allocating Scsi_host struct from SCSI layer failed. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Loop down - aborting ISP.\n" description {{ Local port has been down for over 4 minutes, reset ASIC. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "RISC paused -- mmio_enabled, Dumping firmware!\n" description {{ ASIC is frozen after a AER recovery so perform a firware dump. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Can't re-enable PCI device after reset.\n" description {{ Adapter failed to restart after a PCIe slot reset. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "the device failed to resume I/O from slot/link_reset\n" description {{ Adapter failed to restart after AER recovery. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" file: "drivers/scsi/qla2xxx/qla_sup.c" message: qla_printk KERN_ERR "Inconsistent FLTL detected: checksum=0x%x.\n" description {{ Firmware Layout Table signature not valid. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "NPIV-Config: Failed to create vport [%02x]: wwpn=%llx wwnn=%llx.\n" description {{ Predefined virtual port stored in flash could not be created. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to allocate memory for optrom burst write (%x KB).\n" description {{ Coherant DMA memory allocation failed. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to unprotect flash for update.\n" description {{ Turning off write-protection for onboard flash memory failed. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_WARNING "Unable to burst-write optrom segment (%x/%x/%llx).\n" description {{ Cannot use fast flash write method so use slower method. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to protect flash after update.\n" description {{ Reenable of write protection for onboard flash memory failed. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to update fw options (beacon on).\n" description {{ Unable to set beacon blinking functionality. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to update fw options (beacon off).\n" description {{ Unable to turn off beacon blinking functionality. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to get fw options (beacon off).\n" description {{ Unable to read firmware options for this adapter. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to allocate memory for optrom burst read (%x KB).\n" description {{ Coherant DMA memory allocation failed. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_WARNING "Unable to burst-read optrom segment (%x/%x/%llx).Reverting to slow-read\n" description {{ Cannot use fast flash read method so use slower method. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" ppc64-diag-2.7.4/ela/message_catalog/reporters0000644000000000000000000001233513135275400016104 00000000000000/* * The reporters catalog. A reporter is a function or macro that's * used to log a message to syslog. Such macros typically prepend * a prefix (e.g., specifying the driver and/or device) and may specify * a severity level. This catalog captures that information. */ reporter: printk source: kernel reporter: dev_printk source: kernel aliases: dev_emerg(emerg) dev_alert(alert) dev_crit(crit) dev_err(err) dev_warn(warning) dev_notice(notice) dev_info(info) dev_dbg(debug) prefix_format: "%s %s: " prefix_args: driver device reporter: pr_err(err) source: kernel aliases: pr_emerg(emerg) pr_alert(alert) pr_crit(crit) pr_warning(warning) pr_notice(notice) pr_info(info) pr_debug(debug) prefix_format: "%s: " prefix_args: component device_arg: none /* used by cxgb3 driver */ reporter: CH_MSG source: kernel aliases: CH_DBG(debug) CH_ERR(err) CH_WARN(warning) CH_ALERT(alert) prefix_format: "cxgb3 %s: " prefix_args: adapter device_arg: adapter /* used by GPFS */ reporter: mmfs_pathfail(info) source: user prefix_format: "mmfs: Error=MMFS_PDISK_PATHFAIL, ID=%s, Tag=%s:%s: Location=%s, FRU=%s, WWID=%s, RecoveryGroup=%s, %s=%s, Pdisk=%s, Device=%s" prefix_args: id tag message location fru wwid recoverygroup empty declusteredarray pdisk device /* used by GPFS */ reporter: mmfs_failed(info) source: user prefix_format: "mmfs: Error=MMFS_PDISK_FAILED, ID=%s, Tag=%s:%s: Location=%s, FRU=%s, WWID=%s, RecoveryGroup=%s, DeclusteredArray=%s, Pdisk=%s, PdiskState=%s" prefix_args: id tag message location fru wwid recoverygroup declusteredarray pdisk pdiskstate device_arg: none /* used by GPFS */ reporter: mmfs_recovered(info) source: user prefix_format: "mmfs: Error=MMFS_PDISK_RECOVERED, ID=%s, Tag=%s:%s: Location=%s, FRU=%s, WWID=%s, RecoveryGroup=%s, DeclusteredArray=%s, Pdisk=%s" prefix_args: id tag message location fru wwid recoverygroup declusteredarray pdisk device_arg: none /*used by GPFS */ reporter: mmfs_replace(err) source: user prefix_format: "mmfs: Error=MMFS_REPLACE_PDISK, ID=%s, Tag=%s:%s: Location=%s, FRU=%s, WWID=%s, RecoveryGroup=%s, DeclusteredArray=%s, Pdisk=%s, Priority=%s, PdiskState=%s" prefix_args: id tag message location fru wwid recoverygroup declusteredarray pdisk priority pdiskstate device_arg: none /*used by GPFS */ reporter: mmfs_rebuild(err) source: user prefix_format: "mmfs: Error=MMFS_REBUILD_FAILED, ID=%s, Tag=%s:%s: RecoveryGroup=%s, DeclusteredArray=%s, RemainingRedundancy=%s" prefix_args: id tag mesage recoverygroup declusteredarray remainingredundancy device_arg: none /* used by e1000e driver */ reporter: e_printk source: kernel aliases: e_dbg(debug) e_info(info) e_notice(notice) e_warn(warning) e_err(err) prefix_format: "%s: %s: " prefix_args: device netdev /* used by e1000e driver */ reporter: hw_dbg(debug) source: kernel prefix_format: "%s: " prefix_args: netdev device_arg: netdev /* used by ipr driver */ reporter: ipr_ra_printk source: kernel /* * The "device" parameter logged by ipr_ra_printk() (and thus by ipr_ra_err() * and ipr_res_err()) is actually %d:%d:%d:%d -- host:bus:target:lun -- but * this together is taken as the device ID. * * ipr_hcam_err() can call ipr_ra_err() or dev_err(). What's the format * of the device ID when dev_err() is called, and which driver name is * reported? */ aliases: ipr_ra_err(err) ipr_res_err(err) ipr_hcam_err(err) prefix_format: "ipr: %s: " prefix_args: device /* used by ipr driver */ reporter: ipr_err(err) source: kernel aliases: ipr_info(info) ipr_dbg(debug) prefix_format: "ipr: " /* used by lpfc driver */ reporter: lpfc_printf_vlog source: kernel prefix_format: "lpfc %s: %d:(%d):%d " prefix_args: device FCBoardno vpi messageno /* used by lpfc driver */ reporter: lpfc_printf_log source: kernel prefix_format: "lpfc %s: %d:%d " prefix_args: device FCBoardno messageno /* used by qla2xxx driver -- calls dev_printk */ reporter: qla_printk source:kernel prefix_format: "qla2xxx %s: " prefix_args: device /* for ixgb device driver */ /* 3 prefix args */ reporter: netdev_printk3 source: kernel aliases: netdev_info3(info) netdev_err3(err) prefix_format: "%s %s: %s: " prefix_args: driver device netdev device_arg: netdev /* 1 prefix arg */ reporter: netdev_printk1 source: kernel aliases: netdev_info1(info) netdev_err1(err) prefix_format: "%s: " prefix_args: netdev device_arg: netdev /* 0 prefix args */ reporter: netdev_printk0 source: kernel aliases: netdev_info0(info) netdev_err0(err) prefix_format: "(NULL net_device): " meta_reporter: netif_info variants: netdev_info3 netdev_info1 netdev_info0 meta_reporter: netif_err variants: netdev_err3 netdev_err1 netdev_err0 /* from include/scsi/scsi_device.h -- just calls dev_printk */ reporter: sdev_printk source: kernel prefix_format: "%s %s: " prefix_args: driver device /* * from include/scsi/scsi_device.h * scmd_printk() can produce either of two message formats. If there's an * rq_disk associated with the request, the name of the disk is appended to * the message prefix. Otherwise it's equivalent to sdev_printk. So we * list scmd_printk as a meta-reporter that maps to either sdev_printk or * to the scmd_printk_disk pseudo-reporter. */ reporter: scmd_printk_disk source: kernel prefix_format: "%s %s: [%s] " prefix_args: driver device disk meta_reporter: scmd_printk variants: sdev_printk scmd_printk_disk ppc64-diag-2.7.4/ela/message_catalog/with_regex/0000755000000000000000000000000013135275400016355 500000000000000ppc64-diag-2.7.4/ela/message_catalog/with_regex/cxgb30000644000000000000000000005102313135275400017227 00000000000000subsystem: net devspec(device) = "/sys/bus/pci/devices/$device/devspec" filter: driver = "cxgb3" /* * This text is used repeatedly, so make it paste-able. * We also need to explain what to do with the info we get from #1 and #2. */ @copy version_diags_replace {{ 1. Run the "ethtool -i" command to determine the driver software level. 2. Execute diagnostics on the adapter, using "ethtool -t". 3. Replace the adapter board. }} /* cxgb3 kernel driver files have moved from drivers/net/cxgb3 to * drivers/net/ethernet/chelsio/cxgb3. */ file: " drivers/net/ethernet/chelsio/cxgb3/ael1002.c" message[defensive]: CH_WARN "PHY %u i2c read of dev.addr %#x.%#x timed out\n" regex CH_WARN "^cxgb3 ([[:print:]]*): PHY ([0-9]{1,}) i2c read of dev\\.addr (0x[0-9a-f]{1,})\\.(0x[0-9a-f]{1,}) timed out$" file: "drivers/net/ethernet/chelsio/cxgb3/aq100x.c" message[defensive]: CH_WARN "PHY%d: reset failed (0x%x).\n" regex CH_WARN "^cxgb3 ([[:print:]]*): PHY([-]\?[0-9]{1,}): reset failed \\(0x([0-9a-f]{1,})\\)\\.$" message[defensive]: CH_WARN "PHY%d: reset failed (0x%x, 0x%x).\n" regex CH_WARN "^cxgb3 ([[:print:]]*): PHY([-]\?[0-9]{1,}): reset failed \\(0x([0-9a-f]{1,}), 0x([0-9a-f]{1,})\\)\\.$" message[defensive]: CH_WARN "PHY%d: reset timed out (0x%x).\n" regex CH_WARN "^cxgb3 ([[:print:]]*): PHY([-]\?[0-9]{1,}): reset timed out \\(0x([0-9a-f]{1,})\\)\\.$" message[defensive]: CH_WARN "PHY%d: reset took %ums\n" regex CH_WARN "^cxgb3 ([[:print:]]*): PHY([-]\?[0-9]{1,}): reset took ([0-9]{1,})ms$" message[defensive]: CH_WARN "PHY%d: unsupported firmware %d\n" regex CH_WARN "^cxgb3 ([[:print:]]*): PHY([-]\?[0-9]{1,}): unsupported firmware ([-]\?[0-9]{1,})$" message[defensive]: CH_WARN "PHY%d does not start in low power mode.\n" regex CH_WARN "^cxgb3 ([[:print:]]*): PHY([-]\?[0-9]{1,}) does not start in low power mode\\.$" message[defensive]: CH_WARN "PHY%d: incorrect XAUI settings (0x%x, 0x%x).\n" regex CH_WARN "^cxgb3 ([[:print:]]*): PHY([-]\?[0-9]{1,}): incorrect XAUI settings \\(0x([0-9a-f]{1,}), 0x([0-9a-f]{1,})\\)\\.$" file: "drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c" message[chatter]: printk KERN_INFO "%s: link down\n" regex printk "^[[:print:]]*: link down$" message[chatter]: printk KERN_INFO "%s: link up, %s, %s-duplex\n" regex printk "^[[:print:]]*: link up, [[:print:]]*, [[:print:]]*-duplex$" message[chatter]: printk KERN_INFO "%s: PHY module unplugged\n" regex printk "^[[:print:]]*: PHY module unplugged$" message[chatter]: printk KERN_INFO "%s: %s PHY module inserted\n" regex printk "^[[:print:]]*: [[:print:]]* PHY module inserted$" message[defensive]: CH_ERR "firmware image too large %u, expected %d\n" regex CH_ERR "^cxgb3 ([[:print:]]*): firmware image too large ([0-9]{1,}), expected ([-]\?[0-9]{1,})$" message[defensive]: CH_ERR "corrupted firmware image, checksum %u\n" regex CH_ERR "^cxgb3 ([[:print:]]*): corrupted firmware image, checksum ([0-9]{1,})$" message: dev_err "could not upgrade firmware: unable to load %s\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): could not upgrade firmware: unable to load ([[:print:]]*)$" description {{ The firmware on the adapter doesn't match what the driver requires. }} action {{ Verify that /lib/firmware/cxgb3 contains the correct firmware. [Where do they get the correct firmware?] [Re: your recommended action: Under what circumstances should you verify the driver software level, execute diagnostics, and/or replace the adapter?] }} class: software type: temp refcode: "cxgb3007" message[chatter]: dev_info "successful upgrade to firmware %d.%d.%d\n" regex dev_info "^([[:print:]]*) ([[:print:]]*): successful upgrade to firmware ([-]\?[0-9]{1,})\\.([-]\?[0-9]{1,})\\.([-]\?[0-9]{1,})$" message: dev_err "failed to upgrade to firmware %d.%d.%d\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): failed to upgrade to firmware ([-]\?[0-9]{1,})\\.([-]\?[0-9]{1,})\\.([-]\?[0-9]{1,})$" description {{ The adapter contains the wrong firmware version, so the driver tried to update the firmware to the version stored in /lib/firmware/cxgb3. This update failed. }} action {{ Verify that /lib/firmware/cxgb3 contains the correct firmware. [Under what circumstances should you verify the driver software level, execute diagnostics, and/or replace the adapter?] }} class: software type: temp refcode: "cxgb3008" message: dev_err "could not load TP SRAM: unable to load %s\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): could not load TP SRAM: unable to load ([[:print:]]*)$" description {{ The adapter contains the wrong microcode version, so the driver tried to update the TP SRAM to the version stored in /lib/firmware. This update failed. }} action {{ @paste version_diags_replace [Why don't we advise verifying that the correct microcode is in /lib/firmware?] }} class: software type: temp refcode: "cxgb3009" message[chatter]: dev_info "successful update of protocol engine to %d.%d.%d\n" regex dev_info "^([[:print:]]*) ([[:print:]]*): successful update of protocol engine to ([-]\?[0-9]{1,})\\.([-]\?[0-9]{1,})\\.([-]\?[0-9]{1,})$" /* This is reported right before the next message. */ message[redundant]: dev_err "failed to update of protocol engine %d.%d.%d\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): failed to update of protocol engine ([-]\?[0-9]{1,})\\.([-]\?[0-9]{1,})\\.([-]\?[0-9]{1,})$" message: dev_err "loading protocol SRAM failed\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): loading protocol SRAM failed$" description {{ The required version of microcode could not be written to the adapter. }} action {{ @paste version_diags_replace }} /* Shouldn't this be hardware/perm? */ class: software type: temp refcode: "cxgb3010" message: CH_WARN "FW upgrade to %d.%d.%d %s\n" regex CH_WARN "^cxgb3 ([[:print:]]*): FW upgrade to ([-]\?[0-9]{1,})\\.([-]\?[0-9]{1,})\\.([-]\?[0-9]{1,}) ([[:print:]]*)$" description {{ The adapter's firmware is out of sync with the driver. The driver will attempt to load the correct version of firmware into the adapter. }} action {{ Refer to subsequent messages to determine whether the firmware upgrade was successful. }} class: software type: info message: CH_WARN "TP upgrade to %d.%d.%d %s\n" regex CH_WARN "^cxgb3 ([[:print:]]*): TP upgrade to ([-]\?[0-9]{1,})\\.([-]\?[0-9]{1,})\\.([-]\?[0-9]{1,}) ([[:print:]]*)$" description {{ The adapter's microcode is out of sync with the driver. The driver will attempt to load the correct version of microcode into the adapter. }} action {{ Refer to subsequent messages to determine whether the microcode upgrade was successful. }} class: software type: info /* This next one can result from ENOMEM. */ message: CH_ERR "failed to bind qsets, err %d\n" regex CH_ERR "^cxgb3 ([[:print:]]*): failed to bind qsets, err ([-]\?[0-9]{1,})$" description {{ The adapter failed to start up correctly, possibly due to a low-memory condition. }} action {{ Free up memory and retry the failed operation, or add memory to your system. If the problem persists, try the following: @paste version_diags_replace }} class: software type: perm refcode: "cxgb3011" message[defensive]: CH_ERR "request_irq failed, err %d\n" regex CH_ERR "^cxgb3 ([[:print:]]*): request_irq failed, err ([-]\?[0-9]{1,})$" message[defensive]: dev_dbg "cannot create sysfs group\n" regex dev_dbg "^([[:print:]]*) ([[:print:]]*): cannot create sysfs group$" message[defensive]: printk KERN_WARNING "Could not initialize offload capabilities\n" regex printk "^Could not initialize offload capabilities$" message[defensive]: dev_err "Cannot re-enable PCI device after reset.\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): Cannot re-enable PCI device after reset\\.$" message[defensive]: dev_err "can't bring device back up after reset\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): can't bring device back up after reset$" message[defensive]: CH_ALERT "adapter reset %s\n" regex CH_ALERT "^cxgb3 ([[:print:]]*): adapter reset ([[:print:]]*)$" message: CH_ALERT "encountered fatal error, operation suspended\n" regex CH_ALERT "^cxgb3 ([[:print:]]*): encountered fatal error, operation suspended$" description {{ Adapter goes to recovery. [What does that mean?] }} action {{ @paste version_diags_replace }} class: software type: temp refcode: "cxgb3005" message[defensive]: CH_ALERT "FW status: 0x%x, 0x%x, 0x%x, 0x%x\n" regex CH_ALERT "^cxgb3 ([[:print:]]*): FW status: 0x([0-9a-f]{1,}), 0x([0-9a-f]{1,}), 0x([0-9a-f]{1,}), 0x([0-9a-f]{1,})$" message[defensive]: CH_ALERT "adapter recovering, PEX ERR 0x%x\n" regex CH_ALERT "^cxgb3 ([[:print:]]*): adapter recovering, PEX ERR 0x([0-9a-f]{1,})$" message[chatter]: dev_info "Port %d using %d queue sets.\n" regex dev_info "^([[:print:]]*) ([[:print:]]*): Port ([-]\?[0-9]{1,}) using ([-]\?[0-9]{1,}) queue sets\\.$" message[chatter]: printk KERN_INFO "%s: %s %s %sNIC (rev %d) %s%s\n" regex printk "^[[:print:]]*: [[:print:]]* [[:print:]]* [[:print:]]*NIC \\(rev [-]\?[0-9]{1,}\\) [[:print:]]*[[:print:]]*$" message[chatter]: printk KERN_INFO "%s: %uMB CM, %uMB PMTX, %uMB PMRX, S/N: %s\n" regex printk "^[[:print:]]*: [0-9]{1,}MB CM, [0-9]{1,}MB PMTX, [0-9]{1,}MB PMRX, S/N: [[:print:]]*$" message[chatter]: printk KERN_INFO "%s - version %s\n" regex printk "^[[:print:]]* - version [[:print:]]*$" /* Replaced DRV_NAME with "cxgb3" in this next one. */ message: printk KERN_ERR "cxgb3: cannot initialize work queue\n" regex printk "^cxgb3: cannot initialize work queue$" description {{ The driver could not initialize a work queue while probing for devices, probably because of a low-memory condition. }} action {{ Free up memory and retry the failed operation, or add memory to your system. }} class: hardware type: perm priority: H refcode: "cxgb3001" message[chatter]: dev_info "cannot obtain PCI resources\n" regex dev_info "^([[:print:]]*) ([[:print:]]*): cannot obtain PCI resources$" message: dev_err "cannot enable PCI device\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): cannot enable PCI device$" description {{ Can't enable PCI IO and memory resources for this adapter }} action {{ @paste version_diags_replace }} class: hardware type: perm priority: H refcode: "cxgb3002" message: dev_err "unable to obtain 64-bit DMA for coherent allocations\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): unable to obtain 64-bit DMA for coherent allocations$" description {{ Cannot obtain 64-bit DMA allocations for this adapter now. }} action {{ @paste version_diags_replace }} class: hardware type: perm priority: H refcode: "cxgb3003" message[defensive]: dev_err "no usable DMA configuration\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): no usable DMA configuration$" message[defensive]: dev_err "cannot allocate nofail buffer\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): cannot allocate nofail buffer$" message: dev_err "cannot map device registers\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): cannot map device registers$" description {{ Couldn't map device registers for MMIO registers access. }} action {{ @paste version_diags_replace }} class: hardware type: perm priority: H refcode: "cxgb3004" message[defensive]: dev_warn "cannot register net device %s, skipping\n" regex dev_warn "^([[:print:]]*) ([[:print:]]*): cannot register net device ([[:print:]]*), skipping$" message[defensive]: dev_err "could not register any net devices\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): could not register any net devices$" file: "drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c" message[chatter]: printk KERN_INFO "%s, iscsi set MaxRxData to 16224 (0x%x).\n" regex printk "^[[:print:]]*, iscsi set MaxRxData to 16224 \\(0x[0-9a-f]{1,}\\)\\.$" message[chatter]: printk KERN_INFO "%s, setting iscsi pgsz 0x%x, %u,%u,%u,%u.\n" regex printk "^[[:print:]]*, setting iscsi pgsz 0x[0-9a-f]{1,}, [0-9]{1,},[0-9]{1,},[0-9]{1,},[0-9]{1,}\\.$" message[defensive]: printk KERN_ERR "Unexpected SMT_WRITE_RPL status %u for entry %u\n" regex printk "^Unexpected SMT_WRITE_RPL status [0-9]{1,} for entry [0-9]{1,}$" message[defensive]: printk KERN_ERR "Unexpected L2T_WRITE_RPL status %u for entry %u\n" regex printk "^Unexpected L2T_WRITE_RPL status [0-9]{1,} for entry [0-9]{1,}$" message[defensive]: printk KERN_ERR "Unexpected RTE_WRITE_RPL status %u for entry %u\n" regex printk "^Unexpected RTE_WRITE_RPL status [0-9]{1,} for entry [0-9]{1,}$" message[defensive]: printk KERN_ERR "%s: received clientless CPL command 0x%x\n" regex printk "^[[:print:]]*: received clientless CPL command 0x[0-9a-f]{1,}$" /* dup: printk KERN_ERR "%s: received clientless CPL command 0x%x\n" */ /* dup: printk KERN_ERR "%s: received clientless CPL command 0x%x\n" */ message[defensive]: printk default "%s: passive open TID %u too large\n" regex printk "^[[:print:]]*: passive open TID [0-9]{1,} too large$" /* dup: printk KERN_ERR "%s: received clientless CPL command 0x%x\n" */ message[enomem]: printk default "do_abort_req_rss: couldn't get skb!\n" regex printk "^do_abort_req_rss: couldn't get skb!$" message[defensive]: printk default "%s: active establish TID %u too large\n" regex printk "^[[:print:]]*: active establish TID [0-9]{1,} too large$" /* dup: printk KERN_ERR "%s: received clientless CPL command 0x%x\n" */ /* dup: printk KERN_ERR "%s: received clientless CPL command 0x%x\n" */ message[defensive]: printk KERN_ERR "%s: received bad CPL command 0x%x\n" regex printk "^[[:print:]]*: received bad CPL command 0x[0-9a-f]{1,}$" message[defensive]: printk KERN_ERR "T3C: handler registration for opcode %x failed\n" regex printk "^T3C: handler registration for opcode [0-9a-f]{1,} failed$" message[defensive]: printk KERN_ERR "%s: CPL message (opcode %u) had unknown TID %u\n" regex printk "^[[:print:]]*: CPL message \\(opcode [0-9]{1,}\\) had unknown TID [0-9]{1,}$" message[enomem]: printk KERN_ERR "%s: cannot allocate skb!\n" regex printk "^[[:print:]]*: cannot allocate skb!$" message[defensive]: printk KERN_WARNING "%s: Redirect to non-offload device ignored.\n" regex printk "^[[:print:]]*: Redirect to non-offload device ignored\\.$" message[defensive]: printk KERN_WARNING "%s: Redirect to different offload device ignored.\n" regex printk "^[[:print:]]*: Redirect to different offload device ignored\\.$" message[defensive]: printk KERN_ERR "%s: couldn't allocate new l2t entry!\n" regex printk "^[[:print:]]*: couldn't allocate new l2t entry!$" file: "drivers/net/ethernet/chelsio/cxgb3/mc5.c" message[defensive]: CH_ERR "MC5 timeout writing to TCAM address 0x%x\n" regex CH_ERR "^cxgb3 ([[:print:]]*): MC5 timeout writing to TCAM address 0x([0-9a-f]{1,})$" message[defensive]: CH_ERR "TCAM reset timed out\n" regex CH_ERR "^cxgb3 ([[:print:]]*): TCAM reset timed out$" message[defensive]: CH_ERR "Unsupported TCAM type %d\n" regex CH_ERR "^cxgb3 ([[:print:]]*): Unsupported TCAM type ([-]\?[0-9]{1,})$" message[defensive]: CH_ALERT "MC5 parity error\n" regex CH_ALERT "^cxgb3 ([[:print:]]*): MC5 parity error$" message[defensive]: CH_ALERT "MC5 request queue parity error\n" regex CH_ALERT "^cxgb3 ([[:print:]]*): MC5 request queue parity error$" message[defensive]: CH_ALERT "MC5 dispatch queue parity error\n" regex CH_ALERT "^cxgb3 ([[:print:]]*): MC5 dispatch queue parity error$" file: "drivers/net/ethernet/chelsio/cxgb3/sge.c" message[defensive]: dev_err "%s: Tx ring %u full while queue awake!\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): ([[:print:]]*): Tx ring ([0-9]{1,}) full while queue awake!$" message[defensive]: CH_ALERT "SGE parity error (0x%x)\n" regex CH_ALERT "^cxgb3 ([[:print:]]*): SGE parity error \\(0x([0-9a-f]{1,})\\)$" message[defensive]: CH_ALERT "SGE framing error (0x%x)\n" regex CH_ALERT "^cxgb3 ([[:print:]]*): SGE framing error \\(0x([0-9a-f]{1,})\\)$" message[defensive]: CH_ALERT "SGE response queue credit overflow\n" regex CH_ALERT "^cxgb3 ([[:print:]]*): SGE response queue credit overflow$" message[defensive]: CH_ALERT "packet delivered to disabled response queue (0x%x)\n" regex CH_ALERT "^cxgb3 ([[:print:]]*): packet delivered to disabled response queue \\(0x([0-9a-f]{1,})\\)$" message[defensive]: CH_ALERT "SGE dropped %s priority doorbell\n" regex CH_ALERT "^cxgb3 ([[:print:]]*): SGE dropped ([[:print:]]*) priority doorbell$" message[defensive]: CH_ALERT "free list queue 0 initialization failed\n" regex CH_ALERT "^cxgb3 ([[:print:]]*): free list queue 0 initialization failed$" message[defensive]: CH_WARN "free list queue 0 enabled with %d credits\n" regex CH_WARN "^cxgb3 ([[:print:]]*): free list queue 0 enabled with ([-]\?[0-9]{1,}) credits$" message[defensive]: CH_WARN "free list queue 1 enabled with %d credits\n" regex CH_WARN "^cxgb3 ([[:print:]]*): free list queue 1 enabled with ([-]\?[0-9]{1,}) credits$" file: "drivers/net/ethernet/chelsio/cxgb3/t3_hw.c" message[defensive]: CH_ERR "reading EEPROM address 0x%x failed\n" regex CH_ERR "^cxgb3 ([[:print:]]*): reading EEPROM address 0x([0-9a-f]{1,}) failed$" message[defensive]: CH_ERR "write to EEPROM address 0x%x failed\n" regex CH_ERR "^cxgb3 ([[:print:]]*): write to EEPROM address 0x([0-9a-f]{1,}) failed$" message[defensive]: CH_ERR "found wrong TP version (%u.%u), driver compiled for version %d.%d\n" regex CH_ERR "^cxgb3 ([[:print:]]*): found wrong TP version \\(([0-9]{1,})\\.([0-9]{1,})\\), driver compiled for version ([-]\?[0-9]{1,})\\.([-]\?[0-9]{1,})$" message[defensive]: CH_ERR "corrupted protocol SRAM image, checksum %u\n" regex CH_ERR "^cxgb3 ([[:print:]]*): corrupted protocol SRAM image, checksum ([0-9]{1,})$" message[defensive]: CH_WARN "found old FW minor version(%u.%u), driver compiled for version %u.%u\n" regex CH_WARN "^cxgb3 ([[:print:]]*): found old FW minor version\\(([0-9]{1,})\\.([0-9]{1,})\\), driver compiled for version ([0-9]{1,})\\.([0-9]{1,})$" message[defensive]: CH_WARN "found newer FW version(%u.%u), driver compiled for version %u.%u\n" regex CH_WARN "^cxgb3 ([[:print:]]*): found newer FW version\\(([0-9]{1,})\\.([0-9]{1,})\\), driver compiled for version ([0-9]{1,})\\.([0-9]{1,})$" message[defensive]: CH_ERR "corrupted firmware image, checksum %u\n" regex CH_ERR "^cxgb3 ([[:print:]]*): corrupted firmware image, checksum ([0-9]{1,})$" message[defensive]: CH_ERR "firmware download failed, error %d\n" regex CH_ERR "^cxgb3 ([[:print:]]*): firmware download failed, error ([-]\?[0-9]{1,})$" message[defensive]: CH_ALERT "%s (0x%x)\n" regex CH_ALERT "^cxgb3 ([[:print:]]*): ([[:print:]]*) \\(0x([0-9a-f]{1,})\\)$" message[defensive]: CH_WARN "%s (0x%x)\n" regex CH_WARN "^cxgb3 ([[:print:]]*): ([[:print:]]*) \\(0x([0-9a-f]{1,})\\)$" message[defensive]: CH_ALERT "PEX error code 0x%x\n" regex CH_ALERT "^cxgb3 ([[:print:]]*): PEX error code 0x([0-9a-f]{1,})$" message[defensive]: CH_WARN "%s MC7 correctable error at addr 0x%x, data 0x%x 0x%x 0x%x\n" regex CH_WARN "^cxgb3 ([[:print:]]*): ([[:print:]]*) MC7 correctable error at addr 0x([0-9a-f]{1,}), data 0x([0-9a-f]{1,}) 0x([0-9a-f]{1,}) 0x([0-9a-f]{1,})$" message[defensive]: CH_ALERT "%s MC7 uncorrectable error at addr 0x%x, data 0x%x 0x%x 0x%x\n" regex CH_ALERT "^cxgb3 ([[:print:]]*): ([[:print:]]*) MC7 uncorrectable error at addr 0x([0-9a-f]{1,}), data 0x([0-9a-f]{1,}) 0x([0-9a-f]{1,}) 0x([0-9a-f]{1,})$" message[defensive]: CH_ALERT "%s MC7 parity error 0x%x\n" regex CH_ALERT "^cxgb3 ([[:print:]]*): ([[:print:]]*) MC7 parity error 0x([0-9a-f]{1,})$" message[defensive]: CH_ALERT "%s MC7 address error: 0x%x\n" regex CH_ALERT "^cxgb3 ([[:print:]]*): ([[:print:]]*) MC7 address error: 0x([0-9a-f]{1,})$" message[defensive]: CH_ALERT "port%d: MAC TX FIFO parity error\n" regex CH_ALERT "^cxgb3 ([[:print:]]*): port([-]\?[0-9]{1,}): MAC TX FIFO parity error$" message[defensive]: CH_ALERT "port%d: MAC RX FIFO parity error\n" regex CH_ALERT "^cxgb3 ([[:print:]]*): port([-]\?[0-9]{1,}): MAC RX FIFO parity error$" message[defensive]: CH_ERR "TP initialization timed out\n" regex CH_ERR "^cxgb3 ([[:print:]]*): TP initialization timed out$" message[defensive]: CH_ERR "MAC calibration failed\n" regex CH_ERR "^cxgb3 ([[:print:]]*): MAC calibration failed$" message[defensive]: CH_ERR "write to MC7 register 0x%x timed out\n" regex CH_ERR "^cxgb3 ([[:print:]]*): write to MC7 register 0x([0-9a-f]{1,}) timed out$" message[defensive]: CH_ERR "%s MC7 calibration timed out\n" regex CH_ERR "^cxgb3 ([[:print:]]*): ([[:print:]]*) MC7 calibration timed out$" message[defensive]: CH_ERR "%s MC7 BIST timed out\n" regex CH_ERR "^cxgb3 ([[:print:]]*): ([[:print:]]*) MC7 BIST timed out$" message[defensive]: CH_ERR "uP initialization timed out\n" regex CH_ERR "^cxgb3 ([[:print:]]*): uP initialization timed out$" message[defensive]: CH_ALERT "Invalid port type index %d\n" regex CH_ALERT "^cxgb3 ([[:print:]]*): Invalid port type index ([-]\?[0-9]{1,})$" file: "drivers/net/ethernet/chelsio/cxgb3/xgmac.c" message[defensive]: CH_ERR "MAC %d XAUI SERDES CMU lock failed\n" regex CH_ERR "^cxgb3 ([[:print:]]*): MAC ([-]\?[0-9]{1,}) XAUI SERDES CMU lock failed$" message[defensive]: CH_ERR "MAC %d Rx fifo drain failed\n" regex CH_ERR "^cxgb3 ([[:print:]]*): MAC ([-]\?[0-9]{1,}) Rx fifo drain failed$" ppc64-diag-2.7.4/ela/message_catalog/with_regex/e1000e0000644000000000000000000012044613135275400017121 00000000000000subsystem: net devspec(device) = "/sys/bus/pci/devices/$device/devspec" devspec(netdev) = "/sys/class/net/$netdev/device/devspec" @copy diags_eeprom_replace {{ 1. Execute diagnostics on the adapter, using "ethtool -t". 2. Check the EEPROM level on the failing adapter. 3. Replace the adapter. }} /* Where do they see the errno they should check against errno.h? */ /* Note: e1000e kernel driver files have been moved from drivers/net/e1000e to * drivers/net/ethernet/intel/e1000e folder. */ file: "drivers/net/ethernet/intel/e1000e/82571.c" /* * Note: hw_dbg is now e_dbg since * kernel commit 3bb99fe226ead584a4db674dab546689f705201f * * Skip debug code. * e_dbg "Error getting PHY ID\n" * e_dbg "PHY ID unknown: type = 0x%08x\n" * e_dbg "Please update your 82571 Bootagent\n" * e_dbg "Driver can't access device - SMBI bit is set.\n" * e_dbg "Driver can't access the NVM\n" * e_dbg "Driver can't access the PHY\n" * e_dbg "nvm parameter(s) out of bounds\n" * e_dbg "MNG configuration cycle has not completed.\n" * e_dbg "PCI-E Master disable polling has failed.\n" * e_dbg "Masking off all interrupts\n" * e_dbg "Cannot acquire MDIO ownership\n" * e_dbg "Issuing a global reset to MAC\n" * e_dbg "Error initializing identification LED\n" * e_dbg "Initializing the IEEE VLAN\n" * e_dbg "Zeroing the MTA\n" * e_dbg "AN_UP -> AN_PROG\n" * e_dbg "FORCED_UP -> AN_PROG\n" * e_dbg "AN_PROG -> AN_UP\n" * e_dbg "AN_PROG -> DOWN\n" * e_dbg "Error config flow control\n" * e_dbg "AN_PROG -> FORCED_UP\n" * e_dbg "DOWN -> AN_PROG\n" * e_dbg "ANYSTATE -> DOWN\n" * e_dbg "ANYSTATE -> DOWN\n" * e_dbg "ANYSTATE -> AN_PROG\n" * e_dbg "NVM Read Error\n" */ file: "drivers/net/ethernet/intel/e1000e/80003es2lan.c" /* * e_dbg "Driver can't access resource, SW_FW_SYNC timeout.\n" * e_dbg "MNG configuration cycle has not completed.\n" * e_dbg "GG82563 PSCR: %X\n" * e_dbg "Waiting for forced speed/duplex link on GG82563 phy.\n" * e_dbg "PCI-E Master disable polling has failed.\n" * e_dbg "Masking off all interrupts\n" * e_dbg "Issuing a global reset to MAC\n" * e_dbg "Error initializing identification LED\n" * e_dbg "Initializing the IEEE VLAN\n" * e_dbg "Zeroing the MTA\n" * e_dbg "Error Resetting the PHY\n" */ file: "drivers/net/ethernet/intel/e1000e/ethtool.c" message: e_err "Unsupported Speed/Duplex configuration\n" regex e_err "^([[:print:]]*): ([[:print:]]*): Unsupported Speed/Duplex configuration$" description {{ Using the "ethtool -s" command, an attempt has been made to configure an incompatible combination of speed and duplex parameters. In particular, the only combination available for fiber is 1000 Mbps, full duplex. }} action {{ Specify a speed/duplex combination that is supported by your adapter and driver. }} class: software type: config refcode: "UnsupportSpeed/Duplex" /* dup: e_err "Unsupported Speed/Duplex configuration\n" */ message: e_err "Cannot change link characteristics when SoL/IDER is active.\n" regex e_err "^([[:print:]]*): ([[:print:]]*): Cannot change link characteristics when SoL/IDER is active\\.$" description {{ Using the "ethtool -s" command, an attempt has been made to change link settings while a PHY (physical layer device) reset is blocked by firmware. }} action {{ 1. Try again later. 2. Execute diagnostics on the adapter, using "ethtool -t". }} class: hardware type: temp refcode: "BLKRstPHY" message: e_err "forcing MDI/MDI-X state is not supported when link speed and/or duplex are forced\n" regex e_err "^([[:print:]]*): ([[:print:]]*): forcing MDI/MDI-X state is not supported when link speed and/or duplex are forced$" description {{ MDI setting is only allowed when autoneg enabled because some hardware doesn't allow MDI setting when speed or duplex is forced. }} action {{ 1. Enable autoneg to allow MDI setting. 2. Don't force speed and/or duplex. }} class: hardware type: temp refcode: "MDIreqAutoneg" message[chatter]: e_info "TSO is %s\n" regex e_info "^([[:print:]]*): ([[:print:]]*): TSO is ([[:print:]]*)$" message[defensive]: e_err "pattern test reg %04X failed: got 0x%08X expected 0x%08X\n" regex e_err "^([[:print:]]*): ([[:print:]]*): pattern test reg ([0]{0,3}[0-9A-F]{1,}) failed: got 0x([0]{0,7}[0-9A-F]{1,}) expected 0x([0]{0,7}[0-9A-F]{1,})$" message[defensive]: e_err "set/check reg %04X test failed: got 0x%08X expected 0x%08X\n" regex e_err "^([[:print:]]*): ([[:print:]]*): set/check reg ([0]{0,3}[0-9A-F]{1,}) test failed: got 0x([0]{0,7}[0-9A-F]{1,}) expected 0x([0]{0,7}[0-9A-F]{1,})$" message: e_err "failed STATUS register test got: 0x%08X expected: 0x%08X\n" regex e_err "^([[:print:]]*): ([[:print:]]*): failed STATUS register test got: 0x([0]{0,7}[0-9A-F]{1,}) expected: 0x([0]{0,7}[0-9A-F]{1,})$" description {{ An adapter self-test, run with "ethtool -t ... offline", has failed reading the STATUS register. }} action {{ Run "ethtool -d" to obtain a register dump, and contact your service provider. }} class: hardware type: temp refcode: "RegTestFail" message[chatter]: e_info "testing %s interrupt\n" regex e_info "^([[:print:]]*): ([[:print:]]*): testing ([[:print:]]*) interrupt$" message: e_err "Cannot setup 1Gbps loopback.\n" regex e_err "^([[:print:]]*): ([[:print:]]*): Cannot setup 1Gbps loopback\\.$" description {{ Workaround: K1 must be disabled for stable 1Gbps operation 82577/8 must acquire h/w semaphore before workaround. }} action {{ 1. Re-try after some time. (?) 2. TBD }} class: hardware type: temp refcode: "AcqHwSemaphore" message: e_err "Cannot do PHY loopback test when SoL/IDER is active.\n" regex e_err "^([[:print:]]*): ([[:print:]]*): Cannot do PHY loopback test when SoL/IDER is active\\.$" description {{ In an adapter self-test, run with the "ethtool -t ... offline" command, a loopback test has been cancelled because a PHY (physical layer device) reset is blocked by firmware. }} action {{ 1. Try again later. 2. In the absence of any other problem reports, it's probably OK to ignore this failure. }} class: hardware type: temp refcode: "BLKRstPHY" message[chatter]: e_info "offline testing starting\n" regex e_info "^([[:print:]]*): ([[:print:]]*): offline testing starting$" message[chatter]: e_info "online testing starting\n" regex e_info "^([[:print:]]*): ([[:print:]]*): online testing starting$" message[defensive]: e_err "Interface does not support directed (unicast) frame wake-up packets\n" regex e_err "^([[:print:]]*): ([[:print:]]*): Interface does not support directed \\(unicast\\) frame wake-up packets$" file: "drivers/net/ethernet/intel/e1000e/ich8lan.c" /* * e_dbg "Failed to initialize PHY flow\n" * e_dbg "Required LANPHYPC toggle blocked by ME\n" * e_dbg "Toggling LANPHYPC\n" * e_dbg "Cannot determine PHY addr. Erroring out\n" * e_dbg "ERROR: Flash registers not mapped\n" * e_dbg "Error configuring flow control\n" * e_dbg "contention for Phy access\n" * e_dbg "SW has already locked the resource.\n" * e_dbg "Failed to acquire the semaphore, FW or HW has it: FWSM=0x%8.8x EXTCNF_CTRL=0x%8.8x)\n" * e_dbg "Semaphore unexpectedly released by sw/fw/hw\n" * e_dbg "SHRA[%d] might be locked by ME - FWSM=0x%8.8x\n" * e_dbg "Failed to write receive address at index %d\n" * e_dbg "Unsupported SMB frequency in PHY\n" * e_dbg "SW/FW/HW has locked the resource for too long.\n" * e_dbg "Failed to acquire the semaphore.\n" * e_dbg "IFE PMC: %X\n" * e_dbg "Waiting for forced speed/duplex link on IFE phy.\n" * e_dbg "Link taking longer than expected.\n" * e_dbg "LAN_INIT_DONE not set, increase timeout\n" * e_dbg "Phy info is only valid if link is up\n" * e_dbg "Unable to determine valid NVM bank via EEC - reading flash signature\n" * e_dbg "ERROR: No valid NVM bank present\n" * e_dbg "nvm parameter(s) out of bounds\n" * e_dbg "Could not detect valid bank, assuming bank 0\n" * e_dbg "NVM read error: %d\n" * e_dbg "Flash descriptor invalid. SW Sequencing must be used." sic * e_dbg "Flash controller busy, cannot get access" sic * e_dbg "Timeout error - flash cycle did not complete." sic * e_dbg "nvm parameter(s) out of bounds\n" * e_dbg "Could not detect valid bank, assuming bank 0\n" * e_dbg "Flash commit failed.\n" * e_dbg "NVM update error: %d\n" * e_dbg "Timeout error - flash cycle did not complete." sic * e_dbg "Retrying Byte %2.2X at offset %u\n" * e_dbg "NVM Read Error\n" * e_dbg "PCI-E Master disable polling has failed.\n" * e_dbg "Masking off all interrupts\n" * e_dbg "Issuing a global reset to ich8lan\n" * e_dbg "Auto Read Done did not complete\n" * e_dbg "Error initializing identification LED\n" * e_dbg "Zeroing the MTA\n" * e_dbg "After fix-ups FlowControl is now = %x\n" * e_dbg "Workaround applies to ICH8 only.\n" * e_dbg "Failed to init PHY flow ret_val=%d\n" * e_dbg "Failed to setup iRST\n" * e_dbg "Error %d in resume workarounds\n" * e_dbg "Auto Read Done did not complete\n" * e_dbg "PHY Reset Asserted not set - needs delay\n" * e_dbg "EEPROM not present\n" */ file: "drivers/net/ethernet/intel/e1000e/mac.c" /* * e_dbg "Programming MAC Address into RAR[0]\n" * e_dbg "Clearing RAR[1-%u]\n" */ message[defensive]: printk KERN_ERR "multicast array memory allocation failed\n" regex printk "^multicast array memory allocation failed$" /* * e_dbg "Hash value = 0x%03X\n" */ message: e_dbg "Error configuring flow control\n" regex e_dbg "^([[:print:]]*): ([[:print:]]*): Error configuring flow control$" description {{ After detecting a link change, the driver failed to reconfigure and restore the flow-control parameters. The failure was probably either in autonegotiation or in forcing the desired speed and duplex parameters. }} action {{ Run the ethtool command (e.g., "ethtool eth0") to check the adapter's speed/duplex and flow-control settings. }} class: hardware sl_severity: warning refcode: "ErrCfgFC" message: e_dbg "NOT RXing /C/, disable AutoNeg and force link.\n" regex e_dbg "^([[:print:]]*): ([[:print:]]*): NOT RXing /C/, disable AutoNeg and force link\\.$" /* Wen has: "NOT RXing, disable AutoNeg and force link" */ description {{ Autonegotiation with the adapter's link partner has failed, or the link partner is not trying to autonegotiate. The adapter will treat the link as up. }} action {{ 1. Verify that the adapter's cable to the network is plugged in. 2. Run the ethtool command (e.g., "ethtool eth0") to verify that autonegotiation is enabled. }} class: software sl_severity: warning refcode: "ErrCfgFC" /* * e_dbg "Ignoring Alternate Mac Address with MC bit set\n" * e_dbg "Error configuring flow control\n" * e_dbg "RXing /C/, enable AutoNeg and stop forcing link.\n" * dup: e_dbg "NOT RXing /C/, disable AutoNeg and force link.\n" * dup: e_dbg "Error configuring flow control\n" * dup: e_dbg "RXing /C/, enable AutoNeg and stop forcing link.\n" * e_dbg "SERDES: Link up - forced.\n" * e_dbg "SERDES: Link down - force failed.\n" * e_dbg "SERDES: Link up - autoneg completed successfully.\n" * e_dbg "SERDES: Link down - invalidcodewords detected in autoneg.\n" * e_dbg "SERDES: Link down - no sync.\n" * e_dbg "SERDES: Link down - autoneg failed\n" */ message: e_dbg "NVM Read Error\n" regex e_dbg "^([[:print:]]*): ([[:print:]]*): NVM Read Error$" description {{ In an attempt to set the adapters's default flow control setting, a read from the adapter's EEPROM failed. }} action {{ @paste diags_eeprom_replace }} class: hardware sl_severity: warning refcode: "BF778E00" /* * e_dbg "After fix-ups FlowControl is now = %x\n" * e_dbg "Initializing the Flow Control address, type and timer regs\n" */ message: e_dbg "Flow control param set incorrectly\n" regex e_dbg "^([[:print:]]*): ([[:print:]]*): Flow control param set incorrectly$" description {{ For a copper or forced fiber connection, the driver tried to adjust the flow-control setting, but the current setting is in error. }} action {{ 1. Run diagnostics using the "ethtool -t" command. 2. Check the flow-control settings in drivers/net/e1000e/param.c in the kernel source. [I don't see any mention of flow control in param.c] 3. Check the EEPROM level on the failing adapter. }} class: software sl_severity: warning refcode: "FCParaWrong" /* * e_dbg "Never got a valid link from auto-neg!!!\n" */ message: e_dbg "Error while checking for link\n" regex e_dbg "^([[:print:]]*): ([[:print:]]*): Error while checking for link$" description {{ After autonegotiation failed, the adapter attempted to force the link up, but that also failed; no signal was detected. }} action {{ 1. Run diagnostics using the "ethtool -t" command. [And then what?] }} class: software sl_severity: warning refcode: "FCParaWrong" /* * e_dbg "Valid Link Found\n" * e_dbg "Auto-negotiation enabled\n" * e_dbg "No signal detected\n" * e_dbg "hw->fc.current_mode = %u\n" * dup: e_dbg "Flow control param set incorrectly\n" */ message: e_dbg "Error forcing flow control settings\n" regex e_dbg "^([[:print:]]*): ([[:print:]]*): Error forcing flow control settings$" description {{ For a copper or forced fiber connection, the driver's attempt to adjust the flow-control setting failed. }} action {{ 1. Run diagnostics using the "ethtool -t" command. 2. Check the flow-control settings in drivers/net/e1000e/param.c in the kernel source. [I don't see any mention of flow control in param.c] 3. Check the EEPROM level on the failing adapter. }} class: software sl_severity: warning refcode: "ErrForceFC" /* * e_dbg "Copper PHY and Auto Neg has not completed.\n" * e_dbg "Flow Control = FULL.\r\n" * e_dbg "Flow Control = RX PAUSE frames only.\r\n" * e_dbg "Flow Control = Tx PAUSE frames only.\r\n" * e_dbg "Flow Control = Rx PAUSE frames only.\r\n" * e_dbg "Flow Control = NONE.\r\n" */ message: e_dbg "Error getting link speed and duplex\n" regex e_dbg "^([[:print:]]*): ([[:print:]]*): Error getting link speed and duplex$" description {{ After establishing a link, the adapter failed to obtain the link speed and duplex. }} action {{ Run the ethtool command (e.g., "ethtool eth0") to check the adapter's speed/duplex and flow-control settings. }} class: software sl_severity: warning refcode: "ErrSpeedDlx" /* * dup: e_dbg "Error forcing flow control settings\n" * e_dbg "1000 Mbs, "); sic * e_dbg "100 Mbs, "); sic * e_dbg "10 Mbs, "); sic * e_dbg "Full Duplex\n" * e_dbg "Half Duplex\n" */ message: e_dbg "Driver can't access device - SMBI bit is set.\n" regex e_dbg "^([[:print:]]*): ([[:print:]]*): Driver can't access device - SMBI bit is set\\.$" description {{ The driver could not obtain exclusive access to the PHY (physical layer device) and/or NVM (non-volatile memory) as needed. }} action {{ @paste diags_eeprom_replace }} class: software sl_severity: warning refcode: "SMBIset" message: e_dbg "Driver can't access the NVM\n" regex e_dbg "^([[:print:]]*): ([[:print:]]*): Driver can't access the NVM$" description {{ The driver could not obtain exclusive access to the PHY (physical layer device) and/or NVM (non-volatile memory) as needed. }} action {{ @paste diags_eeprom_replace }} class: hardware type: perm refcode: "ErrAcessNVM" message: e_dbg "Auto read by HW from NVM has not completed.\n" regex e_dbg "^([[:print:]]*): ([[:print:]]*): Auto read by HW from NVM has not completed\\.$" description {{ The driver timed out while preparing to access the adapter's non-volatile memory. }} action {{ @paste diags_eeprom_replace }} class: hardware type: perm refcode: "AutoReadFail" /* * e_dbg "NVM Read Error\n" * e_dbg "Master requests are pending.\n" * e_dbg "Not in Adaptive IFS mode!\n" */ message: e_dbg "Could not acquire NVM grant\n" regex e_dbg "^([[:print:]]*): ([[:print:]]*): Could not acquire NVM grant$" description {{ While preparing to write to the adapter's non-volatile memory, the driver timed out trying to obtain exclusive access. }} action {{ 1. Run the "ethtool -i" command to check the adapter's firmware version. 2. Check the level of the adapter's EEPROM or NVRAM. [How do you do that? What do you do with this info once you have it?] 3. Replace the adapter. }} class: hardware type: perm refcode: "GrantNVMFail" message: e_dbg "SPI NVM Status error\n" regex e_dbg "^([[:print:]]*): ([[:print:]]*): SPI NVM Status error$" description {{ While preparing to read or write the adapter's EEPROM, the driver timed out trying to read a status register. }} action {{ @paste diags_eeprom_replace }} class: hardware type: perm refcode: "SPINVMErr" message: e_dbg "nvm parameter(s) out of bounds\n" regex e_dbg "^([[:print:]]*): ([[:print:]]*): nvm parameter\\(s\\) out of bounds$" description {{ An attempt to read or write the adapter's EEPROM failed, apparently due to an internal error or hardware error. }} action {{ @paste diags_eeprom_replace }} class: hardware type: perm refcode: "ErrCfgNVM" /* * dup: e_dbg "nvm parameter(s) out of bounds\n" * dup: e_dbg "NVM Read Error\n" * dup: e_dbg "NVM Read Error\n" * dup: e_dbg "NVM Read Error\n" * dup: e_dbg "NVM Read Error\n" * e_dbg "NVM Checksum Invalid\n" */ message: e_dbg "NVM Read Error while updating checksum.\n" regex e_dbg "^([[:print:]]*): ([[:print:]]*): NVM Read Error while updating checksum\\.$" description {{ At attempt to read the adapter's EEPROM (in order to compute a new checksum) failed. }} action {{ 1. Run the "ethtool -i" command to check the adapter's firmware version. 2. Check the level of the adapter's EEPROM or NVRAM. [How do you do that? What do you do with this info once you have it?] }} class: hardware type: perm refcode: "ReadNVMFail" message: e_dbg "NVM Write Error while updating checksum.\n" regex e_dbg "^([[:print:]]*): ([[:print:]]*): NVM Write Error while updating checksum\\.$" description {{ An attempt to write a new EEPROM checksum failed. }} action {{ 1. Run the "ethtool -i" command to check the adapter's firmware version. 2. Check the level of the adapter's EEPROM or NVRAM. [How do you do that? What do you do with this info once you have it?] }} class: hardware type: perm refcode: "WriteNVMFail" /* * e_dbg "E1000_HOST_EN bit disabled.\n" * e_dbg "Previous command timeout failed .\n" * e_dbg "NVM Read Error\n" * e_dbg "NVM Read Error\n" */ file: "drivers/net/ethernet/intel/e1000e/netdev.c" message: dev_err "RX DMA map failed\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): RX DMA map failed$" description {{ The driver failed to create a DMA mapping for the adapter's receive buffer. }} action {{ 1. Reduce your current use of DMA mappings. [How?] 2. Delay bringing up the network interface; try again later. 3. Reboot the system. }} class: software sl_severity: error refcode: "RxDMAFail" message[defensive]: dev_err "RX DMA page map failed\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): RX DMA page map failed$" /* duplicate: dev_err "RX DMA map failed\n" */ /* e_dbg "%s: Receive packet consumed multiple buffers\n" */ message[defensive]: e_err "Detected Tx Unit Hang:\n" regex e_err "^([[:print:]]*): ([[:print:]]*): Detected Tx Unit Hang:$" /* e_dbg "%s: Packet Split buffers didn't pick up the full packet\n" */ /* e_dbg "%s: Last part of the packet spanning multiple descriptors\n" */ /* e_dbg "failed to enable jumbo frame workaround mode\n" */ message[defensive]: e_err "ME firmware caused invalid RDT - resetting\n" regex e_err "^([[:print:]]*): ([[:print:]]*): ME firmware caused invalid RDT - resetting$" message[defensive]: e_err "ME firmware caused invalid TDT - resetting\n" regex e_err "^([[:print:]]*): ([[:print:]]*): ME firmware caused invalid TDT - resetting$" /* See desc in kernel commit c6e7f51e73c1bc6044bce989ec503ef2e4758d55 */ message[defensive]: e_err "Detected Hardware Unit Hang:\n" regex e_err "^([[:print:]]*): ([[:print:]]*): Detected Hardware Unit Hang:$" /* Kernel commit: 41cec6f1160c110bd69597c2a5611b46e8287801 */ message: e_err "Try turning off Tx pause (flow control) via ethtool\n" regex e_err "^([[:print:]]*): ([[:print:]]*): Try turning off Tx pause \\(flow control\\) via ethtool$" description {{ There is a known issue in the 82577 and 82578 device that can cause a hang in the device hardware during traffic stress; the current workaround in the driver is to disable transmit flow control by default. }} action {{ 1. Try turning off Tx pause (flow control) via ethtool 2. Re-try after disabling transmit flow control }} class: software type: config refcode: "DisableFlowCtrl" message[defensive]: e_err "pskb_may_pull failed.\n" regex e_err "^([[:print:]]*): ([[:print:]]*): pskb_may_pull failed\\.$" message: e_err "Failed to initialize MSI-X interrupts. Falling back to MSI interrupts.\n" regex e_err "^([[:print:]]*): ([[:print:]]*): Failed to initialize MSI-X interrupts\\. Falling back to MSI interrupts\\.$" description {{ MSI-X interrupts could not be enabled for this adapter, because either the kernel or the hardware doesn't support MSI-X mode. The driver will try to use MSI mode. }} action {{ 1. Execute diagnostics on the adapter, using "ethtool -t". 2. Verify that the adapter hardware and firmware support MSI-X mode. 3. Verify that the kernel supports MSI-X mode. }} class: software type: config refcode: "EnableMSIXFailed" message: e_err "Failed to initialize MSI interrupts. Falling back to legacy interrupts.\n" regex e_err "^([[:print:]]*): ([[:print:]]*): Failed to initialize MSI interrupts\\. Falling back to legacy interrupts\\.$" description {{ MSI interrupts could not be enabled for this adapter, because either the kernel or the hardware doesn't support MSI mode. The driver will try to use LSI mode. }} action {{ 1. Execute diagnostics on the adapter, using "ethtool -t". 2. Verify that the adapter hardware and firmware support MSI mode. 3. Verify that the kernel supports MSI mode. }} class: software type: config refcode: "EnableMSIFailed" message: e_err "Unable to allocate interrupt, Error: %d\n" regex e_err "^([[:print:]]*): ([[:print:]]*): Unable to allocate interrupt, Error: ([-]\?[0-9]{1,})$" description {{ While bringing up a network interface, the driver failed to configure interrupts for this adapter. }} action {{ 1. Find the error code in errno.h to determine the reason for the error. 2. Execute diagnostics on the adapter, using "ethtool -t". }} class: software sl_severity: error refcode: "ReqItrFail" message: e_err "Unable to allocate memory for the transmit descriptor ring\n" regex e_err "^([[:print:]]*): ([[:print:]]*): Unable to allocate memory for the transmit descriptor ring$" description {{ While bringing up a network interface, the driver failed to allocate memory for the transmit descriptor ring, probably because the system is low on memory. }} action {{ 1. With the ethtool command (-g and -G options), reduce the size of the adapter's transmit descriptor ring. 2. Free up memory and retry the failed operation. 3. Add memory to your system. }} class: software sl_severity: error refcode: "TxDMemFail" message: e_err "Unable to allocate memory for the receive descriptor ring\n" regex e_err "^([[:print:]]*): ([[:print:]]*): Unable to allocate memory for the receive descriptor ring$" description {{ While bringing up a network interface, the driver failed to allocate memory for the receive descriptor ring, probably because the system is low on memory. }} action {{ 1. With the ethtool command (-g and -G options), reduce the size of the adapter's receive descriptor ring. 2. Free up memory and retry the failed operation. 3. Add memory to your system. }} class: software sl_severity: error refcode: "RxDMemFail" message: e_err "Unable to allocate memory for queues\n" regex e_err "^([[:print:]]*): ([[:print:]]*): Unable to allocate memory for queues$" description {{ While bringing up a network interface, the driver failed to allocate memory for the transmit and receive queues, probably because the system is low on memory. }} action {{ 1. With the ethtool command (-g and -G options), reduce the size of the adapter's transmit and/or descriptor rings. 2. Free up memory and retry the failed operation. 3. Add memory to your system. }} class: software sl_severity: error refcode: "QueueMemFail" message: e_err "Hardware Error\n" regex e_err "^([[:print:]]*): ([[:print:]]*): Hardware Error$" description {{ While bringing up a network interface, the driver failed to initialize the identification LED or failed to set up link and flow control. This is a non-fatal error. }} action {{ 1. Execute diagnostics on the adapter, using "ethtool -t". 2. Check the cable connections. }} class: hardware sl_severity: warning refcode: "HrdErr" /* e_dbg "%s: icr is %08X\n" */ message[chatter]: e_info "MSI interrupt test failed!\n" regex e_info "^([[:print:]]*): ([[:print:]]*): MSI interrupt test failed!$" /* e_dbg "%s: MSI interrupt test succeeded!\n" */ message: e_warn "MSI interrupt test failed, using legacy interrupt.\n" regex e_warn "^([[:print:]]*): ([[:print:]]*): MSI interrupt test failed, using legacy interrupt\\.$" description {{ One of the tests run via the "ethtool -t" command failed. MSI interrupt mode is not available, so the driver will try to use LSI mode. }} action {{ 1. Find the error code in errno.h to determine the reason for the error. 2. Verify that the adapter hardware and firmware support MSI mode. 3. Verify that the kernel supports MSI mode. }} class: software sl_severity: warning refcode: "MSIFailed" /* dup: e_info "MSI interrupt test failed, using legacy interrupt.\n" */ /* TODO: Is the explanation provided by Wen (#18) correct? */ message[defensive]: e_err "Interrupt allocation failed\n" regex e_err "^([[:print:]]*): ([[:print:]]*): Interrupt allocation failed$" message[defensive]: e_warn "Unable to create IPMI pass-through filter\n" regex e_warn "^([[:print:]]*): ([[:print:]]*): Unable to create IPMI pass-through filter$" message: e_warn "Error reading PHY register\n" regex e_warn "^([[:print:]]*): ([[:print:]]*): Error reading PHY register$" description {{ This is only a warning message. }} action {{ No action necessary. }} class: software sl_severity: warning refcode: "ErrPHY" message[chatter]: printk KERN_INFO "e1000e: %s NIC Link is Up %d Mbps %s, Flow Control: %s\n" regex printk "^e1000e: [[:print:]]* NIC Link is Up [-]\?[0-9]{1,} Mbps [[:print:]]*, Flow Control: [[:print:]]*$" message[chatter]: e_info "Gigabit has been disabled, downgrading speed\n" regex e_info "^([[:print:]]*): ([[:print:]]*): Gigabit has been disabled, downgrading speed$" message[chatter]: e_info "Autonegotiated half duplex but link partner cannot autoneg. Try forcing full duplex if link gets many collisions.\n" regex e_info "^([[:print:]]*): ([[:print:]]*): Autonegotiated half duplex but link partner cannot autoneg\\. Try forcing full duplex if link gets many collisions\\.$" message[chatter]: e_info "10/100 speed: disabling TSO\n" regex e_info "^([[:print:]]*): ([[:print:]]*): 10/100 speed: disabling TSO$" message[chatter]: printk KERN_INFO "e1000e: %s NIC Link is Down\n" regex printk "^e1000e: [[:print:]]* NIC Link is Down$" message[defensive]: e_warn "checksum_partial proto=%x!\n" regex e_warn "^([[:print:]]*): ([[:print:]]*): checksum_partial proto=([0-9a-f]{1,})!$" message: dev_err "TX DMA map failed\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): TX DMA map failed$" description {{ The driver failed to create a DMA mapping for the adapter's transmit buffer. }} action {{ 1. Reduce your current use of DMA mappings. [How?] 2. Delay bringing up the network interface; try again later. 3. Reboot the system. }} class: software sl_severity: error refcode: "TxDMAFail" message[defensive]: e_err "__pskb_pull_tail failed.\n" regex e_err "^([[:print:]]*): ([[:print:]]*): __pskb_pull_tail failed\\.$" message: e_err "Reset adapter\n" regex e_err "^([[:print:]]*): ([[:print:]]*): Reset adapter$" description {{ An unexpected reset has been called because of some unexpected behaviour. }} action {{ Reset (restart?) the network interface. }} class: software type: config refcode: "ResetAdapter" message: e_err "Jumbo Frames not supported.\n" regex e_err "^([[:print:]]*): ([[:print:]]*): Jumbo Frames not supported\\.$" description {{ The configured MTU size is appropriate for Jumbo Frames; however, the adapter doesn't support Jumbo Frames. The default size for Jumbo Frames is 9234 bytes. }} action {{ Use the ifconfig command to set the MTU value to within the proper range. }} class: software type: config refcode: "JmbFrames" message: e_err "Unsupported MTU setting\n" regex e_err "^([[:print:]]*): ([[:print:]]*): Unsupported MTU setting$" description {{ Different adapters support different ranges for the MTU (maximum transmit unit) parameter. A system administrator has apparently configured an MTU value that is too small or too big. }} action {{ Use the ifconfig command to set the MTU value to within the proper range. }} class: software type: config refcode: "badMtu" message: e_err "Jumbo Frames not supported on this device when CRC stripping is disabled.\n" regex e_err "^([[:print:]]*): ([[:print:]]*): Jumbo Frames not supported on this device when CRC stripping is disabled\\.$" description {{ Jumbo frames on 82579 and newer devcies requires CRC be stripped. }} action {{ Enable CRC stripping on this device. }} class: software type: config refcode: "JmbFramesCRCStrip" message[chatter]: e_info "changing MTU from %d to %d\n" regex e_info "^([[:print:]]*): ([[:print:]]*): changing MTU from ([-]\?[0-9]{1,}) to ([-]\?[0-9]{1,})$" message[defensive]: e_err "Could not acquire PHY\n" regex e_err "^([[:print:]]*): ([[:print:]]*): Could not acquire PHY$" message[defensive]: e_err "Could not read PHY page 769\n" regex e_err "^([[:print:]]*): ([[:print:]]*): Could not read PHY page 769$" message[defensive]: e_err "Could not set PHY Host Wakeup bit\n" regex e_err "^([[:print:]]*): ([[:print:]]*): Could not set PHY Host Wakeup bit$" message[defensive]: dev_warn "Disabling L1 ASPM\n" regex dev_warn "^([[:print:]]*) ([[:print:]]*): Disabling L1 ASPM$" message[defensive]: dev_err "Cannot enable PCI device from suspend\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): Cannot enable PCI device from suspend$" message[chatter]: e_info "PHY Wakeup cause - %s\n" regex e_info "^([[:print:]]*): ([[:print:]]*): PHY Wakeup cause - ([[:print:]]*)$" message[chatter]: e_info "MAC Wakeup cause - %s\n" regex e_info "^([[:print:]]*): ([[:print:]]*): MAC Wakeup cause - ([[:print:]]*)$" message[defensive]: dev_err "Cannot re-enable PCI device after reset.\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): Cannot re-enable PCI device after reset\\.$" message: dev_err "can't bring device back up after reset\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): can't bring device back up after reset$" description {{ This error happens during Enhanced Error Handling (EEH) on the PowerPC platform. During error recovery, the attempt to resume normal operation after a PCI bus reset failed. }} action {{ 1. Obtain a dump of the kernel stack and registers, and report the problem to your service provider. [How do you obtain a strack trace that's relevant to this problem?] 2. On a PowerPC platform, you can use the hotplug command to attempt to recover the adapter, rather than rebooting the Linux partition. [Where is the hotplug command documented? Under what circumstances SHOULD you reboot the partition?] }} class: software sl_severity: error refcode: "AEREnfail" message[chatter]: e_info "(PCI Express:2.5GB/s:%s) %pM\n" regex e_info "^([[:print:]]*): ([[:print:]]*): \\(PCI Express:2\\.5GB/s:([[:print:]]*)\\) (\\(null\\)|([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2})$" message[chatter]: e_info "Intel(R) PRO/%s Network Connection\n" regex e_info "^([[:print:]]*): ([[:print:]]*): Intel\\(R\\) PRO/([[:print:]]*) Network Connection$" message[chatter]: e_info "MAC: %d, PHY: %d, PBA No: %06x-%03x\n" regex e_info "^([[:print:]]*): ([[:print:]]*): MAC: ([-]\?[0-9]{1,}), PHY: ([-]\?[0-9]{1,}), PBA No: ([0]{0,5}[0-9a-f]{1,})-([0]{0,2}[0-9a-f]{1,})$" message[defensive]: dev_warn "Warning: detected DSPD enabled in EEPROM\n" regex dev_warn "^([[:print:]]*) ([[:print:]]*): Warning: detected DSPD enabled in EEPROM$" message[defensive]: dev_warn "Warning: detected ASPM enabled in EEPROM\n" regex dev_warn "^([[:print:]]*) ([[:print:]]*): Warning: detected ASPM enabled in EEPROM$" message: dev_err "No usable DMA configuration, aborting\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): No usable DMA configuration, aborting$" description {{ Unable to enable DMA for either 32 or 64 bits with device_mask. The device driver couldn't continue to initialize the adapter because the adapter couldn't perform DMA properly on the system. [Explain device_mask, or omit the ref to it.] }} action {{ 1. Reboot Linux. 2. Verify that your kernel supports DMA mode for data transfer. [How? Is DMA support configurable?] }} class: software sl_severity: error refcode: "noDmaCfg" message: dev_err "pci_enable_pcie_error_reporting failed 0x%x\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): pci_enable_pcie_error_reporting failed 0x([0-9a-f]{1,})$" /* Note: Wen has this as "pci_enable_error_reporting failed\n" */ description {{ This is a non-fatal error. The driver unsuccessfully attempted to enable AER on the adapter. This error means either the system doesn't support AER or the adapter doesn't support AER. The driver will continue to initialize the adapter. }} action {{ 1. Verify that your Linux kernel supports AER. 2. Verify that your adapter supports AER. }} class: software sl_severity: warning refcode: "AEREnfail" message: e_info "PHY reset is blocked due to SOL/IDER session.\n" regex e_info "^([[:print:]]*): ([[:print:]]*): PHY reset is blocked due to SOL/IDER session\\.$" description {{ The reset of the PHY (physical layer device) is blocked, but the driver continues to initialize the adapter. }} action {{ No action required. }} class: software type: info refcode: "PhyRstBlk" message: e_err "The NVM Checksum Is Not Valid\n" regex e_err "^([[:print:]]*): ([[:print:]]*): The NVM Checksum Is Not Valid$" description {{ The driver has given up trying to initialize the adapter because the adapter's EEPROM checksum is incorrect. }} action {{ @paste diags_eeprom_replace }} class: hardware type: perm refcode: "BF778E00" priority: H /* dup: dev_err "The NVM Checksum Is Not Valid\n" */ message: e_err "NVM Read Error while reading MAC address\n" regex e_err "^([[:print:]]*): ([[:print:]]*): NVM Read Error while reading MAC address$" description {{ The driver was unable to read the MAC address from the adapter's EEPROM. }} action {{ @paste diags_eeprom_replace }} class: software sl_severity: warning refcode: "RdMAC" /* dup: dev_err "NVM Read Error while reading MAC address\n" */ message: e_err "Invalid MAC Address: %pM\n" regex e_err "^([[:print:]]*): ([[:print:]]*): Invalid MAC Address: (\\(null\\)|([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2})$" description {{ The MAC address read from the adapter's EEPROM is not a valid Ethernet address. }} action {{ @paste diags_eeprom_replace }} class: hardware type: perm refcode: "BF778E00" priority: H /* dup: dev_err "Invalid MAC Address: %pM\n" */ message: dev_err "pci_disable_pcie_error_reporting failed 0x%x\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): pci_disable_pcie_error_reporting failed 0x([0-9a-f]{1,})$" /* Note: Wen has this as "pci_disable_error_reporting failed\n" */ description {{ This is a non-fatal error. The driver unsuccessfully attempted to disable AER on the adapter. This error means either the system doesn't support AER or the adapter doesn't support AER. }} action {{ Verify that the adapter supports AER. If it doesn't, don't try to enable or disable AER for it. [How can the customer affect this?] }} class: software sl_severity: warning refcode: "AERDisfail" message[chatter]: printk KERN_INFO "%s: Intel(R) PRO/1000 Network Driver - %s\n" regex printk "^[[:print:]]*: Intel\\(R\\) PRO/1000 Network Driver - [[:print:]]*$" message[chatter]: printk KERN_INFO "%s: Copyright (c) 1999-2008 Intel Corporation.\n" regex printk "^[[:print:]]*: Copyright \\(c\\) 1999-2008 Intel Corporation\\.$" file: "drivers/net/ethernet/intel/e1000e/param.c" message[chatter]: e_info "%s Enabled\n" regex e_info "^([[:print:]]*): ([[:print:]]*): ([[:print:]]*) Enabled$" message[chatter]: e_info "%s Disabled\n" regex e_info "^([[:print:]]*): ([[:print:]]*): ([[:print:]]*) Disabled$" message[chatter]: e_info "%s set to %i\n" regex e_info "^([[:print:]]*): ([[:print:]]*): ([[:print:]]*) set to ([-]\?[0-9]{1,})$" /* Omit this: it would match everything. e_info "%s\n" */ message[chatter]: e_info "Invalid %s value specified (%i) %s\n" regex e_info "^([[:print:]]*): ([[:print:]]*): Invalid ([[:print:]]*) value specified \\(([-]\?[0-9]{1,})\\) ([[:print:]]*)$" message: e_notice "Warning: no configuration for board #%i\n" regex e_notice "^([[:print:]]*): ([[:print:]]*): Warning: no configuration for board #([-]\?[0-9]{1,})$" description {{ The number of network adapters in the system that are associated with the e1000e driver exceeds E1000_MAX_NIC, as defined in e1000_param.c of the driver source. }} action {{ Change E1000_MAX_NIC in e1000_param.c and rebuild the driver. ["(ii) Change the startup module parameter." How would this work? It appears that E1000_MAX_NIC is a compile-time constant.] }} class: software type: config refcode: "noBoard" message[defensive]: e_notice "Using defaults for all values\n" regex e_notice "^([[:print:]]*): ([[:print:]]*): Using defaults for all values$" message[chatter]: dev_info "%s set to default %d\n" regex dev_info "^([[:print:]]*) ([[:print:]]*): ([[:print:]]*) set to default ([-]\?[0-9]{1,})$" message[chatter]: e_info "%s turned off\n" regex e_info "^([[:print:]]*): ([[:print:]]*): ([[:print:]]*) turned off$" message[chatter]: e_info "%s set to dynamic mode\n" regex e_info "^([[:print:]]*): ([[:print:]]*): ([[:print:]]*) set to dynamic mode$" message[chatter]: e_info "%s set to dynamic conservative mode\n" regex e_info "^([[:print:]]*): ([[:print:]]*): ([[:print:]]*) set to dynamic conservative mode$" message[chatter]: dev_info "%s set to simplified (2000-8000 ints) mode\n" regex dev_info "^([[:print:]]*) ([[:print:]]*): ([[:print:]]*) set to simplified \\(2000-8000 ints\\) mode$" file: "drivers/net/ethernet/intel/e1000e/phy.c" /* * e_dbg "PHY Address %d is out of range\n" * e_dbg "MDI Read did not complete\n" * e_dbg "MDI Error\n" * e_dbg "PHY Address %d is out of range\n" * e_dbg "MDI Write did not complete\n" * e_dbg "MDI Error\n" * e_dbg "Setting page 0x%x\n" * e_dbg "Error committing the PHY changes\n" * e_dbg "Error resetting the PHY.\n" * e_dbg "Error Disabling LPLU D0\n" * e_dbg "autoneg_advertised %x\n" * e_dbg "Advertise 10mb Half duplex\n" * e_dbg "Advertise 10mb Full duplex\n" * e_dbg "Advertise 100mb Half duplex\n" * e_dbg "Advertise 100mb Full duplex\n" * e_dbg "Advertise 1000mb Half duplex request denied!\n" * e_dbg "Advertise 1000mb Full duplex\n" * e_dbg "Flow control param set incorrectly\n" * e_dbg "Auto-Neg Advertising %x\n" * e_dbg "Reconfiguring auto-neg advertisement params\n" * e_dbg "Error Setting up Auto-Negotiation\n" * e_dbg "Restarting Auto-Neg\n" * e_dbg "Error while waiting for autoneg to complete\n" * e_dbg "Forcing Speed and Duplex\n" * e_dbg "Error Forcing Speed and Duplex\n" * e_dbg "Valid link established!!!\n" * e_dbg "Unable to establish link!!!\n" * e_dbg "IGP PSCR: %X\n" * e_dbg "Waiting for forced speed/duplex link on IGP phy.\n" * e_dbg "Link taking longer than expected.\n" * e_dbg "M88E1000 PSCR: %X\n" * e_dbg "Waiting for forced speed/duplex link on M88 phy.\n" * e_dbg "Link taking longer than expected.\n" * e_dbg "IFE PMC: %X\n" * e_dbg "Waiting for forced speed/duplex link on IFE phy.\n" * e_dbg "Link taking longer than expected.\n" * e_dbg "Half Duplex\n" * e_dbg "Full Duplex\n" * e_dbg "Forcing 100mb\n" * e_dbg "Forcing 10mb\n" * e_dbg "Phy info is only valid for copper media\n" * e_dbg "Phy info is only valid if link is up\n" * e_dbg "Phy info is only valid if link is up\n" * e_dbg "Running IGP 3 PHY init script\n" * e_dbg "Could not set Port Control page\n" * e_dbg "Could not read PHY register %d.%d\n" * e_dbg "Could not write PHY register %d.%d\n" * e_dbg "Could not set Port Control page\n" * e_dbg "Could not restore PHY register %d.%d\n" * e_dbg "Attempting to access page %d while gig enabled.\n" * e_dbg "Could not enable PHY wakeup reg access\n" * e_dbg "Accessing PHY page %d reg 0x%x\n" * e_dbg "Could not write address opcode to page %d\n" * e_dbg "Could not access PHY reg %d.%d\n" * e_dbg "reading PHY page %d (or 0x%x shifted) reg 0x%x\n" * e_dbg "writing PHY page %d (or 0x%x shifted) reg 0x%x\n" * e_dbg "Could not write the Address Offset port register\n" * e_dbg "Could not access the Data port register\n" * e_dbg "Attempting to access page 800 while gig enabled\n" * e_dbg "Could not acquire PHY\n" * e_dbg "Could not write PHY the HV address register\n" * e_dbg "Could not read data value from HV data register\n" * e_dbg "I82577_PHY_CTRL_2: %X\n" * e_dbg "Waiting for forced speed/duplex link on 82577 phy\n" * e_dbg "Link taking longer than expected.\n" * e_dbg "Phy info is only valid if link is up\n" */ ppc64-diag-2.7.4/ela/message_catalog/with_regex/gpfs0000755000000000000000000000465613135275400017175 00000000000000subsystem: gpfs message: mmfs_failed "\n" regex mmfs_failed "^mmfs: Error=MMFS_PDISK_FAILED, ID=([[:print:]]*), Tag=([[:print:]]*):([[:print:]]*): Location=([[:print:]]*), FRU=([[:print:]]*), WWID=([[:print:]]*), RecoveryGroup=([[:print:]]*), DeclusteredArray=([[:print:]]*), Pdisk=([[:print:]]*), PdiskState=([[:print:]]*)$" description {{ A disk has failed or is not responding. The filesystem is still operational. }} action {{ Ignore }} class: software sl_severity: warning refcode: "" message: mmfs_pathfail "\n" regex mmfs_pathfail "^mmfs: Error=([[:print:]]*), ID=([[:print:]]*), Tag=([[:print:]]*):([[:print:]]*): Location=([[:print:]]*), FRU=([[:print:]]*), WWID=([[:print:]]*), RecoveryGroup=([[:print:]]*), ([[:print:]]*)=([[:print:]]*), Pdisk=([[:print:]]*), Device=([[:print:]]*)$" description {{ A path to a disk is no longer usable. Probable cause: SAS adapter, cable, port expander or disk carrier. }} action {{ Ignore }} class: software sl_severity: warning refcode: "" message: mmfs_recovered "\n" regex mmfs_recovered "^mmfs: Error=MMFS_PDISK_RECOVERED, ID=([[:print:]]*), Tag=([[:print:]]*):([[:print:]]*): Location=([[:print:]]*), FRU=([[:print:]]*), WWID=([[:print:]]*), RecoveryGroup=([[:print:]]*), DeclusteredArray=([[:print:]]*), Pdisk=([[:print:]]*)$" description {{ A disk previously reported as not responding has been found and is working. }} action {{ Ignore }} class: software sl_severity: warning refcode: "" message: mmfs_replace "\n" regex mmfs_replace "^mmfs: Error=MMFS_REPLACE_PDISK, ID=([[:print:]]*), Tag=([[:print:]]*):([[:print:]]*): Location=([[:print:]]*), FRU=([[:print:]]*), WWID=([[:print:]]*), RecoveryGroup=([[:print:]]*), DeclusteredArray=([[:print:]]*), Pdisk=([[:print:]]*), Priority=([[:print:]]*), PdiskState=([[:print:]]*)$" description {{ The disk replacement threshold has been met for the given failed disk. The disk must be replaced. }} action {{ Notify administrator. }} class: software sl_severity: error refcode: "EF000001" message: mmfs_rebuild "\n" regex mmfs_rebuild "^mmfs: Error=MMFS_REBUILD_FAILED, ID=([[:print:]]*), Tag=([[:print:]]*):([[:print:]]*): RecoveryGroup=([[:print:]]*), DeclusteredArray=([[:print:]]*), RemainingRedundancy=([[:print:]]*)$" description {{ There is not enough available spare space to reestablish full redundancy in a declustered array. Customer may be in danger of data loss. }} action {{ Notify administrator. }} class: software sl_severity: error refcode: "EF000002" ppc64-diag-2.7.4/ela/message_catalog/with_regex/ipr0000644000000000000000000013224313135275400017017 00000000000000subsystem: scsi file: "drivers/scsi/ipr.c" message[defensive]: dev_err "Failed to save PCI-X command register\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): Failed to save PCI-X command register$" message[defensive]: dev_err "Failed to setup PCI-X command register\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): Failed to setup PCI-X command register$" message[defensive]: dev_err "Host RCB failed with IOASC: 0x%08X\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): Host RCB failed with IOASC: 0x([0]{0,7}[0-9A-F]{1,})$" /***** * Skipping all of the following because they report additional info * subsequent to "real" error messages. 979: ipr_hcam_err(hostrcb, "%s VPID/SN: %s\n" 998: ipr_err("Vendor/Product ID: %s\n" 1002: ipr_err(" Serial Number: %s\n" 1018: ipr_hcam_err(hostrcb, "%s WWN: %08X%08X\n" 1032: ipr_err(" WWN: %08X%08X\n" 1050: ipr_err("-----Current Configuration-----\n" 1051: ipr_err("Cache Directory Card Information:\n" 1053: ipr_err("Adapter Card Information:\n" 1056: ipr_err("-----Expected Configuration-----\n" 1057: ipr_err("Cache Directory Card Information:\n" 1059: ipr_err("Adapter Card Information:\n" 1062: ipr_err("Additional IOA Data: %08X %08X %08X\n" 1082: ipr_err("-----Current Configuration-----\n" 1083: ipr_err("Cache Directory Card Information:\n" 1085: ipr_err("Adapter Card Information:\n" 1088: ipr_err("-----Expected Configuration-----\n" 1089: ipr_err("Cache Directory Card Information:\n" 1091: ipr_err("Adapter Card Information:\n" 1094: ipr_err("Additional IOA Data: %08X %08X %08X\n" 1118: ipr_err("Device Errors Detected/Logged: %d/%d\n" 1126: ipr_phys_res_err(ioa_cfg, dev_entry->dev_res_addr, "Device %d", i + 1); 1129: ipr_err("-----New Device Information-----\n" 1132: ipr_err("Cache Directory Card Information:\n" 1135: ipr_err("Adapter Card Information:\n" 1158: ipr_err("Device Errors Detected/Logged: %d/%d\n" 1166: ipr_phys_res_err(ioa_cfg, dev_entry->dev_res_addr, "Device %d", i + 1); 1169: ipr_err("-----New Device Information-----\n" 1172: ipr_err("Cache Directory Card Information:\n" 1175: ipr_err("Adapter Card Information:\n" 1178: ipr_err("Additional IOA Data: %08X %08X %08X %08X %08X\n" 1207: ipr_err("RAID %s Array Configuration: %d:%d:%d:%d\n" 1225: ipr_err("Exposed Array Member %d:\n" 1227: ipr_err("Array Member %d:\n" 1230: ipr_phys_res_err(ioa_cfg, array_entry->dev_res_addr, "Current Location"); 1231: ipr_phys_res_err(ioa_cfg, array_entry->expected_dev_res_addr, "Expected Location"); 1258: ipr_err("RAID %s Array Configuration: %d:%d:%d:%d\n" 1274: ipr_err("Exposed Array Member %d:\n" 1276: ipr_err("Array Member %d:\n" 1280: ipr_phys_res_err(ioa_cfg, array_entry->dev_res_addr, "Current Location"); 1281: ipr_phys_res_err(ioa_cfg, array_entry->expected_dev_res_addr, "Expected Location"); 1313: ipr_err("%08X: %08X %08X %08X %08X\n" *****/ /***** * Omitting these because they could report any of a number of errors. 1338: ipr_hcam_err(hostrcb, "%s [PRC: %08X]\n" 1364: ipr_hcam_err(hostrcb, "%s [PRC: %08X]\n" *****/ /***** * Skipping all of the following because they report additional info * subsequent to "real" error messages. 1417: ipr_hcam_err(hostrcb, "%s %s: IOA Port=%d\n" 1421: ipr_hcam_err(hostrcb, "%s %s: IOA Port=%d, Phy=%d\n" 1425: ipr_hcam_err(hostrcb, "%s %s: IOA Port=%d, Cascade=%d\n" 1429: ipr_hcam_err(hostrcb, "%s %s: IOA Port=%d, Cascade=%d, Phy=%d\n" 1437: ipr_err("Path state=%02X IOA Port=%d Cascade=%d Phy=%d\n" 1509: ipr_hcam_err(hostrcb, "%s %s: Phy=%d, Link rate=%s, WWN=%08X%08X\n" 1515: ipr_hcam_err(hostrcb, "%s %s: Link rate=%s, WWN=%08X%08X\n" 1520: ipr_hcam_err(hostrcb, "%s %s: Phy=%d, Link rate=%s, " 1526: ipr_hcam_err(hostrcb, "%s %s: Cascade=%d, Link rate=%s, " 1532: ipr_hcam_err(hostrcb, "%s %s: Cascade=%d, Phy=%d, Link rate=%s " 1543: ipr_hcam_err(hostrcb, "Path element=%02X: Cascade=%d Phy=%d Link rate=%s " *****/ /***** * Omitting this because it could report any of a number of errors. 1567: ipr_hcam_err(hostrcb, "%s\n" *****/ message[defensive]: dev_err "Error notifications lost\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): Error notifications lost$" message[defensive]: dev_err "Host RCB failed with IOASC: 0x%08X\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): Host RCB failed with IOASC: 0x([0]{0,7}[0-9A-F]{1,})$" message[defensive]: dev_err "Adapter being reset due to command timeout.\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): Adapter being reset due to command timeout\\.$" message[defensive]: dev_err "Adapter timed out transitioning to operational.\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): Adapter timed out transitioning to operational\\.$" message[defensive]: dev_err "IOA dump long data transfer timeout\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): IOA dump long data transfer timeout$" message[defensive]: dev_err "IOA dump short data transfer timeout\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): IOA dump short data transfer timeout$" message[defensive]: dev_err "Invalid dump table format: %lx\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): Invalid dump table format: ([0-9a-f]{1,})$" message[defensive]: dev_err "Dump of IOA initiated\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): Dump of IOA initiated$" message[defensive]: dev_err "Dump of IOA failed. Dump table not valid: %d, %X.\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): Dump of IOA failed\\. Dump table not valid: ([-]\?[0-9]{1,}), ([0-9A-F]{1,})\\.$" message[defensive]: dev_err "Dump of IOA completed.\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): Dump of IOA completed\\.$" message[chatter]: dev_info "%s adapter write cache.\n" regex dev_info "^([[:print:]]*) ([[:print:]]*): ([[:print:]]*) adapter write cache\\.$" message[defensive]: dev_err "Microcode download already in progress\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): Microcode download already in progress$" message[defensive]: dev_err "Failed to map microcode download buffer!\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): Failed to map microcode download buffer!$" message[defensive]: dev_err "Firmware file %s not found\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): Firmware file ([[:print:]]*) not found$" message[defensive]: dev_err "Invalid microcode buffer\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): Invalid microcode buffer$" message[defensive]: dev_err "Microcode buffer allocation failed\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): Microcode buffer allocation failed$" message[defensive]: dev_err "Microcode buffer copy to DMA buffer failed\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): Microcode buffer copy to DMA buffer failed$" message[defensive]: ipr_err "Dump memory allocation failed\n" regex ipr_err "^ipr: Dump memory allocation failed$" message[defensive]: dev_err "Adapter being reset as a result of error recovery.\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): Adapter being reset as a result of error recovery\\.$" message[defensive]: scmd_printk KERN_ERR "Resetting device\n" regex sdev_printk "^([[:print:]]*) ([[:print:]]*): Resetting device$" regex scmd_printk_disk "^([[:print:]]*) ([[:print:]]*): \\[([[:print:]]*)] Resetting device$" message[defensive]: sdev_printk KERN_ERR "Abort timed out. Resetting bus.\n" regex sdev_printk "^([[:print:]]*) ([[:print:]]*): Abort timed out\\. Resetting bus\\.$" message[defensive]: scmd_printk KERN_ERR "Aborting command: %02X\n" regex sdev_printk "^([[:print:]]*) ([[:print:]]*): Aborting command: ([0]{0,1}[0-9A-F]{1,})$" regex scmd_printk_disk "^([[:print:]]*) ([[:print:]]*): \\[([[:print:]]*)] Aborting command: ([0]{0,1}[0-9A-F]{1,})$" message[defensive]: dev_err "Permanent IOA failure. 0x%08X\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): Permanent IOA failure\\. 0x([0]{0,7}[0-9A-F]{1,})$" message[defensive]: dev_err "Invalid response handle from IOA\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): Invalid response handle from IOA$" message[defensive]: dev_err "pci_map_sg failed!\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): pci_map_sg failed!$" message[defensive]: scmd_printk KERN_ERR "Request Sense failed with IOASC: 0x%08X\n" regex sdev_printk "^([[:print:]]*) ([[:print:]]*): Request Sense failed with IOASC: 0x([0]{0,7}[0-9A-F]{1,})$" regex scmd_printk_disk "^([[:print:]]*) ([[:print:]]*): \\[([[:print:]]*)] Request Sense failed with IOASC: 0x([0]{0,7}[0-9A-F]{1,})$" /***** * Skipping the following because they report additional info * subsequent to "real" error messages. 4568: ipr_err("IOASA Dump:\n" 4571: ipr_err("%08X: %08X %08X %08X %08X\n" *****/ message[chatter]: dev_info "IOA initialized.\n" regex dev_info "^([[:print:]]*) ([[:print:]]*): IOA initialized\\.$" message[defensive]: dev_err "Term power is absent on scsi bus %d\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): Term power is absent on scsi bus ([-]\?[0-9]{1,})$" message[defensive]: dev_err "Invalid resource address reported: 0x%08X\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): Invalid resource address reported: 0x([0]{0,7}[0-9A-F]{1,})$" message[defensive]: dev_err "0x%02X failed with IOASC: 0x%08X\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): 0x([0]{0,1}[0-9A-F]{1,}) failed with IOASC: 0x([0]{0,7}[0-9A-F]{1,})$" message[defensive]: dev_err "Microcode download required\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): Microcode download required$" message[defensive]: dev_err "Too many devices attached\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): Too many devices attached$" message[chatter]: dev_info "Adapter firmware version: %02X%02X%02X%02X\n" regex dev_info "^([[:print:]]*) ([[:print:]]*): Adapter firmware version: ([0]{0,1}[0-9A-F]{1,})([0]{0,1}[0-9A-F]{1,})([0]{0,1}[0-9A-F]{1,})([0]{0,1}[0-9A-F]{1,})$" message[chatter]: dev_info "Starting IOA initialization sequence.\n" regex dev_info "^([[:print:]]*) ([[:print:]]*): Starting IOA initialization sequence\\.$" message[chatter]: dev_info "Initializing IOA.\n" regex dev_info "^([[:print:]]*) ([[:print:]]*): Initializing IOA\\.$" message[defensive]: dev_err "IOA unit check with no data\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): IOA unit check with no data$" message[defensive]: dev_err "IOA taken offline - error recovery failed\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): IOA taken offline - error recovery failed$" message[defensive]: dev_dbg "ioa_cfg adx: 0x%p\n" regex dev_dbg "^([[:print:]]*) ([[:print:]]*): ioa_cfg adx: 0x(\\(null\\)|([0]{0,7}[0-9a-f]{1,}))$" message[defensive]: dev_err "Adapter not supported in this hardware configuration.\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): Adapter not supported in this hardware configuration\\.$" message[defensive]: dev_err "Can not assign irq %d\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): Can not assign irq ([-]\?[0-9]{1,})$" message[chatter]: dev_info "IRQ assigned: %d\n" regex dev_info "^([[:print:]]*) ([[:print:]]*): IRQ assigned: ([-]\?[0-9]{1,})$" message[chatter]: dev_info "MSI test failed. Falling back to LSI.\n" regex dev_info "^([[:print:]]*) ([[:print:]]*): MSI test failed\\. Falling back to LSI\\.$" message[chatter]: dev_info "MSI test succeeded.\n" regex dev_info "^([[:print:]]*) ([[:print:]]*): MSI test succeeded\\.$" message[defensive]: dev_err "Cannot enable adapter\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): Cannot enable adapter$" message[chatter]: dev_info "Found IOA with IRQ: %d\n" regex dev_info "^([[:print:]]*) ([[:print:]]*): Found IOA with IRQ: ([-]\?[0-9]{1,})$" message[defensive]: dev_err "call to scsi_host_alloc failed!\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): call to scsi_host_alloc failed!$" message[defensive]: dev_err "Unknown adapter chipset 0x%04X 0x%04X\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): Unknown adapter chipset 0x([0]{0,3}[0-9A-F]{1,}) 0x([0]{0,3}[0-9A-F]{1,})$" message[defensive]: dev_err "Couldn't register memory range of registers\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): Couldn't register memory range of registers$" message[defensive]: dev_err "Couldn't map memory range of registers\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): Couldn't map memory range of registers$" message[defensive]: dev_err "Failed to set PCI DMA mask\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): Failed to set PCI DMA mask$" message[defensive]: dev_err "Write of cache line size failed\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): Write of cache line size failed$" message[chatter]: dev_info "MSI enabled with IRQ: %d\n" regex dev_info "^([[:print:]]*) ([[:print:]]*): MSI enabled with IRQ: ([-]\?[0-9]{1,})$" message[chatter]: dev_info "Cannot enable MSI.\n" regex dev_info "^([[:print:]]*) ([[:print:]]*): Cannot enable MSI\\.$" message[defensive]: dev_err "Failed to save PCI config space\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): Failed to save PCI config space$" message[defensive]: dev_err "Couldn't allocate enough memory for device driver!\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): Couldn't allocate enough memory for device driver!$" message[defensive]: dev_err "Couldn't register IRQ %d! rc=%d\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): Couldn't register IRQ ([-]\?[0-9]{1,})! rc=([-]\?[0-9]{1,})$" message[chatter]: ipr_info "IBM Power RAID SCSI Device Driver version: %s %s\n" regex ipr_info "^ipr: IBM Power RAID SCSI Device Driver version: [[:print:]]* [[:print:]]*$" /***** ***** The rest of this catlog was generated automatically from ***** ipr_error_table[]. *****/ message: ipr_hcam_err "FFF9: Device sector reassign successful\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): FFF9: Device sector reassign successful$" description {{ Device sector reassign successful. }} action {{ None required }} class: software type: info refcode: "" message: ipr_hcam_err "FFF7: Media error recovered by device rewrite procedures\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): FFF7: Media error recovered by device rewrite procedures$" description {{ Media error recovered by device rewrite procedures. }} action {{ None required }} class: unknown type: info refcode: "" message: ipr_hcam_err "7001: IOA sector reassignment successful\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): 7001: IOA sector reassignment successful$" description {{ IOA sector reassignment successful }} action {{ If three 7001 messages have occurred for the same disk drive location, then exchange the failing items in the Failing Items list one at a time. If the problem is not resolved, perform “MAP 3351†on page 104 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "FFF9: Soft media error. Sector reassignment recommended\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): FFF9: Soft media error\\. Sector reassignment recommended$" description {{ Soft media error. Sector reassignment recommended. }} action {{ None required }} class: software type: info refcode: "" message: ipr_hcam_err "FFF7: Media error recovered by IOA rewrite procedures\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): FFF7: Media error recovered by IOA rewrite procedures$" description {{ Media error recovered by IOA rewrite procedures. }} action {{ None required }} class: unknown type: info refcode: "" message: ipr_hcam_err "FF3D: Soft PCI bus error recovered by the IOA\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): FF3D: Soft PCI bus error recovered by the IOA$" description {{ Soft PCI bus error recovered by the IOA. }} action {{ If 10 FF3D messages have occurred for the same I/O Adapter physical location within a week, then exchange the failing items in the Failing Items list one at a time. }} class: hardware sl_severity: error refcode: "" message: ipr_res_err "FFF6: Device hardware error recovered by the IOA\n" regex ipr_res_err "^ipr: ([[:print:]]*): FFF6: Device hardware error recovered by the IOA$" description {{ Device hardware error recovered by the IOA. }} action {{ None required }} class: hardware type: info refcode: "" message: ipr_hcam_err "FFF6: Device hardware error recovered by the IOA\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): FFF6: Device hardware error recovered by the IOA$" description {{ Device hardware error recovered by the IOA. }} action {{ None required }} class: hardware type: info refcode: "" message: ipr_hcam_err "FFF6: Device hardware error recovered by the device\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): FFF6: Device hardware error recovered by the device$" description {{ Device hardware error recovered by the device. }} action {{ None required }} class: hardware type: info refcode: "" message: ipr_res_err "FF3D: Soft IOA error recovered by the IOA\n" regex ipr_res_err "^ipr: ([[:print:]]*): FF3D: Soft IOA error recovered by the IOA$" description {{ Soft IOA error recovered by the IOA. }} action {{ If 10 FF3D messages have occurred for the same I/O Adapter physical location within a week, then exchange the failing items in the Failing Items list one at a time. }} class: unknown sl_severity: error refcode:"" message: ipr_hcam_err "FF3D: Soft IOA error recovered by the IOA\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): FF3D: Soft IOA error recovered by the IOA$" description {{ Soft IOA error recovered by the IOA. }} action {{ If 10 FF3D messages have occurred for the same I/O Adapter physical location within a week, then exchange the failing items in the Failing Items list one at a time. }} class: unknown type: info refcode: "" message: ipr_hcam_err "FFFA: Undefined device response recovered by the IOA\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): FFFA: Undefined device response recovered by the IOA$" description {{ Undefined device response recovered by the IOA. }} action {{ If 10 FFFA messages have occurred for the same disk drive location in a one-week time period, then exchange the failing items in the Failing Items list one at a time. If the problem is not resolved, perform “MAP 3351†on page 104 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "FFF6: Failure prediction threshold exceeded\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): FFF6: Failure prediction threshold exceeded$" description {{ Failure prediction threshold exceeded. }} action {{ Exchange the failing items in the Failing Items list one at a time. If the problem is not resolved, perform “MAP 3351†on page 104 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown type: info refcode: "" message: ipr_hcam_err "8009: Impending cache battery pack failure\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): 8009: Impending cache battery pack failure$" description {{ Impending cache battery pack failure. }} action {{ Perform “MAP 3300†on page 90 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: hardware sl_severity: error refcode: "" message: ipr_hcam_err "3020: Storage subsystem configuration error\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): 3020: Storage subsystem configuration error$" description {{ Storage subsystem configuration error. }} action {{ Perform “MAP 3350†on page 101 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: software sl_severity: error refcode: "" message: ipr_hcam_err "FFF3: Disk media format bad\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): FFF3: Disk media format bad$" description {{ Disk media format bad. }} action {{ Perform “MAP 3335†on page 97 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: hardware sl_severity: error refcode: "" message: ipr_hcam_err "3002: Addressed device failed to respond to selection\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): 3002: Addressed device failed to respond to selection$" description {{ Addressed device failed to respond to selection. }} action {{ Exchange the failing items in the Failing Items list one at a time. If the problem is not resolved, perform “MAP 3351†on page 104 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: hardware sl_severity: error refcode: "" message: ipr_res_err "3100: Device bus error\n" regex ipr_res_err "^ipr: ([[:print:]]*): 3100: Device bus error$" description {{ Device bus error. }} action {{ A SAS fabric error occurred. Perform “MAP 3350†on page 101 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: hardware sl_severity: error refcode: "" message: ipr_hcam_err "3100: Device bus error\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): 3100: Device bus error$" description {{ Device bus error. }} action {{ A SAS fabric error occurred. Perform “MAP 3350†on page 101 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: hardware sl_severity: error refcode: "" message: ipr_hcam_err "3109: IOA timed out a device command\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): 3109: IOA timed out a device command$" description {{ IOA timed out a device command. }} action {{ Perform “MAP 3350†on page 101 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "4100: Hard device bus fabric error\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): 4100: Hard device bus fabric error$" description {{ Hard device bus fabric error. }} action {{ Perform “MAP 3352†on page 105 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "9000: IOA reserved area data check\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): 9000: IOA reserved area data check$" description {{ IOA reserved area data check. }} action {{ Perform “MAP 3390†on page 106 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: software type: info refcode: "" message: ipr_hcam_err "9001: IOA reserved area invalid data pattern\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): 9001: IOA reserved area invalid data pattern$" description {{ IOA reserved area invalid data pattern. }} action {{ Perform “MAP 3337†on page 98 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "9002: IOA reserved area LRC error\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): 9002: IOA reserved area LRC error$" description {{ IOA reserved area LRC error. }} action {{ Perform “MAP 3390†on page 106 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "102E: Out of alternate sectors for disk storage\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): 102E: Out of alternate sectors for disk storage$" description {{ Out of alternate sectors for disk storage. }} action {{ Exchange the failing items in the Failing Items list one at a time. If the problem is not resolved, perform MAP 3351 on page 104 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: error refcode: "" message: ipr_res_err "FFF4: Data transfer underlength error\n" regex ipr_res_err "^ipr: ([[:print:]]*): FFF4: Data transfer underlength error$" description {{ Data transfer underlength error. }} action{{ Exchange the failing items in the Failing Items list one at a time. If the problem is not resolved, perform “MAP 3351†on page 104 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "FFF4: Data transfer underlength error\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): FFF4: Data transfer underlength error$" description {{ Data transfer underlength error. }} action {{ Exchange the failing items in the Failing Items list one at a time. If the problem is not resolved, perform “MAP 3351†on page 104 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: error refcode: "" message: ipr_res_err "FFF4: Data transfer overlength error\n" regex ipr_res_err "^ipr: ([[:print:]]*): FFF4: Data transfer overlength error$" description {{ Data transfer overlength error. }} action {{ Exchange the failing items in the Failing Items list one at a time. If the problem is not resolved, perform “MAP 3351†on page 104 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: software sl_severity: error refcode: "" message: ipr_hcam_err "FFF4: Data transfer overlength error\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): FFF4: Data transfer overlength error$" description {{ Data transfer overlength error. }} action {{ Exchange the failing items in the Failing Items list one at a time. If the problem is not resolved, perform “MAP 3351†on page 104 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "3400: Logical unit failure\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): 3400: Logical unit failure$" description {{ Device, I/O Adapter, Any device on I/O bus, Signal cables. }} action {{ Exchange the failing items in the Failing Items list one at a time. }} class: hardware sl_severity: error refcode: "" message: ipr_hcam_err "FFF4: Device microcode is corrupt\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): FFF4: Device microcode is corrupt$" description {{ Device microcode is corrupt. }} action {{ Exchange the failing items in the Failing Items list one at a time. If the problem is not resolved, perform “MAP 3351†on page 104 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: error refcode: "" message: ipr_res_err "8150: PCI bus error\n" regex ipr_res_err "^ipr: ([[:print:]]*): 8150: PCI bus error$" description {{ PCI bus error. }} action {{ If two errors have occurred for the same I/O adapter in 24 hours, exchange the failing items in the Failing Items list one at a time. }} class: hardware sl_severity: error refcode: "" message: ipr_hcam_err "8150: PCI bus error\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): 8150: PCI bus error$" description {{ PCI bus error. }} action {{ If two errors have occurred for the same I/O adapter in 24 hours, exchange the failing items in the Failing Items list one at a time. }} class: hardware sl_severity: error refcode: "" message: ipr_res_err "FFF4: Disk device problem\n" regex ipr_res_err "^ipr: ([[:print:]]*): FFF4: Disk device problem$" description {{ Disk device problem. }} action {{ Exchange the failing items in the Failing Items list one at a time. If the problem is not resolved, perform “MAP 3351†on page 104 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: hardware sl_severity: error refcode: "" message: ipr_hcam_err "FFF4: Disk device problem\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): FFF4: Disk device problem$" description {{ Disk device problem. }} action {{ Exchange the failing items in the Failing Items list one at a time. If the problem is not resolved, perform “MAP 3351†on page 104 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: hardware sl_severity: error refcode: "" message: ipr_res_err "8150: Permanent IOA failure\n" regex ipr_res_err "^ipr: ([[:print:]]*): 8150: Permanent IOA failure$" description {{ Permanent IOA failure. }} action {{ Exchange the failing items in the Failing Items list one at a time. }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "8150: Permanent IOA failure\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): 8150: Permanent IOA failure$" description {{ Permanent IOA failure. }} action {{ Exchange the failing items in the Failing Items list one at a time. }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "3010: Disk device returned wrong response to IOA\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): 3010: Disk device returned wrong response to IOA$" description {{ Disk device returned wrong response to IOA. }} action {{ Exchange the failing items in the Failing Items list one at a time. If the problem is not resolved, perform “MAP 3351†on page 104 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "8151: IOA microcode error\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): 8151: IOA microcode error$" description {{ IOA microcode error. }} action {{ Update adapter microcode. See “Updating the controller microcode†on page 63 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf If the problem is not resolved, exchange the failing items in the Failing Items list one at a time. }} class: unknown sl_severity: error refcode:"" message: ipr_hcam_err "8157: IOA error requiring IOA reset to recover\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): 8157: IOA error requiring IOA reset to recover$" description {{ IOA error requiring IOA reset to recover. }} action {{ If two 8157 messages have occurred for the same I/O adapter location, exchange the failing items in the Failing Items list one at a time. }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "8008: A permanent cache battery pack failure occurred\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): 8008: A permanent cache battery pack failure occurred$" description {{ A permanent cache battery pack failure occurred. }} action {{ Perform “MAP 3300†on page 90 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: hardware sl_severity: error refcode: "" message: ipr_hcam_err "9090: Disk unit has been modified after the last known status\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): 9090: Disk unit has been modified after the last known status$" description {{ Disk unit has been modified after the last known status. }} action {{ Perform “MAP 3333†on page 95 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: hardware sl_severity: warning refcode: "" message: ipr_hcam_err "9081: IOA detected device error\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): 9081: IOA detected device error$" description {{ IOA detected device error. }} action {{ Exchange the failing items in the Failing Items list one at a time. }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "9082: IOA detected device error\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): 9082: IOA detected device error$" description {{ IOA detected device error. }} action {{ Exchange the failing items in the Failing Items list one at a time. }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "9091: Incorrect hardware configuration change has been detected\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): 9091: Incorrect hardware configuration change has been detected$" description {{ Incorrect hardware configuration change has been detected. }} action {{ Perform “MAP 3333†on page 95 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: hardware sl_severity: error refcode: "" message: ipr_hcam_err "4010: Incorrect connection between cascaded expanders\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): 4010: Incorrect connection between cascaded expanders$" description {{ Incorrect connection between cascaded expanders. }} action {{ Perform “MAP 3342†on page 99 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: hardware sl_severity: error refcode: "" message: ipr_hcam_err "4020: Connections exceed IOA design limits\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): 4020: Connections exceed IOA design limits$" description {{ Connections exceed IOA design limits. }} action {{ Perform “MAP 3343†on page 99 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "4030: Incorrect multipath connection\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): 4030: Incorrect multipath connection$" description {{ Incorrect multipath connection. }} action {{ Perform “MAP 3344†on page 100 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: hardware sl_severity: error refcode: "" message: ipr_hcam_err "4110: Unsupported enclosure function\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): 4110: Unsupported enclosure function$" description {{ Unsupported enclosure function. }} action {{ Perform “MAP 3345†on page 100 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "FFF4: Command to logical unit failed\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): FFF4: Command to logical unit failed$" description {{ Command to logical unit failed. }} action {{ Exchange the failing items in the Failing Items list one at a time. If the problem is not resolved, perform “MAP 3351†on page 104 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "9031: Array protection temporarily suspended, protection resuming\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): 9031: Array protection temporarily suspended, protection resuming$" description {{ Array protection temporarily suspended, protection resuming. }} action {{ Perform “MAP 3310†on page 91 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown type: info refcode: "" message: ipr_hcam_err "9040: Array protection temporarily suspended, protection resuming\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): 9040: Array protection temporarily suspended, protection resuming$" description {{ Array protection temporarily suspended, protection resuming. }} action {{ No action required. The array is synching. Wait until the synch is complete. }} class: unknown type: info refcode: "" message: ipr_hcam_err "3020: IOA detected a SCSI bus configuration error\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): 3020: IOA detected a SCSI bus configuration error$" description {{ IOA detected a SCSI bus configuration error. }} action {{ Perform “MAP 3350†on page 101 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "4040: Incomplete multipath connection between IOA and enclosure\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): 4040: Incomplete multipath connection between IOA and enclosure$" description {{ Incomplete multipath connection between IOA and enclosure. }} action {{ Perform “MAP 3344†on page 100 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "4041: Incomplete multipath connection between enclosure and device\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): 4041: Incomplete multipath connection between enclosure and device$" description {{ Incomplete multipath connection between enclosure and device. }} action {{ Perform “MAP 3346†on page 100 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "9075: Incomplete multipath connection between IOA and remote IOA\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): 9075: Incomplete multipath connection between IOA and remote IOA$" description {{ Incomplete multipath connection between IOA and remote IOA. }} action {{ Perform “MAP 3349†on page 101 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "4050: Enclosure does not support a required multipath function\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): 4050: Enclosure does not support a required multipath function$" description {{ Enclosure does not support a required multipath function. }} action {{ Perform “MAP 3348†on page 101 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "9041: Array protection temporarily suspended\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): 9041: Array protection temporarily suspended$" description {{ Array protection temporarily suspended. }} action {{ Background array parity checking detected and errors corrected. Perform “MAP 3390†on page 106 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: warning refcode: "" message: ipr_hcam_err "9042: Corrupt array parity detected on specified device\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): 9042: Corrupt array parity detected on specified device$" description {{ Corrupt array parity detected on specified device. }} action {{ Perform “MAP 3390†on page 106 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "9030: Array no longer protected due to missing or failed disk unit\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): 9030: Array no longer protected due to missing or failed disk unit$" description {{ Array no longer protected due to missing or failed disk unit. }} action {{ Perform “MAP 3310†on page 91 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "9032: Array exposed but still protected\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): 9032: Array exposed but still protected$" description {{ Array exposed but still protected. }} action {{ Perform “MAP 3310†on page 91 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "4061: Multipath redundancy level got better\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): 4061: Multipath redundancy level got better$" description {{ Multipath redundancy level got better. }} action {{ None required }} class: unknown type: info refcode: "" message: ipr_hcam_err "4060: Multipath redundancy level got worse\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): 4060: Multipath redundancy level got worse$" description {{ Multipath redundancy level got worse. }} action {{ Perform “MAP 3353†on page 106 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "9008: IOA does not support functions expected by devices\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): 9008: IOA does not support functions expected by devices$" description {{ IOA does not support functions expected by devices. }} action {{ Perform “MAP 3330†on page 94 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: warning refcode: "" message: ipr_hcam_err "9020: Array missing 2 or more devices with only 1 device present\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): 9020: Array missing 2 or more devices with only 1 device present$" description {{ Array missing 2 or more devices with only 1 device present. }} action {{ Perform “MAP 3311†on page 92 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: hardware sl_severity: error refcode: "" message: ipr_hcam_err "9021: Array missing 2 or more devices with 2 or more devices present\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): 9021: Array missing 2 or more devices with 2 or more devices present$" description {{ Array missing 2 or more devices with 2 or more devices present. }} action {{ Perform “MAP 3311†on page 92 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: hardware sl_severity: error refcode: "" message: ipr_hcam_err "9022: Exposed array is missing a required device\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): 9022: Exposed array is missing a required device$" description {{ Exposed array is missing a required device. }} action {{ Perform “MAP 3311†on page 92 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: hardware sl_severity: error refcode: "" message: ipr_hcam_err "9023: Array member(s) not at required physical locations\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): 9023: Array member\\(s\\) not at required physical locations$" description {{ Array member(s) not at required physical locations. }} action {{ Perform “MAP 3312†on page 93 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: hardware sl_severity: error refcode: "" message: ipr_hcam_err "9024: Array not functional due to present hardware configuration\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): 9024: Array not functional due to present hardware configuration$" description {{ Array not functional due to present hardware configuration. }} action {{ Perform “MAP 3390†on page 106 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: hardware sl_severity: error refcode: "" message: ipr_hcam_err "9054: IOA resources not available due to previous problems\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): 9054: IOA resources not available due to previous problems$" description {{ IOA resources not available due to previous problems. }} action {{ Perform “MAP 3321†on page 94 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "9092: Disk unit requires initialization before use\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): 9092: Disk unit requires initialization before use$" description {{ Disk unit requires initialization before use. }} action {{ Perform “MAP 3334†on page 96 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: unknown sl_severity: error refcode: "" message: ipr_hcam_err "9029: Incorrect hardware configuration change has been detected\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): 9029: Incorrect hardware configuration change has been detected$" description {{ Incorrect hardware configuration change has been detected. }} action {{ Perform “MAP 3390†on page 106 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: hardware sl_severity: error refcode: "" message: ipr_hcam_err "9060: One or more disk pairs are missing from an array\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): 9060: One or more disk pairs are missing from an array$" description {{ One or more disk pairs are missing from an array. }} action {{ Perform “MAP 3311†on page 92 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: hardware sl_severity: error refcode: "" message: ipr_hcam_err "9061: One or more disks are missing from an array\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): 9061: One or more disks are missing from an array$" description {{ One or more disks are missing from an array. }} action {{ Perform “MAP 3311†on page 92 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: hardware sl_severity: error refcode: "" message: ipr_hcam_err "9062: One or more disks are missing from an array\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): 9062: One or more disks are missing from an array$" description {{ One or more disks are missing from an array. }} action {{ Perform “MAP 3311†on page 92 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: hardware sl_severity: error refcode: "" message: ipr_hcam_err "9063: Maximum number of functional arrays has been exceeded\n" regex ipr_hcam_err "^ipr: ([[:print:]]*): 9063: Maximum number of functional arrays has been exceeded$" description {{ Maximum number of functional arrays has been exceeded. }} action {{ Perform “MAP 3390†on page 106 of the SAS Reference Guide - http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/topic/p7ebk/p7ebk.pdf }} class: hardware sl_severity: error refcode: "" ppc64-diag-2.7.4/ela/message_catalog/with_regex/ixgb0000644000000000000000000004127113135275400017156 00000000000000subsystem: net file: "drivers/net/ixgb/ixgb_main.c" message[chatter]: netif_info "Intel(R) PRO/10GbE Network Connection\n" regex netdev_info3 "^([[:print:]]*) ([[:print:]]*): ([[:print:]]*): Intel\\(R\\) PRO/10GbE Network Connection$" regex netdev_info1 "^([[:print:]]*): Intel\\(R\\) PRO/10GbE Network Connection$" regex netdev_info0 "^\\(NULL net_device\\): Intel\\(R\\) PRO/10GbE Network Connection$" message[defensive]: netif_err "Unable to allocate interrupt Error: %d\n" regex netdev_err3 "^([[:print:]]*) ([[:print:]]*): ([[:print:]]*): Unable to allocate interrupt Error: ([-]\?[0-9]{1,})$" regex netdev_err1 "^([[:print:]]*): Unable to allocate interrupt Error: ([-]\?[0-9]{1,})$" regex netdev_err0 "^\\(NULL net_device\\): Unable to allocate interrupt Error: [-]\?[0-9]{1,}$" message[defensive]: netif_err "ixgb_init_hw failed\n" regex netdev_err3 "^([[:print:]]*) ([[:print:]]*): ([[:print:]]*): ixgb_init_hw failed$" regex netdev_err1 "^([[:print:]]*): ixgb_init_hw failed$" regex netdev_err0 "^\\(NULL net_device\\): ixgb_init_hw failed$" message[defensive]: netif_err "The EEPROM Checksum Is Not Valid\n" regex netdev_err3 "^([[:print:]]*) ([[:print:]]*): ([[:print:]]*): The EEPROM Checksum Is Not Valid$" regex netdev_err1 "^([[:print:]]*): The EEPROM Checksum Is Not Valid$" regex netdev_err0 "^\\(NULL net_device\\): The EEPROM Checksum Is Not Valid$" message[defensive]: netif_err "Invalid MAC Address\n" regex netdev_err3 "^([[:print:]]*) ([[:print:]]*): ([[:print:]]*): Invalid MAC Address$" regex netdev_err1 "^([[:print:]]*): Invalid MAC Address$" regex netdev_err0 "^\\(NULL net_device\\): Invalid MAC Address$" message[defensive]: netif_err "unsupported device id\n" regex netdev_err3 "^([[:print:]]*) ([[:print:]]*): ([[:print:]]*): unsupported device id$" regex netdev_err1 "^([[:print:]]*): unsupported device id$" regex netdev_err0 "^\\(NULL net_device\\): unsupported device id$" message[defensive]: netif_err "Unable to allocate transmit descriptor ring memory\n" regex netdev_err3 "^([[:print:]]*) ([[:print:]]*): ([[:print:]]*): Unable to allocate transmit descriptor ring memory$" regex netdev_err1 "^([[:print:]]*): Unable to allocate transmit descriptor ring memory$" regex netdev_err0 "^\\(NULL net_device\\): Unable to allocate transmit descriptor ring memory$" message[defensive]: netif_err "Unable to allocate transmit descriptor memory\n" regex netdev_err3 "^([[:print:]]*) ([[:print:]]*): ([[:print:]]*): Unable to allocate transmit descriptor memory$" regex netdev_err1 "^([[:print:]]*): Unable to allocate transmit descriptor memory$" regex netdev_err0 "^\\(NULL net_device\\): Unable to allocate transmit descriptor memory$" message[defensive]: netif_err "Unable to allocate receive descriptor ring\n" regex netdev_err3 "^([[:print:]]*) ([[:print:]]*): ([[:print:]]*): Unable to allocate receive descriptor ring$" regex netdev_err1 "^([[:print:]]*): Unable to allocate receive descriptor ring$" regex netdev_err0 "^\\(NULL net_device\\): Unable to allocate receive descriptor ring$" message[defensive]: netif_err "Unable to allocate receive descriptors\n" regex netdev_err3 "^([[:print:]]*) ([[:print:]]*): ([[:print:]]*): Unable to allocate receive descriptors$" regex netdev_err1 "^([[:print:]]*): Unable to allocate receive descriptors$" regex netdev_err0 "^\\(NULL net_device\\): Unable to allocate receive descriptors$" message[defensive]: netif_err "Invalid MTU setting %d\n" regex netdev_err3 "^([[:print:]]*) ([[:print:]]*): ([[:print:]]*): Invalid MTU setting ([-]\?[0-9]{1,})$" regex netdev_err1 "^([[:print:]]*): Invalid MTU setting ([-]\?[0-9]{1,})$" regex netdev_err0 "^\\(NULL net_device\\): Invalid MTU setting [-]\?[0-9]{1,}$" message[defensive]: netif_err "Cannot re-enable PCI device after reset\n" regex netdev_err3 "^([[:print:]]*) ([[:print:]]*): ([[:print:]]*): Cannot re-enable PCI device after reset$" regex netdev_err1 "^([[:print:]]*): Cannot re-enable PCI device after reset$" regex netdev_err0 "^\\(NULL net_device\\): Cannot re-enable PCI device after reset$" message[defensive]: netif_err "After reset, the EEPROM checksum is not valid\n" regex netdev_err3 "^([[:print:]]*) ([[:print:]]*): ([[:print:]]*): After reset, the EEPROM checksum is not valid$" regex netdev_err1 "^([[:print:]]*): After reset, the EEPROM checksum is not valid$" regex netdev_err0 "^\\(NULL net_device\\): After reset, the EEPROM checksum is not valid$" message[defensive]: netif_err "After reset, invalid MAC address\n" regex netdev_err3 "^([[:print:]]*) ([[:print:]]*): ([[:print:]]*): After reset, invalid MAC address$" regex netdev_err1 "^([[:print:]]*): After reset, invalid MAC address$" regex netdev_err0 "^\\(NULL net_device\\): After reset, invalid MAC address$" message[defensive]: dev_err "TX DMA map failed\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): TX DMA map failed$" message[defensive]: printk err "ixgb: No usable DMA configuration, aborting\n" regex printk "^ixgb: No usable DMA configuration, aborting$" message[chatter]: printk err "ixgb: %s NIC Link is Up 10 Gbps Full Duplex, Flow Control: %s\n" regex printk "^ixgb: [[:print:]]* NIC Link is Up 10 Gbps Full Duplex, Flow Control: [[:print:]]*$" message[chatter]: printk err "ixgb: %s NIC Link is Down\n" regex printk "^ixgb: [[:print:]]* NIC Link is Down$" file: "drivers/net/ixgb/ixgb_param.c" message[chatter]: printk err "Invalid %s specified (%i) %s\n" regex printk "^Invalid [[:print:]]* specified \\([-]\?[0-9]{1,}\\) [[:print:]]*$" message[chatter]: printk err "Warning: no configuration for board #%i\n" regex printk "^Warning: no configuration for board #[-]\?[0-9]{1,}$" message[chatter]: printk info "Using defaults for all values\n" regex printk "^Using defaults for all values$" message[chatter]: printk info "Ignoring RxFCHighThresh when no RxFC\n" regex printk "^Ignoring RxFCHighThresh when no RxFC$" message[chatter]: printk info "Ignoring RxFCLowThresh when no RxFC\n" regex printk "^Ignoring RxFCLowThresh when no RxFC$" message[chatter]: printk info "Ignoring FCReqTimeout when no RxFC\n" regex printk "^Ignoring FCReqTimeout when no RxFC$" file: "drivers/net/ixgbe/ixgbe_main.c" message[chatter]: dev_info "MAC: %d, PHY: %d, SFP+: %d, PBA No: %06x-%03x\n" regex dev_info "^([[:print:]]*) ([[:print:]]*): MAC: ([-]\?[0-9]{1,}), PHY: ([-]\?[0-9]{1,}), SFP\\+: ([-]\?[0-9]{1,}), PBA No: ([0]{0,5}[0-9a-f]{1,})-([0]{0,2}[0-9a-f]{1,})$" message[chatter]: dev_info "MAC: %d, PHY: %d, PBA No: %06x-%03x\n" regex dev_info "^([[:print:]]*) ([[:print:]]*): MAC: ([-]\?[0-9]{1,}), PHY: ([-]\?[0-9]{1,}), PBA No: ([0]{0,5}[0-9a-f]{1,})-([0]{0,2}[0-9a-f]{1,})$" message[chatter]: dev_info "Intel(R) 10 Gigabit Network Connection\n" regex dev_info "^([[:print:]]*) ([[:print:]]*): Intel\\(R\\) 10 Gigabit Network Connection$" message[chatter]: dev_warn "PCI-Express bandwidth available for this card is not sufficient for optimal performance.\n" regex dev_warn "^([[:print:]]*) ([[:print:]]*): PCI-Express bandwidth available for this card is not sufficient for optimal performance\\.$" message[chatter]: dev_warn "For optimal performance a x8 PCI-Express slot is required.\n" regex dev_warn "^([[:print:]]*) ([[:print:]]*): For optimal performance a x8 PCI-Express slot is required\\.$" message[defensive]: dev_err "master disable timed out\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): master disable timed out$" message[defensive]: dev_err "Hardware Error: %d\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): Hardware Error: ([-]\?[0-9]{1,})$" message[defensive]: dev_err "EEPROM initialization failed\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): EEPROM initialization failed$" message[defensive]: dev_err "TX DMA map failed\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): TX DMA map failed$" message[defensive]: dev_err "No usable DMA configuration, aborting\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): No usable DMA configuration, aborting$" message[defensive]: dev_err "pci_request_selected_regions failed 0x%x\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): pci_request_selected_regions failed 0x([0-9a-f]{1,})$" message[defensive]: dev_err "HW Init failed: %d\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): HW Init failed: ([-]\?[0-9]{1,})$" message[defensive]: dev_err "The EEPROM Checksum Is Not Valid\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): The EEPROM Checksum Is Not Valid$" message[defensive]: dev_err "invalid MAC address\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): invalid MAC address$" message[defensive]: dev_err "pci_cleanup_aer_uncorrect_error_status failed 0x%0x\n" regex dev_err "^([[:print:]]*) ([[:print:]]*): pci_cleanup_aer_uncorrect_error_status failed 0x([0-9a-f]{1,})$" message[defensive]: printk err "ixgbe: Cannot enable PCI device from suspend\n" regex printk "^ixgbe: Cannot enable PCI device from suspend$" message[defensive]: printk err "ixgbe: Cannot initialize interrupts for device\n" regex printk "^ixgbe: Cannot initialize interrupts for device$" message[chatter]: printk err "ixgbe: %s NIC Link is Up %s, Flow Control: %s\n" regex printk "^ixgbe: [[:print:]]* NIC Link is Up [[:print:]]*, Flow Control: [[:print:]]*$" message[chatter]: printk err "ixgbe: %s NIC Link is Down\n" regex printk "^ixgbe: [[:print:]]* NIC Link is Down$" file: "drivers/net/ixgbe/ixgbe_sriov.c" message[defensive]: printk err "Error receiving message from VF\n" regex printk "^Error receiving message from VF$" file: "drivers/net/ixgbe/ixgbe_82598.c" message[defensive]: hw_dbg "Flow control param set incorrectly\n" regex hw_dbg "^([[:print:]]*): Flow control param set incorrectly$" message[defensive]: hw_dbg "Autonegotiation did not complete.\n" regex hw_dbg "^([[:print:]]*): Autonegotiation did not complete\\.$" message[defensive]: hw_dbg "Link was indicated but link is down\n" regex hw_dbg "^([[:print:]]*): Link was indicated but link is down$" message[defensive]: hw_dbg "PCI-E Master disable polling has failed.\n" regex hw_dbg "^([[:print:]]*): PCI-E Master disable polling has failed\\.$" message[defensive]: hw_dbg "Reset polling failed to complete.\n" regex hw_dbg "^([[:print:]]*): Reset polling failed to complete\\.$" message[defensive]: hw_dbg "RAR index %d is out of range.\n" regex hw_dbg "^([[:print:]]*): RAR index ([-]\?[0-9]{1,}) is out of range\\.$" message[defensive]: hw_dbg "EEPROM read did not pass.\n" regex hw_dbg "^([[:print:]]*): EEPROM read did not pass\\.$" file: "drivers/net/ixgbe/ixgbe_82599.c" message[defensive]: hw_dbg "Autoneg did not complete.\n" regex hw_dbg "^([[:print:]]*): Autoneg did not complete\\.$" message[defensive]: hw_dbg "ixgbe_setup_mac_link_smartspeed.\n" regex hw_dbg "^([[:print:]]*): ixgbe_setup_mac_link_smartspeed\\.$" message[defensive]: hw_dbg "PCI-E Master disable polling has failed.\n" regex hw_dbg "^([[:print:]]*): PCI-E Master disable polling has failed\\.$" message[defensive]: hw_dbg "Reset polling failed to complete.\n" regex hw_dbg "^([[:print:]]*): Reset polling failed to complete\\.$" message[defensive]: hw_dbg "RAR index %d is out of range.\n" regex hw_dbg "^([[:print:]]*): RAR index ([-]\?[0-9]{1,}) is out of range\\.$" message[defensive]: hw_dbg "RAR index %d is out of range.\n" regex hw_dbg "^([[:print:]]*): RAR index ([-]\?[0-9]{1,}) is out of range\\.$" message[defensive]: hw_dbg "No space in VLVF.\n" regex hw_dbg "^([[:print:]]*): No space in VLVF\\.$" message[defensive]: hw_dbg "Flow Director previous command isn't complete, aborting table re-initialization. \n" regex hw_dbg "^([[:print:]]*): Flow Director previous command isn't complete, aborting table re-initialization\\. $" message[defensive]: hw_dbg "Flow Director Signature poll time exceeded!\n" regex hw_dbg "^([[:print:]]*): Flow Director Signature poll time exceeded!$" message[defensive]: hw_dbg "Flow Director Perfect poll time exceeded!\n" regex hw_dbg "^([[:print:]]*): Flow Director Perfect poll time exceeded!$" message[defensive]: hw_dbg "Error on l4type input\n" regex hw_dbg "^([[:print:]]*): Error on l4type input$" message[defensive]: hw_dbg "Rx unit being enabled before security path fully disabled. Continuing with init.\n" regex hw_dbg "^([[:print:]]*): Rx unit being enabled before security path fully disabled\\. Continuing with init\\.$" file: "drivers/net/ixgbe/ ixgbe_common.c" message[defensive]: hw_dbg "NVM Read Error\n" regex hw_dbg "^([[:print:]]*): NVM Read Error$" message[defensive]: hw_dbg "PCI-E Master disable polling has failed.\n" regex hw_dbg "^([[:print:]]*): PCI-E Master disable polling has failed\\.$" message[defensive]: hw_dbg "Eeprom read timed out\n" regex hw_dbg "^([[:print:]]*): Eeprom read timed out$" message[defensive]: hw_dbg "Could not acquire EEPROM grant\n" regex hw_dbg "^([[:print:]]*): Could not acquire EEPROM grant$" message[defensive]: hw_dbg "SPI EEPROM Status error\n" regex hw_dbg "^([[:print:]]*): SPI EEPROM Status error$" message[defensive]: hw_dbg "EEPROM read failed\n" regex hw_dbg "^([[:print:]]*): EEPROM read failed$" message[defensive]: hw_dbg "RAR index %d is out of range.\n" regex hw_dbg "^([[:print:]]*): RAR index ([-]\?[0-9]{1,}) is out of range\\.$" message[defensive]: hw_dbg "Overriding MAC Address in RAR[0]\n" regex hw_dbg "^([[:print:]]*): Overriding MAC Address in RAR\\[0]$" message[defensive]: hw_dbg "Clearing RAR[1-%d]\n" regex hw_dbg "^([[:print:]]*): Clearing RAR\\[1-([-]\?[0-9]{1,})]$" message[defensive]: hw_dbg "Added a secondary address to RAR[%d]\n" regex hw_dbg "^([[:print:]]*): Added a secondary address to RAR\\[([-]\?[0-9]{1,})]$" message[defensive]: hw_dbg "ixgbe_add_uc_addr Complete\n" regex hw_dbg "^([[:print:]]*): ixgbe_add_uc_addr Complete$" message[defensive]: hw_dbg "Clearing RAR[1-%d]\n" regex hw_dbg "^([[:print:]]*): Clearing RAR\\[1-([-]\?[0-9]{1,})]$" message[defensive]: hw_dbg "ixgbe_update_uc_addr_list_generic Complete\n" regex hw_dbg "^([[:print:]]*): ixgbe_update_uc_addr_list_generic Complete$" message[defensive]: hw_dbg "MC filter type param set incorrectly\n" regex hw_dbg "^([[:print:]]*): MC filter type param set incorrectly$" message[defensive]: hw_dbg "ixgbe_update_mc_addr_list_generic Complete\n" regex hw_dbg "^([[:print:]]*): ixgbe_update_mc_addr_list_generic Complete$" message[defensive]: hw_dbg "Flow control param set incorrectly\n" regex hw_dbg "^([[:print:]]*): Flow control param set incorrectly$" message[defensive]: hw_dbg "Invalid packet buffer number [%d], expected range is 0-7\n" regex hw_dbg "^([[:print:]]*): Invalid packet buffer number \\[([-]\?[0-9]{1,})], expected range is 0-7$" message[defensive]: hw_dbg "Invalid water mark configuration\n" regex hw_dbg "^([[:print:]]*): Invalid water mark configuration$" message[defensive]: hw_dbg "ixgbe_fc_rx_pause not valid in strict IEEE mode\n" regex hw_dbg "^([[:print:]]*): ixgbe_fc_rx_pause not valid in strict IEEE mode$" message[defensive]: hw_dbg "Driver can't access resource, GSSR timeout.\n" regex hw_dbg "^([[:print:]]*): Driver can't access resource, GSSR timeout\\.$" file: "drivers/net/ixgbe/ixgbe_phy.c" message[defensive]: hw_dbg "PHY address command did not complete.\n" regex hw_dbg "^([[:print:]]*): PHY address command did not complete\\.$" message[defensive]: hw_dbg "PHY read command didn't complete\n" regex hw_dbg "^([[:print:]]*): PHY read command didn't complete$" message[defensive]: hw_dbg "PHY address cmd didn't complete\n" regex hw_dbg "^([[:print:]]*): PHY address cmd didn't complete$" message[defensive]: hw_dbg "PHY address cmd didn't complete\n" regex hw_dbg "^([[:print:]]*): PHY address cmd didn't complete$" message[defensive]: hw_dbg "PHY reset did not complete.\n" regex hw_dbg "^([[:print:]]*): PHY reset did not complete\\.$" message[defensive]: hw_dbg "Bad control value\n" regex hw_dbg "^([[:print:]]*): Bad control value$" message[defensive]: hw_dbg "Bad control type\n" regex hw_dbg "^([[:print:]]*): Bad control type$" message[defensive]: hw_dbg "SFP+ module not supported\n" regex hw_dbg "^([[:print:]]*): SFP\\+ module not supported$" message[defensive]: hw_dbg "SFP+ module not supported\n" regex hw_dbg "^([[:print:]]*): SFP\\+ module not supported$" message[defensive]: hw_dbg "No matching SFP+ module found\n" regex hw_dbg "^([[:print:]]*): No matching SFP\\+ module found$" message[defensive]: hw_dbg "I2C byte read error - Retrying.\n" regex hw_dbg "^([[:print:]]*): I2C byte read error - Retrying\\.$" message[defensive]: hw_dbg "I2C byte read error.\n" regex hw_dbg "^([[:print:]]*): I2C byte read error\\.$" message[defensive]: hw_dbg "I2C byte write error - Retrying.\n" regex hw_dbg "^([[:print:]]*): I2C byte write error - Retrying\\.$" message[defensive]: hw_dbg "I2C byte write error.\n" regex hw_dbg "^([[:print:]]*): I2C byte write error\\.$" message[defensive]: hw_dbg "I2C ack was not received.\n" regex hw_dbg "^([[:print:]]*): I2C ack was not received\\.$" message[defensive]: hw_dbg "I2C data was not set to %X\n" regex hw_dbg "^([[:print:]]*): I2C data was not set to ([0-9A-F]{1,})$" message[defensive]: hw_dbg "Error - I2C data was not set to %X.\n" regex hw_dbg "^([[:print:]]*): Error - I2C data was not set to ([0-9A-F]{1,})\\.$" ppc64-diag-2.7.4/ela/message_catalog/with_regex/lpfc0000644000000000000000000051752413135275400017162 00000000000000subsystem:net message: lpfc_printf_log KERN_WARNING "Abort outstanding I/O on NPort x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Abort outstanding I/O on NPort x([0-9a-f]{1,})$" description {{ All outstanding I/Os are cleaned up on the specified remote NPort. DATA: (1) nlp_flag (2) nlp_state (3) nlp_rpi }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_WARNING "Active Mailbox cleared - mailbox timeout exiting\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Active Mailbox cleared - mailbox timeout exiting$" description {{ The mailbox timeout handler has determined that the driver is in the process of completing this mailbox command. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_ERR "Adapter failed init, mbxCmd x%x READ_SPARM mbxStatus x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Adapter failed init, mbxCmd x([0-9a-f]{1,}) READ_SPARM mbxStatus x([0-9a-f]{1,})$" description {{ Adapter initialization failed when issuing a READ_SPARM mailbox command. }} action {{ This error could indicate a hardware or firmware problem. If the problem persists, report the error to Technical Support. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Adapter failed to get Option ROM version status x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Adapter failed to get Option ROM version status x([0-9a-f]{1,})$" description {{ The driver could not read the HBA’s option ROM. }} action {{ Reset the HBA. Ensure the adapter’s firmware is current. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Adapter failed to init, chipset, status reg x%x, FW Data: A8 x%x AC x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Adapter failed to init, chipset, status reg x([0-9a-f]{1,}), FW Data: A8 x([0-9a-f]{1,}) AC x([0-9a-f]{1,})$" description {{ The adapter failed during powerup diagnostics after it was reset. }} action {{ This error could indicate a hardware or firmware problem.If the problem persists, report the error to Technical Support. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Adapter failed to init. Data: x%x x%x x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Adapter failed to init\\. Data: x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ An error occurred when processing queue related tags for an HBA in a particular slot. DATA: (1) mbxCommand (2) mbxStatus (3) hbaqno }} action {{ Software driver error. If this problem persists, report these errors to Technical Support. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Adapter failed to init, mbxCmd x%x CONFIG_PORT, mbxStatus x%x Data: x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Adapter failed to init, mbxCmd x([0-9a-f]{1,}) CONFIG_PORT, mbxStatus x([0-9a-f]{1,}) Data: x([0-9a-f]{1,})$" description {{ Adapter initialization failed when issuing a CONFIG_PORT mailbox command. DATA: (1) hbainit }} action {{ This error could indicate a hardware or firmware problem. Update the firmware. If the problem persists, report the error to Technical Support. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Adapter failed to init, mbxCmd x%x INIT_LINK, mbxStatus x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Adapter failed to init, mbxCmd x([0-9a-f]{1,}) INIT_LINK, mbxStatus x([0-9a-f]{1,})$" description {{ Adapter initialization failed when issuing an INIT_LINK mailbox command. }} action {{ This error could indicate a hardware or firmware problem. Update the firmware.If the problem persists,report the error to Technical Support. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Adapter failed to init, mbxCmd x%x READ_CONFIG, mbxStatus x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Adapter failed to init, mbxCmd x([0-9a-f]{1,}) READ_CONFIG, mbxStatus x([0-9a-f]{1,})$" description {{ Adapter initialization failed when issuing a READ_CONFIG mailbox command. }} action {{ This error could indicate a hardware or firmware problem. Update the firmware.If the problem persists,report the error to Technical Support. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Adapter failed to init, mbxCmd x%x READ_REV, mbxStatus x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Adapter failed to init, mbxCmd x([0-9a-f]{1,}) READ_REV, mbxStatus x([0-9a-f]{1,})$" description {{ Adapter initialization failed when issuing a READ_REV mailbox command. }} action {{ This error could indicate a hardware or firmware problem. Update the firmware.If the problem persists,report the error to Technical Support. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Adapter failed to init, READ_REV has missing revision information.\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Adapter failed to init, READ_REV has missing revision information\\.$" description {{ A firmware revision initialization error was detected. }} action {{ This error could indicate a hardware or firmware problem. Update the firmware.If the problem persists,report the error to Technical Support. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Adapter failed to init, timeout, status reg x%x, FW Data: A8 x%x AC x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Adapter failed to init, timeout, status reg x([0-9a-f]{1,}), FW Data: A8 x([0-9a-f]{1,}) AC x([0-9a-f]{1,})$" description {{ The adapter failed during powerup diagnostics after it was reset. }} action {{ This error could indicate a hardware or firmware problem.If the problem persists, report the error to Technical Support. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Adapter failed to issue ASYNCEVT_ENABLE mbox status x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Adapter failed to issue ASYNCEVT_ENABLE mbox status x([0-9a-f]{1,})$" description {{ The mailbox command to enable an asynchronous event notification failed. }} action {{ Ensure the adapter firmware is current. Reload the driver. }} class: firmware sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Adapter failed to issue DOWN_LINK mbox command rc 0x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Adapter failed to issue DOWN_LINK mbox command rc 0x([0-9a-f]{1,})$" description {{ The driver was unable to issue the Down Link Mailbox command. }} action {{ None required }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Adapter Hardware Error Data: x%x x%x x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Adapter Hardware Error Data: x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ The driver received an interrupt indicating a possible hardware problem. Data: (1) status (2) status1 (3) status2 }} action {{ This error could indicate a hardware or firmware problem. If the problem persists, report the error to Technical Support. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Adapter heartbeat failure, taking this port offline.\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Adapter heartbeat failure, taking this port offline\\.$" description {{ The Heartbeat mailbox command failed. }} action {{ Ensure the adapter firmware is current. Reload the driver. }} class: firmware sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Adapter is very hot, please take corrective action. temperature : %d Celsius\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Adapter is very hot, please take corrective action\\. temperature : ([-]\?[0-9]{1,}) Celsius$" description {{ Adapter temperature is above normal range. DATA: Temperature in Celsius }} action {{ Shutdown and remove the HBA. Contact Technical Support. }} class: hardware sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Adapter Link is disabled.\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Adapter Link is disabled\\.$" description {{ The adapterl link has been disabled. }} action {{ None required }} class: unknown sl_severity: warning refcode: "" message: lpfc_printf_log KERN_INFO "Adapter temperature is OK now. temperature : %d Celsius\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Adapter temperature is OK now\\. temperature : ([-]\?[0-9]{1,}) Celsius$" description {{ Adapter temperature has reverted to normal range. DATA: Temperature in Celsius }} action {{ No action needed, informational. }} class: hardware type: info refcode: "" message: lpfc_printf_log KERN_ERR "ADD_FCF_RECORD mailbox failed with status 0x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) ADD_FCF_RECORD mailbox failed with status 0x([0-9a-f]{1,})$" description {{ The mailbox command to add the FCF record has failed. }} action {{ None required }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "ADD_FCF_RECORD mailbox failed with status x%x add_status x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) ADD_FCF_RECORD mailbox failed with status x([0-9a-f]{1,}) add_status x([0-9a-f]{1,})$" description {{ The mailbox command to add the FCF record has failed. }} action {{ None required }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Bad hbq tag. Data: x%x x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Bad hbq tag\\. Data: x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ An error occurred when processing queue related tags for an HBA in a particular slot. DATA: (1) tag (2) buffer_count }} action {{ Software driver error. If this problem persists, report these errors to Technical Support. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_WARNING "Block sgl registration required DMA size (%d) great than a page\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Block sgl registration required DMA size \\(([-]\?[0-9]{1,})\\) great than a page$" description {{ The request to post SGL pages does not fit on a page. }} action {{ No action needed, informational. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_INFO "Bring Adapter offline\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Bring Adapter offline$" description {{ The FC driver has received a request to bring the adapter offline. This may occur when running lputil. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_INFO "Bring Adapter online\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Bring Adapter online$" description {{ The FC driver has received a request to bring the adapter online. This may occur when running lputil. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_ERR "Cannot find virtual addr for buffer tag on ring %d Data x%lx x%p x%p x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Cannot find virtual addr for buffer tag on ring ([-]\?[0-9]{1,}) Data x([0-9a-f]{1,}) x(\\(null\\)|([0]{0,7}[0-9a-f]{1,})) x(\\(null\\)|([0]{0,7}[0-9a-f]{1,})) x([0-9a-f]{1,})$" description {{ DMA buffer is not available for this unsolicited command. DATA: (1) tag (2) next (3) prev (4) postbufq_cnt }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Cannot find virtual addr for mapped buf on ring %d Data x%llx x%p x%p x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Cannot find virtual addr for mapped buf on ring ([-]\?[0-9]{1,}) Data x([0-9a-f]{1,}) x(\\(null\\)|([0]{0,7}[0-9a-f]{1,})) x(\\(null\\)|([0]{0,7}[0-9a-f]{1,})) x([0-9a-f]{1,})$" description {{ The driver cannot find the specified buffer in its mapping table. Thus it cannot find the virtual address needed to access the data. DATA: (1) phys (2) next (3) prev (4) postbufq_cnt }} action {{ This error could indicate a software driver or firmware problem. If the problem persists report these errors to Technical Support. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Cannot re-enable interrupt after slot reset.\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Cannot re-enable interrupt after slot reset\\.$" description {{ The driver was not able to enable the interrupt after an HBA reset. }} action {{ Unload and reload the driver. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Clear Virtual Link Received for VPI 0x%x tag 0x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Clear Virtual Link Received for VPI 0x([0-9a-f]{1,}) tag 0x([0-9a-f]{1,})$" description {{ A Clear virtual link was received from the Fabric for this VPI. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_WARNING "Config MSI mailbox command failed, mbxCmd x%x, mbxStatus x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Config MSI mailbox command failed, mbxCmd x([0-9a-f]{1,}), mbxStatus x([0-9a-f]{1,})$" description {{ The mailbox command sent to the firmware to configure the HBA to use MSI-X has failed. }} action {{ Ensure the hardware platform supports MSI-X. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Config Port initialization error, mbxCmd x%x READ_NVPARM, mbxStatus x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Config Port initialization error, mbxCmd x([0-9a-f]{1,}) READ_NVPARM, mbxStatus x([0-9a-f]{1,})$" description {{ A read nvparams mailbox command failed during port configuration. }} action {{ This error could indicate a software driver, firmware or hardware problem. Report these errors to Technical Support. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Config region 23 has bad signature\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Config region 23 has bad signature$" description {{ Configuration region 23 has an invalid signature. }} action {{ None required. }} class: unknown sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Config region 23 has bad version\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Config region 23 has bad version$" description {{ The driver was unable to read Config Region 23 because it is an invalid version. }} action {{ None required. }} class: unknown sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Could not manually add FCF record 0, status %d\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Could not manually add FCF record 0, status ([-]\?[0-9]{1,})$" description {{ Could not add FCF record to the FCF list. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "CQ_CREATE mailbox failed with status x%x add_status x%x, mbx status x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) CQ_CREATE mailbox failed with status x([0-9a-f]{1,}) add_status x([0-9a-f]{1,}), mbx status x([0-9a-f]{1,})$" description {{ The mailbox command sent to create the completion queue has failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "CQ_DESTROY mailbox failed with status x%x add_status x%x, mbx status x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) CQ_DESTROY mailbox failed with status x([0-9a-f]{1,}) add_status x([0-9a-f]{1,}), mbx status x([0-9a-f]{1,})$" description {{ The mailbox command sent to delete the completion queue has failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Create VPORT failed: Cannot get instance number\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Create VPORT failed: Cannot get instance number$" description {{ The driver failed to allocate resources for an adapter and could not assign an instance number. }} action {{ Software driver error. If this problem persists, report these errors to Technical Support. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Create VPORT failed: Max VPORTs (%d) exceeded\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Create VPORT failed: Max VPORTs \\(([-]\?[0-9]{1,})\\) exceeded$" description {{ The driver failed to create a port because the maximum number of port supported by the driver will be exceeded. DATA: (1) max_vpi }} action {{ No Action. The driver can not create any more VPorts. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Create VPORT failed: NPIV is not enabled: SLImode:%d\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Create VPORT failed: NPIV is not enabled: SLImode:([-]\?[0-9]{1,})$" description {{ The driver failed to create a port because the HBA was in wrong mode or was not capable of NPIV. DATA: (1) sli_rev }} action {{ Load the driver with npiv enabled on an HBA that supports SLI-3. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Create VPORT failed: vpi x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Create VPORT failed: vpi x([0-9a-f]{1,})$" description {{ The driver failed to create a port and had to eliminate all its resources. DATA: (1) vpi }} action {{ Software driver error. If this problem persists, report these errors to Technical Support. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "CT command failed to delete objects on fabric\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) CT command failed to delete objects on fabric$" description {{ A command issued to the fabric to delete an associated resource for an object such as for a port, failed. }} action {{ Software driver error. If this problem persists, report these errors to Technical Support. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Deferred Adapter Hardware Error Data: x%x x%x x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Deferred Adapter Hardware Error Data: x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ An adapter hardware error was sent to the driver. DATA: (1) work_hs, (2) work_status[0], (3) work_status[1] }} action {{ Perform a dump using hbacmd. }} class: hardware sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "DEL FCF of default FCF Index failed mbx status x%x, status x%x add_status x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) DEL FCF of default FCF Index failed mbx status x([0-9a-f]{1,}), status x([0-9a-f]{1,}) add_status x([0-9a-f]{1,})$" description {{ The mailbox command to delete the FCF record has failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Dropped frame rctl:%s type:%s\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Dropped frame rctl:([[:print:]]*) type:([[:print:]]*)$" description {{ An unsupported frame was received by the port and dropped. DATA: (1) rctl_names[fc_hdr->fh_r_ctl], (2) type_names[fc_hdr->fh_type] }} action {{ None required. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_INFO "ELS complete with no corresponding cmdiocb: iotag (%d)\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) ELS complete with no corresponding cmdiocb: iotag \\(([-]\?[0-9]{1,})\\)$" description {{ The completion that the ISR is handling cannot find a tag associated with the IOTAG }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_ERR "EQ_CREATE mailbox failed with status x%x add_status x%x, mbx status x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) EQ_CREATE mailbox failed with status x([0-9a-f]{1,}) add_status x([0-9a-f]{1,}), mbx status x([0-9a-f]{1,})$" description {{ The mailbox command sent to create the event queue has failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "EQ_DESTROY mailbox failed with status x%x add_status x%x, mbx status x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) EQ_DESTROY mailbox failed with status x([0-9a-f]{1,}) add_status x([0-9a-f]{1,}), mbx status x([0-9a-f]{1,})$" description {{ The mailbox command sent to delete the event queue has failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Error Could not grow rpi count\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Error Could not grow rpi count$" description {{ An error occurred because the RPI count could not be increased. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Error %d during queue setup.\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Error ([-]\?[0-9]{1,}) during queue setup\\.$" description {{ Could not set up all the queues that driver requires to exchange IOs with the HBA. }} action {{ Reload the driver. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Error %d during rpi post operation\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Error ([-]\?[0-9]{1,}) during rpi post operation$" description {{ The driver was trying to post pages to the firmware to keep target login information and encountered a failure. }} action {{ Unload and reload the driver. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_WARNING "Error %d during scsi sgl post operation\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Error ([-]\?[0-9]{1,}) during scsi sgl post operation$" description {{ The SGL entries could not be registered with the HBA. }} action {{ Reset the HBA using hbacmd. }} class: hardware sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Error %d during sgl post operation\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Error ([-]\?[0-9]{1,}) during sgl post operation$" description {{ The SGL post operation failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Error %d parsing vpd. Using defaults.\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Error ([-]\?[0-9]{1,}) parsing vpd\\. Using defaults\\.$" description {{ Could not parse the VPD data, so the driver is using the default values. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Error %d posting all rpi headers\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Error ([-]\?[0-9]{1,}) posting all rpi headers$" description {{ The RPI headers could not be posted to the firmware. }} action {{ None required. }} class: firmware sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Error during rpi post operation\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Error during rpi post operation$" description {{ The driver was trying to post pages to the firmware to be used to keep target login information and encountered a failure. }} action {{ Unload and reload the driver. }} class: firmware sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Failed allocate fast-path FCP CQ (%d)\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Failed allocate fast-path FCP CQ \\(([-]\?[0-9]{1,})\\)$" description {{ The completion queue event for the fast path could not be allocated. }} action {{ Unload and reload the driver. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Failed allocate memory for fast-path CQ record array\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Failed allocate memory for fast-path CQ record array$" description {{ Failed to allocate memory for the fast-path EQ record array. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Failed allocate memory for fast-path EQ record array\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Failed allocate memory for fast-path EQ record array$" description {{ Failed to allocate memory for the fast-path EQ record array. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Failed allocate memory for fast-path per-EQ handle array\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Failed allocate memory for fast-path per-EQ handle array$" description {{ Failed to allocate memory for the fast-path per-EQ handle array. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Failed allocate memory for fast-path WQ record array\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Failed allocate memory for fast-path WQ record array$" description {{ Failed to allocate memory for the fast-path EQ record array. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Failed allocate memory for msi-x interrupt vector entries\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Failed allocate memory for msi-x interrupt vector entries$" description {{ The driver was unable to allocate memory during initialization of the MSI-X interrupt array. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Failed allocate slow-path ELS CQ\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Failed allocate slow-path ELS CQ$" description {{ Failed allocate slow-path ELS CQ. }} action {{ None required. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Failed allocate slow-path ELS WQ\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Failed allocate slow-path ELS WQ$" description {{ Failed to allocate slow-path ELS WQ. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Failed allocate slow-path EQ\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Failed allocate slow-path EQ$" description {{ The event queue for the slow path was not allocated. }} action {{ Unload and reload the driver. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_WARNING "Failed allocate slow-path mailbox CQ\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Failed allocate slow-path mailbox CQ$" description {{ Failed to allocate slow-path mailbox CQ. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Failed to allocate CQ_EVENT entry\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Failed to allocate CQ_EVENT entry$" description {{ The asynchronous event handler was not able to allocate an event queue entry to which to transfer the asynchronous event. }} action {{ This could be a V-LINK clear from the switch or a fatal error from the firmware. Perform a dump from the OneCommand Manager application. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Failed to allocate IOTAG.last IOTAG is %d\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Failed to allocate IOTAG\\.last IOTAG is ([-]\?[0-9]{1,})$" description {{ The driver cannot allocate an IoTag. Display the last value used. }} action {{ This message indicates the adapter HBA I/O queue is full. Typically this happens when heavy I/O is running on a low-end (3 digit) adapter. We suggest you upgrade to a higher-end adapter. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Failed to allocate mbox cmd memory\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Failed to allocate mbox cmd memory$" description {{ Mailbox allocation error. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Failed to allocate mbox for ADD_FCF cmd\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Failed to allocate mbox for ADD_FCF cmd$" description {{ Failed to allocate mailbox for ADD_FCF command. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Failed to allocate mbox for query firmware config cmd\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Failed to allocate mbox for query firmware config cmd$" description {{ Failed to allocate mailbox memory. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Failed to allocate mbox for READ_FCF cmd\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Failed to allocate mbox for READ_FCF cmd$" description {{ Failed to allocate mbox for READ_FCF command. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Failed to allocate memory for ELS XRI management array of size %d.\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Failed to allocate memory for ELS XRI management array of size ([-]\?[0-9]{1,})\\.$" description {{ Initialization failed to allocate memory for the ELS XRI management array. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Failed to allocate memory for SCSI XRI management array of size %d.\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Failed to allocate memory for SCSI XRI management array of size ([-]\?[0-9]{1,})\\.$" description {{ Initialization could not allocate memory to hold the XRIs. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Failed to allocate non-embedded SGE array.\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Failed to allocate non-embedded SGE array\\.$" description {{ Failed to allocate the non-embedded SGE array. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Failed to allocate sysfs attr\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Failed to allocate sysfs attr$" description {{ Initialization failed to sysfs attribute. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_INFO "Failed to allocate XRI.last XRITAG is %d Max XRI is %d, Used XRI is %d\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Failed to allocate XRI\\.last XRITAG is ([-]\?[0-9]{1,}) Max XRI is ([-]\?[0-9]{1,}), Used XRI is ([-]\?[0-9]{1,})$" description {{ All XRIs are in use. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_ERR "Failed to create scsi host.\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Failed to create scsi host\\.$" description {{ Initialization failed to create SCSI host. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Failed to enable interrupt.\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Failed to enable interrupt\\.$" description {{ The driver failed to start the interrupt. }} action {{ Unload and reload the driver. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Failed to enable pci device.\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Failed to enable pci device\\.$" description {{ Failed to enable PCI device during initialization. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Failed to get the non-embedded SGE virtual address\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Failed to get the non-embedded SGE virtual address$" description {{ The READ_FCF_RECORD mailbox command could not retrieve the Scatter Gather Entry that was requested. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Failed to initialize iocb list.\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Failed to initialize iocb list\\.$" description {{ Driver resource initialization failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Failed to initialize rpi headers.\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Failed to initialize rpi headers\\.$" description {{ Failed to initialize RPI headers. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Failed to initialize sgl list.\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Failed to initialize sgl list\\.$" description {{ Failed to initialize SGL list during initialization. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Failed to read FCoE parameters\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Failed to read FCoE parameters$" description {{ The driver failed to read FCoE parameters. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Failed to set up driver resource.\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Failed to set up driver resource\\.$" description {{ Driver resource initialization failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Failed to set up hba\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Failed to set up hba$" description {{ Initialization failed to set up the HBA. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Failed to set up pci memory space.\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Failed to set up pci memory space\\.$" description {{ PCI initialization failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_WARNING "Failure HBA POST Status: sta_reg=0x%x, perr=x%x, sfi=x%x, nip=x%x, ipc=x%x, xrom=x%x, dl=x%x, pstatus=x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Failure HBA POST Status: sta_reg=0x([0-9a-f]{1,}), perr=x([0-9a-f]{1,}), sfi=x([0-9a-f]{1,}), nip=x([0-9a-f]{1,}), ipc=x([0-9a-f]{1,}), xrom=x([0-9a-f]{1,}), dl=x([0-9a-f]{1,}), pstatus=x([0-9a-f]{1,})$" description {{ The HBA’s power on self test has failed. }} action {{ None required. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_INFO "Fast-path wqe consume event carries miss-matched qid: wcqe-qid=x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Fast-path wqe consume event carries miss-matched qid: wcqe-qid=x([0-9a-f]{1,})$" description {{ The consumed entry does not have the fast path’s queueID. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_ERR "FCF disconnected from network index 0x%x tag 0x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) FCF disconnected from network index 0x([0-9a-f]{1,}) tag 0x([0-9a-f]{1,})$" description {{ The FCF has disconnected from the network. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "FCF Table full count 0x%x tag 0x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) FCF Table full count 0x([0-9a-f]{1,}) tag 0x([0-9a-f]{1,})$" description {{ The FCF table is full. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "FCoE Function not supported by firmware. Function mode = %08x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) FCoE Function not supported by firmware\\. Function mode = ([0]{0,7}[0-9a-f]{1,})$" description {{ FCoE is not supported by this firmware. }} action {{ Use the OneCommand Manager application to update to the latest firmware. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_INFO "FCP cmdiocb not callback function iotag: (%d)\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) FCP cmdiocb not callback function iotag: \\(([-]\?[0-9]{1,})\\)$" description {{ The IOCB found for this iotag does not have a completion handler set in it. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_INFO "FCP complete error: status=x%x, hw_status=x%x, total_data_specified=%d, parameter=x%x, word3=x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) FCP complete error: status=x([0-9a-f]{1,}), hw_status=x([0-9a-f]{1,}), total_data_specified=([-]\?[0-9]{1,}), parameter=x([0-9a-f]{1,}), word3=x([0-9a-f]{1,})$" description {{ Logs the FCP failure. Status and parameter are equivalent to ulpStatus and ulpWord[4]. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_INFO "FCP complete with no corresponding cmdiocb: iotag (%d)\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) FCP complete with no corresponding cmdiocb: iotag \\(([-]\?[0-9]{1,})\\)$" description {{ There was no IOCB on the in-progress list that matched this iotag. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_INFO "Feature Mismatch Data: x%08x %08x x%x x%x x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Feature Mismatch Data: x([0]{0,7}[0-9a-f]{1,}) ([0]{0,7}[0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ The features passed in to the driver as module parameters do not match what the firmware can do. Setting to default values. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_INFO "Find ndlp returned NULL for oxid:x%x SID:x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Find ndlp returned NULL for oxid:x([0-9a-f]{1,}) SID:x([0-9a-f]{1,})$" description {{ Could not find the node for this DID. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_ERR "HBA not supporting SLI-3 or later SLI Revision: 0x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) HBA not supporting SLI-3 or later SLI Revision: 0x([0-9a-f]{1,})$" description {{ The HBA does not support SLI-3 or SLI-4. }} action {{ This HBA does not support msi. Set lpfc_use_msi=0. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "HBA Unrecoverable error: uerr_lo_reg=0x%x, uerr_hi_reg=0x%x, ue_mask_lo_reg=0x%x, ue_mask_hi_reg=0x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) HBA Unrecoverable error: uerr_lo_reg=0x([0-9a-f]{1,}), uerr_hi_reg=0x([0-9a-f]{1,}), ue_mask_lo_reg=0x([0-9a-f]{1,}), ue_mask_hi_reg=0x([0-9a-f]{1,})$" description {{ The HBA has notified the driver that it has encountered an unrecoverable error. }} action {{ A dump from the OneCommand Manager application should be taken. Then, the driver should be unloaded and reloaded. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "HBQ %d: local_hbqGetIdx %u is > than hbqp->entry_count %u\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) HBQ ([-]\?[0-9]{1,}): local_hbqGetIdx ([0-9]{1,}) is > than hbqp->entry_count ([0-9]{1,})$" description {{ An error occurred when processing queue related to an HBA in a particular slot. DATA: (1) hbqno (2) local_hbqGetIdx (3) entry_count }} action {{ Software driver error. If this problem persists, report these errors to Technical Support. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Ignoring ELS cmd tag x%x completion Data: x%x x%x x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Ignoring ELS cmd tag x([0-9a-f]{1,}) completion Data: x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ This ELS command was aborted. DATA: (1) ulpStatus (2) ulpWord[4] (3) ulpTimeout }} action {{ None required. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_INFO "Ignoring unsolicited CT No HBQ status = x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Ignoring unsolicited CT No HBQ status = x([0-9a-f]{1,})$" description {{ Received an unsolicited ct command without a BDE. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_INFO "Ignoring unsolicted CT HBQ Size:%d status = x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Ignoring unsolicted CT HBQ Size:([-]\?[0-9]{1,}) status = x([0-9a-f]{1,})$" description {{ Received an unsolicited ct command with an invalid size. DATA: ulpStatus }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_ERR "INIT VPI Mailbox failed status %d, mbxStatus x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) INIT VPI Mailbox failed status ([-]\?[0-9]{1,}), mbxStatus x([0-9a-f]{1,})$" description {{ The INIT VPI mailbox command has failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Invalid asynchrous event code: x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Invalid asynchrous event code: x([0-9a-f]{1,})$" description {{ The asynchronous event code that the firmware passed to the driver is invalid. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Invalid command 0x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Invalid command 0x([0-9a-f]{1,})$" description {{ The IOCB command is invalid. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Invalid completion queue type (%d)\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Invalid completion queue type \\(([-]\?[0-9]{1,})\\)$" description {{ The event queue entry is not for a mailbox or a work queue entry. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Invalid CT %x command 0x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Invalid CT ([0-9a-f]{1,}) command 0x([0-9a-f]{1,})$" description {{ Invalid Command-Type in the IOCB is not supported. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Invalid device group (x%x)\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Invalid device group \\(x([0-9a-f]{1,})\\)$" description {{ While unloading the driver, the driver detect a PCI device that it should not have claimed. }} action {{ None required. }} class: hardware sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Invalid HBA PCI-device group: 0x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Invalid HBA PCI-device group: 0x([0-9a-f]{1,})$" description {{ Invalid HBA PCI-device group detected. }} action {{ None required. }} class: hardware sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Invalid link-attention link speed: x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Invalid link-attention link speed: x([0-9a-f]{1,})$" description {{ The link speed reported in the link attention interrupt is invalid. }} action {{ Check the switch configuration. }} class: hardware sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Invalid link attention type: x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Invalid link attention type: x([0-9a-f]{1,})$" description {{ The READ_LA mailbox command has returned an invalid link type. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Invalid link fault code: x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Invalid link fault code: x([0-9a-f]{1,})$" description {{ The attempt to read the link attention register has returned an unknown value. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Invalid param:\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Invalid param:$" description {{ SLI-4: The post SGL function was passed an invalid XRI }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Invalid SLI revision (%d)\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Invalid SLI revision \\(([-]\?[0-9]{1,})\\)$" description {{ While processing a host attention or unrecoverable error, the driver detected an invalid SLI revision. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_INFO "Invalid speed for this board: Reset link speed to auto: x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Invalid speed for this board: Reset link speed to auto: x([0-9a-f]{1,})$" description {{ The driver is reinitializing the link speed to auto-detect. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_ERR "Invalid work queue CQE subtype (x%x)\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Invalid work queue CQE subtype \\(x([0-9a-f]{1,})\\)$" description {{ Invalid work queue CQE. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_INFO "IOCB wait issue failed, Data x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) IOCB wait issue failed, Data x([0-9a-f]{1,})$" description {{ The LPFC driver failed to issue an IOCB. DATA:(1) retval }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_ERR "IOCB wake NOT set, Data x%x x%lx\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) IOCB wake NOT set, Data x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ The completion handler associated with the IOCB was never called. DATA:(1) timeout (2) timeleft/jiffies }} action {{ This error could indicate a software driver, firmware or hardware problem.If the problem persists,report the error to Technical Support. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_log KERN_WARNING "IOCB wake signaled\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) IOCB wake signaled$" description {{ The IOCB completed successfully. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_ERR "IOCB x%x failed. No vport\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) IOCB x([0-9a-f]{1,}) failed\\. No vport$" description {{ An IOCB command could not be communicated because there was no VPort associated with the mailbox command. DATA: (1) ulpCommand }} action {{ Software driver error. If this problem persists, report these errors to Technical Support. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "iotag x%x is out off range: max iotag (x%x)\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) iotag x([0-9a-f]{1,}) is out off range: max iotag \\(x([0-9a-f]{1,})\\)$" description {{ The IOCB lookup cannot be performed because the iocb_tag is out of range. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "iotag x%x is out off range: max iotag x%x wd0 x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) iotag x([0-9a-f]{1,}) is out off range: max iotag x([0-9a-f]{1,}) wd0 x([0-9a-f]{1,})$" description {{ The IoTag in the completed IOCB is out of range. }} action {{ This error could indicate a software driver, firmware or hardware problem. Report these errors to Technical Support. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "LATT: Cannot issue READ_LA: Data:%d\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) LATT: Cannot issue READ_LA: Data:([-]\?[0-9]{1,})$" description {{ The link attention handler could not issue a READ_LA mailbox command. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Link Down Event x%x received Data: x%x x%x x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Link Down Event x([0-9a-f]{1,}) received Data: x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ A link down event was received. DATA: (1) fc_eventTag (2) hba_state (3) fc_flag }} action {{ If numerous link events are occurring, check the physical connections to the Fibre Channel network. }} class: hardware sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Link Up Event in loop back mode x%x received Data: x%x x%x x%x x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Link Up Event in loop back mode x([0-9a-f]{1,}) received Data: x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ Link up notification; configured for loopback. DATA: (1) fc_eventTag (2) granted_AL_PA (3) UlnkSpeed (4) alpa_map[0] }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Link Up Event npiv not supported in loop topology\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Link Up Event npiv not supported in loop topology$" description {{ NPIV is not supported in loop topology. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Loopback test did not receive expected data length. actual length 0x%x expected length 0x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Loopback test did not receive expected data length\\. actual length 0x([0-9a-f]{1,}) expected length 0x([0-9a-f]{1,})$" description {{ The loopback test did not receive the same amount of data that it transmitted. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "lpfc_create_static_vport bad information header 0x%x 0x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) lpfc_create_static_vport bad information header 0x([0-9a-f]{1,}) 0x([0-9a-f]{1,})$" description {{ Invalid information header; the signature or revision is invalid. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "lpfc_create_static_vport failed to allocate mailbox memory\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) lpfc_create_static_vport failed to allocate mailbox memory$" description {{ Failed to allocate mailbox memory for VPort creation. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "lpfc_create_static_vport failed to allocate vport_info\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) lpfc_create_static_vport failed to allocate vport_info$" description {{ Failed to allocate vport_info. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "lpfc_create_static_vport failed to create vport\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) lpfc_create_static_vport failed to create vport$" description {{ Failed to create vport }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "lpfc_create_static_vport failed to issue dump mailbox command ret 0x%x status 0x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) lpfc_create_static_vport failed to issue dump mailbox command ret 0x([0-9a-f]{1,}) status 0x([0-9a-f]{1,})$" description {{ Failed to issue a dump mailbox command for statis VPort creation. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "lpfc_dump_fcoe_param: memory allocation failed\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) lpfc_dump_fcoe_param: memory allocation failed$" description {{ Memory allocation has failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "lpfc_dump_static_vport: memory allocation failed\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) lpfc_dump_static_vport: memory allocation failed$" description {{ Failed to allocate mailbox memory. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "lpfc_sli_read_serdes_param failed to allocate mailbox memory\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) lpfc_sli_read_serdes_param failed to allocate mailbox memory$" description {{ Failed to allocate mailbox memory. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_WARNING "lpfc_soft_wwpn attribute set failed to reinit adapter - %d\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) lpfc_soft_wwpn attribute set failed to reinit adapter - ([-]\?[0-9]{1,})$" description {{ The adapter failed to restart after setting a new WWPN. }} action {{ Perform a dump using the hbacmd. }} class: hardware sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Mailbox failed , mbxCmd x%x READ_CONFIG, mbxStatus x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Mailbox failed , mbxCmd x([0-9a-f]{1,}) READ_CONFIG, mbxStatus x([0-9a-f]{1,})$" description {{ The READ_CONFIG mailbox command failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_INFO "mbox: Issued mailbox cmd 0x%x while in stopped state.\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) mbox: Issued mailbox cmd 0x([0-9a-f]{1,}) while in stopped state\\.$" description {{ Only the dump mailbox command and reset HBA mailbox command are allowed when in the stopped state. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_ERR "Mbox x%x failed, no vport\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Mbox x([0-9a-f]{1,}) failed, no vport$" description {{ The vport field of this mailbox command was not completed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Menlo Maint Mode Link up Event x%x rcvd Data: x%x x%x x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Menlo Maint Mode Link up Event x([0-9a-f]{1,}) rcvd Data: x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ The link is up in maintenance mode; only management commands are allowed. DATA: (1) fc_eventTag (2) port_state (3) vport fc_flag }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Miss-matched fast-path completion queue identifier: eqcqid=%d, fcpcqid=%d\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Miss-matched fast-path completion queue identifier: eqcqid=([-]\?[0-9]{1,}), fcpcqid=([-]\?[0-9]{1,})$" description {{ The CQID in the event queue entry does not match the fcp_cqid that was passed into the routine. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "MQ_CREATE mailbox failed with status x%x add_status x%x, mbx status x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) MQ_CREATE mailbox failed with status x([0-9a-f]{1,}) add_status x([0-9a-f]{1,}), mbx status x([0-9a-f]{1,})$" description {{ The mailbox command sent to create the mailbox queue has failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "MQ_DESTROY mailbox failed with status x%x add_status x%x, mbx status x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) MQ_DESTROY mailbox failed with status x([0-9a-f]{1,}) add_status x([0-9a-f]{1,}), mbx status x([0-9a-f]{1,})$" description {{ The mailbox command sent to delete the mailbox queue has failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_WARNING "MSI request_irq failed (%d)\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) MSI request_irq failed \\(([-]\?[0-9]{1,})\\)$" description {{ The request_irq kernel API has failed. }} action {{ Set lpfc_use_msi = 0. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_WARNING "MSI-X fast-path request_irq failed (%d)\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) MSI-X fast-path request_irq failed \\(([-]\?[0-9]{1,})\\)$" description {{ The driver received an error for the request_irq_call. }} action {{ Unload and reload the driver. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_INFO "MSI-X interrupt with no EQE\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) MSI-X interrupt with no EQE$" description {{ SLI-4 HBA interrupt on the slow path but there is no associated EQE. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_WARNING "MSI-X slow-path request_irq failed (%d)\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) MSI-X slow-path request_irq failed \\(([-]\?[0-9]{1,})\\)$" description {{ The kernel API to request an IRQ has failed. }} action {{ Use module parameter lpfc_use_msi = 0 (IntX). }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_INFO "ndlp null for oxid %x SID %x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) ndlp null for oxid ([0-9a-f]{1,}) SID ([0-9a-f]{1,})$" description {{ The Node value for this SID is not in the node list. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_INFO "New FCF found index 0x%x tag 0x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) New FCF found index 0x([0-9a-f]{1,}) tag 0x([0-9a-f]{1,})$" description {{ The driver has detected a new FCF in the SAN. DATA: (1) macqe_fcoe->fcf_index (2) acqe_fcoe->event_tag }} action {{ No action needed, informational. }} class: hardware type: info refcode: "" message: lpfc_printf_log KERN_ERR "No entry from fast-path completion queue fcpcqid=%d\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) No entry from fast-path completion queue fcpcqid=([-]\?[0-9]{1,})$" description {{ There were no completions in the completion queue referenced by fcpcqid. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "No entry from the CQ: identifier (x%x), type (%d)\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) No entry from the CQ: identifier \\(x([0-9a-f]{1,})\\), type \\(([-]\?[0-9]{1,})\\)$" description {{ There was no completion queue event for this event queue entry. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_WARNING "NOP mailbox command failed status x%x add_status x%x mbx status x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) NOP mailbox command failed status x([0-9a-f]{1,}) add_status x([0-9a-f]{1,}) mbx status x([0-9a-f]{1,})$" description {{ The NOP mailbox command failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "No room left for SCSI XRI allocation: max_xri=%d, els_xri=%d\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) No room left for SCSI XRI allocation: max_xri=([-]\?[0-9]{1,}), els_xri=([-]\?[0-9]{1,})$" description {{ The number of allocated XRIs has reached the max_xri value. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_INFO "No support for fcpi mode.\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) No support for fcpi mode\\.$" description {{ Could not configure the port to run in FCP initiator mode. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_ERR "Not a valid fast-path completion event: majorcode=x%x, minorcode=x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Not a valid fast-path completion event: majorcode=x([0-9a-f]{1,}), minorcode=x([0-9a-f]{1,})$" description {{ The major or minor code in the Event Queue field is not valid. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Not a valid slow-path completion event: majorcode=x%x, minorcode=x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Not a valid slow-path completion event: majorcode=x([0-9a-f]{1,}), minorcode=x([0-9a-f]{1,})$" description {{ SLI-4: The EQE is not valid. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Not a valid WCQE code: x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Not a valid WCQE code: x([0-9a-f]{1,})$" description {{ The completion queue handler detected an invalid type. }} action {{ None required. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Not configured for supporting MSI-X cfg_use_msi: 0x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Not configured for supporting MSI-X cfg_use_msi: 0x([0-9a-f]{1,})$" description {{ The lpfc_use_msi module parameter should have been set to 2. }} action {{ Set module parameter lpfc_use_msi = 2. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "NPIV enabled: Override lpfc_sli_mode parameter (%d) to auto (0).\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) NPIV enabled: Override lpfc_sli_mode parameter \\(([-]\?[0-9]{1,})\\) to auto \\(0\\)\\.$" description {{ The lpfc_enable_npiv and lpfc_sli_mode driver parameter settings conflict. The HBA must be configured for SLI-3 mode to support NPIV. DATA: (1) lpfc_sli_mode }} action {{ This is an informational message that indicates that the lpfc_enable_npiv and lpfc_sli_mod parameter settings are not compatible. Resolve the parameter conflict by setting the SLI mode to 0 or 3 or, if SLI-2 mode is required then disable NPIV. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Only Limited Edition cmd Format supported 0x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Only Limited Edition cmd Format supported 0x([0-9a-f]{1,})$" description {{ The SGL pages could not be unregistered from the firmware. }} action {{ None required. }} class: firmware sl_severity: warning refcode: "" message: lpfc_printf_log KERN_INFO "Outstanding IO when bringing Adapter offline\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Outstanding IO when bringing Adapter offline$" description {{ IO is still pending while attempting to stop the driver. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_INFO "PCI enable MSI mode success.\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) PCI enable MSI mode success\\.$" description {{ MSI has been enabled for the port. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_ERR "PM resume Failed to enable interrupt\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) PM resume Failed to enable interrupt$" description {{ The PCI resume (hotplug) could not get an interrupt vector. }} action {{ Unload and reload the driver. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "PM resume failed to start worker thread: error=x%x.\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) PM resume failed to start worker thread: error=x([0-9a-f]{1,})\\.$" description {{ The PCI resume (hotplug) could not start the worker thread for the driver. }} action {{ Unload and reload the driver. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "POST_RPI_HDR mailbox failed with status x%x add_status x%x, mbx status x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) POST_RPI_HDR mailbox failed with status x([0-9a-f]{1,}) add_status x([0-9a-f]{1,}), mbx status x([0-9a-f]{1,})$" description {{ The mailbox command sent to post the RPUI header pages to the firmware has failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "POST_SGL_BLOCK mailbox command failed status x%x add_status x%x mbx status x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) POST_SGL_BLOCK mailbox command failed status x([0-9a-f]{1,}) add_status x([0-9a-f]{1,}) mbx status x([0-9a-f]{1,})$" description {{ The mailbox command sent to post the SGL pages to the firmware has failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "POST_SGL mailbox failed with status x%x add_status x%x, mbx status x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) POST_SGL mailbox failed with status x([0-9a-f]{1,}) add_status x([0-9a-f]{1,}), mbx status x([0-9a-f]{1,})$" description {{ The mailbox command sent to post the SGL pages to the firmware has failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Query Firmware Config failed mbx status x%x, status x%x add_status x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Query Firmware Config failed mbx status x([0-9a-f]{1,}), status x([0-9a-f]{1,}) add_status x([0-9a-f]{1,})$" description {{ Could not read the firmware configuration. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "rc should be MBX_SUCCESS\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) rc should be MBX_SUCCESS$" description {{ The next mailbox command on the mailbox queue has failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "rc should have been MBX_BUSY\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) rc should have been MBX_BUSY$" description {{ Attempting to unregister a default RPI from an interrupt context and the mailbox state is not busy. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Read FCF record failed 0x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Read FCF record failed 0x([0-9a-f]{1,})$" description {{ Could not read the FCF record from the firmware. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "READ_FCF_RECORD Indicates empty FCF table.\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) READ_FCF_RECORD Indicates empty FCF table\\.$" description {{ The driver requested the firmware provide a list of FCF entries to connect to and the firmware responded that the FCF table is empty. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "READ_FCF_RECORD mailbox failed with status x%x add_status x%x, mbx\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) READ_FCF_RECORD mailbox failed with status x([0-9a-f]{1,}) add_status x([0-9a-f]{1,}), mbx$" description {{ The READ_FCF_RECORD mailbox command failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_WARNING "READ_LA mbox error x%x state x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) READ_LA mbox error x([0-9a-f]{1,}) state x([0-9a-f]{1,})$" description {{ The driver cannot determine what type of link event occurred. }} action {{ If numerous link events are occurring, check the physical connections to the Fibre Channel network. May indicate a possible hardware or firmware problem. }} class: hardware sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "READ_REV Error. SLI Level %d FCoE enabled %d\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) READ_REV Error\\. SLI Level ([-]\?[0-9]{1,}) FCoE enabled ([-]\?[0-9]{1,})$" description {{ This SLI-4 only HBA setup function was called for a non-SLI-4 device. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "READ_SPARAM command failed status %d, mbxStatus x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) READ_SPARAM command failed status ([-]\?[0-9]{1,}), mbxStatus x([0-9a-f]{1,})$" description {{ The READ_SPARAM mailbox command has failed during initialization. The HBA has been set to error state. }} action {{ Take a dump with hbacmd and then try reloading the driver. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_WARNING "READ_SPARAM: no buffers\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) READ_SPARAM: no buffers$" description {{ The driver attempted to issue a READ_SPARAM mailbox command to the HBA, but there were no buffers available. }} action {{ This message indicates: (1) Kernel virtual memory is depleted. Check that the system meets minimum RAM requirements for the Emulex Fibre Channel adapter. Try closing other applications to freesome memory. (2) A possible driver buffer management problem. If the problem persists, report the error to Technical Support. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Receive Frame Truncated!!\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Receive Frame Truncated!!$" description {{ The receive unsolicited handler detected a truncated frame. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_WARNING "Re-establishing Link Data: x%x x%x x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Re-establishing Link Data: x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ The driver detected a condition in which it had to re-initialize the link. DATA: (1) status (2) status1 (3) status2 }} action {{ If numerous link events are occurring, check the physical connections to the Fibre Channel network. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_WARNING "REG_LOGIN: no buffers, VPI:%d DID:x%x, flag x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) REG_LOGIN: no buffers, VPI:([-]\?[0-9]{1,}) DID:x([0-9a-f]{1,}), flag x([0-9a-f]{1,})$" description {{ The driver attempted to issue a REG_LOGIN mailbox command to the HBA, but there were no buffers available. DATA: (1) Did (2) flag }} action {{ This message indicates: (1) Kernel virtual memory is depleted. Check that the system meets minimum RAM requirements for the Emulex Fibre Channel adapter. Try closing other applications to free some memory. (2) A possible driver buffer management problem. If the problem persists, report the error to Technical Support. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "REMOVE_ALL_SGL_PAGES mailbox failed with status x%x add_status x%x, mbx status x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) REMOVE_ALL_SGL_PAGES mailbox failed with status x([0-9a-f]{1,}) add_status x([0-9a-f]{1,}), mbx status x([0-9a-f]{1,})$" description {{ The mailbox command sent to delete the SGL pages from the firmware has failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_INFO "Reset HBA Data: x%x x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Reset HBA Data: x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ An HBA has been reset. DATA: (1) hba_state (2) sli_flag }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_ERR "Resetting board due to mailbox timeout\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Resetting board due to mailbox timeout$" description {{ A mailbox command failed to complete. The driver is resetting the port. }} action {{ If the mailbox command fails again, set the lpfc_log_verbose to LOG_MBOX and retry. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_INFO "Restart HBA Data: x%x x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Restart HBA Data: x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ The driver has been told to restart the HBA }} action {{ No action required, informational message. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_ERR "Ring %d Cannot find buffer for an unsolicited iocb. tag 0x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Ring ([-]\?[0-9]{1,}) Cannot find buffer for an unsolicited iocb\\. tag 0x([0-9a-f]{1,})$" description {{ There are no more pre-allocated buffers available to handle unsolicited buffers. }} action {{ Ensure this port is not being managed by multiple ports. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Ring %d handler: Failed to allocate iocb Rctl x%x Type x%x received\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Ring ([-]\?[0-9]{1,}) handler: Failed to allocate iocb Rctl x([0-9a-f]{1,}) Type x([0-9a-f]{1,}) received$" description {{ The driver was unable to allocate memory to send a query config mailbox command }} action {{ None required. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Ring %d handler: portRspPut %d is bigger than rsp ring %d\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Ring ([-]\?[0-9]{1,}) handler: portRspPut ([-]\?[0-9]{1,}) is bigger than rsp ring ([-]\?[0-9]{1,})$" description {{ The port rsp ring put index is larger than the size of the rsp ring. }} action {{ This error could indicate a software driver, firmware or hardware problem. Report these errors to Technical Support. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Ring %d handler: unexpected ASYNC_STATUS evt_code 0x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Ring ([-]\?[0-9]{1,}) handler: unexpected ASYNC_STATUS evt_code 0x([0-9a-f]{1,})$" description {{ The HBA received an asynchronous event that was not a temperature event. }} action {{ None required. }} class: hardware sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Ring %d handler: unexpected completion IoTag x%x Data: x%x x%x x%x x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Ring ([-]\?[0-9]{1,}) handler: unexpected completion IoTag x([0-9a-f]{1,}) Data: x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ The driver could not find a matching command for the completion received on the specified ring. DATA: (1) ulpStatus (2) ulpWord[4] (3) ulpCommand (4) ulpContext }} action {{ This error could indicate a firmware or hardware problem. Report these errors to Technical Support. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Ring %d handler: unexpected Rctl x%x Type x%x received\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Ring ([-]\?[0-9]{1,}) handler: unexpected Rctl x([0-9a-f]{1,}) Type x([0-9a-f]{1,}) received$" description {{ The Rctl/Type of a received frame did not match any for the configured masks for the specified ring. }} action {{ This error could indicate a software driver, firmware or hardware problem. Report these errors to Technical Support. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Ring %d issue: portCmdGet %d is bigger than cmd ring %d\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Ring ([-]\?[0-9]{1,}) issue: portCmdGet ([-]\?[0-9]{1,}) is bigger than cmd ring ([-]\?[0-9]{1,})$" description {{ The port cmd ring get index is greater than the size of cmd ring. }} action {{ This error could indicate a software driver, firmware or hardware problem. Report these errors to Technical Support. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "RQ_CREATE mailbox failed with status x%x add_status x%x, mbx status x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) RQ_CREATE mailbox failed with status x([0-9a-f]{1,}) add_status x([0-9a-f]{1,}), mbx status x([0-9a-f]{1,})$" description {{ The mailbox command sent to create the receive queue has failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "RQ_DESTROY mailbox failed with status x%x add_status x%x, mbx status x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) RQ_DESTROY mailbox failed with status x([0-9a-f]{1,}) add_status x([0-9a-f]{1,}), mbx status x([0-9a-f]{1,})$" description {{ The mailbox command sent to delete the work queue has failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_WARNING "Rsp Ring %d error: IOCB Data: x%x x%x x%x x%x x%x x%x x%x x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Rsp Ring ([-]\?[0-9]{1,}) error: IOCB Data: x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ An IOCB error has occurred on the specified ring. DATA: (1) ulpWord[0] (2) ulpWord[1] (3) ulpWord[2] (4) ulpWord[3] (5) ulpWord[4] (6) ulpWord[5] (7) irsp+6 (8) irsp+7 }} action {{ If the problem persists, check the targets. If the targets are okay, report the error to Technical Support. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_INFO "Rsp Ring %d error: IOCB Data: x%x x%x x%x x%x x%x x%x x%x x%x x%x x%x x%x x%x x%x x%x x%x x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Rsp Ring ([-]\?[0-9]{1,}) error: IOCB Data: x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ The firmware has returned an error for this IOCB. DATA: (1) (2) }} action {{ No action needed, informational. }} class: firmware type: info refcode: "" message: lpfc_printf_log KERN_ERR "SLI4 Adapter Hardware Error Data: x%x x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) SLI4 Adapter Hardware Error Data: x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ The HBA has encountered an unrecoverable error. }} action {{ Use hbacmd to retrieve a dump file. }} class: hardware sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "SLI_CONFIG_SPECIAL mailbox failed with status x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) SLI_CONFIG_SPECIAL mailbox failed with status x([0-9a-f]{1,})$" description {{ Mailbox command failed. }} action {{ Ensure the adapter’s firmware is current. Unload and reload the driver. }} class: firmware sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "SLI_FUNCTION_RESET mailbox failed with status x%x add_status x%x, mbx status x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) SLI_FUNCTION_RESET mailbox failed with status x([0-9a-f]{1,}) add_status x([0-9a-f]{1,}), mbx status x([0-9a-f]{1,})$" description {{ Mailbox command failed. }} action {{ Reset the HBA. }} class: hardware sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Slow-path CQ identifier (%d) does not exist:\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Slow-path CQ identifier \\(([-]\?[0-9]{1,})\\) does not exist:$" description {{ The Completion Queue ID passed in the Event Queue entry does not reference a valid completion queue. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_INFO "Slow-path wqe consume event carries miss-matched qid: wcqe-qid=x%x, sp-qid=x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Slow-path wqe consume event carries miss-matched qid: wcqe-qid=x([0-9a-f]{1,}), sp-qid=x([0-9a-f]{1,})$" description {{ The consumed entry does not have the slow path’s queueID. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_ERR "The lpfc_dmabuf allocation failed\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) The lpfc_dmabuf allocation failed$" description {{ The asynchronous link event handler could not allocate a mailbox command to issue the READ_LA (read link attention) mailbox command. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "The mboxq allocation failed\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) The mboxq allocation failed$" description {{ The asynchronous link event handler could not allocate a mailbox command to issue the READ_LA (read link attention) mailbox command. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "The mbuf allocation failed\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) The mbuf allocation failed$" description {{ The asynchronous link event handler could not allocate DMA-able memory for the READ_LA mailbox command. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "There is pending active mailbox cmd\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) There is pending active mailbox cmd$" description {{ The mailbox commands have overlapped. This command should have been added to the mailbox queue. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "The SLI4 DCBX asynchronous event is not handled yet\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) The SLI4 DCBX asynchronous event is not handled yet$" description {{ The SLI-4 DCBX asynchronous event is not handled yet. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Unable to allocate memory for issuing MBOX_CONFIG_MSI command\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Unable to allocate memory for issuing MBOX_CONFIG_MSI command$" description {{ Mailbox memory pool allocation error. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Unable to allocate memory for issuing NOP mailbox command\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Unable to allocate memory for issuing NOP mailbox command$" description {{ Memory allocation for this mailbox command has failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Unable to allocate memory for issuing SLI_CONFIG_SPECIAL mailbox command\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Unable to allocate memory for issuing SLI_CONFIG_SPECIAL mailbox command$" description {{ Mailbox memory pool allocation error. }} action {{ None required. }} class: unknown sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Unable to allocate memory for issuing SLI_FUNCTION_RESET mailbox command\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Unable to allocate memory for issuing SLI_FUNCTION_RESET mailbox command$" description {{ Mailbox memory pool allocation error. }} action {{ None required. }} class: unknown sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Unable to deregister pages from HBA: %x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Unable to deregister pages from HBA: ([0-9a-f]{1,})$" description {{ The SGL pages could not be unregistered from the firmware. }} action {{ None required. }} class: firmware sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Unable to select SLI-3. Not supported by adapter.\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Unable to select SLI-3\\. Not supported by adapter\\.$" description {{ The HBA is not capable of operating in a given mode. }} action {{ SLI-3 mode is only available on some HBAs. Do not attempt to force the SLI mode to 3 on HBAs that do not support SLI-3 mode. This is an informational message. HBAs that do not support SLI-3 will be configured to run in SLI-2 mode, but it is recommended to use the auto setting (0). }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Unknown FCoE event type 0x%x event tag 0x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Unknown FCoE event type 0x([0-9a-f]{1,}) event tag 0x([0-9a-f]{1,})$" description {{ The firmware has detected an unknown FCoE event. }} action {{ Check the FCoE switch configuration and the HBA DCBX mode. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Unknown IOCB command Data: x%x x%x x%x x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Unknown IOCB command Data: x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ Received an unknown IOCB command completion. DATA: (1) ulpCommand (2) ulpStatus (3) ulpIoTag (4) ulpContext }} action {{ This error could indicate a software driver or firmware problem. If these problems persist, report these errors to Technical Support. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Unknown IOCB command Data: x%x, x%x x%x x%x x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Unknown IOCB command Data: x([0-9a-f]{1,}), x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ eceived an unknown IOCB command completion. DATA: (1) type (2) ulpCommand (3) ulpStatus (4) ulpIoTag (5) ulpContext }} action {{ This error could indicate a software driver or firmware problem. If these problems persist, report these errors to Technical Support. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "Unrecognized lpfc_sli_mode parameter: %d.\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Unrecognized lpfc_sli_mode parameter: ([-]\?[0-9]{1,})\\.$" description {{ The user has attempted to set the SLI mode to an invalid value. The only valid values for the SLI mode are 0, 2, and 3. DATA: (1) lpfc_sli_mode }} action {{ The lpfc_sli_mode driver parameter setting must be corrected. Valid values are 0, 2, and 3. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "UNREG_FCFI issue mbox failed\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) UNREG_FCFI issue mbox failed$" description {{ Could not issue the UNREG_FCFI mailbox command. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "UNREG_FCFI mbox allocation failed HBA state x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) UNREG_FCFI mbox allocation failed HBA state x([0-9a-f]{1,})$" description {{ allocation for the UNREG_FCFI mailbox command has failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "UNREG_FCFI mbox allocation failed\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) UNREG_FCFI mbox allocation failed$" description {{ Failed to allocate mailbox memory. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "UNREG_FCFI mbxStatus error x%x HBA state x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) UNREG_FCFI mbxStatus error x([0-9a-f]{1,}) HBA state x([0-9a-f]{1,})$" description {{ The Unregister FCFI mailbox failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Unregister FCFI command failed status %d, mbxStatus x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Unregister FCFI command failed status ([-]\?[0-9]{1,}), mbxStatus x([0-9a-f]{1,})$" description {{ The driver was unable to unregister the FCFI from the firmware. }} action {{ None required. }} class: unknown sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "UNREG_VFI issue mbox failed rc x%x HBA state x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) UNREG_VFI issue mbox failed rc x([0-9a-f]{1,}) HBA state x([0-9a-f]{1,})$" description {{ Could not issue the UNREG_VFI mailbox command. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "UNREG_VFI mbox allocation failed HBA state x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) UNREG_VFI mbox allocation failed HBA state x([0-9a-f]{1,})$" description {{ Could not allocate memory for UNREG_VFI mailbox command. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "UNREG_VFI mbxStatus error x%x HBA state x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) UNREG_VFI mbxStatus error x([0-9a-f]{1,}) HBA state x([0-9a-f]{1,})$" description {{ The Unregister VFI mailbox command failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Unsupported CQ count. (%d)\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Unsupported CQ count\\. \\(([-]\?[0-9]{1,})\\)$" description {{ Cannot create an completion queue of this size. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Unsupported EQ count. (%d)\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Unsupported EQ count\\. \\(([-]\?[0-9]{1,})\\)$" description {{ Cannot create an event queue of this size. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Unsupported MQ count. (%d)\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Unsupported MQ count\\. \\(([-]\?[0-9]{1,})\\)$" description {{ Cannot create MQ of this size. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Unsupported RQ count. (%d)\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Unsupported RQ count\\. \\(([-]\?[0-9]{1,})\\)$" description {{ The receive queue ring can only be 512, 1024, 2048, or 4096. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_INFO "Vital Product Data: x%x x%x x%x x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Vital Product Data: x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ Vital product data (VPD) contained in the HBA flash. DATA: (1) vpd[0] (2) vpd[1] (3) vpd[2] (4) vpd[3] }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_log KERN_WARNING "VPD not present on adapter, mbxCmd x%x DUMP VPD, mbxStatus x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) VPD not present on adapter, mbxCmd x([0-9a-f]{1,}) DUMP VPD, mbxStatus x([0-9a-f]{1,})$" description {{ The DUMP_VPD mailbox command failed. }} action {{ This error could indicate a hardware or firmware problem. If the problem persists, report the error to Technical Support. }} class: unknown sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "Wakeup on signal: rc=x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) Wakeup on signal: rc=x([0-9a-f]{1,})$" description {{ A signal other than the LPFC_DATA_READY was received on the worker thread. }} action {{ Unload and reload the driver. }} class: software sl_severity: error refcode: "" message: lpfc_printf_log KERN_ERR "WQ_CREATE mailbox failed with status x%x add_status x%x, mbx status x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) WQ_CREATE mailbox failed with status x([0-9a-f]{1,}) add_status x([0-9a-f]{1,}), mbx status x([0-9a-f]{1,})$" description {{ The mailbox command sent to create the work queue has failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_log KERN_ERR "WQ_DESTROY mailbox failed with status x%x add_status x%x, mbx status x%x\n" regex lpfc_printf_log "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):([-]\?[0-9]{1,}) WQ_DESTROY mailbox failed with status x([0-9a-f]{1,}) add_status x([0-9a-f]{1,}), mbx status x([0-9a-f]{1,})$" description {{ The mailbox command sent to delete the work queue has failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_INFO "Abort outstanding I/O on NPort x%x Data: x%x x%x x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Abort outstanding I/O on NPort x([0-9a-f]{1,}) Data: x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ All outstanding I/Os are cleaned up on the specified remote NPort. DATA: (1) nlp_flag (2) nlp_state (3) nlp_rpi }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "ACC to LOGO completes to NPort x%x Data: x%x x%x x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) ACC to LOGO completes to NPort x([0-9a-f]{1,}) Data: x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ The driver received a LOGO from a remote NPort and successfully issued an ACC response. DATA: (1) nlp_flag (2) nlp_state (3) nlp_rpi }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "ADISC completes to NPort x%x Data: x%x x%x x%x x%x x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) ADISC completes to NPort x([0-9a-f]{1,}) Data: x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ The HBA performed a ADISC into a remote NPort. DATA: (1) ulpStatus (2) ulpWord[4] (3) ulpTimeout (4) disc (5) num_disc_nodes }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "Allocation request of %d command buffers did not succeed. Allocated %d buffers.\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Allocation request of ([-]\?[0-9]{1,}) command buffers did not succeed\\. Allocated ([-]\?[0-9]{1,}) buffers\\.$" description {{ The allocation request for the specified command buffers did not succeed. However,the specified number of buffers has been allocated. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "Allocation request of %d command buffers will exceed max of %d. Reducing allocation request to %d.\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Allocation request of ([-]\?[0-9]{1,}) command buffers will exceed max of ([-]\?[0-9]{1,})\\. Reducing allocation request to ([-]\?[0-9]{1,})\\.$" description {{ The number of command buffers requested will exceed the maximum so a smaller quantity will be allocated. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_ERR "An FLOGI ELS command x%x was received from DID x%x in Loop Mode\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) An FLOGI ELS command x([0-9a-f]{1,}) was received from DID x([0-9a-f]{1,}) in Loop Mode$" description {{ While in Loop Mode an unknown or unsupported ELS command was received. }} action {{ Check device DID. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_INFO "At limitation of %d preallocated command buffers\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) At limitation of ([-]\?[0-9]{1,}) preallocated command buffers$" description {{ The maximum number of command buffers have already been allocated. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_ERR "Bus Reset on target %d failed\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Bus Reset on target ([-]\?[0-9]{1,}) failed$" description {{ The bus reset for the specified target failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_INFO "Cancel Discovery Timer state x%x Data: x%x x%x x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Cancel Discovery Timer state x([0-9a-f]{1,}) Data: x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ Cancel the device discovery / RSCN rescue timer. DATA: (1) fc_flag (2) fc_plogi_cnt (3) fc_adisc_cnt }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_ERR "Cannot issue NameServer login\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Cannot issue NameServer login$" description {{ Could not issue an ELS PLOGI to the nameserver DID. }} action {{ Check the port connection and the switch configuration. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "Cannot issue Register Fabric login: Err %d\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Cannot issue Register Fabric login: Err ([-]\?[0-9]{1,})$" description {{ Could not issue the fabric reg login, the err value is unique for each possible failure. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "Cannot Register NameServer login\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Cannot Register NameServer login$" description {{ Either a memory allocation issue or an invalid parameter was sent to the REG_LOGIN. }} action {{ At least one message (0142 0121 0133 0134 0135) should precede this message. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_INFO "Cleanup node for NPort x%x Data: x%x x%x x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Cleanup node for NPort x([0-9a-f]{1,}) Data: x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ The driver node table entry for a remote NPort was removed. DATA: (1) nlp_flag (2) nlp_state (3) nlp_rpi }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_ERR "CLEAR_LA mbxStatus error x%x hba state x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) CLEAR_LA mbxStatus error x([0-9a-f]{1,}) hba state x([0-9a-f]{1,})$" description {{ The driver issued a CLEAR_LA mbox command to the HBA that failed. }} action {{ This error could indicate a firmware or hardware problem. Report these errors to Technical Support. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "CLEAR LA timeout\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) CLEAR LA timeout$" description {{ The driver issued a CLEAR_LA that never completed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "CONFIG_LINK bad hba state x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) CONFIG_LINK bad hba state x([0-9a-f]{1,})$" description {{ A CONFIG_LINK mbox command completed and the driver was not in the right state. }} action {{ Software driver error. If this problem persists, report these errors to Technical Support. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "CONFIG_LINK mbxStatus error x%x HBA state x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) CONFIG_LINK mbxStatus error x([0-9a-f]{1,}) HBA state x([0-9a-f]{1,})$" description {{ The driver issued a CONFIG_LINK mbox command to the HBA that failed. }} action {{ This error could indicate a firmware or hardware problem. Report these errors to Technical Support. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_INFO "Continue discovery with %d ADISCs to go Data: x%x x%x x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Continue discovery with ([-]\?[0-9]{1,}) ADISCs to go Data: x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ A device discovery is in progress. DATA: (1) fc_adisc_cnt (2) fc_flag (3) phba->hba_state }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "Continue discovery with %d PLOGIs to go Data: x%x x%x x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Continue discovery with ([-]\?[0-9]{1,}) PLOGIs to go Data: x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ Device discovery is in progress. DATA: (1) fc_plogi_cnt (2) fc_flag (3) phba->hba_state }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_ERR "Could not issue unreg_did (default rpis) status %d\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Could not issue unreg_did \\(default rpis\\) status ([-]\?[0-9]{1,})$" description {{ Attempt to unregister rpi failed. }} action {{ Software driver error. If this problem persists, report these errors to Technical Support. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "Could not issue unreg_login(all_rpis) status %d\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Could not issue unreg_login\\(all_rpis\\) status ([-]\?[0-9]{1,})$" description {{ The unreg_login cannot be issued. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "Could not issue unreg_vpi\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Could not issue unreg_vpi$" description {{ Driver attempt to unregister vpi failed. }} action {{ Software driver error. If this problem persists, report these errors to Technical Support. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "Create VPORT failed. Cannot get sparam\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Create VPORT failed\\. Cannot get sparam$" description {{ The port could not be created because it could not be initialized possibly due to unavailable resources. }} action {{ Software driver error. If this problem persists, report these errors to Technical Support. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "Create VPORT failed. Duplicate WWN on HBA\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Create VPORT failed\\. Duplicate WWN on HBA$" description {{ The port could not be created because it would duplicate an existing WWNN HBA address. The resources for the port had to be discarded. }} action {{ Provide a WWN that is unique. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "Create VPORT failed. Invalid WWN format\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Create VPORT failed\\. Invalid WWN format$" description {{ The port could not be created due to an invalid WWNN or WWPN format. }} action {{ Provide a valid WWN when creating Vports. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "Create VPORT Interrupted.\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Create VPORT Interrupted\\.$" description {{ The port creation process was unexpectedly interrupted at a critical time and the operation was unsuccessful. }} action {{ The process was interrupted while creating a VPort. Retry the command. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_WARNING "Create vport work array FAILED: cannot do scsi_host_get\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Create vport work array FAILED: cannot do scsi_host_get$" description {{ The driver was unable to get a reference to a SCSI host. }} action {{ Software driver error. If this problem persists, report these errors to Technical Support. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_INFO "CT Request completes, latt %d, ulpStatus x%x CmdRsp x%x, Context x%x, Tag x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) CT Request completes, latt ([-]\?[0-9]{1,}), ulpStatus x([0-9a-f]{1,}) CmdRsp x([0-9a-f]{1,}), Context x([0-9a-f]{1,}), Tag x([0-9a-f]{1,})$" description {{ A RFT request that was sent to the fabric completed. DATA: (1) latt (2) ulpStatus (3) CmdRsp (4) Context (5) Tag }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "Deferred RSCN Data: x%x x%x x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Deferred RSCN Data: x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ The driver has received multiple RSCNs and has deferred the processing of the most recent RSCN. DATA: (1) fc_rscn_id_cnt (2) fc_flag (3) hba_state }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "Device Discovery completes\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Device Discovery completes$" description {{ This indicates successful completion of device (re)discovery after a link up. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_ERR "Device Discovery completion error\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Device Discovery completion error$" description {{ This indicates that an uncorrectable error was encountered during device (re)discovery after a link up. Fibre Channel devices will not be accessible if this message is displayed. }} action {{ Reboot the system. If the problem persists, report the error to Technical Support. Run with verbose mode on for more details. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "Device Reset rport failure: rdata x%p\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Device Reset rport failure: rdata x(\\(null\\)|([0]{0,7}[0-9a-f]{1,}))$" description {{ The reset of the Rport failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "Discovery Mailbox error: state: 0x%x : %p %p\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Discovery Mailbox error: state: 0x([0-9a-f]{1,}) : (\\(null\\)|([0]{0,7}[0-9a-f]{1,})) (\\(null\\)|([0]{0,7}[0-9a-f]{1,}))$" description {{ Either the driver could not allocate resources or it could not send sparam_mbox or cfglink_mbox. DATA: (1) address of sparam_mbox command (2) address of cfglink_mbox command }} action {{ Attempt to unload and reload the driver when it is convenient. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "Dropping received ELS cmd Data: x%x x%x x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Dropping received ELS cmd Data: x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ The driver decided to drop an ELS Response ring entry. DATA: (1) ulpStatus (2) ulpWord[4] (3) ulpTimeout }} action {{ This error could indicate a software driver or firmware problem. If problems persist report these errors to Technical Support. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_INFO "DSM in event x%x on NPort x%x in state %d Data: x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) DSM in event x([0-9a-f]{1,}) on NPort x([0-9a-f]{1,}) in state ([-]\?[0-9]{1,}) Data: x([0-9a-f]{1,})$" description {{ The driver Discovery State Machine is processing an event. DATA: (1) nlp_flag }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "DSM out state %d on NPort free\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) DSM out state ([-]\?[0-9]{1,}) on NPort free$" description {{ The driver Discovery State Machine completed processing an event. DATA: (1) nlp_flag }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "DSM out state %d on NPort x%x Data: x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) DSM out state ([-]\?[0-9]{1,}) on NPort x([0-9a-f]{1,}) Data: x([0-9a-f]{1,})$" description {{ The driver Discovery State Machine completed processing an event. DATA: (1) nlp_flag }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "ELS cmd tag x%x completes Data: x%x x%x x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) ELS cmd tag x([0-9a-f]{1,}) completes Data: x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ The specific ELS command was completed by the firmware. DATA: (1) ulpStatus (2) ulpWord[4] (3) ulpTimeout }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "ELS command x%x received from NPORT x%x Data: x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) ELS command x([0-9a-f]{1,}) received from NPORT x([0-9a-f]{1,}) Data: x([0-9a-f]{1,})$" description {{ Received the specific ELS command from a remote NPort. DATA: (1) hba_state }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "ELS response tag x%x completes Data: x%x x%x x%x x%x x%x x%x x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) ELS response tag x([0-9a-f]{1,}) completes Data: x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ The specific ELS response was completed by the firmware. DATA: (1) ulpStatus (2) ulpWord[4] (3) ulptimeout (4) nlp_DID (5) nlp_flag (6) nlp_state (7) nlp_rpi }} action {{ No action needed, informational. }} class: firmware type: info refcode: "" message: lpfc_printf_vlog KERN_ERR "ELS rsp: Cannot issue reg_login for x%x Data: x%x x%x x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) ELS rsp: Cannot issue reg_login for x([0-9a-f]{1,}) Data: x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ REG_LOGIN mailbox command failed. DATA: (1) nlp_DID (2) nlp_state (3) nlp_flag (4) nlp_rpi }} action {{ None required. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "ELS timeout Data: x%x x%x x%x x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) ELS timeout Data: x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ An ELS IOCB command was posted to a ring and did not complete within ULP timeout seconds. DATA: (1) elscmd (2) remote_id (3) ulpcommand (4) ulpIoTag }} action {{ If no ELS command is going through the adapter, reboot the system; If problem persists, contact Technical Support. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_INFO "Fabric does not support NPIV - configuring single port mode.\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Fabric does not support NPIV - configuring single port mode\\.$" description {{ The fabric reports no support for NPIV upon FLOGI. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_ERR "Failed to allocate init_vpi mailbox\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Failed to allocate init_vpi mailbox$" description {{ Failed to allocate init_vpi mailbox\n. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "Failed to allocate memory for ELS event\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Failed to allocate memory for ELS event$" description {{ Memory could not be allocated to send the ELS event to the FC transport. }} action {{ None required. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "Failed to allocate memory for LOGO event\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Failed to allocate memory for LOGO event$" description {{ Memory could not be allocated to send the LOGO event to the FC transport. }} action {{ None required. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "Failed to allocate memory for RSCN event\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Failed to allocate memory for RSCN event$" description {{ Memory could not be allocated to send the RSCN event to the management application. }} action {{ None required. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "Failed to issue INIT_VPI mailbox command\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Failed to issue INIT_VPI mailbox command$" description {{ Failed to INIT_VPI. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "Failed to issue init_vpi mailbox\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Failed to issue init_vpi mailbox$" description {{ The driver was unable to send an initialize VPI mailbox command. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_WARNING "FAN timeout\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) FAN timeout$" description {{ A link up event was received without the login bit set, so the driver waits E_D_TOV for the Fabric to send a FAN. If no FAN if received, a FLOGI will be sent after the timeout. }} action {{ None required. The driver recovers from this condition by issuing a FLOGI to the fabric. }} class: hardware sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_INFO "FARP-REQ received from DID x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) FARP-REQ received from DID x([0-9a-f]{1,})$" description {{ An unsolicited FARP request was received. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_WARNING "FCP cmd x%x failed <%d/%d> status: x%x result: x%x Data: x%x x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) FCP cmd x([0-9a-f]{1,}) failed <([-]\?[0-9]{1,})/([-]\?[0-9]{1,})> status: x([0-9a-f]{1,}) result: x([0-9a-f]{1,}) Data: x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ The specified device failed an FCP command. DATA: (1) ulpContext (2) iotag }} action {{ Check the state of the target in question. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_WARNING "FCP command x%x failed: x%x SNS x%x x%x Data: x%x x%x x%x x%x x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) FCP command x([0-9a-f]{1,}) failed: x([0-9a-f]{1,}) SNS x([0-9a-f]{1,}) x([0-9a-f]{1,}) Data: x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ The FCP command failed with a response error. DATA: (1) resp_info (2) scsi_status (3) ResId (4) SnsLen (5) RspLen (6)rspInfo3 }} action {{ Check the state of the target in question. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_INFO "FCP command x%x residual overrun error. Data: x%x x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) FCP command x([0-9a-f]{1,}) residual overrun error\\. Data: x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ A residual overrun error has occurred while processing the specified FCP command. DATA: (1) request_bufflen (2) resid }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "FCP command x%x residual underrun converted to error Data: x%x x%x x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) FCP command x([0-9a-f]{1,}) residual underrun converted to error Data: x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ The driver converted this underrun condition to an error based on the underflow field in the SCSI command. DATA: (1) len (2) resid (3) underflow }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "FCP Read Check Error and Underrun Data: x%x x%x x%x x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) FCP Read Check Error and Underrun Data: x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ HBA reported under run from storage array. DATA: (1) vpi (2) fcpDI (3) res_id (4) fcpi_parm }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_WARNING "FCP Read Check Error Data: x%x x%x x%x x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) FCP Read Check Error Data: x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ The issued FCP command returned a read check error. DATA: (1) fcpDl (2) rspResId (3) fcpi_parm (4) cmd[0] }} action {{ Check the state of the target in question. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_INFO "FCP Read Underrun, expected %d, residual %d Data: x%x x%x x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) FCP Read Underrun, expected ([-]\?[0-9]{1,}), residual ([-]\?[0-9]{1,}) Data: x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ An FCP device provided less data than was requested. DATA: (1) fcpi_parm (2) cmnd[0] (3) underflow }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_ERR "FDISC failed. (%d/%d)\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) FDISC failed\\. \\(([-]\?[0-9]{1,})/([-]\?[0-9]{1,})\\)$" description {{ DATA: lsRjtError }} action {{ Reconfigure the switch to support more NPIV logins. If problem persists, contact Technical Support. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "FDISC Failed (x%x).\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) FDISC Failed \\(x([0-9a-f]{1,})\\)\\.$" description {{ DATA: lsRjtError }} action {{ Reconfigure the switch to support more NPIV logins. If problem persists, contact Technical Support. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_INFO "FDMI Request Data: x%x x%x x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) FDMI Request Data: x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ The driver is sending an FDMI request to the fabric. DATA: (1) fc_flag (2) hba_state (3) cmdcode }} action {{ No action needed, informational. }} class: unknown type: info refcode: "" message: lpfc_printf_vlog KERN_WARNING "FDMI rsp failed Data: x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) FDMI rsp failed Data: x([0-9a-f]{1,})$" description {{ An error response was received to FDMI request. DATA:(1) SWAP_DATA16(fdmi_cmd) }} action {{ The fabric does not support FDMI, check fabric configuration. }} class: unknown sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_INFO "FIND node did x%x NOT FOUND.\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) FIND node did x([0-9a-f]{1,}) NOT FOUND\\.$" description {{ The driver was searching for a node table entry based on the DID and the entry was not found. DATA: (1) order }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "FLOGI completes successfully Data: x%x x%x x%x x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) FLOGI completes successfully Data: x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ An ELS FLOGI command that was sent to the fabric succeeded. DATA: (1) ulpWord[4] (2) e_d_tov (3) r_a_tov (4) edtovResolution }} action {{ No action needed, informational. }} class: unknown type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "FLOGI failure Data: x%x x%x x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) FLOGI failure Data: x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ An ELS FLOGI command that was sent to the fabric failed. DATA: (1) ulpStatus (2) ulpWord[4] (3) ulpTimeout }} action {{ No action needed, informational. }} class: unknown type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "FLOGI NPIV supported, response data 0x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) FLOGI NPIV supported, response data 0x([0-9a-f]{1,})$" description {{ The fabric reports support for NPIV upon FLOGI. DATA: (1) response_multiple_NPort }} action {{ No action needed, informational. }} class: unknown type: info refcode: "" message: lpfc_printf_vlog KERN_ERR "GID_FT Query error: 0x%x 0x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) GID_FT Query error: 0x([0-9a-f]{1,}) 0x([0-9a-f]{1,})$" description {{ The GID_FT CT request for the nameserver has failed. }} action {{ Check the switch configuration. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "Ignoring change to nodev_tmo because devloss_tmo is set.\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Ignoring change to nodev_tmo because devloss_tmo is set\\.$" description {{ Attempting to change the nodev timeout when the devloss has already been set. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "Ignoring nodev_tmo module parameter because devloss_tmo is set.\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Ignoring nodev_tmo module parameter because devloss_tmo is set\\.$" description {{ Both module parameters (nodev and devloss) were set so the driver is ignoring the nodev parameter. }} action {{ Only one of these parameters must be set. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "Illegal State Transition: node x%x event x%x, state x%x Data: x%x x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Illegal State Transition: node x([0-9a-f]{1,}) event x([0-9a-f]{1,}), state x([0-9a-f]{1,}) Data: x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ The current node state does not have a handler for this event. DATA: (1) nlp_rpi (2) nlp_flag }} action {{ Verify that all targets are still visible to the SCSI mid-layer. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "Init VPI mailbox failed 0x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Init VPI mailbox failed 0x([0-9a-f]{1,})$" description {{ The Initialize VPI mailbox command failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "Invalid response length: tgt x%x lun x%x cmnd x%x rsplen x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Invalid response length: tgt x([0-9a-f]{1,}) lun x([0-9a-f]{1,}) cmnd x([0-9a-f]{1,}) rsplen x([0-9a-f]{1,})$" description {{ The response length for this FCP command is not supported. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_INFO "Iodone <%d/%d> cmd %p, error x%x SNS x%x x%x Data: x%x x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Iodone <([-]\?[0-9]{1,})/([-]\?[0-9]{1,})> cmd (\\(null\\)|([0]{0,7}[0-9a-f]{1,})), error x([0-9a-f]{1,}) SNS x([0-9a-f]{1,}) x([0-9a-f]{1,}) Data: x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ This error indicates that the Fibre Channel driver is returning a SCSI command to the SCSI layer in error or with sense data. DATA: (1) retry (2) resid }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_ERR "I/O flush failure for context %s : cnt x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) I/O flush failure for context ([[:print:]]*) : cnt x([0-9a-f]{1,})$" description {{ The I/O flush to the {LUN TARGET or HOST] has failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "Issue FDISC: Cannot send IOCB\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Issue FDISC: Cannot send IOCB$" description {{ Unable to send the fabric IOCB. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "Issue FDISC: no IOCB\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Issue FDISC: no IOCB$" description {{ All of the pre-allocated IOCBs are in use. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_WARNING "Issue FDMI request failed Data: x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Issue FDMI request failed Data: x([0-9a-f]{1,})$" description {{ Cannot issue an FDMI request to the HBA. DATA: (1) cmdcode }} action {{ No action needed, informational. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_INFO "Issue GEN REQ IOCB to NPORT x%x Data: x%x x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Issue GEN REQ IOCB to NPORT x([0-9a-f]{1,}) Data: x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ Issue a GEN REQ IOCB for remote NPORT. These are typically used for CT request. DATA: (1) ulpIoTag (2) hba_state }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_ERR "Issue NameServer Req x%x err %d Data: x%x x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Issue NameServer Req x([0-9a-f]{1,}) err ([-]\?[0-9]{1,}) Data: x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ The driver was not able to send the nameserver CT command. DATA: (1) vports fc_flag (2) vports fc_rscn_id_cn }} action {{ Check the port and switch configurations. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "Issue Register VFI failed: Err %d\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Issue Register VFI failed: Err ([-]\?[0-9]{1,})$" description {{ The driver could not register the Virtual Fabric Index for the FCFI. }} action {{ Check the switch and port configurations. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_INFO "LOGO completes to NPort x%x Data: x%x x%x x%x x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) LOGO completes to NPort x([0-9a-f]{1,}) Data: x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ The HBA performed a LOGO to a remote NPort. DATA: (1) ulpStatus (2) ulpWord[4] (3) ulpTimeout (4) num_disc_nodes }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_ERR "lpfc_alloc_bucket failed to allocate statistical data buffer DID 0x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) lpfc_alloc_bucket failed to allocate statistical data buffer DID 0x([0-9a-f]{1,})$" description {{ Memory allocation failed for node’s statistical data. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_INFO "lpfc_cleanup_node: ndlp:x%p usgmap:x%x refcnt:%d\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) lpfc_cleanup_node: ndlp:x(\\(null\\)|([0]{0,7}[0-9a-f]{1,})) usgmap:x([0-9a-f]{1,}) refcnt:([-]\?[0-9]{1,})$" description {{ Node clean-up wascalled to prepare the node for release. }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_ERR "lpfc_devloss_tmo attribute cannot be set to %d, allowed range is [%d, %d]\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) lpfc_devloss_tmo attribute cannot be set to ([-]\?[0-9]{1,}), allowed range is \\[([-]\?[0-9]{1,}), ([-]\?[0-9]{1,})]$" description {{ Attempt to set the devloss timeout value is outside the allowed range. }} action {{ Set the devloss timeout between the minimum and maximum devloss range. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_WARNING "lpfc_enable_node: ndlp:x%p usgmap:x%x refcnt:%d\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) lpfc_enable_node: ndlp:x(\\(null\\)|([0]{0,7}[0-9a-f]{1,})) usgmap:x([0-9a-f]{1,}) refcnt:([-]\?[0-9]{1,})$" description {{ Enable node was attempted on an inactive node. }} action {{ No action needed, informational. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_WARNING "lpfc_nlp_get: ndlp:x%p usgmap:x%x refcnt:%d\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) lpfc_nlp_get: ndlp:x(\\(null\\)|([0]{0,7}[0-9a-f]{1,})) usgmap:x([0-9a-f]{1,}) refcnt:([-]\?[0-9]{1,})$" description {{ A kref_get was attempted on a node that was being released. }} action {{ No action needed, informational. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_WARNING "lpfc_nlp_put: ndlp:x%p usgmap:x%x refcnt:%d\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) lpfc_nlp_put: ndlp:x(\\(null\\)|([0]{0,7}[0-9a-f]{1,})) usgmap:x([0-9a-f]{1,}) refcnt:([-]\?[0-9]{1,})$" description {{ A kref_put was called again after the node was already inactive. }} action {{ No action needed, informational. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "lpfc_nlp_state_cleanup failed to allocate statistical data buffer DID 0x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) lpfc_nlp_state_cleanup failed to allocate statistical data buffer DID 0x([0-9a-f]{1,})$" description {{ Memory allocation failed for node’s statistical data. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "lpfc_nodev_tmo attribute cannot be set to %d, allowed range is [%d, %d]\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) lpfc_nodev_tmo attribute cannot be set to ([-]\?[0-9]{1,}), allowed range is \\[([-]\?[0-9]{1,}), ([-]\?[0-9]{1,})]$" description {{ The attempt to set the devloss timeout value failed because the value is out of the allowable range. }} action {{ Use a value between the minimum and maximum values. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "lpfc_restrict_login attribute cannot be set to %d, allowed range is [0, 1]\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) lpfc_restrict_login attribute cannot be set to ([-]\?[0-9]{1,}), allowed range is \\[0, 1]$" description {{ The module parameter lpfc_restrict_login can only be set to 0 (off) or 1 (on). }} action {{ Set lpfc_restrict_login=[0,1]. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "lpfc_restrict_login must be 0 for Physical ports.\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) lpfc_restrict_login must be 0 for Physical ports\\.$" description {{ Attempt to set the restrict login parameter to something other than on or off. }} action {{ Use 0 (Off) or 1 (On). }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "NameServer GFF Rsp x%x Error (%d %d) Data: x%x x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) NameServer GFF Rsp x([0-9a-f]{1,}) Error \\(([-]\?[0-9]{1,}) ([-]\?[0-9]{1,})\\) Data: x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ The nameServer GFF CT request failed. DATA: (1) vports fc_flag (2) vports fc_rscn_id_cnt }} action {{ Check the port and switch configurations. }} class: hardware sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "NameServer login: node freed\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) NameServer login: node freed$" description {{ The enable mode failed to free up the nameserver login. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "NameServer login: no memory\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) NameServer login: no memory$" description {{ Could not allocate memory for the NDLP structure. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "NameServer Query timeout Data: x%x x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) NameServer Query timeout Data: x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ Node authentication timeout, node Discovery timeout. A NameServer Query to the Fabric or discovery of reported remote NPorts is not acknowledged within R_A_TOV. DATA: (1) fc_ns_retry (2) fc_max_ns_retry }} action {{ Check Fabric configuration. The driver recovers from this and continues with device discovery. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "NameServer Rsp Data: x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) NameServer Rsp Data: x([0-9a-f]{1,})$" description {{ The driver received a NameServer response containing a status error. DATA: (1) CommandResponse.bits.CmdRsp (2) ReasonCode (3) Explanation (4) fc_flag }} action {{ Check the fabric configuration. The driver recovers from this and continues with device discovery. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "Node Authentication timeout\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Node Authentication timeout$" description {{ The driver has lost track of what NPORTs are being authenticated. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "Nodelist not empty\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Nodelist not empty$" description {{ Driver unloaded or hotplug detected a node still in use. }} action {{ None required. }} class: unknown sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "No NPIV Fabric support\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) No NPIV Fabric support$" description {{ The driver was unable to create an NPIV Vport because it is not supported by the attached fabric. DATA: (1) rctl_names[fc_hdr->fh_r_ctl], (2) type_names[fc_hdr->fh_type]) }} action {{ Reconfigure the switch to support NPIV. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "No retry ELS command x%x to remote NPORT x%x Retried:%d Error:x%x/%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) No retry ELS command x([0-9a-f]{1,}) to remote NPORT x([0-9a-f]{1,}) Retried:([-]\?[0-9]{1,}) Error:x([0-9a-f]{1,})/([0-9a-f]{1,})$" description {{ (1) ulpStatus (2) ulpWord[4] }} action {{ None required. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "NS cmd %x Error (%d %d)\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) NS cmd ([0-9a-f]{1,}) Error \\(([-]\?[0-9]{1,}) ([-]\?[0-9]{1,})\\)$" description {{ The nameServer CT request failed. }} action {{ Check the port and switch configurations. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "Pending Link Event during Discovery: State x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Pending Link Event during Discovery: State x([0-9a-f]{1,})$" description {{ Received link event during discovery. Causes discovery restart. }} action {{ None required unless problem persists. If persistent check cabling. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "PLOGI: cannot format reg_login Data: x%x x%x x%x x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) PLOGI: cannot format reg_login Data: x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ Could not allocate an RPI or DMA buffer for the mailbox command. DATA: (1) nlp_DID (2) nlp_state (3) nlp_flag (4) nlp_rpi }} action {{ None required. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "PLOGI: cannot issue reg_login Data: x%x x%x x%x x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) PLOGI: cannot issue reg_login Data: x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ The ELS PLOGI mailbox command has failed. DATA: (1) nlp_DID 92) nlp_state (3) nlp_flag (4) nlp_rpi }} action {{ Check the port and switch configuration. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_INFO "PLOGI chkparm OK Data: x%x x%x x%x x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) PLOGI chkparm OK Data: x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ Received a PLOGI from a remote NPORT and its Fibre Channel service parameters match this HBA. Request can be accepted. DATA: (1) nlp_DID (2) nlp_state (3) nlp_flag (4) nlp_Rpi }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "PLOGI completes to NPort x%x Data: x%x x%x x%x x%x x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) PLOGI completes to NPort x([0-9a-f]{1,}) Data: x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ The HBA performed a PLOGI into a remote NPort. DATA: (1) ulpStatus (2) ulpWord[4] (3) ulpTimeout (4)disc (5) num_disc_nodes }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_ERR "PLOGI completes to NPort x%x with no ndlp. Data: x%x x%x x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) PLOGI completes to NPort x([0-9a-f]{1,}) with no ndlp\\. Data: x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ A PLOGI has completed for which there is no NDLP. DATA: (1) ulpStatus (2) ulpWord[4] }} action {{ None required. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "PLOGI: no memory for reg_login Data: x%x x%x x%x x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) PLOGI: no memory for reg_login Data: x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ Memory allocation error. DATA: (1) nlp_DID (2) nlp_state (3) nlp_flag (4) nlp_rpi }} action {{ Memory allocation error. Check system resources. Unload unused modules. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "PLOGI Reject: invalid nname\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) PLOGI Reject: invalid nname$" description {{ Invalid node WWN provided. }} action {{ None required. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "PLOGI RSP: Invalid WWN.\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) PLOGI RSP: Invalid WWN\\.$" description {{ The PLOGI sent to the port by a remote port had an invalid WWN. }} action {{ None required. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_INFO "PRLI completes to NPort x%x Data: x%x x%x x%x x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) PRLI completes to NPort x([0-9a-f]{1,}) Data: x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ The HBA performed a PRLI into a remote NPort. DATA: (1) ulpStatus (2) ulpWord[4] (3) ulpTimeout (4) num_disc_nodes }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "Process x%x NameServer Rsp Data: x%x x%x x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Process x([0-9a-f]{1,}) NameServer Rsp Data: x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ The driver received a NameServer response. DATA: (1) nlp_flag (2) fc_flag (3) fc_rscn_id_cnt }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_ERR "READ_SPARAM mbxStatus error x%x hba state x%x>\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) READ_SPARAM mbxStatus error x([0-9a-f]{1,}) hba state x([0-9a-f]{1,})>$" description {{ The driver issued a READ_SPARAM mbox command to the HBA that failed. }} action {{ This error could indicate a firmware or hardware problem. Report these errors to Technical Support. }} class: unknown sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_INFO "ReDiscovery RSCN Data: x%x x%x x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) ReDiscovery RSCN Data: x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ The number / type of RSCNs has forced the driver to go to the nameserver and rediscover all NPORTs. DATA: (1) fc_rscn_id_cnt (2) fc_flag (3) hba_state }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_ERR "REG_FCFI mbxStatus error x%x HBA state x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) REG_FCFI mbxStatus error x([0-9a-f]{1,}) HBA state x([0-9a-f]{1,})$" description {{ The REG_FCFI mailbox command has failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "Register Fabric login error: 0x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Register Fabric login error: 0x([0-9a-f]{1,})$" description {{ The REG_LOGIN for the fabric has failed. }} action {{ Check the port connection and the switch configuration. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "Register NameServer error: 0x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Register NameServer error: 0x([0-9a-f]{1,})$" description {{ The REG_LOGIN mailbox command has failed for the nameserver. }} action {{ Check the switch configuration }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "Register VPI: Can't send mbox\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Register VPI: Can't send mbox$" description {{ Could not issue the REG_LOGIN command for this VPort. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "Register VPI: no memory\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Register VPI: no memory$" description {{ Could not allocate memory for the REG_LOGIN mailbox command. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "RegLogin failed Data: x%x x%x x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) RegLogin failed Data: x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ The firmware returned a failure for the specified RegLogin. DATA: (1) Did (2) mbxStatus (3) hbaState }} action {{ This message indicates that the firmware could not do RegLogin for the specified Did. There may be a limitation on how many nodes an HBA can see. }} class: firmware sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "REG_VFI mbxStatus error x%x HBA state x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) REG_VFI mbxStatus error x([0-9a-f]{1,}) HBA state x([0-9a-f]{1,})$" description {{ The REG_VFI mailbox command has failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_INFO "Retry ELS command x%x to remote NPORT x%x Data: x%x x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Retry ELS command x([0-9a-f]{1,}) to remote NPORT x([0-9a-f]{1,}) Data: x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ The driver is retrying the specific ELS command. DATA: (1) retry (2) delay }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "RSCN processed Data: x%x x%x x%x x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) RSCN processed Data: x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ An RSCN ELS command was received from a fabric and processed. DATA: (1) fc_flag (2) cnt (3) fc_rscn_id_cnt (4) hba_state }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "RSCN received Data: x%x x%x x%x x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) RSCN received Data: x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ An RSCN ELS command was received from a fabric. DATA: (1) fc_flag (2) payload_len (3) *lp (4)fc_rscn_id_cnt }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_ERR "RSCN timeout Data: x%x x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) RSCN timeout Data: x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ The driver has lost track of what NPORTs have RSCNs pending. DATA: (1) fc_ns_retry (2) lpfc_max_ns_retry }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "SCSI layer issued Bus Reset Data: x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) SCSI layer issued Bus Reset Data: x([0-9a-f]{1,})$" description {{ The SCSI layer is requesting the driver to abort all I/Os to all targets on this HBA. DATA: (1) ret }} action {{ Check the state of the targets in question. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "Signal aborted mbxCmd x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Signal aborted mbxCmd x([0-9a-f]{1,})$" description {{ A pending mailbox command was aborted because the thread received a signal. }} action {{ You should retry the attempted command. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_INFO "Skip x%x NameServer Rsp Data: x%x x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Skip x([0-9a-f]{1,}) NameServer Rsp Data: x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ The driver received a NameServer response. DATA: (1) size (2) fc_flag (3) fc_rscn_id_cnt (4)no_rscn_id_cnt }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "Start Discovery hba state x%x Data: x%x x%x x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Start Discovery hba state x([0-9a-f]{1,}) Data: x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ Device discovery / rediscovery after FLOGI, FAN or RSCN has started. DATA: (1) fc_flag (2) fc_plogi_cnt (3) fc_adisc_cnt }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "Start Discovery Timer state x%x Data: x%x x%lx x%x x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Start Discovery Timer state x([0-9a-f]{1,}) Data: x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,}) x([0-9a-f]{1,})$" description {{ Start the device discovery / RSCN rescue timer. DATA: (1) tmo (2) fc_disctmo (3) fc_plogi_cnt (4) fc_adisc_cnt }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_ERR "Target Reset rport failure: rdata x%p\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Target Reset rport failure: rdata x(\\(null\\)|([0]{0,7}[0-9a-f]{1,}))$" description {{ The reset of the target failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "Timeout while waiting for NameServer login\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Timeout while waiting for NameServer login$" description {{ Our login request to the NameServer was not acknowledged within RATOV. }} action {{ Check the fabric configuration. The driver recovers from this and continues with device discovery. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "TMF %s to TGT %d LUN %d failed (%d, %d)\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) TMF ([[:print:]]*) to TGT ([-]\?[0-9]{1,}) LUN ([-]\?[0-9]{1,}) failed \\(([-]\?[0-9]{1,}), ([-]\?[0-9]{1,})\\)$" description {{ The task management command failed. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "Unexpected discovery timeout, vport State x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Unexpected discovery timeout, vport State x([0-9a-f]{1,})$" description {{ The discovery process has timed out. }} action {{ Verify that all targets are still visible. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "Unexpected timeout, hba link state x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Unexpected timeout, hba link state x([0-9a-f]{1,})$" description {{ Discovery has timed out and the HBA state is not ready. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "Unknown ELS command x%x received from NPORT x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Unknown ELS command x([0-9a-f]{1,}) received from NPORT x([0-9a-f]{1,})$" description {{ Received an unsupported ELS command from a remote NPORT. }} action {{ Check remote NPORT for potential problem. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_INFO "Vport Created.\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Vport Created\\.$" description {{ This message is displayed to indicate that a port was created in the system. It is displayed at this level to ensure it is always appears at all log levels. }} action {{ None required. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_ERR "Vport Disabled.\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Vport Disabled\\.$" description {{ The port had to be disabled in the system. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "vport_delete failed: Cannot delete physical host\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) vport_delete failed: Cannot delete physical host$" description {{ An attempt to delete a port failed because it was to delete a physical port and not a virtual port. Only VPorts on physical ports can be deleted on an NPIV system. }} action {{ Software driver error. If this problem persists, report these errors to Technical Support. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_ERR "vport_delete failed: Cannot delete static vport.\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) vport_delete failed: Cannot delete static vport\\.$" description {{ Static VPorts cannot be deleted. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "Vport Deleted.\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Vport Deleted\\.$" description {{ A Vport was deleted. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "Vport discovery quiesce Wait: state x%x fc_flags x%x num_nodes x%x, waiting 1000 msecs total wait msecs x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Vport discovery quiesce Wait: state x([0-9a-f]{1,}) fc_flags x([0-9a-f]{1,}) num_nodes x([0-9a-f]{1,}), waiting 1000 msecs total wait msecs x([0-9a-f]{1,})$" description {{ Could not pause discovery on this VPort. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "Vport Enabled.\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Vport Enabled\\.$" description {{ The port had to be enabled after possible recovery from some errors. }} action {{ None required. }} class: software sl_severity: warning refcode: "" message: lpfc_printf_vlog KERN_ERR "VPort failed init, mbxCmd x%x READ_SPARM mbxStatus x%x, rc = x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) VPort failed init, mbxCmd x([0-9a-f]{1,}) READ_SPARM mbxStatus x([0-9a-f]{1,}), rc = x([0-9a-f]{1,})$" description {{ A pending mailbox command issued to initialize port, failed. DATA: (1) mbxCommand (2) mbxStatus (3) rc }} action {{ Software driver error. If this problem persists, report these errors to Technical Support. }} class: software sl_severity: error refcode: "" message: lpfc_printf_vlog KERN_INFO "Xmit ADISC ACC response iotag x%x xri: x%x, did x%x, nlp_flag x%x, nlp_state x%x rpi x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Xmit ADISC ACC response iotag x([0-9a-f]{1,}) xri: x([0-9a-f]{1,}), did x([0-9a-f]{1,}), nlp_flag x([0-9a-f]{1,}), nlp_state x([0-9a-f]{1,}) rpi x([0-9a-f]{1,})$" description {{ An ADISC ACC response for the specified IO tag has been sent. DATA: (1) xri (for SLI-4) (2) ulpContext (3) nlp_DID (4) nlp_flag (5) nlp_state (6) nlp_rpi }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "Xmit ELS ACC response tag x%x, XRI: x%x, DID: x%x, nlp_flag: x%x nlp_state: x%x RPI: x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Xmit ELS ACC response tag x([0-9a-f]{1,}), XRI: x([0-9a-f]{1,}), DID: x([0-9a-f]{1,}), nlp_flag: x([0-9a-f]{1,}) nlp_state: x([0-9a-f]{1,}) RPI: x([0-9a-f]{1,})$" description {{ An ELS accept response for the specified IO tag has been sent. DATA: (1) ulpContext (2) nlp_DID (3) nlp_flag (4) nlp_state (5) nlp_rpi }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "Xmit ELS command x%x to remote NPORT x%x I/O tag: x%x, port state: x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Xmit ELS command x([0-9a-f]{1,}) to remote NPORT x([0-9a-f]{1,}) I/O tag: x([0-9a-f]{1,}), port state: x([0-9a-f]{1,})$" description {{ Xmit ELS command to remote NPORT. DATA: (1) icmd->ulpIoTag (2) hba_state }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "Xmit ELS response x%x to remote NPORT x%x I/O tag: x%x, size: x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Xmit ELS response x([0-9a-f]{1,}) to remote NPORT x([0-9a-f]{1,}) I/O tag: x([0-9a-f]{1,}), size: x([0-9a-f]{1,})$" description {{ Xmit ELS response to remote NPORT. DATA: (1) icmd->ulpIoTag (2) size }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "Xmit ELS RJT x%x response tag x%x xri x%x, did x%x, nlp_flag x%x, nlp_state x%x, rpi x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Xmit ELS RJT x([0-9a-f]{1,}) response tag x([0-9a-f]{1,}) xri x([0-9a-f]{1,}), did x([0-9a-f]{1,}), nlp_flag x([0-9a-f]{1,}), nlp_state x([0-9a-f]{1,}), rpi x([0-9a-f]{1,})$" description {{ An ELS reject response with the specified error for the specified IO tag has been sent. DATA: (1) xri (for SLI-4) (2) ulpContext (3) nlp_DID (4) nlp_flag (5) nlp_state (6) nlp_rpi }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "Xmit ELS RPL ACC response tag x%x xri x%x, did x%x, nlp_flag x%x, nlp_state x%x, rpi x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Xmit ELS RPL ACC response tag x([0-9a-f]{1,}) xri x([0-9a-f]{1,}), did x([0-9a-f]{1,}), nlp_flag x([0-9a-f]{1,}), nlp_state x([0-9a-f]{1,}), rpi x([0-9a-f]{1,})$" description {{ An RPL ACC response for the specified IO tag has been sent. DATA: (1) xri (for SLI-4) (2) ulpContext (3) nlp_DID (4) nlp_flag (5) nlp_state (6) nlp_rpi }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "Xmit ELS RPS ACC response tag x%x xri x%x, did x%x, nlp_flag x%x, nlp_state x%x, rpi x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Xmit ELS RPS ACC response tag x([0-9a-f]{1,}) xri x([0-9a-f]{1,}), did x([0-9a-f]{1,}), nlp_flag x([0-9a-f]{1,}), nlp_state x([0-9a-f]{1,}), rpi x([0-9a-f]{1,})$" description {{ An RPS ACC response for the specified IO tag has been sent. DATA: (1) xri (for SLI-4) (2) ulpContext (3) nlp_DID (4) nlp_flag (5) nlp_state (6) nlp_rpi }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "Xmit PRLI ACC response tag x%x xri x%x, did x%x, nlp_flag x%x, nlp_state x%x, rpi x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Xmit PRLI ACC response tag x([0-9a-f]{1,}) xri x([0-9a-f]{1,}), did x([0-9a-f]{1,}), nlp_flag x([0-9a-f]{1,}), nlp_state x([0-9a-f]{1,}), rpi x([0-9a-f]{1,})$" description {{ A PRLI ACC response for the specified IO tag has been sent. DATA: (1) xri (for SLI-4) (2) ulpContext (3) nlp_DID (4) nlp_flag (5) nlp_state (6) nlp_rpi }} action {{ No action needed, informational. }} class: software type: info refcode: "" message: lpfc_printf_vlog KERN_INFO "Xmit RNID ACC response tag x%x xri x%x\n" regex lpfc_printf_vlog "^lpfc ([[:print:]]*): ([-]\?[0-9]{1,}):\\(([-]\?[0-9]{1,})\\):([-]\?[0-9]{1,}) Xmit RNID ACC response tag x([0-9a-f]{1,}) xri x([0-9a-f]{1,})$" description {{ A RNID ACC response for the specified IO tag has been sent. DATA: (1) ulpContext }} action {{ No action needed, informational. }} class: software type: info refcode: "" ppc64-diag-2.7.4/ela/message_catalog/with_regex/qla2xxx0000644000000000000000000015217313135275400017640 00000000000000subsystem: scsi file: "drivers/scsi/qla2xxx/qla_attr.c" message: qla_printk KERN_INFO "Firmware dump cleared on (%ld).\n" regex qla_printk "^qla2xxx ([[:print:]]*): Firmware dump cleared on \\(([-]\?[0-9]{1,})\\)\\.$" description {{ Previous firmware dump was cleared from memory. }} action {{ None recommended. }} class: firmware type: info refcode: "" message: qla_printk KERN_WARNING "Raw firmware dump ready for read on (%ld).\n" regex qla_printk "^qla2xxx ([[:print:]]*): Raw firmware dump ready for read on \\(([-]\?[0-9]{1,})\\)\\.$" description {{ Firmware dump now ready to be read. }} action {{ None recommended. }} class: firmware type: info refcode: "" message: qla_printk KERN_ERR "HBA not online, failing NVRAM update.\n" regex qla_printk "^qla2xxx ([[:print:]]*): HBA not online, failing NVRAM update\\.$" description {{ Application tried to write to NVRAM of adapter that is offline. }} action {{ None recommended. }} class: hardware sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to allocate memory for optrom retrieval (%x).\n" regex qla_printk "^qla2xxx ([[:print:]]*): Unable to allocate memory for optrom retrieval \\(([0-9a-f]{1,})\\)\\.$" description {{ System has low memory. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Invalid start region 0x%x/0x%x.\n" regex qla_printk "^qla2xxx ([[:print:]]*): Invalid start region 0x([0-9a-f]{1,})/0x([0-9a-f]{1,})\\.$" description {{ Invalid starting address of option rom memory. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to allocate memory for optrom update (%x).\n" regex qla_printk "^qla2xxx ([[:print:]]*): Unable to allocate memory for optrom update \\(([0-9a-f]{1,})\\)\\.$" description {{ System has low memory. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "HBA not online, failing flash update.\n" regex qla_printk "^qla2xxx ([[:print:]]*): HBA not online, failing flash update\\.$" description {{ Application tried to write to flash memory of adapter that is offline. }} action {{ None recommended. }} class: hardware sl_severity: warning refcode: "" message: qla_printk KERN_ERR "HBA not online, failing VPD update.\n" regex qla_printk "^qla2xxx ([[:print:]]*): HBA not online, failing VPD update\\.$" description {{ Application tried to write to vital product data of adapter that is offline. }} action {{ None recommended. }} class: hardware sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to allocate memory for VPD information update.\n" regex qla_printk "^qla2xxx ([[:print:]]*): Unable to allocate memory for VPD information update\\.$" description {{ System has low memory. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to allocate memory for SFP read-data.\n" regex qla_printk "^qla2xxx ([[:print:]]*): Unable to allocate memory for SFP read-data\\.$" description {{ System has low memory. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to read SFP data (%x/%x/%x).\n" regex qla_printk "^qla2xxx ([[:print:]]*): Unable to read SFP data \\(([0-9a-f]{1,})/([0-9a-f]{1,})/([0-9a-f]{1,})\\)\\.$" description {{ Firmware did not return any information for requested SFP data. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_INFO "Issuing ISP reset on (%ld).\n" regex qla_printk "^qla2xxx ([[:print:]]*): Issuing ISP reset on \\(([-]\?[0-9]{1,})\\)\\.$" description {{ Debug ASIC reset. }} action {{ None recommended. }} class: software type: info refcode: "" message: qla_printk KERN_INFO "Issuing MPI reset on (%ld).\n" regex qla_printk "^qla2xxx ([[:print:]]*): Issuing MPI reset on \\(([-]\?[0-9]{1,})\\)\\.$" description {{ Debug reset of 81xx MP firmware. }} action {{ None recommended. }} class: software type: info refcode: "" message: qla_printk KERN_ERR "MPI reset failed on (%ld).\n" regex qla_printk "^qla2xxx ([[:print:]]*): MPI reset failed on \\(([-]\?[0-9]{1,})\\)\\.$" description {{ MPI firmware reset failed during loopback test. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to allocate memory for XGMAC read-data.\n" regex qla_printk "^qla2xxx ([[:print:]]*): Unable to allocate memory for XGMAC read-data\\.$" description {{ System has low memory. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to read XGMAC data (%x).\n" regex qla_printk "^qla2xxx ([[:print:]]*): Unable to read XGMAC data \\(([0-9a-f]{1,})\\)\\.$" description {{ Unable to ethernet transmission statistics. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to allocate memory for DCBX TLV read-data.\n" regex qla_printk "^qla2xxx ([[:print:]]*): Unable to allocate memory for DCBX TLV read-data\\.$" description {{ System has low memory. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to read DCBX TLV data (%x).\n" regex qla_printk "^qla2xxx ([[:print:]]*): Unable to read DCBX TLV data \\(([0-9a-f]{1,})\\)\\.$" description {{ Unable to read data center bridging type-length-value data. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to create sysfs %s binary attribute (%d).\n" regex qla_printk "^qla2xxx ([[:print:]]*): Unable to create sysfs ([[:print:]]*) binary attribute \\(([-]\?[0-9]{1,})\\)\\.$" description {{ Error creating sysfs attribute. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_WARNING "Abort ISP active -- ignoring beacon request.\n" regex qla_printk "^qla2xxx ([[:print:]]*): Abort ISP active -- ignoring beacon request\\.$" description {{ Request to blink beacon ignored. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_INFO "VP entry id %d assigned.\n" regex qla_printk "^qla2xxx ([[:print:]]*): VP entry id ([-]\?[0-9]{1,}) assigned\\.$" description {{ Virtual port index of new NPIV port. }} action {{ None recommended. }} class: software type: info refcode: "" message: qla_printk KERN_WARNING "Can't create request queue for vp_idx:%d\n" regex qla_printk "^qla2xxx ([[:print:]]*): Can't create request queue for vp_idx:([-]\?[0-9]{1,})$" description {{ Could not create a separate request queue for new virtual port. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_WARNING "Queue delete failed.\n" regex qla_printk "^qla2xxx ([[:print:]]*): Queue delete failed\\.$" description {{ Could not delete request queue specific to a virtual port being deleted. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_INFO "vport %d deleted\n" regex qla_printk "^qla2xxx ([[:print:]]*): vport ([-]\?[0-9]{1,}) deleted$" description {{ Virtual port successfully deleted. }} action {{ None recommended. }} class: software type: info refcode: "" file: "drivers/scsi/qla2xxx/qla_bsg.c" message: qla_printk KERN_ERR "MPI reset failed on (%ld).\n" regex qla_printk "^qla2xxx ([[:print:]]*): MPI reset failed on \\(([-]\?[0-9]{1,})\\)\\.$" description {{ MPI firmware reset failed during loopback test. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" file: "drivers/scsi/qla2xxx/qla_dbg.c" message: qla_printk KERN_ERR "Failed to dump firmware (%x)!!!\n" regex qla_printk "^qla2xxx ([[:print:]]*): Failed to dump firmware \\(([0-9a-f]{1,})\\)!!!$" description {{ Procedure to produce a firmware dump failed. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_INFO "Firmware dump saved to temp buffer (%ld/%p).\n" regex qla_printk "^qla2xxx ([[:print:]]*): Firmware dump saved to temp buffer \\(([-]\?[0-9]{1,})/(\\(null\\)|([0]{0,7}[0-9a-f]{1,}))\\)\\.$" description {{ Procedure to produce firmware dump succeeded and is ready for retrieval. }} action {{ None recommended. }} class: software type: info refcode: "" message: qla_printk KERN_ERR "No buffer available for dump!!!\n" regex qla_printk "^qla2xxx ([[:print:]]*): No buffer available for dump!!!$" description {{ Memory buffer for firmware dump was never allocated. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" file: "drivers/scsi/qla2xxx/qla_dfs.c" message: qla_printk KERN_ERR "DebugFS: Unable to disable FCE (%d).\n" regex qla_printk "^qla2xxx ([[:print:]]*): DebugFS: Unable to disable FCE \\(([-]\?[0-9]{1,})\\)\\.$" description {{ Error flushing fibre channel event buffer. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "DebugFS: Unable to reinitialize FCE (%d).\n" regex qla_printk "^qla2xxx ([[:print:]]*): DebugFS: Unable to reinitialize FCE \\(([-]\?[0-9]{1,})\\)\\.$" description {{ Error reinitializing trace when ending a trace session. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "DebugFS: Unable to create root directory.\n" regex qla_printk "^qla2xxx ([[:print:]]*): DebugFS: Unable to create root directory\\.$" description {{ Unable to create the qla2xxx directory in the debugFS filesystem. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "DebugFS: Unable to create ha directory.\n" regex qla_printk "^qla2xxx ([[:print:]]*): DebugFS: Unable to create ha directory\\.$" description {{ Unable to create a directory for this adapter in DebugFS. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "DebugFS: Unable to fce node.\n" regex qla_printk "^qla2xxx ([[:print:]]*): DebugFS: Unable to fce node\\.$" description {{ Unable to create fibre channel event node in DebugFS. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" file: "drivers/scsi/qla2xxx/qla_init.c" message: qla_printk KERN_WARNING "Configuring PCI space...\n" regex qla_printk "^qla2xxx ([[:print:]]*): Configuring PCI space\\.\\.\\.$" description {{ Driver is configuring PCI configuration registers. }} action {{ None recommended. }} class: software type: info refcode: "" message: qla_printk KERN_INFO "Configure NVRAM parameters...\n" regex qla_printk "^qla2xxx ([[:print:]]*): Configure NVRAM parameters\\.\\.\\.$" description {{ Driver is reading NVRAM parameters and configuring driver settings with them. }} action {{ None recommended. }} class: software type: info refcode: "" message: qla_printk KERN_WARNING "Masking HBA WWPN %02x%02x%02x%02x%02x%02x%02x%02x (via NVRAM).\n" regex qla_printk "^qla2xxx ([[:print:]]*): Masking HBA WWPN ([0]{0,1}[0-9a-f]{1,})([0]{0,1}[0-9a-f]{1,})([0]{0,1}[0-9a-f]{1,})([0]{0,1}[0-9a-f]{1,})([0]{0,1}[0-9a-f]{1,})([0]{0,1}[0-9a-f]{1,})([0]{0,1}[0-9a-f]{1,})([0]{0,1}[0-9a-f]{1,}) \\(via NVRAM\\)\\.$" description {{ Masking this HBA from operating system based on NVRAM parameters. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_INFO "Verifying loaded RISC code...\n" regex qla_printk "^qla2xxx ([[:print:]]*): Verifying loaded RISC code\\.\\.\\.$" description {{ Verifying that the firmware image is valid. }} action {{ None recommended. }} class: software type: info refcode: "" message: qla_printk KERN_ERR "Unable to configure ISP84XX.\n" regex qla_printk "^qla2xxx ([[:print:]]*): Unable to configure ISP84XX\\.$" description {{ Error configuring 84xx CNA specific settings. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to initialize ISP84XX.\n" regex qla_printk "^qla2xxx ([[:print:]]*): Unable to initialize ISP84XX\\.$" description {{ Error initializing 84xx CNA specific firmware. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_WARNING "RISC CODE NOT loaded\n" regex qla_printk "^qla2xxx ([[:print:]]*): RISC CODE NOT loaded$" description {{ Not loading firmware from flash memory. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Wrong product ID = 0x%x,0x%x,0x%x\n" regex qla_printk "^qla2xxx ([[:print:]]*): Wrong product ID = 0x([0-9a-f]{1,}),0x([0-9a-f]{1,}),0x([0-9a-f]{1,})$" description {{ Bad product ID detected for 1Gb/s or 2Gb/s adapter. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Failed mailbox send register test\n" regex qla_printk "^qla2xxx ([[:print:]]*): Failed mailbox send register test$" description {{ Register communication test for adapter failed. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_WARNING "Firmware dump previously allocated.\n" regex qla_printk "^qla2xxx ([[:print:]]*): Firmware dump previously allocated\\.$" description {{ Memory for a firmware dump has already been allocated. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to allocate (%d KB) for FCE.\n" regex qla_printk "^qla2xxx ([[:print:]]*): Unable to allocate \\(([-]\?[0-9]{1,}) KB\\) for FCE\\.$" description {{ System has low memory. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to initialize FCE (%d).\n" regex qla_printk "^qla2xxx ([[:print:]]*): Unable to initialize FCE \\(([-]\?[0-9]{1,})\\)\\.$" description {{ Mailbox command to initialize the fibre channel event buffer. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_INFO "Allocated (%d KB) for FCE...\n" regex qla_printk "^qla2xxx ([[:print:]]*): Allocated \\(([-]\?[0-9]{1,}) KB\\) for FCE\\.\\.\\.$" description {{ Information about how much memory was allocated for the fibre channel event buffer. }} action {{ None recommended. }} class: software type: info refcode: "" message: qla_printk KERN_ERR "Unable to allocate (%d KB) for EFT.\n" regex qla_printk "^qla2xxx ([[:print:]]*): Unable to allocate \\(([-]\?[0-9]{1,}) KB\\) for EFT\\.$" description {{ System has low memory. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to initialize EFT (%d).\n" regex qla_printk "^qla2xxx ([[:print:]]*): Unable to initialize EFT \\(([-]\?[0-9]{1,})\\)\\.$" description {{ Mailbox command to initialize the event trace buffer failed. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_INFO "Allocated (%d KB) for EFT...\n" regex qla_printk "^qla2xxx ([[:print:]]*): Allocated \\(([-]\?[0-9]{1,}) KB\\) for EFT\\.\\.\\.$" description {{ Information about how much memory was allocated for the event trace buffer. }} action {{ None recommended. }} class: software type: info refcode: "" message: qla_printk KERN_ERR "Unable to allocate (%d KB) for firmware dump!!!\n" regex qla_printk "^qla2xxx ([[:print:]]*): Unable to allocate \\(([-]\?[0-9]{1,}) KB\\) for firmware dump!!!$" description {{ System has low memory. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_INFO "Allocated (%d KB) for firmware dump...\n" regex qla_printk "^qla2xxx ([[:print:]]*): Allocated \\(([-]\?[0-9]{1,}) KB\\) for firmware dump\\.\\.\\.$" description {{ Informational about how much memory was allocated for firmware dump. }} action {{ None recommended. }} class: software type: info refcode: "" message: qla_printk KERN_ERR "Unsupported FAC firmware (%d.%02d.%02d).\n" regex qla_printk "^qla2xxx ([[:print:]]*): Unsupported FAC firmware \\(([-]\?[0-9]{1,})\\.([-]\?[0]{0,1}[0-9]{1,})\\.([-]\?[0]{0,1}[0-9]{1,})\\)\\.$" description {{ Error getting information about flash access commands. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to update Serial Link options (%x).\n" regex qla_printk "^qla2xxx ([[:print:]]*): Unable to update Serial Link options \\(([0-9a-f]{1,})\\)\\.$" description {{ Error setting link parameters. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_WARNING "MSIX Handshake Disable Mode turned on\n" regex qla_printk "^qla2xxx ([[:print:]]*): MSIX Handshake Disable Mode turned on$" description {{ No MSI-X handshaking needed for this adapter. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_INFO "Waiting for LIP to complete...\n" regex qla_printk "^qla2xxx ([[:print:]]*): Waiting for LIP to complete\\.\\.\\.$" description {{ Waiting for link to stabilize. }} action {{ None recommended. }} class: software type: info refcode: "" message: qla_printk KERN_INFO "scsi(%ld): Waiting for LIP to complete...\n" regex qla_printk "^qla2xxx ([[:print:]]*): scsi\\(([-]\?[0-9]{1,})\\): Waiting for LIP to complete\\.\\.\\.$" description {{ Waiting for link to stabilize. }} action {{ None recommended. }} class: software type: info refcode: "" message: qla_printk KERN_WARNING "Cable is unplugged...\n" regex qla_printk "^qla2xxx ([[:print:]]*): Cable is unplugged\\.\\.\\.$" description {{ Adapter not connected to another physical port. }} action {{ None recommended. }} class: hardware sl_severity: warning refcode: "" message: qla_printk KERN_ERR "ERROR -- Unable to get host loop ID.\n" regex qla_printk "^qla2xxx ([[:print:]]*): ERROR -- Unable to get host loop ID\\.$" description {{ Could not get handle for local port. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Cannot get topology - retrying.\n" regex qla_printk "^qla2xxx ([[:print:]]*): Cannot get topology - retrying\\.$" description {{ Error getting connection type. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_WARNING "Topology - %s, Host Loop address 0x%x\n" regex qla_printk "^qla2xxx ([[:print:]]*): Topology - ([[:print:]]*), Host Loop address 0x([0-9a-f]{1,})$" description {{ Local port handle. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Inconsistent NVRAM detected: checksum=0x%x id=%c version=0x%x.\n" regex qla_printk "^qla2xxx ([[:print:]]*): Inconsistent NVRAM detected: checksum=0x([0-9a-f]{1,}) id=([[:print:]]) version=0x([0-9a-f]{1,})\\.$" description {{ NVRAM signature was invalid. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Falling back to functioning (yet invalid -- WWPN) defaults.\n" regex qla_printk "^qla2xxx ([[:print:]]*): Falling back to functioning \\(yet invalid -- WWPN\\) defaults\\.$" description {{ Using driver default NVRAM settings. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_WARNING "ZIO mode %d enabled; timer delay (%d us).\n" regex qla_printk "^qla2xxx ([[:print:]]*): ZIO mode ([-]\?[0-9]{1,}) enabled; timer delay \\(([-]\?[0-9]{1,}) us\\)\\.$" description {{ Zero interrupt i/o enabled. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to allocate fc remote port!\n" regex qla_printk "^qla2xxx ([[:print:]]*): Unable to allocate fc remote port!$" description {{ FC transport could not create remote port object. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "SNS scan failed -- assuming zero-entry result...\n" regex qla_printk "^qla2xxx ([[:print:]]*): SNS scan failed -- assuming zero-entry result\\.\\.\\.$" description {{ All name server queries failed. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_WARNING "Performing ISP error recovery - ha= %p.\n" regex qla_printk "^qla2xxx ([[:print:]]*): Performing ISP error recovery - ha= (\\(null\\)|([0]{0,7}[0-9a-f]{1,}))\\.$" description {{ About to perform an ASIC reset. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "ISP error recovery failed - board disabled\n" regex qla_printk "^qla2xxx ([[:print:]]*): ISP error recovery failed - board disabled$" description {{ ASIC reset failed so the adapter is being disabled. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "qla2x00_abort_isp: **** FAILED ****\n" regex qla_printk "^qla2xxx ([[:print:]]*): qla2x00_abort_isp: \\*\\*\\*\\* FAILED \\*\\*\\*\\*$" description {{ ASIC reset failed. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_WARNING "FW: Loading from flash (%x)...\n" regex qla_printk "^qla2xxx ([[:print:]]*): FW: Loading from flash \\(([0-9a-f]{1,})\\)\\.\\.\\.$" description {{ Firmware is loading from onboard flash memory. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to verify integrity of flash firmware image! Firmware data: %08x %08x %08x %08x!\n" regex qla_printk "^qla2xxx ([[:print:]]*): Unable to verify integrity of flash firmware image! Firmware data: ([0]{0,7}[0-9a-f]{1,}) ([0]{0,7}[0-9a-f]{1,}) ([0]{0,7}[0-9a-f]{1,}) ([0]{0,7}[0-9a-f]{1,})!$" description {{ Firmware image from onboard flash memory is invalid. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "[ERROR] Failed to load segment %d of firmware\n" regex qla_printk "^qla2xxx ([[:print:]]*): \\[ERROR] Failed to load segment ([-]\?[0-9]{1,}) of firmware$" description {{ Error copying firmware image to onboard RAM. }} action {{ None recommended. }} class: firmware sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Firmware image unavailable.\n" regex qla_printk "^qla2xxx ([[:print:]]*): Firmware image unavailable\\.$" description {{ Retrieving firmware image via request_firmware failed. }} action {{ None recommended. }} class: firmware sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to verify integrity of firmware image (%Zd)!\n" regex qla_printk "^qla2xxx ([[:print:]]*): Unable to verify integrity of firmware image \\(([-]\?[0-9]{1,})\\)!$" description {{ Firmware image retrieved via request_firmware is invalid. }} action {{ None recommended. }} class: firmware sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to verify integrity of firmware image!\n" regex qla_printk "^qla2xxx ([[:print:]]*): Unable to verify integrity of firmware image!$" description {{ Firmware image retrieved via request_firmware is invalid. }} action {{ None recommended. }} class: firmware sl_severity: warning refcode: "" message: qla_printk KERN_WARNING "FW: Loading via request-firmware...\n" regex qla_printk "^qla2xxx ([[:print:]]*): FW: Loading via request-firmware\\.\\.\\.$" description {{ Firmware image was retrieved via request_firmware. }} action {{ None recommended. }} class: firmware sl_severity: warning refcode: "" message: qla_printk KERN_WARNING "FW: Attempting to fallback to golden firmware...\n" regex qla_printk "^qla2xxx ([[:print:]]*): FW: Attempting to fallback to golden firmware\\.\\.\\.$" description {{ Falling back to golden firmware for 81xx adapter. }} action {{ None recommended. }} class: firmware sl_severity: warning refcode: "" message: qla_printk KERN_ERR "FW: Please update operational firmware...\n" regex qla_printk "^qla2xxx ([[:print:]]*): FW: Please update operational firmware\\.\\.\\.$" description {{ The operational firmware image of a 81xx adapter is corrupt and needs to be reloaded. }} action {{ None recommended. }} class: firmware sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Attempting retry of stop-firmware command...\n" regex qla_printk "^qla2xxx ([[:print:]]*): Attempting retry of stop-firmware command\\.\\.\\.$" description {{ Trying orderly shutdown of firmware. }} action {{ None recommended. }} class: firmware sl_severity: warning refcode: "" file: "drivers/scsi/qla2xxx/qla_isr.c" message: qla_printk KERN_ERR "Parity error -- HCCR=%x, Dumping firmware!\n" regex qla_printk "^qla2xxx ([[:print:]]*): Parity error -- HCCR=([0-9a-f]{1,}), Dumping firmware!$" description {{ A parity error was detected in a register or onboard RAM so perform a ASIC reset. }} action {{ None recommended. }} class: firmware sl_severity: warning refcode: "" message: qla_printk KERN_ERR "RISC paused -- HCCR=%x, Dumping firmware!\n" regex qla_printk "^qla2xxx ([[:print:]]*): RISC paused -- HCCR=([0-9a-f]{1,}), Dumping firmware!$" description {{ The ASIC was frozen so perform a reset of the ASIC. }} action {{ None recommended. }} class: firmware sl_severity: warning refcode: "" message: qla_printk KERN_ERR "IDC failed to post ACK.\n" regex qla_printk "^qla2xxx ([[:print:]]*): IDC failed to post ACK\\.$" description {{ Driver failed to ACK 81xx inter-driver communication event. }} action {{ None recommended. }} class: unknown sl_severity: warning refcode: "" message: qla_printk KERN_ERR "ISP System Error - mbx1=%xh mbx2=%xh mbx3=%xh mbx7=%xh.\n" regex qla_printk "^qla2xxx ([[:print:]]*): ISP System Error - mbx1=([0-9a-f]{1,})h mbx2=([0-9a-f]{1,})h mbx3=([0-9a-f]{1,})h mbx7=([0-9a-f]{1,})h\\.$" description {{ An internal system error occurred. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unrecoverable Hardware Error: adapter marked OFFLINE!\n" regex qla_printk "^qla2xxx ([[:print:]]*): Unrecoverable Hardware Error: adapter marked OFFLINE!$" description {{ An internal parity error occurred and the adapter may need to be replaced. }} action {{ None recommended. }} class: hardware sl_severity: warning refcode: "" message: qla_printk KERN_ERR "ISP Request Transfer Error (%x).\n" regex qla_printk "^qla2xxx ([[:print:]]*): ISP Request Transfer Error \\(([0-9a-f]{1,})\\)\\.$" description {{ Error transferring data from request queue. }} action {{ None recommended. }} class: unknown sl_severity: warning refcode: "" message: qla_printk KERN_ERR "ISP Response Transfer Error.\n" regex qla_printk "^qla2xxx ([[:print:]]*): ISP Response Transfer Error\\.$" description {{ Error transferring data from firmware to host response queue. }} action {{ None recommended. }} class: unknown sl_severity: warning refcode: "" message: qla_printk KERN_WARNING "LIP occurred (%x).\n" regex qla_printk "^qla2xxx ([[:print:]]*): LIP occurred \\(([0-9a-f]{1,})\\)\\.$" description {{ Fibre channel LIP occurred on the link. }} action {{ None recommended. }} class: unknown sl_severity: warning refcode: "" message: qla_printk KERN_WARNING "LOOP UP detected (%s Gbps).\n" regex qla_printk "^qla2xxx ([[:print:]]*): LOOP UP detected \\(([[:print:]]*) Gbps\\)\\.$" description {{ Local port link is up. }} action {{ None recommended. }} class: unknown sl_severity: warning refcode: "" message: qla_printk KERN_WARNING "LOOP DOWN detected (%x %x %x %x).\n" regex qla_printk "^qla2xxx ([[:print:]]*): LOOP DOWN detected \\(([0-9a-f]{1,}) ([0-9a-f]{1,}) ([0-9a-f]{1,}) ([0-9a-f]{1,})\\)\\.$" description {{ Local port link is down. }} action {{ None recommended. }} class: unknown sl_severity: warning refcode: "" message: qla_printk KERN_WARNING "LIP reset occurred (%x).\n" regex qla_printk "^qla2xxx ([[:print:]]*): LIP reset occurred \\(([0-9a-f]{1,})\\)\\.$" description {{ Fibre channel LIP reset occurred. }} action {{ None recommended. }} class: unknown sl_severity: warning refcode: "" message: qla_printk KERN_WARNING "Configuration change detected: value=%x.\n" regex qla_printk "^qla2xxx ([[:print:]]*): Configuration change detected: value=([0-9a-f]{1,})\\.$" description {{ There was a change in the connection status of the local port. }} action {{ None recommended. }} class: unknown sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Alert 84XX: panic recovery %04x %04x\n" regex qla_printk "^qla2xxx ([[:print:]]*): Alert 84XX: panic recovery ([0]{0,3}[0-9a-f]{1,}) ([0]{0,3}[0-9a-f]{1,})$" description {{ Internal panic recovered on a 84xx adapter. }} action {{ None recommended. }} class: unknown sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Alert 84XX: firmware version %x\n" regex qla_printk "^qla2xxx ([[:print:]]*): Alert 84XX: firmware version ([0-9a-f]{1,})$" description {{ Unknown asynchronous event from 84xx adapter. }} action {{ None recommended. }} class: firmware sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Alert 84xx: Invalid Alert %04x %04x %04x\n" regex qla_printk "^qla2xxx ([[:print:]]*): Alert 84xx: Invalid Alert ([0]{0,3}[0-9a-f]{1,}) ([0]{0,3}[0-9a-f]{1,}) ([0]{0,3}[0-9a-f]{1,})$" description {{ Unknown asynchronous event from 84xx adapter. }} action {{ None recommended. }} class: unknown sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Invalid SCSI completion handle %d.\n" regex qla_printk "^qla2xxx ([[:print:]]*): Invalid SCSI completion handle ([-]\?[0-9]{1,})\\.$" description {{ Command completion is for invalid command. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Invalid ISP SCSI completion handle\n" regex qla_printk "^qla2xxx ([[:print:]]*): Invalid ISP SCSI completion handle$" description {{ Command completion is for invalid command. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "%s: Invalid completion handle (%x).\n" regex qla_printk "^qla2xxx ([[:print:]]*): ([[:print:]]*): Invalid completion handle \\(([0-9a-f]{1,})\\)\\.$" description {{ Command completion is for invalid command. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "%s: Invalid completion handle (%x) -- timed-out.\n" regex qla_printk "^qla2xxx ([[:print:]]*): ([[:print:]]*): Invalid completion handle \\(([0-9a-f]{1,})\\) -- timed-out\\.$" description {{ SCSI layer has already timed out command. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "%s: SRB handle (%x) mismatch %x.\n" regex qla_printk "^qla2xxx ([[:print:]]*): ([[:print:]]*): SRB handle \\(([0-9a-f]{1,})\\) mismatch ([0-9a-f]{1,})\\.$" description {{ Command completion is for invalid command. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_WARNING "Command is NULL: already returned to OS (sp=%p)\n" regex qla_printk "^qla2xxx ([[:print:]]*): Command is NULL: already returned to OS \\(sp=(\\(null\\)|([0]{0,7}[0-9a-f]{1,}))\\)$" description {{ Command already completed back to SCSI layer. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Error entry - invalid handle\n" regex qla_printk "^qla2xxx ([[:print:]]*): Error entry - invalid handle$" description {{ Error status entry is invalid. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Additional code -- 0x55AA.\n" regex qla_printk "^qla2xxx ([[:print:]]*): Additional code -- 0x55AA\\.$" description {{ Extra debug information from checking the ASIC when it is frozen. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_WARNING "MSI-X: Failed to enable support -- %d/%d Retry with %d vectors\n" regex qla_printk "^qla2xxx ([[:print:]]*): MSI-X: Failed to enable support -- ([-]\?[0-9]{1,})/([-]\?[0-9]{1,}) Retry with ([-]\?[0-9]{1,}) vectors$" description {{ System could not give us the number of MSI-X vectors request so retry with less. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_WARNING "MSI-X: Failed to enable support, giving up -- %d/%d\n" regex qla_printk "^qla2xxx ([[:print:]]*): MSI-X: Failed to enable support, giving up -- ([-]\?[0-9]{1,})/([-]\?[0-9]{1,})$" description {{ Could not enable MSI-X support for this adapter. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "MSI-X: Unable to register handler -- %x/%d.\n" regex qla_printk "^qla2xxx ([[:print:]]*): MSI-X: Unable to register handler -- ([0-9a-f]{1,})/([-]\?[0-9]{1,})\\.$" description {{ Unable to register a specific MSI-X handler callback. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "MSI-X: Falling back-to INTa mode -- %d.\n" regex qla_printk "^qla2xxx ([[:print:]]*): MSI-X: Falling back-to INTa mode -- ([-]\?[0-9]{1,})\\.$" description {{ Could not enable MSI so falling back to INTx for interrupt handling. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Failed to reserve interrupt %d already in use.\n" regex qla_printk "^qla2xxx ([[:print:]]*): Failed to reserve interrupt ([-]\?[0-9]{1,}) already in use\\.$" description {{ Could not reserve INTx IRQ. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" file: "drivers/scsi/qla2xxx/qla_mbx.c" message: qla_printk KERN_ERR "Mailbox command timeout occurred. Scheduling ISP abort. eeh_busy: 0x%x\n" regex qla_printk "^qla2xxx ([[:print:]]*): Mailbox command timeout occurred\\. Scheduling ISP abort\\. eeh_busy: 0x([0-9a-f]{1,})$" description {{ Mailbox command to firmware timed out, reset ASIC. }} action {{ None recommended. }} class: firmware sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Mailbox command timeout occurred. Issuing ISP abort.\n" regex qla_printk "^qla2xxx ([[:print:]]*): Mailbox command timeout occurred\\. Issuing ISP abort\\.$" description {{ Mailbox command to firmware timed out, reset ASIC. }} action {{ None recommended. }} class: firmware sl_severity: warning refcode: "" file: "drivers/scsi/qla2xxx/qla_mid.c" message: qla_printk KERN_ERR "Couldn't delete req que %d\n" regex qla_printk "^qla2xxx ([[:print:]]*): Couldn't delete req que ([-]\?[0-9]{1,})$" description {{ Couldn't delete a request queue associated with a virtual port. }} action {{ None recommended. }} class: unknown sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Couldn't delete rsp que %d\n" regex qla_printk "^qla2xxx ([[:print:]]*): Couldn't delete rsp que ([-]\?[0-9]{1,})$" description {{ Couldn't delete a response queue associated with a virtual port. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "could not allocate memory for request que\n" regex qla_printk "^qla2xxx ([[:print:]]*): could not allocate memory for request que$" description {{ System has low memory. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Memory Allocation failed - request_ring\n" regex qla_printk "^qla2xxx ([[:print:]]*): Memory Allocation failed - request_ring$" description {{ Coherant DMA memory allocation failed. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "No resources to create additional request queue\n" regex qla_printk "^qla2xxx ([[:print:]]*): No resources to create additional request queue$" description {{ Adapter has no more resources to create another request queue. }} action {{ None recommended. }} class: unknown sl_severity: warning refcode: "" message: qla_printk KERN_ERR "qla25xx_create_req_que failed\n" regex qla_printk "^qla2xxx ([[:print:]]*): qla25xx_create_req_que failed$" description {{ Failed to create a new request queue (beyond the base request queue). }} action {{ None recommended. }} class: unknown sl_severity: warning refcode: "" message: qla_printk KERN_ERR "could not allocate memory for response que\n" regex qla_printk "^qla2xxx ([[:print:]]*): could not allocate memory for response que$" description {{ System has low memory. }} action {{ None recommended. }} class: unknown sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Memory Allocation failed - response_ring\n" regex qla_printk "^qla2xxx ([[:print:]]*): Memory Allocation failed - response_ring$" description {{ Coherant DMA memory allocation failed. }} action {{ None recommended. }} class: unknown sl_severity: warning refcode: "" message: qla_printk KERN_ERR "No resources to create additional response queue\n" regex qla_printk "^qla2xxx ([[:print:]]*): No resources to create additional response queue$" description {{ Adapter has no more resources to create another response queue. }} action {{ None recommended. }} class: unknown sl_severity: warning refcode: "" message: qla_printk KERN_WARNING "msix not enabled\n" regex qla_printk "^qla2xxx ([[:print:]]*): msix not enabled$" description {{ Adapter is not using MSI-X. }} action {{ None recommended. }} class: unknown sl_severity: warning refcode: "" message: qla_printk KERN_ERR "qla25xx_create_rsp_que failed\n" regex qla_printk "^qla2xxx ([[:print:]]*): qla25xx_create_rsp_que failed$" description {{ Failed to create a new response queue (beyond the base response queue). }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" file: "drivers/scsi/qla2xxx/qla_os.c" message: qla_printk KERN_ERR "Unable to allocate memory for request queue ptrs\n" regex qla_printk "^qla2xxx ([[:print:]]*): Unable to allocate memory for request queue ptrs$" description {{ System low on memory. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to allocate memory for response queue ptrs\n" regex qla_printk "^qla2xxx ([[:print:]]*): Unable to allocate memory for response queue ptrs$" description {{ System low on memory. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_WARNING "Firmware is not multi-queue capable\n" regex qla_printk "^qla2xxx ([[:print:]]*): Firmware is not multi-queue capable$" description {{ The firmware for this adapter is not capable of multiple request or response queues. }} action {{ None recommended. }} class: firmware sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Can't create request queue\n" regex qla_printk "^qla2xxx ([[:print:]]*): Can't create request queue$" description {{ A request to create a new request queue could not be fulfilled. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Response Queue create failed\n" regex qla_printk "^qla2xxx ([[:print:]]*): Response Queue create failed$" description {{ A request to create a new response queue failed. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "scsi(%ld:%d:%d): Abort handler timed out -- %lx\n" regex qla_printk "^qla2xxx ([[:print:]]*): scsi\\(([-]\?[0-9]{1,}):([-]\?[0-9]{1,}):([-]\?[0-9]{1,})\\): Abort handler timed out -- ([0-9a-f]{1,})$" description {{ A request to abort a command timed out. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "scsi(%ld:%d:%d): Abort command issued -- %d %lx %x.\n" regex qla_printk "^qla2xxx ([[:print:]]*): scsi\\(([-]\?[0-9]{1,}):([-]\?[0-9]{1,}):([-]\?[0-9]{1,})\\): Abort command issued -- ([-]\?[0-9]{1,}) ([0-9a-f]{1,}) ([0-9a-f]{1,})\\.$" description {{ A request to abort a command was issued from the SCSI layer. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_INFO "scsi(%ld:%d:%d): %s RESET ISSUED.\n" regex qla_printk "^qla2xxx ([[:print:]]*): scsi\\(([-]\?[0-9]{1,}):([-]\?[0-9]{1,}):([-]\?[0-9]{1,})\\): ([[:print:]]*) RESET ISSUED\\.$" description {{ A reset of a LUN was requested by the SCSI layer. }} action {{ None recommended. }} class: software type: info refcode: "" message: qla_printk KERN_INFO "scsi(%ld:%d:%d): %s RESET SUCCEEDED.\n" regex qla_printk "^qla2xxx ([[:print:]]*): scsi\\(([-]\?[0-9]{1,}):([-]\?[0-9]{1,}):([-]\?[0-9]{1,})\\): ([[:print:]]*) RESET SUCCEEDED\\.$" description {{ LUN reset succeeded. }} action {{ None recommended. }} class: software type: info refcode: "" message: qla_printk KERN_ERR "scsi(%ld:%d:%d): %s RESET FAILED: %s.\n" regex qla_printk "^qla2xxx ([[:print:]]*): scsi\\(([-]\?[0-9]{1,}):([-]\?[0-9]{1,}):([-]\?[0-9]{1,})\\): ([[:print:]]*) RESET FAILED: ([[:print:]]*)\\.$" description {{ LUN reset failed. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_INFO "scsi(%ld:%d:%d): BUS RESET ISSUED.\n" regex qla_printk "^qla2xxx ([[:print:]]*): scsi\\(([-]\?[0-9]{1,}):([-]\?[0-9]{1,}):([-]\?[0-9]{1,})\\): BUS RESET ISSUED\\.$" description {{ A bus reset was requested by the SCSI layer. }} action {{ None recommended. }} class: software type: info refcode: "" message: qla_printk KERN_INFO "qla2xxx_eh_bus_reset reset succeeded.\n" regex qla_printk "^qla2xxx ([[:print:]]*): qla2xxx_eh_bus_reset reset succeeded\\.$" description {{ bus reset succeeded. }} action {{ None recommended. }} class: software type: info refcode: "" message: qla_printk KERN_INFO "scsi(%ld:%d:%d): ADAPTER RESET ISSUED.\n" regex qla_printk "^qla2xxx ([[:print:]]*): scsi\\(([-]\?[0-9]{1,}):([-]\?[0-9]{1,}):([-]\?[0-9]{1,})\\): ADAPTER RESET ISSUED\\.$" description {{ A reset of the adapter was requested by the SCSI layer. }} action {{ None recommended. }} class: software type: info refcode: "" message: qla_printk KERN_INFO "qla2xxx_eh_host_reset reset succeeded.\n" regex qla_printk "^qla2xxx ([[:print:]]*): qla2xxx_eh_host_reset reset succeeded\\.$" description {{ Adapter reset succeeded. }} action {{ None recommended. }} class: software type: info refcode: "" message: qla_printk KERN_ERR "Failed to reserve PIO/MMIO regions (%s)\n" regex qla_printk "^qla2xxx ([[:print:]]*): Failed to reserve PIO/MMIO regions \\(([[:print:]]*)\\)$" description {{ PCI layer could not reserve device resources. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Invalid PCI I/O region size (%s)...\n" regex qla_printk "^qla2xxx ([[:print:]]*): Invalid PCI I/O region size \\(([[:print:]]*)\\)\\.\\.\\.$" description {{ PCI I/O memory region for this adapter is an invalid size. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_WARNING "region #0 not a PIO resource (%s)...\n" regex qla_printk "^qla2xxx ([[:print:]]*): region #0 not a PIO resource \\(([[:print:]]*)\\)\\.\\.\\.$" description {{ Memory region 0 on the adapter is not a port I/O resource. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "region #1 not an MMIO resource (%s), aborting\n" regex qla_printk "^qla2xxx ([[:print:]]*): region #1 not an MMIO resource \\(([[:print:]]*)\\), aborting$" description {{ Memory region 1 on the adapter isn't a memory-mapped I/O resource so abort configuration. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Invalid PCI mem region size (%s), aborting\n" regex qla_printk "^qla2xxx ([[:print:]]*): Invalid PCI mem region size \\(([[:print:]]*)\\), aborting$" description {{ The memory-mapped I/O region of the adapter is an invalid size so abort configuration. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "cannot remap MMIO (%s), aborting\n" regex qla_printk "^qla2xxx ([[:print:]]*): cannot remap MMIO \\(([[:print:]]*)\\), aborting$" description {{ ioremap() operation to map device memory into the kernel address space failed so abort configuration. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_INFO "MSI-X vector count: %d\n" regex qla_printk "^qla2xxx ([[:print:]]*): MSI-X vector count: ([-]\?[0-9]{1,})$" description {{ Number of MSI-X vectors for this adapter. }} action {{ None recommended. }} class: software type: info refcode: "" message: qla_printk KERN_WARNING "BAR 3 not enabled\n" regex qla_printk "^qla2xxx ([[:print:]]*): BAR 3 not enabled$" description {{ This adapter is not capable of multiple request and response queues. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_INFO "Found an ISP%04X, irq %d, iobase 0x%p\n" regex qla_printk "^qla2xxx ([[:print:]]*): Found an ISP([0]{0,3}[0-9A-F]{1,}), irq ([-]\?[0-9]{1,}), iobase 0x(\\(null\\)|([0]{0,7}[0-9a-f]{1,}))$" description {{ Information about adapter just found in probe routine. }} action {{ None recommended. }} class: software type: info refcode: "" message: qla_printk KERN_ERR "[ERROR] Failed to allocate memory for adapter\n" regex qla_printk "^qla2xxx ([[:print:]]*): \\[ERROR] Failed to allocate memory for adapter$" description {{ System has low memory. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "[ERROR] Failed to allocate memory for scsi_host\n" regex qla_printk "^qla2xxx ([[:print:]]*): \\[ERROR] Failed to allocate memory for scsi_host$" description {{ System has low memory. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "[ERROR] Failed to allocate memory for queue pointers\n" regex qla_printk "^qla2xxx ([[:print:]]*): \\[ERROR] Failed to allocate memory for queue pointers$" description {{ System has low memory. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Failed to initialize adapter\n" regex qla_printk "^qla2xxx ([[:print:]]*): Failed to initialize adapter$" description {{ Error starting firmware. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_WARNING "Can't create queues, falling back to single queue mode\n" regex qla_printk "^qla2xxx ([[:print:]]*): Can't create queues, falling back to single queue mode$" description {{ Setting up multiqueue mode failed so fall back to a single request and response queue. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to start DPC thread!\n" regex qla_printk "^qla2xxx ([[:print:]]*): Unable to start DPC thread!$" description {{ Could not start deferred procedure kernel thread. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_INFO " QLogic Fibre Channel HBA Driver: %s QLogic %s - %s ISP%04X: %s @ %s hdma%c, host#=%ld, fw=%s\n" regex qla_printk "^qla2xxx ([[:print:]]*): QLogic Fibre Channel HBA Driver: ([[:print:]]*) QLogic ([[:print:]]*) - ([[:print:]]*) ISP([0]{0,3}[0-9A-F]{1,}): ([[:print:]]*) @ ([[:print:]]*) hdma([[:print:]]), host#=([-]\?[0-9]{1,}), fw=([[:print:]]*)$" description {{ Info about adapter just configured. }} action {{ None recommended. }} class: software type: info refcode: "" message: qla_printk KERN_ERR "Unable to allocate memory for rsp\n" regex qla_printk "^qla2xxx ([[:print:]]*): Unable to allocate memory for rsp$" description {{ System low on memory. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to allocate memory for rsp_ring\n" regex qla_printk "^qla2xxx ([[:print:]]*): Unable to allocate memory for rsp_ring$" description {{ System low on memory. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to allocate memory for npiv info\n" regex qla_printk "^qla2xxx ([[:print:]]*): Unable to allocate memory for npiv info$" description {{ System low on memory. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "qla2x00_do_dpc: dpc_flags: %lx\n" regex qla_printk "^qla2xxx ([[:print:]]*): qla2x00_do_dpc: dpc_flags: ([0-9a-f]{1,})$" description {{ Allocating Scsi_host struct from SCSI layer failed. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Loop down - aborting ISP.\n" regex qla_printk "^qla2xxx ([[:print:]]*): Loop down - aborting ISP\\.$" description {{ Local port has been down for over 4 minutes, reset ASIC. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "RISC paused -- mmio_enabled, Dumping firmware!\n" regex qla_printk "^qla2xxx ([[:print:]]*): RISC paused -- mmio_enabled, Dumping firmware!$" description {{ ASIC is frozen after a AER recovery so perform a firware dump. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Can't re-enable PCI device after reset.\n" regex qla_printk "^qla2xxx ([[:print:]]*): Can't re-enable PCI device after reset\\.$" description {{ Adapter failed to restart after a PCIe slot reset. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "the device failed to resume I/O from slot/link_reset\n" regex qla_printk "^qla2xxx ([[:print:]]*): the device failed to resume I/O from slot/link_reset$" description {{ Adapter failed to restart after AER recovery. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" file: "drivers/scsi/qla2xxx/qla_sup.c" message: qla_printk KERN_ERR "Inconsistent FLTL detected: checksum=0x%x.\n" regex qla_printk "^qla2xxx ([[:print:]]*): Inconsistent FLTL detected: checksum=0x([0-9a-f]{1,})\\.$" description {{ Firmware Layout Table signature not valid. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "NPIV-Config: Failed to create vport [%02x]: wwpn=%llx wwnn=%llx.\n" regex qla_printk "^qla2xxx ([[:print:]]*): NPIV-Config: Failed to create vport \\[([0]{0,1}[0-9a-f]{1,})]: wwpn=([0-9a-f]{1,}) wwnn=([0-9a-f]{1,})\\.$" description {{ Predefined virtual port stored in flash could not be created. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to allocate memory for optrom burst write (%x KB).\n" regex qla_printk "^qla2xxx ([[:print:]]*): Unable to allocate memory for optrom burst write \\(([0-9a-f]{1,}) KB\\)\\.$" description {{ Coherant DMA memory allocation failed. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to unprotect flash for update.\n" regex qla_printk "^qla2xxx ([[:print:]]*): Unable to unprotect flash for update\\.$" description {{ Turning off write-protection for onboard flash memory failed. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_WARNING "Unable to burst-write optrom segment (%x/%x/%llx).\n" regex qla_printk "^qla2xxx ([[:print:]]*): Unable to burst-write optrom segment \\(([0-9a-f]{1,})/([0-9a-f]{1,})/([0-9a-f]{1,})\\)\\.$" description {{ Cannot use fast flash write method so use slower method. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to protect flash after update.\n" regex qla_printk "^qla2xxx ([[:print:]]*): Unable to protect flash after update\\.$" description {{ Reenable of write protection for onboard flash memory failed. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to update fw options (beacon on).\n" regex qla_printk "^qla2xxx ([[:print:]]*): Unable to update fw options \\(beacon on\\)\\.$" description {{ Unable to set beacon blinking functionality. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to update fw options (beacon off).\n" regex qla_printk "^qla2xxx ([[:print:]]*): Unable to update fw options \\(beacon off\\)\\.$" description {{ Unable to turn off beacon blinking functionality. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to get fw options (beacon off).\n" regex qla_printk "^qla2xxx ([[:print:]]*): Unable to get fw options \\(beacon off\\)\\.$" description {{ Unable to read firmware options for this adapter. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_ERR "Unable to allocate memory for optrom burst read (%x KB).\n" regex qla_printk "^qla2xxx ([[:print:]]*): Unable to allocate memory for optrom burst read \\(([0-9a-f]{1,}) KB\\)\\.$" description {{ Coherant DMA memory allocation failed. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" message: qla_printk KERN_WARNING "Unable to burst-read optrom segment (%x/%x/%llx).Reverting to slow-read\n" regex qla_printk "^qla2xxx ([[:print:]]*): Unable to burst-read optrom segment \\(([0-9a-f]{1,})/([0-9a-f]{1,})/([0-9a-f]{1,})\\)\\.Reverting to slow-read$" description {{ Cannot use fast flash read method so use slower method. }} action {{ None recommended. }} class: software sl_severity: warning refcode: "" ppc64-diag-2.7.4/ela/event_lex.l0000644000000000000000000000447513135275400013172 00000000000000%{ /* * Tokenizer for event catalog * * Copyright (C) International Business Machines Corp., 2009 * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #define CATALOGS_IMPLEMENTATION #include "catalogs.h" #include "ev.tab.h" #include #include #include #include extern EventCtlgParser event_ctlg_parser; static EventCtlgParser *pc = &event_ctlg_parser; %} %option noyywrap %% action { return KW_ACTION; } class { return KW_CLASS; } copy { return KW_COPY; } description { return KW_DESCRIPTION; } devspec { return KW_DEVSPEC; } exception { return KW_EXCEPTION; } file { return KW_FILE; } filter { return KW_FILTER; } message { return KW_MESSAGE; } priority { return KW_PRIORITY; } refcode { return KW_REFCODE; } regex { return KW_REGEX; } sl_severity { return KW_SL_SEVERITY; } subsystem { return KW_SUBSYSTEM; } type { return KW_TYPE; } [_A-Za-z][A-Za-z0-9_]* { char *name; if (! (name = strdup((const char*)yytext)) ) { perror("strdup"); return ERRTOK; } evlval.sval = name; return TK_NAME; } \" { char *s = pc->get_string(1); if (!s) return ERRTOK; evlval.sval = s; return TK_STRING; } \{\{ { char *s = pc->get_text_block(); if (!s) return ERRTOK; evlval.sval = s; return TK_TEXTBLOCK; } [ \t\r] ; /* Skip white space. */ \n { pc->lineno++; } "/*" { if (pc->skip_comment() < 0) return ERRTOK; } . { return yytext[0]; /* Pass through any other characters. */ } %% /* unput is a macro, but we need a function pointer. */ static void unput_func(int c) { unput(c); } void EventCtlgParser::init_lex(void) { YY_FLUSH_BUFFER; yyrestart(file); lineno = 1; p_input = yyinput; p_unput = unput_func; } ppc64-diag-2.7.4/ela/event_gram.y0000644000000000000000000001334613135275400013342 00000000000000%{ /* * Grammars for events catalog and exceptions catalog * * Copyright (C) International Business Machines Corp., 2009 * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #define CATALOGS_IMPLEMENTATION #include #include "catalogs.h" extern EventCtlgParser event_ctlg_parser; static EventCtlgParser *pc = &event_ctlg_parser; extern EventCatalog event_catalog; static SyslogEvent *event; static EventCtlgFile *driver; extern ExceptionCatalog exception_catalog; /* Why doesn't yacc declare this? */ extern int yylex(void); void yyerror(const char *s); %} /* Note: Tokens of type sval are all strdup-ed. */ %union { int ival; /* keyword, punctuation */ char *sval; /* string, name, text block */ SyslogEvent *event; EventCtlgFile *driver; MessageFilter *filter; } %token KW_ACTION KW_CLASS KW_COPY KW_DESCRIPTION %token KW_DEVSPEC KW_EXCEPTION KW_FILE KW_FILTER %token KW_MESSAGE KW_PRIORITY KW_REFCODE KW_REGEX %token KW_SL_SEVERITY KW_SUBSYSTEM KW_TYPE %token TK_STRING TK_NAME TK_TEXTBLOCK %token ERRTOK %type catalog_file driver_file exceptions_file %type header exception %type subsystem_stmt %type filter_expr %type entry %type message_stmt message_exception_stmt %type description_stmt action_stmt exception_stmt %% catalog_file : driver_file | exceptions_file ; driver_file : header entries ; header : subsystem_stmt optional_header_stmts { event_catalog.register_driver($1); $$ = 0; /* avoid yacc warning */ } ; subsystem_stmt : KW_SUBSYSTEM ':' TK_NAME { driver = new EventCtlgFile(pc->pathname, $3); $$ = driver; free($3); } optional_header_stmts: header_stmts | /* NULL */ ; header_stmts : header_stmt | header_stmts header_stmt ; header_stmt : copy | devspec_stmt | filter_stmt ; copy : '@' KW_COPY TK_NAME TK_TEXTBLOCK { driver->add_text_copy($3, $4); free($3); free($4); } ; devspec_stmt : KW_DEVSPEC '(' TK_NAME ')' '=' TK_STRING { driver->add_devspec($3, $6); free($3); free($6); } ; filter_stmt : KW_FILTER ':' filter_expr { driver->add_filter($3); } ; filter_expr : TK_NAME '=' TK_STRING { $$ = new MessageFilter($1, '=', $3); free($1); free($3); } ; entries : entry_or_file | entries entry_or_file ; entry_or_file : entry { event_catalog.register_event($1); } | file_stmt ; file_stmt : KW_FILE ':' TK_STRING { driver->set_source_file($3); free($3); } ; entry : message_stmt optional_regex_stmts explanation { $$ = $1; } | message_exception_stmt optional_regex_stmts | error { $$ = NULL; } ; message_stmt : KW_MESSAGE ':' TK_NAME TK_STRING { event = new SyslogEvent($3, "", $4, driver); $$ = event; free($3); free($4); } | KW_MESSAGE ':' TK_NAME TK_NAME TK_STRING { event = new SyslogEvent($3, $4, $5, driver); $$ = event; free($3); free($4); free($5); } ; optional_regex_stmts : regex_stmts | /* NULL */ ; regex_stmts : regex_stmt | regex_stmts regex_stmt ; regex_stmt : KW_REGEX TK_NAME TK_STRING { event->set_regex($2, $3); free($2); free($3); } ; explanation : addl_stmts | exception_stmt { event->except($1); free($1); } ; /* * message[defensive]: printk "failed to set up thing\n" * is shorthand for * message: printk "failed to set up thing\n" exception: defensive */ message_exception_stmt: KW_MESSAGE '[' TK_NAME ']' ':' TK_NAME TK_STRING { event = new SyslogEvent($6, "", $7, driver); $$ = event; event->except($3); free($3); free($6); free($7); } | KW_MESSAGE '[' TK_NAME ']' ':' TK_NAME TK_NAME TK_STRING { event = new SyslogEvent($6, $7, $8, driver); $$ = event; event->except($3); free($3); free($6); free($7); free($8); } ; addl_stmts : addl_stmt | addl_stmts addl_stmt ; addl_stmt: description_stmt { event->set_description($1); free($1); // $$ = 0; } | action_stmt { event->set_action($1); free($1); // $$ = 0; } | class_stmt | type_stmt | sl_severity_stmt | priority_stmt | refcode_stmt ; exception_stmt : KW_EXCEPTION ':' TK_NAME { $$ = $3; } ; description_stmt : KW_DESCRIPTION TK_TEXTBLOCK { $$ = $2; } ; action_stmt : KW_ACTION TK_TEXTBLOCK { $$ = $2; } ; class_stmt : KW_CLASS ':' TK_NAME { event->set_class($3); free($3); } ; type_stmt : KW_TYPE ':' TK_NAME { event->set_type($3); free($3); } sl_severity_stmt : KW_SL_SEVERITY ':' TK_NAME { event->set_sl_severity($3); free($3); } priority_stmt : KW_PRIORITY ':' TK_NAME { event->set_priority($3); free($3); } refcode_stmt : KW_REFCODE ':' TK_STRING { event->set_refcode($3); free($3); } exceptions_file : exception | exceptions_file exception ; exception : exception_stmt description_stmt action_stmt { exception_catalog.add(pc, $1, $2, $3); free($1); free($2); free($3); $$ = 0; } ; %% /* AKA everror() */ void yyerror(const char *s) { fprintf(stderr, "%s:%d: %s\n", pc->pathname, pc->lineno, s); } ppc64-diag-2.7.4/ela/reporter_lex.l0000644000000000000000000000401413135275400013700 00000000000000%{ /* * Tokenizer for reporters catalog * * Copyright (C) International Business Machines Corp., 2009, 2010 * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #define CATALOGS_IMPLEMENTATION #include "catalogs.h" #include "rr.tab.h" #include #include extern ReporterCtlgParser reporter_ctlg_parser; static ReporterCtlgParser *pc = &reporter_ctlg_parser; %} %option noyywrap %% aliases { return KW_ALIASES; } device_arg { return KW_DEVICE_ARG; } meta_reporter { return KW_META_REPORTER; } prefix_args { return KW_PREFIX_ARGS; } prefix_format { return KW_PREFIX_FORMAT; } reporter { return KW_REPORTER; } source { return KW_SOURCE; } variants { return KW_VARIANTS; } [_A-Za-z][A-Za-z0-9_]* { char *name; if (! (name = strdup((const char*)yytext)) ) { perror("strdup"); return ERRTOK; } rrlval.sval = name; return TK_NAME; } \" { char *s = pc->get_string(1); if (!s) return ERRTOK; rrlval.sval = s; return TK_STRING; } [ \t\r] ; /* Skip white space. */ \n { pc->lineno++; } "/*" { if (pc->skip_comment() < 0) return ERRTOK; } . { return yytext[0]; /* Pass through any other characters. */ } %% /* unput is a macro, but we need a function pointer. */ static void unput_func(int c) { unput(c); } void ReporterCtlgParser::init_lex(void) { YY_FLUSH_BUFFER; yyrestart(file); lineno = 1; p_input = yyinput; p_unput = unput_func; } ppc64-diag-2.7.4/ela/reporter_gram.y0000644000000000000000000000770113135275400014061 00000000000000%{ /* * Grammar for reporters catalog * * Copyright (C) International Business Machines Corp., 2009 * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #define CATALOGS_IMPLEMENTATION #include #include "catalogs.h" extern ReporterCtlgParser reporter_ctlg_parser; static ReporterCtlgParser *pc = &reporter_ctlg_parser; extern ReporterCatalog reporter_catalog; static Reporter *reporter; static MetaReporter *meta_reporter; static vector *name_list; static vector *alias_list; /* Why doesn't yacc declare this? */ extern int yylex(void); void yyerror(const char *s); %} /* Note: Tokens of type sval are all strdup-ed. */ %union { int ival; /* keyword, punctuation */ char *sval; /* string, name */ Reporter *reporter; MetaReporter *meta_reporter; vector *name_list; ReporterAlias *alias; vector *alias_list; } %token KW_ALIASES KW_META_REPORTER KW_PREFIX_ARGS KW_PREFIX_FORMAT %token KW_REPORTER KW_SOURCE KW_VARIANTS KW_DEVICE_ARG %token TK_STRING TK_NAME %token ERRTOK %type reporter_entry reporter_stmt %type meta_reporter_entry meta_reporter_stmt %type source_stmt %type name_list %type name_and_lvl %type alias_list %% catalog : entry | catalog entry ; entry : reporter_entry { reporter_catalog.register_reporter($1); } | meta_reporter_entry { reporter_catalog.register_meta_reporter($1); } | error ; reporter_entry : reporter_stmt source_stmt aliases_stmt prefix_format_stmt prefix_args_stmt device_arg_stmt { $$ = $1; } ; meta_reporter_entry : meta_reporter_stmt variants_stmt { $$ = $1; } ; meta_reporter_stmt : KW_META_REPORTER ':' TK_NAME { meta_reporter = new MetaReporter($3); free($3); $$ = meta_reporter; } ; variants_stmt : KW_VARIANTS ':' name_list { meta_reporter->set_variant_names($3); } ; reporter_stmt : KW_REPORTER ':' name_and_lvl { reporter = new Reporter($3); $$ = reporter; } ; source_stmt : KW_SOURCE ':' TK_NAME { reporter->set_source($3); free($3); } ; name_list : TK_NAME { name_list = new vector(); name_list->push_back($1); $$ = name_list; free($1); } | name_list TK_NAME { name_list->push_back($2); $$ = name_list; free($2); } ; name_and_lvl : TK_NAME { $$ = new ReporterAlias($1); free($1); } | TK_NAME '(' TK_NAME ')' { $$ = new ReporterAlias($1, $3); free($1); free($3); } ; alias_list : name_and_lvl { alias_list = new vector(); alias_list->push_back($1); $$ = alias_list; } | alias_list name_and_lvl { alias_list->push_back($2); $$ = alias_list; } ; aliases_stmt : KW_ALIASES ':' alias_list { reporter->set_aliases($3); } | /*NULL*/ ; prefix_format_stmt : KW_PREFIX_FORMAT ':' TK_STRING { reporter->set_prefix_format($3); free($3); } | /*NULL*/ ; prefix_args_stmt : KW_PREFIX_ARGS ':' name_list { reporter->set_prefix_args($3); } | /*NULL*/ ; device_arg_stmt : KW_DEVICE_ARG ':' TK_NAME { reporter->set_device_arg($3); free($3); } | /*NULL*/ ; %% /* AKA rrerror() */ void yyerror(const char *s) { fprintf(stderr, "%s:%d: %s\n", pc->pathname, pc->lineno, s); } ppc64-diag-2.7.4/lpd/0000755000000000000000000000000013135275553011121 500000000000000ppc64-diag-2.7.4/lpd/man/0000755000000000000000000000000013135275553011674 500000000000000ppc64-diag-2.7.4/lpd/man/lp_diag.80000644000000000000000000000165213135275400013277 00000000000000.\" .\" Copyright (C) 2012 International Business Machines .\" Author : Vasant Hegde .\" .TH LP_DIAG 8 "Dec 2012" Linux "PowerLinux Service Tools" .SH NAME lp_diag - Light Path Diagnostics .SH SYNOPSIS .nf lp_diag [\fB-V\fR] [\fB-h\fR] .fi .SH DESCRIPTION .P The \fBlp_diag\fR utility is used to view and manipulate the service indicators (LEDs). It provides curses based interface. Using \fBlp_diag\fR one can perform below tasks : Set System Attention Indicator to NORMAL Set ALL Identify Indicator to NORMAL List all identify indicators along with their current status (on or off) Modify identify indicator(s) state (on or off) .B lp_diag currently supports a limited number of device drivers and SES enclosures. .SH OPTIONS .TP .B \-V Display the version of the command and exit. .TP .B \-h Print the usage message and exit. .SH "SEE ALSO" .BR usysident (8), .BR usysattn (8) ppc64-diag-2.7.4/lpd/man/usysattn.80000644000000000000000000000420313135275400013565 00000000000000.\" .\" Copyright (C) 2004, 2012 International Business Machines .\" .\" Note: .\" This man page is moved from powerpc-util package to here. .\" Author : Michael Strosaker .\" Updates: Vasant Hegde .\" .TH USYSATTN 8 "Dec 2012" Linux "PowerLinux Service Tools" .SH NAME usysattn, usysfault \- operate system attention and fault indicators .SH SYNOPSIS .nf \fB/usr/sbin/usysattn \fR[\fB-l \fI\fR [\fB-s normal\fR] [\fB-t\fR]] [\fB-V\fR] [\fB-h\fR] \fB/usr/sbin/usysfault \fR[\fB-l \fI\fR [\fB-s normal\fR] [\fB-t\fR]] [\fB-V\fR] [\fB-h\fR] .fi .SH DESCRIPTION .P The \fIusysattn\fR utility is used to view and manipulate the system attention and fault indicators (LEDs) on IBM Power Systems servers. The first location code displayed by \fIusysattn\fR is system attention indicator and rest of the location codes are fault indicators. These indicators are turned on automatically when a serviceable event is received. These identifiers are specified by location code. .P When run without arguments, \fIusysattn\fR will print a list of all the fault indicators on the system along with their current status (on or off). The \fB\-l\fR option can be used to specify a particular indicator. If \fB\-l\fR is the only argument, the status of that indicator will be printed. If \fB\-s\fR \fInormal\fR is specified along with the \fB\-l\fR argument, the indicator will be turned off. .P .B NOTE: Ensure that there are no outstanding service actions to be taken on this system before turning off the system attention indicator. .SH OPTIONS .TP .B \-l \fIlocation_code Specify the location code of the indicator. .TP .B \-s normal Must be used with the \fB\-l\fR option; turns the specified indicator off. .TP .B \-t Truncate the location code if necessary. If an indicator is not available at the specified location, this option will continuously trim the last clause off of the location code in an attempt to find an indicator near the device. .TP .B \-V Display the version of the command and exit. .TP .B \-h Print the usage message and exit. .SH "SEE ALSO" .BR lp_diag (8), .BR usysident (8) ppc64-diag-2.7.4/lpd/man/usysident.80000644000000000000000000000422213135275400013723 00000000000000.\" .\" Copyright (C) 2004, 2012 International Business Machines .\" .\" Note: .\" This man page is moved from powerpc-util package to here. .\" Author : Michael Strosaker .\" Updates: Vasant Hegde .\" .TH USYSIDENT 8 "Dec 2012" Linux "PowerLinux Service Tools" .SH NAME usysident \- operate device identification indicators .SH SYNOPSIS .nf \fB/usr/sbin/usysident \fR[\fB-l \fI\fR [\fB-s normal\fR|\fBidentify\fR] [\fB-t\fR]] \fB/usr/sbin/usysident \fR[\fB-d \fI\fR [\fB-s normal\fR|\fBidentify\fR] [\fB-t\fR]] \fB/usr/sbin/usysident \fR[\fB-V\fR] \fB/usr/sbin/usysident \fR[\fB-h\fR] .fi .SH DESCRIPTION .P The \fIusysident\fR utility is used to view and manipulate the indicators (LEDs) that identify certain devices on IBM Power Systems servers. These identifiers are specified by location code; location codes can be retrieved by running lscfg. .P When run without arguments, \fIusysident\fR will print a list of all of the identification indicators on the system along with their current status (on or off). The \fB\-l\fR or \fB\-d\fR options can be used to specify a particular indicator, by location code or logical device name respectively. If \fB\-l\fR or \fB\-d\fR is the only argument, the status of that indicator will be printed. If the \fB\-s\fR argument is specified in addition, the indicator may be turned on or off. .SH OPTIONS .TP \fB\-l \fIlocation_code Specify the location code of the indicator. .TP \fB\-d \fIdev_name Specify the name of the device to be identified (e.g. eth0, sda). .TP \fB\-s \fR{\fBnormal\fR|\fBidentify\fR} Must be used with the \fB\-l\fR or \fB\-d\fR option; \fB\-s normal\fR will turn the indicator off, while \fB\-s identify\fR will turn the indicator on. .TP .B \-t Truncate the location code if necessary. If an indicator is not available at the specified location, this option will continuously trim the last clause off of the location code in an attempt to find an indicator near the device. .TP .B \-V Display the version of the command and exit. .TP .B \-h Print the usage message and exit. .SH "SEE ALSO" .BR lp_diag (8), .BR usysattn (8), .BR lscfg (8) ppc64-diag-2.7.4/lpd/man/usysfault.80000644000000000000000000000013113135275400013726 00000000000000.\" .\" Copyright (C) 2004, 2012 International Business Machines .\" .so man8/usysattn.8 ppc64-diag-2.7.4/lpd/scripts/0000755000000000000000000000000013135275553012610 500000000000000ppc64-diag-2.7.4/lpd/scripts/lp_diag_setup0000755000000000000000000000715113135275400015270 00000000000000#!/usr/bin/perl -I /etc/ppc64-diag # @file lp_diag_setup # @brief Register/unregister Light Path notification tools # with servicelog # # Copyright (C) 2012 IBM Corporation # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # @author Vasant Hegde use Getopt::Long; sub usage { print "$0 {--register | --unregister} [--verbose]\n"; print " --register: register notification tools with servicelog\n"; print " --unregister: unregister servicelog notification tools\n"; print " --verbose: display verbose output\n"; } sub run_cmd { my $cmd = @_[0]; $redirect = " >/dev/null 2>&1"; if ($flag_verbose) { $redirect = ""; print " *** Running: $cmd\n"; } system("$cmd$redirect"); my $exit_status = $? >> 8; if ($flag_verbose) { print " *** Exit Status: $exit_status\n"; } return $exit_status; } sub servicelog_id { my $cmd = @_[0]; # read the servicelog_notify output for the Servicelog ID @sl_out = `/usr/bin/servicelog_notify --list --command=\"$cmd\" 2> /dev/null`; foreach $line (@sl_out) { chomp($line); $pos = index($line, "Servicelog ID:"); if ($pos >= 0) { $sl_id = substr($line, 14); # trim leading whitespace $sl_id =~ s/^\s+//; return $sl_id; } } return "?"; } sub register { my $cmd = @_[0]->[0]; my $sl_args = @_[0]->[1]; my $rc; $rc = run_cmd("/usr/bin/servicelog_notify --list --command=\"$cmd\""); if ($rc == 1) { # command not currently registered; register it now $rc = run_cmd("/usr/bin/servicelog_notify --add ". "--command=\"$cmd\" $sl_args"); } } sub unregister { my $cmd = @_[0]->[0]; my $sl_args = @_[0]->[1]; my $rc; $rc = run_cmd("/usr/bin/servicelog_notify --remove ". "--command=\"$cmd\""); } @notification_tools = ( ["/etc/ppc64-diag/lp_diag_notify -e", "--match='disposition>=1 and severity>=4 and serviceable=1' ". "--type=EVENT --method=num_arg"], ["/etc/ppc64-diag/lp_diag_notify -r", "--type=REPAIR --method=num_arg"], ); Getopt::Long::Configure("bundling"); GetOptions("register|r"=>\$flag_register, "unregister|u"=>\$flag_unregister, "help|h"=>\$flag_help, "verbose|v"=>\$flag_verbose, "<>"=>\&bad_arg) or usage(), exit(1); if ($flag_help) { usage(); exit (0); } if ($flag_register and $flag_unregister) { print "Only one of --register and --unregister should be specified.\n"; usage(); exit (1); } if (!$flag_register and !$flag_unregister) { print "One of --register or --unregister must be specified.\n"; usage(); exit (1); } my $count = 0; if ($flag_register) { foreach $tool (@notification_tools) { register($tool); $count++; } print "Registered $count tools with servicelog:\n\n"; foreach $tool (@notification_tools) { run_cmd("/usr/bin/servicelog_notify --list ". "--command=\"".$tool->[0]."\""); print "\n"; } } if ($flag_unregister) { foreach $tool (@notification_tools) { unregister($tool); $count++; } print "Unregistered $count notification tools from servicelog.\n"; } exit (0); ppc64-diag-2.7.4/lpd/scripts/lp_diag_notify0000755000000000000000000000350413135275400015436 00000000000000#!/usr/bin/perl -I /etc/ppc64-diag # @file lp_diag_notify # # This script is to be registered with servicelog as a notification tool. # It calls Light Path Diagnostics (lp_diag) tool for error analysis and # enabling/disabling fault LED's. # # Copyright (C) 2012 IBM Corporation # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # @author Vasant Hegde use Getopt::Long; sub usage { print "$0 {[--event|e ] | [--repair|r ]}\n"; print " --event |e: Service event ID\n"; print " --repair|r: Repair event ID\n"; } my $id = 0; my $command = "/usr/sbin/lp_diag"; Getopt::Long::Configure("bundling"); GetOptions("event|e=i" =>\$event, "repair|r=i" =>\$repair, "help|h"=>\$flag_help) or usage(), exit(1); if ($flag_help) { usage(); exit(0); } if ($event && $repair) { print "The options -e and -r cannot be used together.\n"; usage(); exit(1); } if (!$event && !$repair) { print "One of -e or -r must be specified.\n"; usage(); exit(1); } if ($event) { $command .= " -e $event"; } elsif ($repair) { $command .= " -r $repair"; } else { usage(); exit(1); } #print("command =", $command); system("$command\n"); exit (0); ppc64-diag-2.7.4/lpd/test/0000755000000000000000000000000013135275553012100 500000000000000ppc64-diag-2.7.4/lpd/test/ledtool.c0000644000000000000000000000672413135275400013626 00000000000000/** * @file ledtool.c * @brief Light Path Diagnostics testing tool * * Copyright (C) 2012 IBM Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * @author Vasant Hegde */ #include #include #include #include #include "indicator.h" /** * enable_fault_indicator - Enable fault indicator for the given loc code */ int enable_fault_indicator(char *loccode, int truncate) { int rc = 0; int truncated = 0; struct loc_code *list = NULL; struct loc_code *loc_led = NULL; rc = get_indicator_list(LED_TYPE_FAULT, &list); if (!list) return -1; if (loccode == NULL) { /* attn indicator */ loc_led = &list[0]; } else { retry: loc_led = get_indicator_for_loc_code(list, loccode); if (!loc_led) { if (truncate && truncate_loc_code(loccode)) { truncated = 1; goto retry; } fprintf(stderr, "There is no fault indicator at " "location code %s\n", loccode); free_indicator_list(list); return 0; } } if (truncated) fprintf(stderr, "Truncated location code = %s\n", loccode); rc = set_indicator_state(LED_TYPE_FAULT, loc_led, 1); if (rc == 0) { if (loccode == NULL) indicator_log_write("System Attention Indicator : ON"); else indicator_log_write("%s : Fault : ON", loc_led->code); fprintf(stderr, "%s : \[on]\n", loc_led->code); } else fprintf(stderr, "Unable to enable fault indicator\n"); free_indicator_list(list); return rc; } void print_usage(char *progname) { fprintf(stdout, "Enable system attention/fault indicators.\n" "\nUsage : %s -f []\n" "\t-f : Fault indicator\n" "\t-t : Truncate location code if necessary\n" "\t-h : Print this message and exit\n" "\n\tloc_code : Location code\n", progname); } /* ledtool command line arguments */ #define LED_TOOL_ARGS "fht" /* main */ int main(int argc, char **argv) { char *loccode = NULL; int rc = 0; int c; int fault = 0; int truncate = 0; opterr = 0; while ((c = getopt(argc, argv, LED_TOOL_ARGS)) != -1) { switch (c) { case 'f': fault = 1; break; case 'h': print_usage(argv[0]); exit(0); case 't': truncate = 1; break; default: print_usage(argv[0]); exit(1); } } if (optind < argc) loccode = argv[optind++]; if (optind < argc) { print_usage(argv[0]); exit(1); } if (!fault) { print_usage(argv[0]); exit(1); } program_name = argv[0]; lp_error_log_fd = STDOUT_FILENO; /* log message to stdout */ rc = init_files(); if (rc) { fprintf(stderr, "Unable to open log file.\n"); exit(1); } if (probe_indicator() != 0) { close_files(); exit(1); } /* Light Path operating mode */ if (get_indicator_mode() != 0) { close_files(); exit(1); } /* enable fault indicator */ rc = enable_fault_indicator(loccode, truncate); close_files(); exit(rc); } ppc64-diag-2.7.4/lpd/test/sesdevices.c0000644000000000000000000000550413135275400014314 00000000000000/** * @file sesdevices.c * @brief List all Light Path Daignostics supported SES enclosures * * Copyright (C) 2012 IBM Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * @author Vasant Hegde */ #include #include #include #include #include #include "indicator.h" #include "lp_util.h" /* SES sys path */ #define SCSI_SES_PATH "/sys/class/enclosure" /* List of all Light Path supported enclosures */ static struct { char *mtm; } supported_enclosure[] = { {"5888"}, /* Bluehawk */ {"EDR1"}, /* Bluehawk */ {NULL} }; /* trim ESM/ERM part */ static void trim_location_code(struct dev_vpd *vpd) { char *hyphen; hyphen = strchr(vpd->location, '-'); if (hyphen && (!strcmp(hyphen, "-P1-C1") || !strcmp(hyphen, "-P1-C2"))) *hyphen = '\0'; } int main() { int i; int count = 0; char path[128]; DIR *dir; struct dirent *dirent; struct dev_vpd *vpd = NULL; struct dev_vpd *v1; vpd = read_device_vpd(SCSI_SES_PATH); if (!vpd) return 0; for (v1 = vpd; v1; v1 = v1->next) { /* remove ESM/ERM part of location code */ trim_location_code(v1); /* read sg name */ snprintf(path, 128, "%s/%s/device/scsi_generic", SCSI_SES_PATH, v1->dev); dir = opendir(path); if (!dir) { fprintf(stderr, "Unable to open directory : %s\n", path); continue; } /* fill sg device name */ while ((dirent = readdir(dir)) != NULL) { if (!strcmp(dirent->d_name, ".") || !strcmp(dirent->d_name, "..")) continue; strncpy(v1->dev, dirent->d_name, DEV_LENGTH); } closedir(dir); } for (v1 = vpd; v1; v1 = v1->next) for (i = 0; supported_enclosure[i].mtm; i++) if (!strcmp(v1->mtm, supported_enclosure[i].mtm)) { count++; fprintf(stdout, "\n"); fprintf(stdout, "SCSI Device : %s\n", v1->dev); fprintf(stdout, "Model : %s\n", v1->mtm); fprintf(stdout, "Location Code : %s\n", v1->location); fprintf(stdout, "Serial Number : %s\n", v1->sn); } if (count == 0) fprintf(stderr, "System does not have Light Path supported " "SES enclosure(s).\n"); free_device_vpd(vpd); return 0; } ppc64-diag-2.7.4/lpd/test/e1000e_message0000644000000000000000000000010713135275400014326 00000000000000Sep 21 09:42:10 eagle3 kernel: e1000e 0001:00:01.0: RX DMA map failed ppc64-diag-2.7.4/lpd/test/e1000e_message20000644000000000000000000000010713135275400014410 00000000000000Sep 21 09:42:10 eagle3 kernel: e1000e 0000:00:01.0: RX DMA map failed ppc64-diag-2.7.4/lpd/test/lpd_ela_test.sh0000755000000000000000000002021613135275400015006 00000000000000#!/bin/bash ################################################################################ # Light Path Diagnostics Test cases # # Note: # - This script wipes out servicelog database and deletes some of # important log files. *Do not* run this script on production # environment. # # USAGE: ./lpd_ela_test.sh # # Author Vasant Hegde # ################################################################################ TEST_GROUP="Power Diagnostics" TEST_SCENARIO="Light Path Diagnostics" # Takes the name of the script before the "." and composes log filenames SCRIPT_NAME=$(basename "$0" | cut -f 1 -d ".") LOG_DIR=`pwd` EXECUTION_LOG="$LOG_DIR/$SCRIPT_NAME.log" ERROR_LOG="$LOG_DIR/$SCRIPT_NAME.err" TMP_DIR="/var/tmp/ras" mkdir -p $TMP_DIR MESSAGE_FILE="$TMP_DIR/messages" TMP_FILE="$TMP_DIR/$SCRIPT_NAME.tmp" # Initializing the variable that will determine PASS or FAILURE for the script IS_FAILED=0 ################################################################################ # init_logs () # Purpose : Clean up old logs and start the new execution ones # Parametrs : None # Returns : 0 ################################################################################ init_logs () { # mkdir -p $LOG_DIR rm -f $EXECUTION_LOG $ERROR_LOG touch $EXECUTION_LOG $ERROR_LOG return 0 } ################################################################################ # print_log () # Purpose : Takes the first argument, prints to stdout and to the script # log # Parameters : None # Returns : 0 ################################################################################ print_log () { echo $1 | tee -a $EXECUTION_LOG return 0 } ################################################################################ # exec_log () # Purpose : Executes the command passed as the first argument, prints to # stdout and to the script log # Parameters : String with the command you want to execute, log and check # exit code # Returns : Same of the command passed as a parameter ################################################################################ exec_log () { print_log "Output of the command $1:" eval $1 1>&2 >$TMP_FILE EXIT_CODE=$? cat $TMP_FILE | tee -a $EXECUTION_LOG rm -f $TMP_FILE if [ $EXIT_CODE != 0 ]; then print_log "ERROR: Command $1 ended abnormally with exit code $EXIT_CODE." print_log "Please verify." | tee -a $ERROR_LOG IS_FAILED=1 fi return $EXIT_CODE } ################################################################################ # clean_servicelog () # Purpose : Truncate the servicelog database, and below files # /var/log/platform # /var/spool/mail/root # /var/log/lp_diag.log # /var/log/indicators # Parameters : None # Returns : The exit code of the servicelog command ################################################################################ clean_servicelog () { exec_log "servicelog_manage --truncate events --force" SLOG_EXIT=$? truncate -s 0 /var/log/platform truncate -s 0 /var/spool/mail/root truncate -s 0 /var/log/lp_diag.log truncate -s 0 /var/log/indicators return $SLOG_EXIT } ################################################################################ # print_log_header () # Purpose : Initializes the execution log truncating it # (tee without -a flag) # Parameters : None # Returns : 0 ################################################################################ print_log_header () { cat << TEXT | tee $EXECUTION_LOG $(date +'%d/%m/%y %H:%M') ******************************************************************************** * PowerLinux RAS Testcase * $TEST_GROUP * $TEST_SCENARIO ******************************************************************************** TEXT return 0 } ################################################################################ # print_log_footer () # Purpose : Checks whether the testcase ended successfully and prints # its status # Parameters : None # Returns : 0 ################################################################################ print_log_footer () { if [ $IS_FAILED = 0 ]; then TEST_STATUS='PASS' else TEST_STATUS='FAILED' print_log "Showing testcase errors:" exec_log "cat $ERROR_LOG" fi cat << TEXT | tee -a $EXECUTION_LOG ******************************************************************************** * PowerLinux RAS Testcase * $TEST_GROUP * $TEST_SCENARIO * Test status: $TEST_STATUS ******************************************************************************** $(date +'%d/%m/%y %H:%M') TEXT return 0 } ################################################################################ # validate_lpd_tool () # Purpose : Check Light Path command and registeration scripts # Parameters : None # Returns : 0 ################################################################################ validate_lpd_tool () { if [ ! -x /usr/sbin/lp_diag ] then print_log "lp_diag command does not exist. " print_log "Install ppc64-diag package\n" IS_FAILED=1 fi event=`servicelog_notify -l |grep "lp_diag_notify \-e"` if [ "$event" == "" ] then print_log "Service event notification script is not registered\n" IS_FAILED=1 fi event=`servicelog_notify -l |grep "lp_diag_notify \-r"` if [ "$event" == "" ] then print_log "Repair event notification script is not registered\n" IS_FAILED=1 fi } ################################################################################ # check_fault_indicator () # Purpose : Check fault indicator status # Parameters : ON/OFF # Returns : 0 ################################################################################ check_fault_indicator () { location=`servicelog --dump |grep "Location" | awk 'BEGIN{FS=":";}{print $2}'` location=`echo $location | sed 's/ *$//g'` if [ "$location" == "" ] then print_log "Empty location code in service event" location=`usysattn | head -1 | awk '{print $1}'` fi state=`echo $1 | awk '{print tolower($0)}'` led=`usysattn -l $location -t | tail -1` if [ "$led" != "$state" ] then print_log "Unable to modify fault indicator" IS_FAILED=1 return fi indicator=`grep "$1" /var/log/indicators | awk 'BEGIN{FS=":";}{print $5}'` print_log "$indicator = $led" } ################################################################################ # close_service_event () # Purpose : Close serviceable event # Parameters : None # Returns : 0 ################################################################################ close_service_event () { procedure=`servicelog --dump |grep "Procedure Id" | awk 'BEGIN{FS=":";}{print $2}'` procedure=`echo $procedure | sed 's/ *$//g'` location=`servicelog --dump |grep "Location" | awk 'BEGIN{FS=":";}{print $2}'` location=`echo $location | sed 's/ *$//g'` exec_log "log_repair_action -q -l \"$location\" -p \"$procedure\"" } # Validate input file if [ "$1" != "" ] then if [ -e $1 ] then INPUT_FILE=$1 fi fi if [ "$INPUT_FILE" == "" ] then echo "Usage : $0 " exit 1 fi # Initializing test case logs init_logs # Printing log header print_log_header print_log "1 - Checking lpd tools" validate_lpd_tool print_log "2 - Creating messages file" cp $INPUT_FILE $MESSAGE_FILE print_log "3 - Running explain_syslog" exec_log "explain_syslog -m $MESSAGE_FILE" MESSAGE=$(explain_syslog -m $MESSAGE_FILE | grep "unrecognized message" ) if [ "$MESSAGE" = "" ]; then print_log "explain_syslog successful" else print_log "ERROR: explain_syslog does not explain the message" | tee -a $ERROR_LOG IS_FAILED=1 fi print_log "4 - Clearing servicelog events" clean_servicelog print_log "5 - Running syslog_to_svclog - Injecting serviceable event" exec_log "syslog_to_svclog -m $MESSAGE_FILE" print_log "6 - Checking events in servicelog" exec_log "servicelog --dump" sleep 2 # Wait for lp_diag to close log file print_log "7 - Checking fault indicator status" check_fault_indicator "ON" print_log "8 - Close service event" close_service_event sleep 2 # Wait for lp_diag to close log file print_log "9 - Checking fault indicator status" check_fault_indicator "OFF" print_log_footer exit $IS_FAILED ppc64-diag-2.7.4/lpd/Makefile.am0000644000000000000000000000434613135275400013073 00000000000000lpd_common_h_files = lpd/indicator.h \ lpd/indicator_marvell.h \ lpd/indicator_ses.h \ lpd/lp_util.h lpd_h_files = $(lpd_common_h_files) lpd/servicelog.h lpd_common_files = lpd/files.c \ lpd/lp_util.c \ lpd/indicator.c \ lpd/indicator_ses.c \ lpd/indicator_opal.c \ lpd/indicator_rtas.c \ lpd/indicator_marvell.c \ common/utils.c \ common/platform.c lpd_common_lib = -lrtas -lrtasevent -lservicelog lp_diag_lib = -lncurses -lmenu $(lpd_common_lib) sbin_PROGRAMS += lpd/lp_diag lpd/usysident lpd_lp_diag_SOURCES = lpd/lp_diag.c \ lpd/servicelog.c \ $(lpd_common_files) \ $(lpd_h_files) lpd_lp_diag_LDADD = $(lp_diag_lib) lpd_usysident_SOURCES = lpd/usysident.c \ $(lpd_common_files)\ $(lpd_common_h_files) lpd_usysident_LDADD = $(lpd_common_lib) dist_man_MANS += lpd/man/lp_diag.8 \ lpd/man/usysattn.8 \ lpd/man/usysident.8 \ lpd/man/usysfault.8 LPD_SCRIPT = lpd/scripts/lp_diag_setup \ lpd/scripts/lp_diag_notify all-local-lpd: ln -sf usysident lpd/usysattn ln -sf usysident lpd/usysfault AM_LOCALS += all-local-lpd install-exec-hook-lpd: install -d --mode=755 $(DESTDIR)/etc/ppc64-diag install -D --mode=744 $(LPD_SCRIPT) $(DESTDIR)/etc/ppc64-diag/ $(LN_S) $(sbindir)/usysident $(DESTDIR)/$(sbindir)/usysattn $(LN_S) $(sbindir)/usysident $(DESTDIR)/$(sbindir)/usysfault INSTALL_EXEC_HOOKS += install-exec-hook-lpd uninstall-hook-lpd: rm -f $(DESTDIR)/etc/ppc64-diag/lp_diag_setup rm -f $(DESTDIR)/etc/ppc64-diag/lp_diag_notify rm -f $(sbindir)/usysattn rm -f $(sbindir)/usysfault UNINSTALL_HOOKS += uninstall-hook-lpd clean-local-lpd: rm -f lpd/usysattn rm -f lpd/usysfault CLEAN_LOCALS += clean-local-lpd lpd_test_common_files = lpd/servicelog.c \ $(lpd_common_files) check_PROGRAMS += lpd/test/ledtool \ lpd/test/sesdevices lpd_test_ledtool_SOURCES = lpd/test/ledtool.c \ $(lpd_test_common_files) lpd_test_ledtool_LDADD = $(lpd_common_lib) lpd_test_sesdevices_SOURCES = lpd/test/sesdevices.c \ $(lpd_test_common_files) lpd_test_sesdevices_LDADD = $(lpd_common_lib) EXTRA_DIST += $(LPD_SCRIPT) \ lpd/README \ lpd/test/e1000e_message \ lpd/test/e1000e_message2 \ lpd/test/lpd_ela_test.sh ppc64-diag-2.7.4/lpd/lp_diag.c0000644000000000000000000006754013135275400012607 00000000000000/** * @file lp_diag.c * @brief Light Path Diagnostics * * Copyright (C) 2012 IBM Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * @author Vasant Hegde */ #include #include #include #include #include #include #include #include #include #include #include "servicelog.h" #include "indicator.h" #include "lp_util.h" /* FRU callout priority as defined in PAPR+ * * Note: Order of the priority is important! */ #define FRU_CALLOUT_PRIORITY "HMABCL" /* Servicelog command string */ #define SERVICELOG_EVENT_CMD \ "Run \"/usr/bin/servicelog --query=\"id=%d\"\" for full details." #define SERVICELOG_REPAIR_CMD \ "Run \"/usr/bin/servicelog --query=\"repair=%d\"\" for full details." /* loop */ #define for_each_callout(callout, callouts) \ for (callout = callouts; callout; callout = callout->next) #define for_each_event(e, events) \ for (e = events; e; e = e->next) #define for_each_fru(fru, frus) \ for (fru = frus; fru; fru = fru->next) /* Row number for the menu begin */ #define BEGIN_Y 5 #define ENTER 10 /* FRU location code */ struct fru { char location[LOCATION_LENGTH]; struct fru *next; }; /* Global variables for LPD UI */ int nlines; char *cur_state; char *prev_state; static int startup_window(); /** * set_attn_indicator - Enable/disable system attention indicator * * @attn_loc attn location * @new_state indicator state * * @Returns : * 0 on success, !0 on failure */ static int set_attn_indicator(struct loc_code *attn_loc, int new_state) { int rc; int state; rc = get_indicator_state(LED_TYPE_FAULT, attn_loc, &state); if (rc || state != new_state) { rc = set_indicator_state(LED_TYPE_FAULT, attn_loc, new_state); if (rc) indicator_log_write("System Attention Indicator :" "Unable to %s", new_state ? "enable" : "disable"); else indicator_log_write("System Attention Indicator : %s", new_state ? "ON" : "OFF"); } return rc; } /** * set_fault_indicator - Enable/disable location fault indicator * * @loc location code * @new_state indicator state * * @Returns : * 0 on success, !0 on failure */ static int set_fault_indicator(struct loc_code *loc, int new_state) { int rc; int state; rc = get_indicator_state(LED_TYPE_FAULT, loc, &state); if (rc || state != new_state) { rc = set_indicator_state(LED_TYPE_FAULT, loc, new_state); if (rc) indicator_log_write("%s : Unable to %s fault indicator", loc->code, new_state ? "enable" : "disable"); else indicator_log_write("%s : Fault : %s", loc->code, new_state ? "ON" : "OFF"); } return rc; } /** * service_event_supported - Validate the event type and supported device * * @event sl_event structure * @event_type service event type * * Returns : * 1 on success / 0 on failure */ static int service_event_supported(struct sl_event *event) { struct sl_data_os *os; struct sl_data_enclosure *enclosure; /* we handle OS and Enclosure events only */ switch (event->type) { case SL_TYPE_OS: os = event->addl_data; if (!device_supported(os->subsystem, os->driver)) { log_msg("Unsupported device driver : %s", os->driver); return 0; } break; case SL_TYPE_ENCLOSURE: enclosure = event->addl_data; if (!enclosure_supported(enclosure->enclosure_model)) { log_msg("Unsupported Enclosure model : %s", enclosure->enclosure_model); return 0; } break; case SL_TYPE_BMC: case SL_TYPE_RTAS: case SL_TYPE_BASIC: default: return 0; } return 1; } /** * free_fru_loc_code - Free location code list * * @frus fru list * * Returns : * nothing */ static void free_fru_loc_code(struct fru *frus) { struct fru *temp = frus; while (frus) { temp = frus; frus = frus->next; free(temp); } } /** * get_fru_indicator - get FRU indicator location code * * Truncates the last few characters off of a location code; * if fault indicator doesn't exist at the original location, * perhaps one exists at the location closer to the CEC. * * Returns: * loc_code structure on success, NULL on failure */ static struct loc_code * get_fru_indicator(struct loc_code *list, char *location, int *truncated) { struct loc_code *loc_led; retry: loc_led = get_indicator_for_loc_code(list, location); if (!loc_led) { /* No indicator at original location */ if (truncate_loc_code(location)) { *truncated = 1; goto retry; } return NULL; } return loc_led; } /** * build_callout_loc_code - Build location code list * * @event sl_event * @list loc_code structure * @frus fru list * @attn_state attention indicator state * * Returns : * fru loc list, on success / NULL, on failure */ static struct fru * build_callout_loc_code(struct sl_event *event, struct loc_code *list, struct fru *frus, int *attn_state) { int found; int truncated = 0; char location[LOCATION_LENGTH]; struct fru *fru; struct sl_callout *callout; struct loc_code *loc_led; if (!event->callouts) { /* Empty callout */ *attn_state = 1; return frus; } for_each_callout(callout, event->callouts) { /* valid loc code ? */ if (!callout->location || !strcmp(callout->location, "")) { *attn_state = 1; continue; } /* get FRUs nearest fault indicator */ strncpy(location, callout->location, LOCATION_LENGTH); location[LOCATION_LENGTH - 1] = '\0'; loc_led = get_fru_indicator(list, location, &truncated); if (!loc_led) { /* No indicator found for the given loc code */ *attn_state = 1; continue; } found = 0; for_each_fru(fru, frus) /* location is added to callout list ? */ if (!strcmp(fru->location, location)) { found = 1; break; } if (!found) { /* Add location code to fru list */ fru = frus; if (fru) while (fru->next) fru = fru->next; if (!fru) { fru = calloc(1, sizeof(struct fru)); frus = fru; } else { fru->next = calloc(1, sizeof(struct fru)); fru = fru->next; } if (!fru) { log_msg("Out of memory"); free_fru_loc_code(frus); return NULL; } strncpy(fru->location, location, LOCATION_LENGTH - 1); } } return frus; } /** * event_fru_callout - Parse the FRU callout list and enable * location indicator * * @callouts sl_callouts structure * @list loc_code list * @fru_priority FRU callout priority * @attn_on Attention indicator state * * @Returns : * 1 on success / 0 on failure */ static int event_fru_callout(struct sl_callout *callouts, struct loc_code *list, char fru_priority, int *attn_on) { int rc = 0; int truncated = 0; char location[LOCATION_LENGTH]; struct sl_callout *callout; struct loc_code *loc_led = NULL; /* Go over callout list */ for_each_callout(callout, callouts) { if (callout->priority != fru_priority) continue; /* valid location code ? */ if (!callout->location || !strcmp(callout->location, "")) { indicator_log_write("Empty location code in callout"); *attn_on = 1; continue; } /* get FRUs nearest fault indicator */ strncpy(location, callout->location, LOCATION_LENGTH); location[LOCATION_LENGTH - 1] = '\0'; loc_led = get_fru_indicator(list, location, &truncated); if (!loc_led) { /* No indicator found for the given loc code */ *attn_on = 1; indicator_log_write("%s does not have fault indicator", callout->location); indicator_log_write("Could not truncate and get " "location code closer to CEC"); continue; } if (truncated) { indicator_log_write("%s does not have fault indicator", callout->location); indicator_log_write("Truncated location : %s", location); } rc = set_fault_indicator(loc_led, LED_STATE_ON); } return rc; } /** * repair_fru_callout - Disable indicator * * @fru FRU location code * @list loc_code list * @attn_disable Attention indicator state * * @Returns : * 1 on success / 0 on failure */ static int repair_fru_callout(struct fru *fru, struct loc_code *list, int *attn_disable) { int rc = 0; struct loc_code *loc_led = NULL; loc_led = get_indicator_for_loc_code(list, fru->location); if (loc_led) rc = set_fault_indicator(loc_led, LED_STATE_OFF); else { indicator_log_write("%s does not have fault indicator", fru->location); *attn_disable = 1; } return rc; } /** * parse_service_event - Analyze events and enable LED if required * * @event_id servicelog event ID * * Returns : * 0 on success, !0 on failure */ static int parse_service_event(int event_id) { int i; int rc; int attn_on = 0; struct sl_event *event = NULL; struct loc_code *list = NULL; struct loc_code *attn_loc; log_msg("Service event ID = %d", event_id); /* get servicelog event */ rc = get_service_event(event_id, &event); if (rc) return rc; if (!event) { log_msg("Unable to read service event"); return -1; } if (!service_event_supported(event)) { rc = 0; /* return success */ goto event_out; } indicator_log_write("---- Service event begin ----"); /* build indicator list */ rc = get_indicator_list(LED_TYPE_FAULT, &list); if (rc) { log_msg("Unable to retrieve fault indicators"); indicator_log_write("Unable to retrieve fault indicators"); goto indicator_out; } /* First loc code is system attention indicator */ attn_loc = &list[0]; if (operating_mode == LED_MODE_LIGHT_PATH) { if (event->callouts) /* Run over FRU callout priority in order and * enable fault indicator */ for (i = 0; FRU_CALLOUT_PRIORITY[i]; i++) rc = event_fru_callout(event->callouts, list, FRU_CALLOUT_PRIORITY[i], &attn_on); else { /* No callout list, enable check log indicator */ indicator_log_write("Empty callout list"); attn_on = 1; } if (attn_on) /* check log indicator */ rc = set_attn_indicator(attn_loc, LED_STATE_ON); } else { log_msg("Guiding Light mode"); rc = set_attn_indicator(attn_loc, LED_STATE_ON); } if (rc) log_msg("Unable to enable fault indicator"); /* free indicator list */ free_indicator_list(list); indicator_out: indicator_log_write(SERVICELOG_EVENT_CMD, event_id); indicator_log_write("---- Service event end ----"); event_out: /* free up servicelog event */ servicelog_event_free(event); return rc; } /** * parse_repair_event - Analyse the servicelog repair events and * disable indicator if required * * @repair_id servicelog repair ID * * Returns : * 0 on success, !0 on failure */ static int parse_repair_event(int repair_id) { int rc; int loc_match; int attn_disable = 0; int attn_keep = 0; struct fru *r_fru = NULL; struct fru *r_frus = NULL; struct fru *o_fru = NULL; struct fru *o_frus = NULL; struct sl_event *repair_events = NULL; struct sl_event *open_events = NULL; struct sl_event *repair; struct sl_event *event; struct loc_code *attn_loc; struct loc_code *list = NULL; log_msg("Repair event ID = %d", repair_id); /* get servicelog repair events */ rc = get_repair_event(repair_id, &repair_events); if (rc) return rc; /* get_repair_event returns success, even if particular * repair event didn't close any serviceable event(s). */ if (!repair_events) { log_msg("Repair event %d did not close any service event(s)", repair_id); return 0; } rc = get_all_open_service_event(&open_events); if (rc) goto repair_out; indicator_log_write("---- Repair event begin ----"); /* build indicator list */ rc = get_indicator_list(LED_TYPE_FAULT, &list); if (rc) { log_msg("Unable to retrieve fault indicators"); goto event_out; } /* First loc code is system attention indicator */ attn_loc = &list[0]; if (operating_mode == LED_MODE_LIGHT_PATH) { for_each_event(repair, repair_events) { if (!service_event_supported(repair)) continue; r_frus = build_callout_loc_code(repair, list, r_frus, &attn_disable); } for_each_event(event, open_events) { if (!service_event_supported(event)) continue; o_frus = build_callout_loc_code(event, list, o_frus, &attn_keep); } for_each_fru(r_fru, r_frus) { loc_match = 0; for_each_fru(o_fru, o_frus) { /* Do not disable fault indicator, if there * exists an open serviceable event(s) with * that location code. */ if (!strcmp(r_fru->location, o_fru->location)) { loc_match = 1; break; } } if (loc_match) continue; rc = repair_fru_callout(r_fru, list, &attn_disable); } if (!attn_keep && attn_disable) rc = set_attn_indicator(attn_loc, LED_STATE_OFF); } else { log_msg("Guiding Light mode"); if (!open_events) /* No more open events */ rc = set_attn_indicator(attn_loc, LED_STATE_OFF); } if (rc) log_msg("Unable to disable fault indicator"); free_fru_loc_code(o_frus); free_fru_loc_code(r_frus); /* free indicator list */ free_indicator_list(list); event_out: indicator_log_write(SERVICELOG_REPAIR_CMD, repair_id); indicator_log_write("---- Repair event end ----"); servicelog_event_free(open_events); repair_out: servicelog_event_free(repair_events); return rc; } /* UI_help - Print the help message for each selection * * @my_menu list of identify and attention indicators * */ static void UI_help(MENU *my_menu) { int x, y; int c; const char *desc = NULL; ITEM *cur; WINDOW *my_text_win; WINDOW *my_help_win; char *help1 = "This selection will turn all Identify Indicators\n" "off."; char *help2 = "This selection will turn System Attention\nIndicator" " off."; char *help3 = "This selection will toggle the Identify Indicator " "state.\n\n" "If a '+' appears to the left of this selection,\n" "the transaction is waiting to be committed.\n\n" "If an 'I' appears to the left of this selection,\nthe" " Identify Indicator is currently in the \n'identify'" " state.\n\n" "If an 'I' does not appear to the left of this\n" "selection, the Identify Indicator is currently\nin " "the 'normal' state."; getmaxyx(stdscr, y, x); my_help_win = newwin(18, 55, y - 19, (x - 55)/2); my_text_win = newwin(15, 50, y - 17, (x - 50)/2); keypad(my_text_win, TRUE); box(my_help_win, 0, 0); wborder(my_help_win, '|', '|', '-', '-', '+', '+', '+', '+'); wrefresh(my_help_win); mvwprintw(my_text_win, 14, 0, "F3=Cancel\t\tEnter"); wrefresh(my_text_win); cur = current_item(my_menu); desc = item_description(cur); if (!desc) { delwin(my_text_win); delwin(my_help_win); return; } if (!strcmp(desc, "ident")) mvwprintw(my_text_win, 0, 0, help1); else if (!strcmp(desc, "attn")) mvwprintw(my_text_win, 0, 0, help2); else mvwprintw(my_text_win, 0, 0, help3); wrefresh(my_text_win); while ((c = wgetch(my_text_win))) { if (c == KEY_F(3) || c == ENTER) break; } delwin(my_text_win); delwin(my_help_win); touchwin(stdscr); wrefresh(stdscr); endwin(); } /* UI_make_selection - Select a particular indicator * * @my_menu_win window associated with my_menu * @my_menu list of identify and attention indicators * */ static void UI_make_selection(WINDOW *my_menu_win, MENU *my_menu) { int index; int i; int __attribute__((__unused__)) x, y; ITEM *cur; const char *desc = NULL; cur = current_item(my_menu); index = item_index(cur); desc = item_description(cur); getyx(my_menu_win, y, x); if (desc && !strcmp(desc, "ident")) { for (i = 0; i < item_count(my_menu); i++) if (cur_state[i] == 'I') { prev_state[i] = 'I'; cur_state[i] = '+'; } for (i = 0; i < nlines; i++) mvaddch(i + BEGIN_Y, 0, cur_state[i]); } else if (cur_state[index] == '+') { cur_state[index] = prev_state[index]; mvaddch(y + BEGIN_Y, 0, cur_state[index]); } else { prev_state[index] = cur_state[index]; cur_state[index] = '+'; mvaddch(y + BEGIN_Y, 0, cur_state[index]); } refresh(); } /* UI_commit - commits the changes made to the indicator states * * @my_menu_win window associated with my_menu * @my_menu list of identify and attention indicators * @ident_list list of identify indicators * @attn_list list of system attention and fault indicators * */ static void UI_commit(WINDOW *my_menu_win, MENU *my_menu, struct loc_code *ident_list, struct loc_code *attn_list) { int ident; int index; int i, j; int err = 0; int x, y; int rc; int c; char *name; const char *desc = NULL; ITEM **items; ITEM *cur; WINDOW *my_help_win; struct loc_code *loc; getmaxyx(stdscr, y, x); my_help_win = newwin(6, 55, y - 7, (x - 55)/2); keypad(my_help_win, TRUE); box(my_help_win, 0, 0); wborder(my_help_win, '|', '|', '-', '-', '+', '+', '+', '+'); items = menu_items(my_menu); for (i = 0; i < item_count(my_menu); i++) { desc = item_description(items[i]); if (!desc) { if (cur_state[i] == '+') { cur_state[i] = prev_state[i]; err = 1; } continue; } if (!strcmp(desc, "loc")) { name = (char *)item_name(items[i]); loc = get_indicator_for_loc_code(ident_list, name); if (!loc) { if (cur_state[i] == '+') { cur_state[i] = prev_state[i]; err = 1; } continue; } rc = get_indicator_state(LED_TYPE_IDENT, loc, &ident); if (rc) { if (cur_state[i] == '+') { cur_state[i] = prev_state[i]; err = 1; } continue; } } if (cur_state[i] == '+') { mvwprintw(my_help_win, 2, 8, "Processing data ..."); wrefresh(my_help_win); if (!strcmp(desc, "attn")) { rc = set_attn_indicator(&attn_list[0], LED_STATE_OFF); cur_state[i] = ' '; if (rc) err = 1; } else { rc = set_indicator_state(LED_TYPE_IDENT, loc, ident ? LED_STATE_OFF : LED_STATE_ON); if (rc) { err = 1; cur_state[i] = ident? 'I' : ' '; continue; } cur_state[i] = ident ? ' ' : 'I'; indicator_log_write("%s : Identify : %s", loc->code, ident? "OFF" : "ON"); } } else if (!strcmp(desc, "loc")) { cur_state[i] = ident? 'I' : ' '; } } cur = current_item(my_menu); index = item_index(cur); getyx(my_menu_win, y, x); for (i = index - y, j = 0; i < index - y + nlines; i++, j++) mvaddch(j + BEGIN_Y, 0, cur_state[i]); refresh(); if (err) { mvwprintw(my_help_win, 2, 4, "Commit failed for one " "or more selections."); mvwprintw(my_help_win, 4, 10, "F3=Cancel\t\tEnter"); while ((c = wgetch(my_help_win))) { if (c == ENTER || c == KEY_F(3)) break; } wrefresh(my_help_win); } delwin(my_help_win); touchwin(my_menu_win); touchwin(stdscr); wrefresh(stdscr); wrefresh(my_menu_win); } /* UI_update_indicator - Updates the state of the indicator when * the selected item changes * * @my_menu_win window associated with my_menu * @my_menu list of identify and attention indicators * */ static void UI_update_indicator(WINDOW *my_menu_win, MENU *my_menu) { int index; int i, j; int __attribute__((__unused__)) x, y; int count; ITEM *cur; cur = current_item(my_menu); index = item_index(cur); count = item_count(my_menu); getyx(my_menu_win, y, x); if (count > nlines) { move(BEGIN_Y - 1, 0); clrtoeol(); if (index - y == 0) printw("[TOP]"); else printw("[MORE .. %d]", index - y); move(nlines + BEGIN_Y, 0); clrtoeol(); if (index - y == count - nlines) printw("[BOTTOM]"); else printw("[MORE .. %d]", count - (index - y + nlines)); } for (i = index - y, j = 0; i < index - y + nlines; i++, j++) mvaddch(j + BEGIN_Y, 0, cur_state[i]); refresh(); } /* UI_cleanup - release memory for states, my_items and menu * * @my_menu list of identify and attention indicators * @my_items items associated with menu * */ static void UI_cleanup(MENU *my_menu, ITEM **my_items) { int i; free(cur_state); free(prev_state); unpost_menu(my_menu); free_menu(my_menu); for (i = 0; i < item_count(my_menu); i++) free_item(my_items[i]); free(my_items); } void resize_handler(int sig) { } /* create_menu - Prints the list of location codes and allows * the user to modify the state of the indicator * * @ident_list list of identify indicators * @attn_list list of system attention and fault indicators * * Returns : * 0 on success and !0 on failure */ static int create_menu(struct loc_code *ident_list, struct loc_code *attn_list) { int __attribute__((__unused__)) x, y; int i = 0; int c; int rc; int ident; int length = 0; int count; struct loc_code *cur; WINDOW *my_menu_win; MENU *my_menu; ITEM **my_items; getmaxyx(stdscr, y, x); nlines = y - 13; if (ident_list) for(cur = ident_list; cur; cur = cur->next) length++; if (attn_list) length += 3; else length += 2; cur_state = malloc(length); prev_state = malloc(length); my_items = (ITEM **)calloc(length, sizeof(ITEM *)); if (!cur_state || !prev_state || !my_items) { log_msg("Out of memory"); free(my_items); return -1; } if (ident_list) { my_items[i] = new_item("Set ALL Identify " "Indicator to NORMAL", "ident"); cur_state[i] = ' '; i++; mvprintw(0, 0, "SYSTEM IDENTIFY INDICATOR"); mvprintw(2, 0, "Determining system capabilities"); mvprintw(4, 0, "Please stand by."); refresh(); } if (attn_list) { my_items[i] = new_item("Set System Attention " "Indicator to NORMAL", "attn"); cur_state[i] = ' '; i++; } for (cur = ident_list; cur; cur = cur->next, i++) { /* Determine the identify indicator state */ rc = get_indicator_state(LED_TYPE_IDENT, cur, &ident); if (rc) cur_state[i] = ' '; else cur_state[i] = ident ? 'I' : ' '; my_items[i] = new_item(cur->code, "loc"); } my_items[i] = (ITEM *)NULL; clear(); if (!ident_list && attn_list) mvprintw(0, 0, "ATTENTION INDICATOR"); else if (attn_list) mvprintw(0, 0, "IDENTIFY AND ATTENTION INDICATORS"); else mvprintw(0, 0, "IDENTIFY INDICATORS"); mvprintw(2, 0, "Make selection(s), use Commit to continue"); mvprintw(LINES - 3, 0, "F1=Help\t\t\tF4=List\t\t\tF7=Commit\t\t\t" "F10=Exit\nF3=Previous Menu"); refresh(); my_menu = new_menu((ITEM **)my_items); menu_opts_off(my_menu, O_SHOWDESC); menu_opts_off(my_menu, O_ONEVALUE); /* Set main window and sub window */ my_menu_win = newwin(nlines, 70, BEGIN_Y , 1); set_menu_sub(my_menu, derwin(my_menu_win, nlines, 70, 0, 0)); keypad(my_menu_win, TRUE); set_menu_win(my_menu, my_menu_win); set_menu_format(my_menu, nlines, 1); set_menu_mark(my_menu, " "); post_menu(my_menu); count = item_count(my_menu); if (count > nlines) { mvprintw(BEGIN_Y - 1, 0, "[TOP]"); mvprintw(nlines + BEGIN_Y, 0, "[MORE .. %d]", count - nlines); } else { nlines = count; } for (i = 0; i < nlines; i++) mvaddch(i + BEGIN_Y, 0, cur_state[i]); refresh(); while ((c = wgetch(my_menu_win)) != KEY_F(10)) { switch (c) { case KEY_F(1): UI_help(my_menu); touchwin(my_menu_win); break; case KEY_DOWN: menu_driver(my_menu, REQ_DOWN_ITEM); UI_update_indicator(my_menu_win, my_menu); break; case KEY_UP: menu_driver(my_menu, REQ_UP_ITEM); UI_update_indicator(my_menu_win, my_menu); break; case KEY_PPAGE: menu_driver(my_menu, REQ_SCR_UPAGE); UI_update_indicator(my_menu_win, my_menu); break; case KEY_NPAGE: menu_driver(my_menu, REQ_SCR_DPAGE); UI_update_indicator(my_menu_win, my_menu); break; case ENTER: UI_make_selection(my_menu_win, my_menu); break; case KEY_F(7): UI_commit(my_menu_win, my_menu, ident_list, attn_list); break; case KEY_F(3): clear(); UI_cleanup(my_menu, my_items); startup_window(); return 0; } wrefresh(my_menu_win); } UI_cleanup(my_menu, my_items); return 0; } /* startup_window - Explain the Lightpath instructions and details * * Returns: * 0 on success !0 on error */ static int startup_window(void) { int x, y; int c; int rc, rv; struct loc_code *attn_list = NULL; struct loc_code *ident_list = NULL; char *msg1 = "This program contains service indicator tasks. " "This should be\nused to view and manipulate the" " service indicators (LEDs)."; char *msg2 = "Several keys are used to control the procedures:\n" "- The Enter key continues the procedure or" " performs an action.\n" "- The cursor keys are used to select an option.\n"; initscr(); cbreak(); noecho(); keypad(stdscr, TRUE); signal(SIGWINCH, resize_handler); getmaxyx(stdscr, y, x); if (y < 24 || x < 80) { endwin(); fprintf(stderr, "Light Path Diagnostics requires minimum " "of 24 line by 80 column display.\nCheck " "the window size and try again.\n"); return -1; } rc = get_indicator_list(LED_TYPE_FAULT, &attn_list); if (rc) log_msg("Unable to get system attention indicator"); rv = get_indicator_list(LED_TYPE_IDENT, &ident_list); if (rv) log_msg("Unable to get identify indicators"); if (rc && rv) { endwin(); fprintf(stderr, "System does not support service indicators\n"); return rc; } mvprintw(0, 0, "SERVICE INDICATORS VERSION %s", VERSION); mvprintw(2, 0, msg1); mvprintw(5, 0, msg2); mvprintw(9, 0, "Press the F3 key to exit or press Enter to continue."); while ((c = getch()) != KEY_F(3)) { if (c == ENTER) { clear(); rc = create_menu(ident_list, attn_list); break; } } free_indicator_list(attn_list); free_indicator_list(ident_list); endwin(); return rc; } /** * print_usage - Print the usage statement */ static void print_usage(const char *cmd) { fprintf(stdout, "Usage:\n" "\t%s [-V] [-h]\n", cmd); fprintf(stdout, "\nOptions:\n"); fprintf(stdout, "\t-V: Print the version of the command\n"); fprintf(stdout, "\t-h: Print this message\n"); } /* lp_diag command line arguments */ #define LP_DIAG_ARGS "e:r:hV" /* Options to be passed to getopt_long function */ static struct option longopts[] = { {"event", required_argument, NULL, 'e'}, {"repair", required_argument, NULL, 'r'}, {"help", no_argument, NULL, 'h'}, {"version", no_argument, NULL, 'V'}, {0, 0, 0, 0} }; /** * main - */ int main(int argc, char *argv[]) { int c; int rc = 0; int event_flag = 0; int repair_flag = 0; int event_id = 0; int repair_id = 0; char *next_char; program_name = argv[0]; if (probe_indicator() != 0) { fprintf(stderr, "%s is not supported on this platform\n", argv[0]); return 0; } opterr = 0; while ((c = getopt_long(argc, argv, LP_DIAG_ARGS, longopts, NULL)) != EOF) { switch (c) { case 'e': event_flag = 1; event_id = (int)strtoul(optarg, &next_char, 10); if (optarg[0] == '\0' || *next_char != '\0' || event_id <= 0) { print_usage(argv[0]); exit(1); } break; case 'r': repair_flag = 1; repair_id = (int)strtoul(optarg, &next_char, 10); if (optarg[0] == '\0' || *next_char != '\0' || repair_id <= 0) { print_usage(argv[0]); exit(1); } break; case 'V': fprintf(stdout, "%s %s\n", argv[0], VERSION); fflush(stdout); exit(0); case 'h': print_usage(argv[0]); exit(0); case '?': default: print_usage(argv[0]); exit(1); } } if (geteuid() != 0) { dbg("%s: Requires superuser privileges.", argv[0]); exit(1); } if (optind < argc) { dbg("Unrecognized argument : %s", argv[optind]); print_usage(argv[0]); exit(1); } if (event_flag && repair_flag) { dbg("The -e and -r options cannot be used together\n"); print_usage(argv[0]); exit(1); } /* initialize */ rc = init_files(); if (rc) goto cleanup; /* Light Path operating mode */ rc = get_indicator_mode(); if (rc) goto cleanup; if (argc < 2) { log_msg("Starting LPD UI"); rc = startup_window(); } if (event_flag) { log_msg("Service event analysis"); rc = parse_service_event(event_id); } if (repair_flag) { log_msg("Repair event analysis"); rc = parse_repair_event(repair_id); } cleanup: log_msg("%s exiting", program_name); close_files(); exit(rc); } ppc64-diag-2.7.4/lpd/servicelog.c0000644000000000000000000000563313135275400013345 00000000000000/** * @file servicelog.c * @brief Read servicelog database * * Copyright (C) 2012 IBM Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * @author Vasant Hegde */ #include #include #include #include "indicator.h" /* Query string should be same as "match" field in notification script. * see scripts/lp_diag_setup script. */ #define SERVICELOG_QUERY_LEN 128 #define SERVICELOG_QUERY_STRING "disposition>=1 and severity>=4 and " \ "serviceable=1" /** * get_servicelog_event - Retrieve servicelog event(s) * * @query servicelog event query * @event servicelog event structure * * Returns : * 0 on success, !0 on failure */ static int get_servicelog_event(char *query, struct sl_event **event) { int rc; struct servicelog *slog; rc = servicelog_open(&slog, 0); if (rc) { log_msg("Error opening servicelog db: %s", strerror(rc)); return rc; } rc = servicelog_event_query(slog, query, event); if (rc) log_msg("Error reading servicelog db :%s", servicelog_error(slog)); /* close database */ servicelog_close(slog); return rc; } /** * get_service_event - Get service event */ int get_service_event(int event_id, struct sl_event **event) { char query[SERVICELOG_QUERY_LEN]; snprintf(query, SERVICELOG_QUERY_LEN, "id=%d", event_id); return get_servicelog_event(query, event); } /** * get_all_open_service_event - Get all open serviceable event */ int get_all_open_service_event(struct sl_event **event) { int len; char query[SERVICELOG_QUERY_LEN]; len = snprintf(query, SERVICELOG_QUERY_LEN, SERVICELOG_QUERY_STRING); snprintf(query + len, SERVICELOG_QUERY_LEN - len, " and closed=0"); return get_servicelog_event(query, event); } /** * get_repair_event - Get repair event */ int get_repair_event(int repair_id, struct sl_event **event) { int len; char query[SERVICELOG_QUERY_LEN]; len = snprintf(query, SERVICELOG_QUERY_LEN, SERVICELOG_QUERY_STRING); snprintf(query + len, SERVICELOG_QUERY_LEN - len, " and repair=%d", repair_id); return get_servicelog_event(query, event); } /** * print_service_event - Print servicelog event */ int print_service_event(struct sl_event *event) { return servicelog_event_print(stdout, event, 1); } ppc64-diag-2.7.4/lpd/files.c0000644000000000000000000002136213135275400012302 00000000000000/** * @file files.c * @brief File manipulation routines * * Copyright (C) 2012 IBM Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * @author Vasant Hegde */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "indicator.h" /* Program name */ char *program_name; /* Indicator event log file/descriptor */ char *lp_event_log_file = "/var/log/indicators"; int lp_event_log_fd = -1; /* Log file/descriptor */ char *lp_error_log_file = "/var/log/lp_diag.log"; int lp_error_log_fd = -1; /** * reformat_msg - Re-format a log message to wrap at 80 characters * * In order to ease the formatting of messages in the lp_diag this * will automatically format the messages to wrap at 80 characters. * * @msg buffer containing the message to re-format * @size message size * * Returns : * new buffer length */ static int reformat_msg(char *msg, int size) { char buf[LP_ERROR_LOG_MAX]; char *pos; char *next; char temp; char temp2; int len = strlen(msg); if (len >= LP_ERROR_LOG_MAX) /* Insufficient temporary buffer size */ return len; if (len > (size - size / 80 + 1)) /* Worst case target size */ return len; if (len < 80) { /* no need to reformat */ msg[len++] = '\n'; return len; } memset(buf, 0, LP_ERROR_LOG_MAX); /* first copy the msg into our buffer */ memcpy(buf, msg, len); /* zero out the old buffer */ msg[0] = '\0'; pos = buf; while (strlen(pos) > 80) { next = pos + 80; do { if (*next == ' ') *next = '\n'; if (*next == '\n') { temp = *(next + 1); *(next + 1) = '\0'; strcat(msg, pos); *(next + 1) = temp; pos = next + 1; break; } next--; } while (next > pos); if (next == pos) { /* word is longer than line length */ next = pos + 79; temp = *next; temp2 = *(next + 1); *next = '\n'; *(next + 1) = '\0'; strcat(msg, pos); *next = temp; *(next + 1) = temp2; pos = next; } } /* while loop end */ strcat(msg, pos); len = strlen(msg); msg[len++] = '\n'; return len; } /** * insert_time - Insert current date and time */ static int insert_time(char *buf, int size) { int len; time_t cal; cal = time(NULL); len = snprintf(buf, size, "%s", ctime(&cal)); len--; /* remove new line character */ return len; } /** * _dbg - Write debug messages to stdout * * Provide utility to print debug statements if the debug flag * is specified. * * @fmt format string to printf() * @... additional argument */ void _dbg(const char *fmt, ...) { int len = 0; char buf[LP_ERROR_LOG_MAX]; va_list ap; /* * If LPD_DEBUG is set at compile time (e.g., make CFLAGS='-DLPD_DEBUG'), * then always write the messages at runtime. * If it's not (default), check if the LPD_DEBUG environment variable * is set at runtime (e.g., export LPD_DEBUG=1), and only write if it is. */ #ifndef LPD_DEBUG if (!getenv("LPD_DEBUG")) return; #endif va_start(ap, fmt); len = snprintf(buf, LP_ERROR_LOG_MAX, "DEBUG: "); len += vsnprintf(buf + len, LP_ERROR_LOG_MAX - len, fmt, ap); va_end(ap); if (len < 0 || len >= LP_ERROR_LOG_MAX) return; /* Insufficient buffer size */ fprintf(stdout, "%s", buf); fprintf(stdout, "\n"); fflush(stdout); } /** * log_msg - Write log message into lp_diag log file * * @fmt format string to printf() * @... additional argument */ void log_msg(const char *fmt, ...) { int rc; int len = 0; char buf[LP_ERROR_LOG_MAX]; va_list ap; #ifndef LPD_DEBUG /* In order to make testing easier we will not print time in * debug version of lp_diag. */ if (lp_error_log_fd != STDOUT_FILENO) { len = insert_time(buf, LP_ERROR_LOG_MAX); len += snprintf(buf + len, LP_ERROR_LOG_MAX - len, ": "); } #endif /* Add the actual message */ va_start(ap, fmt); len += vsnprintf(buf + len, LP_ERROR_LOG_MAX - len, fmt, ap); if (len < 0 || len >= LP_ERROR_LOG_MAX) { dbg("Insufficient buffer size"); va_end(ap); return; } va_end(ap); /* Add ending punctuation */ len += snprintf(buf + len, LP_ERROR_LOG_MAX - len, "."); if (lp_error_log_fd == -1) { dbg("Log file \"%s\" is not available", lp_error_log_file); _dbg(buf); return; } _dbg(buf); /* reformat the new message */ len = reformat_msg(buf, LP_ERROR_LOG_MAX); rc = write(lp_error_log_fd, buf, len); if (rc == -1) dbg("Write to log file \"%s\" failed", lp_error_log_file); } /** * indicator_log_write - write indicate events to log file * * @fmt format string to printf() * @... additional argument to printf() * * Returns : * return code from write() call */ int indicator_log_write(const char *fmt, ...) { int len; int rc = 0; char buf[LP_ERROR_LOG_MAX]; va_list ap; if (lp_event_log_fd == -1) { log_msg("Indicator event log file \"%s\" is not available", lp_event_log_file); return -1; } /* Add time */ len = insert_time(buf, LP_ERROR_LOG_MAX); len += snprintf(buf + len, LP_ERROR_LOG_MAX - len, ": %s : ", program_name); va_start(ap, fmt); len += vsnprintf(buf + len, LP_ERROR_LOG_MAX - len, fmt, ap); if (len < 0 || len >= LP_ERROR_LOG_MAX) { log_msg("Insufficient buffer size"); va_end(ap); return -1; } va_end(ap); /* Add ending punctuation */ len += snprintf(buf + len, LP_ERROR_LOG_MAX - len, "\n"); rc = write(lp_event_log_fd, buf, len); if (rc == -1) log_msg("Write to indicator event log file \"%s\" failed", lp_event_log_file); return rc; } /** * rotate_log_file - Check log file size and rotate if required. * * @lp_log_file log file name * * Returns : * nothing */ static void rotate_log_file(char *lp_log_file) { int rc; int dir_fd; char *dir_name; char lp_log_file0[PATH_MAX]; struct stat sbuf; rc = stat(lp_log_file, &sbuf); if (rc == -1) { dbg("Cannot stat log file to rotate logs"); return; } if (sbuf.st_size <= LP_ERRD_LOGSZ) return; _dbg("Rotating log file : %s", lp_log_file); snprintf(lp_log_file0, PATH_MAX, "%s0", lp_log_file); /* Remove old files */ rc = stat(lp_log_file0, &sbuf); if (rc == 0) { if (unlink(lp_log_file0)) { dbg("Could not delete archive file %s " "(%d: %s) to make a room for new archive." " The new logs will be logged anyway.", lp_log_file0, errno, strerror(errno)); return; } } rc = rename(lp_log_file, lp_log_file0); if (rc == -1) { dbg("Could not archive log file %s to %s (%d: %s)", lp_log_file, lp_log_file0, errno, strerror(errno)); return; } dir_name = dirname(lp_log_file0); dir_fd = open(dir_name, O_RDONLY | O_DIRECTORY); if (dir_fd == -1) { dbg("Could not open log directory %s (%d: %s)", dir_name, errno, strerror(errno)); return; } /* sync log directory */ rc = fsync(dir_fd); if (rc == -1) dbg("Could not sync log directory %s (%d: %s)", dir_name, errno, strerror(errno)); close(dir_fd); } /** * init_files - Open log files * * Returns : * 0 on success, !0 on failure */ int init_files(void) { int rc = 0; /* lp_diag log file */ if (lp_error_log_fd != STDOUT_FILENO) { /* 1 = stdout */ rotate_log_file(lp_error_log_file); lp_error_log_fd = open(lp_error_log_file, O_RDWR | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR | S_IRGRP); if (lp_error_log_fd == -1) dbg("Could not open log file \"%s\"", lp_error_log_file); } /* open event log file */ rotate_log_file(lp_event_log_file); lp_event_log_fd = open(lp_event_log_file, O_RDWR | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR | S_IRGRP); if (lp_event_log_fd == -1) { log_msg("Could not open indicator event log file \"%s\"", lp_event_log_file); return -1; } return rc; } /** * close_files - Close all the files used by lp_diag * * Perform any file cleanup (i.e. close()) and possibly free()'ing * buffers needed by log_diag before exiting. * * Returns : * nothing */ void close_files(void) { if (lp_error_log_fd > STDOUT_FILENO) /* don't close stdout */ close(lp_error_log_fd); if (lp_event_log_fd != -1) close(lp_event_log_fd); } ppc64-diag-2.7.4/lpd/lp_util.c0000644000000000000000000001622113135275400012646 00000000000000/** * @file lp_util.c * @brief Light Path utility * * Copyright (C) 2012 IBM Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * @author Vasant Hegde */ #include #include #include #include #include #include #include #include "indicator.h" #include "utils.h" #define LSVPD_PATH "/usr/sbin/lsvpd" /* Note: * At present, we do not support all SES enclosures/devices. Consider * removing device_supported() and enclosure_supported() once we * have Light Path support for all enclosures/devices. */ /* List of all Light Path supported enclosures */ static struct { char *model; } supported_ses_enclosure[] = { {"5888"}, /* Bluehawk */ {"EDR1"}, /* Bluehawk */ {"5887"}, /* Homerun */ {"ESLL"}, /* Slider - LFF */ {"ESLS"}, /* Slider - SFF */ {NULL} }; /* List of all Light Path supported devices */ static struct { char *subsystem; char *driver; } os_supported_device[] = { {"net", "cxgb3"}, /* Chelsio network card*/ {"net", "e1000e"}, /* Intel network card*/ {NULL, NULL} }; /** * device_supported - Check Light Path support for device * * @subsystem subsystem * @driver kernel driver * * Returns : * 1 if device is supported / 0 if device is not supported */ int device_supported(const char *subsystem, const char *driver) { int i; if (!subsystem || !driver) return 0; for (i = 0; os_supported_device[i].driver; i++) if (!strcmp(os_supported_device[i].subsystem, subsystem) && !strcmp(os_supported_device[i].driver, driver)) return 1; return 0; } /** * enclosure_supported - Check Light Path support for enclosure * * @model enclosure model * * Returns : * 1 if enclosure is supported / 0 if enclosure is not supported */ int enclosure_supported(const char *model) { int i; if (!model) return 0; for (i = 0; supported_ses_enclosure[i].model; i++) if (!strcmp(supported_ses_enclosure[i].model, model)) return 1; return 0; } /** * fgets_nonl - Read a line and strip the newline. */ char * fgets_nonl(char *buf, int size, FILE *s) { char *nl; if (!fgets(buf, size, s)) return NULL; nl = strchr(buf, '\n'); if (nl == NULL) return NULL; *nl = '\0'; return buf; } /** * skip_space - */ static char * skip_space(const char *pos) { pos = strchr(pos, ' '); if (!pos) return NULL; while (*pos == ' ') pos++; return (char *)pos; } /** * read_vpd_from_lsvpd - Retrieve vpd data * * Returns : * 0 on success, !0 on failure */ int read_vpd_from_lsvpd(struct dev_vpd *vpd, const char *device) { char buf[128]; char *pos; char *args[] = {LSVPD_PATH, "-l", (char *const)device, NULL}; pid_t cpid; int rc; FILE *fp; /* use lsvpd to find the device vpd */ fp = spopen(args, &cpid); if (fp == NULL) { log_msg("Unable to retrieve the vpd for \"%s\". " "Ensure that lsvpd package is installed.", device); return -1; } while (fgets_nonl(buf, 128, fp) != NULL) { if ((pos = strstr(buf, "*TM")) != NULL) { if (!(pos = skip_space(pos))) continue; strncpy(vpd->mtm, pos, VPD_LENGTH - 1); vpd->mtm[VPD_LENGTH - 1] = '\0'; } else if ((pos = strstr(buf, "*YL")) != NULL) { if (!(pos = skip_space(pos))) continue; strncpy(vpd->location, pos, LOCATION_LENGTH - 1); vpd->location[LOCATION_LENGTH - 1] = '\0'; } else if ((pos = strstr(buf, "*DS")) != NULL) { if (!(pos = skip_space(pos))) continue; strncpy(vpd->ds, pos, VPD_LENGTH - 1); vpd->ds[VPD_LENGTH - 1] = '\0'; } else if ((pos = strstr(buf, "*SN")) != NULL) { if (!(pos = skip_space(pos))) continue; strncpy(vpd->sn, pos, VPD_LENGTH - 1); vpd->sn[VPD_LENGTH - 1] = '\0'; } else if ((pos = strstr(buf, "PN")) != NULL) { if (!(pos = skip_space(pos))) continue; strncpy(vpd->pn, pos, VPD_LENGTH - 1); vpd->pn[VPD_LENGTH - 1] = '\0'; } else if ((pos = strstr(buf, "*FN")) != NULL) { if (!(pos = skip_space(pos))) continue; strncpy(vpd->fru, pos, VPD_LENGTH - 1); vpd->fru[VPD_LENGTH - 1] = '\0'; } } rc = spclose(fp, cpid); if (rc) { log_msg("%s: spclose() failed [rc=%d]\n", __func__, rc); return -1; } return 0; } /** * free_device_vpd - free vpd structure */ void free_device_vpd(struct dev_vpd *vpd) { struct dev_vpd *tmp; while (vpd) { tmp = vpd; vpd = vpd->next; free(tmp); } } /** * read_device_vpd - * * @path /sys path * * Returns : * vpd structure on success / NULL on failure */ struct dev_vpd * read_device_vpd(const char *path) { DIR *dir; struct dirent *dirent; struct dev_vpd *vpd = NULL; struct dev_vpd *curr = NULL; dir = opendir(path); if (!dir) { if (errno != ENOENT) log_msg("Unable to open directory : %s", path); return NULL; } while ((dirent = readdir(dir)) != NULL) { if (!strcmp(dirent->d_name, ".") || !strcmp(dirent->d_name, "..")) continue; if (!curr) { curr = calloc(1, sizeof(struct dev_vpd)); vpd = curr; } else { curr->next = calloc(1, sizeof(struct dev_vpd)); curr = curr->next; } if (!curr) { log_msg("Out of memory"); free_device_vpd(vpd); closedir(dir); return NULL; } /* device name */ strncpy(curr->dev, dirent->d_name, DEV_LENGTH - 1); curr->dev[DEV_LENGTH - 1] = '\0'; if (read_vpd_from_lsvpd(curr, dirent->d_name)) { free_device_vpd(vpd); closedir(dir); return NULL; } } closedir(dir); return vpd; } /** * fill_indicators_vpd - Fill indicators vpd data */ void fill_indicators_vpd(struct loc_code *list) { struct dev_vpd vpd; struct loc_code *curr; for (curr = list; curr; curr = curr->next) { /* zero out the vpd structure */ memset(&vpd, 0, sizeof(struct dev_vpd)); if (read_vpd_from_lsvpd(&vpd, curr->code)) return; strncpy(curr->devname, vpd.dev, DEV_LENGTH); strncpy(curr->mtm, vpd.mtm, VPD_LENGTH); strncpy(curr->sn, vpd.sn, VPD_LENGTH); strncpy(curr->pn, vpd.pn, VPD_LENGTH); strncpy(curr->fru, vpd.fru, VPD_LENGTH); /* retain existing DS */ if (curr->ds[0] == '\0') strncpy(curr->ds, vpd.ds, VPD_LENGTH); } } /** * get_loc_code_for_dev - Get location code for the given device * * @device device name * @location output location code * @locsize location code size * * Returns : * 0 on success / -1 on failure */ int get_loc_code_for_dev(const char *device, char *location, int locsize) { struct dev_vpd vpd; memset(&vpd, 0, sizeof(struct dev_vpd)); if (device && !read_vpd_from_lsvpd(&vpd, device)) { if (location && vpd.location[0] != '\0') { strncpy(location, vpd.location, locsize); location[locsize - 1] = '\0'; return 0; } } return -1; } ppc64-diag-2.7.4/lpd/indicator.c0000644000000000000000000001755213135275400013162 00000000000000/** * @file indicator.c * @brief Indicator manipulation routines * * Copyright (C) 2012 IBM Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * @author Vasant Hegde */ #include #include #include #include #include #include #include #include "platform.h" #include "indicator.h" #include "lp_util.h" /* Indicator operating mode */ uint32_t operating_mode; /* points to platform structure of running platform */ struct platform platform; /* Map LED type to description. */ struct led_type_map { const int type; const char *desc; }; static struct led_type_map led_type_map[] = { {LED_TYPE_IDENT, LED_DESC_IDENT}, {LED_TYPE_FAULT, LED_DESC_FAULT}, {LED_TYPE_ATTN, LED_DESC_ATTN}, {-1, NULL}, }; /* Returns LED type */ int get_indicator_type(const char *indicator_desc) { int i; for (i = 0; led_type_map[i].desc != NULL; i++) if (!strcmp(led_type_map[i].desc, indicator_desc)) return led_type_map[i].type; return -1; } /* Returns LED description */ const char * get_indicator_desc(int indicator) { int i; for (i = 0; led_type_map[i].type != -1; i++) if (led_type_map[i].type == indicator) return led_type_map[i].desc; return "Unknown"; } /** * is_enclosure_loc_code - */ int is_enclosure_loc_code(struct loc_code *loc) { if (strchr(loc->code, '-') == NULL) return 1; return 0; } /** * truncate_loc_code - Truncate the last few characters of a location code * * Truncates the last few characters off of a location code; if an * indicator doesn't exist at the orignal location, perhaps one exists * at a location closer to the CEC. * * @loccode location code to truncate * * Returns : * 1 - successful truncation / 0 - could not be truncated further */ int truncate_loc_code(char *loccode) { int i; for (i = strlen(loccode) - 1; i >= 0; i--) { if (loccode[i] == '-') { loccode[i] = '\0'; return 1; /* successfully truncated */ } } return 0; } /** * get_indicator_for_loc_code - Compare device location code with indicator list * * @list indicator list * @location device location code * * Returns : * on success, loc_code structure * on failure, NULL */ struct loc_code * get_indicator_for_loc_code(struct loc_code *list, const char *location) { while (list) { if (!strcmp(list->code, location)) return list; list = list->next; } return NULL; } /** * probe_indicator - Check indicator support on running platform * * Returns : * 0 on success, -1 on failure */ int probe_indicator(void) { int p; p = get_platform(); switch (p) { case PLATFORM_PSERIES_LPAR: platform = rtas_platform; break; case PLATFORM_POWERNV: platform = opal_platform; break; case PLATFORM_POWERKVM_GUEST: default: fprintf(stderr, "%s is not supported on the %s platform\n", program_name, __power_platform_name(p)); return -1; } if (platform.probe) return platform.probe(); return 0; } /** * get_indicator_mode - Gets the service indicator operating mode * * Returns : * operating mode value */ int get_indicator_mode(void) { if (!platform.get_indicator_mode) return -1; return platform.get_indicator_mode(); } /** * get_indicator_list - Build indicator list of given type * * @indicator identification or attention indicator * @list loc_code structure * * Returns : * 0 on success, !0 otherwise */ int get_indicator_list(int indicator, struct loc_code **list) { if (!platform.get_indicator_list) return -1; return platform.get_indicator_list(indicator, list); } /** * get_indicator_state - Retrieve the current state for an indicator * * Call the appropriate routine for retrieving indicator values based on the * type of indicator. * * @indicator identification or attention indicator * @loc location code of the sensor * @state return location for the sensor state * * Returns : * indicator return code */ int get_indicator_state(int indicator, struct loc_code *loc, int *state) { if (!platform.get_indicator_state) return -1; return platform.get_indicator_state(indicator, loc, state); } /** * set_indicator_state - Set an indicator to a new state (on or off) * * Call the appropriate routine for setting indicators based on the type * of indicator. * * @indicator identification or attention indicator * @loc location code of rtas indicator * @new_value value to update indicator to * * Returns : * indicator return code */ int set_indicator_state(int indicator, struct loc_code *loc, int new_value) { if (!platform.set_indicator_state) return -1; return platform.set_indicator_state(indicator, loc, new_value); } /** * get_all_indicator_state - Get all indicators current state * * @indicator identification or attention indicator * @loc location code structure * * Returns : * nothing */ void get_all_indicator_state(int indicator, struct loc_code *loc) { int rc; int state; while (loc) { rc = get_indicator_state(indicator, loc, &state); if (rc) /* failed to get indicator state */ loc->state = -1; else loc->state = state; loc = loc->next; } } /** * set_all_indicator_state - Sets all indicators state * * @indicator identification or attention indicator * @loc location code structure * @new_value LED_STATE_ON/LED_STATE_OFF * * Returns : * 0 on success, !0 on failure */ void set_all_indicator_state(int indicator, struct loc_code *loc, int new_value) { int state; int rc; struct loc_code *encl = &loc[0]; while (loc) { rc = get_indicator_state(indicator, loc, &state); if (rc || state != new_value) set_indicator_state(indicator, loc, new_value); loc = loc->next; } /* If enclosure identify indicator is turned ON explicitly, * then turning OFF all components identify indicator inside * enclosure does not turn OFF enclosure identify indicator. */ if (encl && indicator == LED_TYPE_IDENT && new_value == LED_STATE_OFF) set_indicator_state(indicator, encl, new_value); } /** * enable_check_log_indicator - Enable check log indicator * * Returns : * 0 on success, !0 on failure */ int enable_check_log_indicator(void) { int rc; struct loc_code *list = NULL; struct loc_code *clocation; rc = get_indicator_list(LED_TYPE_FAULT, &list); if (rc) return rc; /** * The first location code returned by get_rtas_indices RTAS call * is check log indicator. */ clocation = &list[0]; rc = set_indicator_state(LED_TYPE_FAULT, clocation, LED_STATE_ON); free_indicator_list(list); return rc; } /** * disable_check_log_indicator - Disable check log indicator * * Returns : * 0 on success, !0 on failure */ int disable_check_log_indicator(void) { int rc; struct loc_code *list = NULL; struct loc_code *clocation; rc = get_indicator_list(LED_TYPE_FAULT, &list); if (rc) return rc; /** * The first location code returned by get_rtas_indices RTAS call * is check log indicator. */ clocation = &list[0]; rc = set_indicator_state(LED_TYPE_FAULT, clocation, LED_STATE_OFF); free_indicator_list(list); return rc; } /** * free_indicator_list - Free loc_code structure * * @loc list to free * * Return : * nothing */ void free_indicator_list(struct loc_code *loc) { struct loc_code *tmp = loc; while (loc) { tmp = loc; loc = loc->next; free(tmp); } } ppc64-diag-2.7.4/lpd/indicator_ses.c0000644000000000000000000002521313135275400014025 00000000000000/** * @file indicator_ses.c * @brief SES indicator manipulation routines * * Copyright (C) 2012 IBM Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * @author Vasant Hegde */ #include #include #include #include #include #include #include #include #include #include "utils.h" #include "indicator.h" #include "lp_util.h" /* SES LED command name */ #define SCSI_INDICATOR_CMD "/usr/sbin/encl_led" /* SES sys path */ #define SCSI_SES_PATH "/sys/class/enclosure" /* * Some versions of iprconfig/lscfg report the location code of the ESM/ERM * -- e.g., UEDR1.001.G12W34S-P1-C1. For our purposes, we usually don't want * the -P1-C1. (Don't trim location codes for disks and such.) * * TODO: This adjustment is appropriate for Bluehawks. Need to understand * what, if anything, needs to be done for other (e.g. Pearl) enclosures. */ static void trim_location_code(struct dev_vpd *vpd) { char *hyphen; hyphen = strchr(vpd->location, '-'); if (hyphen && (!strcmp(hyphen, "-P1-C1") || !strcmp(hyphen, "-P1-C2"))) *hyphen = '\0'; } /** * read_ses_vpd - Read SES device vpd data * * Returns : * vpd structure on success, NULL on failure */ static struct dev_vpd * read_ses_vpd(void) { char path[PATH_MAX]; DIR *dir; struct dirent *dirent; struct dev_vpd *vpd = NULL; struct dev_vpd *v1; /* get enclosure vpd data */ vpd = read_device_vpd(SCSI_SES_PATH); if (!vpd) return NULL; for (v1 = vpd; v1; v1 = v1->next) { /* remove ESM/ERM part of location code */ trim_location_code(v1); /* read sg name */ snprintf(path, PATH_MAX, "%s/%s/device/scsi_generic", SCSI_SES_PATH, v1->dev); dir = opendir(path); if (!dir) { log_msg("Unable to open directory : %s", path); continue; } /* fill sg device name */ while ((dirent = readdir(dir)) != NULL) { if (!strcmp(dirent->d_name, ".") || !strcmp(dirent->d_name, "..")) continue; strncpy(v1->dev, dirent->d_name, DEV_LENGTH - 1); v1->dev[DEV_LENGTH - 1] = '\0'; } closedir(dir); } return vpd; } /** * Helper functions to parse encl_led command output SES LED's. * * Ex : * Listing the particular enclosure indicator list: * encl_led -v -l sgN [component] : * fault ident location description * off off P1-E1 left power supply * off off P1-E2 right power supply * * Modify fault/identify indicator. * encl_led -{i|f} {on|off} sgN [component] */ /** * get_relative_fru_location - split location code * * Get FRU location code relative to the enclosure location code. * Ex : If an enclosure has location code U5888.001.G123789, and one * of its diks has a full location code U5888.001.G123789-P1-D1, * then relatvie FRU location code would be P1-D1. * */ static char * get_relative_fru_location(const char *loccode) { char *fru_loc; fru_loc = strchr(loccode, '-'); if (!fru_loc) return NULL; fru_loc++; /* skip - */ return fru_loc; } /** * get_ses_fru_desc - Parse SES FRU description * * Returns : * FRU description on success, NULL on failure */ static char * get_ses_fru_desc(char *buf) { if (!buf) return NULL; while (*buf == ' ') buf++; return buf; } /** * get_ses_fru_location - Parse SES FRU location * * Returns : * Relative FRU location code on success, NULL on failure */ static char * get_ses_fru_location(char *buf) { char *fru; char *space; fru = strchr(buf, 'P'); if (!fru) { fru = strchr(buf, '-'); /* Enclosure location code */ if (!fru) return NULL; } space = strchr(fru, ' '); if (!space) return NULL; *space = '\0'; return fru; } /** * get_ses_fru_identify_state - Get FRU identify indicator state * * Returns : * Indicator state on success, -1 on failure */ static int get_ses_fru_identify_state(const char *buf) { char *fault; char *ident; fault = strchr(buf, 'o'); if (!fault) return -1; fault++; ident = strchr(fault, 'o'); if (!ident) return -1; return !strncmp(ident, "on", 2); } /** * get_ses_fru_fault_state - Get FRU fault indicator state * * Returns : * Indicator state on success, -1 on failure */ static int get_ses_fru_fault_state(const char *buf) { char *fault; fault = strchr(buf, 'o'); if (!fault) return -1; return !strncmp(fault, "on", 2); } /** * ses_indicator_list - Build SES indicator list for the given enclosure * * @list loc_code structure * @vpd dev_vpd structure * * Returns : * 0 on success, !0 on failure */ static int ses_indicator_list(struct loc_code **list, struct dev_vpd *vpd) { char buf[128]; char *desc; char *fru_loc; char *args[] = {SCSI_INDICATOR_CMD, "-v", "-l", (char *const)vpd->dev, NULL}; int rc; pid_t cpid; FILE *fp; struct loc_code *curr = *list; fp = spopen(args, &cpid); if (fp == NULL) { log_msg("Unable to get enclosure indicator list. " "Ensure that encl_led command is installed."); return -1; } if (curr) while (curr->next) curr = curr->next; while (fgets_nonl(buf, 128, fp) != NULL) { fru_loc = get_ses_fru_location(buf); if (!fru_loc) continue; /* Advance buffer to parse description field */ desc = get_ses_fru_desc(fru_loc + strlen(fru_loc) + 1); if (!curr) { curr = calloc(1, sizeof(struct loc_code)); *list = curr; } else { curr->next = calloc(1, sizeof(struct loc_code)); curr = curr->next; } if (!curr) { log_msg("Out of memory"); /* Read until pipe becomes empty */ while (fgets_nonl(buf, 128, fp) != NULL) ; rc = spclose(fp, cpid); if (rc) log_msg("%s: spclose failed [rc=%d]\n", __func__, rc); return -1; } /* fill loc_code structure */ strncpy(curr->code, vpd->location, LOCATION_LENGTH -1); if (strcmp(fru_loc, "-")) { /* Components */ strncat(curr->code, "-", LOCATION_LENGTH - strlen(curr->code) - 1); strncat(curr->code, fru_loc, LOCATION_LENGTH - strlen(curr->code) - 1); } curr->length = strlen(curr->code) + 1; curr->type = TYPE_SES; /* We need to keep track of the sg device. */ strncpy(curr->dev, vpd->dev, DEV_LENGTH - 1); /* lsvpd does not provide vpd data for components like power * supply inside enclosure. Lets keep the display name. */ if (desc) snprintf(curr->ds, VPD_LENGTH, "Enclosure %s : %s", vpd->dev, desc); } rc = spclose(fp, cpid); if (rc) { log_msg("%s: spclose failed [rc=%d]\n", __func__, rc); return -1; } return 0; } /** * get_ses_indices - Get SES indicator list * * @loc loc_code structure * * Returns : * none */ void get_ses_indices(int indicator, struct loc_code **list) { int vpd_matched; struct dev_vpd *vpd; struct dev_vpd *v1; struct dev_vpd *v2; vpd = read_ses_vpd(); if (!vpd) return; /* Some of the enclosures can be represented by multiple sg devices. * Make sure we don't duplicate the location code for such devices. * Ex: A Bluehawk can be represented by 4 different sg devices. */ for (v1 = vpd; v1; v1 = v1->next) { if (!enclosure_supported(v1->mtm)) continue; vpd_matched = 0; for (v2 = v1->next; v2; v2 = v2->next) { if (!enclosure_supported(v2->mtm)) continue; if (!strcmp(v1->location, v2->location)) { vpd_matched = 1; break; } } if (!vpd_matched && v1->location[0] != '\0') if (ses_indicator_list(list, v1)) { free_device_vpd(vpd); return; } } free_device_vpd(vpd); return; } /** * get_ses_indicator - get SES indicator state * * @loc loc_code structure * @state return ses indicator state of given loc * * Returns * 0 on success / -1 on failure */ int get_ses_indicator(int indicator, struct loc_code *loc, int *state) { int fru_found = 0; char buf[128]; char *fru_loc; char *fru; char *args[] = {SCSI_INDICATOR_CMD, "-l", (char *const)loc->dev, /* FRU loc */ NULL, NULL}; int rc; pid_t cpid; FILE *fp; fru_loc = get_relative_fru_location(loc->code); if (!fru_loc) /* Enclosure location code */ fru_loc = "-"; args[3] = (char *const)fru_loc; fp = spopen(args, &cpid); if (fp == NULL) { log_msg("Unable to get enclosure LED status. " "Ensure that encl_led command is installed."); return -1; } while (fgets_nonl(buf, 128, fp) != NULL) { if (fru_found) /* read until pipe becomes empty*/ continue; fru = get_ses_fru_location(buf); if (fru && !strcmp(fru_loc, fru)) { fru_found = 1; if (indicator == LED_TYPE_IDENT) *state = get_ses_fru_identify_state(buf); else *state = get_ses_fru_fault_state(buf); } } rc = spclose(fp, cpid); if (rc) { log_msg("%s: spclose failed [rc=%d]\n", __func__, rc); return -1; } if (!fru_found) return -1; return 0; } /** * set_ses_indicator - Set SES indicators * * @loc loc_code structure * @state value to update indicator to * * Returns : * ioctl call return code */ int set_ses_indicator(int indicator, struct loc_code *loc, int new_value) { char *fru_loc; pid_t fork_pid; int status; fru_loc = get_relative_fru_location(loc->code); if (!fru_loc) /* Enclosure location code */ fru_loc = "-"; if (loc->dev[0] == '\0') return -1; if (access(SCSI_INDICATOR_CMD, X_OK) != 0) { log_msg("The command \"%s\" is not executable.\n", SCSI_INDICATOR_CMD); return -1; } fork_pid = fork(); if (fork_pid == -1) { log_msg("Couldn't fork() (%d:%s)\n", errno, strerror(errno)); return -1; } else if (fork_pid == 0) { /* Child */ char *args[6]; args[0] = (char *)SCSI_INDICATOR_CMD; args[1] = indicator == LED_TYPE_IDENT ? "-i" : "-f"; args[2] = new_value == LED_STATE_ON ? "on" : "off"; args[3] = loc->dev; args[4] = fru_loc; args[5] = NULL; execv(SCSI_INDICATOR_CMD, args); log_msg("Couldn't execv() into: %s (%d:%s)\n", SCSI_INDICATOR_CMD, errno, strerror(errno)); exit(EXIT_FAILURE); } /* Wait for set SES indicator command to complete */ if (waitpid(fork_pid, &status, 0) == -1) { log_msg("Wait failed, while running set SES indicator " "command\n"); return -1; } status = (int8_t)WEXITSTATUS(status); if (status) { log_msg("%s command execution failed\n", SCSI_INDICATOR_CMD); return -1; } return 0; } ppc64-diag-2.7.4/lpd/indicator_opal.c0000644000000000000000000002650613135275400014174 00000000000000/** * @file indicator_opal.c * @brief OPAL indicator manipulation routines * * Copyright (C) 2015 IBM Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * @author Vasant Hegde */ #include #include #include #include #include #include #include #include #include #include "indicator.h" #include "indicator_ses.h" #include "indicator_marvell.h" /* LED directory */ #define OPAL_LED_SYSFS_PATH "/sys/class/leds" #define OPAL_LED_FILE "brightness" /* LED Mode */ #define OPAL_LED_MODE_PROPERTY "/proc/device-tree/ibm,opal/leds/led-mode" #define OPAL_LED_MODE_LIGHT_PATH "lightpath" #define OPAL_LED_MODE_GUIDING_LIGHT "guidinglight" /* * LEDs are available under /sys/class/leds directory. Open this * dir for various LED operations. */ static DIR * open_sysfs_led_dir(void) { int rc; DIR *dir; rc = access(OPAL_LED_SYSFS_PATH, R_OK); if (rc != 0) { log_msg("%s : Error accessing led sysfs dir: %s (%d: %s)", __func__, OPAL_LED_SYSFS_PATH, errno, strerror(errno)); return NULL; } dir = opendir(OPAL_LED_SYSFS_PATH); if (!dir) log_msg("%s : Failed to open led sysfs dir : %s (%d: %s)", __func__, OPAL_LED_SYSFS_PATH, errno, strerror(errno)); return dir; } /* Close LED class dir */ static inline void close_sysfs_led_dir(DIR *dir) { closedir(dir); } /* Parse LED location code */ static struct loc_code * opal_parse_loc_code(int indicator, struct loc_code *loc, const char *dirname) { char *colon; int loc_len; struct loc_code *curr = loc; colon = strstr(dirname, ":"); if (!colon) { log_msg("%s : Invalid location code", __func__); return loc; } loc_len = colon - dirname; if (loc_len <= 0 || loc_len >= LOCATION_LENGTH) { log_msg("%s : Invalid location code length", __func__); return loc; } if (!curr) { curr = malloc(sizeof(struct loc_code)); loc = curr; } else { while (curr->next) curr = curr->next; curr->next = malloc(sizeof(struct loc_code)); curr = curr->next; } if (!curr) { log_msg("%s : Out of memory", __func__); return loc; } memset(curr, 0, sizeof(struct loc_code)); strncpy(curr->code, dirname, loc_len); curr->code[loc_len] = '\0'; curr->length = loc_len + 1; /* Including NULL */ curr->type = TYPE_OPAL; curr->index = indicator; /* LED_TYPE_{ATTN/IDENT/FAULT} */ curr->next = NULL; return loc; } /** * Get OPAL platform related indicator list * * @indicator identification or attention/fault indicator * @loc pointer to loc_code structure * * Returns : * 0 on success, !0 on failure */ static int opal_get_indices(int indicator, struct loc_code **loc) { const char *indicator_desc; int i; int rc = -1; int nleds; struct loc_code *list = *loc; struct dirent **dirlist; struct dirent *dirent; indicator_desc = get_indicator_desc(indicator); if (!indicator_desc) return rc; nleds = scandir(OPAL_LED_SYSFS_PATH, &dirlist, NULL, alphasort); if (nleds == -1) { log_msg("%s : Failed to read led sysfs dir : %s", __func__, OPAL_LED_SYSFS_PATH); return rc; } for (i = 0; i < nleds; i++) { dirent = dirlist[i]; if (dirent->d_type != DT_DIR && dirent->d_type != DT_LNK) { free(dirlist[i]); continue; } if (strstr(dirent->d_name, indicator_desc)) list = opal_parse_loc_code(indicator, list, dirent->d_name); free(dirlist[i]); } *loc = list; free(dirlist); return 0; } /* Open /sys/class/leds/:/brightnes file */ static int open_led_brightness_file(struct loc_code *loc, int mode) { const char *indicator_desc; char filename[PATH_MAX]; int len; int fd; int rc = -1; indicator_desc = get_indicator_desc(loc->index); if (!indicator_desc) return rc; len = snprintf(filename, PATH_MAX, "%s/%s:%s/%s", OPAL_LED_SYSFS_PATH, loc->code, indicator_desc, OPAL_LED_FILE); if (len >= PATH_MAX) { log_msg("%s : Path to LED brightness file is too big", __func__); return rc; } fd = open(filename, mode); if (fd == -1) log_msg("%s : Failed to open %s file", __func__, filename); return fd; } static inline void close_led_brightness_file(int fd) { close(fd); } /** * opal_get_indicator - Get OPAL LED state * * @indicator identification or attention indicator * @loc location code of the sensor * @state return sensor state for the given loc * * Returns : * 0 on success, !0 on failure */ static int opal_get_indicator(struct loc_code *loc, int *state) { int fd; int rc = -1; char buf[4]; fd = open_led_brightness_file(loc, O_RDONLY); if (fd == -1) return rc; rc = read(fd, buf, 4); if (rc == -1) { log_msg("%s : Failed to read LED state. (%d : %s)", __func__, errno, strerror(errno)); close_led_brightness_file(fd); return rc; } *state = atoi(buf); close_led_brightness_file(fd); return 0; } /** * opal_set_indicator - Set OPAL indicator * * @indicator identification or attention indicator * @loc location code of OPAL indicator * @new_value value to update indicator to * * Returns : * 0 on success, !0 on failure */ static int opal_set_indicator(struct loc_code *loc, int new_value) { char buf = '0'; int fd; int rc = -1; if (new_value) buf = '1'; fd = open_led_brightness_file(loc, O_WRONLY); if (fd == -1) return rc; rc = write(fd, &buf, 1); if (rc == -1) { log_msg("%s : Failed to modify LED state. (%d : %s)", __func__, errno, strerror(errno)); close_led_brightness_file(fd); return rc; } close_led_brightness_file(fd); return 0; } /* * opal_indicator_probe_led_class - Probe LED class (/sys/class/leds) * indicator support on OPAL based platform * * Returns: * 0 if indicator is supported, else -1 */ static int opal_indicator_probe_led_class(void) { int rc = -1; DIR *led_dir; struct dirent *dirent; led_dir = open_sysfs_led_dir(); if (!led_dir) return rc; /* * LED is supported if we have at least directory * under /sys/class/leds */ while ((dirent = readdir(led_dir)) != NULL) { if (!strcmp(dirent->d_name, ".") || !strcmp(dirent->d_name, "..")) continue; if (dirent->d_type != DT_DIR && dirent->d_type != DT_LNK) continue; close_sysfs_led_dir(led_dir); return 0; } close_sysfs_led_dir(led_dir); return rc; } /* * opal_indicator_probe_marvell - Probe Marvell indicator support on * OPAL based platform * * Returns: * 0 if indicator is supported, else -1 */ static int opal_indicator_probe_marvell(void) { struct loc_code *list = NULL; get_mv_indices(LED_TYPE_IDENT, &list); if (list) { free_indicator_list(list); return 0; } return -1; } /* * opal_indicator_probe - Probe indicator support on OPAL based platform * * Returns: * 0 if indicator is supported, else -1 */ static int opal_indicator_probe(void) { int rc = -1; if (!opal_indicator_probe_led_class()) rc = 0; /* * Marvell HDD LEDs are not presented/controlled via kernel LEDs * (i.e., /sys/class/leds), and some OPAL systems might not have * any kernel LEDs (e.g., modules not loaded) but still have the * Marvell SATA controller with LEDs available, and able to work. */ if (!opal_indicator_probe_marvell()) rc = 0; return rc; } /** * opal_get_indicator_mode - Gets the service indicator operating mode * * Returns : * operating mode value */ static int opal_get_indicator_mode(void) { char buf[128]; int rc = 0; int fd; int readsz; struct stat sbuf; rc = stat(OPAL_LED_MODE_PROPERTY, &sbuf); if (rc) { operating_mode = LED_MODE_LIGHT_PATH; return 0; } fd = open(OPAL_LED_MODE_PROPERTY, O_RDONLY); if (fd == -1) { log_msg("%s : Failed to open led mode DT file : %s (%d : %s)", __func__, OPAL_LED_MODE_PROPERTY, errno, strerror(errno)); return -1; } readsz = read(fd, buf, 128); if (readsz == -1) { log_msg("%s : Failed to read led mode : %s (%d : %s)", __func__, OPAL_LED_MODE_PROPERTY, errno, strerror(errno)); close(fd); return -1; } if (!strcmp(buf, OPAL_LED_MODE_LIGHT_PATH)) operating_mode = LED_MODE_LIGHT_PATH; else if (!strcmp(buf, OPAL_LED_MODE_GUIDING_LIGHT)) operating_mode = LED_MODE_GUIDING_LIGHT; else { log_msg("%s : Unknown LED operating mode\n", __func__); rc = -1; } close(fd); return rc; } /** * opal_get_indicator_list - Build indicator list of given type * * @indicator identification or fault indicator * @list loc_code structure * * Returns : * 0 on success, !0 otherwise */ static int opal_get_indicator_list(int indicator, struct loc_code **list) { /* * We treat first indicator in fault indicator list as * check log indicator. Hence parse attention indicator. */ if (indicator == LED_TYPE_FAULT) opal_get_indices(LED_TYPE_ATTN, list); /* FRU fault indicators are not supported in Guiding Light mode */ if (indicator == LED_TYPE_FAULT && operating_mode == LED_MODE_GUIDING_LIGHT) return 0; /* Get OPAL indicator list */ opal_get_indices(indicator, list); /* SES indicators */ get_ses_indices(indicator, list); /* Marvell HDD LEDs (indicators) */ get_mv_indices(indicator, list); /* * The list pointer (*list) is initially NULL. * If it's not-NULL here, we found indicators. */ return !(*list); } /** * opal_get_indicator_state - Retrieve the current state for an indicator * * @indicator identification or attention indicator * @loc location code of the sensor * @state return location for the sensor state * * Returns : * indicator return code */ static int opal_get_indicator_state(int indicator, struct loc_code *loc, int *state) { switch (loc->type) { case TYPE_OPAL: return opal_get_indicator(loc, state); case TYPE_SES: return get_ses_indicator(indicator, loc, state); case TYPE_MARVELL: return get_mv_indicator(indicator, loc, state); default: break; } return -1; } /** * opal_set_indicator_state - Set an indicator to a new state (on or off) * * Call the appropriate routine for setting indicators based on the type * of indicator. * * @indicator identification or attention indicator * @loc location code of opal indicator * @new_value value to update indicator to * * Returns : * indicator return code */ static int opal_set_indicator_state(int indicator, struct loc_code *loc, int new_value) { switch (loc->type) { case TYPE_OPAL: return opal_set_indicator(loc, new_value); case TYPE_SES: return set_ses_indicator(indicator, loc, new_value); case TYPE_MARVELL: return set_mv_indicator(indicator, loc, new_value); default: break; } return -1; } struct platform opal_platform = { .name = "opal", .probe = opal_indicator_probe, .get_indicator_mode = opal_get_indicator_mode, .get_indicator_list = opal_get_indicator_list, .get_indicator_state = opal_get_indicator_state, .set_indicator_state = opal_set_indicator_state, }; ppc64-diag-2.7.4/lpd/indicator_rtas.c0000644000000000000000000003100513135275400014200 00000000000000/** * @file indicator_rtas.c * @brief RTAS indicator manipulation routines * * Copyright (C) 2012 IBM Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * @author Vasant Hegde */ #include #include #include #include #include #include "indicator.h" #include "indicator_ses.h" /* Device tree property for indicator list */ #define RTAS_INDICATOR_DT_PATH "/proc/device-tree/rtas/ibm,get-indices" /* Token defination for indicator */ #define RTAS_INDICATOR_IDENT 9007 #define RTAS_INDICATOR_ATTN 9006 /* Defination for type of indicator call */ #define DYNAMIC_INDICATOR 0xFFFFFFFF /* RTAS error buffer size */ #define RTAS_ERROR_BUF_SIZE 64 /* Get RTAS token number for given LED type */ static inline int get_rtas_token(int indicator) { switch(indicator) { /* We use same token number for fault and checklog indicator */ case LED_TYPE_ATTN: case LED_TYPE_FAULT: return RTAS_INDICATOR_ATTN; case LED_TYPE_IDENT: return RTAS_INDICATOR_IDENT; } return -1; } /** * parse_work_area - Parse the working buffer * * @loc list to add new data to * @buf working area to parse * * Returns : * pointer to new loc_code list */ static struct loc_code * parse_rtas_workarea(struct loc_code *loc, const char *buf) { int i; uint32_t num = be32toh(*(uint32_t *)buf); struct loc_code *curr = loc; if (curr) while (curr->next) curr = curr->next; buf += sizeof(uint32_t); for (i = 0; i < num; i++) { if (!curr) { curr = calloc(1, sizeof(struct loc_code)); loc = curr; } else { curr->next = calloc(1, sizeof(struct loc_code)); curr = curr->next; } if (!curr) { log_msg("Out of memory"); /* free up previously allocated memory */ free_indicator_list(loc); return NULL; } /* * NOTE: Location code length and location code string combined * is given as the input to LED indicator related rtas calls. So * the buffer representation of the location code length and * location code string must be PAPR compliant and big endian at * all times. Convert the location code length to host format when * ever required on the need basis. */ curr->index = be32toh(*(uint32_t *)buf); buf += sizeof(uint32_t); /* Includes NULL char */ curr->length = be32toh(*(uint32_t *)buf); buf += sizeof(uint32_t); /* Corrupted work area */ if (curr->length > LOCATION_LENGTH) { free_indicator_list(loc); return NULL; } strncpy(curr->code, buf, curr->length); buf += curr->length; curr->code[curr->length] = '\0'; curr->length = strlen(curr->code) + 1; curr->length = htobe32(curr->length); curr->type = TYPE_RTAS; curr->next = NULL; } return loc; } /** * librtas_error - Check for librtas specific return codes * * @Note: * librtas_error is based on librtas_error.c in powerpc-util package. * @author Nathan Fontenot * * This will check the error value for a librtas specific return code * and fill in the buffer with the appropriate error message. * * @error return code from librtas * @buf buffer to fill with error string * @size size of "buffer" * * Returns : * nothing */ static void librtas_error(int error, char *buf, size_t size) { switch (error) { case RTAS_KERNEL_INT: snprintf(buf, size, "No kernel interface to firmware"); break; case RTAS_KERNEL_IMP: snprintf(buf, size, "No kernel implementation of function"); break; case RTAS_PERM: snprintf(buf, size, "Non-root caller"); break; case RTAS_NO_MEM: snprintf(buf, size, "Out of heap memory"); break; case RTAS_NO_LOWMEM: snprintf(buf, size, "Kernel out of low memory"); break; case RTAS_FREE_ERR: snprintf(buf, size, "Attempt to free nonexistent RMO buffer"); break; case RTAS_TIMEOUT: snprintf(buf, size, "RTAS delay exceeded specified timeout"); break; case RTAS_IO_ASSERT: snprintf(buf, size, "Unexpected librtas I/O error"); break; case RTAS_UNKNOWN_OP: snprintf(buf, size, "No firmware implementation of function"); break; default: snprintf(buf, size, "Unknown librtas error %d", error); } } /** * get_rtas_list - Gets rtas indicator list * * @indicator identification or attention indicator * @loc pointer to loc_code structure * * Returns : * rtas call return value */ static int get_rtas_indices(int indicator, struct loc_code **loc) { int rc; int index = 1; int next_index; int rtas_token; char workarea[BUF_SIZE]; char err_buf[RTAS_ERROR_BUF_SIZE]; struct loc_code *list = NULL; rtas_token = get_rtas_token(indicator); if (rtas_token == -1) return -3; /* Indicator type not supported */ do { rc = rtas_get_indices(0, rtas_token, workarea, BUF_SIZE, index, &next_index); switch (rc) { case 1: /* more data available */ index = next_index; /* fall through */ case 0: /* success */ list = parse_rtas_workarea(list, workarea); if (!list) return -99; /* Out of heap memory */ break; case -1: /* hardware error */ log_msg("Hardware error retrieving indicator indices"); free_indicator_list(list); break; case RTAS_UNKNOWN_OP: /* Yes, this is a librtas return code but it should * be treated the same as a -3 return code, both * indicate that functionality is not supported */ librtas_error(rc, err_buf, RTAS_ERROR_BUF_SIZE); /* fall through */ case -3: /* indicator type not supported. */ log_msg("The %s indicators are not supported on this " "system", get_indicator_desc(indicator)); if (rc == RTAS_UNKNOWN_OP) log_msg(",\n%s", err_buf); free_indicator_list(list); break; case -4: /* list changed; start over */ free_indicator_list(list); list = NULL; index = 1; break; default: librtas_error(rc, err_buf, RTAS_ERROR_BUF_SIZE); log_msg("Could not retrieve data for %s " "indicators,\n%s", get_indicator_desc(indicator), err_buf); free_indicator_list(list); break; } } while ((rc == 1) || (rc == -4)); *loc = list; return rc; } /** * get_rtas_sensor - Retrieve a sensor value from rtas * * Call the rtas_get_sensor or rtas_get_dynamic_sensor librtas calls, * depending on whether the index indicates that the sensor is dynamic. * * @indicator identification or attention indicator * @loc location code of the sensor * @state return sensor state for the given loc * * Returns : * rtas call return code */ static int get_rtas_sensor(int indicator, struct loc_code *loc, int *state) { int rc; int rtas_token; char err_buf[RTAS_ERROR_BUF_SIZE]; rtas_token = get_rtas_token(indicator); if (rtas_token == -1) return -3; /* No such sensor implemented */ if (loc->index == DYNAMIC_INDICATOR) rc = rtas_get_dynamic_sensor(rtas_token, (void *)loc, state); else rc = rtas_get_sensor(rtas_token, loc->index, state); switch (rc) { case 0: /*success */ break; case -1: log_msg("Hardware error retrieving the indicator at %s", loc->code); break; case -2: log_msg("Busy while retrieving indicator at %s. " "Try again later", loc->code); break; case -3: log_msg("The indicator at %s is not implemented", loc->code); break; default: librtas_error(rc, err_buf, RTAS_ERROR_BUF_SIZE); log_msg("Could not get %ssensor %s indicators,\n%s", (loc->index == DYNAMIC_INDICATOR) ? "dynamic " : "", get_indicator_desc(indicator), err_buf); break; } return rc; } /** * set_rtas_indicator - Set rtas indicator * * Call the rtas_set_indicator or rtas_set_dynamic_indicator librtas calls, * depending on whether the index indicates that the indicator is dynamic. * * @indicator identification or attention indicator * @loc location code of rtas indicator * @new_value value to update indicator to * * Returns : * rtas call return code */ static int set_rtas_indicator(int indicator, struct loc_code *loc, int new_value) { int rc; int rtas_token; char err_buf[RTAS_ERROR_BUF_SIZE]; rtas_token = get_rtas_token(indicator); if (rtas_token == -1) return -3; /* No such sensor implemented */ if (loc->index == DYNAMIC_INDICATOR) rc = rtas_set_dynamic_indicator(rtas_token, new_value, (void *)loc); else rc = rtas_set_indicator(rtas_token, loc->index, new_value); switch (rc) { case 0: /*success */ break; case -1: log_msg("Hardware error while setting the indicator at %s", loc->code); break; case -2: log_msg("Busy while setting the indicator at %s. " "Try again later", loc->code); break; case -3: log_msg("The indicator at %s is not implemented", loc->code); break; default: librtas_error(rc, err_buf, RTAS_ERROR_BUF_SIZE); log_msg("Could not set %ssensor %s indicators,\n%s", (loc->index == DYNAMIC_INDICATOR) ? "dynamic " : "", get_indicator_desc(indicator), err_buf); break; } return rc; } /* * rtas_indicator_probe - Probe indicator support on RTAS based platform * * Returns: * 0 if indicator is supported, else -1 */ static int rtas_indicator_probe(void) { return 0; } /** * get_rtas_indicator_mode - Gets the service indicator operating mode * * Note: There is no defined property in PAPR+ to determine the indicator * operating mode. There is some work being done to get property * into PAPR. When that is done we will check for that property. * * At present, we will query RTAS fault indicators. It should return * at least one fault indicator, that is check log indicator. If only * one indicator is returned, then Guiding Light mode else Light Path * mode. * * Returns : * operating mode value */ static int get_rtas_indicator_mode(void) { int rc; struct loc_code *list = NULL; rc = get_rtas_indices(LED_TYPE_FAULT, &list); if (rc) return -1; if (!list) /* failed */ return -1; else if (!list->next) operating_mode = LED_MODE_GUIDING_LIGHT; else operating_mode = LED_MODE_LIGHT_PATH; free_indicator_list(list); return 0; } /** * get_rtas_indicator_list - Build indicator list of given type * * @indicator identification or attention indicator * @list loc_code structure * * Returns : * 0 on success, !0 otherwise */ static int get_rtas_indicator_list(int indicator, struct loc_code **list) { int rc; /* Get RTAS indicator list */ rc = get_rtas_indices(indicator, list); if (rc) return rc; /* FRU fault indicators are not supported in Guiding Light mode */ if (indicator == LED_TYPE_FAULT && operating_mode == LED_MODE_GUIDING_LIGHT) return rc; /* SES indicators */ get_ses_indices(indicator, list); return rc; } /** * get_rtas_indicator_state - Retrieve the current state for an indicator * * Call the appropriate routine for retrieving indicator values based on the * type of indicator. * * @indicator identification or attention indicator * @loc location code of the sensor * @state return location for the sensor state * * Returns : * indicator return code */ static int get_rtas_indicator_state(int indicator, struct loc_code *loc, int *state) { switch (loc->type) { case TYPE_RTAS: return get_rtas_sensor(indicator, loc, state); case TYPE_SES: return get_ses_indicator(indicator, loc, state); default: break; } return -1; } /** * set_rtas_indicator_state - Set an indicator to a new state (on or off) * * Call the appropriate routine for setting indicators based on the type * of indicator. * * @indicator identification or attention indicator * @loc location code of rtas indicator * @new_value value to update indicator to * * Returns : * indicator return code */ static int set_rtas_indicator_state(int indicator, struct loc_code *loc, int new_value) { switch (loc->type) { case TYPE_RTAS: return set_rtas_indicator(indicator, loc, new_value); case TYPE_SES: return set_ses_indicator(indicator, loc, new_value); default: break; } return -1; } struct platform rtas_platform = { .name = "rtas", .probe = rtas_indicator_probe, .get_indicator_mode = get_rtas_indicator_mode, .get_indicator_list = get_rtas_indicator_list, .get_indicator_state = get_rtas_indicator_state, .set_indicator_state = set_rtas_indicator_state, }; ppc64-diag-2.7.4/lpd/indicator_marvell.c0000644000000000000000000003457413135275400014707 00000000000000/** * @file indicator_marvell.c * @brief Marvell HDD LEDs (indicators) manipulation routines * * Copyright (C) 2016 IBM Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * @author Mauricio Faria de Oliveira * @author Douglas Miller */ #include #include #include #include #include #include #include #include #include #include #include #include #include "indicator.h" #include "lp_util.h" #include "utils.h" /* * Path to block devices in sysfs */ #define SYS_BLOCK_PATH "/sys/block" /* * PCI IDs of the Marvell 9235 SATA controller in * IBM Power System S822LC for HPC (Garrison/Minsky). */ #define MV_PCI_VID "0x1b4b" #define MV_PCI_DID "0x9235" #define MV_PCI_SVID "0x1014" #define MV_PCI_SSID "0x0612" #define MV_PCI_ID_BUF_LEN 7 /* "0x3456" and '\0' */ /* * Vendor-Specific Registers (VSR) are accessed indirectly * through a pair of registers in PCI BAR5. * * First, set the VSR address in VSR_ADDR; * Then, read/write data from/to VSR_DATA. */ static const uint32_t mv_pci_bar5_vsr_addr = 0xa8; static const uint32_t mv_pci_bar5_vsr_data = 0xac; static const uint32_t mv_pci_bar5_length = 2048; /* * The LEDs are controlled via GPIO pins or SATA link/activity status (default). * * This involves 3 VSRs: * - The LED mode of a SATA port is set in the PORT_ACTIVE_SEL register. * (either GPIO pin state or SATA link/activity status for all/one SATA port) * - The GPIO pin state is set in the DATA_OUT register. * - The GPIO pin state output is enabled in the DATA_OUT_ENABLE register. * * On Garrison/Minsky the identification LED of the SATA port 'N' is wired * to the GPIO pin of the SATA port 'N + 2' (the max. number of disks is 2). * The PORT_ACTIVE_SEL and DATA_OUT_ENABLE registers are set by default so * that SATA ports 3 and 4 (that is, the identification LEDs of SATA ports * 1 and 2) are GPIO-pin based, and only the DATA_OUT register needs to be * modified to (un)light the identification LEDs (a.k.a. fault LEDs). * * Register information: * * GPIO Data Out: * - 1 bit per GPIO pin (31-0) * - default: 0x00000018 (all low, except for pins 3 and 4) * - The LEDs are ON on low and OFF on high. * * GPIO Data Out Enable: * - 1 bit per GPIO bin (31-0) * - default: 0xffffffe7 (all high, except for pins 3 and 4) * - active low (data output enabled on bit value 0) * * Port Active Enable (or Port GPIOx Active Select) * - bits 31-30: reserved (zero) * - bits 29-00: 10x 3-bit mode (SATA ports 9-0) * - default: 0x2db6da8d */ static const uint32_t mv_gpio_data_out = 0x07071020; static const uint32_t mv_gpio_data_out_enable = 0x07071024; static const uint32_t mv_gpio_port_active_sel = 0x07071058; static const uint32_t mv_port_number_offset = 2; static const uint32_t mv_port_number_max = 9; static char *mv_port_mode[] = { "All SATAx LINK and ACT", // 0x0 "SATA0 LINK and ACT", // 0x1 "SATA1 LINK and ACT", // 0x2 "SATA2 LINK and ACT", // 0x3 "SATA3 LINK and ACT", // 0x4 "GPIO_DATA_OUT[n]", // 0x5 "Invalid (6)", // 0x6 "Invalid (7)" // 0x7 }; /** * mv_mmap_bar5 - open() and mmap() a PCI BAR5 (resource5) file. * the caller should unmap/close (see mv_munmap_bar5()). * * @path path to the 'resource5' file * @fd pointer to a file descriptor * * Return: * - success: pointer to the mmap()'ed PCI BAR5 * - failure: NULL */ static void * mv_mmap_bar5(const char* path, int *fd) { void *bar5; /* open and mmap PCI BAR5 */ *fd = open(path, O_RDWR); if (*fd < 0) { log_msg("Unable to open file '%s'", path); return NULL; } bar5 = mmap(NULL, mv_pci_bar5_length, PROT_READ | PROT_WRITE, MAP_SHARED, *fd, 0); if (bar5 == MAP_FAILED) { log_msg("Unable to mmap file '%s'", path); close(*fd); return NULL; } return bar5; } /** * mv_munmap_bar5 - munmap() and close() a PCI BAR5 (resource5) file. * (release resources from mv_mmap_bar5()). * * @bar5 pointer to the mmap()'ed PCI BAR5 * @fd file descriptor of the open()'ed/mmap()'ed PCI BAR5 * * Return: * - nothing */ static void mv_munmap_bar5(void *bar5, int fd) { /* munmap() and close PCI BAR5 */ if (munmap(bar5, mv_pci_bar5_length)) log_msg("Unable to munmap file"); if (close(fd)) log_msg("Unable to close file"); } /** * mv_vsr_read - read a VSR * * @bar5 pointer to mmap()'ed PCI BAR5 (see mv_mmap_bar5()) * @vsr_addr VSR address to read from * * Return: * - VSR data read */ static uint32_t mv_vsr_read(void* bar5, uint32_t vsr_addr) { volatile uint32_t *addr = (uint32_t *)(bar5 + mv_pci_bar5_vsr_addr); volatile uint32_t *data = (uint32_t *)(bar5 + mv_pci_bar5_vsr_data); /* set address and read data */ *addr = vsr_addr; return *data; } /** * mv_vsr_write - write a VSR * * @bar5 pointer to mmap()'ed PCI BAR5 (see mv_mmap_bar5()) * @vsr_addr VSR address to write to * @vsr_data VSR data to write * * Return: * - nothing */ static void mv_vsr_write(void* bar5, uint32_t vsr_addr, uint32_t vsr_data) { volatile uint32_t *addr = (uint32_t *)(bar5 + mv_pci_bar5_vsr_addr); volatile uint32_t *data = (uint32_t *)(bar5 + mv_pci_bar5_vsr_data); /* set address and write data */ *addr = vsr_addr; *data = vsr_data; } /** * mv_get_port_mode - get the LED mode of a SATA port (from register copy) * * @port_number number of the SATA port (0-9) * @port_mode pointer to the LED mode (result) (see mv_port_mode[]) * @port_active_sel copy of the PORT_ACTIVE_SEL register * * Return: * - -1 on failure * - 0 on success */ static int mv_get_port_mode(uint32_t port_number, uint32_t *port_mode, uint32_t port_active_sel) { uint32_t shift, mask; if (port_number > mv_port_number_max) { log_msg("Invalid port number: '%u'", port_number); return -1; } /* get the 3-bit mode of SATA port N */ shift = 3 * port_number; mask = 0x7 << shift; *port_mode = (port_active_sel & mask) >> shift; return 0; } /** * check_pci_id() - checks the value of a PCI ID file. * * Return: * - 0 on success (open/read file, and match value) * - -1 on failure * - +1 on different values */ static int check_pci_id(char *path, char *pci_id) { FILE *f; char *pci_id_rc, pci_id_buf[MV_PCI_ID_BUF_LEN]; f = fopen(path, "r"); if (!f) { log_msg("Unable to open file '%s'", path); return -1; } pci_id_rc = fgets(pci_id_buf, MV_PCI_ID_BUF_LEN, f); if (!pci_id_rc) { log_msg("Unable to read file '%s'", path); fclose(f); return -1; } fclose(f); return !!strncmp(pci_id, pci_id_buf, MV_PCI_ID_BUF_LEN); } /** * mv_indicator_list - Build Marvell HDD LED (indicator) list for the given disk vpd * * @list loc_code structure * @vpd dev_vpd structure * * Return: * - 0 on success or skip vpd (not a Marvell SATA disk) * - -1 on failure */ static int mv_indicator_list(struct loc_code **list, struct dev_vpd *vpd) { struct loc_code *list_curr, *list_new; char path[PATH_MAX], symlink[PATH_MAX]; char *ata_device, *host; ssize_t len; /* check for an 'sdX' device name */ if (strncmp(vpd->dev, "sd", 2)) return 0; /* read the '/sys/block/sdX' symlink to '../device/pci.../sdX' */ snprintf(path, PATH_MAX, "%s/%s", SYS_BLOCK_PATH, vpd->dev); len = readlink(path, symlink, PATH_MAX); if (len < 0) { log_msg("Unable to read the contents of symbolic link '%s'", path); return -1; } symlink[len] = '\0'; /* * check for an 'ataX' subdir (w/ trailing 'X' digit); for example 'ata1' in * '../devices/pci<...>/0001:08:00.0/ata1/host3/target3:0:0/3:0:0:0/block/sdj' */ ata_device = strstr(symlink, "/ata"); if (!ata_device || !isdigit(ata_device[4])) return 0; host = strstr(symlink, "/host"); if (!host || !isdigit(host[5])) return 0; /* split symlink into relative path for PCI device dir and ataX device */ ata_device[0] = '\0'; /* end symlink on leading '/' of '/ataX/' */ ata_device++; /* skip the leading '/' of '/ataX/' */ host[0] = '\0'; /* end ata_device on trailing '/' of '/ataX/', * which is the leading '/' of '/hostY/' */ /* * get the absolute path for the PCI device dir from symlink, * which is relative to /sys/block (e.g., '../devices/pci...'), * so skip the leading '../' (3 chars) */ len = snprintf(path, PATH_MAX, "%s/%s", "/sys", &symlink[3]); if (len < 0) { log_msg("Unable to format absolute pathname of '%s'", symlink); return -1; } /* * check for the PCI IDs of the Marvell 9235 SATA controller. * * concatenate the PCI ID files' basename after the dirname * with strncpy() (string length + 1 for '\0'). */ strncpy(&path[len], "/vendor", 8); if (check_pci_id(path, MV_PCI_VID)) return 0; strncpy(&path[len], "/device", 8); if (check_pci_id(path, MV_PCI_DID)) return 0; strncpy(&path[len], "/subsystem_vendor", 18); if (check_pci_id(path, MV_PCI_SVID)) return 0; strncpy(&path[len], "/subsystem_device", 18); if (check_pci_id(path, MV_PCI_SSID)) return 0; path[len] = '\0'; /* restore path as dirname of PCI device dir */ /* Allocate one loc_code element, and insert/append it to the list */ list_new = calloc(1, sizeof(struct loc_code)); if (!list_new) { log_msg("Out of memory"); return 1; } if (*list) { /* position list_curr in the last element of the list */ list_curr = *list; while (list_curr->next) list_curr = list_curr->next; /* append the new element to the list */ list_curr->next = list_new; } else { /* null list; insert the new element at the list head */ *list = list_new; } /* set the new element's properties */ list_new->type = TYPE_MARVELL; strncpy(list_new->code, vpd->location, LOCATION_LENGTH); /* loc. code */ strncpy(list_new->devname, vpd->dev, DEV_LENGTH); /* sdX device name */ snprintf(list_new->dev, DEV_LENGTH, "%s/resource5", path); /* PCI BAR5 */ list_new->index = (uint32_t)atoi(&ata_device[3]); /* use for ATA index */ dbg("Marvell HDD LED:"); dbg("- location code: '%s'", list_new->code); dbg("- device name (disk): '%s'", list_new->devname); dbg("- device name (pci bar5): '%s'", list_new->dev); dbg("- ata index: '%u'", list_new->index); return 0; } /** * get_mv_indices - Get Marvell HDD LEDs (indicators) list * * @indicator led type * @loc_list loc_code structure * * Return: * - nothing */ void get_mv_indices(int indicator, struct loc_code **loc_list) { struct dev_vpd *vpd_list, *vpd_curr; /* support for identification LEDs only */ if (indicator != LED_TYPE_IDENT) return; /* get block devices' vpd information */ vpd_list = read_device_vpd(SYS_BLOCK_PATH); if (!vpd_list) return; /* search for Marvell HDDs, and append to the list */ for (vpd_curr = vpd_list; vpd_curr; vpd_curr = vpd_curr->next) if (vpd_curr->location[0] != '\0') if (mv_indicator_list(loc_list, vpd_curr)) break; free_device_vpd(vpd_list); } /** * get_mv_indicator - get Marvell HDD LED/indicator state * * @loc loc_code structure * @state return indicator state of given loc * * Return: * - 0 on success * - -1 on failure */ int get_mv_indicator(int indicator, struct loc_code *loc, int *state) { int fd; void *bar5; uint32_t data_out, data_out_enable, active_sel; uint32_t port_number, port_mode; /* support for identification LEDs only */ if (indicator != LED_TYPE_IDENT) return -1; /* read registers from PCI BAR5 */ bar5 = mv_mmap_bar5(loc->dev, &fd); if (!bar5) return -1; /* log_msg() done */ /* for debugging, read the 3 VSRs; only DATA_OUT is required */ data_out = mv_vsr_read(bar5, mv_gpio_data_out); data_out_enable = mv_vsr_read(bar5, mv_gpio_data_out_enable); active_sel = mv_vsr_read(bar5, mv_gpio_port_active_sel); /* for debugging, get the LED mode of the SATA port 'N + offset' */ port_number = loc->index + mv_port_number_offset; if (mv_get_port_mode(port_number, &port_mode, active_sel)) return -1; /* log_msg() done */ dbg("SATA disk '%s'", (loc->devname) ? loc->devname : "(null)"); dbg("Data Out: '0x%08x'", data_out); dbg("Data Out Enable: '0x%08x'", data_out_enable); dbg("Port Active Select: '0x%08x'", active_sel); dbg("ATA Index: '%u', Port Number: '%u', Port Mode: '%u' ('%s')", loc->index, port_number, port_mode, mv_port_mode[port_mode]); /* LED state: ON on low (bit 0) and OFF on high (bit 1) */ *state = (data_out & (1 << port_number)) ? LED_STATE_OFF : LED_STATE_ON; mv_munmap_bar5(bar5, fd); return 0; } /** * set_mv_indicator - set Marvell HDD LED/indicator state * * @loc loc_code structure * @state value to update indicator to * * Return: * - 0 on success * - -1 on failure */ int set_mv_indicator(int indicator, struct loc_code *loc, int new_value) { int fd; void *bar5; uint32_t data_out, port_number; /* support for identification LEDs only */ if (indicator != LED_TYPE_IDENT) return -1; /* sanity check */ if (new_value != LED_STATE_ON && new_value != LED_STATE_OFF) return -1; /* read/write registers from/to PCI BAR5 */ bar5 = mv_mmap_bar5(loc->dev, &fd); if (!bar5) return -1; /* log_msg() done */ /* * only changes to the DATA_OUT register are required with the default * values for the DATA_OUT_ENABLE and PORT_ACTIVE_SEL registers on the * Garrison/Minsky system (see header comments). */ data_out = mv_vsr_read(bar5, mv_gpio_data_out); /* set the LED state of the SATA port 'N + offset' */ port_number = loc->index + mv_port_number_offset; /* set/clear the bit in the DATA_OUT register; * LED state: ON on low (bit 0) and OFF on high (bit 1) */ if (new_value == LED_STATE_ON) data_out &= ~(1 << port_number); else data_out |= 1 << port_number; /* update the register */ mv_vsr_write(bar5, mv_gpio_data_out, data_out); /* for debugging, read the register again after writing */ dbg("Data Out (written to): '0x%08x'", data_out); data_out = mv_vsr_read(bar5, mv_gpio_data_out); dbg("Data Out (read again): '0x%08x'", data_out); mv_munmap_bar5(bar5, fd); return 0; } ppc64-diag-2.7.4/lpd/indicator.h0000644000000000000000000001212213135275400013153 00000000000000/** * Copyright (C) 2012 IBM Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef INDICATOR_H #define INDICATOR_H #include #include #include /* Definations for indicator operating mode */ #define LED_MODE_GUIDING_LIGHT 0x01 #define LED_MODE_LIGHT_PATH 0x02 /* Definations for indicator type */ #define LED_TYPE_IDENT 0x00 #define LED_TYPE_FAULT 0x01 #define LED_TYPE_ATTN 0x02 /* Indicator type description */ #define LED_DESC_IDENT "identify" #define LED_DESC_FAULT "fault" #define LED_DESC_ATTN "attention" /* Definations for indicator type */ #define TYPE_ALL 0 #define TYPE_RTAS 1 #define TYPE_SES 2 #define TYPE_OS 3 #define TYPE_OPAL 4 #define TYPE_MARVELL 5 #define TYPE_EOL 6 /* Indicator state */ #define LED_STATE_SAME -1 #define LED_STATE_ON 1 #define LED_STATE_OFF 0 /* Buffer size */ #define BUF_SIZE 4096 #define LP_ERROR_LOG_MAX 4096 /* Debug defination */ #define dbg(_f, _a...) _dbg("%s(): "_f, __FUNCTION__, ##_a) /* Log file size */ #define KILOBYTE 1024 #define LP_ERRD_LOGSZ (KILOBYTE * KILOBYTE) /* External variables */ extern uint32_t operating_mode; extern char *program_name; extern char *lp_event_log_file; extern int lp_event_log_fd; extern char *lp_error_log_file; extern int lp_error_log_fd; #define DEV_LENGTH PATH_MAX #define VPD_LENGTH 128 #define LOCATION_LENGTH 80 /* device vpd data */ struct dev_vpd { char dev[DEV_LENGTH]; char location[LOCATION_LENGTH]; char mtm[VPD_LENGTH]; char sn[VPD_LENGTH]; char pn[VPD_LENGTH]; char fru[VPD_LENGTH]; char ds[VPD_LENGTH]; struct dev_vpd *next; }; /* Indicator list - * * Note : * The order of the fields in loc_code is important! * First three fields must be first, and in this order. * These fields are used for RTAS-controlled indicators. * Fields after this point can be reordered. The 'length' * field must be big endian at all times irrespective of * the native platform. */ struct loc_code { __be32 length; /* includes null terminator (RTAS) */ char code[LOCATION_LENGTH]; /* location code */ uint32_t index; /* RTAS index, if RTAS indicator */ uint32_t type; /* one of TYPE_ defines */ int state; /* identify indicator status */ char dev[DEV_LENGTH]; /* device name to interact with*/ char devname[DEV_LENGTH]; /* like sda, sdb etc */ char mtm[VPD_LENGTH]; /* Model */ char sn[VPD_LENGTH]; /* Serial Number */ char pn[VPD_LENGTH]; /* Part Number */ char fru[VPD_LENGTH]; /* FRU number */ char ds[VPD_LENGTH]; /* Display name */ struct loc_code *next; }; /* Each platform provides a set of hooks for LED operation. */ struct platform { const char *name; /* Probe LED support */ int (*probe)(void); /* Check LED operating mode (Guiding Light/Light Path) */ int (*get_indicator_mode)(void); /* Get location code list for given led type */ int (*get_indicator_list)(int led_type, struct loc_code **list); /* Get LED state of given led_type for given location code */ int (*get_indicator_state)(int led_type, struct loc_code *loc, int *state); /* Update LED state of given led_type for given location code */ int (*set_indicator_state)(int led_type, struct loc_code *loc, int new_value); }; #define DECLARE_PLATFORM(name)\ const struct platform name ##_platform extern struct platform platform; extern struct platform rtas_platform; extern struct platform opal_platform; /* files.c */ extern void _dbg(const char *, ...); extern void log_msg(const char *, ...); extern int indicator_log_write(const char *, ...); extern int init_files(void); extern void close_files(void); /* indicator.c */ extern const char *get_indicator_desc(int ); extern int get_indicator_type(const char *); extern int is_enclosure_loc_code(struct loc_code *); extern int truncate_loc_code(char *); extern struct loc_code *get_indicator_for_loc_code(struct loc_code *, const char *); extern int probe_indicator(void); extern int get_indicator_mode(void); extern int get_indicator_list(int, struct loc_code **); extern int get_indicator_state(int , struct loc_code *, int *); extern int set_indicator_state(int , struct loc_code *, int); extern void get_all_indicator_state(int , struct loc_code *); extern void set_all_indicator_state(int , struct loc_code *, int); extern int enable_check_log_indicator(void); extern int disable_check_log_indicator(void); extern void free_indicator_list(struct loc_code *); #endif /* INDICATOR_H */ ppc64-diag-2.7.4/lpd/indicator_marvell.h0000644000000000000000000000206213135275400014677 00000000000000/** * Copyright (C) 2016 IBM Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef INDICATOR_MARVELL_H #define INDICATOR_MARVELL_H /* Marvell HDD LEDs (indicators) support */ extern void get_mv_indices(int, struct loc_code **); extern int get_mv_indicator(int, struct loc_code *, int *); extern int set_mv_indicator(int, struct loc_code *, int); #endif /* INDICATOR_MARVELL_H */ ppc64-diag-2.7.4/lpd/indicator_ses.h0000644000000000000000000000201713135275400014027 00000000000000/** * Copyright (C) 2012 IBM Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef INDICATOR_SES_H #define INDICATOR_SES_H /* SES support */ extern void get_ses_indices(int, struct loc_code **); extern int get_ses_indicator(int, struct loc_code *, int *); extern int set_ses_indicator(int, struct loc_code *, int); #endif /* INDICATOR_SES_H */ ppc64-diag-2.7.4/lpd/lp_util.h0000644000000000000000000000234713135275400012657 00000000000000/** * Copyright (C) 2012 IBM Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef LP_UTIL_H #define LP_UTIL_H extern int device_supported(const char *, const char *); extern int enclosure_supported(const char *); extern char *fgets_nonl(char *, int, FILE *); extern int read_vpd_from_lsvpd(struct dev_vpd *, const char *); extern void free_device_vpd(struct dev_vpd *); extern struct dev_vpd *read_device_vpd(const char *); extern void fill_indicators_vpd(struct loc_code *); extern int get_loc_code_for_dev(const char *, char *, int); #endif /* LP_UTIL_H */ ppc64-diag-2.7.4/lpd/servicelog.h0000644000000000000000000000213213135275400013341 00000000000000/** * Copyright (C) 2015 IBM Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef SERVICELOG_H #define SERVICELOG_H #include /* servicelog.c */ extern int get_service_event(int, struct sl_event **); extern int get_all_open_service_event(struct sl_event **); extern int get_repair_event(int, struct sl_event **); extern int print_service_event(struct sl_event *); #endif /* SERVICELOG_H */ ppc64-diag-2.7.4/lpd/usysident.c0000644000000000000000000003025013135275400013223 00000000000000/** * @file usysident.c * @brief usysident/usysattn/usysfault * * Copyright (C) 2012 IBM Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * @author Vasant Hegde * * @Note: * This file is the re-implementation of original usysident.c * file in powerpc-utils package. * @author Michael Strosaker * **/ #include #include #include #include #include #include #include #include #include "indicator.h" #include "lp_util.h" #define CMD_LINE_OPTIONS "d:l:s:-:thV" #define CMD_IDENTIFY "usysident" #define CMD_FAULT "usysfault" #define CMD_ATTN "usysattn" /* print indicator state */ #define print_indicator_state(loc) \ fprintf(stdout, "%s\t [%s]\n", loc->code, loc->state ? "on" : "off") /* Log indicator status */ #define indicator_log_state(indicator, loc, state) \ if (indicator == LED_TYPE_FAULT && !strchr(loc, '-')) \ indicator_log_write("System Attention Indicator : %s", \ state == LED_STATE_ON ? "ON" : "OFF"); \ else \ indicator_log_write("%s : %s : %s", loc, \ get_indicator_desc(LED_TYPE_IDENT), \ state == LED_STATE_ON ? "ON" : "OFF"); /** * print_usage - Print the usage statement */ static void print_usage(const char *cmd) { if (strstr(cmd, CMD_IDENTIFY)) { fprintf(stdout, "Usage:\n" " %s [-l [-s {identify|normal}][-t]]\n" " %s [-d [-s {identify|normal}][-t]]\n" " %s [-V]\n" " %s [-h]\n\n", cmd, cmd, cmd, cmd); fprintf(stdout, "Options:\n" " -l Indicator location code\n" " -d Device name\n" " -s identify Turn on device/location identify indicator\n" " -s normal Turn off device/location identify indicator\n" " -t Truncate loc code if necessary\n" " -V Print the version of the command\n" " -h Print this message and exit\n"); } else { fprintf(stdout, "Usage:\n" " %s [-l [-s normal][-t]]\n" " %s [-V]\n" " %s [-h]\n\n", cmd, cmd, cmd); fprintf(stdout, "Options:\n" " -l Indicator location code\n" " -s normal Turn off location fault indicator\n" " -t Truncate loc code if necessary\n" " -V Print the version of the command\n" " -h Print this message\n"); } } /** * main - */ int main(int argc, char **argv) { int c; int state; int indicator; int rc = 0; int trunc = 0; int truncated = 0; char temp[LOCATION_LENGTH]; char dloc[LOCATION_LENGTH]; char *dvalue = NULL; char *lvalue = NULL; char *svalue = NULL; char *othervalue = NULL; struct loc_code *current; struct loc_code *list = NULL; struct loc_code *list_start = NULL; program_name = argv[0]; if (probe_indicator() != 0) { fprintf(stderr, "%s is not supported on this platform\n", argv[0]); return 0; } opterr = 0; while ((c = getopt(argc, argv, CMD_LINE_OPTIONS)) != -1) { switch (c) { case 'd': /* Device name */ dvalue = optarg; break; case 'l': /* Location code */ lvalue = optarg; if (strlen(lvalue) >= LOCATION_LENGTH) { fprintf(stderr, "\nLocation code length cannot" " be > %d (including NULL char).\n\n", LOCATION_LENGTH); return 1; } break; case 's': /* Enable/disable */ svalue = optarg; break; case '-': /* All location code */ othervalue = optarg; break; case 't': /* truncate location code */ trunc = 1; break; case 'V': fprintf(stdout, "%s %s\n", argv[0], VERSION); fflush(stdout); return 0; case 'h': print_usage(argv[0]); return 0; case '?': if (isprint(optopt)) fprintf(stderr, "Unrecognized option: -%c\n\n", optopt); else fprintf(stderr, "Unrecognized option character %x\n\n", optopt); print_usage(argv[0]); return 1; default: print_usage(argv[0]); return 1; } } /* Option checking */ if (optind < argc) { fprintf(stderr, "Unrecognized argument : %s\n\n", argv[optind]); print_usage(argv[0]); return 1; } if (dvalue && !strstr(argv[0], CMD_IDENTIFY)) { fprintf(stderr, "Unrecognized option: -d\n\n"); print_usage(argv[0]); return 1; } if (dvalue && lvalue) { fprintf(stderr, "The -d and -l options cannot be used together.\n\n"); print_usage(argv[0]); return 1; } if (svalue && strstr(argv[0], CMD_IDENTIFY)) { if (!strcmp(svalue, "identify")) c = LED_STATE_ON; else if (!strcmp(svalue, "normal")) c = LED_STATE_OFF; else { fprintf(stderr, "The -s option must be either " "\"identify\" or \"normal\".\n\n"); print_usage(argv[0]); return 1; } } if (svalue && (strstr(argv[0], CMD_FAULT) || strstr(argv[0], CMD_ATTN))) { if (!strcmp(svalue, "normal")) c = LED_STATE_OFF; else { fprintf(stderr, "The -s option must be \"normal\".\n\n"); print_usage(argv[0]); return 1; } } if (svalue && !(dvalue || lvalue)) { if (strstr(argv[0], CMD_IDENTIFY)) fprintf(stderr, "The -s option requires the -d or -l " "option to also be used.\n\n"); else fprintf(stderr, "The -s option requires the -l " "option to also be used.\n\n"); print_usage(argv[0]); return 1; } if (svalue && geteuid() != 0) { fprintf(stderr, "%s: Turning indicator on/off requires " "superuser privileges.\n\n", argv[0]); return 1; } if (trunc && !(dvalue || lvalue)) { if (strstr(argv[0], CMD_IDENTIFY)) fprintf(stderr, "The -t option requires the -d or -l " "option to also be used.\n\n"); else fprintf(stderr, "The -t option requires the -l " "option to also be used.\n\n"); print_usage(argv[0]); return 1; } if (othervalue && strstr(argv[0], CMD_IDENTIFY)) { if (!strcmp(othervalue, "all-on")) c = LED_STATE_ON; else if (!strcmp(othervalue, "all-off")) c = LED_STATE_OFF; else { fprintf(stderr, "Unrecognized option: --%s\n\n", othervalue); print_usage(argv[0]); return 1; } } if (othervalue && (strstr(argv[0], CMD_ATTN) || strstr(argv[0], CMD_FAULT))) { if (!strcmp(othervalue, "all-off")) c = LED_STATE_OFF; else { fprintf(stderr, "Unrecognized option: --%s\n\n", othervalue); print_usage(argv[0]); return 1; } } if (othervalue && argc > 2) { fprintf(stderr, "\"--%s\" cannot be used with any other options.\n\n", othervalue); print_usage(argv[0]); return 1; } if (strstr(argv[0], CMD_IDENTIFY)) indicator = LED_TYPE_IDENT; else if (strstr(argv[0], CMD_FAULT) || strstr(argv[0], CMD_ATTN)) indicator = LED_TYPE_FAULT; else return 1; /* initialize */ lp_error_log_fd = STDOUT_FILENO; /* log message to stdout */ rc = init_files(); if (rc) { fprintf(stderr, "Unable to open log file.\n"); return 1; } /* Light Path operating mode */ if (indicator == LED_TYPE_FAULT) { rc = get_indicator_mode(); if (rc) return rc; } /* get indicator list */ rc = get_indicator_list(indicator, &list); if (rc) goto file_cleanup; if (argc == 1) { current = list; while (current) { /* get and print all indicators current state */ rc = get_indicator_state(indicator, current, &state); if (rc) /* failed to get indicator state */ current->state = -1; else current->state = state; print_indicator_state(current); current = current->next; } } /* Turn on/off indicator based on device name */ if (dvalue) { if (get_loc_code_for_dev(dvalue, dloc, LOCATION_LENGTH) != 0) { fprintf(stderr, "\"%s\" is not a valid device or " "it does not have location code.\n", dvalue); rc = 2; } else { lvalue = dloc; fprintf(stdout, "%s is at location code %s.\n", dvalue, lvalue); } } /* Turn on/off indicator based on location code */ if (lvalue) { strncpy(temp, lvalue, LOCATION_LENGTH); temp[LOCATION_LENGTH - 1] = '\0'; list_start = list; retry: current = get_indicator_for_loc_code(list_start, lvalue); if (!current) { if (trunc) { if (truncate_loc_code(lvalue)) { truncated = 1; list_start = list; /* start again */ goto retry; } } fprintf(stdout, "There is no %s indicator at location " "code %s.\n", get_indicator_desc(indicator), temp); rc = 1; } else { /* Found location code */ if (truncated) fprintf(stdout, "Truncated location code : " "%s\n", lvalue); if (current->type == TYPE_MARVELL) { /* * On some systems... * The Marvell SATA HDD controller may have one location code * for all disks. So, in order to uniquely identify a disk in * the list, the -d (dvalue) option must be used. * * eg, if the -l (lvalue) option is used then the * first disk in that location code will match, and it might * be the wrong disk! * * So, check if there is another list entry in this system * with the same location code as the current entry; if so, * only handle Marvell devices if '-d ' is used. */ if (!dvalue && get_indicator_for_loc_code(current->next, lvalue)) { fprintf(stdout, "The Marvell HDD LEDs must be " "specified by device name (-d option);" " non-unique location codes found.\n"); rc = 1; goto no_retry; } /* * At this point, after the check for "if (dvalue && lvalue)", * if dvalue is non-NULL then lvalue is from get_loc_code_dev() * (based on device name: dvalue), and dvalue is from cmdline. * * So, if dvalue is non-NULL and doesn't match the device name * specified in 'current' (found location code), let's try the * next elements in the list (which may match the device name); * for this we need to retry, re-starting on the next element. */ if (dvalue && current->devname && strncmp(dvalue, current->devname, DEV_LENGTH)) { list_start = current->next; goto retry; } } if (svalue) { rc = get_indicator_state(indicator, current, &state); if (rc || state != c) { rc = set_indicator_state(indicator, current, c); if (rc) goto indicator_cleanup; indicator_log_state(indicator, current->code, c); } } rc = get_indicator_state(indicator, current, &state); if (!rc) { if (dvalue) fprintf(stdout, "%s\t[%s]\n", lvalue, state ? "on" : "off"); else fprintf(stdout, "%s\n", state ? "on" : "off"); } } /* if-else end */ } /* lvalue end */ no_retry: /* Turn on/off all indicators */ if (othervalue) { current = list; while (current) { rc = get_indicator_state(indicator, current, &state); if (rc) /* failed to get indicator state */ current->state = -1; else current->state = state; if (state != c) { set_indicator_state(indicator, current, c); rc = get_indicator_state(indicator, current, &state); if (rc) /* failed to get indicator state */ current->state = -1; else current->state = state; } print_indicator_state(current); current = current->next; } /* If enclosure ident indicator is turned ON explicitly, * then turning OFF all components ident indicator inside * enclosure does not turn OFF enclosure ident indicator. */ if (indicator == LED_TYPE_IDENT && c == LED_STATE_OFF) set_indicator_state(indicator, &list[0], c); indicator_log_write("All %s Indicators : %s", get_indicator_desc(indicator), c == LED_STATE_ON ? "ON" : "OFF"); } indicator_cleanup: free_indicator_list(list); file_cleanup: close_files(); return rc; } ppc64-diag-2.7.4/lpd/README0000644000000000000000000000156513135275400011717 00000000000000Light Path Diangostics : ======================= Light Path Diagnostics allows system engineers and administrators to easily and quickly diagnose hardware problems on the IBM servers. Light Path Diagnostics on PowerLinux constantly monitors for serviceable events and enables/disable fault indicators as required. Further documentation for each of these utilities is available in their corresponding man pages. lp_diag: light path diagnostics -------- UI to view and modify the indicator status. usysident: identification indicator utility --------- A utility to view the status of device identification indicators (LEDs), and to turn the indicators on and off. usysattn, usysfault: attention indicator utility ------------------- A utility to view the status of the system attention and fault indicators (LEDs), and to turn the indicators off after an event has been serviced. ppc64-diag-2.7.4/m4/0000755000000000000000000000000013135275552010661 500000000000000ppc64-diag-2.7.4/m4/ax_append_compile_flags.m40000644000000000000000000000553113135275400015662 00000000000000# =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_append_compile_flags.html # =========================================================================== # # SYNOPSIS # # AX_APPEND_COMPILE_FLAGS([FLAG1 FLAG2 ...], [FLAGS-VARIABLE], [EXTRA-FLAGS]) # # DESCRIPTION # # For every FLAG1, FLAG2 it is checked whether the compiler works with the # flag. If it does, the flag is added FLAGS-VARIABLE # # If FLAGS-VARIABLE is not specified, the current language's flags (e.g. # CFLAGS) is used. During the check the flag is always added to the # current language's flags. # # If EXTRA-FLAGS is defined, it is added to the current language's default # flags (e.g. CFLAGS) when the check is done. The check is thus made with # the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to # force the compiler to issue an error when a bad flag is given. # # NOTE: This macro depends on the AX_APPEND_FLAG and # AX_CHECK_COMPILE_FLAG. Please keep this macro in sync with # AX_APPEND_LINK_FLAGS. # # LICENSE # # Copyright (c) 2011 Maarten Bosmans # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation, either version 3 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 4 AC_DEFUN([AX_APPEND_COMPILE_FLAGS], [AX_REQUIRE_DEFINED([AX_CHECK_COMPILE_FLAG]) AX_REQUIRE_DEFINED([AX_APPEND_FLAG]) for flag in $1; do AX_CHECK_COMPILE_FLAG([$flag], [AX_APPEND_FLAG([$flag], [$2])], [], [$3]) done ])dnl AX_APPEND_COMPILE_FLAGS ppc64-diag-2.7.4/m4/ax_append_flag.m40000644000000000000000000000530413135275400013765 00000000000000# =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_append_flag.html # =========================================================================== # # SYNOPSIS # # AX_APPEND_FLAG(FLAG, [FLAGS-VARIABLE]) # # DESCRIPTION # # FLAG is appended to the FLAGS-VARIABLE shell variable, with a space # added in between. # # If FLAGS-VARIABLE is not specified, the current language's flags (e.g. # CFLAGS) is used. FLAGS-VARIABLE is not changed if it already contains # FLAG. If FLAGS-VARIABLE is unset in the shell, it is set to exactly # FLAG. # # NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. # # LICENSE # # Copyright (c) 2008 Guido U. Draheim # Copyright (c) 2011 Maarten Bosmans # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation, either version 3 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 2 AC_DEFUN([AX_APPEND_FLAG], [AC_PREREQ(2.59)dnl for _AC_LANG_PREFIX AS_VAR_PUSHDEF([FLAGS], [m4_default($2,_AC_LANG_PREFIX[FLAGS])])dnl AS_VAR_SET_IF(FLAGS, [case " AS_VAR_GET(FLAGS) " in *" $1 "*) AC_RUN_LOG([: FLAGS already contains $1]) ;; *) AC_RUN_LOG([: FLAGS="$FLAGS $1"]) AS_VAR_SET(FLAGS, ["AS_VAR_GET(FLAGS) $1"]) ;; esac], [AS_VAR_SET(FLAGS,["$1"])]) AS_VAR_POPDEF([FLAGS])dnl ])dnl AX_APPEND_FLAG ppc64-diag-2.7.4/m4/ax_check_compile_flag.m40000644000000000000000000000641113135275400015303 00000000000000# =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html # =========================================================================== # # SYNOPSIS # # AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT]) # # DESCRIPTION # # Check whether the given FLAG works with the current language's compiler # or gives an error. (Warnings, however, are ignored) # # ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on # success/failure. # # If EXTRA-FLAGS is defined, it is added to the current language's default # flags (e.g. CFLAGS) when the check is done. The check is thus made with # the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to # force the compiler to issue an error when a bad flag is given. # # INPUT gives an alternative input source to AC_COMPILE_IFELSE. # # NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this # macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG. # # LICENSE # # Copyright (c) 2008 Guido U. Draheim # Copyright (c) 2011 Maarten Bosmans # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation, either version 3 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 3 AC_DEFUN([AX_CHECK_COMPILE_FLAG], [AC_PREREQ(2.59)dnl for _AC_LANG_PREFIX AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [ ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1" AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])], [AS_VAR_SET(CACHEVAR,[yes])], [AS_VAR_SET(CACHEVAR,[no])]) _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags]) AS_IF([test x"AS_VAR_GET(CACHEVAR)" = xyes], [m4_default([$2], :)], [m4_default([$3], :)]) AS_VAR_POPDEF([CACHEVAR])dnl ])dnl AX_CHECK_COMPILE_FLAGS ppc64-diag-2.7.4/m4/ax_check_link_flag.m40000644000000000000000000000611513135275400014611 00000000000000# =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_check_link_flag.html # =========================================================================== # # SYNOPSIS # # AX_CHECK_LINK_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT]) # # DESCRIPTION # # Check whether the given FLAG works with the linker or gives an error. # (Warnings, however, are ignored) # # ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on # success/failure. # # If EXTRA-FLAGS is defined, it is added to the linker's default flags # when the check is done. The check is thus made with the flags: "LDFLAGS # EXTRA-FLAGS FLAG". This can for example be used to force the linker to # issue an error when a bad flag is given. # # INPUT gives an alternative input source to AC_LINK_IFELSE. # # NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this # macro in sync with AX_CHECK_{PREPROC,COMPILE}_FLAG. # # LICENSE # # Copyright (c) 2008 Guido U. Draheim # Copyright (c) 2011 Maarten Bosmans # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation, either version 3 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 3 AC_DEFUN([AX_CHECK_LINK_FLAG], [AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_ldflags_$4_$1])dnl AC_CACHE_CHECK([whether the linker accepts $1], CACHEVAR, [ ax_check_save_flags=$LDFLAGS LDFLAGS="$LDFLAGS $4 $1" AC_LINK_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])], [AS_VAR_SET(CACHEVAR,[yes])], [AS_VAR_SET(CACHEVAR,[no])]) LDFLAGS=$ax_check_save_flags]) AS_IF([test x"AS_VAR_GET(CACHEVAR)" = xyes], [m4_default([$2], :)], [m4_default([$3], :)]) AS_VAR_POPDEF([CACHEVAR])dnl ])dnl AX_CHECK_LINK_FLAGS ppc64-diag-2.7.4/m4/ax_require_defined.m40000644000000000000000000000230113135275400014651 00000000000000# =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_require_defined.html # =========================================================================== # # SYNOPSIS # # AX_REQUIRE_DEFINED(MACRO) # # DESCRIPTION # # AX_REQUIRE_DEFINED is a simple helper for making sure other macros have # been defined and thus are available for use. This avoids random issues # where a macro isn't expanded. Instead the configure script emits a # non-fatal: # # ./configure: line 1673: AX_CFLAGS_WARN_ALL: command not found # # It's like AC_REQUIRE except it doesn't expand the required macro. # # Here's an example: # # AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG]) # # LICENSE # # Copyright (c) 2014 Mike Frysinger # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. #serial 1 AC_DEFUN([AX_REQUIRE_DEFINED], [dnl m4_ifndef([$1], [m4_fatal([macro ]$1[ is not defined; is a m4 file missing?])]) ])dnl AX_REQUIRE_DEFINED ppc64-diag-2.7.4/m4/libtool.m40000644000000000000000000105767513135275527012536 00000000000000# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) # serial 57 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. m4_defun([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # `config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain="$ac_aux_dir/ltmain.sh" ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the `libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to `config.status' so that its # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags="_LT_TAGS"dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into `config.status', and then the shell code to quote escape them in # for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # `#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test $lt_write_fail = 0 && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test $[#] != 0 do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try \`$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test "$silent" = yes && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) _LT_PROG_REPLACE_SHELLFNS mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test "$lt_cv_ld_force_load" = "yes"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" m4_if([$1], [CXX], [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script which will find a shell with a builtin # printf (which we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case "$ECHO" in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [ --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified).], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([${with_sysroot}]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and in which our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64le-*linux*|powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*le-*linux*|powerpc*le-*linux*) LD="${LD-ld} -m elf64lppc" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links="nottested" if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Add ABI-specific directories to the system library path. sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([], [sys_lib_dlsearch_path_spec], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi]) if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global defined # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS="$save_LDFLAGS"]) if test "$lt_cv_irix_exported_symbol" = yes; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting ${shlibpath_var} if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ func_to_tool_file "$lt_outputfile"~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(GCC, $1)="$GXX" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test "$pre_test_object_deps_done" = no; then case ${prev} in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)="${prev}${p}" else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$G77" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" CFLAGS="$lt_save_CFLAGS" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [AC_MSG_CHECKING([whether the shell understands some XSI constructs]) # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes AC_MSG_RESULT([$xsi_shell]) _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) AC_MSG_CHECKING([whether the shell understands "+="]) lt_shell_append=no ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes AC_MSG_RESULT([$lt_shell_append]) _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) # ------------------------------------------------------ # In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and # '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. m4_defun([_LT_PROG_FUNCTION_REPLACE], [dnl { sed -e '/^$1 ()$/,/^} # $1 /c\ $1 ()\ {\ m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) } # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: ]) # _LT_PROG_REPLACE_SHELLFNS # ------------------------- # Replace existing portable implementations of several shell functions with # equivalent extended shell implementations where those features are available.. m4_defun([_LT_PROG_REPLACE_SHELLFNS], [if test x"$xsi_shell" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"}]) _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl func_split_long_opt_name=${1%%=*} func_split_long_opt_arg=${1#*=}]) _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) fi if test x"$lt_shell_append" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl func_quote_for_eval "${2}" dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) fi ]) # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine which file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS ppc64-diag-2.7.4/m4/ltoptions.m40000644000000000000000000003007313135275527013103 00000000000000# Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, # Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 7 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option `$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the `shared' and # `disable-shared' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the `static' and # `disable-static' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the `fast-install' # and `disable-fast-install' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the `pic-only' and `no-pic' # LT_INIT options. # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) ppc64-diag-2.7.4/m4/ltsugar.m40000644000000000000000000001042413135275527012527 00000000000000# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59 which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) ppc64-diag-2.7.4/m4/ltversion.m40000644000000000000000000000126213135275527013073 00000000000000# ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # @configure_input@ # serial 3337 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.2]) m4_define([LT_PACKAGE_REVISION], [1.3337]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.2' macro_revision='1.3337' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) ppc64-diag-2.7.4/m4/lt~obsolete.m40000644000000000000000000001375613135275530013425 00000000000000# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) ppc64-diag-2.7.4/opal-dump-parse/0000755000000000000000000000000013135275553013350 500000000000000ppc64-diag-2.7.4/opal-dump-parse/Makefile.am0000644000000000000000000000033513135275400015314 00000000000000sbin_PROGRAMS += opal-dump-parse/opal-dump-parse opal_dump_parse_opal_dump_parse_SOURCES = opal-dump-parse/opal-dump-parse.c \ opal-dump-parse/opal-dump-parse.h dist_man_MANS += opal-dump-parse/opal-dump-parse.8 ppc64-diag-2.7.4/opal-dump-parse/opal-dump-parse.80000644000000000000000000000317213135275400016361 00000000000000.\" .\" Copyright (C) 2014- International Business Machines .\" .\" Author : Aruna Balakrishnaiah .\" .TH OPAL-DUMP-PARSE 8 "8 May 2014" Linux .SH NAME opal-dump-parse \- Parse OPAL System dump .SH SYNOPSIS .B opal-dump-parse [ \fB\-l\fR | \fB\-h\fR | \fB\-s\fR \f id\fR | \fB\-o\fR \f file\R ] .SH DESCRIPTION On Power Systems service processor (FSP) generates System dump (SYSDUMP) during system crash. On PowerKVM machine SYSDUMP contains OPAL logs. This tool helps to extract OPAL log from System dump. .SH OPTIONS .TP .BR \-l \fR List all the sections .TP .BR \-s " " \fIid\fR Capture log with specific section id .TP .BR \-o " " \fIfile\fR Output file to capture the log with specified section id .TP .BR \-h \fR Display help message .SH EXAMPLES .P .nf 1. Capture Skiboot log # opal-dump-parse SYSDUMP.10665FT.00000003.20140513071107 By default the log is captured to Skiboot-log...