diff options
| author | Peter Grehan <grehan@FreeBSD.org> | 2013-08-01 22:09:57 +0000 |
|---|---|---|
| committer | Peter Grehan <grehan@FreeBSD.org> | 2013-08-01 22:09:57 +0000 |
| commit | 672ed870a77238165e29d91823c7b564ec95ffbf (patch) | |
| tree | 15a0d1703ee9cc7d7009aa072f4f6d38a7cd6026 | |
| parent | 15b996d74243d0060fee414670a6a758490bfca2 (diff) | |
| parent | 04ae0d7cc59570c90e76d05fb1fa8f45e7c80895 (diff) | |
Notes
635 files changed, 28904 insertions, 24886 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index 20ee13b36801..9a143480d618 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -128,3 +128,6 @@ sysdoc trhodes Pre-commit review preferred. sh(1) jilles Pre-commit review requested. This also applies to kill(1), printf(1) and test(1) which are compiled in as builtins. +nvme(4) jimharris Pre-commit review requested. +nvd(4) jimharris Pre-commit review requested. +nvmecontrol(8) jimharris Pre-commit review requested. @@ -130,11 +130,34 @@ _MAKEOBJDIRPREFIX!= /usr/bin/env -i PATH=${PATH} ${MAKE} \ .error MAKEOBJDIRPREFIX can only be set in environment, not as a global\ (in make.conf(5)) or command-line variable. .endif -MAKEPATH= ${MAKEOBJDIRPREFIX}${.CURDIR}/make.${MACHINE} -BINMAKE= \ - `if [ -x ${MAKEPATH}/make ]; then echo ${MAKEPATH}/make; else echo ${MAKE}; fi` \ + +# We often need to use the tree's version of make to build it. +# Choices add to complexity though. +# We cannot blindly use a make which may not be the one we want +# so be exlicit - until all choice is removed. +.if !defined(WITHOUT_BMAKE) +WANT_MAKE= bmake +.else +WANT_MAKE= fmake +.endif +MYMAKE= ${MAKEOBJDIRPREFIX}${.CURDIR}/make.${MACHINE}/${WANT_MAKE} +.if defined(.PARSEDIR) +HAVE_MAKE= bmake +.else +HAVE_MAKE= fmake +.endif +.if exists(${MYMAKE}) +SUB_MAKE:= ${MYMAKE} -m ${.CURDIR}/share/mk +.elif ${WANT_MAKE} != ${HAVE_MAKE} || ${WANT_MAKE} != "bmake" +# It may not exist yet but we may cause it to. +# In the case of fmake, upgrade_checks may cause a newer version to be built. +SUB_MAKE= `test -x ${MYMAKE} && echo ${MYMAKE} || echo ${MAKE}` \ -m ${.CURDIR}/share/mk -_MAKE= PATH=${PATH} ${BINMAKE} -f Makefile.inc1 TARGET=${_TARGET} TARGET_ARCH=${_TARGET_ARCH} +.else +SUB_MAKE= ${MAKE} -m ${.CURDIR}/share/mk +.endif + +_MAKE= PATH=${PATH} ${SUB_MAKE} -f Makefile.inc1 TARGET=${_TARGET} TARGET_ARCH=${_TARGET_ARCH} # Guess machine architecture from machine type, and vice versa. .if !defined(TARGET_ARCH) && defined(TARGET) @@ -291,11 +314,13 @@ kernel: buildkernel installkernel # Perform a few tests to determine if the installed tools are adequate # for building the world. # +# Note: if we ever need to care about the version of bmake, simply testing +# MAKE_VERSION against a required version should suffice. +# upgrade_checks: -.if !defined(.PARSEDIR) -.if !defined(WITHOUT_BMAKE) - (cd ${.CURDIR} && ${MAKE} bmake) -.else +.if ${HAVE_MAKE} != ${WANT_MAKE} + @(cd ${.CURDIR} && ${MAKE} ${WANT_MAKE:S,^f,,}) +.elif ${WANT_MAKE} == "fmake" @if ! (cd ${.CURDIR}/tools/build/make_check && \ PATH=${PATH} ${BINMAKE} obj >/dev/null 2>&1 && \ PATH=${PATH} ${BINMAKE} >/dev/null 2>&1); \ @@ -303,14 +328,13 @@ upgrade_checks: (cd ${.CURDIR} && ${MAKE} make); \ fi .endif -.endif # # Upgrade make(1) to the current version using the installed # headers, libraries and tools. Also, allow the location of # the system bsdmake-like utility to be overridden. # -MMAKEENV= MAKEOBJDIRPREFIX=${MAKEPATH} \ +MMAKEENV= MAKEOBJDIRPREFIX=${MYMAKE:H} \ DESTDIR= \ INSTALL="sh ${.CURDIR}/tools/install.sh" MMAKE= ${MMAKEENV} ${MAKE} \ @@ -327,7 +351,7 @@ make bmake: .PHONY ${MMAKE} obj && \ ${MMAKE} depend && \ ${MMAKE} all && \ - ${MMAKE} install DESTDIR=${MAKEPATH} BINDIR= + ${MMAKE} install DESTDIR=${MYMAKE:H} BINDIR= PROGNAME=${MYMAKE:T} tinderbox: @cd ${.CURDIR} && ${MAKE} DOING_TINDERBOX=YES universe @@ -377,7 +401,8 @@ MAKEFAIL=tee -a ${FAILFILE} MAKEFAIL=cat .endif -universe: universe_prologue upgrade_checks +universe_prologue: upgrade_checks +universe: universe_prologue universe_prologue: @echo "--------------------------------------------------------------" @echo ">>> make universe started on ${STARTTIME}" @@ -387,9 +412,9 @@ universe_prologue: .endif .for target in ${TARGETS} universe: universe_${target} -.ORDER: universe_prologue upgrade_checks universe_${target} universe_epilogue +universe_epilogue: universe_${target} universe_${target}: universe_${target}_prologue -universe_${target}_prologue: +universe_${target}_prologue: universe_prologue @echo ">> ${target} started on `LC_ALL=C date`" .if !defined(MAKE_JUST_KERNELS) .for target_arch in ${TARGET_ARCHES_${target}} @@ -397,7 +422,7 @@ universe_${target}: universe_${target}_${target_arch} universe_${target}_${target_arch}: universe_${target}_prologue @echo ">> ${target}.${target_arch} ${UNIVERSE_TARGET} started on `LC_ALL=C date`" @(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \ - ${MAKE} ${JFLAG} ${UNIVERSE_TARGET} \ + ${SUB_MAKE} ${JFLAG} ${UNIVERSE_TARGET} \ TARGET=${target} \ TARGET_ARCH=${target_arch} \ > _.${target}.${target_arch}.${UNIVERSE_TARGET} 2>&1 || \ @@ -418,11 +443,11 @@ universe_${target}: universe_${target}_kernels universe_${target}_kernels: universe_${target}_prologue .if exists(${KERNSRCDIR}/${target}/conf/NOTES) @(cd ${KERNSRCDIR}/${target}/conf && env __MAKE_CONF=/dev/null \ - ${MAKE} LINT > ${.CURDIR}/_.${target}.makeLINT 2>&1 || \ + ${SUB_MAKE} LINT > ${.CURDIR}/_.${target}.makeLINT 2>&1 || \ (echo "${target} 'make LINT' failed," \ "check _.${target}.makeLINT for details"| ${MAKEFAIL})) .endif - @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} TARGET=${target} \ + @cd ${.CURDIR} && ${SUB_MAKE} ${.MAKEFLAGS} TARGET=${target} \ universe_kernels .endif @echo ">> ${target} completed on `LC_ALL=C date`" @@ -445,7 +470,7 @@ TARGET_ARCH_${kernel}!= cd ${KERNSRCDIR}/${TARGET}/conf && \ universe_kernconfs: universe_kernconf_${TARGET}_${kernel} universe_kernconf_${TARGET}_${kernel}: @(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \ - ${MAKE} ${JFLAG} buildkernel \ + ${SUB_MAKE} ${JFLAG} buildkernel \ TARGET=${TARGET} \ TARGET_ARCH=${TARGET_ARCH_${kernel}} \ KERNCONF=${kernel} \ diff --git a/Makefile.inc1 b/Makefile.inc1 index 87949fbc0df7..2099fa9e0dd1 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -833,6 +833,18 @@ distributeworld installworld: installcheck installcheck_UGID awk 'BEGIN { print "#${MTREE_MAGIC}" } !/ type=/ { file = $$1 } / type=/ { if ($$1 == file) { sub(/^\.\/${dist}\//, "./"); print } }' > \ ${DESTDIR}/${DISTDIR}/${dist}.meta .endfor +.if ${MK_DEBUG_FILES} != "no" +. for dist in base ${EXTRA_DISTRIBUTIONS} + @# For each file that exists in this dist, print the corresponding + @# line from the METALOG. This relies on the fact that + @# a line containing only the filename will sort immediatly before + @# the relevant mtree line. + cd ${DESTDIR}/${DISTDIR}; \ + find ./${dist}/usr/lib/debug | sort -u ${METALOG} - | \ + awk 'BEGIN { print "#${MTREE_MAGIC}" } !/ type=/ { file = $$1 } / type=/ { if ($$1 == file) { sub(/^\.\/${dist}\//, "./"); print } }' > \ + ${DESTDIR}/${DISTDIR}/${dist}.debug.meta +. endfor +.endif .endif .endif @@ -841,13 +853,29 @@ packageworld: .if defined(NO_ROOT) ${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \ tar cvJf ${DESTDIR}/${DISTDIR}/${dist}.txz \ + --exclude usr/lib/debug \ @${DESTDIR}/${DISTDIR}/${dist}.meta .else ${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \ - tar cvJf ${DESTDIR}/${DISTDIR}/${dist}.txz . + tar cvJf ${DESTDIR}/${DISTDIR}/${dist}.txz \ + --exclude usr/lib/debug . .endif .endfor +.if ${MK_DEBUG_FILES} != "no" +. for dist in base ${EXTRA_DISTRIBUTIONS} +. if defined(NO_ROOT) + ${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \ + tar cvJf ${DESTDIR}/${DISTDIR}/${dist}.debug.txz \ + @${DESTDIR}/${DISTDIR}/${dist}.debug.meta +. else + ${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \ + tar cvJfL ${DESTDIR}/${DISTDIR}/${dist}.debug.txz \ + usr/lib/debug +. endif +. endfor +.endif + # # reinstall # @@ -31,6 +31,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10.x IS SLOW: disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20130726: + Behavior of devfs rules path matching has been changed. + Pattern is now always matched against fully qualified devfs + path and slash characters must be explicitly matched by + slashes in pattern (FNM_PATHNAME). Rulesets involving devfs + subdirectories must be reviewed. + 20130716: The default ARM ABI has changed to the ARM EABI. The old ABI is incompatible with the ARM EABI and all programs and modules will diff --git a/bin/sh/Makefile b/bin/sh/Makefile index cc04aa42db59..00d34fa749da 100644 --- a/bin/sh/Makefile +++ b/bin/sh/Makefile @@ -8,7 +8,7 @@ SHSRCS= alias.c arith_yacc.c arith_yylex.c cd.c echo.c error.c eval.c \ histedit.c input.c jobs.c kill.c mail.c main.c memalloc.c miscbltin.c \ mystring.c options.c output.c parser.c printf.c redir.c show.c \ test.c trap.c var.c -GENSRCS= builtins.c init.c nodes.c syntax.c +GENSRCS= builtins.c nodes.c syntax.c GENHDRS= builtins.h nodes.h syntax.h token.h SRCS= ${SHSRCS} ${GENSRCS} ${GENHDRS} @@ -30,26 +30,21 @@ WFORMAT=0 ${.CURDIR}/../test \ ${.CURDIR}/../../usr.bin/printf -CLEANFILES+= mkinit mkinit.o mknodes mknodes.o \ +CLEANFILES+= mknodes mknodes.o \ mksyntax mksyntax.o CLEANFILES+= ${GENSRCS} ${GENHDRS} -build-tools: mkinit mknodes mksyntax +build-tools: mknodes mksyntax .ORDER: builtins.c builtins.h builtins.c builtins.h: mkbuiltins builtins.def sh ${.CURDIR}/mkbuiltins ${.CURDIR} -init.c: mkinit alias.c eval.c exec.c input.c jobs.c options.c parser.c \ - redir.c trap.c var.c - ./mkinit ${.ALLSRC:S/^mkinit$//} - # XXX this is just to stop the default .c rule being used, so that the # intermediate object has a fixed name. # XXX we have a default .c rule, but no default .o rule. .o: ${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET} -mkinit: mkinit.o mknodes: mknodes.o mksyntax: mksyntax.o diff --git a/bin/sh/TOUR b/bin/sh/TOUR index 13438b528bc3..e9bbe9b121b5 100644 --- a/bin/sh/TOUR +++ b/bin/sh/TOUR @@ -25,38 +25,11 @@ programs is: program input files generates ------- ----------- --------- mkbuiltins builtins builtins.h builtins.c - mkinit *.c init.c mknodes nodetypes nodes.h nodes.c mksyntax - syntax.h syntax.c mktokens - token.h -There are undoubtedly too many of these. Mkinit searches all the -C source files for entries looking like: - - RESET { - x = 2; /* executed when the shell does a longjmp - back to the main command loop */ - } - -It pulls this code out into routines which are when particular -events occur. The intent is to improve modularity by isolating -the information about which modules need to be explicitly -initialized/reset within the modules themselves. - -Mkinit recognizes several constructs for placing declarations in -the init.c file. - INCLUDE "file.h" -includes a file. The storage class MKINIT makes a declaration -available in the init.c file, for example: - MKINIT int funcnest; /* depth of function calls */ -MKINIT alone on a line introduces a structure or union declara- -tion: - MKINIT - struct redirtab { - short renamed[10]; - }; -Preprocessor #define statements are copied to init.c without any -special action to request this. +There are undoubtedly too many of these. EXCEPTIONS: Code for dealing with exceptions appears in exceptions.c. The C language doesn't include exception handling, diff --git a/bin/sh/eval.c b/bin/sh/eval.c index 1a6d5ed2f53e..1daa3db9159f 100644 --- a/bin/sh/eval.c +++ b/bin/sh/eval.c @@ -76,7 +76,7 @@ __FBSDID("$FreeBSD$"); int evalskip; /* set if we are skipping commands */ int skipcount; /* number of levels to skip */ -MKINIT int loopnest; /* current loop nesting level */ +static int loopnest; /* current loop nesting level */ int funcnest; /* depth of function calls */ static int builtin_flags; /* evalcommand flags for builtins */ @@ -104,16 +104,13 @@ static void prehash(union node *); * Called to reset things after an exception. */ -#ifdef mkinit -INCLUDE "eval.h" - -RESET { +void +reseteval(void) +{ evalskip = 0; loopnest = 0; funcnest = 0; } -#endif - /* diff --git a/bin/sh/eval.h b/bin/sh/eval.h index 724e15714bf5..a6e87b237cb9 100644 --- a/bin/sh/eval.h +++ b/bin/sh/eval.h @@ -46,6 +46,8 @@ struct backcmd { /* result of evalbackcmd */ struct job *jp; /* job structure for command */ }; +void reseteval(void); + /* flags in argument to evaltree/evalstring */ #define EV_EXIT 01 /* exit after evaluating tree */ #define EV_TESTED 02 /* exit status is checked; ignore -e flag */ diff --git a/bin/sh/exec.c b/bin/sh/exec.c index 6c3a6ddbf783..5f78de91a326 100644 --- a/bin/sh/exec.c +++ b/bin/sh/exec.c @@ -70,7 +70,6 @@ __FBSDID("$FreeBSD$"); #include "syntax.h" #include "memalloc.h" #include "error.h" -#include "init.h" #include "mystring.h" #include "show.h" #include "jobs.h" diff --git a/bin/sh/input.c b/bin/sh/input.c index f574f460af16..e46095d5ed54 100644 --- a/bin/sh/input.c +++ b/bin/sh/input.c @@ -92,7 +92,7 @@ struct parsefile { int plinno = 1; /* input line number */ int parsenleft; /* copy of parsefile->nleft */ -MKINIT int parselleft; /* copy of parsefile->lleft */ +static int parselleft; /* copy of parsefile->lleft */ const char *parsenextc; /* copy of parsefile->nextc */ static char basebuf[BUFSIZ + 1];/* buffer for top level input file */ static struct parsefile basepf = { /* top level input file */ @@ -108,15 +108,12 @@ static void pushfile(void); static int preadfd(void); static void popstring(void); -#ifdef mkinit -INCLUDE "input.h" -INCLUDE "error.h" - -RESET { +void +resetinput(void) +{ popallfiles(); parselleft = parsenleft = 0; /* clear input buffer */ } -#endif /* diff --git a/bin/sh/input.h b/bin/sh/input.h index 70f675e5cbfb..cc54eedb185a 100644 --- a/bin/sh/input.h +++ b/bin/sh/input.h @@ -47,6 +47,7 @@ extern const char *parsenextc; /* next character in input buffer */ struct alias; struct parsefile; +void resetinput(void); char *pfgets(char *, int); int pgetc(void); int preadbuffer(void); diff --git a/bin/sh/jobs.c b/bin/sh/jobs.c index 7129a9f64d52..89e481297fea 100644 --- a/bin/sh/jobs.c +++ b/bin/sh/jobs.c @@ -77,8 +77,8 @@ __FBSDID("$FreeBSD$"); static struct job *jobtab; /* array of jobs */ static int njobs; /* size of array */ -MKINIT pid_t backgndpid = -1; /* pid of last background process */ -MKINIT struct job *bgjob = NULL; /* last background process */ +static pid_t backgndpid = -1; /* pid of last background process */ +static struct job *bgjob = NULL; /* last background process */ #if JOBS static struct job *jobmru; /* most recently used job list */ static pid_t initialpgrp; /* pgrp of shell on invocation */ @@ -116,7 +116,7 @@ static void showjob(struct job *, int); * Turn job control on and off. */ -MKINIT int jobctl; +static int jobctl; #if JOBS void diff --git a/bin/sh/main.c b/bin/sh/main.c index 0c496d06e7d6..2b99eddaa2d9 100644 --- a/bin/sh/main.c +++ b/bin/sh/main.c @@ -68,10 +68,10 @@ __FBSDID("$FreeBSD$"); #include "show.h" #include "memalloc.h" #include "error.h" -#include "init.h" #include "mystring.h" #include "exec.h" #include "cd.h" +#include "redir.h" #include "builtins.h" int rootpid; @@ -79,6 +79,7 @@ int rootshell; struct jmploc main_handler; int localeisutf8, initial_localeisutf8; +static void reset(void); static void cmdloop(int); static void read_profile(const char *); static char *find_dot_file(char *); @@ -179,6 +180,14 @@ state4: return 0; } +static void +reset(void) +{ + reseteval(); + resetinput(); + resetparser(); + resetredir(); +} /* * Read and execute commands. "Top" is nonzero for the top level command diff --git a/bin/sh/mkinit.c b/bin/sh/mkinit.c deleted file mode 100644 index d73e0e256a73..000000000000 --- a/bin/sh/mkinit.c +++ /dev/null @@ -1,480 +0,0 @@ -/*- - * Copyright (c) 1991, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Kenneth Almquist. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef lint -static char const copyright[] = -"@(#) Copyright (c) 1991, 1993\n\ - The Regents of the University of California. All rights reserved.\n"; -#endif /* not lint */ - -#ifndef lint -#if 0 -static char sccsid[] = "@(#)mkinit.c 8.2 (Berkeley) 5/4/95"; -#endif -#endif /* not lint */ -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -/* - * This program scans all the source files for code to handle various - * special events and combines this code into one file. This (allegedly) - * improves the structure of the program since there is no need for - * anyone outside of a module to know that that module performs special - * operations on particular events. - * - * Usage: mkinit sourcefile... - */ - - -#include <sys/types.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <fcntl.h> -#include <unistd.h> -#include <errno.h> - - -/* - * OUTFILE is the name of the output file. Output is initially written - * to the file OUTTEMP, which is then moved to OUTFILE. - */ - -#define OUTFILE "init.c" -#define OUTTEMP "init.c.new" - - -/* - * A text structure is basically just a string that grows as more characters - * are added onto the end of it. It is implemented as a linked list of - * blocks of characters. The routines addstr and addchar append a string - * or a single character, respectively, to a text structure. Writetext - * writes the contents of a text structure to a file. - */ - -#define BLOCKSIZE 512 - -struct text { - char *nextc; - int nleft; - struct block *start; - struct block *last; -}; - -struct block { - struct block *next; - char text[BLOCKSIZE]; -}; - - -/* - * There is one event structure for each event that mkinit handles. - */ - -struct event { - const char *name; /* name of event (e.g. RESET) */ - const char *routine; /* name of routine called on event */ - const char *comment; /* comment describing routine */ - struct text code; /* code for handling event */ -}; - - -char writer[] = "\ -/*\n\ - * This file was generated by the mkinit program.\n\ - */\n\ -\n"; - -char reset[] = "\ -/*\n\ - * This routine is called when an error or an interrupt occurs in an\n\ - * interactive shell and control is returned to the main command loop.\n\ - */\n"; - - -struct event event[] = { - { "RESET", "reset", reset, { NULL, 0, NULL, NULL } }, - { NULL, NULL, NULL, { NULL, 0, NULL, NULL } } -}; - - -const char *curfile; /* current file */ -int linno; /* current line */ -char *header_files[200]; /* list of header files */ -struct text defines; /* #define statements */ -struct text decls; /* declarations */ -int amiddecls; /* for formatting */ - - -void readfile(const char *); -int match(const char *, const char *); -int gooddefine(const char *); -void doevent(struct event *, FILE *, const char *); -void doinclude(char *); -void dodecl(char *, FILE *); -void output(void); -void addstr(const char *, struct text *); -void addchar(int, struct text *); -void writetext(struct text *, FILE *); -FILE *ckfopen(const char *, const char *); -void *ckmalloc(size_t); -char *savestr(const char *); -void error(const char *); - -#define equal(s1, s2) (strcmp(s1, s2) == 0) - -int -main(int argc __unused, char *argv[]) -{ - char **ap; - - header_files[0] = savestr("\"shell.h\""); - header_files[1] = savestr("\"mystring.h\""); - header_files[2] = savestr("\"init.h\""); - for (ap = argv + 1 ; *ap ; ap++) - readfile(*ap); - output(); - rename(OUTTEMP, OUTFILE); - exit(0); -} - - -/* - * Parse an input file. - */ - -void -readfile(const char *fname) -{ - FILE *fp; - char line[1024]; - struct event *ep; - - fp = ckfopen(fname, "r"); - curfile = fname; - linno = 0; - amiddecls = 0; - while (fgets(line, sizeof line, fp) != NULL) { - linno++; - for (ep = event ; ep->name ; ep++) { - if (line[0] == ep->name[0] && match(ep->name, line)) { - doevent(ep, fp, fname); - break; - } - } - if (line[0] == 'I' && match("INCLUDE", line)) - doinclude(line); - if (line[0] == 'M' && match("MKINIT", line)) - dodecl(line, fp); - if (line[0] == '#' && gooddefine(line)) { - char *cp; - char line2[1024]; - static const char undef[] = "#undef "; - - strcpy(line2, line); - memcpy(line2, undef, sizeof(undef) - 1); - cp = line2 + sizeof(undef) - 1; - while(*cp && (*cp == ' ' || *cp == '\t')) - cp++; - while(*cp && *cp != ' ' && *cp != '\t' && *cp != '\n') - cp++; - *cp++ = '\n'; *cp = '\0'; - addstr(line2, &defines); - addstr(line, &defines); - } - } - fclose(fp); -} - - -int -match(const char *name, const char *line) -{ - const char *p, *q; - - p = name, q = line; - while (*p) { - if (*p++ != *q++) - return 0; - } - if (*q != '{' && *q != ' ' && *q != '\t' && *q != '\n') - return 0; - return 1; -} - - -int -gooddefine(const char *line) -{ - const char *p; - - if (! match("#define", line)) - return 0; /* not a define */ - p = line + 7; - while (*p == ' ' || *p == '\t') - p++; - while (*p != ' ' && *p != '\t') { - if (*p == '(') - return 0; /* macro definition */ - p++; - } - while (*p != '\n' && *p != '\0') - p++; - if (p[-1] == '\\') - return 0; /* multi-line definition */ - return 1; -} - - -void -doevent(struct event *ep, FILE *fp, const char *fname) -{ - char line[1024]; - int indent; - const char *p; - - sprintf(line, "\n /* from %s: */\n", fname); - addstr(line, &ep->code); - addstr(" {\n", &ep->code); - for (;;) { - linno++; - if (fgets(line, sizeof line, fp) == NULL) - error("Unexpected EOF"); - if (equal(line, "}\n")) - break; - indent = 6; - for (p = line ; *p == '\t' ; p++) - indent += 8; - for ( ; *p == ' ' ; p++) - indent++; - if (*p == '\n' || *p == '#') - indent = 0; - while (indent >= 8) { - addchar('\t', &ep->code); - indent -= 8; - } - while (indent > 0) { - addchar(' ', &ep->code); - indent--; - } - addstr(p, &ep->code); - } - addstr(" }\n", &ep->code); -} - - -void -doinclude(char *line) -{ - char *p; - char *name; - char **pp; - - for (p = line ; *p != '"' && *p != '<' && *p != '\0' ; p++); - if (*p == '\0') - error("Expecting '\"' or '<'"); - name = p; - while (*p != ' ' && *p != '\t' && *p != '\n') - p++; - if (p[-1] != '"' && p[-1] != '>') - error("Missing terminator"); - *p = '\0'; - - /* name now contains the name of the include file */ - for (pp = header_files ; *pp && ! equal(*pp, name) ; pp++); - if (*pp == NULL) - *pp = savestr(name); -} - - -void -dodecl(char *line1, FILE *fp) -{ - char line[1024]; - char *p, *q; - - if (strcmp(line1, "MKINIT\n") == 0) { /* start of struct/union decl */ - addchar('\n', &decls); - do { - linno++; - if (fgets(line, sizeof line, fp) == NULL) - error("Unterminated structure declaration"); - addstr(line, &decls); - } while (line[0] != '}'); - amiddecls = 0; - } else { - if (! amiddecls) - addchar('\n', &decls); - q = NULL; - for (p = line1 + 6 ; *p && strchr("=/\n", *p) == NULL; p++) - continue; - if (*p == '=') { /* eliminate initialization */ - for (q = p ; *q && *q != ';' ; q++); - if (*q == '\0') - q = NULL; - else { - while (p[-1] == ' ') - p--; - *p = '\0'; - } - } - addstr("extern", &decls); - addstr(line1 + 6, &decls); - if (q != NULL) - addstr(q, &decls); - amiddecls = 1; - } -} - - - -/* - * Write the output to the file OUTTEMP. - */ - -void -output(void) -{ - FILE *fp; - char **pp; - struct event *ep; - - fp = ckfopen(OUTTEMP, "w"); - fputs(writer, fp); - for (pp = header_files ; *pp ; pp++) - fprintf(fp, "#include %s\n", *pp); - fputs("\n\n\n", fp); - writetext(&defines, fp); - fputs("\n\n", fp); - writetext(&decls, fp); - for (ep = event ; ep->name ; ep++) { - fputs("\n\n\n", fp); - fputs(ep->comment, fp); - fprintf(fp, "\nvoid\n%s(void)\n{\n", ep->routine); - writetext(&ep->code, fp); - fprintf(fp, "}\n"); - } - fclose(fp); -} - - -/* - * A text structure is simply a block of text that is kept in memory. - * Addstr appends a string to the text struct, and addchar appends a single - * character. - */ - -void -addstr(const char *s, struct text *text) -{ - while (*s) { - if (--text->nleft < 0) - addchar(*s++, text); - else - *text->nextc++ = *s++; - } -} - - -void -addchar(int c, struct text *text) -{ - struct block *bp; - - if (--text->nleft < 0) { - bp = ckmalloc(sizeof *bp); - if (text->start == NULL) - text->start = bp; - else - text->last->next = bp; - text->last = bp; - text->nextc = bp->text; - text->nleft = BLOCKSIZE - 1; - } - *text->nextc++ = c; -} - -/* - * Write the contents of a text structure to a file. - */ -void -writetext(struct text *text, FILE *fp) -{ - struct block *bp; - - if (text->start != NULL) { - for (bp = text->start ; bp != text->last ; bp = bp->next) - fwrite(bp->text, sizeof (char), BLOCKSIZE, fp); - fwrite(bp->text, sizeof (char), BLOCKSIZE - text->nleft, fp); - } -} - -FILE * -ckfopen(const char *file, const char *mode) -{ - FILE *fp; - - if ((fp = fopen(file, mode)) == NULL) { - fprintf(stderr, "Can't open %s: %s\n", file, strerror(errno)); - exit(2); - } - return fp; -} - -void * -ckmalloc(size_t nbytes) -{ - char *p; - - if ((p = malloc(nbytes)) == NULL) - error("Out of space"); - return p; -} - -char * -savestr(const char *s) -{ - char *p; - - p = ckmalloc(strlen(s) + 1); - strcpy(p, s); - return p; -} - -void -error(const char *msg) -{ - if (curfile != NULL) - fprintf(stderr, "%s:%d: ", curfile, linno); - fprintf(stderr, "%s\n", msg); - exit(2); -} diff --git a/bin/sh/output.c b/bin/sh/output.c index d26adce149be..bf8e17d97ece 100644 --- a/bin/sh/output.c +++ b/bin/sh/output.c @@ -75,25 +75,6 @@ struct output memout = {NULL, 0, NULL, 0, MEM_OUT, 0}; struct output *out1 = &output; struct output *out2 = &errout; - - -#ifdef mkinit - -INCLUDE "output.h" -INCLUDE "memalloc.h" - -RESET { - out1 = &output; - out2 = &errout; - if (memout.buf != NULL) { - ckfree(memout.buf); - memout.buf = NULL; - } -} - -#endif - - void outcslow(int c, struct output *file) { diff --git a/bin/sh/parser.c b/bin/sh/parser.c index 073c2b69308f..f079c69c31df 100644 --- a/bin/sh/parser.c +++ b/bin/sh/parser.c @@ -96,9 +96,9 @@ static struct heredoc *heredoclist; /* list of here documents to read */ static int doprompt; /* if set, prompt the user */ static int needprompt; /* true if interactive and at start of line */ static int lasttoken; /* last token read */ -MKINIT int tokpushback; /* last token pushed back */ +int tokpushback; /* last token pushed back */ static char *wordtext; /* text of last word returned by readtoken */ -MKINIT int checkkwd; /* 1 == check for kwds, 2 == also eat newlines */ +static int checkkwd; static struct nodelist *backquotelist; static union node *redirnode; static struct heredoc *heredoc; @@ -1819,13 +1819,13 @@ parsearith: { } /* end of readtoken */ - -#ifdef mkinit -RESET { +void +resetparser(void) +{ tokpushback = 0; checkkwd = 0; } -#endif + /* * Returns true if the text contains nothing to expand (no dollar signs diff --git a/bin/sh/parser.h b/bin/sh/parser.h index b803f76dbe64..92b2e37b0487 100644 --- a/bin/sh/parser.h +++ b/bin/sh/parser.h @@ -79,6 +79,7 @@ extern const char *const parsekwd[]; union node *parsecmd(int); void fixredir(union node *, const char *, int); +void resetparser(void); int goodname(const char *); int isassignment(const char *); char *getprompt(void *); diff --git a/bin/sh/redir.c b/bin/sh/redir.c index 855f317af5c1..dde4384b401f 100644 --- a/bin/sh/redir.c +++ b/bin/sh/redir.c @@ -66,14 +66,13 @@ __FBSDID("$FreeBSD$"); #define CLOSED -1 /* fd was not open before redir */ -MKINIT struct redirtab { struct redirtab *next; int renamed[10]; }; -MKINIT struct redirtab *redirlist; +static struct redirtab *redirlist; /* * We keep track of whether or not fd0 has been redirected. This is for @@ -324,16 +323,13 @@ popredir(void) * Undo all redirections. Called on error or interrupt. */ -#ifdef mkinit - -INCLUDE "redir.h" - -RESET { +void +resetredir(void) +{ while (redirlist) popredir(); } -#endif /* Return true if fd 0 has already been redirected at least once. */ int diff --git a/bin/sh/redir.h b/bin/sh/redir.h index ad44c4eddd8c..d012440a4383 100644 --- a/bin/sh/redir.h +++ b/bin/sh/redir.h @@ -40,6 +40,7 @@ union node; void redirect(union node *, int); void popredir(void); +void resetredir(void); int fd0_redirected_p(void); void clearredir(void); diff --git a/bin/sh/shell.h b/bin/sh/shell.h index 5f6d0ac68ab5..679efc7b1619 100644 --- a/bin/sh/shell.h +++ b/bin/sh/shell.h @@ -63,7 +63,6 @@ typedef intmax_t arith_t; #define ARITH_MAX INTMAX_MAX typedef void *pointer; -#define MKINIT /* empty */ #include <sys/cdefs.h> diff --git a/bin/sh/trap.c b/bin/sh/trap.c index 313802925592..14112890c2b4 100644 --- a/bin/sh/trap.c +++ b/bin/sh/trap.c @@ -72,7 +72,7 @@ __FBSDID("$FreeBSD$"); #define S_RESET 5 /* temporary - to reset a hard ignored sig */ -MKINIT char sigmode[NSIG]; /* current value of signal */ +static char sigmode[NSIG]; /* current value of signal */ volatile sig_atomic_t pendingsig; /* indicates some signal received */ int in_dotrap; /* do we execute in a trap handler? */ static char *volatile trap[NSIG]; /* trap handler commands */ diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dtest.pl b/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dtest.pl index 7b47580ddf62..db157415b62b 100755 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dtest.pl +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dtest.pl @@ -583,6 +583,8 @@ if ($opt_x) { die "$PNAME: failed to open $PNAME.$$.log: $!\n" unless (!$opt_l || open(LOG, ">$PNAME.$$.log")); +$ENV{'DTRACE_DEBUG_REGSET'} = 'true'; + if ($opt_g) { $ENV{'UMEM_DEBUG'} = 'default,verbose'; $ENV{'UMEM_LOGGING'} = 'fail,contents'; diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d new file mode 100644 index 000000000000..bb3ed4789bf5 --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d @@ -0,0 +1,35 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +#pragma D option quiet + +/* + * Make sure the sizes of compatible keys doesn't affect the sort order. + */ + +BEGIN +{ + @[(int)1, 0] = sum(10); + @[(uint64_t)2, 0] = sum(20); + @[(int)3, 0] = sum(30); + @[(uint64_t)4, 0] = sum(40); + printa(@); + + exit(0); +} diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d.out new file mode 100644 index 000000000000..83252ade53ae --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d.out @@ -0,0 +1,6 @@ + + 1 0 10 + 2 0 20 + 3 0 30 + 4 0 40 + diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.basics.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.basics.d.out new file mode 100644 index 000000000000..d3b6af813101 --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.basics.d.out @@ -0,0 +1,8 @@ +The value of i is 6 +The value of i is 18 +The value of i is 72 +The value of i is 25920 +The value of i is 935761216 +The value of i is -91738734 +The value of i is -91738729 + diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d new file mode 100644 index 000000000000..714fbe373b2c --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d @@ -0,0 +1,50 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +/* + * Test compile-time casting between integer types of different size. + */ + +#pragma D option quiet + +int64_t x; + +BEGIN +{ + x = (int32_t)(int16_t)0xfff0; + printf("%16x %20d %20u\n", x, x, x); + x = (int32_t)(uint16_t)0xfff0; + printf("%16x %20d %20u\n", x, x, x); + x = (uint32_t)(int16_t)0xfff0; + printf("%16x %20d %20u\n", x, x, x); + x = (uint32_t)(uint16_t)0xfff0; + printf("%16x %20d %20u\n", x, x, x); + printf("\n"); + + x = (int16_t)(int32_t)0xfff0; + printf("%16x %20d %20u\n", x, x, x); + x = (int16_t)(uint32_t)0xfff0; + printf("%16x %20d %20u\n", x, x, x); + x = (uint16_t)(int32_t)0xfff0; + printf("%16x %20d %20u\n", x, x, x); + x = (uint16_t)(uint32_t)0xfff0; + printf("%16x %20d %20u\n", x, x, x); + + exit(0); +} diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d.out new file mode 100644 index 000000000000..d43df27d5d5c --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d.out @@ -0,0 +1,10 @@ +fffffffffffffff0 -16 18446744073709551600 + fff0 65520 65520 + fffffff0 4294967280 4294967280 + fff0 65520 65520 + +fffffffffffffff0 -16 18446744073709551600 +fffffffffffffff0 -16 18446744073709551600 + fff0 65520 65520 + fff0 65520 65520 + diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.complex.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.complex.d deleted file mode 100644 index 2db1b6350b94..000000000000 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.complex.d +++ /dev/null @@ -1,57 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (the "License"). - * You may not use this file except in compliance with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ - -/* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* - * ASSERTION: - * Complex expressions. - * Call complex expressions and make sure test succeeds. - * Match expected output in tst.complex.d.out - * - * SECTION: Types, Operators, and Expressions/Arithmetic Operators - * - */ - -#pragma D option quiet - -BEGIN -{ - i = 0; - i = i++ + ++i; - printf("The value of i is %d\n", i); - i = i-- - --i; - printf("The value of i is %d\n", i); - i = i-- + ++i; - printf("The value of i is %d\n", i); - i += i++ + -- i + ++i - ++i * i ; - printf("The value of i is %d\n", i); - i -= i++ * 3; - printf("The value of i is %d\n", i); - i = i++/i--+i++-++i-++i; - printf("The value of i is %d\n", i); - exit (0); -} diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d new file mode 100644 index 000000000000..0589b721b421 --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d @@ -0,0 +1,36 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +/* + * Test narrowing at assignment. + */ + +#pragma D option quiet + +uint16_t x; +uint32_t y; + +BEGIN +{ + x = 0xbeefcafe; + y = x; + printf("%x", y); /* where's the beef? */ + + exit(0); +} diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d.out new file mode 100644 index 000000000000..ea17b160d298 --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d.out @@ -0,0 +1 @@ +cafe diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d new file mode 100644 index 000000000000..a7017bfee5e7 --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d @@ -0,0 +1,52 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +/* + * Test execution-time casting between integer types of different size. + */ + +#pragma D option quiet + +int64_t x; + +BEGIN +{ + z = 0xfff0; + + x = (int32_t)(int16_t)z; + printf("%16x %20d %20u\n", x, x, x); + x = (int32_t)(uint16_t)z; + printf("%16x %20d %20u\n", x, x, x); + x = (uint32_t)(int16_t)z; + printf("%16x %20d %20u\n", x, x, x); + x = (uint32_t)(uint16_t)z; + printf("%16x %20d %20u\n", x, x, x); + printf("\n"); + + x = (int16_t)(int32_t)z; + printf("%16x %20d %20u\n", x, x, x); + x = (int16_t)(uint32_t)z; + printf("%16x %20d %20u\n", x, x, x); + x = (uint16_t)(int32_t)z; + printf("%16x %20d %20u\n", x, x, x); + x = (uint16_t)(uint32_t)z; + printf("%16x %20d %20u\n", x, x, x); + + exit(0); +} diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d.out new file mode 100644 index 000000000000..d43df27d5d5c --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d.out @@ -0,0 +1,10 @@ +fffffffffffffff0 -16 18446744073709551600 + fff0 65520 65520 + fffffff0 4294967280 4294967280 + fff0 65520 65520 + +fffffffffffffff0 -16 18446744073709551600 +fffffffffffffff0 -16 18446744073709551600 + fff0 65520 65520 + fff0 65520 65520 + diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionentry.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionentry.d index 78e107eed492..e625cd9996d4 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionentry.d +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionentry.d @@ -36,12 +36,12 @@ #pragma D option quiet #pragma D option statusrate=10ms -fbt::ioctl:entry +fbt::kern_ioctl:entry { printf("Entering the ioctl function\n"); } -fbt::ioctl:return +fbt::kern_ioctl:return { printf("Returning from ioctl function\n"); exit(0); diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionreturnvalue.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionreturnvalue.d index 6d1b8a8fab69..f0338ec57133 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionreturnvalue.d +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionreturnvalue.d @@ -36,7 +36,7 @@ #pragma D option quiet #pragma D option statusrate=10ms -fbt::ioctl:return +fbt::kern_ioctl:return { printf("The function return value is stored in %u\n", arg1); exit(0); diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.ioctlargs.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.ioctlargs.d index c2c7bf04d002..5a26459a2eef 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.ioctlargs.d +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.ioctlargs.d @@ -36,13 +36,13 @@ #pragma D option quiet #pragma D option statusrate=10ms -fbt::ioctl:entry +fbt::kern_ioctl:entry { printf("Entering the ioctl function\n"); printf("The few arguments are %u %u %u %u\n", arg0, arg1, arg2, arg3); } -fbt::ioctl:return +fbt::kern_ioctl:return { printf("Returning from ioctl function\n"); printf("The few arguments are %u %u %u %u\n", arg0, arg1, arg2, arg3); diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offset.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offset.d index be2c0d6a6169..2ee8080305ba 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offset.d +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offset.d @@ -41,12 +41,12 @@ BEGIN self->traceme = 1; } -fbt::ioctl:entry +fbt::kern_ioctl:entry { printf("Entering the function\n"); } -fbt::ioctl:return +fbt::kern_ioctl:return { printf("The offset = %u\n", arg0); exit(0); diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offsetzero.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offsetzero.d index 240744bff38f..1e8ae16e0970 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offsetzero.d +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offsetzero.d @@ -36,14 +36,14 @@ #pragma D option quiet #pragma D option statusrate=10ms -fbt::ioctl:entry +fbt::kern_ioctl:entry { printf("Entering the ioctl function\n"); printf("The few arguments are %u %u %u %u\n", arg0, arg1, arg2, arg3); exit(0); } -fbt::ioctl:return +fbt::kern_ioctl:return { printf("Returning from ioctl function\n"); printf("The few arguments are %u %u %u %u\n", arg0, arg1, arg2, arg3); diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.return0.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.return0.d index cadbaa00f925..3fb54227b050 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.return0.d +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.return0.d @@ -36,7 +36,7 @@ #pragma D option quiet #pragma D option statusrate=10ms -fbt::ioctl:return +fbt::kern_ioctl:return /arg1 == 0/ { printf("%s %x returned 0", probefunc, arg0); diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.tailcall.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.tailcall.d index 67ef106fac0c..8dbb0abe39c0 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.tailcall.d +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.tailcall.d @@ -36,7 +36,7 @@ #pragma D option quiet #pragma D option statusrate=10ms -fbt::ioctl:entry +fbt::kern_ioctl:entry { self->traceme = 1; } @@ -47,7 +47,7 @@ fbt:::entry printf("called %s\n", probefunc); } -fbt::ioctl:return +fbt::kern_ioctl:return /self->traceme/ { self->traceme = 0; diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strjoin.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strjoin.d index 392c18a6df89..0f23737d38f6 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strjoin.d +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strjoin.d @@ -24,7 +24,9 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ #pragma D option quiet @@ -36,3 +38,8 @@ BEGIN printf("%s\n", strjoin("", "")); exit(0); } + +BEGIN +{ + exit(1); +} diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.BadAlign.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.BadAlign.d index ab4106dbeef8..3923cd910a14 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.BadAlign.d +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.BadAlign.d @@ -24,7 +24,9 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ /* * ASSERTION: This test reproduces the alignment error. @@ -39,9 +41,10 @@ BEGIN { - x = (int *) 64; + x = (int *)64; y = *x; trace(y); + exit(0); } ERROR diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress2.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress2.d index 324f40113ae8..6c79bfa42016 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress2.d +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress2.d @@ -24,7 +24,9 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ /* * ASSERTION: D pointers do not allow invalid pointer accesses. @@ -44,6 +46,7 @@ BEGIN y = (int *) (x - 3300778156056); *y = 3; trace(*y); + exit(0); } ERROR diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress3.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress3.d index 39bd1140bdf1..66c203061d00 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress3.d +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress3.d @@ -24,7 +24,9 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ /* * ASSERTION: D pointers do not allow invalid pointer accesses. @@ -39,9 +41,10 @@ BEGIN { - y = (int *) (-33007); + y = (int *)-33007; *y = 3; trace(*y); + exit(0); } ERROR diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress4.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress4.d index 9d6b144086b8..f5f49e966fcf 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress4.d +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress4.d @@ -24,7 +24,9 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ /* * ASSERTION: Demonstrating valid memory access. @@ -40,10 +42,11 @@ BEGIN { x = (int *)alloca(sizeof (int)); - printf("Address x: %x\n", (int) x); - y = (int *) (x - 2); + printf("Address x: %x\n", (int)x); + y = (int *)(x - 2); *y = 3; - printf("Address y: %x\tValue: %d\n", (int) y, *y); + printf("Address y: %x\tValue: %d\n", (int)y, *y); + exit(0); } ERROR diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_AGG.bad.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_AGG.bad.d new file mode 100644 index 000000000000..5479d00126a7 --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_AGG.bad.d @@ -0,0 +1,29 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +BEGIN +{ + @ = count(); + print(@); +} + +BEGIN +{ + exit(0); +} diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_DYN.bad.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_DYN.bad.d deleted file mode 100644 index 892b44561376..000000000000 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_DYN.bad.d +++ /dev/null @@ -1,29 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (the "License"). - * You may not use this file except in compliance with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ - -/* - * Copyright (c) 2011 by Delphix. All rights reserved. - */ - -BEGIN -{ - print(*curpsinfo); -} diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_VOID.bad.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_VOID.bad.d index 902f07272dd0..4f45885d42a3 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_VOID.bad.d +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_VOID.bad.d @@ -20,10 +20,15 @@ */ /* - * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ BEGIN { print((void)`p0); } + +BEGIN +{ + exit(0); +} diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PROTO_LEN.bad.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PROTO_LEN.bad.d index a1d3be1f62d3..368caebacb81 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PROTO_LEN.bad.d +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PROTO_LEN.bad.d @@ -20,10 +20,15 @@ */ /* - * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ BEGIN { print(); } + +BEGIN +{ + exit(0); +} diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.dyn.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.dyn.d new file mode 100644 index 000000000000..f17551facb4e --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.dyn.d @@ -0,0 +1,28 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +BEGIN +{ + print(*curpsinfo); +} + +BEGIN +{ + exit(0); +} diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.xlate.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.xlate.d new file mode 100644 index 000000000000..e8125d4f5cba --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.xlate.d @@ -0,0 +1,42 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +#pragma D option quiet + +typedef struct pancakes { + int i; + string s; + timespec_t t; +} pancakes_t; + +translator pancakes_t < void *V > { + i = 2 * 10; + s = strjoin("I like ", "pancakes"); + t = *(timespec_t *)`dtrace_zero; +}; + +BEGIN +{ + print(*(xlate < pancakes_t * > ((void *)NULL))); +} + +BEGIN +{ + exit(0); +} diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.xlate.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.xlate.d.out new file mode 100644 index 000000000000..9b01402af34b --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.xlate.d.out @@ -0,0 +1,8 @@ +pancakes_t { + int i = 0x14 + string s = [ "I like pancakes" ] + timespec_t t = { + time_t tv_sec = 0 + long tv_nsec = 0 + } +} diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.ints.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.ints.d.out index 4d2bb11207e1..bc7eaed0ec9a 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.ints.d.out +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.ints.d.out @@ -1,6 +1,6 @@ -239 -52719 +-17 +-12817 -1867788817 1311768467294899695 diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.signs.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.signs.d new file mode 100644 index 000000000000..64e565e267b0 --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.signs.d @@ -0,0 +1,38 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +/* + * Check %d v. %i v. %u. + */ + +#pragma D option quiet + +uint16_t x; +int16_t y; + +BEGIN +{ + x = 0xffffffff; + y = 0xffffffff; + + printf("%d %i %u\n", x, x, x); + printf("%d %i %u\n", y, y, y); + + exit(0); +} diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.signs.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.signs.d.out new file mode 100644 index 000000000000..169ac59b9554 --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.signs.d.out @@ -0,0 +1,3 @@ +65535 -1 65535 +-1 -1 65535 + diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.copyin.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.copyin.d index 7426d19e1b31..beb1c50bba38 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.copyin.d +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.copyin.d @@ -24,7 +24,9 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ /* * ASSERTION: @@ -39,7 +41,7 @@ */ -#pragma D option bufsize=16 +#pragma D option bufsize=32 #pragma D option bufpolicy=ring #pragma D option statusrate=1nsec diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations2.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations2.d index f660e9a8f3cf..5ac7957ced85 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations2.d +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations2.d @@ -24,7 +24,9 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ /* * ASSERTION: diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_PROTO_LEN.bad.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_PROTO_LEN.bad.d index a1ec95ccb4f5..68c11950b51c 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_PROTO_LEN.bad.d +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_PROTO_LEN.bad.d @@ -24,8 +24,9 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ /* * ASSERTION: @@ -39,3 +40,8 @@ BEGIN trace(); } + +BEGIN +{ + exit(0); +} diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_TRACE_AGG.bad.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_TRACE_AGG.bad.d new file mode 100644 index 000000000000..b29b9f179964 --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_TRACE_AGG.bad.d @@ -0,0 +1,29 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +BEGIN +{ + @ = count(); + trace(@); +} + +BEGIN +{ + exit(0); +} diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_TRACE_VOID.bad.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_TRACE_VOID.bad.d index eb9f194a73f4..ed044b2236fb 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_TRACE_VOID.bad.d +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_TRACE_VOID.bad.d @@ -24,7 +24,9 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ /* * ASSERTION: @@ -37,3 +39,8 @@ BEGIN { trace((void)`kmem_flags); } + +BEGIN +{ + exit(0); +} diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/tst.dyn.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/tst.dyn.d new file mode 100644 index 000000000000..24ad80fb469c --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/tst.dyn.d @@ -0,0 +1,28 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +BEGIN +{ + trace(*curpsinfo); +} + +BEGIN +{ + exit(0); +} diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/man.TestTransStability.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/man.TestTransStability.d deleted file mode 100644 index c664188f13a3..000000000000 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/man.TestTransStability.d +++ /dev/null @@ -1,61 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (the "License"). - * You may not use this file except in compliance with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ - -/* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* - * ASSERTION: - * The D inline translation mechanism can be used to facilitate stable - * translations. - * - * SECTION: Translators/ Translator Declarations - * SECTION: Translators/ Translate Operator - * SECTION: Translators/Stable Translations - * - * NOTES: Uncomment the pragma that explicitly resets the attributes of - * myinfo identifier to Stable/Stable/Common from Private/Private/Unknown. - * Run the program with and without the comments as: - * /usr/sbin/dtrace -vs man.TestTransStability.d - */ - -#pragma D option quiet - -inline lwpsinfo_t *myinfo = xlate < lwpsinfo_t *> (curthread); - -/* -#pragma D attributes Stable/Stable/Common myinfo -*/ - -BEGIN -{ - trace(myinfo->pr_flag); - exit(0); -} - -ERROR -{ - exit(1); -} diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability1.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability1.ksh new file mode 100644 index 000000000000..16eeda32916b --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability1.ksh @@ -0,0 +1,62 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +# +# Copyright (c) 2012 by Delphix. All rights reserved. +# + +# +# Test the output for stable translations. +# + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +$dtrace -v -s /dev/stdin <<EOF + +#pragma D option quiet + +inline lwpsinfo_t *myinfo = xlate < lwpsinfo_t *> (curthread); + +#pragma D attributes Stable/Stable/Common myinfo + +BEGIN +{ + this->a = myinfo->pr_flag; + exit(0); +} + +BEGIN +{ + exit(1); +} +EOF + +exit $? diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability1.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability1.ksh.out new file mode 100644 index 000000000000..43c1adb1a54f --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability1.ksh.out @@ -0,0 +1,14 @@ + +Stability attributes for script /dev/stdin: + + Minimum Probe Description Attributes + Identifier Names: Unstable + Data Semantics: Unstable + Dependency Class: Common + + Minimum Statement Attributes + Identifier Names: Stable + Data Semantics: Stable + Dependency Class: Common + + diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability2.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability2.ksh new file mode 100644 index 000000000000..82070cde9237 --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability2.ksh @@ -0,0 +1,60 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +# +# Copyright (c) 2012 by Delphix. All rights reserved. +# + +# +# Test the output of unstable translations. +# + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +$dtrace -v -s /dev/stdin <<EOF + +#pragma D option quiet + +inline lwpsinfo_t *myinfo = xlate < lwpsinfo_t *> (curthread); + +BEGIN +{ + this->a = myinfo->pr_flag; + exit(0); +} + +BEGIN +{ + exit(1); +} +EOF + +exit $? diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability2.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability2.ksh.out new file mode 100644 index 000000000000..f4b70f9573db --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability2.ksh.out @@ -0,0 +1,14 @@ + +Stability attributes for script /dev/stdin: + + Minimum Probe Description Attributes + Identifier Names: Unstable + Data Semantics: Unstable + Dependency Class: Common + + Minimum Statement Attributes + Identifier Names: Private + Data Semantics: Private + Dependency Class: Unknown + + diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.const.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.const.d new file mode 100644 index 000000000000..dae3d9041ed3 --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.const.d @@ -0,0 +1,29 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +/* + * Make sure we can scope types with modifiers. + */ + +BEGIN +{ + trace((D`int *)0); + trace((const D`int *)0); + exit(0); +} diff --git a/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c b/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c index b35d27297620..425f391993f7 100644 --- a/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c +++ b/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c @@ -3530,6 +3530,12 @@ zfs_snapshot_cb(zfs_handle_t *zhp, void *arg) int rv = 0; int error; + if (sd->sd_recursive && + zfs_prop_get_int(zhp, ZFS_PROP_INCONSISTENT) != 0) { + zfs_close(zhp); + return (0); + } + error = asprintf(&name, "%s@%s", zfs_get_name(zhp), sd->sd_snapname); if (error == -1) nomem(); diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c index 42b66458d477..b0f2b4a1af32 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c @@ -26,6 +26,7 @@ /* * Copyright (c) 2011, Joyent, Inc. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #include <stdlib.h> @@ -894,33 +895,14 @@ dt_aggregate_valcmp(const void *lhs, const void *rhs) caddr_t rdata = rh->dtahe_data.dtada_data; dtrace_recdesc_t *lrec, *rrec; int64_t *laddr, *raddr; - int rval, i; - - if ((rval = dt_aggregate_hashcmp(lhs, rhs)) != 0) - return (rval); - - if (lagg->dtagd_nrecs > ragg->dtagd_nrecs) - return (DT_GREATERTHAN); - - if (lagg->dtagd_nrecs < ragg->dtagd_nrecs) - return (DT_LESSTHAN); + int rval; - for (i = 0; i < lagg->dtagd_nrecs; i++) { - lrec = &lagg->dtagd_rec[i]; - rrec = &ragg->dtagd_rec[i]; + assert(lagg->dtagd_nrecs == ragg->dtagd_nrecs); - if (lrec->dtrd_offset < rrec->dtrd_offset) - return (DT_LESSTHAN); - - if (lrec->dtrd_offset > rrec->dtrd_offset) - return (DT_GREATERTHAN); + lrec = &lagg->dtagd_rec[lagg->dtagd_nrecs - 1]; + rrec = &ragg->dtagd_rec[ragg->dtagd_nrecs - 1]; - if (lrec->dtrd_action < rrec->dtrd_action) - return (DT_LESSTHAN); - - if (lrec->dtrd_action > rrec->dtrd_action) - return (DT_GREATERTHAN); - } + assert(lrec->dtrd_action == rrec->dtrd_action); laddr = (int64_t *)(uintptr_t)(ldata + lrec->dtrd_offset); raddr = (int64_t *)(uintptr_t)(rdata + rrec->dtrd_offset); diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c index 0ac4795413bc..64b98c4527bf 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c @@ -22,7 +22,7 @@ /* * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, Joyent Inc. All rights reserved. - * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ /* @@ -664,62 +664,53 @@ static void dt_action_trace(dtrace_hdl_t *dtp, dt_node_t *dnp, dtrace_stmtdesc_t *sdp) { dtrace_actdesc_t *ap = dt_stmt_action(dtp, sdp); + boolean_t istrace = (dnp->dn_ident->di_id == DT_ACT_TRACE); + const char *act = istrace ? "trace" : "print"; if (dt_node_is_void(dnp->dn_args)) { - dnerror(dnp->dn_args, D_TRACE_VOID, - "trace( ) may not be applied to a void expression\n"); + dnerror(dnp->dn_args, istrace ? D_TRACE_VOID : D_PRINT_VOID, + "%s( ) may not be applied to a void expression\n", act); } - if (dt_node_is_dynamic(dnp->dn_args)) { - dnerror(dnp->dn_args, D_TRACE_DYN, - "trace( ) may not be applied to a dynamic expression\n"); + if (dt_node_resolve(dnp->dn_args, DT_IDENT_XLPTR) != NULL) { + dnerror(dnp->dn_args, istrace ? D_TRACE_DYN : D_PRINT_DYN, + "%s( ) may not be applied to a translated pointer\n", act); } - dt_cg(yypcb, dnp->dn_args); - ap->dtad_difo = dt_as(yypcb); - ap->dtad_kind = DTRACEACT_DIFEXPR; -} - -/* - * The print() action behaves identically to trace(), except that it stores the - * CTF type of the argument (if present) within the DOF for the DIFEXPR action. - * To do this, we set the 'dtsd_strdata' to point to the fully-qualified CTF - * type ID for the result of the DIF action. We use the ID instead of the name - * to handles complex types like arrays and function pointers that can't be - * resolved by ctf_type_lookup(). This is later processed by - * dtrace_dof_create() and turned into a reference into the string table so - * that we can get the type information when we process the data after the - * fact. - */ -static void -dt_action_print(dtrace_hdl_t *dtp, dt_node_t *dnp, dtrace_stmtdesc_t *sdp) -{ - dtrace_actdesc_t *ap = dt_stmt_action(dtp, sdp); - dt_node_t *dret; - size_t len; - dt_module_t *dmp; - - if (dt_node_is_void(dnp->dn_args)) { - dnerror(dnp->dn_args, D_PRINT_VOID, - "print( ) may not be applied to a void expression\n"); - } - - if (dt_node_is_dynamic(dnp->dn_args)) { - dnerror(dnp->dn_args, D_PRINT_DYN, - "print( ) may not be applied to a dynamic expression\n"); + if (dnp->dn_args->dn_kind == DT_NODE_AGG) { + dnerror(dnp->dn_args, istrace ? D_TRACE_AGG : D_PRINT_AGG, + "%s( ) may not be applied to an aggregation%s\n", act, + istrace ? "" : " -- did you mean printa()?"); } dt_cg(yypcb, dnp->dn_args); - dret = yypcb->pcb_dret; - dmp = dt_module_lookup_by_ctf(dtp, dret->dn_ctfp); + /* + * The print() action behaves identically to trace(), except that it + * stores the CTF type of the argument (if present) within the DOF for + * the DIFEXPR action. To do this, we set the 'dtsd_strdata' to point + * to the fully-qualified CTF type ID for the result of the DIF + * action. We use the ID instead of the name to handles complex types + * like arrays and function pointers that can't be resolved by + * ctf_type_lookup(). This is later processed by dtrace_dof_create() + * and turned into a reference into the string table so that we can + * get the type information when we process the data after the fact. + */ + if (dnp->dn_ident->di_id == DT_ACT_PRINT) { + dt_node_t *dret; + size_t n; + dt_module_t *dmp; + + dret = yypcb->pcb_dret; + dmp = dt_module_lookup_by_ctf(dtp, dret->dn_ctfp); - len = snprintf(NULL, 0, "%s`%ld", dmp->dm_name, dret->dn_type) + 1; - sdp->dtsd_strdata = dt_alloc(dtp, len); - if (sdp->dtsd_strdata == NULL) - longjmp(yypcb->pcb_jmpbuf, EDT_NOMEM); - (void) snprintf(sdp->dtsd_strdata, len, "%s`%ld", dmp->dm_name, - dret->dn_type); + n = snprintf(NULL, 0, "%s`%ld", dmp->dm_name, dret->dn_type) + 1; + sdp->dtsd_strdata = dt_alloc(dtp, n); + if (sdp->dtsd_strdata == NULL) + longjmp(yypcb->pcb_jmpbuf, EDT_NOMEM); + (void) snprintf(sdp->dtsd_strdata, n, "%s`%ld", dmp->dm_name, + dret->dn_type); + } ap->dtad_difo = dt_as(yypcb); ap->dtad_kind = DTRACEACT_DIFEXPR; @@ -1145,6 +1136,9 @@ dt_compile_fun(dtrace_hdl_t *dtp, dt_node_t *dnp, dtrace_stmtdesc_t *sdp) case DT_ACT_PANIC: dt_action_panic(dtp, dnp->dn_expr, sdp); break; + case DT_ACT_PRINT: + dt_action_trace(dtp, dnp->dn_expr, sdp); + break; case DT_ACT_PRINTA: dt_action_printa(dtp, dnp->dn_expr, sdp); break; @@ -1181,9 +1175,6 @@ dt_compile_fun(dtrace_hdl_t *dtp, dt_node_t *dnp, dtrace_stmtdesc_t *sdp) case DT_ACT_TRACE: dt_action_trace(dtp, dnp->dn_expr, sdp); break; - case DT_ACT_PRINT: - dt_action_print(dtp, dnp->dn_expr, sdp); - break; case DT_ACT_TRACEMEM: dt_action_tracemem(dtp, dnp->dn_expr, sdp); break; @@ -2559,7 +2550,8 @@ dt_compile(dtrace_hdl_t *dtp, int context, dtrace_probespec_t pspec, void *arg, } out: - if (context != DT_CTX_DTYPE && DT_TREEDUMP_PASS(dtp, 3)) + if (context != DT_CTX_DTYPE && yypcb->pcb_root != NULL && + DT_TREEDUMP_PASS(dtp, 3)) dt_node_printr(yypcb->pcb_root, stderr, 0); if (dtp->dt_cdefs_fd != -1 && (ftruncate64(dtp->dt_cdefs_fd, 0) == -1 || diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cg.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cg.c index 6c602199290f..e748ff2b3ade 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cg.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cg.c @@ -1387,6 +1387,162 @@ dt_cg_func_typeref(dtrace_hdl_t *dtp, dt_node_t *dnp) typs->dn_value = ctf_type_size(dtt.dtt_ctfp, dtt.dtt_type); } +typedef struct dt_xlmemb { + dt_ident_t *dtxl_idp; /* translated ident */ + dt_irlist_t *dtxl_dlp; /* instruction list */ + dt_regset_t *dtxl_drp; /* register set */ + int dtxl_sreg; /* location of the translation input */ + int dtxl_dreg; /* location of our allocated buffer */ +} dt_xlmemb_t; + +/*ARGSUSED*/ +static int +dt_cg_xlate_member(const char *name, ctf_id_t type, ulong_t off, void *arg) +{ + dt_xlmemb_t *dx = arg; + dt_ident_t *idp = dx->dtxl_idp; + dt_irlist_t *dlp = dx->dtxl_dlp; + dt_regset_t *drp = dx->dtxl_drp; + + dt_node_t *mnp; + dt_xlator_t *dxp; + + int reg, treg; + uint32_t instr; + size_t size; + + /* Generate code for the translation. */ + dxp = idp->di_data; + mnp = dt_xlator_member(dxp, name); + + /* If there's no translator for the given member, skip it. */ + if (mnp == NULL) + return (0); + + dxp->dx_ident->di_flags |= DT_IDFLG_CGREG; + dxp->dx_ident->di_id = dx->dtxl_sreg; + + dt_cg_node(mnp->dn_membexpr, dlp, drp); + + dxp->dx_ident->di_flags &= ~DT_IDFLG_CGREG; + dxp->dx_ident->di_id = 0; + + treg = mnp->dn_membexpr->dn_reg; + + /* Compute the offset into our buffer and store the result there. */ + reg = dt_regset_alloc(drp); + + dt_cg_setx(dlp, reg, off / NBBY); + instr = DIF_INSTR_FMT(DIF_OP_ADD, dx->dtxl_dreg, reg, reg); + dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, instr)); + + size = ctf_type_size(mnp->dn_membexpr->dn_ctfp, + mnp->dn_membexpr->dn_type); + if (dt_node_is_scalar(mnp->dn_membexpr)) { + /* + * Copying scalars is simple. + */ + switch (size) { + case 1: + instr = DIF_INSTR_STORE(DIF_OP_STB, treg, reg); + break; + case 2: + instr = DIF_INSTR_STORE(DIF_OP_STH, treg, reg); + break; + case 4: + instr = DIF_INSTR_STORE(DIF_OP_STW, treg, reg); + break; + case 8: + instr = DIF_INSTR_STORE(DIF_OP_STX, treg, reg); + break; + default: + xyerror(D_UNKNOWN, "internal error -- unexpected " + "size: %lu\n", (ulong_t)size); + } + + dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, instr)); + + } else if (dt_node_is_string(mnp->dn_membexpr)) { + int szreg; + + /* + * Use the copys instruction for strings. + */ + szreg = dt_regset_alloc(drp); + dt_cg_setx(dlp, szreg, size); + instr = DIF_INSTR_COPYS(treg, szreg, reg); + dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, instr)); + dt_regset_free(drp, szreg); + } else { + int szreg; + + /* + * If it's anything else then we'll just bcopy it. + */ + szreg = dt_regset_alloc(drp); + dt_cg_setx(dlp, szreg, size); + dt_irlist_append(dlp, + dt_cg_node_alloc(DT_LBL_NONE, DIF_INSTR_FLUSHTS)); + instr = DIF_INSTR_PUSHTS(DIF_OP_PUSHTV, DIF_TYPE_CTF, + DIF_REG_R0, treg); + dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, instr)); + instr = DIF_INSTR_PUSHTS(DIF_OP_PUSHTV, DIF_TYPE_CTF, + DIF_REG_R0, reg); + dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, instr)); + instr = DIF_INSTR_PUSHTS(DIF_OP_PUSHTV, DIF_TYPE_CTF, + DIF_REG_R0, szreg); + dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, instr)); + instr = DIF_INSTR_CALL(DIF_SUBR_BCOPY, szreg); + dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, instr)); + dt_regset_free(drp, szreg); + } + + dt_regset_free(drp, reg); + dt_regset_free(drp, treg); + + return (0); +} + +/* + * If we're expanding a translated type, we create an appropriately sized + * buffer with alloca() and then translate each member into it. + */ +static int +dt_cg_xlate_expand(dt_node_t *dnp, dt_ident_t *idp, dt_irlist_t *dlp, + dt_regset_t *drp) +{ + dt_xlmemb_t dlm; + uint32_t instr; + int dreg; + size_t size; + + dreg = dt_regset_alloc(drp); + size = ctf_type_size(dnp->dn_ident->di_ctfp, dnp->dn_ident->di_type); + + /* Call alloca() to create the buffer. */ + dt_cg_setx(dlp, dreg, size); + + dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, DIF_INSTR_FLUSHTS)); + + instr = DIF_INSTR_PUSHTS(DIF_OP_PUSHTV, DIF_TYPE_CTF, DIF_REG_R0, dreg); + dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, instr)); + + instr = DIF_INSTR_CALL(DIF_SUBR_ALLOCA, dreg); + dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, instr)); + + /* Generate the translation for each member. */ + dlm.dtxl_idp = idp; + dlm.dtxl_dlp = dlp; + dlm.dtxl_drp = drp; + dlm.dtxl_sreg = dnp->dn_reg; + dlm.dtxl_dreg = dreg; + (void) ctf_member_iter(dnp->dn_ident->di_ctfp, + dnp->dn_ident->di_type, dt_cg_xlate_member, + &dlm); + + return (dreg); +} + static void dt_cg_node(dt_node_t *dnp, dt_irlist_t *dlp, dt_regset_t *drp) { @@ -1600,7 +1756,16 @@ dt_cg_node(dt_node_t *dnp, dt_irlist_t *dlp, dt_regset_t *drp) dt_cg_node(dnp->dn_child, dlp, drp); dnp->dn_reg = dnp->dn_child->dn_reg; - if (!(dnp->dn_flags & DT_NF_REF)) { + if (dt_node_is_dynamic(dnp->dn_child)) { + int reg; + idp = dt_node_resolve(dnp->dn_child, DT_IDENT_XLPTR); + assert(idp != NULL); + reg = dt_cg_xlate_expand(dnp, idp, dlp, drp); + + dt_regset_free(drp, dnp->dn_child->dn_reg); + dnp->dn_reg = reg; + + } else if (!(dnp->dn_flags & DT_NF_REF)) { uint_t ubit = dnp->dn_flags & DT_NF_USERLAND; /* @@ -1998,6 +2163,13 @@ dt_cg(dt_pcb_t *pcb, dt_node_t *dnp) dt_cg_node(dnp, &pcb->pcb_ir, pcb->pcb_regs); + if ((idp = dt_node_resolve(dnp, DT_IDENT_XLSOU)) != NULL) { + int reg = dt_cg_xlate_expand(dnp, idp, + &pcb->pcb_ir, pcb->pcb_regs); + dt_regset_free(pcb->pcb_regs, dnp->dn_reg); + dnp->dn_reg = reg; + } + instr = DIF_INSTR_RET(dnp->dn_reg); dt_regset_free(pcb->pcb_regs, dnp->dn_reg); dt_irlist_append(&pcb->pcb_ir, dt_cg_node_alloc(DT_LBL_NONE, instr)); diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c index c88a92c4a8f1..8d9e49449eca 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c @@ -2018,13 +2018,13 @@ dt_consume_cpu(dtrace_hdl_t *dtp, FILE *fp, int cpu, uint64_t tracememsize = 0; dtrace_probedata_t data; uint64_t drops; - data.dtpda_flow = dtp->dt_flow; - data.dtpda_indent = dtp->dt_indent; - data.dtpda_prefix = dtp->dt_prefix; bzero(&data, sizeof (data)); data.dtpda_handle = dtp; data.dtpda_cpu = cpu; + data.dtpda_flow = dtp->dt_flow; + data.dtpda_indent = dtp->dt_indent; + data.dtpda_prefix = dtp->dt_prefix; for (offs = buf->dtbd_oldest; offs < buf->dtbd_size; ) { dtrace_eprobedesc_t *epd; @@ -2611,7 +2611,7 @@ typedef struct dt_begin { static int dt_consume_begin_probe(const dtrace_probedata_t *data, void *arg) { - dt_begin_t *begin = (dt_begin_t *)arg; + dt_begin_t *begin = arg; dtrace_probedesc_t *pd = data->dtpda_pdesc; int r1 = (strcmp(pd->dtpd_provider, "dtrace") == 0); @@ -2636,7 +2636,7 @@ static int dt_consume_begin_record(const dtrace_probedata_t *data, const dtrace_recdesc_t *rec, void *arg) { - dt_begin_t *begin = (dt_begin_t *)arg; + dt_begin_t *begin = arg; return (begin->dtbgn_recfunc(data, rec, begin->dtbgn_arg)); } diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_decl.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_decl.c index bb779840406c..871fdd530487 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_decl.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_decl.c @@ -21,6 +21,7 @@ */ /* * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. * Use is subject to license terms. */ @@ -254,11 +255,6 @@ dt_decl_spec(ushort_t kind, char *name) ddp->dd_kind = kind; ddp->dd_name = name; - if (name != NULL && strchr(name, '`') != NULL) { - xyerror(D_DECL_SCOPE, "D scoping operator may not be used " - "in a type name\n"); - } - return (dt_decl_check(ddp)); } diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_error.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_error.c index 75814c1ca888..66776beed21d 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_error.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_error.c @@ -18,6 +18,7 @@ * * CDDL HEADER END */ + /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_errtags.h b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_errtags.h index 353f581adc7f..6bc392ff65fa 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_errtags.h +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_errtags.h @@ -190,8 +190,10 @@ typedef enum { D_PRINTA_AGGPROTO, /* printa() aggregation mismatch */ D_TRACE_VOID, /* trace() argument has void type */ D_TRACE_DYN, /* trace() argument has dynamic type */ + D_TRACE_AGG, /* trace() argument is an aggregation */ D_PRINT_VOID, /* print() argument has void type */ D_PRINT_DYN, /* print() argument has dynamic type */ + D_PRINT_AGG, /* print() argument is an aggregation */ D_TRACEMEM_ADDR, /* tracemem() address bad type */ D_TRACEMEM_SIZE, /* tracemem() size bad type */ D_TRACEMEM_ARGS, /* tracemem() illegal number of args */ diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h index c066b0355864..e4b1db55fa10 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h @@ -468,7 +468,6 @@ enum { EDT_VERSREDUCED, /* requested API version has been reduced */ EDT_CTF, /* libctf called failed (dt_ctferr has more) */ EDT_COMPILER, /* error in D program compilation */ - EDT_NOREG, /* register allocation failure */ EDT_NOTUPREG, /* tuple register allocation failure */ EDT_NOMEM, /* memory allocation failure */ EDT_INT2BIG, /* integer limit exceeded */ diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c index aafe6479f9ab..5b3be7de728e 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c @@ -23,6 +23,7 @@ /* * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Copyright (c) 2011, Joyent Inc. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #pragma ident "%Z%%M% %I% %E% SMI" @@ -96,6 +97,7 @@ */ #include <sys/param.h> +#include <sys/sysmacros.h> #include <limits.h> #include <setjmp.h> #include <strings.h> @@ -1862,6 +1864,38 @@ dt_node_op1(int op, dt_node_t *cp) return (dnp); } +/* + * If an integer constant is being cast to another integer type, we can + * perform the cast as part of integer constant folding in this pass. We must + * take action when the integer is being cast to a smaller type or if it is + * changing signed-ness. If so, we first shift rp's bits bits high (losing + * excess bits if narrowing) and then shift them down with either a logical + * shift (unsigned) or arithmetic shift (signed). + */ +static void +dt_cast(dt_node_t *lp, dt_node_t *rp) +{ + size_t srcsize = dt_node_type_size(rp); + size_t dstsize = dt_node_type_size(lp); + + if (dstsize < srcsize) { + int n = (sizeof (uint64_t) - dstsize) * NBBY; + rp->dn_value <<= n; + rp->dn_value >>= n; + } else if (dstsize > srcsize) { + int n = (sizeof (uint64_t) - srcsize) * NBBY; + int s = (dstsize - srcsize) * NBBY; + + rp->dn_value <<= n; + if (rp->dn_flags & DT_NF_SIGNED) { + rp->dn_value = (intmax_t)rp->dn_value >> s; + rp->dn_value >>= n - s; + } else { + rp->dn_value >>= n; + } + } +} + dt_node_t * dt_node_op2(int op, dt_node_t *lp, dt_node_t *rp) { @@ -2011,32 +2045,9 @@ dt_node_op2(int op, dt_node_t *lp, dt_node_t *rp) } } - /* - * If an integer constant is being cast to another integer type, we can - * perform the cast as part of integer constant folding in this pass. - * We must take action when the integer is being cast to a smaller type - * or if it is changing signed-ness. If so, we first shift rp's bits - * bits high (losing excess bits if narrowing) and then shift them down - * with either a logical shift (unsigned) or arithmetic shift (signed). - */ if (op == DT_TOK_LPAR && rp->dn_kind == DT_NODE_INT && dt_node_is_integer(lp)) { - size_t srcsize = dt_node_type_size(rp); - size_t dstsize = dt_node_type_size(lp); - - if ((dstsize < srcsize) || ((lp->dn_flags & DT_NF_SIGNED) ^ - (rp->dn_flags & DT_NF_SIGNED))) { - int n = dstsize < srcsize ? - (sizeof (uint64_t) * NBBY - dstsize * NBBY) : - (sizeof (uint64_t) * NBBY - srcsize * NBBY); - - rp->dn_value <<= n; - if (lp->dn_flags & DT_NF_SIGNED) - rp->dn_value = (intmax_t)rp->dn_value >> n; - else - rp->dn_value = rp->dn_value >> n; - } - + dt_cast(lp, rp); dt_node_type_propagate(lp, rp); dt_node_attr_assign(rp, dt_attr_min(lp->dn_attr, rp->dn_attr)); dt_node_free(lp); @@ -2895,14 +2906,14 @@ dt_cook_op1(dt_node_t *dnp, uint_t idflags) case DT_TOK_DEREF: /* * If the deref operator is applied to a translated pointer, - * we can just set our output type to the base translation. + * we set our output type to the output of the translation. */ if ((idp = dt_node_resolve(cp, DT_IDENT_XLPTR)) != NULL) { dt_xlator_t *dxp = idp->di_data; dnp->dn_ident = &dxp->dx_souid; dt_node_type_assign(dnp, - DT_DYN_CTFP(dtp), DT_DYN_TYPE(dtp)); + dnp->dn_ident->di_ctfp, dnp->dn_ident->di_type); break; } @@ -3078,6 +3089,31 @@ dt_cook_op1(dt_node_t *dnp, uint_t idflags) return (dnp); } +static void +dt_assign_common(dt_node_t *dnp) +{ + dt_node_t *lp = dnp->dn_left; + dt_node_t *rp = dnp->dn_right; + int op = dnp->dn_op; + + if (rp->dn_kind == DT_NODE_INT) + dt_cast(lp, rp); + + if (!(lp->dn_flags & DT_NF_LVALUE)) { + xyerror(D_OP_LVAL, "operator %s requires modifiable " + "lvalue as an operand\n", opstr(op)); + /* see K&R[A7.17] */ + } + + if (!(lp->dn_flags & DT_NF_WRITABLE)) { + xyerror(D_OP_WRITE, "operator %s can only be applied " + "to a writable variable\n", opstr(op)); + } + + dt_node_type_propagate(lp, dnp); /* see K&R[A7.17] */ + dt_node_attr_assign(dnp, dt_attr_min(lp->dn_attr, rp->dn_attr)); +} + static dt_node_t * dt_cook_op2(dt_node_t *dnp, uint_t idflags) { @@ -3556,19 +3592,7 @@ dt_cook_op2(dt_node_t *dnp, uint_t idflags) } } asgn_common: - if (!(lp->dn_flags & DT_NF_LVALUE)) { - xyerror(D_OP_LVAL, "operator %s requires modifiable " - "lvalue as an operand\n", opstr(op)); - /* see K&R[A7.17] */ - } - - if (!(lp->dn_flags & DT_NF_WRITABLE)) { - xyerror(D_OP_WRITE, "operator %s can only be applied " - "to a writable variable\n", opstr(op)); - } - - dt_node_type_propagate(lp, dnp); /* see K&R[A7.17] */ - dt_node_attr_assign(dnp, dt_attr_min(lp->dn_attr, rp->dn_attr)); + dt_assign_common(dnp); break; case DT_TOK_PTR: @@ -3873,6 +3897,14 @@ asgn_common: dt_node_type_propagate(lp, dnp); /* see K&R[A7.5] */ dt_node_attr_assign(dnp, dt_attr_min(lp->dn_attr, rp->dn_attr)); + + /* + * If it's a pointer then should be able to (attempt to) + * assign to it. + */ + if (lkind == CTF_K_POINTER) + dnp->dn_flags |= DT_NF_WRITABLE; + break; } diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c index 51f87b03ffd9..24682b2f086e 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c @@ -22,6 +22,7 @@ /* * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, Joyent, Inc. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #if defined(sun) @@ -161,7 +162,7 @@ static int pfcheck_dint(dt_pfargv_t *pfv, dt_pfargd_t *pfd, dt_node_t *dnp) { if (dnp->dn_flags & DT_NF_SIGNED) - pfd->pfd_flags |= DT_PFCONV_SIGNED; + pfd->pfd_fmt[strlen(pfd->pfd_fmt) - 1] = 'i'; else pfd->pfd_fmt[strlen(pfd->pfd_fmt) - 1] = 'u'; @@ -664,7 +665,7 @@ static const dt_pfconv_t _dtrace_conversions[] = { { "hu", "u", "unsigned short", pfcheck_type, pfprint_uint }, { "hx", "x", "short", pfcheck_xshort, pfprint_uint }, { "hX", "X", "short", pfcheck_xshort, pfprint_uint }, -{ "i", "i", pfproto_xint, pfcheck_dint, pfprint_dint }, +{ "i", "i", pfproto_xint, pfcheck_xint, pfprint_sint }, { "I", "s", pfproto_cstr, pfcheck_str, pfprint_inetaddr }, { "k", "s", "stack", pfcheck_stack, pfprint_stack }, { "lc", "lc", "int", pfcheck_type, pfprint_sint }, /* a.k.a. wint_t */ diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c index df34eece397f..87211a24b93f 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c @@ -21,6 +21,7 @@ /* * Copyright 2010 Sun Microsystems, Inc. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. * Use is subject to license terms. */ @@ -617,8 +618,8 @@ dt_printf(dtrace_hdl_t *dtp, FILE *fp, const char *format, ...) size_t avail; /* - * It's not legal to use buffered ouput if there is not a - * handler for buffered output. + * Using buffered output is not allowed if a handler has + * not been installed. */ if (dtp->dt_bufhdlr == NULL) { va_end(ap); diff --git a/cddl/contrib/opensolaris/lib/libdtrace/i386/dt_isadep.c b/cddl/contrib/opensolaris/lib/libdtrace/i386/dt_isadep.c index f11ae480a807..9479e83dd777 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/i386/dt_isadep.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/i386/dt_isadep.c @@ -24,6 +24,10 @@ * Use is subject to license terms. */ +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + #include <stdlib.h> #include <assert.h> #include <errno.h> @@ -525,7 +529,8 @@ dt_instr_size(uchar_t *instr, dtrace_hdl_t *dtp, pid_t pid, uintptr_t addr, * another debugger attached to this process. The original instruction * can't be recovered so this must fail. */ - if (x86dis.d86_len == 1 && instr[0] == FASTTRAP_INSTR) + if (x86dis.d86_len == 1 && + (uchar_t)x86dis.d86_bytes[0] == FASTTRAP_INSTR) return (-1); return (x86dis.d86_len); diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c index 3d96da23cfd9..7186c6fb4f93 100644 --- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c +++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c @@ -1885,6 +1885,10 @@ get_numeric_property(zfs_handle_t *zhp, zfs_prop_t prop, zprop_source_t *src, zcmd_free_nvlists(&zc); break; + case ZFS_PROP_INCONSISTENT: + *val = zhp->zfs_dmustats.dds_inconsistent; + break; + default: switch (zfs_prop_get_type(prop)) { case PROP_TYPE_NUMBER: @@ -3379,13 +3383,16 @@ zfs_snapshot_cb(zfs_handle_t *zhp, void *arg) char name[ZFS_MAXNAMELEN]; int rv = 0; - (void) snprintf(name, sizeof (name), - "%s@%s", zfs_get_name(zhp), sd->sd_snapname); + if (zfs_prop_get_int(zhp, ZFS_PROP_INCONSISTENT) == 0) { + (void) snprintf(name, sizeof (name), + "%s@%s", zfs_get_name(zhp), sd->sd_snapname); - fnvlist_add_boolean(sd->sd_nvl, name); + fnvlist_add_boolean(sd->sd_nvl, name); - rv = zfs_iter_filesystems(zhp, zfs_snapshot_cb, sd); + rv = zfs_iter_filesystems(zhp, zfs_snapshot_cb, sd); + } zfs_close(zhp); + return (rv); } diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c index d0eac12016e1..1fc46c24e4ab 100644 --- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c +++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c @@ -1576,8 +1576,8 @@ zfs_send(zfs_handle_t *zhp, const char *fromsnap, const char *tosnap, if (tid != 0) { if (err != 0) (void) pthread_cancel(tid); - (void) pthread_join(tid, NULL); (void) close(pipefd[0]); + (void) pthread_join(tid, NULL); } if (sdd.cleanup_fd != -1) { @@ -1613,8 +1613,8 @@ err_out: VERIFY(0 == close(sdd.cleanup_fd)); if (tid != 0) { (void) pthread_cancel(tid); - (void) pthread_join(tid, NULL); (void) close(pipefd[0]); + (void) pthread_join(tid, NULL); } return (err); } diff --git a/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c b/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c index 77b49895a571..82ec5fafda4a 100644 --- a/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c +++ b/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c @@ -52,6 +52,8 @@ static char *curfile; #define CTF_BUF_CHUNK_SIZE (64 * 1024) #define RES_BUF_CHUNK_SIZE (64 * 1024) +static int ntypes = 0; /* The number of types. */ + struct ctf_buf { strtab_t ctb_strtab; /* string table */ caddr_t ctb_base; /* pointer to base of buffer */ @@ -1143,6 +1145,10 @@ resurrect_types(ctf_header_t *h, tdata_t *td, tdesc_t **tdarr, int tdsize, (*mpp)->ml_type = tdarr[ctm->ctm_type]; (*mpp)->ml_offset = ctm->ctm_offset; (*mpp)->ml_size = 0; + if (ctm->ctm_type > ntypes) { + parseterminate("Invalid member type ctm_type=%d", + ctm->ctm_type); + } } } else { for (i = 0, mpp = &tdp->t_members; i < vlen; @@ -1159,6 +1165,10 @@ resurrect_types(ctf_header_t *h, tdata_t *td, tdesc_t **tdarr, int tdsize, (*mpp)->ml_offset = (int)CTF_LMEM_OFFSET(ctlm); (*mpp)->ml_size = 0; + if (ctlm->ctlm_type > ntypes) { + parseterminate("Invalid lmember type ctlm_type=%d", + ctlm->ctlm_type); + } } } @@ -1272,9 +1282,10 @@ ctf_parse(ctf_header_t *h, caddr_t buf, symit_data_t *si, char *label) { tdata_t *td = tdata_new(); tdesc_t **tdarr; - int ntypes = count_types(h, buf); int idx, i; + ntypes = count_types(h, buf); + /* shudder */ tdarr = xcalloc(sizeof (tdesc_t *) * (ntypes + 1)); tdarr[0] = NULL; diff --git a/cddl/contrib/opensolaris/tools/ctf/cvt/ctftools.h b/cddl/contrib/opensolaris/tools/ctf/cvt/ctftools.h index 93a540d22c60..9b2ee3d7565c 100644 --- a/cddl/contrib/opensolaris/tools/ctf/cvt/ctftools.h +++ b/cddl/contrib/opensolaris/tools/ctf/cvt/ctftools.h @@ -159,7 +159,7 @@ typedef struct ardef { /* Auxiliary structure for structure/union tdesc_t */ typedef struct mlist { int ml_offset; /* Offset from start of structure (in bits) */ - int ml_size; /* Member size (in bits) */ + uint_t ml_size; /* Member size (in bits) */ char *ml_name; /* Member name */ struct tdesc *ml_type; /* Member type */ struct mlist *ml_next; /* Next member */ diff --git a/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c b/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c index 19aeff2c7942..c7f785eb0446 100644 --- a/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c +++ b/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c @@ -674,6 +674,13 @@ die_array_create(dwarf_t *dw, Dwarf_Die arr, Dwarf_Off off, tdesc_t *tdp) tdesc_t *dimtdp; int flags; + /* Check for bogus gcc DW_AT_byte_size attribute */ + if (uval == (unsigned)-1) { + printf("dwarf.c:%s() working around bogus -1 DW_AT_byte_size\n", + __func__); + uval = 0; + } + tdp->t_size = uval; /* @@ -760,6 +767,12 @@ die_enum_create(dwarf_t *dw, Dwarf_Die die, Dwarf_Off off, tdesc_t *tdp) tdp->t_type = ENUM; (void) die_unsigned(dw, die, DW_AT_byte_size, &uval, DW_ATTR_REQ); + /* Check for bogus gcc DW_AT_byte_size attribute */ + if (uval == (unsigned)-1) { + printf("dwarf.c:%s() working around bogus -1 DW_AT_byte_size\n", + __func__); + uval = 0; + } tdp->t_size = uval; if ((mem = die_child(dw, die)) != NULL) { @@ -873,7 +886,7 @@ static void die_sou_create(dwarf_t *dw, Dwarf_Die str, Dwarf_Off off, tdesc_t *tdp, int type, const char *typename) { - Dwarf_Unsigned sz, bitsz, bitoff; + Dwarf_Unsigned sz, bitsz, bitoff, maxsz=0; Dwarf_Die mem; mlist_t *ml, **mlastp; iidesc_t *ii; @@ -929,6 +942,8 @@ die_sou_create(dwarf_t *dw, Dwarf_Die str, Dwarf_Off off, tdesc_t *tdp, ml->ml_name = NULL; ml->ml_type = die_lookup_pass1(dw, mem, DW_AT_type); + debug(3, "die_sou_create(): ml_type = %p t_id = %d\n", + ml->ml_type, ml->ml_type->t_id); if (die_mem_offset(dw, mem, DW_AT_data_member_location, &mloff, 0)) { @@ -956,8 +971,24 @@ die_sou_create(dwarf_t *dw, Dwarf_Die str, Dwarf_Off off, tdesc_t *tdp, *mlastp = ml; mlastp = &ml->ml_next; + + /* Find the size of the largest member to work around a gcc + * bug. See GCC Bugzilla 35998. + */ + if (maxsz < ml->ml_size) + maxsz = ml->ml_size; + } while ((mem = die_sibling(dw, mem)) != NULL); + /* See if we got a bogus DW_AT_byte_size. GCC will sometimes + * emit this. + */ + if (sz == (unsigned)-1) { + printf("dwarf.c:%s() working around bogus -1 DW_AT_byte_size\n", + __func__); + tdp->t_size = maxsz / 8; /* maxsz is in bits, t_size is bytes */ + } + /* * GCC will attempt to eliminate unused types, thus decreasing the * size of the emitted dwarf. That is, if you declare a foo_t in your @@ -1054,7 +1085,7 @@ die_sou_resolve(tdesc_t *tdp, tdesc_t **tdpp __unused, void *private) } if (ml->ml_size != 0 && mt->t_type == INTRINSIC && - mt->t_intr->intr_nbits != ml->ml_size) { + mt->t_intr->intr_nbits != (int)ml->ml_size) { /* * This member is a bitfield, and needs to reference * an intrinsic type with the same width. If the @@ -1370,6 +1401,13 @@ die_base_create(dwarf_t *dw, Dwarf_Die base, Dwarf_Off off, tdesc_t *tdp) */ (void) die_unsigned(dw, base, DW_AT_byte_size, &sz, DW_ATTR_REQ); + /* Check for bogus gcc DW_AT_byte_size attribute */ + if (sz == (unsigned)-1) { + printf("dwarf.c:%s() working around bogus -1 DW_AT_byte_size\n", + __func__); + sz = 0; + } + if (tdp->t_name == NULL) terminate("die %llu: base type without name\n", off); diff --git a/cddl/contrib/opensolaris/tools/ctf/cvt/st_parse.c b/cddl/contrib/opensolaris/tools/ctf/cvt/st_parse.c index 21a0149861be..e136c94ab9b0 100644 --- a/cddl/contrib/opensolaris/tools/ctf/cvt/st_parse.c +++ b/cddl/contrib/opensolaris/tools/ctf/cvt/st_parse.c @@ -952,7 +952,7 @@ soudef(char *cp, stabtype_t type, tdesc_t **rtdp) itdp = find_intrinsic(tdp); if (itdp->t_type == INTRINSIC) { - if (mlp->ml_size != itdp->t_intr->intr_nbits) { + if ((int)mlp->ml_size != itdp->t_intr->intr_nbits) { parse_debug(4, cp, "making %d bit intrinsic " "from %s", mlp->ml_size, tdesc_name(itdp)); mlp->ml_type = bitintrinsic(itdp, mlp->ml_size); @@ -1173,7 +1173,7 @@ resolve_typed_bitfields_cb(void *arg, void *private __unused) while (tdp) { switch (tdp->t_type) { case INTRINSIC: - if (ml->ml_size != tdp->t_intr->intr_nbits) { + if ((int)ml->ml_size != tdp->t_intr->intr_nbits) { debug(3, "making %d bit intrinsic from %s", ml->ml_size, tdesc_name(tdp)); ml->ml_type = bitintrinsic(tdp, ml->ml_size); diff --git a/contrib/apr-util/CHANGES b/contrib/apr-util/CHANGES index 986635359990..67eefbdd961e 100644 --- a/contrib/apr-util/CHANGES +++ b/contrib/apr-util/CHANGES @@ -1,45 +1,100 @@ -*- coding: utf-8 -*- -Changes with APR-Util 1.4.1 +Changes with APR-util 1.5.2 - *) Apply Windows build fixes for the apr_crypto API. [Mladen Turk] + *) Windows: Add command line makefiles. [Gregg Smith] -Changes with APR-util 1.4.0 + *) apr_uri_parse(): Do not accept invalid characters in the scheme. + Per RFC 3986 3.3, enforce that the first segment of a relative path does + not contain a colon. PR 52479. [Stefan Fritsch] - *) apr_ldap_init: Pass secure=1 to ldapssl_init() with Solaris LDAP SDK. - PR: 42682 [Stefan Fritsch] + *) Fix memory leak in hook sorting function. PR 51256. + [<horowity checkpoint com>] - *) apr_memcache_server_create: Fix possible segfault. PR 51064. - [Michajlo Matijkiw <michajlo_matijkiw comcast com>] + *) Speedup md5 calculation by avoiding some copying on little endian + architectures. PR 49011. [Stefan Fritsch, Stefan Fuhrmann + <stefanfuhrmann alice-dsl de>] - *) apr_thread_pool: Fix thread unsafe pool usage. [Stefan Fritsch] + *) Use heap memory for crypt in apr_password_validate(), to reduce stack + usage. PR 54572. [Stefan Fritsch] - *) Do not include apr.h and apr_errno.h from system search path in - apu_errno.h. PR 46487 [Rainer Jung] + *) Fix password validation failure for all crypt and crypt_r based + algorithms. PR 54603. [Harvey Eneman <harvey.eneman oracle.com>] - *) Add optional dbm, openssl and nss subpackages to the RPM spec file. - [Graham Leggett] + *) Fix syntax error in crypto/apr_passwd.c on non-glibc systems. PR 54275. + [Stefan Fritsch] - *) apr_dbd_freetds: The sybdb.h header file might be freetds/sybdb.h - or sybdb.h. [Graham Leggett] + *) Fix potential data corruption in apr_brigade_write() and friends if + the last bucket of the brigade is a heap bucket that has been split, + and there are still references to the next part of the original bucket + in use. [Stefan Fritsch] - *) Add apr_crypto implementations for OpenSSL and Mozilla NSS. Add a unit - test to verify the interoperability of the two modules. Builds default - to disabled unless explicitly enabled. - [Graham Leggett] + *) Remove duplicated logic in apr_brigade_puts(). PR 53740. [Christophe + Jaillet <christophe jaillet wanadoo fr>] - *) Add the apr_crypto interface, a rewrite of the earlier apr_ssl code, - based on the modular dso interface used for dbd and ldap. Initially, - the interface supports symmetrical encryption and decryption. The - purpose of the interface is to offer portable and interoperable - access to basic crypto using the native crypto libraries present on - each platform. [Graham Leggett] + *) apr_crypto: If --with-crypto is passed to configure but no crypto + libraries are enabled, autodetect available libraries. [Jeff Trawick] - *) Add trace probes to hooks, making it easier to inspect APR Hook based - applications with DTrace or other such mechanisms. - [Theo Schlossnagle <jesus omniti.com>, generalized by Jeff Trawick] + *) memcache: Fix dead server retry logic. [Gavin Shelley <columbusmonkey me.com>] - *) Implement resource list when threads are unavailable. PR 24325 - [Bojan Smojver] +Changes with APR-util 1.5.1 + + *) testmemcache: Fix crash. PR 52705. [Peter Poeml <peter poeml de>] + + *) MinGW: Support shared builds of apr-util when apr is shared. + PR 46175. [Carlo Bramini <carlo.bramix libero.it>, Jeff Trawick] + + *) Add support for Berkeley DB 5.2 and 5.3. Simplify detection script. + PR 53684. [Rainer Jung] + + *) configure: Allow to specify library specific custom linker flags + via the LDADD_XXX variables. [Rainer Jung] + + *) apr_password_validate(): Fix intermittent errors on systems + such as FreeBSD where the crypt() function is used. + (Broken only in 1.5.0) [Jeff Trawick] + + *) Improve platform detection for bundled expat by updating + config.guess and config.sub. [Rainer Jung] + +Changes with APR-util 1.5.0 + + *) dbd_pgsql_escape: Use PQescapeStringConn. [Nick Kew] + + *) apr_password_validate, apr_bcrypt_encode: Add support for bcrypt encoded + passwords. The bcrypt implementation uses code from crypt_blowfish + written by Solar Designer <solar openwall com>. apr_bcrypt_encode creates + hashes with "$2y$" prefix, but apr_password_validate also accepts the old + prefix "$2a$". PR 49288. [Stefan Fritsch] + + *) APR dbd: Allow to use apr_dbd_get_row() with a different pool than + apr_dbd_select(). PR 53533. [<arthur echo gmail com>] + + *) APR dbd FreeTDS support: Fix spurious API errors caused by uninitialized + fields. [TROY.LIU 劉春偉 <TROY.LIU deltaww.com.cn>] + + *) apr_password_validate: Increase maximum hash string length to allow + more than 9999 rounds with sha512-crypt. PR 53410. [Stefan Fritsch] + + *) Fix segfaults in crypt() and crypt_r() failure modes. + PR 47272. [Arkadiusz Miskiewicz <arekm pld-linux.org>] + + *) apr_crypto: Ensure that the if/else that governs the static + initialisation of each crypto driver works when the first driver + isn't in use. [Graham Leggett] + + *) apr_crypto: Ensure the *driver variable is initialised when a statically + compiled library is initialised for the first time. [Graham Leggett] + + *) apr_crypto: Ensure the *driver variable is initialised when the library + has already been loaded. Fix ported from apr_dbd. [Graham Leggett] + + *) apr_crypto: Move the static initialisation of DRIVER_LOAD from + apr_crypto_init() to apr_crypto_get_driver(), so that we don't lose + the parameters. [Graham Leggett] + +Changes with APR-util 1.4.x and later: + + *) http://svn.apache.org/viewvc/apr/apr-util/branches/1.4.x/CHANGES?view=markup Changes for APR-util 1.3.x and later: diff --git a/contrib/apr-util/Makefile.win b/contrib/apr-util/Makefile.win index 7ea348f177f6..b4b420e1c2e6 100644 --- a/contrib/apr-util/Makefile.win +++ b/contrib/apr-util/Makefile.win @@ -7,7 +7,7 @@ # install - compile everything # clean - mop up everything # -# You can override the build mechansim, choose only one; +# You can override the build mechanism, choose only one; # # USEMAK=1 - compile from exported make files # USEDSW=1 - compile from .dsw / .dsp VC6 projects diff --git a/contrib/apr-util/NWGNUmakefile b/contrib/apr-util/NWGNUmakefile index 42a4212dec95..e089b6fc7f36 100644 --- a/contrib/apr-util/NWGNUmakefile +++ b/contrib/apr-util/NWGNUmakefile @@ -259,6 +259,7 @@ FILES_lib_objs = \ $(OBJDIR)/apr_md4.o \ $(OBJDIR)/apr_md5.o \ $(OBJDIR)/apr_memcache.o \ + $(OBJDIR)/apr_passwd.o \ $(OBJDIR)/apr_queue.o \ $(OBJDIR)/apr_reslist.o \ $(OBJDIR)/apr_rmm.o \ @@ -269,6 +270,7 @@ FILES_lib_objs = \ $(OBJDIR)/apr_strmatch.o \ $(OBJDIR)/apr_thread_pool.o \ $(OBJDIR)/apr_uri.o \ + $(OBJDIR)/crypt_blowfish.o \ $(OBJDIR)/sdbm.o \ $(OBJDIR)/sdbm_hash.o \ $(OBJDIR)/sdbm_lock.o \ diff --git a/contrib/apr-util/apr-util.spec b/contrib/apr-util/apr-util.spec index dea088770b3b..36249ff9ee83 100644 --- a/contrib/apr-util/apr-util.spec +++ b/contrib/apr-util/apr-util.spec @@ -3,7 +3,7 @@ Summary: Apache Portable Runtime Utility library Name: apr-util -Version: 1.4.1 +Version: 1.5.2 Release: 1 License: Apache Software License Group: System Environment/Libraries diff --git a/contrib/apr-util/aprutil.dsp b/contrib/apr-util/aprutil.dsp deleted file mode 100644 index 277d4846e75a..000000000000 --- a/contrib/apr-util/aprutil.dsp +++ /dev/null @@ -1,794 +0,0 @@ -# Microsoft Developer Studio Project File - Name="aprutil" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=aprutil - Win32 Release -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "aprutil.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "aprutil.mak" CFG="aprutil - Win32 Release" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "aprutil - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "aprutil - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE "aprutil - x64 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "aprutil - x64 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "aprutil - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "LibR" -# PROP BASE Intermediate_Dir "LibR" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "LibR" -# PROP Intermediate_Dir "LibR" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /O2 /Oy- /Zi /I "./include" /I "../apr/include" /I "./include/private" /I "../apr-iconv/include" /I "./dbm/sdbm" /I "./xml/expat/lib" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "APU_DECLARE_STATIC" /D "API_DECLARE_STATIC" /D "APU_USE_SDBM" /D "HAVE_SQL_H" /D "XML_STATIC" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\aprutil-1" /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"LibR\aprutil-1.lib" - -!ELSEIF "$(CFG)" == "aprutil - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "LibD" -# PROP BASE Intermediate_Dir "LibD" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "LibD" -# PROP Intermediate_Dir "LibD" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /EHsc /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "./include" /I "../apr/include" /I "./include/private" /I "../apr-iconv/include" /I "./dbm/sdbm" /I "./xml/expat/lib" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "APU_DECLARE_STATIC" /D "API_DECLARE_STATIC" /D "APU_USE_SDBM" /D "HAVE_SQL_H" /D "XML_STATIC" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\aprutil-1" /FD /c -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"LibD\aprutil-1.lib" - -!ELSEIF "$(CFG)" == "aprutil - x64 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "x64\LibR" -# PROP BASE Intermediate_Dir "x64\LibR" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "x64\LibR" -# PROP Intermediate_Dir "x64\LibR" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "../apr/include" /I "./include/private" /I "../apr-iconv/include" /I "./dbm/sdbm" /I "./xml/expat/lib" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "APU_DECLARE_STATIC" /D "API_DECLARE_STATIC" /D "APU_USE_SDBM" /D "HAVE_SQL_H" /D "XML_STATIC" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\aprutil-1" /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"x64\LibR\aprutil-1.lib" - -!ELSEIF "$(CFG)" == "aprutil - x64 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "x64\LibD" -# PROP BASE Intermediate_Dir "x64\LibD" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "x64\LibD" -# PROP Intermediate_Dir "x64\LibD" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "../apr/include" /I "./include/private" /I "../apr-iconv/include" /I "./dbm/sdbm" /I "./xml/expat/lib" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "APU_DECLARE_STATIC" /D "API_DECLARE_STATIC" /D "APU_USE_SDBM" /D "HAVE_SQL_H" /D "XML_STATIC" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\aprutil-1" /FD /EHsc /c -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"x64\LibD\aprutil-1.lib" - -!ENDIF - -# Begin Target - -# Name "aprutil - Win32 Release" -# Name "aprutil - Win32 Debug" -# Name "aprutil - x64 Release" -# Name "aprutil - x64 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "" -# Begin Group "buckets" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\buckets\apr_brigade.c -# End Source File -# Begin Source File - -SOURCE=.\buckets\apr_buckets.c -# End Source File -# Begin Source File - -SOURCE=.\buckets\apr_buckets_alloc.c -# End Source File -# Begin Source File - -SOURCE=.\buckets\apr_buckets_eos.c -# End Source File -# Begin Source File - -SOURCE=.\buckets\apr_buckets_file.c -# End Source File -# Begin Source File - -SOURCE=.\buckets\apr_buckets_flush.c -# End Source File -# Begin Source File - -SOURCE=.\buckets\apr_buckets_heap.c -# End Source File -# Begin Source File - -SOURCE=.\buckets\apr_buckets_mmap.c -# End Source File -# Begin Source File - -SOURCE=.\buckets\apr_buckets_pipe.c -# End Source File -# Begin Source File - -SOURCE=.\buckets\apr_buckets_pool.c -# End Source File -# Begin Source File - -SOURCE=.\buckets\apr_buckets_refcount.c -# End Source File -# Begin Source File - -SOURCE=.\buckets\apr_buckets_simple.c -# End Source File -# Begin Source File - -SOURCE=.\buckets\apr_buckets_socket.c -# End Source File -# End Group -# Begin Group "crypto" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\crypto\apr_crypto.c -# End Source File -# Begin Source File - -SOURCE=.\crypto\apr_md4.c -# End Source File -# Begin Source File - -SOURCE=.\crypto\apr_md5.c -# End Source File -# Begin Source File - -SOURCE=.\crypto\apr_sha1.c -# End Source File -# Begin Source File - -SOURCE=.\crypto\getuuid.c -# End Source File -# Begin Source File - -SOURCE=.\crypto\uuid.c -# End Source File -# End Group -# Begin Group "dbd" -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\dbd\apr_dbd.c -# End Source File -# Begin Source File - -SOURCE=.\dbd\apr_dbd_freetds.c -# End Source File -# Begin Source File - -SOURCE=.\dbd\apr_dbd_mysql.c -# End Source File -# Begin Source File - -SOURCE=.\dbd\apr_dbd_odbc.c -# End Source File -# Begin Source File - -SOURCE=.\dbd\apr_dbd_oracle.c -# End Source File -# Begin Source File - -SOURCE=.\dbd\apr_dbd_pgsql.c -# End Source File -# Begin Source File - -SOURCE=.\dbd\apr_dbd_sqlite2.c -# End Source File -# Begin Source File - -SOURCE=.\dbd\apr_dbd_sqlite3.c -# End Source File -# End Group -# Begin Group "dbm" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\dbm\apr_dbm.c -# End Source File -# Begin Source File - -SOURCE=.\dbm\apr_dbm_berkeleydb.c -# End Source File -# Begin Source File - -SOURCE=.\dbm\apr_dbm_gdbm.c -# End Source File -# Begin Source File - -SOURCE=.\dbm\apr_dbm_sdbm.c -# End Source File -# End Group -# Begin Group "encoding" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\encoding\apr_base64.c -# End Source File -# End Group -# Begin Group "hooks" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\hooks\apr_hooks.c -# End Source File -# End Group -# Begin Group "ldap" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\ldap\apr_ldap_init.c -# End Source File -# Begin Source File - -SOURCE=.\ldap\apr_ldap_option.c -# End Source File -# Begin Source File - -SOURCE=.\ldap\apr_ldap_rebind.c -# End Source File -# Begin Source File - -SOURCE=.\ldap\apr_ldap_stub.c -# End Source File -# Begin Source File - -SOURCE=.\ldap\apr_ldap_url.c -# End Source File -# End Group -# Begin Group "memcache" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\memcache\apr_memcache.c -# End Source File -# End Group -# Begin Group "misc" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\misc\apr_date.c -# End Source File -# Begin Source File - -SOURCE=.\misc\apu_dso.c -# End Source File -# Begin Source File - -SOURCE=.\misc\apr_queue.c -# End Source File -# Begin Source File - -SOURCE=.\misc\apr_reslist.c -# End Source File -# Begin Source File - -SOURCE=.\misc\apr_rmm.c -# End Source File -# Begin Source File - -SOURCE=.\misc\apr_thread_pool.c -# End Source File -# Begin Source File - -SOURCE=.\misc\apu_version.c -# End Source File -# End Group -# Begin Group "sdbm" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\dbm\sdbm\sdbm.c -# End Source File -# Begin Source File - -SOURCE=.\dbm\sdbm\sdbm_hash.c -# End Source File -# Begin Source File - -SOURCE=.\dbm\sdbm\sdbm_lock.c -# End Source File -# Begin Source File - -SOURCE=.\dbm\sdbm\sdbm_pair.c -# End Source File -# Begin Source File - -SOURCE=.\dbm\sdbm\sdbm_pair.h -# End Source File -# Begin Source File - -SOURCE=.\dbm\sdbm\sdbm_private.h -# End Source File -# Begin Source File - -SOURCE=.\dbm\sdbm\sdbm_tune.h -# End Source File -# End Group -# Begin Group "strmatch" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\strmatch\apr_strmatch.c -# End Source File -# End Group -# Begin Group "uri" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\uri\apr_uri.c -# End Source File -# End Group -# Begin Group "xlate" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\xlate\xlate.c -# End Source File -# End Group -# Begin Group "xml" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\xml\apr_xml.c -# End Source File -# End Group -# End Group -# Begin Group "Generated Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\include\apr_ldap.h.in -# End Source File -# Begin Source File - -SOURCE=.\include\apr_ldap.hnw -# End Source File -# Begin Source File - -SOURCE=.\include\apr_ldap.hw - -!IF "$(CFG)" == "aprutil - Win32 Release" - -# Begin Custom Build - Creating apr_ldap.h from apr_ldap.hw -InputPath=.\include\apr_ldap.hw - -".\include\apr_ldap.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apr_ldap.hw > .\include\apr_ldap.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "aprutil - Win32 Debug" - -# Begin Custom Build - Creating apr_ldap.h from apr_ldap.hw -InputPath=.\include\apr_ldap.hw - -".\include\apr_ldap.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apr_ldap.hw > .\include\apr_ldap.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "aprutil - x64 Release" - -# Begin Custom Build - Creating apr_ldap.h from apr_ldap.hw -InputPath=.\include\apr_ldap.hw - -".\include\apr_ldap.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apr_ldap.hw > .\include\apr_ldap.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "aprutil - x64 Debug" - -# Begin Custom Build - Creating apr_ldap.h from apr_ldap.hw -InputPath=.\include\apr_ldap.hw - -".\include\apr_ldap.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apr_ldap.hw > .\include\apr_ldap.h - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\include\apu.h.in -# End Source File -# Begin Source File - -SOURCE=.\include\apu.hnw -# End Source File -# Begin Source File - -SOURCE=.\include\apu.hw - -!IF "$(CFG)" == "aprutil - Win32 Release" - -# Begin Custom Build - Creating apu.h from apu.hw -InputPath=.\include\apu.hw - -".\include\apu.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apu.hw > .\include\apu.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "aprutil - Win32 Debug" - -# Begin Custom Build - Creating apu.h from apu.hw -InputPath=.\include\apu.hw - -".\include\apu.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apu.hw > .\include\apu.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "aprutil - x64 Release" - -# Begin Custom Build - Creating apu.h from apu.hw -InputPath=.\include\apu.hw - -".\include\apu.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apu.hw > .\include\apu.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "aprutil - x64 Debug" - -# Begin Custom Build - Creating apu.h from apu.hw -InputPath=.\include\apu.hw - -".\include\apu.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apu.hw > .\include\apu.h - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\include\private\apu_config.h.in -# End Source File -# Begin Source File - -SOURCE=.\include\private\apu_config.hw - -!IF "$(CFG)" == "aprutil - Win32 Release" - -# Begin Custom Build - Creating apu_config.h from apu_config.hw -InputPath=.\include\private\apu_config.hw - -".\include\private\apu_config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\private\apu_config.hw > .\include\private\apu_config.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "aprutil - Win32 Debug" - -# Begin Custom Build - Creating apu_config.h from apu_config.hw -InputPath=.\include\private\apu_config.hw - -".\include\private\apu_config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\private\apu_config.hw > .\include\private\apu_config.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "aprutil - x64 Release" - -# Begin Custom Build - Creating apu_config.h from apu_config.hw -InputPath=.\include\private\apu_config.hw - -".\include\private\apu_config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\private\apu_config.hw > .\include\private\apu_config.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "aprutil - x64 Debug" - -# Begin Custom Build - Creating apu_config.h from apu_config.hw -InputPath=.\include\private\apu_config.hw - -".\include\private\apu_config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\private\apu_config.hw > .\include\private\apu_config.h - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\include\private\apu_select_dbm.h.in -# End Source File -# Begin Source File - -SOURCE=.\include\private\apu_select_dbm.hw - -!IF "$(CFG)" == "aprutil - Win32 Release" - -# Begin Custom Build - Creating apu_select_dbm.h from apu_select_dbm.hw -InputPath=.\include\private\apu_select_dbm.hw - -".\include\private\apu_select_dbm.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\private\apu_select_dbm.hw > .\include\private\apu_select_dbm.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "aprutil - Win32 Debug" - -# Begin Custom Build - Creating apu_select_dbm.h from apu_select_dbm.hw -InputPath=.\include\private\apu_select_dbm.hw - -".\include\private\apu_select_dbm.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\private\apu_select_dbm.hw > .\include\private\apu_select_dbm.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "aprutil - x64 Release" - -# Begin Custom Build - Creating apu_select_dbm.h from apu_select_dbm.hw -InputPath=.\include\private\apu_select_dbm.hw - -".\include\private\apu_select_dbm.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\private\apu_select_dbm.hw > .\include\private\apu_select_dbm.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "aprutil - x64 Debug" - -# Begin Custom Build - Creating apu_select_dbm.h from apu_select_dbm.hw -InputPath=.\include\private\apu_select_dbm.hw - -".\include\private\apu_select_dbm.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\private\apu_select_dbm.hw > .\include\private\apu_select_dbm.h - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\include\apu_want.h.in -# End Source File -# Begin Source File - -SOURCE=.\include\apu_want.hnw -# End Source File -# Begin Source File - -SOURCE=.\include\apu_want.hw - -!IF "$(CFG)" == "aprutil - Win32 Release" - -# Begin Custom Build - Creating apu_want.h from apu_want.hw -InputPath=.\include\apu_want.hw - -".\include\apu_want.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apu_want.hw > .\include\apu_want.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "aprutil - Win32 Debug" - -# Begin Custom Build - Creating apu_want.h from apu_want.hw -InputPath=.\include\apu_want.hw - -".\include\apu_want.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apu_want.hw > .\include\apu_want.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "aprutil - x64 Release" - -# Begin Custom Build - Creating apu_want.h from apu_want.hw -InputPath=.\include\apu_want.hw - -".\include\apu_want.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apu_want.hw > .\include\apu_want.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "aprutil - x64 Debug" - -# Begin Custom Build - Creating apu_want.h from apu_want.hw -InputPath=.\include\apu_want.hw - -".\include\apu_want.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apu_want.hw > .\include\apu_want.h - -# End Custom Build - -!ENDIF - -# End Source File -# End Group -# Begin Group "Public Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\include\apr_anylock.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_base64.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_buckets.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_date.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_dbm.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_hooks.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_ldap_url.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_md4.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_md5.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_memcache.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_optional.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_optional_hooks.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_queue.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_reslist.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_rmm.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_sdbm.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_sha1.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_strmatch.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_thread_pool.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_uri.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_uuid.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_xlate.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_xml.h -# End Source File -# Begin Source File - -SOURCE=.\include\apu_version.h -# End Source File -# End Group -# End Target -# End Project diff --git a/contrib/apr-util/buckets/apr_brigade.c b/contrib/apr-util/buckets/apr_brigade.c index 3fd7e46f8b40..1f2ba1729963 100644 --- a/contrib/apr-util/buckets/apr_brigade.c +++ b/contrib/apr-util/buckets/apr_brigade.c @@ -391,17 +391,30 @@ APU_DECLARE(apr_status_t) apr_brigade_vputstrs(apr_bucket_brigade *b, void *ctx, va_list va) { +#define MAX_VECS 8 + struct iovec vec[MAX_VECS]; + apr_size_t i = 0; + for (;;) { - const char *str = va_arg(va, const char *); + char *str = va_arg(va, char *); apr_status_t rv; if (str == NULL) break; - rv = apr_brigade_write(b, flush, ctx, str, strlen(str)); - if (rv != APR_SUCCESS) - return rv; + vec[i].iov_base = str; + vec[i].iov_len = strlen(str); + i++; + + if (i == MAX_VECS) { + rv = apr_brigade_writev(b, flush, ctx, vec, i); + if (rv != APR_SUCCESS) + return rv; + i = 0; + } } + if (i != 0) + return apr_brigade_writev(b, flush, ctx, vec, i); return APR_SUCCESS; } @@ -422,7 +435,12 @@ APU_DECLARE(apr_status_t) apr_brigade_write(apr_bucket_brigade *b, apr_size_t remaining = APR_BUCKET_BUFF_SIZE; char *buf = NULL; - if (!APR_BRIGADE_EMPTY(b) && APR_BUCKET_IS_HEAP(e)) { + /* + * If the last bucket is a heap bucket and its buffer is not shared with + * another bucket, we may write into that bucket. + */ + if (!APR_BRIGADE_EMPTY(b) && APR_BUCKET_IS_HEAP(e) + && ((apr_bucket_heap *)(e->data))->refcount.refcount == 1) { apr_bucket_heap *h = e->data; /* HEAP bucket start offsets are always in-memory, safe to cast */ @@ -512,10 +530,11 @@ APU_DECLARE(apr_status_t) apr_brigade_writev(apr_bucket_brigade *b, i = 0; /* If there is a heap bucket at the end of the brigade - * already, copy into the existing bucket. + * already, and its refcount is 1, copy into the existing bucket. */ e = APR_BRIGADE_LAST(b); - if (!APR_BRIGADE_EMPTY(b) && APR_BUCKET_IS_HEAP(e)) { + if (!APR_BRIGADE_EMPTY(b) && APR_BUCKET_IS_HEAP(e) + && ((apr_bucket_heap *)(e->data))->refcount.refcount == 1) { apr_bucket_heap *h = e->data; apr_size_t remaining = h->alloc_len - (e->length + (apr_size_t)e->start); @@ -591,29 +610,7 @@ APU_DECLARE(apr_status_t) apr_brigade_puts(apr_bucket_brigade *bb, apr_brigade_flush flush, void *ctx, const char *str) { - apr_size_t len = strlen(str); - apr_bucket *bkt = APR_BRIGADE_LAST(bb); - if (!APR_BRIGADE_EMPTY(bb) && APR_BUCKET_IS_HEAP(bkt)) { - /* If there is enough space available in a heap bucket - * at the end of the brigade, copy the string directly - * into the heap bucket - */ - apr_bucket_heap *h = bkt->data; - apr_size_t bytes_avail = h->alloc_len - bkt->length; - - if (bytes_avail >= len) { - char *buf = h->base + bkt->start + bkt->length; - memcpy(buf, str, len); - bkt->length += len; - return APR_SUCCESS; - } - } - - /* If the string could not be copied into an existing heap - * bucket, delegate the work to apr_brigade_write(), which - * knows how to grow the brigade - */ - return apr_brigade_write(bb, flush, ctx, str, len); + return apr_brigade_write(bb, flush, ctx, str, strlen(str)); } APU_DECLARE_NONSTD(apr_status_t) apr_brigade_putstrs(apr_bucket_brigade *b, diff --git a/contrib/apr-util/buckets/apr_buckets_alloc.c b/contrib/apr-util/buckets/apr_buckets_alloc.c index 60f42deaeadb..15baa3396655 100644 --- a/contrib/apr-util/buckets/apr_buckets_alloc.c +++ b/contrib/apr-util/buckets/apr_buckets_alloc.c @@ -65,12 +65,20 @@ APU_DECLARE_NONSTD(apr_bucket_alloc_t *) apr_bucket_alloc_create(apr_pool_t *p) /* may be NULL for debug mode. */ if (allocator == NULL) { if (apr_allocator_create(&allocator) != APR_SUCCESS) { + apr_abortfunc_t fn = apr_pool_abort_get(p); + if (fn) + (fn)(APR_ENOMEM); abort(); } } #endif - list = apr_bucket_alloc_create_ex(allocator); + if (list == NULL) { + apr_abortfunc_t fn = apr_pool_abort_get(p); + if (fn) + (fn)(APR_ENOMEM); + abort(); + } list->pool = p; apr_pool_cleanup_register(list->pool, list, alloc_cleanup, apr_pool_cleanup_null); @@ -131,6 +139,7 @@ APU_DECLARE_NONSTD(void *) apr_bucket_alloc(apr_size_t size, if (endp >= active->endp) { list->blocks = apr_allocator_alloc(list->allocator, ALLOC_AMT); if (!list->blocks) { + list->blocks = active; return NULL; } list->blocks->next = active; diff --git a/contrib/apr-util/build-outputs.mk b/contrib/apr-util/build-outputs.mk index b906794f5656..b624532ebd2b 100644 --- a/contrib/apr-util/build-outputs.mk +++ b/contrib/apr-util/build-outputs.mk @@ -15,8 +15,10 @@ buckets/apr_buckets_simple.lo: buckets/apr_buckets_simple.c .make.dirs include/a buckets/apr_buckets_socket.lo: buckets/apr_buckets_socket.c .make.dirs include/apr_buckets.h crypto/apr_crypto.lo: crypto/apr_crypto.c .make.dirs include/apr_crypto.h include/apu_errno.h include/apu_version.h include/private/apr_crypto_internal.h include/private/apu_internal.h crypto/apr_md4.lo: crypto/apr_md4.c .make.dirs include/apr_md4.h include/apr_xlate.h -crypto/apr_md5.lo: crypto/apr_md5.c .make.dirs include/apr_md5.h include/apr_sha1.h include/apr_xlate.h +crypto/apr_md5.lo: crypto/apr_md5.c .make.dirs include/apr_md5.h include/apr_xlate.h +crypto/apr_passwd.lo: crypto/apr_passwd.c .make.dirs include/apr_md5.h include/apr_sha1.h include/apr_xlate.h crypto/apr_sha1.lo: crypto/apr_sha1.c .make.dirs include/apr_base64.h include/apr_sha1.h include/apr_xlate.h +crypto/crypt_blowfish.lo: crypto/crypt_blowfish.c .make.dirs crypto/getuuid.lo: crypto/getuuid.c .make.dirs include/apr_md5.h include/apr_uuid.h include/apr_xlate.h crypto/uuid.lo: crypto/uuid.c .make.dirs include/apr_uuid.h dbd/apr_dbd.lo: dbd/apr_dbd.c .make.dirs include/apr_dbd.h include/apu_version.h include/private/apr_dbd_internal.h include/private/apu_internal.h @@ -43,7 +45,7 @@ uri/apr_uri.lo: uri/apr_uri.c .make.dirs include/apr_uri.h xlate/xlate.lo: xlate/xlate.c .make.dirs include/apr_xlate.h xml/apr_xml.lo: xml/apr_xml.c .make.dirs include/apr_xlate.h include/apr_xml.h -OBJECTS_all = buckets/apr_brigade.lo buckets/apr_buckets.lo buckets/apr_buckets_alloc.lo buckets/apr_buckets_eos.lo buckets/apr_buckets_file.lo buckets/apr_buckets_flush.lo buckets/apr_buckets_heap.lo buckets/apr_buckets_mmap.lo buckets/apr_buckets_pipe.lo buckets/apr_buckets_pool.lo buckets/apr_buckets_refcount.lo buckets/apr_buckets_simple.lo buckets/apr_buckets_socket.lo crypto/apr_crypto.lo crypto/apr_md4.lo crypto/apr_md5.lo crypto/apr_sha1.lo crypto/getuuid.lo crypto/uuid.lo dbd/apr_dbd.lo dbm/apr_dbm.lo dbm/apr_dbm_sdbm.lo dbm/sdbm/sdbm.lo dbm/sdbm/sdbm_hash.lo dbm/sdbm/sdbm_lock.lo dbm/sdbm/sdbm_pair.lo encoding/apr_base64.lo hooks/apr_hooks.lo ldap/apr_ldap_stub.lo ldap/apr_ldap_url.lo memcache/apr_memcache.lo misc/apr_date.lo misc/apr_queue.lo misc/apr_reslist.lo misc/apr_rmm.lo misc/apr_thread_pool.lo misc/apu_dso.lo misc/apu_version.lo strmatch/apr_strmatch.lo uri/apr_uri.lo xlate/xlate.lo xml/apr_xml.lo +OBJECTS_all = buckets/apr_brigade.lo buckets/apr_buckets.lo buckets/apr_buckets_alloc.lo buckets/apr_buckets_eos.lo buckets/apr_buckets_file.lo buckets/apr_buckets_flush.lo buckets/apr_buckets_heap.lo buckets/apr_buckets_mmap.lo buckets/apr_buckets_pipe.lo buckets/apr_buckets_pool.lo buckets/apr_buckets_refcount.lo buckets/apr_buckets_simple.lo buckets/apr_buckets_socket.lo crypto/apr_crypto.lo crypto/apr_md4.lo crypto/apr_md5.lo crypto/apr_passwd.lo crypto/apr_sha1.lo crypto/crypt_blowfish.lo crypto/getuuid.lo crypto/uuid.lo dbd/apr_dbd.lo dbm/apr_dbm.lo dbm/apr_dbm_sdbm.lo dbm/sdbm/sdbm.lo dbm/sdbm/sdbm_hash.lo dbm/sdbm/sdbm_lock.lo dbm/sdbm/sdbm_pair.lo encoding/apr_base64.lo hooks/apr_hooks.lo ldap/apr_ldap_stub.lo ldap/apr_ldap_url.lo memcache/apr_memcache.lo misc/apr_date.lo misc/apr_queue.lo misc/apr_reslist.lo misc/apr_rmm.lo misc/apr_thread_pool.lo misc/apu_dso.lo misc/apu_version.lo strmatch/apr_strmatch.lo uri/apr_uri.lo xlate/xlate.lo xml/apr_xml.lo OBJECTS_unix = $(OBJECTS_all) diff --git a/contrib/apr-util/build.conf b/contrib/apr-util/build.conf index 98696bd9cb50..d34d004fe33a 100644 --- a/contrib/apr-util/build.conf +++ b/contrib/apr-util/build.conf @@ -10,9 +10,11 @@ paths = crypto/apr_crypto.c crypto/apr_md4.c crypto/apr_md5.c + crypto/apr_passwd.c crypto/apr_sha1.c crypto/getuuid.c crypto/uuid.c + crypto/crypt_blowfish.c dbm/apr_dbm_sdbm.c dbm/apr_dbm.c dbm/sdbm/*.c diff --git a/contrib/apr-util/configure b/contrib/apr-util/configure index 9329716cdb61..6d614e91978e 100755 --- a/contrib/apr-util/configure +++ b/contrib/apr-util/configure @@ -1,11 +1,9 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68. +# Generated by GNU Autoconf 2.69. # # -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software -# Foundation, Inc. +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation @@ -134,6 +132,31 @@ export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh @@ -167,7 +190,8 @@ if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi -test x\$exitcode = x0 || exit 1" +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && @@ -212,21 +236,25 @@ IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : - # We cannot yet assume a decent shell, so we have to provide a - # neutralization value for shells without unset; and this also - # works around shells that cannot unset nonexistent variables. - # Preserve -v and -x to the replacement shell. - BASH_ENV=/dev/null - ENV=/dev/null - (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV - export CONFIG_SHELL - case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; - esac - exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 fi if test x$as_have_required = xno; then : @@ -328,6 +356,14 @@ $as_echo X"$as_dir" | } # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take @@ -449,6 +485,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). @@ -483,16 +523,16 @@ if (echo >conf$$.file) 2>/dev/null; then # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -504,28 +544,8 @@ else as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -1245,8 +1265,6 @@ target=$target_alias if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used" >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi @@ -1422,7 +1440,8 @@ Optional Packages: --with-ldap-lib=path path to ldap lib file --with-ldap=library ldap library to use --with-dbm=DBM choose the DBM type to use. - DBM={sdbm,gdbm,ndbm,db,db1,db185,db2,db3,db4,db41,db42,db43,db44,db45,db46,db47,db48,db50,db51} + DBM={sdbm,gdbm,ndbm,db,db1,db185,db2,db3,db4,db4X,db5X} + for some X=0,...,9 --with-gdbm=DIR enable GDBM support --with-ndbm=PATH Find the NDBM header and library in `PATH/include' and `PATH/lib'. If PATH is of the form `HEADER:LIB', @@ -1526,9 +1545,9 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure -generated by GNU Autoconf 2.68 +generated by GNU Autoconf 2.69 -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1604,7 +1623,7 @@ $as_echo "$ac_try_echo"; } >&5 test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext + test -x conftest$ac_exeext }; then : ac_retval=0 else @@ -1937,7 +1956,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was -generated by GNU Autoconf 2.68. Invocation command line was +generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2491,19 +2510,6 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - - - - - - - - - - - - - rm -f config.nice cat >config.nice<<EOF #! /bin/sh @@ -2729,7 +2735,7 @@ case $as_dir/ in #(( # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. @@ -2786,13 +2792,20 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -# Use -no-install to link the test programs on all platforms -# but Darwin, where it would cause the programs to be linked -# against installed versions of libapr instead of those just -# built. +# Use -no-install or -no-fast-install to link the test +# programs on all platforms but Darwin, where it would cause +# the programs to be linked against installed versions of +# libapr instead of those just built. case $host in -*-apple-darwin*) LT_NO_INSTALL="" ;; -*) LT_NO_INSTALL="-no-install" ;; + *-apple-darwin*) + LT_NO_INSTALL="" + ;; + *-mingw*) + LT_NO_INSTALL="-no-fast-install" + ;; + *) + LT_NO_INSTALL="-no-install" + ;; esac @@ -3060,7 +3073,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3100,7 +3113,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3153,7 +3166,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3194,7 +3207,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue @@ -3252,7 +3265,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3296,7 +3309,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3742,8 +3755,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <stdarg.h> #include <stdio.h> -#include <sys/types.h> -#include <sys/stat.h> +struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); @@ -4480,7 +4492,7 @@ do for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in @@ -4546,7 +4558,7 @@ do for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in @@ -4725,6 +4737,8 @@ done apu_have_crypto=0 + apu_have_openssl=0 + apu_have_nss=0 old_libs="$LIBS" old_cppflags="$CPPFLAGS" @@ -4734,9 +4748,35 @@ done # Check whether --with-crypto was given. if test "${with_crypto+set}" = set; then : withval=$with_crypto; + cryptolibs="openssl nss" + if test "$withval" = "yes"; then - apu_have_openssl=0 + crypto_library_enabled=0 + for cryptolib in $cryptolibs; do + eval v=\$with_$cryptolib + if test "$v" != "" -a "$v" != "no"; then + crypto_library_enabled=1 + fi + done + + if test "$crypto_library_enabled" = "0"; then + for cryptolib in $cryptolibs; do + eval v=\$with_$cryptolib + if test "$v" != "no"; then + eval with_$cryptolib=yes + crypto_library_enabled=1 + fi + done + if test "$crypto_library_enabled" = "1"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Crypto was requested but no crypto library was found; autodetecting possible libraries" >&5 +$as_echo "$as_me: Crypto was requested but no crypto library was found; autodetecting possible libraries" >&6;} + else + as_fn_error $? "Crypto was requested but all possible crypto libraries were disabled." "$LINENO" 5 + fi + fi + + openssl_have_headers=0 openssl_have_libs=0 @@ -5196,7 +5236,27 @@ fi if test "$apu_have_openssl" = "1"; then + + if test "x$LDADD_crypto_openssl" = "x"; then + test "x$silent" != "xyes" && echo " setting LDADD_crypto_openssl to \"$openssl_LDFLAGS -lssl -lcrypto\"" LDADD_crypto_openssl="$openssl_LDFLAGS -lssl -lcrypto" + else + apr_addto_bugger="$openssl_LDFLAGS -lssl -lcrypto" + for i in $apr_addto_bugger; do + apr_addto_duplicate="0" + for j in $LDADD_crypto_openssl; do + if test "x$i" = "x$j"; then + apr_addto_duplicate="1" + break + fi + done + if test $apr_addto_duplicate = "0"; then + test "x$silent" != "xyes" && echo " adding \"$i\" to LDADD_crypto_openssl" + LDADD_crypto_openssl="$LDADD_crypto_openssl $i" + fi + done + fi + apu_have_crypto=1 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for const input buffers in OpenSSL" >&5 @@ -5243,8 +5303,6 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext LDFLAGS="$old_ldflags" - apu_have_nss=0 - nss_have_headers=0 nss_have_libs=0 old_libs="$LIBS" @@ -5255,7 +5313,6 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Check whether --with-nss was given. if test "${with_nss+set}" = set; then : withval=$with_nss; - if test "$withval" = "yes"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. @@ -5276,7 +5333,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5319,7 +5376,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5401,7 +5458,35 @@ fi fi fi - for ac_header in prerror.h nss/nss.h nss.h nss/pk11pub.h pk11pub.h + nss_have_prerrorh=0 + nss_have_nssh=0 + nss_have_pk11pubh=0 + for ac_header in prerror.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "prerror.h" "ac_cv_header_prerror_h" "$ac_includes_default" +if test "x$ac_cv_header_prerror_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_PRERROR_H 1 +_ACEOF + nss_have_prerrorh=1 +fi + +done + + for ac_header in nss/nss.h nss.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + nss_have_nssh=1 +fi + +done + + for ac_header in nss/pk11pub.h pk11pub.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" @@ -5409,11 +5494,12 @@ if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF - nss_have_headers=1 + nss_have_pk11pubh=1 fi done + nss_have_headers=${nss_have_prerrorh}${nss_have_nssh}${nss_have_pk11pubh} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PR_Initialize in -lnspr4" >&5 $as_echo_n "checking for PR_Initialize in -lnspr4... " >&6; } if ${ac_cv_lib_nspr4_PR_Initialize+:} false; then : @@ -5493,7 +5579,7 @@ fi fi - if test "$nss_have_headers" != "0" && test "$nss_have_libs" != "0"; then + if test "$nss_have_headers" = "111" && test "$nss_have_libs" != "0"; then apu_have_nss=1 fi elif test "$withval" = "no"; then @@ -5548,7 +5634,35 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nss in $withval" >&5 $as_echo "$as_me: checking for nss in $withval" >&6;} - for ac_header in prerror.h nss/nss.h nss.h nss/pk11pub.h pk11pub.h + nss_have_prerrorh=0 + nss_have_nssh=0 + nss_have_pk11pubh=0 + for ac_header in prerror.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "prerror.h" "ac_cv_header_prerror_h" "$ac_includes_default" +if test "x$ac_cv_header_prerror_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_PRERROR_H 1 +_ACEOF + nss_have_prerrorh=1 +fi + +done + + for ac_header in nss/nss.h nss.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + nss_have_nssh=1 +fi + +done + + for ac_header in nss/pk11pub.h pk11pub.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" @@ -5556,11 +5670,12 @@ if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF - nss_have_headers=1 + nss_have_pk11pubh=1 fi done + nss_have_headers=${nss_have_prerrorh}${nss_have_nssh}${nss_have_pk11pubh} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PR_Initialize in -lnspr4" >&5 $as_echo_n "checking for PR_Initialize in -lnspr4... " >&6; } if ${ac_cv_lib_nspr4_PR_Initialize+:} false; then : @@ -5640,7 +5755,7 @@ fi fi - if test "$nss_have_headers" != "0" && test "$nss_have_libs" != "0"; then + if test "$nss_have_headers" = "111" && test "$nss_have_libs" != "0"; then apu_have_nss=1 fi @@ -5679,527 +5794,28 @@ fi if test "$apu_have_nss" = "1"; then - LDADD_crypto_nss="$nss_LDFLAGS -lnspr4 -lnss3" - apu_have_crypto=1 - fi - - - - LIBS="$old_libs" - CPPFLAGS="$old_cppflags" - LDFLAGS="$old_ldflags" - - fi - -else - - apu_have_crypto=0 - -fi - - - - - - - apu_have_openssl=0 - openssl_have_headers=0 - openssl_have_libs=0 - - old_libs="$LIBS" - old_cppflags="$CPPFLAGS" - old_ldflags="$LDFLAGS" - - -# Check whether --with-openssl was given. -if test "${with_openssl+set}" = set; then : - withval=$with_openssl; - if test "$withval" = "yes"; then - for ac_header in openssl/x509.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "openssl/x509.h" "ac_cv_header_openssl_x509_h" "$ac_includes_default" -if test "x$ac_cv_header_openssl_x509_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_OPENSSL_X509_H 1 -_ACEOF - openssl_have_headers=1 -fi - -done - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BN_init in -lcrypto" >&5 -$as_echo_n "checking for BN_init in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_BN_init+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lcrypto $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char BN_init (); -int -main () -{ -return BN_init (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_crypto_BN_init=yes -else - ac_cv_lib_crypto_BN_init=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_BN_init" >&5 -$as_echo "$ac_cv_lib_crypto_BN_init" >&6; } -if test "x$ac_cv_lib_crypto_BN_init" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_accept in -lssl" >&5 -$as_echo_n "checking for SSL_accept in -lssl... " >&6; } -if ${ac_cv_lib_ssl_SSL_accept+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lssl -lcrypto $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char SSL_accept (); -int -main () -{ -return SSL_accept (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_ssl_SSL_accept=yes -else - ac_cv_lib_ssl_SSL_accept=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_SSL_accept" >&5 -$as_echo "$ac_cv_lib_ssl_SSL_accept" >&6; } -if test "x$ac_cv_lib_ssl_SSL_accept" = xyes; then : - openssl_have_libs=1 -fi - -fi - - if test "$openssl_have_headers" != "0" && test "$openssl_have_libs" != "0"; then - apu_have_openssl=1 - fi - elif test "$withval" = "no"; then - apu_have_openssl=0 - else - - openssl_CPPFLAGS="-I$withval/include" - openssl_LDFLAGS="-L$withval/lib " - - - if test "x$CPPFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting CPPFLAGS to \"$openssl_CPPFLAGS\"" - CPPFLAGS="$openssl_CPPFLAGS" - else - apr_addto_bugger="$openssl_CPPFLAGS" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $CPPFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to CPPFLAGS" - CPPFLAGS="$CPPFLAGS $i" - fi - done - fi - - - if test "x$LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting LDFLAGS to \"$openssl_LDFLAGS\"" - LDFLAGS="$openssl_LDFLAGS" - else - apr_addto_bugger="$openssl_LDFLAGS" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to LDFLAGS" - LDFLAGS="$LDFLAGS $i" - fi - done - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openssl in $withval" >&5 -$as_echo "$as_me: checking for openssl in $withval" >&6;} - for ac_header in openssl/x509.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "openssl/x509.h" "ac_cv_header_openssl_x509_h" "$ac_includes_default" -if test "x$ac_cv_header_openssl_x509_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_OPENSSL_X509_H 1 -_ACEOF - openssl_have_headers=1 -fi - -done - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BN_init in -lcrypto" >&5 -$as_echo_n "checking for BN_init in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_BN_init+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lcrypto $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char BN_init (); -int -main () -{ -return BN_init (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_crypto_BN_init=yes -else - ac_cv_lib_crypto_BN_init=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_BN_init" >&5 -$as_echo "$ac_cv_lib_crypto_BN_init" >&6; } -if test "x$ac_cv_lib_crypto_BN_init" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_accept in -lssl" >&5 -$as_echo_n "checking for SSL_accept in -lssl... " >&6; } -if ${ac_cv_lib_ssl_SSL_accept+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lssl -lcrypto $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char SSL_accept (); -int -main () -{ -return SSL_accept (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_ssl_SSL_accept=yes -else - ac_cv_lib_ssl_SSL_accept=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_SSL_accept" >&5 -$as_echo "$ac_cv_lib_ssl_SSL_accept" >&6; } -if test "x$ac_cv_lib_ssl_SSL_accept" = xyes; then : - openssl_have_libs=1 -fi - -fi - - if test "$openssl_have_headers" != "0" && test "$openssl_have_libs" != "0"; then - apu_have_openssl=1 - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$withval/lib\"" - APRUTIL_LDFLAGS="-L$withval/lib" - else - apr_addto_bugger="-L$withval/lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$withval/include\"" - APRUTIL_INCLUDES="-I$withval/include" - else - apr_addto_bugger="-I$withval/include" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - fi - - if test "$apu_have_openssl" != "1"; then - for ac_header in openssl/x509.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "openssl/x509.h" "ac_cv_header_openssl_x509_h" "$ac_includes_default" -if test "x$ac_cv_header_openssl_x509_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_OPENSSL_X509_H 1 -_ACEOF - openssl_have_headers=1 -fi - -done - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BN_init in -lcrypto" >&5 -$as_echo_n "checking for BN_init in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_BN_init+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lcrypto $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char BN_init (); -int -main () -{ -return BN_init (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_crypto_BN_init=yes -else - ac_cv_lib_crypto_BN_init=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_BN_init" >&5 -$as_echo "$ac_cv_lib_crypto_BN_init" >&6; } -if test "x$ac_cv_lib_crypto_BN_init" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_accept in -lssl" >&5 -$as_echo_n "checking for SSL_accept in -lssl... " >&6; } -if ${ac_cv_lib_ssl_SSL_accept+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lssl -lcrypto $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char SSL_accept (); -int -main () -{ -return SSL_accept (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_ssl_SSL_accept=yes -else - ac_cv_lib_ssl_SSL_accept=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_SSL_accept" >&5 -$as_echo "$ac_cv_lib_ssl_SSL_accept" >&6; } -if test "x$ac_cv_lib_ssl_SSL_accept" = xyes; then : - openssl_have_libs=1 -fi - -fi - - if test "$openssl_have_headers" != "0" && test "$openssl_have_libs" != "0"; then - apu_have_openssl=1 - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$withval/lib\"" - APRUTIL_LDFLAGS="-L$withval/lib" + if test "x$LDADD_crypto_nss" = "x"; then + test "x$silent" != "xyes" && echo " setting LDADD_crypto_nss to \"$nss_LDFLAGS -lnspr4 -lnss3\"" + LDADD_crypto_nss="$nss_LDFLAGS -lnspr4 -lnss3" else - apr_addto_bugger="-L$withval/lib" + apr_addto_bugger="$nss_LDFLAGS -lnspr4 -lnss3" for i in $apr_addto_bugger; do apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do + for j in $LDADD_crypto_nss; do if test "x$i" = "x$j"; then apr_addto_duplicate="1" break fi done if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" + test "x$silent" != "xyes" && echo " adding \"$i\" to LDADD_crypto_nss" + LDADD_crypto_nss="$LDADD_crypto_nss $i" fi done fi - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$withval/include\"" - APRUTIL_INCLUDES="-I$withval/include" - else - apr_addto_bugger="-I$withval/include" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - fi - fi - - ac_fn_c_check_decl "$LINENO" "EVP_PKEY_CTX_new" "ac_cv_have_decl_EVP_PKEY_CTX_new" "#include <openssl/evp.h> -" -if test "x$ac_cv_have_decl_EVP_PKEY_CTX_new" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_EVP_PKEY_CTX_NEW $ac_have_decl -_ACEOF - - - fi - -else - - apu_have_openssl=0 - -fi - - - - - if test "$apu_have_openssl" = "1"; then - LDADD_crypto_openssl="$openssl_LDFLAGS -lssl -lcrypto" apu_have_crypto=1 - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for const input buffers in OpenSSL" >&5 -$as_echo_n "checking for const input buffers in OpenSSL... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <openssl/rsa.h> -int -main () -{ - const unsigned char * buf; - unsigned char * outbuf; - RSA rsa; - - RSA_private_decrypt(1, - buf, - outbuf, - &rsa, - RSA_PKCS1_PADDING); - - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -$as_echo "#define CRYPTO_OPENSSL_CONST_BUFFERS 1" >>confdefs.h - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi @@ -6208,452 +5824,20 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CPPFLAGS="$old_cppflags" LDFLAGS="$old_ldflags" - - apu_have_nss=0 - nss_have_headers=0 - nss_have_libs=0 - - old_libs="$LIBS" - old_cppflags="$CPPFLAGS" - old_ldflags="$LDFLAGS" - - -# Check whether --with-nss was given. -if test "${with_nss+set}" = set; then : - withval=$with_nss; - - if test "$withval" = "yes"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. -set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PKG_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -PKG_CONFIG=$ac_cv_path_PKG_CONFIG -if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_PKG_CONFIG"; then - ac_pt_PKG_CONFIG=$PKG_CONFIG - # Extract the first word of "pkg-config", so it can be a program name with args. -set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ac_pt_PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG -if test -n "$ac_pt_PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 -$as_echo "$ac_pt_PKG_CONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_pt_PKG_CONFIG" = x; then - PKG_CONFIG="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - PKG_CONFIG=$ac_pt_PKG_CONFIG - fi -else - PKG_CONFIG="$ac_cv_path_PKG_CONFIG" -fi - - if test -n "$PKG_CONFIG"; then - nss_CPPFLAGS=`$PKG_CONFIG --cflags-only-I nss` - nss_LDFLAGS=`$PKG_CONFIG --libs nss` - - if test "x$CPPFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting CPPFLAGS to \"$nss_CPPFLAGS\"" - CPPFLAGS="$nss_CPPFLAGS" - else - apr_addto_bugger="$nss_CPPFLAGS" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $CPPFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to CPPFLAGS" - CPPFLAGS="$CPPFLAGS $i" - fi - done - fi - - - if test "x$LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting LDFLAGS to \"$nss_LDFLAGS\"" - LDFLAGS="$nss_LDFLAGS" - else - apr_addto_bugger="$nss_LDFLAGS" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to LDFLAGS" - LDFLAGS="$LDFLAGS $i" - fi - done - fi - - fi - for ac_header in prerror.h nss/nss.h nss.h nss/pk11pub.h pk11pub.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - nss_have_headers=1 -fi - -done - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PR_Initialize in -lnspr4" >&5 -$as_echo_n "checking for PR_Initialize in -lnspr4... " >&6; } -if ${ac_cv_lib_nspr4_PR_Initialize+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lnspr4 $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char PR_Initialize (); -int -main () -{ -return PR_Initialize (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_nspr4_PR_Initialize=yes -else - ac_cv_lib_nspr4_PR_Initialize=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nspr4_PR_Initialize" >&5 -$as_echo "$ac_cv_lib_nspr4_PR_Initialize" >&6; } -if test "x$ac_cv_lib_nspr4_PR_Initialize" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PK11_CreatePBEV2AlgorithmID in -lnss3" >&5 -$as_echo_n "checking for PK11_CreatePBEV2AlgorithmID in -lnss3... " >&6; } -if ${ac_cv_lib_nss3_PK11_CreatePBEV2AlgorithmID+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lnss3 -lnspr4 $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char PK11_CreatePBEV2AlgorithmID (); -int -main () -{ -return PK11_CreatePBEV2AlgorithmID (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_nss3_PK11_CreatePBEV2AlgorithmID=yes -else - ac_cv_lib_nss3_PK11_CreatePBEV2AlgorithmID=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nss3_PK11_CreatePBEV2AlgorithmID" >&5 -$as_echo "$ac_cv_lib_nss3_PK11_CreatePBEV2AlgorithmID" >&6; } -if test "x$ac_cv_lib_nss3_PK11_CreatePBEV2AlgorithmID" = xyes; then : - nss_have_libs=1 -fi - -fi - - if test "$nss_have_headers" != "0" && test "$nss_have_libs" != "0"; then - apu_have_nss=1 - fi - elif test "$withval" = "no"; then - apu_have_nss=0 - elif test "x$withval" != "x"; then - - nss_CPPFLAGS="-I$withval/include/nss -I$withval/include/nss3 -I$withval/include/nspr -I$withval/include/nspr4 -I$withval/include -I$withval/../public" - nss_LDFLAGS="-L$withval/lib " - - - if test "x$CPPFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting CPPFLAGS to \"$nss_CPPFLAGS\"" - CPPFLAGS="$nss_CPPFLAGS" - else - apr_addto_bugger="$nss_CPPFLAGS" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $CPPFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to CPPFLAGS" - CPPFLAGS="$CPPFLAGS $i" - fi - done - fi - - - if test "x$LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting LDFLAGS to \"$nss_LDFLAGS\"" - LDFLAGS="$nss_LDFLAGS" - else - apr_addto_bugger="$nss_LDFLAGS" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to LDFLAGS" - LDFLAGS="$LDFLAGS $i" - fi - done - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nss in $withval" >&5 -$as_echo "$as_me: checking for nss in $withval" >&6;} - for ac_header in prerror.h nss/nss.h nss.h nss/pk11pub.h pk11pub.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - nss_have_headers=1 -fi - -done - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PR_Initialize in -lnspr4" >&5 -$as_echo_n "checking for PR_Initialize in -lnspr4... " >&6; } -if ${ac_cv_lib_nspr4_PR_Initialize+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lnspr4 $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char PR_Initialize (); -int -main () -{ -return PR_Initialize (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_nspr4_PR_Initialize=yes -else - ac_cv_lib_nspr4_PR_Initialize=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nspr4_PR_Initialize" >&5 -$as_echo "$ac_cv_lib_nspr4_PR_Initialize" >&6; } -if test "x$ac_cv_lib_nspr4_PR_Initialize" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PK11_CreatePBEV2AlgorithmID in -lnss3" >&5 -$as_echo_n "checking for PK11_CreatePBEV2AlgorithmID in -lnss3... " >&6; } -if ${ac_cv_lib_nss3_PK11_CreatePBEV2AlgorithmID+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lnss3 -lnspr4 $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char PK11_CreatePBEV2AlgorithmID (); -int -main () -{ -return PK11_CreatePBEV2AlgorithmID (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_nss3_PK11_CreatePBEV2AlgorithmID=yes -else - ac_cv_lib_nss3_PK11_CreatePBEV2AlgorithmID=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nss3_PK11_CreatePBEV2AlgorithmID" >&5 -$as_echo "$ac_cv_lib_nss3_PK11_CreatePBEV2AlgorithmID" >&6; } -if test "x$ac_cv_lib_nss3_PK11_CreatePBEV2AlgorithmID" = xyes; then : - nss_have_libs=1 -fi - -fi - - if test "$nss_have_headers" != "0" && test "$nss_have_libs" != "0"; then - apu_have_nss=1 + if test "$apu_have_crypto" = "0"; then + as_fn_error $? "Crypto was requested but no crypto library could be enabled; specify the location of a crypto library using --with-openssl, --with-nss, etc." "$LINENO" 5 fi - - fi - if test "$apu_have_nss" != "0"; then - - if test "x$APRUTIL_PRIV_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_PRIV_INCLUDES to \"$nss_CPPFLAGS\"" - APRUTIL_PRIV_INCLUDES="$nss_CPPFLAGS" - else - apr_addto_bugger="$nss_CPPFLAGS" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_PRIV_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_PRIV_INCLUDES" - APRUTIL_PRIV_INCLUDES="$APRUTIL_PRIV_INCLUDES $i" - fi - done - fi - fi else - apu_have_nss=0 + apu_have_crypto=0 fi - if test "$apu_have_nss" = "1"; then - LDADD_crypto_nss="$nss_LDFLAGS -lnspr4 -lnss3" - apu_have_crypto=1 - fi - - - - LIBS="$old_libs" - CPPFLAGS="$old_cppflags" - LDFLAGS="$old_ldflags" @@ -6676,7 +5860,7 @@ apu_has_ldap_mozilla="0" apu_has_ldap_tivoli="0" apu_has_ldap_zos="0" apu_has_ldap_other="0" -LDADD_ldap="" +LDADD_ldap_found="" # Check whether --with-lber was given. @@ -6816,7 +6000,7 @@ eval ac_res=\$$as_ac_Lib $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - LDADD_ldap="-l${ldaplib} ${extralib}" + LDADD_ldap_found="-l${ldaplib} ${extralib}" as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldapssl_client_init" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldapssl_client_init in -l${ldaplib}" >&5 $as_echo_n "checking for ldapssl_client_init in -l${ldaplib}... " >&6; } @@ -7167,7 +6351,7 @@ eval ac_res=\$$as_ac_Lib $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - LDADD_ldap="-l${ldaplib} ${extralib}" + LDADD_ldap_found="-l${ldaplib} ${extralib}" as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldapssl_client_init" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldapssl_client_init in -l${ldaplib}" >&5 $as_echo_n "checking for ldapssl_client_init in -l${ldaplib}... " >&6; } @@ -7518,7 +6702,7 @@ eval ac_res=\$$as_ac_Lib $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - LDADD_ldap="-l${ldaplib} ${extralib}" + LDADD_ldap_found="-l${ldaplib} ${extralib}" as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldapssl_client_init" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldapssl_client_init in -l${ldaplib}" >&5 $as_echo_n "checking for ldapssl_client_init in -l${ldaplib}... " >&6; } @@ -7869,7 +7053,7 @@ eval ac_res=\$$as_ac_Lib $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - LDADD_ldap="-l${ldaplib} ${extralib}" + LDADD_ldap_found="-l${ldaplib} ${extralib}" as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldapssl_client_init" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldapssl_client_init in -l${ldaplib}" >&5 $as_echo_n "checking for ldapssl_client_init in -l${ldaplib}... " >&6; } @@ -8220,7 +7404,7 @@ eval ac_res=\$$as_ac_Lib $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - LDADD_ldap="-l${ldaplib} ${extralib}" + LDADD_ldap_found="-l${ldaplib} ${extralib}" as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldapssl_client_init" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldapssl_client_init in -l${ldaplib}" >&5 $as_echo_n "checking for ldapssl_client_init in -l${ldaplib}... " >&6; } @@ -8571,7 +7755,7 @@ eval ac_res=\$$as_ac_Lib $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - LDADD_ldap="-l${ldaplib} ${extralib}" + LDADD_ldap_found="-l${ldaplib} ${extralib}" as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldapssl_client_init" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldapssl_client_init in -l${ldaplib}" >&5 $as_echo_n "checking for ldapssl_client_init in -l${ldaplib}... " >&6; } @@ -8922,7 +8106,7 @@ eval ac_res=\$$as_ac_Lib $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - LDADD_ldap="-l${ldaplib} ${extralib}" + LDADD_ldap_found="-l${ldaplib} ${extralib}" as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldapssl_client_init" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldapssl_client_init in -l${ldaplib}" >&5 $as_echo_n "checking for ldapssl_client_init in -l${ldaplib}... " >&6; } @@ -9273,7 +8457,7 @@ eval ac_res=\$$as_ac_Lib $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - LDADD_ldap="-l${ldaplib} ${extralib}" + LDADD_ldap_found="-l${ldaplib} ${extralib}" as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldapssl_client_init" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldapssl_client_init in -l${ldaplib}" >&5 $as_echo_n "checking for ldapssl_client_init in -l${ldaplib}... " >&6; } @@ -9624,7 +8808,7 @@ eval ac_res=\$$as_ac_Lib $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - LDADD_ldap="-l${ldaplib} ${extralib}" + LDADD_ldap_found="-l${ldaplib} ${extralib}" as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldapssl_client_init" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldapssl_client_init in -l${ldaplib}" >&5 $as_echo_n "checking for ldapssl_client_init in -l${ldaplib}... " >&6; } @@ -9975,7 +9159,7 @@ eval ac_res=\$$as_ac_Lib $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - LDADD_ldap="-l${ldaplib} ${extralib}" + LDADD_ldap_found="-l${ldaplib} ${extralib}" as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldapssl_client_init" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldapssl_client_init in -l${ldaplib}" >&5 $as_echo_n "checking for ldapssl_client_init in -l${ldaplib}... " >&6; } @@ -10326,7 +9510,7 @@ eval ac_res=\$$as_ac_Lib $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - LDADD_ldap="-l${ldaplib} ${extralib}" + LDADD_ldap_found="-l${ldaplib} ${extralib}" as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldapssl_client_init" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldapssl_client_init in -l${ldaplib}" >&5 $as_echo_n "checking for ldapssl_client_init in -l${ldaplib}... " >&6; } @@ -10678,7 +9862,7 @@ eval ac_res=\$$as_ac_Lib $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - LDADD_ldap="-l${ldaplib} ${extralib}" + LDADD_ldap_found="-l${ldaplib} ${extralib}" as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldapssl_client_init" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldapssl_client_init in -l${ldaplib}" >&5 $as_echo_n "checking for ldapssl_client_init in -l${ldaplib}... " >&6; } @@ -11029,7 +10213,7 @@ eval ac_res=\$$as_ac_Lib $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - LDADD_ldap="-l${ldaplib} ${extralib}" + LDADD_ldap_found="-l${ldaplib} ${extralib}" as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldapssl_client_init" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldapssl_client_init in -l${ldaplib}" >&5 $as_echo_n "checking for ldapssl_client_init in -l${ldaplib}... " >&6; } @@ -11380,7 +10564,7 @@ eval ac_res=\$$as_ac_Lib $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - LDADD_ldap="-l${ldaplib} ${extralib}" + LDADD_ldap_found="-l${ldaplib} ${extralib}" as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldapssl_client_init" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldapssl_client_init in -l${ldaplib}" >&5 $as_echo_n "checking for ldapssl_client_init in -l${ldaplib}... " >&6; } @@ -11731,7 +10915,7 @@ eval ac_res=\$$as_ac_Lib $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - LDADD_ldap="-l${ldaplib} ${extralib}" + LDADD_ldap_found="-l${ldaplib} ${extralib}" as_ac_Lib=`$as_echo "ac_cv_lib_${ldaplib}''_ldapssl_client_init" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldapssl_client_init in -l${ldaplib}" >&5 $as_echo_n "checking for ldapssl_client_init in -l${ldaplib}... " >&6; } @@ -12035,6 +11219,27 @@ fi fi test ${apu_has_ldap} != "1" && as_fn_error $? "could not find an LDAP library" "$LINENO" 5 + test ${apu_has_ldap} == "1" && + if test "x$LDADD_ldap" = "x"; then + test "x$silent" != "xyes" && echo " setting LDADD_ldap to \"$LDADD_ldap_found\"" + LDADD_ldap="$LDADD_ldap_found" + else + apr_addto_bugger="$LDADD_ldap_found" + for i in $apr_addto_bugger; do + apr_addto_duplicate="0" + for j in $LDADD_ldap; do + if test "x$i" = "x$j"; then + apr_addto_duplicate="1" + break + fi + done + if test $apr_addto_duplicate = "0"; then + test "x$silent" != "xyes" && echo " adding \"$i\" to LDADD_ldap" + LDADD_ldap="$LDADD_ldap $i" + fi + done + fi + as_ac_Lib=`$as_echo "ac_cv_lib_$apu_liblber_name''_ber_init" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ber_init in -l$apu_liblber_name" >&5 $as_echo_n "checking for ber_init in -l$apu_liblber_name... " >&6; } @@ -12074,7 +11279,27 @@ eval ac_res=\$$as_ac_Lib { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - LDADD_ldap="${LDADD_ldap} -l${apu_liblber_name}" + + if test "x$LDADD_ldap" = "x"; then + test "x$silent" != "xyes" && echo " setting LDADD_ldap to \"-l${apu_liblber_name}\"" + LDADD_ldap="-l${apu_liblber_name}" + else + apr_addto_bugger="-l${apu_liblber_name}" + for i in $apr_addto_bugger; do + apr_addto_duplicate="0" + for j in $LDADD_ldap; do + if test "x$i" = "x$j"; then + apr_addto_duplicate="1" + break + fi + done + if test $apr_addto_duplicate = "0"; then + test "x$silent" != "xyes" && echo " adding \"$i\" to LDADD_ldap" + LDADD_ldap="$LDADD_ldap $i" + fi + done + fi + fi @@ -12313,11 +11538,12 @@ else #include <ldap.h> #endif - int main(int argc, const char *const *argv) { + int main(int argc, const char *const *argv) { ldap_set_rebind_proc((LDAP *)0, (LDAP_REBIND_PROC *)0, (void *)0); - return 0; } + return 0; } + _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_ldap_set_rebind_proc_style=three @@ -12378,13 +11604,27 @@ fi apu_db_header=db.h # default so apu_select_dbm.h is syntactically correct apu_db_version=0 + # Maximum supported version announced in help string. + # Although we search for all versions up to 5.9, + # we should only include existing versions in our + # help string. + db_max_version=53 + db_min_version=41 + dbm_list="sdbm, gdbm, ndbm, db, db1, db185, db2, db3, db4" + db_version="$db_min_version" + while [ $db_version -le $db_max_version ] + do + dbm_list="$dbm_list, db$db_version" + db_version=`expr $db_version + 1` + done + # Check whether --with-dbm was given. if test "${with_dbm+set}" = set; then : withval=$with_dbm; if test "$withval" = "yes"; then as_fn_error $? "--with-dbm needs to specify a DBM type to use. - One of: sdbm, gdbm, ndbm, db, db1, db185, db2, db3, db4, db41, db42, db43, db44, db45, db46, db47, db48, db50, db51" "$LINENO" 5 + One of: $dbm_list" "$LINENO" 5 fi requested="$withval" @@ -12849,3595 +12089,30 @@ if test "${with_berkeley_db+set}" = set; then : all_places="$check_places" + # Start version search at version 5.9 + db_version=59 + while [ $db_version -ge 40 ] + do + db_major=`echo $db_version | sed -e 's/.$//'` + db_minor=`echo $db_version | sed -e 's/.//'` places="$all_places" + db_major="$db_major" + db_minor="$db_minor" if test -z "$places"; then - places="std /usr/local/BerkeleyDB.5.1 /boot/home/config" - fi - - bdb_version="5" - if test ""1"" != "-1"; then - bdb_version="$bdb_version."1"" - if test ""-1"" != "-1"; then - bdb_version="$bdb_version."-1"" - fi - fi - bdb_places="$places" - bdb_default_search_headers="db51/db.h db5/db.h db.h" - bdb_default_search_lib_names="db-5.1 db5-5.1 db51 db5 db" - - - apu_have_db=0 - - # Save the original values of the flags we tweak. - apu_check_lib_save_libs="$LIBS" - apu_check_lib_save_ldflags="$LDFLAGS" - apu_check_lib_save_cppflags="$CPPFLAGS" - - # The variable `found' is the prefix under which we've found - # Berkeley DB, or `not' if we haven't found it anywhere yet. - found=not - for bdb_place in $bdb_places; do - - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - case "$bdb_place" in - "std" ) - description="the standard places" - ;; - *":"* ) - header="`echo $bdb_place | sed -e 's/:.*$//'`" - lib="`echo $bdb_place | sed -e 's/^.*://'`" - CPPFLAGS="$CPPFLAGS -I$header" - LDFLAGS="$LDFLAGS -L$lib" - description="$header and $lib" - ;; - * ) - if test -d $bdb_place; then - LDFLAGS="$LDFLAGS -L$bdb_place/lib" - CPPFLAGS="$CPPFLAGS -I$bdb_place/include" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $bdb_place" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: directory not found" >&5 -$as_echo "directory not found" >&6; } - continue - fi - description="$bdb_place" - ;; - esac - - # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this - # trick to display a message instead. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $description" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 -$as_echo "" >&6; } - - for bdb_libname in $bdb_default_search_lib_names; do - for bdb_header in $bdb_default_search_headers; do - # Clear the header cache variable for each location - - cache_id="`echo ac_cv_header_${bdb_header} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - unset $cache_id - as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - - if test ""5"" = "3" -o ""5"" = "4" -o ""5"" = "5"; then - # We generate a separate cache variable for each prefix and libname - # we search under. That way, we avoid caching information that - # changes if the user runs `configure' with a different set of - # switches. - - cache_id="`echo apu_cv_check_berkeley_db_"5"_"1"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -l$bdb_libname" >&5 -$as_echo_n "checking for -l$bdb_libname... " >&6; } - if eval \${$cache_id+:} false; then : - $as_echo_n "(cached) " >&6 -else - - - apu_try_berkeley_db_save_libs="$LIBS" - - apu_check_berkeley_db_major="5" - apu_check_berkeley_db_minor="1" - apu_check_berkeley_db_patch="-1" - apu_try_berkeley_db_header=$bdb_header - apu_try_berkeley_db_libname=$bdb_libname - - LIBS="$LIBS -l$apu_try_berkeley_db_libname" - if test "$cross_compiling" = yes; then : - apu_try_berkeley_db=yes - -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include <stdlib.h> -#include <stdio.h> -#include <$apu_try_berkeley_db_header> -main () -{ - int major, minor, patch; - - db_version(&major, &minor, &patch); - - /* Sanity check: ensure that db.h constants actually match the db library */ - if (major != DB_VERSION_MAJOR - || minor != DB_VERSION_MINOR - || patch != DB_VERSION_PATCH) - exit (1); - - /* Run-time check: ensure the library claims to be the correct version. */ - - if ($apu_check_berkeley_db_major != -1) { - if (major < $apu_check_berkeley_db_major) - exit (1); - if (major > $apu_check_berkeley_db_major) - exit (0); - } - - if ($apu_check_berkeley_db_minor != -1) { - if (minor < $apu_check_berkeley_db_minor) - exit (1); - if (minor > $apu_check_berkeley_db_minor) - exit (0); - } - - if ($apu_check_berkeley_db_patch == -1 - || patch >= $apu_check_berkeley_db_patch) - exit (0); - else - exit (1); -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - apu_try_berkeley_db=yes -else - apu_try_berkeley_db=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - - LIBS="$apu_try_berkeley_db_save_libs" - - - eval "$cache_id=$apu_try_berkeley_db" - -fi - - result="`eval echo '$'$cache_id`" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $result" >&5 -$as_echo "$result" >&6; } - elif test ""5"" = "1"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbopen in -l$bdb_libname" >&5 -$as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dbopen (); -int -main () -{ -return dbopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - elif test ""5"" = "2"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for db_open in -l$bdb_libname" >&5 -$as_echo_n "checking for db_open in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char db_open (); -int -main () -{ -return db_open (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - fi - -else - result="no" -fi - - - - # If we found it, no need to search any more. - if test "$result" = "yes"; then - found="$bdb_place" - break - fi - done - test "$found" != "not" && break - done - test "$found" != "not" && break - done - - # Restore the original values of the flags we tweak. - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - - case "$found" in - "not") - apu_have_db=0 - ;; - "std") - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *":"*) - header="`echo $found | sed -e 's/:.*$//'`" - lib="`echo $found | sed -e 's/^.*://'`" - - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$header\"" - APRUTIL_INCLUDES="-I$header" - else - apr_addto_bugger="-I$header" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$lib\"" - APRUTIL_LDFLAGS="-L$lib" - else - apr_addto_bugger="-L$lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *) - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$found/include\"" - APRUTIL_INCLUDES="-I$found/include" - else - apr_addto_bugger="-I$found/include" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$found/lib\"" - APRUTIL_LDFLAGS="-L$found/lib" - else - apr_addto_bugger="-L$found/lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - esac - - if test "$apu_have_db" = "1"; then - apu_db_version=5 - fi - - if test "$apu_db_version" != "5"; then - - places="$all_places" - if test -z "$places"; then - places="std /usr/local/BerkeleyDB.5.0 /boot/home/config" - fi - - bdb_version="5" - if test ""0"" != "-1"; then - bdb_version="$bdb_version."0"" - if test ""-1"" != "-1"; then - bdb_version="$bdb_version."-1"" - fi - fi - bdb_places="$places" - bdb_default_search_headers="db50/db.h db5/db.h db.h" - bdb_default_search_lib_names="db-5.0 db5-5.0 db50 db5 db" - - - apu_have_db=0 - - # Save the original values of the flags we tweak. - apu_check_lib_save_libs="$LIBS" - apu_check_lib_save_ldflags="$LDFLAGS" - apu_check_lib_save_cppflags="$CPPFLAGS" - - # The variable `found' is the prefix under which we've found - # Berkeley DB, or `not' if we haven't found it anywhere yet. - found=not - for bdb_place in $bdb_places; do - - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - case "$bdb_place" in - "std" ) - description="the standard places" - ;; - *":"* ) - header="`echo $bdb_place | sed -e 's/:.*$//'`" - lib="`echo $bdb_place | sed -e 's/^.*://'`" - CPPFLAGS="$CPPFLAGS -I$header" - LDFLAGS="$LDFLAGS -L$lib" - description="$header and $lib" - ;; - * ) - if test -d $bdb_place; then - LDFLAGS="$LDFLAGS -L$bdb_place/lib" - CPPFLAGS="$CPPFLAGS -I$bdb_place/include" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $bdb_place" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: directory not found" >&5 -$as_echo "directory not found" >&6; } - continue - fi - description="$bdb_place" - ;; - esac - - # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this - # trick to display a message instead. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $description" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 -$as_echo "" >&6; } - - for bdb_libname in $bdb_default_search_lib_names; do - for bdb_header in $bdb_default_search_headers; do - # Clear the header cache variable for each location - - cache_id="`echo ac_cv_header_${bdb_header} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - unset $cache_id - as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - - if test ""5"" = "3" -o ""5"" = "4" -o ""5"" = "5"; then - # We generate a separate cache variable for each prefix and libname - # we search under. That way, we avoid caching information that - # changes if the user runs `configure' with a different set of - # switches. - - cache_id="`echo apu_cv_check_berkeley_db_"5"_"0"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -l$bdb_libname" >&5 -$as_echo_n "checking for -l$bdb_libname... " >&6; } - if eval \${$cache_id+:} false; then : - $as_echo_n "(cached) " >&6 -else - - - apu_try_berkeley_db_save_libs="$LIBS" - - apu_check_berkeley_db_major="5" - apu_check_berkeley_db_minor="0" - apu_check_berkeley_db_patch="-1" - apu_try_berkeley_db_header=$bdb_header - apu_try_berkeley_db_libname=$bdb_libname - - LIBS="$LIBS -l$apu_try_berkeley_db_libname" - if test "$cross_compiling" = yes; then : - apu_try_berkeley_db=yes - -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include <stdlib.h> -#include <stdio.h> -#include <$apu_try_berkeley_db_header> -main () -{ - int major, minor, patch; - - db_version(&major, &minor, &patch); - - /* Sanity check: ensure that db.h constants actually match the db library */ - if (major != DB_VERSION_MAJOR - || minor != DB_VERSION_MINOR - || patch != DB_VERSION_PATCH) - exit (1); - - /* Run-time check: ensure the library claims to be the correct version. */ - - if ($apu_check_berkeley_db_major != -1) { - if (major < $apu_check_berkeley_db_major) - exit (1); - if (major > $apu_check_berkeley_db_major) - exit (0); - } - - if ($apu_check_berkeley_db_minor != -1) { - if (minor < $apu_check_berkeley_db_minor) - exit (1); - if (minor > $apu_check_berkeley_db_minor) - exit (0); - } - - if ($apu_check_berkeley_db_patch == -1 - || patch >= $apu_check_berkeley_db_patch) - exit (0); - else - exit (1); -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - apu_try_berkeley_db=yes -else - apu_try_berkeley_db=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - - LIBS="$apu_try_berkeley_db_save_libs" - - - eval "$cache_id=$apu_try_berkeley_db" - -fi - - result="`eval echo '$'$cache_id`" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $result" >&5 -$as_echo "$result" >&6; } - elif test ""5"" = "1"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbopen in -l$bdb_libname" >&5 -$as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dbopen (); -int -main () -{ -return dbopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - elif test ""5"" = "2"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for db_open in -l$bdb_libname" >&5 -$as_echo_n "checking for db_open in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char db_open (); -int -main () -{ -return db_open (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - fi - -else - result="no" -fi - - - - # If we found it, no need to search any more. - if test "$result" = "yes"; then - found="$bdb_place" - break - fi - done - test "$found" != "not" && break - done - test "$found" != "not" && break - done - - # Restore the original values of the flags we tweak. - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - - case "$found" in - "not") - apu_have_db=0 - ;; - "std") - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *":"*) - header="`echo $found | sed -e 's/:.*$//'`" - lib="`echo $found | sed -e 's/^.*://'`" - - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$header\"" - APRUTIL_INCLUDES="-I$header" - else - apr_addto_bugger="-I$header" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$lib\"" - APRUTIL_LDFLAGS="-L$lib" - else - apr_addto_bugger="-L$lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *) - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$found/include\"" - APRUTIL_INCLUDES="-I$found/include" - else - apr_addto_bugger="-I$found/include" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$found/lib\"" - APRUTIL_LDFLAGS="-L$found/lib" - else - apr_addto_bugger="-L$found/lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - esac - - if test "$apu_have_db" = "1"; then - apu_db_version=5 - fi - - if test "$apu_db_version" != "5"; then - - places="$all_places" - if test -z "$places"; then - places="std /usr/local/BerkeleyDB.4.8 /boot/home/config" - fi - - bdb_version="4" - if test ""8"" != "-1"; then - bdb_version="$bdb_version."8"" - if test ""-1"" != "-1"; then - bdb_version="$bdb_version."-1"" - fi - fi - bdb_places="$places" - bdb_default_search_headers="db48/db.h db4/db.h db.h" - bdb_default_search_lib_names="db-4.8 db4-4.8 db48 db4 db" - - - apu_have_db=0 - - # Save the original values of the flags we tweak. - apu_check_lib_save_libs="$LIBS" - apu_check_lib_save_ldflags="$LDFLAGS" - apu_check_lib_save_cppflags="$CPPFLAGS" - - # The variable `found' is the prefix under which we've found - # Berkeley DB, or `not' if we haven't found it anywhere yet. - found=not - for bdb_place in $bdb_places; do - - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - case "$bdb_place" in - "std" ) - description="the standard places" - ;; - *":"* ) - header="`echo $bdb_place | sed -e 's/:.*$//'`" - lib="`echo $bdb_place | sed -e 's/^.*://'`" - CPPFLAGS="$CPPFLAGS -I$header" - LDFLAGS="$LDFLAGS -L$lib" - description="$header and $lib" - ;; - * ) - if test -d $bdb_place; then - LDFLAGS="$LDFLAGS -L$bdb_place/lib" - CPPFLAGS="$CPPFLAGS -I$bdb_place/include" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $bdb_place" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: directory not found" >&5 -$as_echo "directory not found" >&6; } - continue - fi - description="$bdb_place" - ;; - esac - - # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this - # trick to display a message instead. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $description" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 -$as_echo "" >&6; } - - for bdb_libname in $bdb_default_search_lib_names; do - for bdb_header in $bdb_default_search_headers; do - # Clear the header cache variable for each location - - cache_id="`echo ac_cv_header_${bdb_header} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - unset $cache_id - as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - - if test ""4"" = "3" -o ""4"" = "4" -o ""4"" = "5"; then - # We generate a separate cache variable for each prefix and libname - # we search under. That way, we avoid caching information that - # changes if the user runs `configure' with a different set of - # switches. - - cache_id="`echo apu_cv_check_berkeley_db_"4"_"8"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -l$bdb_libname" >&5 -$as_echo_n "checking for -l$bdb_libname... " >&6; } - if eval \${$cache_id+:} false; then : - $as_echo_n "(cached) " >&6 -else - - - apu_try_berkeley_db_save_libs="$LIBS" - - apu_check_berkeley_db_major="4" - apu_check_berkeley_db_minor="8" - apu_check_berkeley_db_patch="-1" - apu_try_berkeley_db_header=$bdb_header - apu_try_berkeley_db_libname=$bdb_libname - - LIBS="$LIBS -l$apu_try_berkeley_db_libname" - if test "$cross_compiling" = yes; then : - apu_try_berkeley_db=yes - -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include <stdlib.h> -#include <stdio.h> -#include <$apu_try_berkeley_db_header> -main () -{ - int major, minor, patch; - - db_version(&major, &minor, &patch); - - /* Sanity check: ensure that db.h constants actually match the db library */ - if (major != DB_VERSION_MAJOR - || minor != DB_VERSION_MINOR - || patch != DB_VERSION_PATCH) - exit (1); - - /* Run-time check: ensure the library claims to be the correct version. */ - - if ($apu_check_berkeley_db_major != -1) { - if (major < $apu_check_berkeley_db_major) - exit (1); - if (major > $apu_check_berkeley_db_major) - exit (0); - } - - if ($apu_check_berkeley_db_minor != -1) { - if (minor < $apu_check_berkeley_db_minor) - exit (1); - if (minor > $apu_check_berkeley_db_minor) - exit (0); - } - - if ($apu_check_berkeley_db_patch == -1 - || patch >= $apu_check_berkeley_db_patch) - exit (0); - else - exit (1); -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - apu_try_berkeley_db=yes -else - apu_try_berkeley_db=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - - LIBS="$apu_try_berkeley_db_save_libs" - - - eval "$cache_id=$apu_try_berkeley_db" - -fi - - result="`eval echo '$'$cache_id`" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $result" >&5 -$as_echo "$result" >&6; } - elif test ""4"" = "1"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbopen in -l$bdb_libname" >&5 -$as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dbopen (); -int -main () -{ -return dbopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - elif test ""4"" = "2"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for db_open in -l$bdb_libname" >&5 -$as_echo_n "checking for db_open in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char db_open (); -int -main () -{ -return db_open (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - fi - -else - result="no" -fi - - - - # If we found it, no need to search any more. - if test "$result" = "yes"; then - found="$bdb_place" - break - fi - done - test "$found" != "not" && break - done - test "$found" != "not" && break - done - - # Restore the original values of the flags we tweak. - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - - case "$found" in - "not") - apu_have_db=0 - ;; - "std") - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *":"*) - header="`echo $found | sed -e 's/:.*$//'`" - lib="`echo $found | sed -e 's/^.*://'`" - - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$header\"" - APRUTIL_INCLUDES="-I$header" - else - apr_addto_bugger="-I$header" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$lib\"" - APRUTIL_LDFLAGS="-L$lib" - else - apr_addto_bugger="-L$lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *) - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$found/include\"" - APRUTIL_INCLUDES="-I$found/include" - else - apr_addto_bugger="-I$found/include" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$found/lib\"" - APRUTIL_LDFLAGS="-L$found/lib" - else - apr_addto_bugger="-L$found/lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - esac - - if test "$apu_have_db" = "1"; then - apu_db_version=4 - fi - - if test "$apu_db_version" != "4"; then - - places="$all_places" - if test -z "$places"; then - places="std /usr/local/BerkeleyDB.4.7 /boot/home/config" - fi - - bdb_version="4" - if test ""7"" != "-1"; then - bdb_version="$bdb_version."7"" - if test ""-1"" != "-1"; then - bdb_version="$bdb_version."-1"" - fi - fi - bdb_places="$places" - bdb_default_search_headers="db47/db.h db4/db.h db.h" - bdb_default_search_lib_names="db-4.7 db4-4.7 db47 db4 db" - - - apu_have_db=0 - - # Save the original values of the flags we tweak. - apu_check_lib_save_libs="$LIBS" - apu_check_lib_save_ldflags="$LDFLAGS" - apu_check_lib_save_cppflags="$CPPFLAGS" - - # The variable `found' is the prefix under which we've found - # Berkeley DB, or `not' if we haven't found it anywhere yet. - found=not - for bdb_place in $bdb_places; do - - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - case "$bdb_place" in - "std" ) - description="the standard places" - ;; - *":"* ) - header="`echo $bdb_place | sed -e 's/:.*$//'`" - lib="`echo $bdb_place | sed -e 's/^.*://'`" - CPPFLAGS="$CPPFLAGS -I$header" - LDFLAGS="$LDFLAGS -L$lib" - description="$header and $lib" - ;; - * ) - if test -d $bdb_place; then - LDFLAGS="$LDFLAGS -L$bdb_place/lib" - CPPFLAGS="$CPPFLAGS -I$bdb_place/include" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $bdb_place" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: directory not found" >&5 -$as_echo "directory not found" >&6; } - continue - fi - description="$bdb_place" - ;; - esac - - # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this - # trick to display a message instead. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $description" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 -$as_echo "" >&6; } - - for bdb_libname in $bdb_default_search_lib_names; do - for bdb_header in $bdb_default_search_headers; do - # Clear the header cache variable for each location - - cache_id="`echo ac_cv_header_${bdb_header} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - unset $cache_id - as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - - if test ""4"" = "3" -o ""4"" = "4" -o ""4"" = "5"; then - # We generate a separate cache variable for each prefix and libname - # we search under. That way, we avoid caching information that - # changes if the user runs `configure' with a different set of - # switches. - - cache_id="`echo apu_cv_check_berkeley_db_"4"_"7"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -l$bdb_libname" >&5 -$as_echo_n "checking for -l$bdb_libname... " >&6; } - if eval \${$cache_id+:} false; then : - $as_echo_n "(cached) " >&6 -else - - - apu_try_berkeley_db_save_libs="$LIBS" - - apu_check_berkeley_db_major="4" - apu_check_berkeley_db_minor="7" - apu_check_berkeley_db_patch="-1" - apu_try_berkeley_db_header=$bdb_header - apu_try_berkeley_db_libname=$bdb_libname - - LIBS="$LIBS -l$apu_try_berkeley_db_libname" - if test "$cross_compiling" = yes; then : - apu_try_berkeley_db=yes - -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include <stdlib.h> -#include <stdio.h> -#include <$apu_try_berkeley_db_header> -main () -{ - int major, minor, patch; - - db_version(&major, &minor, &patch); - - /* Sanity check: ensure that db.h constants actually match the db library */ - if (major != DB_VERSION_MAJOR - || minor != DB_VERSION_MINOR - || patch != DB_VERSION_PATCH) - exit (1); - - /* Run-time check: ensure the library claims to be the correct version. */ - - if ($apu_check_berkeley_db_major != -1) { - if (major < $apu_check_berkeley_db_major) - exit (1); - if (major > $apu_check_berkeley_db_major) - exit (0); - } - - if ($apu_check_berkeley_db_minor != -1) { - if (minor < $apu_check_berkeley_db_minor) - exit (1); - if (minor > $apu_check_berkeley_db_minor) - exit (0); - } - - if ($apu_check_berkeley_db_patch == -1 - || patch >= $apu_check_berkeley_db_patch) - exit (0); - else - exit (1); -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - apu_try_berkeley_db=yes -else - apu_try_berkeley_db=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - - LIBS="$apu_try_berkeley_db_save_libs" - - - eval "$cache_id=$apu_try_berkeley_db" - -fi - - result="`eval echo '$'$cache_id`" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $result" >&5 -$as_echo "$result" >&6; } - elif test ""4"" = "1"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbopen in -l$bdb_libname" >&5 -$as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dbopen (); -int -main () -{ -return dbopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - elif test ""4"" = "2"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for db_open in -l$bdb_libname" >&5 -$as_echo_n "checking for db_open in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char db_open (); -int -main () -{ -return db_open (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - fi - -else - result="no" -fi - - - - # If we found it, no need to search any more. - if test "$result" = "yes"; then - found="$bdb_place" - break - fi - done - test "$found" != "not" && break - done - test "$found" != "not" && break - done - - # Restore the original values of the flags we tweak. - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - - case "$found" in - "not") - apu_have_db=0 - ;; - "std") - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *":"*) - header="`echo $found | sed -e 's/:.*$//'`" - lib="`echo $found | sed -e 's/^.*://'`" - - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$header\"" - APRUTIL_INCLUDES="-I$header" - else - apr_addto_bugger="-I$header" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$lib\"" - APRUTIL_LDFLAGS="-L$lib" - else - apr_addto_bugger="-L$lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *) - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$found/include\"" - APRUTIL_INCLUDES="-I$found/include" - else - apr_addto_bugger="-I$found/include" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$found/lib\"" - APRUTIL_LDFLAGS="-L$found/lib" - else - apr_addto_bugger="-L$found/lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - esac - - if test "$apu_have_db" = "1"; then - apu_db_version=4 - fi - - if test "$apu_db_version" != "4"; then - - places="$all_places" - if test -z "$places"; then - places="std /usr/local/BerkeleyDB.4.6 /boot/home/config" - fi - - bdb_version="4" - if test ""6"" != "-1"; then - bdb_version="$bdb_version."6"" - if test ""-1"" != "-1"; then - bdb_version="$bdb_version."-1"" - fi - fi - bdb_places="$places" - bdb_default_search_headers="db46/db.h db4/db.h db.h" - bdb_default_search_lib_names="db-4.6 db4-4.6 db46 db4 db" - - - apu_have_db=0 - - # Save the original values of the flags we tweak. - apu_check_lib_save_libs="$LIBS" - apu_check_lib_save_ldflags="$LDFLAGS" - apu_check_lib_save_cppflags="$CPPFLAGS" - - # The variable `found' is the prefix under which we've found - # Berkeley DB, or `not' if we haven't found it anywhere yet. - found=not - for bdb_place in $bdb_places; do - - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - case "$bdb_place" in - "std" ) - description="the standard places" - ;; - *":"* ) - header="`echo $bdb_place | sed -e 's/:.*$//'`" - lib="`echo $bdb_place | sed -e 's/^.*://'`" - CPPFLAGS="$CPPFLAGS -I$header" - LDFLAGS="$LDFLAGS -L$lib" - description="$header and $lib" - ;; - * ) - if test -d $bdb_place; then - LDFLAGS="$LDFLAGS -L$bdb_place/lib" - CPPFLAGS="$CPPFLAGS -I$bdb_place/include" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $bdb_place" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: directory not found" >&5 -$as_echo "directory not found" >&6; } - continue - fi - description="$bdb_place" - ;; - esac - - # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this - # trick to display a message instead. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $description" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 -$as_echo "" >&6; } - - for bdb_libname in $bdb_default_search_lib_names; do - for bdb_header in $bdb_default_search_headers; do - # Clear the header cache variable for each location - - cache_id="`echo ac_cv_header_${bdb_header} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - unset $cache_id - as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - - if test ""4"" = "3" -o ""4"" = "4" -o ""4"" = "5"; then - # We generate a separate cache variable for each prefix and libname - # we search under. That way, we avoid caching information that - # changes if the user runs `configure' with a different set of - # switches. - - cache_id="`echo apu_cv_check_berkeley_db_"4"_"6"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -l$bdb_libname" >&5 -$as_echo_n "checking for -l$bdb_libname... " >&6; } - if eval \${$cache_id+:} false; then : - $as_echo_n "(cached) " >&6 -else - - - apu_try_berkeley_db_save_libs="$LIBS" - - apu_check_berkeley_db_major="4" - apu_check_berkeley_db_minor="6" - apu_check_berkeley_db_patch="-1" - apu_try_berkeley_db_header=$bdb_header - apu_try_berkeley_db_libname=$bdb_libname - - LIBS="$LIBS -l$apu_try_berkeley_db_libname" - if test "$cross_compiling" = yes; then : - apu_try_berkeley_db=yes - -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include <stdlib.h> -#include <stdio.h> -#include <$apu_try_berkeley_db_header> -main () -{ - int major, minor, patch; - - db_version(&major, &minor, &patch); - - /* Sanity check: ensure that db.h constants actually match the db library */ - if (major != DB_VERSION_MAJOR - || minor != DB_VERSION_MINOR - || patch != DB_VERSION_PATCH) - exit (1); - - /* Run-time check: ensure the library claims to be the correct version. */ - - if ($apu_check_berkeley_db_major != -1) { - if (major < $apu_check_berkeley_db_major) - exit (1); - if (major > $apu_check_berkeley_db_major) - exit (0); - } - - if ($apu_check_berkeley_db_minor != -1) { - if (minor < $apu_check_berkeley_db_minor) - exit (1); - if (minor > $apu_check_berkeley_db_minor) - exit (0); - } - - if ($apu_check_berkeley_db_patch == -1 - || patch >= $apu_check_berkeley_db_patch) - exit (0); - else - exit (1); -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - apu_try_berkeley_db=yes -else - apu_try_berkeley_db=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - - LIBS="$apu_try_berkeley_db_save_libs" - - - eval "$cache_id=$apu_try_berkeley_db" - -fi - - result="`eval echo '$'$cache_id`" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $result" >&5 -$as_echo "$result" >&6; } - elif test ""4"" = "1"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbopen in -l$bdb_libname" >&5 -$as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dbopen (); -int -main () -{ -return dbopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - elif test ""4"" = "2"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for db_open in -l$bdb_libname" >&5 -$as_echo_n "checking for db_open in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char db_open (); -int -main () -{ -return db_open (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - fi - -else - result="no" -fi - - - - # If we found it, no need to search any more. - if test "$result" = "yes"; then - found="$bdb_place" - break - fi - done - test "$found" != "not" && break - done - test "$found" != "not" && break - done - - # Restore the original values of the flags we tweak. - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - - case "$found" in - "not") - apu_have_db=0 - ;; - "std") - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *":"*) - header="`echo $found | sed -e 's/:.*$//'`" - lib="`echo $found | sed -e 's/^.*://'`" - - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$header\"" - APRUTIL_INCLUDES="-I$header" - else - apr_addto_bugger="-I$header" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$lib\"" - APRUTIL_LDFLAGS="-L$lib" - else - apr_addto_bugger="-L$lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *) - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$found/include\"" - APRUTIL_INCLUDES="-I$found/include" - else - apr_addto_bugger="-I$found/include" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$found/lib\"" - APRUTIL_LDFLAGS="-L$found/lib" - else - apr_addto_bugger="-L$found/lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - esac - - if test "$apu_have_db" = "1"; then - apu_db_version=4 - fi - - if test "$apu_db_version" != "4"; then - - places="$all_places" - if test -z "$places"; then - places="std /usr/local/BerkeleyDB.4.5 /boot/home/config" - fi - - bdb_version="4" - if test ""5"" != "-1"; then - bdb_version="$bdb_version."5"" - if test ""-1"" != "-1"; then - bdb_version="$bdb_version."-1"" - fi - fi - bdb_places="$places" - bdb_default_search_headers="db45/db.h db4/db.h db.h" - bdb_default_search_lib_names="db-4.5 db4-4.5 db45 db4 db" - - - apu_have_db=0 - - # Save the original values of the flags we tweak. - apu_check_lib_save_libs="$LIBS" - apu_check_lib_save_ldflags="$LDFLAGS" - apu_check_lib_save_cppflags="$CPPFLAGS" - - # The variable `found' is the prefix under which we've found - # Berkeley DB, or `not' if we haven't found it anywhere yet. - found=not - for bdb_place in $bdb_places; do - - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - case "$bdb_place" in - "std" ) - description="the standard places" - ;; - *":"* ) - header="`echo $bdb_place | sed -e 's/:.*$//'`" - lib="`echo $bdb_place | sed -e 's/^.*://'`" - CPPFLAGS="$CPPFLAGS -I$header" - LDFLAGS="$LDFLAGS -L$lib" - description="$header and $lib" - ;; - * ) - if test -d $bdb_place; then - LDFLAGS="$LDFLAGS -L$bdb_place/lib" - CPPFLAGS="$CPPFLAGS -I$bdb_place/include" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $bdb_place" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: directory not found" >&5 -$as_echo "directory not found" >&6; } - continue - fi - description="$bdb_place" - ;; - esac - - # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this - # trick to display a message instead. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $description" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 -$as_echo "" >&6; } - - for bdb_libname in $bdb_default_search_lib_names; do - for bdb_header in $bdb_default_search_headers; do - # Clear the header cache variable for each location - - cache_id="`echo ac_cv_header_${bdb_header} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - unset $cache_id - as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - - if test ""4"" = "3" -o ""4"" = "4" -o ""4"" = "5"; then - # We generate a separate cache variable for each prefix and libname - # we search under. That way, we avoid caching information that - # changes if the user runs `configure' with a different set of - # switches. - - cache_id="`echo apu_cv_check_berkeley_db_"4"_"5"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -l$bdb_libname" >&5 -$as_echo_n "checking for -l$bdb_libname... " >&6; } - if eval \${$cache_id+:} false; then : - $as_echo_n "(cached) " >&6 -else - - - apu_try_berkeley_db_save_libs="$LIBS" - - apu_check_berkeley_db_major="4" - apu_check_berkeley_db_minor="5" - apu_check_berkeley_db_patch="-1" - apu_try_berkeley_db_header=$bdb_header - apu_try_berkeley_db_libname=$bdb_libname - - LIBS="$LIBS -l$apu_try_berkeley_db_libname" - if test "$cross_compiling" = yes; then : - apu_try_berkeley_db=yes - -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include <stdlib.h> -#include <stdio.h> -#include <$apu_try_berkeley_db_header> -main () -{ - int major, minor, patch; - - db_version(&major, &minor, &patch); - - /* Sanity check: ensure that db.h constants actually match the db library */ - if (major != DB_VERSION_MAJOR - || minor != DB_VERSION_MINOR - || patch != DB_VERSION_PATCH) - exit (1); - - /* Run-time check: ensure the library claims to be the correct version. */ - - if ($apu_check_berkeley_db_major != -1) { - if (major < $apu_check_berkeley_db_major) - exit (1); - if (major > $apu_check_berkeley_db_major) - exit (0); - } - - if ($apu_check_berkeley_db_minor != -1) { - if (minor < $apu_check_berkeley_db_minor) - exit (1); - if (minor > $apu_check_berkeley_db_minor) - exit (0); - } - - if ($apu_check_berkeley_db_patch == -1 - || patch >= $apu_check_berkeley_db_patch) - exit (0); - else - exit (1); -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - apu_try_berkeley_db=yes -else - apu_try_berkeley_db=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - - LIBS="$apu_try_berkeley_db_save_libs" - - - eval "$cache_id=$apu_try_berkeley_db" - -fi - - result="`eval echo '$'$cache_id`" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $result" >&5 -$as_echo "$result" >&6; } - elif test ""4"" = "1"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbopen in -l$bdb_libname" >&5 -$as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dbopen (); -int -main () -{ -return dbopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - elif test ""4"" = "2"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for db_open in -l$bdb_libname" >&5 -$as_echo_n "checking for db_open in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char db_open (); -int -main () -{ -return db_open (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - fi - -else - result="no" -fi - - - - # If we found it, no need to search any more. - if test "$result" = "yes"; then - found="$bdb_place" - break - fi - done - test "$found" != "not" && break - done - test "$found" != "not" && break - done - - # Restore the original values of the flags we tweak. - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - - case "$found" in - "not") - apu_have_db=0 - ;; - "std") - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *":"*) - header="`echo $found | sed -e 's/:.*$//'`" - lib="`echo $found | sed -e 's/^.*://'`" - - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$header\"" - APRUTIL_INCLUDES="-I$header" - else - apr_addto_bugger="-I$header" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$lib\"" - APRUTIL_LDFLAGS="-L$lib" - else - apr_addto_bugger="-L$lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *) - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$found/include\"" - APRUTIL_INCLUDES="-I$found/include" - else - apr_addto_bugger="-I$found/include" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$found/lib\"" - APRUTIL_LDFLAGS="-L$found/lib" - else - apr_addto_bugger="-L$found/lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - esac - - if test "$apu_have_db" = "1"; then - apu_db_version=4 - fi - - if test "$apu_db_version" != "4"; then - - places="$all_places" - if test -z "$places"; then - places="std /usr/local/BerkeleyDB.4.4 /boot/home/config" - fi - - bdb_version="4" - if test ""4"" != "-1"; then - bdb_version="$bdb_version."4"" - if test ""-1"" != "-1"; then - bdb_version="$bdb_version."-1"" - fi - fi - bdb_places="$places" - bdb_default_search_headers="db44/db.h db4/db.h db.h" - bdb_default_search_lib_names="db-4.4 db4-4.4 db44 db4 db" - - - apu_have_db=0 - - # Save the original values of the flags we tweak. - apu_check_lib_save_libs="$LIBS" - apu_check_lib_save_ldflags="$LDFLAGS" - apu_check_lib_save_cppflags="$CPPFLAGS" - - # The variable `found' is the prefix under which we've found - # Berkeley DB, or `not' if we haven't found it anywhere yet. - found=not - for bdb_place in $bdb_places; do - - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - case "$bdb_place" in - "std" ) - description="the standard places" - ;; - *":"* ) - header="`echo $bdb_place | sed -e 's/:.*$//'`" - lib="`echo $bdb_place | sed -e 's/^.*://'`" - CPPFLAGS="$CPPFLAGS -I$header" - LDFLAGS="$LDFLAGS -L$lib" - description="$header and $lib" - ;; - * ) - if test -d $bdb_place; then - LDFLAGS="$LDFLAGS -L$bdb_place/lib" - CPPFLAGS="$CPPFLAGS -I$bdb_place/include" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $bdb_place" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: directory not found" >&5 -$as_echo "directory not found" >&6; } - continue - fi - description="$bdb_place" - ;; - esac - - # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this - # trick to display a message instead. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $description" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 -$as_echo "" >&6; } - - for bdb_libname in $bdb_default_search_lib_names; do - for bdb_header in $bdb_default_search_headers; do - # Clear the header cache variable for each location - - cache_id="`echo ac_cv_header_${bdb_header} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - unset $cache_id - as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - - if test ""4"" = "3" -o ""4"" = "4" -o ""4"" = "5"; then - # We generate a separate cache variable for each prefix and libname - # we search under. That way, we avoid caching information that - # changes if the user runs `configure' with a different set of - # switches. - - cache_id="`echo apu_cv_check_berkeley_db_"4"_"4"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -l$bdb_libname" >&5 -$as_echo_n "checking for -l$bdb_libname... " >&6; } - if eval \${$cache_id+:} false; then : - $as_echo_n "(cached) " >&6 -else - - - apu_try_berkeley_db_save_libs="$LIBS" - - apu_check_berkeley_db_major="4" - apu_check_berkeley_db_minor="4" - apu_check_berkeley_db_patch="-1" - apu_try_berkeley_db_header=$bdb_header - apu_try_berkeley_db_libname=$bdb_libname - - LIBS="$LIBS -l$apu_try_berkeley_db_libname" - if test "$cross_compiling" = yes; then : - apu_try_berkeley_db=yes - -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include <stdlib.h> -#include <stdio.h> -#include <$apu_try_berkeley_db_header> -main () -{ - int major, minor, patch; - - db_version(&major, &minor, &patch); - - /* Sanity check: ensure that db.h constants actually match the db library */ - if (major != DB_VERSION_MAJOR - || minor != DB_VERSION_MINOR - || patch != DB_VERSION_PATCH) - exit (1); - - /* Run-time check: ensure the library claims to be the correct version. */ - - if ($apu_check_berkeley_db_major != -1) { - if (major < $apu_check_berkeley_db_major) - exit (1); - if (major > $apu_check_berkeley_db_major) - exit (0); - } - - if ($apu_check_berkeley_db_minor != -1) { - if (minor < $apu_check_berkeley_db_minor) - exit (1); - if (minor > $apu_check_berkeley_db_minor) - exit (0); - } - - if ($apu_check_berkeley_db_patch == -1 - || patch >= $apu_check_berkeley_db_patch) - exit (0); - else - exit (1); -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - apu_try_berkeley_db=yes -else - apu_try_berkeley_db=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - - LIBS="$apu_try_berkeley_db_save_libs" - - - eval "$cache_id=$apu_try_berkeley_db" - -fi - - result="`eval echo '$'$cache_id`" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $result" >&5 -$as_echo "$result" >&6; } - elif test ""4"" = "1"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbopen in -l$bdb_libname" >&5 -$as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dbopen (); -int -main () -{ -return dbopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - elif test ""4"" = "2"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for db_open in -l$bdb_libname" >&5 -$as_echo_n "checking for db_open in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char db_open (); -int -main () -{ -return db_open (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - fi - -else - result="no" -fi - - - - # If we found it, no need to search any more. - if test "$result" = "yes"; then - found="$bdb_place" - break - fi - done - test "$found" != "not" && break - done - test "$found" != "not" && break - done - - # Restore the original values of the flags we tweak. - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - - case "$found" in - "not") - apu_have_db=0 - ;; - "std") - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *":"*) - header="`echo $found | sed -e 's/:.*$//'`" - lib="`echo $found | sed -e 's/^.*://'`" - - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$header\"" - APRUTIL_INCLUDES="-I$header" - else - apr_addto_bugger="-I$header" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$lib\"" - APRUTIL_LDFLAGS="-L$lib" - else - apr_addto_bugger="-L$lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *) - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$found/include\"" - APRUTIL_INCLUDES="-I$found/include" - else - apr_addto_bugger="-I$found/include" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$found/lib\"" - APRUTIL_LDFLAGS="-L$found/lib" - else - apr_addto_bugger="-L$found/lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - esac - - if test "$apu_have_db" = "1"; then - apu_db_version=4 - fi - - if test "$apu_db_version" != "4"; then - - places="$all_places" - if test -z "$places"; then - places="std /usr/local/BerkeleyDB.4.3 /boot/home/config" - fi - - bdb_version="4" - if test ""3"" != "-1"; then - bdb_version="$bdb_version."3"" - if test ""-1"" != "-1"; then - bdb_version="$bdb_version."-1"" - fi - fi - bdb_places="$places" - bdb_default_search_headers="db43/db.h db4/db.h db.h" - bdb_default_search_lib_names="db-4.3 db4-4.3 db43 db4 db" - - - apu_have_db=0 - - # Save the original values of the flags we tweak. - apu_check_lib_save_libs="$LIBS" - apu_check_lib_save_ldflags="$LDFLAGS" - apu_check_lib_save_cppflags="$CPPFLAGS" - - # The variable `found' is the prefix under which we've found - # Berkeley DB, or `not' if we haven't found it anywhere yet. - found=not - for bdb_place in $bdb_places; do - - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - case "$bdb_place" in - "std" ) - description="the standard places" - ;; - *":"* ) - header="`echo $bdb_place | sed -e 's/:.*$//'`" - lib="`echo $bdb_place | sed -e 's/^.*://'`" - CPPFLAGS="$CPPFLAGS -I$header" - LDFLAGS="$LDFLAGS -L$lib" - description="$header and $lib" - ;; - * ) - if test -d $bdb_place; then - LDFLAGS="$LDFLAGS -L$bdb_place/lib" - CPPFLAGS="$CPPFLAGS -I$bdb_place/include" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $bdb_place" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: directory not found" >&5 -$as_echo "directory not found" >&6; } - continue - fi - description="$bdb_place" - ;; - esac - - # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this - # trick to display a message instead. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $description" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 -$as_echo "" >&6; } - - for bdb_libname in $bdb_default_search_lib_names; do - for bdb_header in $bdb_default_search_headers; do - # Clear the header cache variable for each location - - cache_id="`echo ac_cv_header_${bdb_header} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - unset $cache_id - as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - - if test ""4"" = "3" -o ""4"" = "4" -o ""4"" = "5"; then - # We generate a separate cache variable for each prefix and libname - # we search under. That way, we avoid caching information that - # changes if the user runs `configure' with a different set of - # switches. - - cache_id="`echo apu_cv_check_berkeley_db_"4"_"3"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -l$bdb_libname" >&5 -$as_echo_n "checking for -l$bdb_libname... " >&6; } - if eval \${$cache_id+:} false; then : - $as_echo_n "(cached) " >&6 -else - - - apu_try_berkeley_db_save_libs="$LIBS" - - apu_check_berkeley_db_major="4" - apu_check_berkeley_db_minor="3" - apu_check_berkeley_db_patch="-1" - apu_try_berkeley_db_header=$bdb_header - apu_try_berkeley_db_libname=$bdb_libname - - LIBS="$LIBS -l$apu_try_berkeley_db_libname" - if test "$cross_compiling" = yes; then : - apu_try_berkeley_db=yes - -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include <stdlib.h> -#include <stdio.h> -#include <$apu_try_berkeley_db_header> -main () -{ - int major, minor, patch; - - db_version(&major, &minor, &patch); - - /* Sanity check: ensure that db.h constants actually match the db library */ - if (major != DB_VERSION_MAJOR - || minor != DB_VERSION_MINOR - || patch != DB_VERSION_PATCH) - exit (1); - - /* Run-time check: ensure the library claims to be the correct version. */ - - if ($apu_check_berkeley_db_major != -1) { - if (major < $apu_check_berkeley_db_major) - exit (1); - if (major > $apu_check_berkeley_db_major) - exit (0); - } - - if ($apu_check_berkeley_db_minor != -1) { - if (minor < $apu_check_berkeley_db_minor) - exit (1); - if (minor > $apu_check_berkeley_db_minor) - exit (0); - } - - if ($apu_check_berkeley_db_patch == -1 - || patch >= $apu_check_berkeley_db_patch) - exit (0); - else - exit (1); -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - apu_try_berkeley_db=yes -else - apu_try_berkeley_db=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - - LIBS="$apu_try_berkeley_db_save_libs" - - - eval "$cache_id=$apu_try_berkeley_db" - -fi - - result="`eval echo '$'$cache_id`" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $result" >&5 -$as_echo "$result" >&6; } - elif test ""4"" = "1"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbopen in -l$bdb_libname" >&5 -$as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dbopen (); -int -main () -{ -return dbopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - elif test ""4"" = "2"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for db_open in -l$bdb_libname" >&5 -$as_echo_n "checking for db_open in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char db_open (); -int -main () -{ -return db_open (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - fi - -else - result="no" -fi - - - - # If we found it, no need to search any more. - if test "$result" = "yes"; then - found="$bdb_place" - break - fi - done - test "$found" != "not" && break - done - test "$found" != "not" && break - done - - # Restore the original values of the flags we tweak. - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - - case "$found" in - "not") - apu_have_db=0 - ;; - "std") - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *":"*) - header="`echo $found | sed -e 's/:.*$//'`" - lib="`echo $found | sed -e 's/^.*://'`" - - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$header\"" - APRUTIL_INCLUDES="-I$header" - else - apr_addto_bugger="-I$header" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$lib\"" - APRUTIL_LDFLAGS="-L$lib" - else - apr_addto_bugger="-L$lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *) - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$found/include\"" - APRUTIL_INCLUDES="-I$found/include" - else - apr_addto_bugger="-I$found/include" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$found/lib\"" - APRUTIL_LDFLAGS="-L$found/lib" - else - apr_addto_bugger="-L$found/lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - esac - - if test "$apu_have_db" = "1"; then - apu_db_version=4 - fi - - if test "$apu_db_version" != "4"; then - - places="$all_places" - if test -z "$places"; then - places="std /usr/local /usr/local/BerkeleyDB.4.2 /boot/home/config" - fi - - bdb_version="4" - if test ""2"" != "-1"; then - bdb_version="$bdb_version."2"" - if test ""-1"" != "-1"; then - bdb_version="$bdb_version."-1"" - fi - fi - bdb_places="$places" - bdb_default_search_headers="db42/db.h db4/db.h db.h" - bdb_default_search_lib_names="db-4.2 db42 db4 db" - - - apu_have_db=0 - - # Save the original values of the flags we tweak. - apu_check_lib_save_libs="$LIBS" - apu_check_lib_save_ldflags="$LDFLAGS" - apu_check_lib_save_cppflags="$CPPFLAGS" - - # The variable `found' is the prefix under which we've found - # Berkeley DB, or `not' if we haven't found it anywhere yet. - found=not - for bdb_place in $bdb_places; do - - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - case "$bdb_place" in - "std" ) - description="the standard places" - ;; - *":"* ) - header="`echo $bdb_place | sed -e 's/:.*$//'`" - lib="`echo $bdb_place | sed -e 's/^.*://'`" - CPPFLAGS="$CPPFLAGS -I$header" - LDFLAGS="$LDFLAGS -L$lib" - description="$header and $lib" - ;; - * ) - if test -d $bdb_place; then - LDFLAGS="$LDFLAGS -L$bdb_place/lib" - CPPFLAGS="$CPPFLAGS -I$bdb_place/include" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $bdb_place" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: directory not found" >&5 -$as_echo "directory not found" >&6; } - continue - fi - description="$bdb_place" - ;; - esac - - # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this - # trick to display a message instead. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $description" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 -$as_echo "" >&6; } - - for bdb_libname in $bdb_default_search_lib_names; do - for bdb_header in $bdb_default_search_headers; do - # Clear the header cache variable for each location - - cache_id="`echo ac_cv_header_${bdb_header} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - unset $cache_id - as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - - if test ""4"" = "3" -o ""4"" = "4" -o ""4"" = "5"; then - # We generate a separate cache variable for each prefix and libname - # we search under. That way, we avoid caching information that - # changes if the user runs `configure' with a different set of - # switches. - - cache_id="`echo apu_cv_check_berkeley_db_"4"_"2"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -l$bdb_libname" >&5 -$as_echo_n "checking for -l$bdb_libname... " >&6; } - if eval \${$cache_id+:} false; then : - $as_echo_n "(cached) " >&6 -else - - - apu_try_berkeley_db_save_libs="$LIBS" - - apu_check_berkeley_db_major="4" - apu_check_berkeley_db_minor="2" - apu_check_berkeley_db_patch="-1" - apu_try_berkeley_db_header=$bdb_header - apu_try_berkeley_db_libname=$bdb_libname - - LIBS="$LIBS -l$apu_try_berkeley_db_libname" - if test "$cross_compiling" = yes; then : - apu_try_berkeley_db=yes - -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include <stdlib.h> -#include <stdio.h> -#include <$apu_try_berkeley_db_header> -main () -{ - int major, minor, patch; - - db_version(&major, &minor, &patch); - - /* Sanity check: ensure that db.h constants actually match the db library */ - if (major != DB_VERSION_MAJOR - || minor != DB_VERSION_MINOR - || patch != DB_VERSION_PATCH) - exit (1); - - /* Run-time check: ensure the library claims to be the correct version. */ - - if ($apu_check_berkeley_db_major != -1) { - if (major < $apu_check_berkeley_db_major) - exit (1); - if (major > $apu_check_berkeley_db_major) - exit (0); - } - - if ($apu_check_berkeley_db_minor != -1) { - if (minor < $apu_check_berkeley_db_minor) - exit (1); - if (minor > $apu_check_berkeley_db_minor) - exit (0); - } - - if ($apu_check_berkeley_db_patch == -1 - || patch >= $apu_check_berkeley_db_patch) - exit (0); - else - exit (1); -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - apu_try_berkeley_db=yes -else - apu_try_berkeley_db=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - - LIBS="$apu_try_berkeley_db_save_libs" - - - eval "$cache_id=$apu_try_berkeley_db" - -fi - - result="`eval echo '$'$cache_id`" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $result" >&5 -$as_echo "$result" >&6; } - elif test ""4"" = "1"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbopen in -l$bdb_libname" >&5 -$as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dbopen (); -int -main () -{ -return dbopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - elif test ""4"" = "2"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for db_open in -l$bdb_libname" >&5 -$as_echo_n "checking for db_open in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char db_open (); -int -main () -{ -return db_open (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - fi - -else - result="no" -fi - - - - # If we found it, no need to search any more. - if test "$result" = "yes"; then - found="$bdb_place" - break - fi - done - test "$found" != "not" && break - done - test "$found" != "not" && break - done - - # Restore the original values of the flags we tweak. - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - - case "$found" in - "not") - apu_have_db=0 - ;; - "std") - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *":"*) - header="`echo $found | sed -e 's/:.*$//'`" - lib="`echo $found | sed -e 's/^.*://'`" - - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$header\"" - APRUTIL_INCLUDES="-I$header" - else - apr_addto_bugger="-I$header" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$lib\"" - APRUTIL_LDFLAGS="-L$lib" - else - apr_addto_bugger="-L$lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *) - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$found/include\"" - APRUTIL_INCLUDES="-I$found/include" - else - apr_addto_bugger="-I$found/include" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$found/lib\"" - APRUTIL_LDFLAGS="-L$found/lib" - else - apr_addto_bugger="-L$found/lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - esac - - if test "$apu_have_db" = "1"; then - apu_db_version=4 - fi - - if test "$apu_db_version" != "4"; then - - places="$all_places" - if test -z "$places"; then - places="std /usr/local /usr/local/BerkeleyDB.4.1 /boot/home/config" + places="std /usr/local /usr/local/BerkeleyDB.${db_major}.${db_minor} /boot/home/config" fi - bdb_version="4" - if test ""1"" != "-1"; then - bdb_version="$bdb_version."1"" + bdb_version="${db_major}" + if test ""${db_minor}"" != "-1"; then + bdb_version="$bdb_version."${db_minor}"" if test ""-1"" != "-1"; then bdb_version="$bdb_version."-1"" fi fi bdb_places="$places" - bdb_default_search_headers="db41/db.h db4/db.h db.h" - bdb_default_search_lib_names="db-4.1 db41 db4 db" + bdb_default_search_headers="db${db_major}${db_minor}/db.h db${db_major}/db.h db.h" + bdb_default_search_lib_names="db-${db_major}.${db_minor} db${db_major}-${db_major}.${db_minor} db${db_major}${db_minor} db-${db_major} db${db_major} db" apu_have_db=0 @@ -16499,13 +12174,13 @@ $as_echo "" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - if test ""4"" = "3" -o ""4"" = "4" -o ""4"" = "5"; then + if test ""${db_major}"" = "3" -o ""${db_major}"" = "4" -o ""${db_major}"" = "5"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of # switches. - cache_id="`echo apu_cv_check_berkeley_db_"4"_"1"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \ + cache_id="`echo apu_cv_check_berkeley_db_"${db_major}"_"${db_minor}"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \ | sed -e 's/[^a-zA-Z0-9_]/_/g'`" @@ -16518,8 +12193,8 @@ else apu_try_berkeley_db_save_libs="$LIBS" - apu_check_berkeley_db_major="4" - apu_check_berkeley_db_minor="1" + apu_check_berkeley_db_major="${db_major}" + apu_check_berkeley_db_minor="${db_minor}" apu_check_berkeley_db_patch="-1" apu_try_berkeley_db_header=$bdb_header apu_try_berkeley_db_libname=$bdb_libname @@ -16591,7 +12266,7 @@ fi result="`eval echo '$'$cache_id`" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $result" >&5 $as_echo "$result" >&6; } - elif test ""4"" = "1"; then + elif test ""${db_major}"" = "1"; then as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbopen in -l$bdb_libname" >&5 $as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; } @@ -16637,7 +12312,7 @@ else fi - elif test ""4"" = "2"; then + elif test ""${db_major}"" = "2"; then as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for db_open in -l$bdb_libname" >&5 $as_echo_n "checking for db_open in -l$bdb_libname... " >&6; } @@ -16815,407 +12490,15 @@ fi esac if test "$apu_have_db" = "1"; then - apu_db_version=4 - fi - - if test "$apu_db_version" != "4"; then - - places="$all_places" - if test -z "$places"; then - places="std /usr/local /usr/local/BerkeleyDB.4.0 /boot/home/config" + apu_db_version=${db_major} fi - bdb_version="4" - if test ""0"" != "-1"; then - bdb_version="$bdb_version."0"" - if test ""-1"" != "-1"; then - bdb_version="$bdb_version."-1"" + if test "$apu_have_db" = "1"; then + break fi - fi - bdb_places="$places" - bdb_default_search_headers="db4/db.h db.h" - bdb_default_search_lib_names="db-4.0 db4 db" - - - apu_have_db=0 - - # Save the original values of the flags we tweak. - apu_check_lib_save_libs="$LIBS" - apu_check_lib_save_ldflags="$LDFLAGS" - apu_check_lib_save_cppflags="$CPPFLAGS" - - # The variable `found' is the prefix under which we've found - # Berkeley DB, or `not' if we haven't found it anywhere yet. - found=not - for bdb_place in $bdb_places; do - - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - case "$bdb_place" in - "std" ) - description="the standard places" - ;; - *":"* ) - header="`echo $bdb_place | sed -e 's/:.*$//'`" - lib="`echo $bdb_place | sed -e 's/^.*://'`" - CPPFLAGS="$CPPFLAGS -I$header" - LDFLAGS="$LDFLAGS -L$lib" - description="$header and $lib" - ;; - * ) - if test -d $bdb_place; then - LDFLAGS="$LDFLAGS -L$bdb_place/lib" - CPPFLAGS="$CPPFLAGS -I$bdb_place/include" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $bdb_place" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: directory not found" >&5 -$as_echo "directory not found" >&6; } - continue - fi - description="$bdb_place" - ;; - esac - - # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this - # trick to display a message instead. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $description" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 -$as_echo "" >&6; } - - for bdb_libname in $bdb_default_search_lib_names; do - for bdb_header in $bdb_default_search_headers; do - # Clear the header cache variable for each location - - cache_id="`echo ac_cv_header_${bdb_header} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - unset $cache_id - as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - - if test ""4"" = "3" -o ""4"" = "4" -o ""4"" = "5"; then - # We generate a separate cache variable for each prefix and libname - # we search under. That way, we avoid caching information that - # changes if the user runs `configure' with a different set of - # switches. - - cache_id="`echo apu_cv_check_berkeley_db_"4"_"0"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -l$bdb_libname" >&5 -$as_echo_n "checking for -l$bdb_libname... " >&6; } - if eval \${$cache_id+:} false; then : - $as_echo_n "(cached) " >&6 -else - - - apu_try_berkeley_db_save_libs="$LIBS" - - apu_check_berkeley_db_major="4" - apu_check_berkeley_db_minor="0" - apu_check_berkeley_db_patch="-1" - apu_try_berkeley_db_header=$bdb_header - apu_try_berkeley_db_libname=$bdb_libname - - LIBS="$LIBS -l$apu_try_berkeley_db_libname" - if test "$cross_compiling" = yes; then : - apu_try_berkeley_db=yes - -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include <stdlib.h> -#include <stdio.h> -#include <$apu_try_berkeley_db_header> -main () -{ - int major, minor, patch; - - db_version(&major, &minor, &patch); - - /* Sanity check: ensure that db.h constants actually match the db library */ - if (major != DB_VERSION_MAJOR - || minor != DB_VERSION_MINOR - || patch != DB_VERSION_PATCH) - exit (1); - - /* Run-time check: ensure the library claims to be the correct version. */ - - if ($apu_check_berkeley_db_major != -1) { - if (major < $apu_check_berkeley_db_major) - exit (1); - if (major > $apu_check_berkeley_db_major) - exit (0); - } - - if ($apu_check_berkeley_db_minor != -1) { - if (minor < $apu_check_berkeley_db_minor) - exit (1); - if (minor > $apu_check_berkeley_db_minor) - exit (0); - } - - if ($apu_check_berkeley_db_patch == -1 - || patch >= $apu_check_berkeley_db_patch) - exit (0); - else - exit (1); -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - apu_try_berkeley_db=yes -else - apu_try_berkeley_db=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - - LIBS="$apu_try_berkeley_db_save_libs" - - - eval "$cache_id=$apu_try_berkeley_db" - -fi - - result="`eval echo '$'$cache_id`" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $result" >&5 -$as_echo "$result" >&6; } - elif test ""4"" = "1"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbopen in -l$bdb_libname" >&5 -$as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dbopen (); -int -main () -{ -return dbopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - elif test ""4"" = "2"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for db_open in -l$bdb_libname" >&5 -$as_echo_n "checking for db_open in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char db_open (); -int -main () -{ -return db_open (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - fi - -else - result="no" -fi - - - - # If we found it, no need to search any more. - if test "$result" = "yes"; then - found="$bdb_place" - break - fi - done - test "$found" != "not" && break - done - test "$found" != "not" && break + db_version=`expr $db_version - 1` done - - # Restore the original values of the flags we tweak. - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - - case "$found" in - "not") - apu_have_db=0 - ;; - "std") - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *":"*) - header="`echo $found | sed -e 's/:.*$//'`" - lib="`echo $found | sed -e 's/^.*://'`" - - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$header\"" - APRUTIL_INCLUDES="-I$header" - else - apr_addto_bugger="-I$header" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$lib\"" - APRUTIL_LDFLAGS="-L$lib" - else - apr_addto_bugger="-L$lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *) - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$found/include\"" - APRUTIL_INCLUDES="-I$found/include" - else - apr_addto_bugger="-I$found/include" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$found/lib\"" - APRUTIL_LDFLAGS="-L$found/lib" - else - apr_addto_bugger="-L$found/lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - esac - - if test "$apu_have_db" = "1"; then - apu_db_version=4 - fi - - if test "$apu_db_version" != "4"; then + if test "$apu_have_db" = "0"; then places="$all_places" if test -z "$places"; then @@ -17612,7 +12895,8 @@ fi apu_db_version=3 fi - if test "$apu_db_version" != "3"; then + fi + if test "$apu_have_db" = "0"; then places="$all_places" if test -z "$places"; then @@ -18009,7 +13293,8 @@ fi apu_db_version=2 fi - if test "$apu_db_version" != "2"; then + fi + if test "$apu_have_db" = "0"; then places="$all_places" if test -z "$places"; then @@ -18406,7 +13691,8 @@ fi apu_db_version=1 fi - if test "$apu_db_version" != "1"; then + fi + if test "$apu_have_db" = "0"; then places="$all_places" if test -z "$places"; then @@ -18803,19 +14089,6 @@ fi apu_db_version=185 fi - fi - fi - fi - fi - fi - fi - fi - fi - fi - fi - fi - fi - fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB" >&5 $as_echo_n "checking for Berkeley DB... " >&6; } @@ -20435,825 +15708,27 @@ fi as_fn_error $? "Berkeley db3 not found" "$LINENO" 5 fi ;; - db4) - - places="$check_places" - if test -z "$places"; then - places="std /usr/local /usr/local/BerkeleyDB.4.0 /boot/home/config" - fi - - bdb_version="4" - if test ""0"" != "-1"; then - bdb_version="$bdb_version."0"" - if test ""-1"" != "-1"; then - bdb_version="$bdb_version."-1"" - fi - fi - bdb_places="$places" - bdb_default_search_headers="db4/db.h db.h" - bdb_default_search_lib_names="db-4.0 db4 db" - - - apu_have_db=0 - - # Save the original values of the flags we tweak. - apu_check_lib_save_libs="$LIBS" - apu_check_lib_save_ldflags="$LDFLAGS" - apu_check_lib_save_cppflags="$CPPFLAGS" - - # The variable `found' is the prefix under which we've found - # Berkeley DB, or `not' if we haven't found it anywhere yet. - found=not - for bdb_place in $bdb_places; do - - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - case "$bdb_place" in - "std" ) - description="the standard places" - ;; - *":"* ) - header="`echo $bdb_place | sed -e 's/:.*$//'`" - lib="`echo $bdb_place | sed -e 's/^.*://'`" - CPPFLAGS="$CPPFLAGS -I$header" - LDFLAGS="$LDFLAGS -L$lib" - description="$header and $lib" - ;; - * ) - if test -d $bdb_place; then - LDFLAGS="$LDFLAGS -L$bdb_place/lib" - CPPFLAGS="$CPPFLAGS -I$bdb_place/include" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $bdb_place" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: directory not found" >&5 -$as_echo "directory not found" >&6; } - continue - fi - description="$bdb_place" - ;; - esac - - # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this - # trick to display a message instead. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $description" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 -$as_echo "" >&6; } - - for bdb_libname in $bdb_default_search_lib_names; do - for bdb_header in $bdb_default_search_headers; do - # Clear the header cache variable for each location - - cache_id="`echo ac_cv_header_${bdb_header} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - unset $cache_id - as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - - if test ""4"" = "3" -o ""4"" = "4" -o ""4"" = "5"; then - # We generate a separate cache variable for each prefix and libname - # we search under. That way, we avoid caching information that - # changes if the user runs `configure' with a different set of - # switches. - - cache_id="`echo apu_cv_check_berkeley_db_"4"_"0"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -l$bdb_libname" >&5 -$as_echo_n "checking for -l$bdb_libname... " >&6; } - if eval \${$cache_id+:} false; then : - $as_echo_n "(cached) " >&6 -else - - - apu_try_berkeley_db_save_libs="$LIBS" - - apu_check_berkeley_db_major="4" - apu_check_berkeley_db_minor="0" - apu_check_berkeley_db_patch="-1" - apu_try_berkeley_db_header=$bdb_header - apu_try_berkeley_db_libname=$bdb_libname - - LIBS="$LIBS -l$apu_try_berkeley_db_libname" - if test "$cross_compiling" = yes; then : - apu_try_berkeley_db=yes - -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include <stdlib.h> -#include <stdio.h> -#include <$apu_try_berkeley_db_header> -main () -{ - int major, minor, patch; - - db_version(&major, &minor, &patch); - - /* Sanity check: ensure that db.h constants actually match the db library */ - if (major != DB_VERSION_MAJOR - || minor != DB_VERSION_MINOR - || patch != DB_VERSION_PATCH) - exit (1); - - /* Run-time check: ensure the library claims to be the correct version. */ - - if ($apu_check_berkeley_db_major != -1) { - if (major < $apu_check_berkeley_db_major) - exit (1); - if (major > $apu_check_berkeley_db_major) - exit (0); - } - - if ($apu_check_berkeley_db_minor != -1) { - if (minor < $apu_check_berkeley_db_minor) - exit (1); - if (minor > $apu_check_berkeley_db_minor) - exit (0); - } - - if ($apu_check_berkeley_db_patch == -1 - || patch >= $apu_check_berkeley_db_patch) - exit (0); - else - exit (1); -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - apu_try_berkeley_db=yes -else - apu_try_berkeley_db=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - - LIBS="$apu_try_berkeley_db_save_libs" - - - eval "$cache_id=$apu_try_berkeley_db" - -fi - - result="`eval echo '$'$cache_id`" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $result" >&5 -$as_echo "$result" >&6; } - elif test ""4"" = "1"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbopen in -l$bdb_libname" >&5 -$as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dbopen (); -int -main () -{ -return dbopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - elif test ""4"" = "2"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for db_open in -l$bdb_libname" >&5 -$as_echo_n "checking for db_open in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char db_open (); -int -main () -{ -return db_open (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - fi - -else - result="no" -fi - - - - # If we found it, no need to search any more. - if test "$result" = "yes"; then - found="$bdb_place" - break - fi - done - test "$found" != "not" && break - done - test "$found" != "not" && break - done - - # Restore the original values of the flags we tweak. - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - - case "$found" in - "not") - apu_have_db=0 - ;; - "std") - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *":"*) - header="`echo $found | sed -e 's/:.*$//'`" - lib="`echo $found | sed -e 's/^.*://'`" - - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$header\"" - APRUTIL_INCLUDES="-I$header" - else - apr_addto_bugger="-I$header" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$lib\"" - APRUTIL_LDFLAGS="-L$lib" - else - apr_addto_bugger="-L$lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *) - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$found/include\"" - APRUTIL_INCLUDES="-I$found/include" - else - apr_addto_bugger="-I$found/include" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$found/lib\"" - APRUTIL_LDFLAGS="-L$found/lib" - else - apr_addto_bugger="-L$found/lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - esac - - if test "$apu_have_db" = "1"; then - apu_db_version=4 - fi - - if test "$apu_db_version" != "4"; then - as_fn_error $? "Berkeley db4 not found" "$LINENO" 5 - fi - ;; - db41) - - places="$check_places" - if test -z "$places"; then - places="std /usr/local /usr/local/BerkeleyDB.4.1 /boot/home/config" - fi - - bdb_version="4" - if test ""1"" != "-1"; then - bdb_version="$bdb_version."1"" - if test ""-1"" != "-1"; then - bdb_version="$bdb_version."-1"" - fi - fi - bdb_places="$places" - bdb_default_search_headers="db41/db.h db4/db.h db.h" - bdb_default_search_lib_names="db-4.1 db41 db4 db" - - - apu_have_db=0 - - # Save the original values of the flags we tweak. - apu_check_lib_save_libs="$LIBS" - apu_check_lib_save_ldflags="$LDFLAGS" - apu_check_lib_save_cppflags="$CPPFLAGS" - - # The variable `found' is the prefix under which we've found - # Berkeley DB, or `not' if we haven't found it anywhere yet. - found=not - for bdb_place in $bdb_places; do - - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - case "$bdb_place" in - "std" ) - description="the standard places" - ;; - *":"* ) - header="`echo $bdb_place | sed -e 's/:.*$//'`" - lib="`echo $bdb_place | sed -e 's/^.*://'`" - CPPFLAGS="$CPPFLAGS -I$header" - LDFLAGS="$LDFLAGS -L$lib" - description="$header and $lib" - ;; - * ) - if test -d $bdb_place; then - LDFLAGS="$LDFLAGS -L$bdb_place/lib" - CPPFLAGS="$CPPFLAGS -I$bdb_place/include" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $bdb_place" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: directory not found" >&5 -$as_echo "directory not found" >&6; } - continue - fi - description="$bdb_place" - ;; - esac - - # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this - # trick to display a message instead. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $description" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 -$as_echo "" >&6; } - - for bdb_libname in $bdb_default_search_lib_names; do - for bdb_header in $bdb_default_search_headers; do - # Clear the header cache variable for each location - - cache_id="`echo ac_cv_header_${bdb_header} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - unset $cache_id - as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - - if test ""4"" = "3" -o ""4"" = "4" -o ""4"" = "5"; then - # We generate a separate cache variable for each prefix and libname - # we search under. That way, we avoid caching information that - # changes if the user runs `configure' with a different set of - # switches. - - cache_id="`echo apu_cv_check_berkeley_db_"4"_"1"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -l$bdb_libname" >&5 -$as_echo_n "checking for -l$bdb_libname... " >&6; } - if eval \${$cache_id+:} false; then : - $as_echo_n "(cached) " >&6 -else - - - apu_try_berkeley_db_save_libs="$LIBS" - - apu_check_berkeley_db_major="4" - apu_check_berkeley_db_minor="1" - apu_check_berkeley_db_patch="-1" - apu_try_berkeley_db_header=$bdb_header - apu_try_berkeley_db_libname=$bdb_libname - - LIBS="$LIBS -l$apu_try_berkeley_db_libname" - if test "$cross_compiling" = yes; then : - apu_try_berkeley_db=yes - -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include <stdlib.h> -#include <stdio.h> -#include <$apu_try_berkeley_db_header> -main () -{ - int major, minor, patch; - - db_version(&major, &minor, &patch); - - /* Sanity check: ensure that db.h constants actually match the db library */ - if (major != DB_VERSION_MAJOR - || minor != DB_VERSION_MINOR - || patch != DB_VERSION_PATCH) - exit (1); - - /* Run-time check: ensure the library claims to be the correct version. */ - - if ($apu_check_berkeley_db_major != -1) { - if (major < $apu_check_berkeley_db_major) - exit (1); - if (major > $apu_check_berkeley_db_major) - exit (0); - } - - if ($apu_check_berkeley_db_minor != -1) { - if (minor < $apu_check_berkeley_db_minor) - exit (1); - if (minor > $apu_check_berkeley_db_minor) - exit (0); - } - - if ($apu_check_berkeley_db_patch == -1 - || patch >= $apu_check_berkeley_db_patch) - exit (0); - else - exit (1); -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - apu_try_berkeley_db=yes -else - apu_try_berkeley_db=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - - LIBS="$apu_try_berkeley_db_save_libs" - - - eval "$cache_id=$apu_try_berkeley_db" - -fi - - result="`eval echo '$'$cache_id`" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $result" >&5 -$as_echo "$result" >&6; } - elif test ""4"" = "1"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbopen in -l$bdb_libname" >&5 -$as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dbopen (); -int -main () -{ -return dbopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - elif test ""4"" = "2"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for db_open in -l$bdb_libname" >&5 -$as_echo_n "checking for db_open in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char db_open (); -int -main () -{ -return db_open (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - fi - -else - result="no" -fi - - - - # If we found it, no need to search any more. - if test "$result" = "yes"; then - found="$bdb_place" - break - fi - done - test "$found" != "not" && break - done - test "$found" != "not" && break - done - - # Restore the original values of the flags we tweak. - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - - case "$found" in - "not") - apu_have_db=0 - ;; - "std") - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *":"*) - header="`echo $found | sed -e 's/:.*$//'`" - lib="`echo $found | sed -e 's/^.*://'`" - - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$header\"" - APRUTIL_INCLUDES="-I$header" - else - apr_addto_bugger="-I$header" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$lib\"" - APRUTIL_LDFLAGS="-L$lib" - else - apr_addto_bugger="-L$lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *) - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$found/include\"" - APRUTIL_INCLUDES="-I$found/include" - else - apr_addto_bugger="-I$found/include" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$found/lib\"" - APRUTIL_LDFLAGS="-L$found/lib" - else - apr_addto_bugger="-L$found/lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - esac - - if test "$apu_have_db" = "1"; then - apu_db_version=4 - fi - - if test "$apu_db_version" != "4"; then - as_fn_error $? "Berkeley db4 not found" "$LINENO" 5 - fi - ;; - db42) + db[45][0-9]) + db_major=`echo "$requested" | sed -e 's/db//' -e 's/.$//'` + db_minor=`echo "$requested" | sed -e 's/db//' -e 's/.//'` places="$check_places" + db_major="$db_major" + db_minor="$db_minor" if test -z "$places"; then - places="std /usr/local /usr/local/BerkeleyDB.4.2 /boot/home/config" + places="std /usr/local /usr/local/BerkeleyDB.${db_major}.${db_minor} /boot/home/config" fi - bdb_version="4" - if test ""2"" != "-1"; then - bdb_version="$bdb_version."2"" + bdb_version="${db_major}" + if test ""${db_minor}"" != "-1"; then + bdb_version="$bdb_version."${db_minor}"" if test ""-1"" != "-1"; then bdb_version="$bdb_version."-1"" fi fi bdb_places="$places" - bdb_default_search_headers="db42/db.h db4/db.h db.h" - bdb_default_search_lib_names="db-4.2 db42 db4 db" + bdb_default_search_headers="db${db_major}${db_minor}/db.h db${db_major}/db.h db.h" + bdb_default_search_lib_names="db-${db_major}.${db_minor} db${db_major}-${db_major}.${db_minor} db${db_major}${db_minor} db-${db_major} db${db_major} db" apu_have_db=0 @@ -21315,13 +15790,13 @@ $as_echo "" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - if test ""4"" = "3" -o ""4"" = "4" -o ""4"" = "5"; then + if test ""${db_major}"" = "3" -o ""${db_major}"" = "4" -o ""${db_major}"" = "5"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of # switches. - cache_id="`echo apu_cv_check_berkeley_db_"4"_"2"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \ + cache_id="`echo apu_cv_check_berkeley_db_"${db_major}"_"${db_minor}"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \ | sed -e 's/[^a-zA-Z0-9_]/_/g'`" @@ -21334,8 +15809,8 @@ else apu_try_berkeley_db_save_libs="$LIBS" - apu_check_berkeley_db_major="4" - apu_check_berkeley_db_minor="2" + apu_check_berkeley_db_major="${db_major}" + apu_check_berkeley_db_minor="${db_minor}" apu_check_berkeley_db_patch="-1" apu_try_berkeley_db_header=$bdb_header apu_try_berkeley_db_libname=$bdb_libname @@ -21407,7 +15882,7 @@ fi result="`eval echo '$'$cache_id`" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $result" >&5 $as_echo "$result" >&6; } - elif test ""4"" = "1"; then + elif test ""${db_major}"" = "1"; then as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbopen in -l$bdb_libname" >&5 $as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; } @@ -21453,7 +15928,7 @@ else fi - elif test ""4"" = "2"; then + elif test ""${db_major}"" = "2"; then as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for db_open in -l$bdb_libname" >&5 $as_echo_n "checking for db_open in -l$bdb_libname... " >&6; } @@ -21631,2436 +16106,37 @@ fi esac if test "$apu_have_db" = "1"; then - apu_db_version=4 + apu_db_version=${db_major} fi - if test "$apu_db_version" != "4"; then - as_fn_error $? "Berkeley db4 not found" "$LINENO" 5 + if test "$apu_db_version" != "$db_major"; then + as_fn_error $? "Berkeley db$db_major not found" "$LINENO" 5 fi ;; - db43) - - places="$check_places" - if test -z "$places"; then - places="std /usr/local/BerkeleyDB.4.3 /boot/home/config" - fi - - bdb_version="4" - if test ""3"" != "-1"; then - bdb_version="$bdb_version."3"" - if test ""-1"" != "-1"; then - bdb_version="$bdb_version."-1"" - fi - fi - bdb_places="$places" - bdb_default_search_headers="db43/db.h db4/db.h db.h" - bdb_default_search_lib_names="db-4.3 db4-4.3 db43 db4 db" - - - apu_have_db=0 - - # Save the original values of the flags we tweak. - apu_check_lib_save_libs="$LIBS" - apu_check_lib_save_ldflags="$LDFLAGS" - apu_check_lib_save_cppflags="$CPPFLAGS" - - # The variable `found' is the prefix under which we've found - # Berkeley DB, or `not' if we haven't found it anywhere yet. - found=not - for bdb_place in $bdb_places; do - - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - case "$bdb_place" in - "std" ) - description="the standard places" - ;; - *":"* ) - header="`echo $bdb_place | sed -e 's/:.*$//'`" - lib="`echo $bdb_place | sed -e 's/^.*://'`" - CPPFLAGS="$CPPFLAGS -I$header" - LDFLAGS="$LDFLAGS -L$lib" - description="$header and $lib" - ;; - * ) - if test -d $bdb_place; then - LDFLAGS="$LDFLAGS -L$bdb_place/lib" - CPPFLAGS="$CPPFLAGS -I$bdb_place/include" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $bdb_place" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: directory not found" >&5 -$as_echo "directory not found" >&6; } - continue - fi - description="$bdb_place" - ;; - esac - - # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this - # trick to display a message instead. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $description" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 -$as_echo "" >&6; } - - for bdb_libname in $bdb_default_search_lib_names; do - for bdb_header in $bdb_default_search_headers; do - # Clear the header cache variable for each location - - cache_id="`echo ac_cv_header_${bdb_header} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - unset $cache_id - as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - - if test ""4"" = "3" -o ""4"" = "4" -o ""4"" = "5"; then - # We generate a separate cache variable for each prefix and libname - # we search under. That way, we avoid caching information that - # changes if the user runs `configure' with a different set of - # switches. - - cache_id="`echo apu_cv_check_berkeley_db_"4"_"3"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -l$bdb_libname" >&5 -$as_echo_n "checking for -l$bdb_libname... " >&6; } - if eval \${$cache_id+:} false; then : - $as_echo_n "(cached) " >&6 -else - - - apu_try_berkeley_db_save_libs="$LIBS" - - apu_check_berkeley_db_major="4" - apu_check_berkeley_db_minor="3" - apu_check_berkeley_db_patch="-1" - apu_try_berkeley_db_header=$bdb_header - apu_try_berkeley_db_libname=$bdb_libname - - LIBS="$LIBS -l$apu_try_berkeley_db_libname" - if test "$cross_compiling" = yes; then : - apu_try_berkeley_db=yes - -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include <stdlib.h> -#include <stdio.h> -#include <$apu_try_berkeley_db_header> -main () -{ - int major, minor, patch; - - db_version(&major, &minor, &patch); - - /* Sanity check: ensure that db.h constants actually match the db library */ - if (major != DB_VERSION_MAJOR - || minor != DB_VERSION_MINOR - || patch != DB_VERSION_PATCH) - exit (1); - - /* Run-time check: ensure the library claims to be the correct version. */ - - if ($apu_check_berkeley_db_major != -1) { - if (major < $apu_check_berkeley_db_major) - exit (1); - if (major > $apu_check_berkeley_db_major) - exit (0); - } - - if ($apu_check_berkeley_db_minor != -1) { - if (minor < $apu_check_berkeley_db_minor) - exit (1); - if (minor > $apu_check_berkeley_db_minor) - exit (0); - } - - if ($apu_check_berkeley_db_patch == -1 - || patch >= $apu_check_berkeley_db_patch) - exit (0); - else - exit (1); -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - apu_try_berkeley_db=yes -else - apu_try_berkeley_db=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - - LIBS="$apu_try_berkeley_db_save_libs" - - - eval "$cache_id=$apu_try_berkeley_db" - -fi - - result="`eval echo '$'$cache_id`" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $result" >&5 -$as_echo "$result" >&6; } - elif test ""4"" = "1"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbopen in -l$bdb_libname" >&5 -$as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dbopen (); -int -main () -{ -return dbopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - elif test ""4"" = "2"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for db_open in -l$bdb_libname" >&5 -$as_echo_n "checking for db_open in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char db_open (); -int -main () -{ -return db_open (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - fi - -else - result="no" -fi - - - - # If we found it, no need to search any more. - if test "$result" = "yes"; then - found="$bdb_place" - break - fi - done - test "$found" != "not" && break - done - test "$found" != "not" && break - done - - # Restore the original values of the flags we tweak. - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - - case "$found" in - "not") - apu_have_db=0 - ;; - "std") - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *":"*) - header="`echo $found | sed -e 's/:.*$//'`" - lib="`echo $found | sed -e 's/^.*://'`" - - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$header\"" - APRUTIL_INCLUDES="-I$header" - else - apr_addto_bugger="-I$header" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$lib\"" - APRUTIL_LDFLAGS="-L$lib" - else - apr_addto_bugger="-L$lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *) - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$found/include\"" - APRUTIL_INCLUDES="-I$found/include" - else - apr_addto_bugger="-I$found/include" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$found/lib\"" - APRUTIL_LDFLAGS="-L$found/lib" - else - apr_addto_bugger="-L$found/lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - esac - - if test "$apu_have_db" = "1"; then - apu_db_version=4 - fi - - if test "$apu_db_version" != "4"; then - as_fn_error $? "Berkeley db4 not found" "$LINENO" 5 - fi - ;; - db44) - - places="$check_places" - if test -z "$places"; then - places="std /usr/local/BerkeleyDB.4.4 /boot/home/config" - fi - - bdb_version="4" - if test ""4"" != "-1"; then - bdb_version="$bdb_version."4"" - if test ""-1"" != "-1"; then - bdb_version="$bdb_version."-1"" - fi - fi - bdb_places="$places" - bdb_default_search_headers="db44/db.h db4/db.h db.h" - bdb_default_search_lib_names="db-4.4 db4-4.4 db44 db4 db" - - - apu_have_db=0 - - # Save the original values of the flags we tweak. - apu_check_lib_save_libs="$LIBS" - apu_check_lib_save_ldflags="$LDFLAGS" - apu_check_lib_save_cppflags="$CPPFLAGS" - - # The variable `found' is the prefix under which we've found - # Berkeley DB, or `not' if we haven't found it anywhere yet. - found=not - for bdb_place in $bdb_places; do - - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - case "$bdb_place" in - "std" ) - description="the standard places" - ;; - *":"* ) - header="`echo $bdb_place | sed -e 's/:.*$//'`" - lib="`echo $bdb_place | sed -e 's/^.*://'`" - CPPFLAGS="$CPPFLAGS -I$header" - LDFLAGS="$LDFLAGS -L$lib" - description="$header and $lib" - ;; - * ) - if test -d $bdb_place; then - LDFLAGS="$LDFLAGS -L$bdb_place/lib" - CPPFLAGS="$CPPFLAGS -I$bdb_place/include" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $bdb_place" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: directory not found" >&5 -$as_echo "directory not found" >&6; } - continue - fi - description="$bdb_place" - ;; - esac - - # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this - # trick to display a message instead. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $description" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 -$as_echo "" >&6; } - - for bdb_libname in $bdb_default_search_lib_names; do - for bdb_header in $bdb_default_search_headers; do - # Clear the header cache variable for each location - - cache_id="`echo ac_cv_header_${bdb_header} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - unset $cache_id - as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - - if test ""4"" = "3" -o ""4"" = "4" -o ""4"" = "5"; then - # We generate a separate cache variable for each prefix and libname - # we search under. That way, we avoid caching information that - # changes if the user runs `configure' with a different set of - # switches. - - cache_id="`echo apu_cv_check_berkeley_db_"4"_"4"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -l$bdb_libname" >&5 -$as_echo_n "checking for -l$bdb_libname... " >&6; } - if eval \${$cache_id+:} false; then : - $as_echo_n "(cached) " >&6 -else - - - apu_try_berkeley_db_save_libs="$LIBS" - - apu_check_berkeley_db_major="4" - apu_check_berkeley_db_minor="4" - apu_check_berkeley_db_patch="-1" - apu_try_berkeley_db_header=$bdb_header - apu_try_berkeley_db_libname=$bdb_libname - - LIBS="$LIBS -l$apu_try_berkeley_db_libname" - if test "$cross_compiling" = yes; then : - apu_try_berkeley_db=yes - -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include <stdlib.h> -#include <stdio.h> -#include <$apu_try_berkeley_db_header> -main () -{ - int major, minor, patch; - - db_version(&major, &minor, &patch); - - /* Sanity check: ensure that db.h constants actually match the db library */ - if (major != DB_VERSION_MAJOR - || minor != DB_VERSION_MINOR - || patch != DB_VERSION_PATCH) - exit (1); - - /* Run-time check: ensure the library claims to be the correct version. */ - - if ($apu_check_berkeley_db_major != -1) { - if (major < $apu_check_berkeley_db_major) - exit (1); - if (major > $apu_check_berkeley_db_major) - exit (0); - } - - if ($apu_check_berkeley_db_minor != -1) { - if (minor < $apu_check_berkeley_db_minor) - exit (1); - if (minor > $apu_check_berkeley_db_minor) - exit (0); - } - - if ($apu_check_berkeley_db_patch == -1 - || patch >= $apu_check_berkeley_db_patch) - exit (0); - else - exit (1); -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - apu_try_berkeley_db=yes -else - apu_try_berkeley_db=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - - LIBS="$apu_try_berkeley_db_save_libs" - - - eval "$cache_id=$apu_try_berkeley_db" - -fi - - result="`eval echo '$'$cache_id`" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $result" >&5 -$as_echo "$result" >&6; } - elif test ""4"" = "1"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbopen in -l$bdb_libname" >&5 -$as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dbopen (); -int -main () -{ -return dbopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - elif test ""4"" = "2"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for db_open in -l$bdb_libname" >&5 -$as_echo_n "checking for db_open in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char db_open (); -int -main () -{ -return db_open (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - fi - -else - result="no" -fi - - - - # If we found it, no need to search any more. - if test "$result" = "yes"; then - found="$bdb_place" - break - fi - done - test "$found" != "not" && break - done - test "$found" != "not" && break - done - - # Restore the original values of the flags we tweak. - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - - case "$found" in - "not") - apu_have_db=0 - ;; - "std") - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *":"*) - header="`echo $found | sed -e 's/:.*$//'`" - lib="`echo $found | sed -e 's/^.*://'`" - - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$header\"" - APRUTIL_INCLUDES="-I$header" - else - apr_addto_bugger="-I$header" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$lib\"" - APRUTIL_LDFLAGS="-L$lib" - else - apr_addto_bugger="-L$lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *) - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$found/include\"" - APRUTIL_INCLUDES="-I$found/include" - else - apr_addto_bugger="-I$found/include" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$found/lib\"" - APRUTIL_LDFLAGS="-L$found/lib" - else - apr_addto_bugger="-L$found/lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - esac - - if test "$apu_have_db" = "1"; then - apu_db_version=4 - fi - - if test "$apu_db_version" != "4"; then - as_fn_error $? "Berkeley db4 not found" "$LINENO" 5 - fi - ;; - db45) - - places="$check_places" - if test -z "$places"; then - places="std /usr/local/BerkeleyDB.4.5 /boot/home/config" - fi - - bdb_version="4" - if test ""5"" != "-1"; then - bdb_version="$bdb_version."5"" - if test ""-1"" != "-1"; then - bdb_version="$bdb_version."-1"" - fi - fi - bdb_places="$places" - bdb_default_search_headers="db45/db.h db4/db.h db.h" - bdb_default_search_lib_names="db-4.5 db4-4.5 db45 db4 db" - - - apu_have_db=0 - - # Save the original values of the flags we tweak. - apu_check_lib_save_libs="$LIBS" - apu_check_lib_save_ldflags="$LDFLAGS" - apu_check_lib_save_cppflags="$CPPFLAGS" - - # The variable `found' is the prefix under which we've found - # Berkeley DB, or `not' if we haven't found it anywhere yet. - found=not - for bdb_place in $bdb_places; do - - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - case "$bdb_place" in - "std" ) - description="the standard places" - ;; - *":"* ) - header="`echo $bdb_place | sed -e 's/:.*$//'`" - lib="`echo $bdb_place | sed -e 's/^.*://'`" - CPPFLAGS="$CPPFLAGS -I$header" - LDFLAGS="$LDFLAGS -L$lib" - description="$header and $lib" - ;; - * ) - if test -d $bdb_place; then - LDFLAGS="$LDFLAGS -L$bdb_place/lib" - CPPFLAGS="$CPPFLAGS -I$bdb_place/include" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $bdb_place" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: directory not found" >&5 -$as_echo "directory not found" >&6; } - continue - fi - description="$bdb_place" - ;; - esac - - # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this - # trick to display a message instead. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $description" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 -$as_echo "" >&6; } - - for bdb_libname in $bdb_default_search_lib_names; do - for bdb_header in $bdb_default_search_headers; do - # Clear the header cache variable for each location - - cache_id="`echo ac_cv_header_${bdb_header} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - unset $cache_id - as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - - if test ""4"" = "3" -o ""4"" = "4" -o ""4"" = "5"; then - # We generate a separate cache variable for each prefix and libname - # we search under. That way, we avoid caching information that - # changes if the user runs `configure' with a different set of - # switches. - - cache_id="`echo apu_cv_check_berkeley_db_"4"_"5"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -l$bdb_libname" >&5 -$as_echo_n "checking for -l$bdb_libname... " >&6; } - if eval \${$cache_id+:} false; then : - $as_echo_n "(cached) " >&6 -else - - - apu_try_berkeley_db_save_libs="$LIBS" - - apu_check_berkeley_db_major="4" - apu_check_berkeley_db_minor="5" - apu_check_berkeley_db_patch="-1" - apu_try_berkeley_db_header=$bdb_header - apu_try_berkeley_db_libname=$bdb_libname - - LIBS="$LIBS -l$apu_try_berkeley_db_libname" - if test "$cross_compiling" = yes; then : - apu_try_berkeley_db=yes - -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include <stdlib.h> -#include <stdio.h> -#include <$apu_try_berkeley_db_header> -main () -{ - int major, minor, patch; - - db_version(&major, &minor, &patch); - - /* Sanity check: ensure that db.h constants actually match the db library */ - if (major != DB_VERSION_MAJOR - || minor != DB_VERSION_MINOR - || patch != DB_VERSION_PATCH) - exit (1); - - /* Run-time check: ensure the library claims to be the correct version. */ - - if ($apu_check_berkeley_db_major != -1) { - if (major < $apu_check_berkeley_db_major) - exit (1); - if (major > $apu_check_berkeley_db_major) - exit (0); - } - - if ($apu_check_berkeley_db_minor != -1) { - if (minor < $apu_check_berkeley_db_minor) - exit (1); - if (minor > $apu_check_berkeley_db_minor) - exit (0); - } - - if ($apu_check_berkeley_db_patch == -1 - || patch >= $apu_check_berkeley_db_patch) - exit (0); - else - exit (1); -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - apu_try_berkeley_db=yes -else - apu_try_berkeley_db=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - - LIBS="$apu_try_berkeley_db_save_libs" - - - eval "$cache_id=$apu_try_berkeley_db" - -fi - - result="`eval echo '$'$cache_id`" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $result" >&5 -$as_echo "$result" >&6; } - elif test ""4"" = "1"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbopen in -l$bdb_libname" >&5 -$as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dbopen (); -int -main () -{ -return dbopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - elif test ""4"" = "2"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for db_open in -l$bdb_libname" >&5 -$as_echo_n "checking for db_open in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char db_open (); -int -main () -{ -return db_open (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - fi - -else - result="no" -fi - - - - # If we found it, no need to search any more. - if test "$result" = "yes"; then - found="$bdb_place" - break - fi - done - test "$found" != "not" && break - done - test "$found" != "not" && break - done - - # Restore the original values of the flags we tweak. - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - - case "$found" in - "not") - apu_have_db=0 - ;; - "std") - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *":"*) - header="`echo $found | sed -e 's/:.*$//'`" - lib="`echo $found | sed -e 's/^.*://'`" - - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$header\"" - APRUTIL_INCLUDES="-I$header" - else - apr_addto_bugger="-I$header" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$lib\"" - APRUTIL_LDFLAGS="-L$lib" - else - apr_addto_bugger="-L$lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *) - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$found/include\"" - APRUTIL_INCLUDES="-I$found/include" - else - apr_addto_bugger="-I$found/include" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$found/lib\"" - APRUTIL_LDFLAGS="-L$found/lib" - else - apr_addto_bugger="-L$found/lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - esac - - if test "$apu_have_db" = "1"; then - apu_db_version=4 - fi - - if test "$apu_db_version" != "4"; then - as_fn_error $? "Berkeley db4 not found" "$LINENO" 5 - fi - ;; - db46) - - places="$check_places" - if test -z "$places"; then - places="std /usr/local/BerkeleyDB.4.6 /boot/home/config" - fi - - bdb_version="4" - if test ""6"" != "-1"; then - bdb_version="$bdb_version."6"" - if test ""-1"" != "-1"; then - bdb_version="$bdb_version."-1"" - fi - fi - bdb_places="$places" - bdb_default_search_headers="db46/db.h db4/db.h db.h" - bdb_default_search_lib_names="db-4.6 db4-4.6 db46 db4 db" - - - apu_have_db=0 - - # Save the original values of the flags we tweak. - apu_check_lib_save_libs="$LIBS" - apu_check_lib_save_ldflags="$LDFLAGS" - apu_check_lib_save_cppflags="$CPPFLAGS" - - # The variable `found' is the prefix under which we've found - # Berkeley DB, or `not' if we haven't found it anywhere yet. - found=not - for bdb_place in $bdb_places; do - - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - case "$bdb_place" in - "std" ) - description="the standard places" - ;; - *":"* ) - header="`echo $bdb_place | sed -e 's/:.*$//'`" - lib="`echo $bdb_place | sed -e 's/^.*://'`" - CPPFLAGS="$CPPFLAGS -I$header" - LDFLAGS="$LDFLAGS -L$lib" - description="$header and $lib" - ;; - * ) - if test -d $bdb_place; then - LDFLAGS="$LDFLAGS -L$bdb_place/lib" - CPPFLAGS="$CPPFLAGS -I$bdb_place/include" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $bdb_place" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: directory not found" >&5 -$as_echo "directory not found" >&6; } - continue - fi - description="$bdb_place" - ;; - esac - - # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this - # trick to display a message instead. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $description" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 -$as_echo "" >&6; } - - for bdb_libname in $bdb_default_search_lib_names; do - for bdb_header in $bdb_default_search_headers; do - # Clear the header cache variable for each location - - cache_id="`echo ac_cv_header_${bdb_header} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - unset $cache_id - as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - - if test ""4"" = "3" -o ""4"" = "4" -o ""4"" = "5"; then - # We generate a separate cache variable for each prefix and libname - # we search under. That way, we avoid caching information that - # changes if the user runs `configure' with a different set of - # switches. - - cache_id="`echo apu_cv_check_berkeley_db_"4"_"6"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -l$bdb_libname" >&5 -$as_echo_n "checking for -l$bdb_libname... " >&6; } - if eval \${$cache_id+:} false; then : - $as_echo_n "(cached) " >&6 -else - - - apu_try_berkeley_db_save_libs="$LIBS" - - apu_check_berkeley_db_major="4" - apu_check_berkeley_db_minor="6" - apu_check_berkeley_db_patch="-1" - apu_try_berkeley_db_header=$bdb_header - apu_try_berkeley_db_libname=$bdb_libname - - LIBS="$LIBS -l$apu_try_berkeley_db_libname" - if test "$cross_compiling" = yes; then : - apu_try_berkeley_db=yes - -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include <stdlib.h> -#include <stdio.h> -#include <$apu_try_berkeley_db_header> -main () -{ - int major, minor, patch; - - db_version(&major, &minor, &patch); - - /* Sanity check: ensure that db.h constants actually match the db library */ - if (major != DB_VERSION_MAJOR - || minor != DB_VERSION_MINOR - || patch != DB_VERSION_PATCH) - exit (1); - - /* Run-time check: ensure the library claims to be the correct version. */ - - if ($apu_check_berkeley_db_major != -1) { - if (major < $apu_check_berkeley_db_major) - exit (1); - if (major > $apu_check_berkeley_db_major) - exit (0); - } - - if ($apu_check_berkeley_db_minor != -1) { - if (minor < $apu_check_berkeley_db_minor) - exit (1); - if (minor > $apu_check_berkeley_db_minor) - exit (0); - } - - if ($apu_check_berkeley_db_patch == -1 - || patch >= $apu_check_berkeley_db_patch) - exit (0); - else - exit (1); -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - apu_try_berkeley_db=yes -else - apu_try_berkeley_db=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - - LIBS="$apu_try_berkeley_db_save_libs" - - - eval "$cache_id=$apu_try_berkeley_db" - -fi - - result="`eval echo '$'$cache_id`" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $result" >&5 -$as_echo "$result" >&6; } - elif test ""4"" = "1"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbopen in -l$bdb_libname" >&5 -$as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dbopen (); -int -main () -{ -return dbopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - elif test ""4"" = "2"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for db_open in -l$bdb_libname" >&5 -$as_echo_n "checking for db_open in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char db_open (); -int -main () -{ -return db_open (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - fi - -else - result="no" -fi - - - - # If we found it, no need to search any more. - if test "$result" = "yes"; then - found="$bdb_place" - break - fi - done - test "$found" != "not" && break - done - test "$found" != "not" && break - done - - # Restore the original values of the flags we tweak. - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - - case "$found" in - "not") - apu_have_db=0 - ;; - "std") - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *":"*) - header="`echo $found | sed -e 's/:.*$//'`" - lib="`echo $found | sed -e 's/^.*://'`" - - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$header\"" - APRUTIL_INCLUDES="-I$header" - else - apr_addto_bugger="-I$header" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$lib\"" - APRUTIL_LDFLAGS="-L$lib" - else - apr_addto_bugger="-L$lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *) - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$found/include\"" - APRUTIL_INCLUDES="-I$found/include" - else - apr_addto_bugger="-I$found/include" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$found/lib\"" - APRUTIL_LDFLAGS="-L$found/lib" - else - apr_addto_bugger="-L$found/lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - esac - - if test "$apu_have_db" = "1"; then - apu_db_version=4 - fi - - if test "$apu_db_version" != "4"; then - as_fn_error $? "Berkeley db4 not found" "$LINENO" 5 - fi - ;; - db47) - - places="$check_places" - if test -z "$places"; then - places="std /usr/local/BerkeleyDB.4.7 /boot/home/config" - fi - - bdb_version="4" - if test ""7"" != "-1"; then - bdb_version="$bdb_version."7"" - if test ""-1"" != "-1"; then - bdb_version="$bdb_version."-1"" - fi - fi - bdb_places="$places" - bdb_default_search_headers="db47/db.h db4/db.h db.h" - bdb_default_search_lib_names="db-4.7 db4-4.7 db47 db4 db" - - - apu_have_db=0 - - # Save the original values of the flags we tweak. - apu_check_lib_save_libs="$LIBS" - apu_check_lib_save_ldflags="$LDFLAGS" - apu_check_lib_save_cppflags="$CPPFLAGS" - - # The variable `found' is the prefix under which we've found - # Berkeley DB, or `not' if we haven't found it anywhere yet. - found=not - for bdb_place in $bdb_places; do - - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - case "$bdb_place" in - "std" ) - description="the standard places" - ;; - *":"* ) - header="`echo $bdb_place | sed -e 's/:.*$//'`" - lib="`echo $bdb_place | sed -e 's/^.*://'`" - CPPFLAGS="$CPPFLAGS -I$header" - LDFLAGS="$LDFLAGS -L$lib" - description="$header and $lib" - ;; - * ) - if test -d $bdb_place; then - LDFLAGS="$LDFLAGS -L$bdb_place/lib" - CPPFLAGS="$CPPFLAGS -I$bdb_place/include" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $bdb_place" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: directory not found" >&5 -$as_echo "directory not found" >&6; } - continue - fi - description="$bdb_place" - ;; - esac - - # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this - # trick to display a message instead. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $description" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 -$as_echo "" >&6; } - - for bdb_libname in $bdb_default_search_lib_names; do - for bdb_header in $bdb_default_search_headers; do - # Clear the header cache variable for each location - - cache_id="`echo ac_cv_header_${bdb_header} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - unset $cache_id - as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - - if test ""4"" = "3" -o ""4"" = "4" -o ""4"" = "5"; then - # We generate a separate cache variable for each prefix and libname - # we search under. That way, we avoid caching information that - # changes if the user runs `configure' with a different set of - # switches. - - cache_id="`echo apu_cv_check_berkeley_db_"4"_"7"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -l$bdb_libname" >&5 -$as_echo_n "checking for -l$bdb_libname... " >&6; } - if eval \${$cache_id+:} false; then : - $as_echo_n "(cached) " >&6 -else - - - apu_try_berkeley_db_save_libs="$LIBS" - - apu_check_berkeley_db_major="4" - apu_check_berkeley_db_minor="7" - apu_check_berkeley_db_patch="-1" - apu_try_berkeley_db_header=$bdb_header - apu_try_berkeley_db_libname=$bdb_libname - - LIBS="$LIBS -l$apu_try_berkeley_db_libname" - if test "$cross_compiling" = yes; then : - apu_try_berkeley_db=yes - -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include <stdlib.h> -#include <stdio.h> -#include <$apu_try_berkeley_db_header> -main () -{ - int major, minor, patch; - - db_version(&major, &minor, &patch); - - /* Sanity check: ensure that db.h constants actually match the db library */ - if (major != DB_VERSION_MAJOR - || minor != DB_VERSION_MINOR - || patch != DB_VERSION_PATCH) - exit (1); - - /* Run-time check: ensure the library claims to be the correct version. */ - - if ($apu_check_berkeley_db_major != -1) { - if (major < $apu_check_berkeley_db_major) - exit (1); - if (major > $apu_check_berkeley_db_major) - exit (0); - } - - if ($apu_check_berkeley_db_minor != -1) { - if (minor < $apu_check_berkeley_db_minor) - exit (1); - if (minor > $apu_check_berkeley_db_minor) - exit (0); - } - - if ($apu_check_berkeley_db_patch == -1 - || patch >= $apu_check_berkeley_db_patch) - exit (0); - else - exit (1); -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - apu_try_berkeley_db=yes -else - apu_try_berkeley_db=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - - LIBS="$apu_try_berkeley_db_save_libs" - - - eval "$cache_id=$apu_try_berkeley_db" - -fi - - result="`eval echo '$'$cache_id`" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $result" >&5 -$as_echo "$result" >&6; } - elif test ""4"" = "1"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbopen in -l$bdb_libname" >&5 -$as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dbopen (); -int -main () -{ -return dbopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - elif test ""4"" = "2"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for db_open in -l$bdb_libname" >&5 -$as_echo_n "checking for db_open in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char db_open (); -int -main () -{ -return db_open (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - fi - -else - result="no" -fi - - - - # If we found it, no need to search any more. - if test "$result" = "yes"; then - found="$bdb_place" - break - fi - done - test "$found" != "not" && break - done - test "$found" != "not" && break - done - - # Restore the original values of the flags we tweak. - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - - case "$found" in - "not") - apu_have_db=0 - ;; - "std") - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *":"*) - header="`echo $found | sed -e 's/:.*$//'`" - lib="`echo $found | sed -e 's/^.*://'`" - - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$header\"" - APRUTIL_INCLUDES="-I$header" - else - apr_addto_bugger="-I$header" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$lib\"" - APRUTIL_LDFLAGS="-L$lib" - else - apr_addto_bugger="-L$lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *) - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$found/include\"" - APRUTIL_INCLUDES="-I$found/include" - else - apr_addto_bugger="-I$found/include" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$found/lib\"" - APRUTIL_LDFLAGS="-L$found/lib" - else - apr_addto_bugger="-L$found/lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - esac - - if test "$apu_have_db" = "1"; then - apu_db_version=4 - fi - - if test "$apu_db_version" != "4"; then - as_fn_error $? "Berkeley db4 not found" "$LINENO" 5 - fi - ;; - db48) - - places="$check_places" - if test -z "$places"; then - places="std /usr/local/BerkeleyDB.4.8 /boot/home/config" - fi - - bdb_version="4" - if test ""8"" != "-1"; then - bdb_version="$bdb_version."8"" - if test ""-1"" != "-1"; then - bdb_version="$bdb_version."-1"" - fi - fi - bdb_places="$places" - bdb_default_search_headers="db48/db.h db4/db.h db.h" - bdb_default_search_lib_names="db-4.8 db4-4.8 db48 db4 db" - - - apu_have_db=0 - - # Save the original values of the flags we tweak. - apu_check_lib_save_libs="$LIBS" - apu_check_lib_save_ldflags="$LDFLAGS" - apu_check_lib_save_cppflags="$CPPFLAGS" - - # The variable `found' is the prefix under which we've found - # Berkeley DB, or `not' if we haven't found it anywhere yet. - found=not - for bdb_place in $bdb_places; do - - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - case "$bdb_place" in - "std" ) - description="the standard places" - ;; - *":"* ) - header="`echo $bdb_place | sed -e 's/:.*$//'`" - lib="`echo $bdb_place | sed -e 's/^.*://'`" - CPPFLAGS="$CPPFLAGS -I$header" - LDFLAGS="$LDFLAGS -L$lib" - description="$header and $lib" - ;; - * ) - if test -d $bdb_place; then - LDFLAGS="$LDFLAGS -L$bdb_place/lib" - CPPFLAGS="$CPPFLAGS -I$bdb_place/include" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $bdb_place" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: directory not found" >&5 -$as_echo "directory not found" >&6; } - continue - fi - description="$bdb_place" - ;; - esac - - # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this - # trick to display a message instead. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $description" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 -$as_echo "" >&6; } - - for bdb_libname in $bdb_default_search_lib_names; do - for bdb_header in $bdb_default_search_headers; do - # Clear the header cache variable for each location - - cache_id="`echo ac_cv_header_${bdb_header} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - unset $cache_id - as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - - if test ""4"" = "3" -o ""4"" = "4" -o ""4"" = "5"; then - # We generate a separate cache variable for each prefix and libname - # we search under. That way, we avoid caching information that - # changes if the user runs `configure' with a different set of - # switches. - - cache_id="`echo apu_cv_check_berkeley_db_"4"_"8"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -l$bdb_libname" >&5 -$as_echo_n "checking for -l$bdb_libname... " >&6; } - if eval \${$cache_id+:} false; then : - $as_echo_n "(cached) " >&6 -else - - - apu_try_berkeley_db_save_libs="$LIBS" - - apu_check_berkeley_db_major="4" - apu_check_berkeley_db_minor="8" - apu_check_berkeley_db_patch="-1" - apu_try_berkeley_db_header=$bdb_header - apu_try_berkeley_db_libname=$bdb_libname - - LIBS="$LIBS -l$apu_try_berkeley_db_libname" - if test "$cross_compiling" = yes; then : - apu_try_berkeley_db=yes - -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include <stdlib.h> -#include <stdio.h> -#include <$apu_try_berkeley_db_header> -main () -{ - int major, minor, patch; - - db_version(&major, &minor, &patch); - - /* Sanity check: ensure that db.h constants actually match the db library */ - if (major != DB_VERSION_MAJOR - || minor != DB_VERSION_MINOR - || patch != DB_VERSION_PATCH) - exit (1); - - /* Run-time check: ensure the library claims to be the correct version. */ - - if ($apu_check_berkeley_db_major != -1) { - if (major < $apu_check_berkeley_db_major) - exit (1); - if (major > $apu_check_berkeley_db_major) - exit (0); - } - - if ($apu_check_berkeley_db_minor != -1) { - if (minor < $apu_check_berkeley_db_minor) - exit (1); - if (minor > $apu_check_berkeley_db_minor) - exit (0); - } - - if ($apu_check_berkeley_db_patch == -1 - || patch >= $apu_check_berkeley_db_patch) - exit (0); - else - exit (1); -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - apu_try_berkeley_db=yes -else - apu_try_berkeley_db=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - - LIBS="$apu_try_berkeley_db_save_libs" - - - eval "$cache_id=$apu_try_berkeley_db" - -fi - - result="`eval echo '$'$cache_id`" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $result" >&5 -$as_echo "$result" >&6; } - elif test ""4"" = "1"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbopen in -l$bdb_libname" >&5 -$as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dbopen (); -int -main () -{ -return dbopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - elif test ""4"" = "2"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for db_open in -l$bdb_libname" >&5 -$as_echo_n "checking for db_open in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char db_open (); -int -main () -{ -return db_open (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - fi - -else - result="no" -fi - - - - # If we found it, no need to search any more. - if test "$result" = "yes"; then - found="$bdb_place" - break - fi - done - test "$found" != "not" && break - done - test "$found" != "not" && break - done - - # Restore the original values of the flags we tweak. - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - - case "$found" in - "not") - apu_have_db=0 - ;; - "std") - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *":"*) - header="`echo $found | sed -e 's/:.*$//'`" - lib="`echo $found | sed -e 's/^.*://'`" - - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$header\"" - APRUTIL_INCLUDES="-I$header" - else - apr_addto_bugger="-I$header" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$lib\"" - APRUTIL_LDFLAGS="-L$lib" - else - apr_addto_bugger="-L$lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *) - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$found/include\"" - APRUTIL_INCLUDES="-I$found/include" - else - apr_addto_bugger="-I$found/include" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$found/lib\"" - APRUTIL_LDFLAGS="-L$found/lib" - else - apr_addto_bugger="-L$found/lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - esac - - if test "$apu_have_db" = "1"; then - apu_db_version=4 - fi - - if test "$apu_db_version" != "4"; then - as_fn_error $? "Berkeley db4 not found" "$LINENO" 5 - fi - ;; - db50) + db[45]) + db_major=`echo "$requested" | sed -e 's/db//'` + # Start version search at version x.9 + db_minor=9 + while [ $db_minor -ge 0 ] + do places="$check_places" + db_major="$db_major" + db_minor="$db_minor" if test -z "$places"; then - places="std /usr/local/BerkeleyDB.5.0 /boot/home/config" + places="std /usr/local /usr/local/BerkeleyDB.${db_major}.${db_minor} /boot/home/config" fi - bdb_version="5" - if test ""0"" != "-1"; then - bdb_version="$bdb_version."0"" + bdb_version="${db_major}" + if test ""${db_minor}"" != "-1"; then + bdb_version="$bdb_version."${db_minor}"" if test ""-1"" != "-1"; then bdb_version="$bdb_version."-1"" fi fi bdb_places="$places" - bdb_default_search_headers="db50/db.h db5/db.h db.h" - bdb_default_search_lib_names="db-5.0 db5-5.0 db50 db5 db" + bdb_default_search_headers="db${db_major}${db_minor}/db.h db${db_major}/db.h db.h" + bdb_default_search_lib_names="db-${db_major}.${db_minor} db${db_major}-${db_major}.${db_minor} db${db_major}${db_minor} db-${db_major} db${db_major} db" apu_have_db=0 @@ -24122,13 +16198,13 @@ $as_echo "" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - if test ""5"" = "3" -o ""5"" = "4" -o ""5"" = "5"; then + if test ""${db_major}"" = "3" -o ""${db_major}"" = "4" -o ""${db_major}"" = "5"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of # switches. - cache_id="`echo apu_cv_check_berkeley_db_"5"_"0"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \ + cache_id="`echo apu_cv_check_berkeley_db_"${db_major}"_"${db_minor}"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \ | sed -e 's/[^a-zA-Z0-9_]/_/g'`" @@ -24141,8 +16217,8 @@ else apu_try_berkeley_db_save_libs="$LIBS" - apu_check_berkeley_db_major="5" - apu_check_berkeley_db_minor="0" + apu_check_berkeley_db_major="${db_major}" + apu_check_berkeley_db_minor="${db_minor}" apu_check_berkeley_db_patch="-1" apu_try_berkeley_db_header=$bdb_header apu_try_berkeley_db_libname=$bdb_libname @@ -24214,7 +16290,7 @@ fi result="`eval echo '$'$cache_id`" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $result" >&5 $as_echo "$result" >&6; } - elif test ""5"" = "1"; then + elif test ""${db_major}"" = "1"; then as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbopen in -l$bdb_libname" >&5 $as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; } @@ -24260,7 +16336,7 @@ else fi - elif test ""5"" = "2"; then + elif test ""${db_major}"" = "2"; then as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for db_open in -l$bdb_libname" >&5 $as_echo_n "checking for db_open in -l$bdb_libname... " >&6; } @@ -24438,4007 +16514,46 @@ fi esac if test "$apu_have_db" = "1"; then - apu_db_version=5 - fi - - if test "$apu_db_version" != "5"; then - as_fn_error $? "Berkeley db5 not found" "$LINENO" 5 - fi - ;; - db51) - - places="$check_places" - if test -z "$places"; then - places="std /usr/local/BerkeleyDB.5.1 /boot/home/config" - fi - - bdb_version="5" - if test ""1"" != "-1"; then - bdb_version="$bdb_version."1"" - if test ""-1"" != "-1"; then - bdb_version="$bdb_version."-1"" - fi + apu_db_version=${db_major} fi - bdb_places="$places" - bdb_default_search_headers="db51/db.h db5/db.h db.h" - bdb_default_search_lib_names="db-5.1 db5-5.1 db51 db5 db" - - - apu_have_db=0 - - # Save the original values of the flags we tweak. - apu_check_lib_save_libs="$LIBS" - apu_check_lib_save_ldflags="$LDFLAGS" - apu_check_lib_save_cppflags="$CPPFLAGS" - - # The variable `found' is the prefix under which we've found - # Berkeley DB, or `not' if we haven't found it anywhere yet. - found=not - for bdb_place in $bdb_places; do - - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - case "$bdb_place" in - "std" ) - description="the standard places" - ;; - *":"* ) - header="`echo $bdb_place | sed -e 's/:.*$//'`" - lib="`echo $bdb_place | sed -e 's/^.*://'`" - CPPFLAGS="$CPPFLAGS -I$header" - LDFLAGS="$LDFLAGS -L$lib" - description="$header and $lib" - ;; - * ) - if test -d $bdb_place; then - LDFLAGS="$LDFLAGS -L$bdb_place/lib" - CPPFLAGS="$CPPFLAGS -I$bdb_place/include" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $bdb_place" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: directory not found" >&5 -$as_echo "directory not found" >&6; } - continue - fi - description="$bdb_place" - ;; - esac - - # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this - # trick to display a message instead. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $description" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 -$as_echo "" >&6; } - - for bdb_libname in $bdb_default_search_lib_names; do - for bdb_header in $bdb_default_search_headers; do - # Clear the header cache variable for each location - - cache_id="`echo ac_cv_header_${bdb_header} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - unset $cache_id - as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - - if test ""5"" = "3" -o ""5"" = "4" -o ""5"" = "5"; then - # We generate a separate cache variable for each prefix and libname - # we search under. That way, we avoid caching information that - # changes if the user runs `configure' with a different set of - # switches. - - cache_id="`echo apu_cv_check_berkeley_db_"5"_"1"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -l$bdb_libname" >&5 -$as_echo_n "checking for -l$bdb_libname... " >&6; } - if eval \${$cache_id+:} false; then : - $as_echo_n "(cached) " >&6 -else - - - apu_try_berkeley_db_save_libs="$LIBS" - - apu_check_berkeley_db_major="5" - apu_check_berkeley_db_minor="1" - apu_check_berkeley_db_patch="-1" - apu_try_berkeley_db_header=$bdb_header - apu_try_berkeley_db_libname=$bdb_libname - - LIBS="$LIBS -l$apu_try_berkeley_db_libname" - if test "$cross_compiling" = yes; then : - apu_try_berkeley_db=yes - -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include <stdlib.h> -#include <stdio.h> -#include <$apu_try_berkeley_db_header> -main () -{ - int major, minor, patch; - - db_version(&major, &minor, &patch); - /* Sanity check: ensure that db.h constants actually match the db library */ - if (major != DB_VERSION_MAJOR - || minor != DB_VERSION_MINOR - || patch != DB_VERSION_PATCH) - exit (1); - - /* Run-time check: ensure the library claims to be the correct version. */ - - if ($apu_check_berkeley_db_major != -1) { - if (major < $apu_check_berkeley_db_major) - exit (1); - if (major > $apu_check_berkeley_db_major) - exit (0); - } - - if ($apu_check_berkeley_db_minor != -1) { - if (minor < $apu_check_berkeley_db_minor) - exit (1); - if (minor > $apu_check_berkeley_db_minor) - exit (0); - } - - if ($apu_check_berkeley_db_patch == -1 - || patch >= $apu_check_berkeley_db_patch) - exit (0); - else - exit (1); -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - apu_try_berkeley_db=yes -else - apu_try_berkeley_db=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - - LIBS="$apu_try_berkeley_db_save_libs" - - - eval "$cache_id=$apu_try_berkeley_db" - -fi - - result="`eval echo '$'$cache_id`" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $result" >&5 -$as_echo "$result" >&6; } - elif test ""5"" = "1"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbopen in -l$bdb_libname" >&5 -$as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dbopen (); -int -main () -{ -return dbopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - elif test ""5"" = "2"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for db_open in -l$bdb_libname" >&5 -$as_echo_n "checking for db_open in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char db_open (); -int -main () -{ -return db_open (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - fi - -else - result="no" -fi - - - - # If we found it, no need to search any more. - if test "$result" = "yes"; then - found="$bdb_place" - break - fi - done - test "$found" != "not" && break - done - test "$found" != "not" && break - done - - # Restore the original values of the flags we tweak. - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - - case "$found" in - "not") - apu_have_db=0 - ;; - "std") - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *":"*) - header="`echo $found | sed -e 's/:.*$//'`" - lib="`echo $found | sed -e 's/^.*://'`" - - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$header\"" - APRUTIL_INCLUDES="-I$header" - else - apr_addto_bugger="-I$header" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" + if test "$apu_have_db" = "1"; then + break fi + db_minor=`expr $db_minor - 1` done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$lib\"" - APRUTIL_LDFLAGS="-L$lib" - else - apr_addto_bugger="-L$lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *) - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$found/include\"" - APRUTIL_INCLUDES="-I$found/include" - else - apr_addto_bugger="-I$found/include" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$found/lib\"" - APRUTIL_LDFLAGS="-L$found/lib" - else - apr_addto_bugger="-L$found/lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - esac - - if test "$apu_have_db" = "1"; then - apu_db_version=5 - fi - - if test "$apu_db_version" != "5"; then - as_fn_error $? "Berkeley db5 not found" "$LINENO" 5 + if test "$apu_db_version" != "$db_major"; then + as_fn_error $? "Berkeley db$db_major not found" "$LINENO" 5 fi ;; default) all_places="$check_places" + # Start version search at version 5.9 + db_version=59 + while [ $db_version -ge 40 ] + do + db_major=`echo $db_version | sed -e 's/.$//'` + db_minor=`echo $db_version | sed -e 's/.//'` places="$all_places" + db_major="$db_major" + db_minor="$db_minor" if test -z "$places"; then - places="std /usr/local/BerkeleyDB.5.1 /boot/home/config" - fi - - bdb_version="5" - if test ""1"" != "-1"; then - bdb_version="$bdb_version."1"" - if test ""-1"" != "-1"; then - bdb_version="$bdb_version."-1"" - fi - fi - bdb_places="$places" - bdb_default_search_headers="db51/db.h db5/db.h db.h" - bdb_default_search_lib_names="db-5.1 db5-5.1 db51 db5 db" - - - apu_have_db=0 - - # Save the original values of the flags we tweak. - apu_check_lib_save_libs="$LIBS" - apu_check_lib_save_ldflags="$LDFLAGS" - apu_check_lib_save_cppflags="$CPPFLAGS" - - # The variable `found' is the prefix under which we've found - # Berkeley DB, or `not' if we haven't found it anywhere yet. - found=not - for bdb_place in $bdb_places; do - - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - case "$bdb_place" in - "std" ) - description="the standard places" - ;; - *":"* ) - header="`echo $bdb_place | sed -e 's/:.*$//'`" - lib="`echo $bdb_place | sed -e 's/^.*://'`" - CPPFLAGS="$CPPFLAGS -I$header" - LDFLAGS="$LDFLAGS -L$lib" - description="$header and $lib" - ;; - * ) - if test -d $bdb_place; then - LDFLAGS="$LDFLAGS -L$bdb_place/lib" - CPPFLAGS="$CPPFLAGS -I$bdb_place/include" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $bdb_place" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: directory not found" >&5 -$as_echo "directory not found" >&6; } - continue - fi - description="$bdb_place" - ;; - esac - - # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this - # trick to display a message instead. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $description" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 -$as_echo "" >&6; } - - for bdb_libname in $bdb_default_search_lib_names; do - for bdb_header in $bdb_default_search_headers; do - # Clear the header cache variable for each location - - cache_id="`echo ac_cv_header_${bdb_header} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - unset $cache_id - as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - - if test ""5"" = "3" -o ""5"" = "4" -o ""5"" = "5"; then - # We generate a separate cache variable for each prefix and libname - # we search under. That way, we avoid caching information that - # changes if the user runs `configure' with a different set of - # switches. - - cache_id="`echo apu_cv_check_berkeley_db_"5"_"1"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -l$bdb_libname" >&5 -$as_echo_n "checking for -l$bdb_libname... " >&6; } - if eval \${$cache_id+:} false; then : - $as_echo_n "(cached) " >&6 -else - - - apu_try_berkeley_db_save_libs="$LIBS" - - apu_check_berkeley_db_major="5" - apu_check_berkeley_db_minor="1" - apu_check_berkeley_db_patch="-1" - apu_try_berkeley_db_header=$bdb_header - apu_try_berkeley_db_libname=$bdb_libname - - LIBS="$LIBS -l$apu_try_berkeley_db_libname" - if test "$cross_compiling" = yes; then : - apu_try_berkeley_db=yes - -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include <stdlib.h> -#include <stdio.h> -#include <$apu_try_berkeley_db_header> -main () -{ - int major, minor, patch; - - db_version(&major, &minor, &patch); - - /* Sanity check: ensure that db.h constants actually match the db library */ - if (major != DB_VERSION_MAJOR - || minor != DB_VERSION_MINOR - || patch != DB_VERSION_PATCH) - exit (1); - - /* Run-time check: ensure the library claims to be the correct version. */ - - if ($apu_check_berkeley_db_major != -1) { - if (major < $apu_check_berkeley_db_major) - exit (1); - if (major > $apu_check_berkeley_db_major) - exit (0); - } - - if ($apu_check_berkeley_db_minor != -1) { - if (minor < $apu_check_berkeley_db_minor) - exit (1); - if (minor > $apu_check_berkeley_db_minor) - exit (0); - } - - if ($apu_check_berkeley_db_patch == -1 - || patch >= $apu_check_berkeley_db_patch) - exit (0); - else - exit (1); -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - apu_try_berkeley_db=yes -else - apu_try_berkeley_db=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - - LIBS="$apu_try_berkeley_db_save_libs" - - - eval "$cache_id=$apu_try_berkeley_db" - -fi - - result="`eval echo '$'$cache_id`" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $result" >&5 -$as_echo "$result" >&6; } - elif test ""5"" = "1"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbopen in -l$bdb_libname" >&5 -$as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dbopen (); -int -main () -{ -return dbopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - elif test ""5"" = "2"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for db_open in -l$bdb_libname" >&5 -$as_echo_n "checking for db_open in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char db_open (); -int -main () -{ -return db_open (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - fi - -else - result="no" -fi - - - - # If we found it, no need to search any more. - if test "$result" = "yes"; then - found="$bdb_place" - break - fi - done - test "$found" != "not" && break - done - test "$found" != "not" && break - done - - # Restore the original values of the flags we tweak. - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - - case "$found" in - "not") - apu_have_db=0 - ;; - "std") - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *":"*) - header="`echo $found | sed -e 's/:.*$//'`" - lib="`echo $found | sed -e 's/^.*://'`" - - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$header\"" - APRUTIL_INCLUDES="-I$header" - else - apr_addto_bugger="-I$header" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$lib\"" - APRUTIL_LDFLAGS="-L$lib" - else - apr_addto_bugger="-L$lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *) - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$found/include\"" - APRUTIL_INCLUDES="-I$found/include" - else - apr_addto_bugger="-I$found/include" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$found/lib\"" - APRUTIL_LDFLAGS="-L$found/lib" - else - apr_addto_bugger="-L$found/lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - esac - - if test "$apu_have_db" = "1"; then - apu_db_version=5 - fi - - if test "$apu_db_version" != "5"; then - - places="$all_places" - if test -z "$places"; then - places="std /usr/local/BerkeleyDB.5.0 /boot/home/config" - fi - - bdb_version="5" - if test ""0"" != "-1"; then - bdb_version="$bdb_version."0"" - if test ""-1"" != "-1"; then - bdb_version="$bdb_version."-1"" - fi - fi - bdb_places="$places" - bdb_default_search_headers="db50/db.h db5/db.h db.h" - bdb_default_search_lib_names="db-5.0 db5-5.0 db50 db5 db" - - - apu_have_db=0 - - # Save the original values of the flags we tweak. - apu_check_lib_save_libs="$LIBS" - apu_check_lib_save_ldflags="$LDFLAGS" - apu_check_lib_save_cppflags="$CPPFLAGS" - - # The variable `found' is the prefix under which we've found - # Berkeley DB, or `not' if we haven't found it anywhere yet. - found=not - for bdb_place in $bdb_places; do - - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - case "$bdb_place" in - "std" ) - description="the standard places" - ;; - *":"* ) - header="`echo $bdb_place | sed -e 's/:.*$//'`" - lib="`echo $bdb_place | sed -e 's/^.*://'`" - CPPFLAGS="$CPPFLAGS -I$header" - LDFLAGS="$LDFLAGS -L$lib" - description="$header and $lib" - ;; - * ) - if test -d $bdb_place; then - LDFLAGS="$LDFLAGS -L$bdb_place/lib" - CPPFLAGS="$CPPFLAGS -I$bdb_place/include" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $bdb_place" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: directory not found" >&5 -$as_echo "directory not found" >&6; } - continue - fi - description="$bdb_place" - ;; - esac - - # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this - # trick to display a message instead. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $description" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 -$as_echo "" >&6; } - - for bdb_libname in $bdb_default_search_lib_names; do - for bdb_header in $bdb_default_search_headers; do - # Clear the header cache variable for each location - - cache_id="`echo ac_cv_header_${bdb_header} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - unset $cache_id - as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - - if test ""5"" = "3" -o ""5"" = "4" -o ""5"" = "5"; then - # We generate a separate cache variable for each prefix and libname - # we search under. That way, we avoid caching information that - # changes if the user runs `configure' with a different set of - # switches. - - cache_id="`echo apu_cv_check_berkeley_db_"5"_"0"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -l$bdb_libname" >&5 -$as_echo_n "checking for -l$bdb_libname... " >&6; } - if eval \${$cache_id+:} false; then : - $as_echo_n "(cached) " >&6 -else - - - apu_try_berkeley_db_save_libs="$LIBS" - - apu_check_berkeley_db_major="5" - apu_check_berkeley_db_minor="0" - apu_check_berkeley_db_patch="-1" - apu_try_berkeley_db_header=$bdb_header - apu_try_berkeley_db_libname=$bdb_libname - - LIBS="$LIBS -l$apu_try_berkeley_db_libname" - if test "$cross_compiling" = yes; then : - apu_try_berkeley_db=yes - -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include <stdlib.h> -#include <stdio.h> -#include <$apu_try_berkeley_db_header> -main () -{ - int major, minor, patch; - - db_version(&major, &minor, &patch); - - /* Sanity check: ensure that db.h constants actually match the db library */ - if (major != DB_VERSION_MAJOR - || minor != DB_VERSION_MINOR - || patch != DB_VERSION_PATCH) - exit (1); - - /* Run-time check: ensure the library claims to be the correct version. */ - - if ($apu_check_berkeley_db_major != -1) { - if (major < $apu_check_berkeley_db_major) - exit (1); - if (major > $apu_check_berkeley_db_major) - exit (0); - } - - if ($apu_check_berkeley_db_minor != -1) { - if (minor < $apu_check_berkeley_db_minor) - exit (1); - if (minor > $apu_check_berkeley_db_minor) - exit (0); - } - - if ($apu_check_berkeley_db_patch == -1 - || patch >= $apu_check_berkeley_db_patch) - exit (0); - else - exit (1); -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - apu_try_berkeley_db=yes -else - apu_try_berkeley_db=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - - LIBS="$apu_try_berkeley_db_save_libs" - - - eval "$cache_id=$apu_try_berkeley_db" - -fi - - result="`eval echo '$'$cache_id`" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $result" >&5 -$as_echo "$result" >&6; } - elif test ""5"" = "1"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbopen in -l$bdb_libname" >&5 -$as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dbopen (); -int -main () -{ -return dbopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - elif test ""5"" = "2"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for db_open in -l$bdb_libname" >&5 -$as_echo_n "checking for db_open in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char db_open (); -int -main () -{ -return db_open (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - fi - -else - result="no" -fi - - - - # If we found it, no need to search any more. - if test "$result" = "yes"; then - found="$bdb_place" - break - fi - done - test "$found" != "not" && break - done - test "$found" != "not" && break - done - - # Restore the original values of the flags we tweak. - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - - case "$found" in - "not") - apu_have_db=0 - ;; - "std") - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *":"*) - header="`echo $found | sed -e 's/:.*$//'`" - lib="`echo $found | sed -e 's/^.*://'`" - - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$header\"" - APRUTIL_INCLUDES="-I$header" - else - apr_addto_bugger="-I$header" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$lib\"" - APRUTIL_LDFLAGS="-L$lib" - else - apr_addto_bugger="-L$lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *) - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$found/include\"" - APRUTIL_INCLUDES="-I$found/include" - else - apr_addto_bugger="-I$found/include" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$found/lib\"" - APRUTIL_LDFLAGS="-L$found/lib" - else - apr_addto_bugger="-L$found/lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - esac - - if test "$apu_have_db" = "1"; then - apu_db_version=5 - fi - - if test "$apu_db_version" != "5"; then - - places="$all_places" - if test -z "$places"; then - places="std /usr/local/BerkeleyDB.4.8 /boot/home/config" - fi - - bdb_version="4" - if test ""8"" != "-1"; then - bdb_version="$bdb_version."8"" - if test ""-1"" != "-1"; then - bdb_version="$bdb_version."-1"" - fi - fi - bdb_places="$places" - bdb_default_search_headers="db48/db.h db4/db.h db.h" - bdb_default_search_lib_names="db-4.8 db4-4.8 db48 db4 db" - - - apu_have_db=0 - - # Save the original values of the flags we tweak. - apu_check_lib_save_libs="$LIBS" - apu_check_lib_save_ldflags="$LDFLAGS" - apu_check_lib_save_cppflags="$CPPFLAGS" - - # The variable `found' is the prefix under which we've found - # Berkeley DB, or `not' if we haven't found it anywhere yet. - found=not - for bdb_place in $bdb_places; do - - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - case "$bdb_place" in - "std" ) - description="the standard places" - ;; - *":"* ) - header="`echo $bdb_place | sed -e 's/:.*$//'`" - lib="`echo $bdb_place | sed -e 's/^.*://'`" - CPPFLAGS="$CPPFLAGS -I$header" - LDFLAGS="$LDFLAGS -L$lib" - description="$header and $lib" - ;; - * ) - if test -d $bdb_place; then - LDFLAGS="$LDFLAGS -L$bdb_place/lib" - CPPFLAGS="$CPPFLAGS -I$bdb_place/include" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $bdb_place" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: directory not found" >&5 -$as_echo "directory not found" >&6; } - continue - fi - description="$bdb_place" - ;; - esac - - # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this - # trick to display a message instead. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $description" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 -$as_echo "" >&6; } - - for bdb_libname in $bdb_default_search_lib_names; do - for bdb_header in $bdb_default_search_headers; do - # Clear the header cache variable for each location - - cache_id="`echo ac_cv_header_${bdb_header} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - unset $cache_id - as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - - if test ""4"" = "3" -o ""4"" = "4" -o ""4"" = "5"; then - # We generate a separate cache variable for each prefix and libname - # we search under. That way, we avoid caching information that - # changes if the user runs `configure' with a different set of - # switches. - - cache_id="`echo apu_cv_check_berkeley_db_"4"_"8"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -l$bdb_libname" >&5 -$as_echo_n "checking for -l$bdb_libname... " >&6; } - if eval \${$cache_id+:} false; then : - $as_echo_n "(cached) " >&6 -else - - - apu_try_berkeley_db_save_libs="$LIBS" - - apu_check_berkeley_db_major="4" - apu_check_berkeley_db_minor="8" - apu_check_berkeley_db_patch="-1" - apu_try_berkeley_db_header=$bdb_header - apu_try_berkeley_db_libname=$bdb_libname - - LIBS="$LIBS -l$apu_try_berkeley_db_libname" - if test "$cross_compiling" = yes; then : - apu_try_berkeley_db=yes - -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include <stdlib.h> -#include <stdio.h> -#include <$apu_try_berkeley_db_header> -main () -{ - int major, minor, patch; - - db_version(&major, &minor, &patch); - - /* Sanity check: ensure that db.h constants actually match the db library */ - if (major != DB_VERSION_MAJOR - || minor != DB_VERSION_MINOR - || patch != DB_VERSION_PATCH) - exit (1); - - /* Run-time check: ensure the library claims to be the correct version. */ - - if ($apu_check_berkeley_db_major != -1) { - if (major < $apu_check_berkeley_db_major) - exit (1); - if (major > $apu_check_berkeley_db_major) - exit (0); - } - - if ($apu_check_berkeley_db_minor != -1) { - if (minor < $apu_check_berkeley_db_minor) - exit (1); - if (minor > $apu_check_berkeley_db_minor) - exit (0); - } - - if ($apu_check_berkeley_db_patch == -1 - || patch >= $apu_check_berkeley_db_patch) - exit (0); - else - exit (1); -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - apu_try_berkeley_db=yes -else - apu_try_berkeley_db=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - - LIBS="$apu_try_berkeley_db_save_libs" - - - eval "$cache_id=$apu_try_berkeley_db" - -fi - - result="`eval echo '$'$cache_id`" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $result" >&5 -$as_echo "$result" >&6; } - elif test ""4"" = "1"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbopen in -l$bdb_libname" >&5 -$as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dbopen (); -int -main () -{ -return dbopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - elif test ""4"" = "2"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for db_open in -l$bdb_libname" >&5 -$as_echo_n "checking for db_open in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char db_open (); -int -main () -{ -return db_open (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - fi - -else - result="no" -fi - - - - # If we found it, no need to search any more. - if test "$result" = "yes"; then - found="$bdb_place" - break - fi - done - test "$found" != "not" && break - done - test "$found" != "not" && break - done - - # Restore the original values of the flags we tweak. - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - - case "$found" in - "not") - apu_have_db=0 - ;; - "std") - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *":"*) - header="`echo $found | sed -e 's/:.*$//'`" - lib="`echo $found | sed -e 's/^.*://'`" - - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$header\"" - APRUTIL_INCLUDES="-I$header" - else - apr_addto_bugger="-I$header" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$lib\"" - APRUTIL_LDFLAGS="-L$lib" - else - apr_addto_bugger="-L$lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *) - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$found/include\"" - APRUTIL_INCLUDES="-I$found/include" - else - apr_addto_bugger="-I$found/include" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$found/lib\"" - APRUTIL_LDFLAGS="-L$found/lib" - else - apr_addto_bugger="-L$found/lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - esac - - if test "$apu_have_db" = "1"; then - apu_db_version=4 - fi - - if test "$apu_db_version" != "4"; then - - places="$all_places" - if test -z "$places"; then - places="std /usr/local/BerkeleyDB.4.7 /boot/home/config" - fi - - bdb_version="4" - if test ""7"" != "-1"; then - bdb_version="$bdb_version."7"" - if test ""-1"" != "-1"; then - bdb_version="$bdb_version."-1"" - fi - fi - bdb_places="$places" - bdb_default_search_headers="db47/db.h db4/db.h db.h" - bdb_default_search_lib_names="db-4.7 db4-4.7 db47 db4 db" - - - apu_have_db=0 - - # Save the original values of the flags we tweak. - apu_check_lib_save_libs="$LIBS" - apu_check_lib_save_ldflags="$LDFLAGS" - apu_check_lib_save_cppflags="$CPPFLAGS" - - # The variable `found' is the prefix under which we've found - # Berkeley DB, or `not' if we haven't found it anywhere yet. - found=not - for bdb_place in $bdb_places; do - - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - case "$bdb_place" in - "std" ) - description="the standard places" - ;; - *":"* ) - header="`echo $bdb_place | sed -e 's/:.*$//'`" - lib="`echo $bdb_place | sed -e 's/^.*://'`" - CPPFLAGS="$CPPFLAGS -I$header" - LDFLAGS="$LDFLAGS -L$lib" - description="$header and $lib" - ;; - * ) - if test -d $bdb_place; then - LDFLAGS="$LDFLAGS -L$bdb_place/lib" - CPPFLAGS="$CPPFLAGS -I$bdb_place/include" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $bdb_place" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: directory not found" >&5 -$as_echo "directory not found" >&6; } - continue - fi - description="$bdb_place" - ;; - esac - - # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this - # trick to display a message instead. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $description" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 -$as_echo "" >&6; } - - for bdb_libname in $bdb_default_search_lib_names; do - for bdb_header in $bdb_default_search_headers; do - # Clear the header cache variable for each location - - cache_id="`echo ac_cv_header_${bdb_header} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - unset $cache_id - as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - - if test ""4"" = "3" -o ""4"" = "4" -o ""4"" = "5"; then - # We generate a separate cache variable for each prefix and libname - # we search under. That way, we avoid caching information that - # changes if the user runs `configure' with a different set of - # switches. - - cache_id="`echo apu_cv_check_berkeley_db_"4"_"7"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -l$bdb_libname" >&5 -$as_echo_n "checking for -l$bdb_libname... " >&6; } - if eval \${$cache_id+:} false; then : - $as_echo_n "(cached) " >&6 -else - - - apu_try_berkeley_db_save_libs="$LIBS" - - apu_check_berkeley_db_major="4" - apu_check_berkeley_db_minor="7" - apu_check_berkeley_db_patch="-1" - apu_try_berkeley_db_header=$bdb_header - apu_try_berkeley_db_libname=$bdb_libname - - LIBS="$LIBS -l$apu_try_berkeley_db_libname" - if test "$cross_compiling" = yes; then : - apu_try_berkeley_db=yes - -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include <stdlib.h> -#include <stdio.h> -#include <$apu_try_berkeley_db_header> -main () -{ - int major, minor, patch; - - db_version(&major, &minor, &patch); - - /* Sanity check: ensure that db.h constants actually match the db library */ - if (major != DB_VERSION_MAJOR - || minor != DB_VERSION_MINOR - || patch != DB_VERSION_PATCH) - exit (1); - - /* Run-time check: ensure the library claims to be the correct version. */ - - if ($apu_check_berkeley_db_major != -1) { - if (major < $apu_check_berkeley_db_major) - exit (1); - if (major > $apu_check_berkeley_db_major) - exit (0); - } - - if ($apu_check_berkeley_db_minor != -1) { - if (minor < $apu_check_berkeley_db_minor) - exit (1); - if (minor > $apu_check_berkeley_db_minor) - exit (0); - } - - if ($apu_check_berkeley_db_patch == -1 - || patch >= $apu_check_berkeley_db_patch) - exit (0); - else - exit (1); -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - apu_try_berkeley_db=yes -else - apu_try_berkeley_db=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - - LIBS="$apu_try_berkeley_db_save_libs" - - - eval "$cache_id=$apu_try_berkeley_db" - -fi - - result="`eval echo '$'$cache_id`" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $result" >&5 -$as_echo "$result" >&6; } - elif test ""4"" = "1"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbopen in -l$bdb_libname" >&5 -$as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dbopen (); -int -main () -{ -return dbopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - elif test ""4"" = "2"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for db_open in -l$bdb_libname" >&5 -$as_echo_n "checking for db_open in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char db_open (); -int -main () -{ -return db_open (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - fi - -else - result="no" -fi - - - - # If we found it, no need to search any more. - if test "$result" = "yes"; then - found="$bdb_place" - break - fi - done - test "$found" != "not" && break - done - test "$found" != "not" && break - done - - # Restore the original values of the flags we tweak. - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - - case "$found" in - "not") - apu_have_db=0 - ;; - "std") - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *":"*) - header="`echo $found | sed -e 's/:.*$//'`" - lib="`echo $found | sed -e 's/^.*://'`" - - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$header\"" - APRUTIL_INCLUDES="-I$header" - else - apr_addto_bugger="-I$header" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$lib\"" - APRUTIL_LDFLAGS="-L$lib" - else - apr_addto_bugger="-L$lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *) - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$found/include\"" - APRUTIL_INCLUDES="-I$found/include" - else - apr_addto_bugger="-I$found/include" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$found/lib\"" - APRUTIL_LDFLAGS="-L$found/lib" - else - apr_addto_bugger="-L$found/lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - esac - - if test "$apu_have_db" = "1"; then - apu_db_version=4 - fi - - if test "$apu_db_version" != "4"; then - - places="$all_places" - if test -z "$places"; then - places="std /usr/local/BerkeleyDB.4.6 /boot/home/config" - fi - - bdb_version="4" - if test ""6"" != "-1"; then - bdb_version="$bdb_version."6"" - if test ""-1"" != "-1"; then - bdb_version="$bdb_version."-1"" - fi - fi - bdb_places="$places" - bdb_default_search_headers="db46/db.h db4/db.h db.h" - bdb_default_search_lib_names="db-4.6 db4-4.6 db46 db4 db" - - - apu_have_db=0 - - # Save the original values of the flags we tweak. - apu_check_lib_save_libs="$LIBS" - apu_check_lib_save_ldflags="$LDFLAGS" - apu_check_lib_save_cppflags="$CPPFLAGS" - - # The variable `found' is the prefix under which we've found - # Berkeley DB, or `not' if we haven't found it anywhere yet. - found=not - for bdb_place in $bdb_places; do - - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - case "$bdb_place" in - "std" ) - description="the standard places" - ;; - *":"* ) - header="`echo $bdb_place | sed -e 's/:.*$//'`" - lib="`echo $bdb_place | sed -e 's/^.*://'`" - CPPFLAGS="$CPPFLAGS -I$header" - LDFLAGS="$LDFLAGS -L$lib" - description="$header and $lib" - ;; - * ) - if test -d $bdb_place; then - LDFLAGS="$LDFLAGS -L$bdb_place/lib" - CPPFLAGS="$CPPFLAGS -I$bdb_place/include" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $bdb_place" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: directory not found" >&5 -$as_echo "directory not found" >&6; } - continue - fi - description="$bdb_place" - ;; - esac - - # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this - # trick to display a message instead. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $description" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 -$as_echo "" >&6; } - - for bdb_libname in $bdb_default_search_lib_names; do - for bdb_header in $bdb_default_search_headers; do - # Clear the header cache variable for each location - - cache_id="`echo ac_cv_header_${bdb_header} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - unset $cache_id - as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - - if test ""4"" = "3" -o ""4"" = "4" -o ""4"" = "5"; then - # We generate a separate cache variable for each prefix and libname - # we search under. That way, we avoid caching information that - # changes if the user runs `configure' with a different set of - # switches. - - cache_id="`echo apu_cv_check_berkeley_db_"4"_"6"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -l$bdb_libname" >&5 -$as_echo_n "checking for -l$bdb_libname... " >&6; } - if eval \${$cache_id+:} false; then : - $as_echo_n "(cached) " >&6 -else - - - apu_try_berkeley_db_save_libs="$LIBS" - - apu_check_berkeley_db_major="4" - apu_check_berkeley_db_minor="6" - apu_check_berkeley_db_patch="-1" - apu_try_berkeley_db_header=$bdb_header - apu_try_berkeley_db_libname=$bdb_libname - - LIBS="$LIBS -l$apu_try_berkeley_db_libname" - if test "$cross_compiling" = yes; then : - apu_try_berkeley_db=yes - -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include <stdlib.h> -#include <stdio.h> -#include <$apu_try_berkeley_db_header> -main () -{ - int major, minor, patch; - - db_version(&major, &minor, &patch); - - /* Sanity check: ensure that db.h constants actually match the db library */ - if (major != DB_VERSION_MAJOR - || minor != DB_VERSION_MINOR - || patch != DB_VERSION_PATCH) - exit (1); - - /* Run-time check: ensure the library claims to be the correct version. */ - - if ($apu_check_berkeley_db_major != -1) { - if (major < $apu_check_berkeley_db_major) - exit (1); - if (major > $apu_check_berkeley_db_major) - exit (0); - } - - if ($apu_check_berkeley_db_minor != -1) { - if (minor < $apu_check_berkeley_db_minor) - exit (1); - if (minor > $apu_check_berkeley_db_minor) - exit (0); - } - - if ($apu_check_berkeley_db_patch == -1 - || patch >= $apu_check_berkeley_db_patch) - exit (0); - else - exit (1); -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - apu_try_berkeley_db=yes -else - apu_try_berkeley_db=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - - LIBS="$apu_try_berkeley_db_save_libs" - - - eval "$cache_id=$apu_try_berkeley_db" - -fi - - result="`eval echo '$'$cache_id`" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $result" >&5 -$as_echo "$result" >&6; } - elif test ""4"" = "1"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbopen in -l$bdb_libname" >&5 -$as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dbopen (); -int -main () -{ -return dbopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - elif test ""4"" = "2"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for db_open in -l$bdb_libname" >&5 -$as_echo_n "checking for db_open in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char db_open (); -int -main () -{ -return db_open (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - fi - -else - result="no" -fi - - - - # If we found it, no need to search any more. - if test "$result" = "yes"; then - found="$bdb_place" - break - fi - done - test "$found" != "not" && break - done - test "$found" != "not" && break - done - - # Restore the original values of the flags we tweak. - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - - case "$found" in - "not") - apu_have_db=0 - ;; - "std") - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *":"*) - header="`echo $found | sed -e 's/:.*$//'`" - lib="`echo $found | sed -e 's/^.*://'`" - - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$header\"" - APRUTIL_INCLUDES="-I$header" - else - apr_addto_bugger="-I$header" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$lib\"" - APRUTIL_LDFLAGS="-L$lib" - else - apr_addto_bugger="-L$lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *) - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$found/include\"" - APRUTIL_INCLUDES="-I$found/include" - else - apr_addto_bugger="-I$found/include" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$found/lib\"" - APRUTIL_LDFLAGS="-L$found/lib" - else - apr_addto_bugger="-L$found/lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - esac - - if test "$apu_have_db" = "1"; then - apu_db_version=4 - fi - - if test "$apu_db_version" != "4"; then - - places="$all_places" - if test -z "$places"; then - places="std /usr/local/BerkeleyDB.4.5 /boot/home/config" - fi - - bdb_version="4" - if test ""5"" != "-1"; then - bdb_version="$bdb_version."5"" - if test ""-1"" != "-1"; then - bdb_version="$bdb_version."-1"" - fi - fi - bdb_places="$places" - bdb_default_search_headers="db45/db.h db4/db.h db.h" - bdb_default_search_lib_names="db-4.5 db4-4.5 db45 db4 db" - - - apu_have_db=0 - - # Save the original values of the flags we tweak. - apu_check_lib_save_libs="$LIBS" - apu_check_lib_save_ldflags="$LDFLAGS" - apu_check_lib_save_cppflags="$CPPFLAGS" - - # The variable `found' is the prefix under which we've found - # Berkeley DB, or `not' if we haven't found it anywhere yet. - found=not - for bdb_place in $bdb_places; do - - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - case "$bdb_place" in - "std" ) - description="the standard places" - ;; - *":"* ) - header="`echo $bdb_place | sed -e 's/:.*$//'`" - lib="`echo $bdb_place | sed -e 's/^.*://'`" - CPPFLAGS="$CPPFLAGS -I$header" - LDFLAGS="$LDFLAGS -L$lib" - description="$header and $lib" - ;; - * ) - if test -d $bdb_place; then - LDFLAGS="$LDFLAGS -L$bdb_place/lib" - CPPFLAGS="$CPPFLAGS -I$bdb_place/include" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $bdb_place" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: directory not found" >&5 -$as_echo "directory not found" >&6; } - continue - fi - description="$bdb_place" - ;; - esac - - # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this - # trick to display a message instead. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $description" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 -$as_echo "" >&6; } - - for bdb_libname in $bdb_default_search_lib_names; do - for bdb_header in $bdb_default_search_headers; do - # Clear the header cache variable for each location - - cache_id="`echo ac_cv_header_${bdb_header} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - unset $cache_id - as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - - if test ""4"" = "3" -o ""4"" = "4" -o ""4"" = "5"; then - # We generate a separate cache variable for each prefix and libname - # we search under. That way, we avoid caching information that - # changes if the user runs `configure' with a different set of - # switches. - - cache_id="`echo apu_cv_check_berkeley_db_"4"_"5"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -l$bdb_libname" >&5 -$as_echo_n "checking for -l$bdb_libname... " >&6; } - if eval \${$cache_id+:} false; then : - $as_echo_n "(cached) " >&6 -else - - - apu_try_berkeley_db_save_libs="$LIBS" - - apu_check_berkeley_db_major="4" - apu_check_berkeley_db_minor="5" - apu_check_berkeley_db_patch="-1" - apu_try_berkeley_db_header=$bdb_header - apu_try_berkeley_db_libname=$bdb_libname - - LIBS="$LIBS -l$apu_try_berkeley_db_libname" - if test "$cross_compiling" = yes; then : - apu_try_berkeley_db=yes - -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include <stdlib.h> -#include <stdio.h> -#include <$apu_try_berkeley_db_header> -main () -{ - int major, minor, patch; - - db_version(&major, &minor, &patch); - - /* Sanity check: ensure that db.h constants actually match the db library */ - if (major != DB_VERSION_MAJOR - || minor != DB_VERSION_MINOR - || patch != DB_VERSION_PATCH) - exit (1); - - /* Run-time check: ensure the library claims to be the correct version. */ - - if ($apu_check_berkeley_db_major != -1) { - if (major < $apu_check_berkeley_db_major) - exit (1); - if (major > $apu_check_berkeley_db_major) - exit (0); - } - - if ($apu_check_berkeley_db_minor != -1) { - if (minor < $apu_check_berkeley_db_minor) - exit (1); - if (minor > $apu_check_berkeley_db_minor) - exit (0); - } - - if ($apu_check_berkeley_db_patch == -1 - || patch >= $apu_check_berkeley_db_patch) - exit (0); - else - exit (1); -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - apu_try_berkeley_db=yes -else - apu_try_berkeley_db=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - - LIBS="$apu_try_berkeley_db_save_libs" - - - eval "$cache_id=$apu_try_berkeley_db" - -fi - - result="`eval echo '$'$cache_id`" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $result" >&5 -$as_echo "$result" >&6; } - elif test ""4"" = "1"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbopen in -l$bdb_libname" >&5 -$as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dbopen (); -int -main () -{ -return dbopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - elif test ""4"" = "2"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for db_open in -l$bdb_libname" >&5 -$as_echo_n "checking for db_open in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char db_open (); -int -main () -{ -return db_open (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - fi - -else - result="no" -fi - - - - # If we found it, no need to search any more. - if test "$result" = "yes"; then - found="$bdb_place" - break - fi - done - test "$found" != "not" && break - done - test "$found" != "not" && break - done - - # Restore the original values of the flags we tweak. - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - - case "$found" in - "not") - apu_have_db=0 - ;; - "std") - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *":"*) - header="`echo $found | sed -e 's/:.*$//'`" - lib="`echo $found | sed -e 's/^.*://'`" - - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$header\"" - APRUTIL_INCLUDES="-I$header" - else - apr_addto_bugger="-I$header" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$lib\"" - APRUTIL_LDFLAGS="-L$lib" - else - apr_addto_bugger="-L$lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *) - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$found/include\"" - APRUTIL_INCLUDES="-I$found/include" - else - apr_addto_bugger="-I$found/include" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$found/lib\"" - APRUTIL_LDFLAGS="-L$found/lib" - else - apr_addto_bugger="-L$found/lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - esac - - if test "$apu_have_db" = "1"; then - apu_db_version=4 - fi - - if test "$apu_db_version" != "4"; then - - places="$all_places" - if test -z "$places"; then - places="std /usr/local/BerkeleyDB.4.4 /boot/home/config" - fi - - bdb_version="4" - if test ""4"" != "-1"; then - bdb_version="$bdb_version."4"" - if test ""-1"" != "-1"; then - bdb_version="$bdb_version."-1"" - fi - fi - bdb_places="$places" - bdb_default_search_headers="db44/db.h db4/db.h db.h" - bdb_default_search_lib_names="db-4.4 db4-4.4 db44 db4 db" - - - apu_have_db=0 - - # Save the original values of the flags we tweak. - apu_check_lib_save_libs="$LIBS" - apu_check_lib_save_ldflags="$LDFLAGS" - apu_check_lib_save_cppflags="$CPPFLAGS" - - # The variable `found' is the prefix under which we've found - # Berkeley DB, or `not' if we haven't found it anywhere yet. - found=not - for bdb_place in $bdb_places; do - - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - case "$bdb_place" in - "std" ) - description="the standard places" - ;; - *":"* ) - header="`echo $bdb_place | sed -e 's/:.*$//'`" - lib="`echo $bdb_place | sed -e 's/^.*://'`" - CPPFLAGS="$CPPFLAGS -I$header" - LDFLAGS="$LDFLAGS -L$lib" - description="$header and $lib" - ;; - * ) - if test -d $bdb_place; then - LDFLAGS="$LDFLAGS -L$bdb_place/lib" - CPPFLAGS="$CPPFLAGS -I$bdb_place/include" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $bdb_place" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: directory not found" >&5 -$as_echo "directory not found" >&6; } - continue - fi - description="$bdb_place" - ;; - esac - - # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this - # trick to display a message instead. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $description" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 -$as_echo "" >&6; } - - for bdb_libname in $bdb_default_search_lib_names; do - for bdb_header in $bdb_default_search_headers; do - # Clear the header cache variable for each location - - cache_id="`echo ac_cv_header_${bdb_header} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - unset $cache_id - as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - - if test ""4"" = "3" -o ""4"" = "4" -o ""4"" = "5"; then - # We generate a separate cache variable for each prefix and libname - # we search under. That way, we avoid caching information that - # changes if the user runs `configure' with a different set of - # switches. - - cache_id="`echo apu_cv_check_berkeley_db_"4"_"4"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -l$bdb_libname" >&5 -$as_echo_n "checking for -l$bdb_libname... " >&6; } - if eval \${$cache_id+:} false; then : - $as_echo_n "(cached) " >&6 -else - - - apu_try_berkeley_db_save_libs="$LIBS" - - apu_check_berkeley_db_major="4" - apu_check_berkeley_db_minor="4" - apu_check_berkeley_db_patch="-1" - apu_try_berkeley_db_header=$bdb_header - apu_try_berkeley_db_libname=$bdb_libname - - LIBS="$LIBS -l$apu_try_berkeley_db_libname" - if test "$cross_compiling" = yes; then : - apu_try_berkeley_db=yes - -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include <stdlib.h> -#include <stdio.h> -#include <$apu_try_berkeley_db_header> -main () -{ - int major, minor, patch; - - db_version(&major, &minor, &patch); - - /* Sanity check: ensure that db.h constants actually match the db library */ - if (major != DB_VERSION_MAJOR - || minor != DB_VERSION_MINOR - || patch != DB_VERSION_PATCH) - exit (1); - - /* Run-time check: ensure the library claims to be the correct version. */ - - if ($apu_check_berkeley_db_major != -1) { - if (major < $apu_check_berkeley_db_major) - exit (1); - if (major > $apu_check_berkeley_db_major) - exit (0); - } - - if ($apu_check_berkeley_db_minor != -1) { - if (minor < $apu_check_berkeley_db_minor) - exit (1); - if (minor > $apu_check_berkeley_db_minor) - exit (0); - } - - if ($apu_check_berkeley_db_patch == -1 - || patch >= $apu_check_berkeley_db_patch) - exit (0); - else - exit (1); -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - apu_try_berkeley_db=yes -else - apu_try_berkeley_db=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - - LIBS="$apu_try_berkeley_db_save_libs" - - - eval "$cache_id=$apu_try_berkeley_db" - -fi - - result="`eval echo '$'$cache_id`" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $result" >&5 -$as_echo "$result" >&6; } - elif test ""4"" = "1"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbopen in -l$bdb_libname" >&5 -$as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dbopen (); -int -main () -{ -return dbopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - elif test ""4"" = "2"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for db_open in -l$bdb_libname" >&5 -$as_echo_n "checking for db_open in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char db_open (); -int -main () -{ -return db_open (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - fi - -else - result="no" -fi - - - - # If we found it, no need to search any more. - if test "$result" = "yes"; then - found="$bdb_place" - break - fi - done - test "$found" != "not" && break - done - test "$found" != "not" && break - done - - # Restore the original values of the flags we tweak. - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - - case "$found" in - "not") - apu_have_db=0 - ;; - "std") - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *":"*) - header="`echo $found | sed -e 's/:.*$//'`" - lib="`echo $found | sed -e 's/^.*://'`" - - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$header\"" - APRUTIL_INCLUDES="-I$header" - else - apr_addto_bugger="-I$header" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$lib\"" - APRUTIL_LDFLAGS="-L$lib" - else - apr_addto_bugger="-L$lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *) - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$found/include\"" - APRUTIL_INCLUDES="-I$found/include" - else - apr_addto_bugger="-I$found/include" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$found/lib\"" - APRUTIL_LDFLAGS="-L$found/lib" - else - apr_addto_bugger="-L$found/lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - esac - - if test "$apu_have_db" = "1"; then - apu_db_version=4 - fi - - if test "$apu_db_version" != "4"; then - - places="$all_places" - if test -z "$places"; then - places="std /usr/local/BerkeleyDB.4.3 /boot/home/config" - fi - - bdb_version="4" - if test ""3"" != "-1"; then - bdb_version="$bdb_version."3"" - if test ""-1"" != "-1"; then - bdb_version="$bdb_version."-1"" - fi - fi - bdb_places="$places" - bdb_default_search_headers="db43/db.h db4/db.h db.h" - bdb_default_search_lib_names="db-4.3 db4-4.3 db43 db4 db" - - - apu_have_db=0 - - # Save the original values of the flags we tweak. - apu_check_lib_save_libs="$LIBS" - apu_check_lib_save_ldflags="$LDFLAGS" - apu_check_lib_save_cppflags="$CPPFLAGS" - - # The variable `found' is the prefix under which we've found - # Berkeley DB, or `not' if we haven't found it anywhere yet. - found=not - for bdb_place in $bdb_places; do - - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - case "$bdb_place" in - "std" ) - description="the standard places" - ;; - *":"* ) - header="`echo $bdb_place | sed -e 's/:.*$//'`" - lib="`echo $bdb_place | sed -e 's/^.*://'`" - CPPFLAGS="$CPPFLAGS -I$header" - LDFLAGS="$LDFLAGS -L$lib" - description="$header and $lib" - ;; - * ) - if test -d $bdb_place; then - LDFLAGS="$LDFLAGS -L$bdb_place/lib" - CPPFLAGS="$CPPFLAGS -I$bdb_place/include" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $bdb_place" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: directory not found" >&5 -$as_echo "directory not found" >&6; } - continue - fi - description="$bdb_place" - ;; - esac - - # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this - # trick to display a message instead. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $description" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 -$as_echo "" >&6; } - - for bdb_libname in $bdb_default_search_lib_names; do - for bdb_header in $bdb_default_search_headers; do - # Clear the header cache variable for each location - - cache_id="`echo ac_cv_header_${bdb_header} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - unset $cache_id - as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - - if test ""4"" = "3" -o ""4"" = "4" -o ""4"" = "5"; then - # We generate a separate cache variable for each prefix and libname - # we search under. That way, we avoid caching information that - # changes if the user runs `configure' with a different set of - # switches. - - cache_id="`echo apu_cv_check_berkeley_db_"4"_"3"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -l$bdb_libname" >&5 -$as_echo_n "checking for -l$bdb_libname... " >&6; } - if eval \${$cache_id+:} false; then : - $as_echo_n "(cached) " >&6 -else - - - apu_try_berkeley_db_save_libs="$LIBS" - - apu_check_berkeley_db_major="4" - apu_check_berkeley_db_minor="3" - apu_check_berkeley_db_patch="-1" - apu_try_berkeley_db_header=$bdb_header - apu_try_berkeley_db_libname=$bdb_libname - - LIBS="$LIBS -l$apu_try_berkeley_db_libname" - if test "$cross_compiling" = yes; then : - apu_try_berkeley_db=yes - -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include <stdlib.h> -#include <stdio.h> -#include <$apu_try_berkeley_db_header> -main () -{ - int major, minor, patch; - - db_version(&major, &minor, &patch); - - /* Sanity check: ensure that db.h constants actually match the db library */ - if (major != DB_VERSION_MAJOR - || minor != DB_VERSION_MINOR - || patch != DB_VERSION_PATCH) - exit (1); - - /* Run-time check: ensure the library claims to be the correct version. */ - - if ($apu_check_berkeley_db_major != -1) { - if (major < $apu_check_berkeley_db_major) - exit (1); - if (major > $apu_check_berkeley_db_major) - exit (0); - } - - if ($apu_check_berkeley_db_minor != -1) { - if (minor < $apu_check_berkeley_db_minor) - exit (1); - if (minor > $apu_check_berkeley_db_minor) - exit (0); - } - - if ($apu_check_berkeley_db_patch == -1 - || patch >= $apu_check_berkeley_db_patch) - exit (0); - else - exit (1); -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - apu_try_berkeley_db=yes -else - apu_try_berkeley_db=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - - LIBS="$apu_try_berkeley_db_save_libs" - - - eval "$cache_id=$apu_try_berkeley_db" - -fi - - result="`eval echo '$'$cache_id`" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $result" >&5 -$as_echo "$result" >&6; } - elif test ""4"" = "1"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbopen in -l$bdb_libname" >&5 -$as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dbopen (); -int -main () -{ -return dbopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - elif test ""4"" = "2"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for db_open in -l$bdb_libname" >&5 -$as_echo_n "checking for db_open in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char db_open (); -int -main () -{ -return db_open (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - fi - -else - result="no" -fi - - - - # If we found it, no need to search any more. - if test "$result" = "yes"; then - found="$bdb_place" - break - fi - done - test "$found" != "not" && break - done - test "$found" != "not" && break - done - - # Restore the original values of the flags we tweak. - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - - case "$found" in - "not") - apu_have_db=0 - ;; - "std") - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *":"*) - header="`echo $found | sed -e 's/:.*$//'`" - lib="`echo $found | sed -e 's/^.*://'`" - - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$header\"" - APRUTIL_INCLUDES="-I$header" - else - apr_addto_bugger="-I$header" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$lib\"" - APRUTIL_LDFLAGS="-L$lib" - else - apr_addto_bugger="-L$lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *) - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$found/include\"" - APRUTIL_INCLUDES="-I$found/include" - else - apr_addto_bugger="-I$found/include" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$found/lib\"" - APRUTIL_LDFLAGS="-L$found/lib" - else - apr_addto_bugger="-L$found/lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - esac - - if test "$apu_have_db" = "1"; then - apu_db_version=4 - fi - - if test "$apu_db_version" != "4"; then - - places="$all_places" - if test -z "$places"; then - places="std /usr/local /usr/local/BerkeleyDB.4.2 /boot/home/config" - fi - - bdb_version="4" - if test ""2"" != "-1"; then - bdb_version="$bdb_version."2"" - if test ""-1"" != "-1"; then - bdb_version="$bdb_version."-1"" - fi - fi - bdb_places="$places" - bdb_default_search_headers="db42/db.h db4/db.h db.h" - bdb_default_search_lib_names="db-4.2 db42 db4 db" - - - apu_have_db=0 - - # Save the original values of the flags we tweak. - apu_check_lib_save_libs="$LIBS" - apu_check_lib_save_ldflags="$LDFLAGS" - apu_check_lib_save_cppflags="$CPPFLAGS" - - # The variable `found' is the prefix under which we've found - # Berkeley DB, or `not' if we haven't found it anywhere yet. - found=not - for bdb_place in $bdb_places; do - - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - case "$bdb_place" in - "std" ) - description="the standard places" - ;; - *":"* ) - header="`echo $bdb_place | sed -e 's/:.*$//'`" - lib="`echo $bdb_place | sed -e 's/^.*://'`" - CPPFLAGS="$CPPFLAGS -I$header" - LDFLAGS="$LDFLAGS -L$lib" - description="$header and $lib" - ;; - * ) - if test -d $bdb_place; then - LDFLAGS="$LDFLAGS -L$bdb_place/lib" - CPPFLAGS="$CPPFLAGS -I$bdb_place/include" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $bdb_place" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: directory not found" >&5 -$as_echo "directory not found" >&6; } - continue - fi - description="$bdb_place" - ;; - esac - - # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this - # trick to display a message instead. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $description" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 -$as_echo "" >&6; } - - for bdb_libname in $bdb_default_search_lib_names; do - for bdb_header in $bdb_default_search_headers; do - # Clear the header cache variable for each location - - cache_id="`echo ac_cv_header_${bdb_header} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - unset $cache_id - as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - - if test ""4"" = "3" -o ""4"" = "4" -o ""4"" = "5"; then - # We generate a separate cache variable for each prefix and libname - # we search under. That way, we avoid caching information that - # changes if the user runs `configure' with a different set of - # switches. - - cache_id="`echo apu_cv_check_berkeley_db_"4"_"2"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -l$bdb_libname" >&5 -$as_echo_n "checking for -l$bdb_libname... " >&6; } - if eval \${$cache_id+:} false; then : - $as_echo_n "(cached) " >&6 -else - - - apu_try_berkeley_db_save_libs="$LIBS" - - apu_check_berkeley_db_major="4" - apu_check_berkeley_db_minor="2" - apu_check_berkeley_db_patch="-1" - apu_try_berkeley_db_header=$bdb_header - apu_try_berkeley_db_libname=$bdb_libname - - LIBS="$LIBS -l$apu_try_berkeley_db_libname" - if test "$cross_compiling" = yes; then : - apu_try_berkeley_db=yes - -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include <stdlib.h> -#include <stdio.h> -#include <$apu_try_berkeley_db_header> -main () -{ - int major, minor, patch; - - db_version(&major, &minor, &patch); - - /* Sanity check: ensure that db.h constants actually match the db library */ - if (major != DB_VERSION_MAJOR - || minor != DB_VERSION_MINOR - || patch != DB_VERSION_PATCH) - exit (1); - - /* Run-time check: ensure the library claims to be the correct version. */ - - if ($apu_check_berkeley_db_major != -1) { - if (major < $apu_check_berkeley_db_major) - exit (1); - if (major > $apu_check_berkeley_db_major) - exit (0); - } - - if ($apu_check_berkeley_db_minor != -1) { - if (minor < $apu_check_berkeley_db_minor) - exit (1); - if (minor > $apu_check_berkeley_db_minor) - exit (0); - } - - if ($apu_check_berkeley_db_patch == -1 - || patch >= $apu_check_berkeley_db_patch) - exit (0); - else - exit (1); -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - apu_try_berkeley_db=yes -else - apu_try_berkeley_db=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - - LIBS="$apu_try_berkeley_db_save_libs" - - - eval "$cache_id=$apu_try_berkeley_db" - -fi - - result="`eval echo '$'$cache_id`" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $result" >&5 -$as_echo "$result" >&6; } - elif test ""4"" = "1"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbopen in -l$bdb_libname" >&5 -$as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dbopen (); -int -main () -{ -return dbopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - elif test ""4"" = "2"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for db_open in -l$bdb_libname" >&5 -$as_echo_n "checking for db_open in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char db_open (); -int -main () -{ -return db_open (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - fi - -else - result="no" -fi - - - - # If we found it, no need to search any more. - if test "$result" = "yes"; then - found="$bdb_place" - break - fi - done - test "$found" != "not" && break - done - test "$found" != "not" && break - done - - # Restore the original values of the flags we tweak. - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - - case "$found" in - "not") - apu_have_db=0 - ;; - "std") - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *":"*) - header="`echo $found | sed -e 's/:.*$//'`" - lib="`echo $found | sed -e 's/^.*://'`" - - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$header\"" - APRUTIL_INCLUDES="-I$header" - else - apr_addto_bugger="-I$header" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$lib\"" - APRUTIL_LDFLAGS="-L$lib" - else - apr_addto_bugger="-L$lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *) - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$found/include\"" - APRUTIL_INCLUDES="-I$found/include" - else - apr_addto_bugger="-I$found/include" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$found/lib\"" - APRUTIL_LDFLAGS="-L$found/lib" - else - apr_addto_bugger="-L$found/lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - esac - - if test "$apu_have_db" = "1"; then - apu_db_version=4 - fi - - if test "$apu_db_version" != "4"; then - - places="$all_places" - if test -z "$places"; then - places="std /usr/local /usr/local/BerkeleyDB.4.1 /boot/home/config" + places="std /usr/local /usr/local/BerkeleyDB.${db_major}.${db_minor} /boot/home/config" fi - bdb_version="4" - if test ""1"" != "-1"; then - bdb_version="$bdb_version."1"" + bdb_version="${db_major}" + if test ""${db_minor}"" != "-1"; then + bdb_version="$bdb_version."${db_minor}"" if test ""-1"" != "-1"; then bdb_version="$bdb_version."-1"" fi fi bdb_places="$places" - bdb_default_search_headers="db41/db.h db4/db.h db.h" - bdb_default_search_lib_names="db-4.1 db41 db4 db" + bdb_default_search_headers="db${db_major}${db_minor}/db.h db${db_major}/db.h db.h" + bdb_default_search_lib_names="db-${db_major}.${db_minor} db${db_major}-${db_major}.${db_minor} db${db_major}${db_minor} db-${db_major} db${db_major} db" apu_have_db=0 @@ -28500,13 +16615,13 @@ $as_echo "" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - if test ""4"" = "3" -o ""4"" = "4" -o ""4"" = "5"; then + if test ""${db_major}"" = "3" -o ""${db_major}"" = "4" -o ""${db_major}"" = "5"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of # switches. - cache_id="`echo apu_cv_check_berkeley_db_"4"_"1"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \ + cache_id="`echo apu_cv_check_berkeley_db_"${db_major}"_"${db_minor}"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \ | sed -e 's/[^a-zA-Z0-9_]/_/g'`" @@ -28519,8 +16634,8 @@ else apu_try_berkeley_db_save_libs="$LIBS" - apu_check_berkeley_db_major="4" - apu_check_berkeley_db_minor="1" + apu_check_berkeley_db_major="${db_major}" + apu_check_berkeley_db_minor="${db_minor}" apu_check_berkeley_db_patch="-1" apu_try_berkeley_db_header=$bdb_header apu_try_berkeley_db_libname=$bdb_libname @@ -28592,7 +16707,7 @@ fi result="`eval echo '$'$cache_id`" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $result" >&5 $as_echo "$result" >&6; } - elif test ""4"" = "1"; then + elif test ""${db_major}"" = "1"; then as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbopen in -l$bdb_libname" >&5 $as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; } @@ -28638,7 +16753,7 @@ else fi - elif test ""4"" = "2"; then + elif test ""${db_major}"" = "2"; then as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for db_open in -l$bdb_libname" >&5 $as_echo_n "checking for db_open in -l$bdb_libname... " >&6; } @@ -28816,407 +16931,15 @@ fi esac if test "$apu_have_db" = "1"; then - apu_db_version=4 - fi - - if test "$apu_db_version" != "4"; then - - places="$all_places" - if test -z "$places"; then - places="std /usr/local /usr/local/BerkeleyDB.4.0 /boot/home/config" + apu_db_version=${db_major} fi - bdb_version="4" - if test ""0"" != "-1"; then - bdb_version="$bdb_version."0"" - if test ""-1"" != "-1"; then - bdb_version="$bdb_version."-1"" + if test "$apu_have_db" = "1"; then + break fi - fi - bdb_places="$places" - bdb_default_search_headers="db4/db.h db.h" - bdb_default_search_lib_names="db-4.0 db4 db" - - - apu_have_db=0 - - # Save the original values of the flags we tweak. - apu_check_lib_save_libs="$LIBS" - apu_check_lib_save_ldflags="$LDFLAGS" - apu_check_lib_save_cppflags="$CPPFLAGS" - - # The variable `found' is the prefix under which we've found - # Berkeley DB, or `not' if we haven't found it anywhere yet. - found=not - for bdb_place in $bdb_places; do - - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - case "$bdb_place" in - "std" ) - description="the standard places" - ;; - *":"* ) - header="`echo $bdb_place | sed -e 's/:.*$//'`" - lib="`echo $bdb_place | sed -e 's/^.*://'`" - CPPFLAGS="$CPPFLAGS -I$header" - LDFLAGS="$LDFLAGS -L$lib" - description="$header and $lib" - ;; - * ) - if test -d $bdb_place; then - LDFLAGS="$LDFLAGS -L$bdb_place/lib" - CPPFLAGS="$CPPFLAGS -I$bdb_place/include" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $bdb_place" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $bdb_place... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: directory not found" >&5 -$as_echo "directory not found" >&6; } - continue - fi - description="$bdb_place" - ;; - esac - - # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this - # trick to display a message instead. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB $bdb_version in $description" >&5 -$as_echo_n "checking for Berkeley DB $bdb_version in $description... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 -$as_echo "" >&6; } - - for bdb_libname in $bdb_default_search_lib_names; do - for bdb_header in $bdb_default_search_headers; do - # Clear the header cache variable for each location - - cache_id="`echo ac_cv_header_${bdb_header} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - unset $cache_id - as_ac_Header=`$as_echo "ac_cv_header_$bdb_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - - if test ""4"" = "3" -o ""4"" = "4" -o ""4"" = "5"; then - # We generate a separate cache variable for each prefix and libname - # we search under. That way, we avoid caching information that - # changes if the user runs `configure' with a different set of - # switches. - - cache_id="`echo apu_cv_check_berkeley_db_"4"_"0"_"-1"_${bdb_header}_${bdb_libname}_in_${bdb_place} \ - | sed -e 's/[^a-zA-Z0-9_]/_/g'`" - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -l$bdb_libname" >&5 -$as_echo_n "checking for -l$bdb_libname... " >&6; } - if eval \${$cache_id+:} false; then : - $as_echo_n "(cached) " >&6 -else - - - apu_try_berkeley_db_save_libs="$LIBS" - - apu_check_berkeley_db_major="4" - apu_check_berkeley_db_minor="0" - apu_check_berkeley_db_patch="-1" - apu_try_berkeley_db_header=$bdb_header - apu_try_berkeley_db_libname=$bdb_libname - - LIBS="$LIBS -l$apu_try_berkeley_db_libname" - if test "$cross_compiling" = yes; then : - apu_try_berkeley_db=yes - -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include <stdlib.h> -#include <stdio.h> -#include <$apu_try_berkeley_db_header> -main () -{ - int major, minor, patch; - - db_version(&major, &minor, &patch); - - /* Sanity check: ensure that db.h constants actually match the db library */ - if (major != DB_VERSION_MAJOR - || minor != DB_VERSION_MINOR - || patch != DB_VERSION_PATCH) - exit (1); - - /* Run-time check: ensure the library claims to be the correct version. */ - - if ($apu_check_berkeley_db_major != -1) { - if (major < $apu_check_berkeley_db_major) - exit (1); - if (major > $apu_check_berkeley_db_major) - exit (0); - } - - if ($apu_check_berkeley_db_minor != -1) { - if (minor < $apu_check_berkeley_db_minor) - exit (1); - if (minor > $apu_check_berkeley_db_minor) - exit (0); - } - - if ($apu_check_berkeley_db_patch == -1 - || patch >= $apu_check_berkeley_db_patch) - exit (0); - else - exit (1); -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - apu_try_berkeley_db=yes -else - apu_try_berkeley_db=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - - LIBS="$apu_try_berkeley_db_save_libs" - - - eval "$cache_id=$apu_try_berkeley_db" - -fi - - result="`eval echo '$'$cache_id`" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $result" >&5 -$as_echo "$result" >&6; } - elif test ""4"" = "1"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_dbopen" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbopen in -l$bdb_libname" >&5 -$as_echo_n "checking for dbopen in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dbopen (); -int -main () -{ -return dbopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - elif test ""4"" = "2"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$bdb_libname''_db_open" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for db_open in -l$bdb_libname" >&5 -$as_echo_n "checking for db_open in -l$bdb_libname... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$bdb_libname $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char db_open (); -int -main () -{ -return db_open (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - result=yes -else - result=no - -fi - - fi - -else - result="no" -fi - - - - # If we found it, no need to search any more. - if test "$result" = "yes"; then - found="$bdb_place" - break - fi - done - test "$found" != "not" && break - done - test "$found" != "not" && break + db_version=`expr $db_version - 1` done - - # Restore the original values of the flags we tweak. - LDFLAGS="$apu_check_lib_save_ldflags" - CPPFLAGS="$apu_check_lib_save_cppflags" - - case "$found" in - "not") - apu_have_db=0 - ;; - "std") - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *":"*) - header="`echo $found | sed -e 's/:.*$//'`" - lib="`echo $found | sed -e 's/^.*://'`" - - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$header\"" - APRUTIL_INCLUDES="-I$header" - else - apr_addto_bugger="-I$header" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$lib\"" - APRUTIL_LDFLAGS="-L$lib" - else - apr_addto_bugger="-L$lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - *) - - if test "x$APRUTIL_INCLUDES" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_INCLUDES to \"-I$found/include\"" - APRUTIL_INCLUDES="-I$found/include" - else - apr_addto_bugger="-I$found/include" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_INCLUDES; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_INCLUDES" - APRUTIL_INCLUDES="$APRUTIL_INCLUDES $i" - fi - done - fi - - - if test "x$APRUTIL_LDFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting APRUTIL_LDFLAGS to \"-L$found/lib\"" - APRUTIL_LDFLAGS="-L$found/lib" - else - apr_addto_bugger="-L$found/lib" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $APRUTIL_LDFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to APRUTIL_LDFLAGS" - APRUTIL_LDFLAGS="$APRUTIL_LDFLAGS $i" - fi - done - fi - - apu_db_header=$bdb_header - apu_db_lib=$bdb_libname - apu_have_db=1 - ;; - esac - - if test "$apu_have_db" = "1"; then - apu_db_version=4 - fi - - if test "$apu_db_version" != "4"; then + if test "$apu_have_db" = "0"; then places="$all_places" if test -z "$places"; then @@ -29613,7 +17336,8 @@ fi apu_db_version=3 fi - if test "$apu_db_version" != "3"; then + fi + if test "$apu_have_db" = "0"; then places="$all_places" if test -z "$places"; then @@ -30010,7 +17734,8 @@ fi apu_db_version=2 fi - if test "$apu_db_version" != "2"; then + fi + if test "$apu_have_db" = "0"; then places="$all_places" if test -z "$places"; then @@ -30407,7 +18132,8 @@ fi apu_db_version=1 fi - if test "$apu_db_version" != "1"; then + fi + if test "$apu_have_db" = "0"; then places="$all_places" if test -z "$places"; then @@ -30804,19 +18530,6 @@ fi apu_db_version=185 fi - fi - fi - fi - fi - fi - fi - fi - fi - fi - fi - fi - fi - fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB" >&5 $as_echo_n "checking for Berkeley DB... " >&6; } @@ -30844,89 +18557,25 @@ fi fi case "$requested" in - sdbm) - apu_use_sdbm=1 - apu_default_dbm=sdbm - ;; - gdbm) - apu_use_gdbm=1 - apu_default_dbm=gdbm - ;; - ndbm) - apu_use_ndbm=1 - apu_default_dbm=ndbm + sdbm | gdbm | ndbm | db) + eval "apu_use_$requested=1" + apu_default_dbm=$requested ;; - db) + db185 | db[12345]) apu_use_db=1 - apu_default_dbm=db + apu_default_dbm=$requested ;; - db1) + db[45][0-9]) apu_use_db=1 - apu_default_dbm=db1 - ;; - db185) - apu_use_db=1 - apu_default_dbm=db185 - ;; - db2) - apu_use_db=1 - apu_default_dbm=db2 - ;; - db3) - apu_use_db=1 - apu_default_dbm=db3 - ;; - db4) - apu_use_db=1 - apu_default_dbm=db4 - ;; - db41) - apu_use_db=1 - apu_default_dbm=db4 - ;; - db42) - apu_use_db=1 - apu_default_dbm=db4 - ;; - db43) - apu_use_db=1 - apu_default_dbm=db4 - ;; - db44) - apu_use_db=1 - apu_default_dbm=db4 - ;; - db45) - apu_use_db=1 - apu_default_dbm=db4 - ;; - db46) - apu_use_db=1 - apu_default_dbm=db4 - ;; - db47) - apu_use_db=1 - apu_default_dbm=db4 - ;; - db48) - apu_use_db=1 - apu_default_dbm=db4 - ;; - db50) - apu_use_db=1 - apu_default_dbm=db5 - ;; - db51) - apu_use_db=1 - apu_default_dbm=db5 + apu_default_dbm=`echo $requested | sed -e 's/.$//'` ;; default) apu_default_dbm="sdbm (default)" apu_use_sdbm=1 ;; *) - as_fn_error $? "--with-dbm=$look_for is an unknown DBM type. - Use one of: sdbm, gdbm, ndbm, db, db1, db185, db2, db3, db4, db41, db42, db43, db44, db45, db46, db47, db48, db50, db51" "$LINENO" 5 + as_fn_error $? "--with-dbm=$requested is an unknown DBM type. + Use one of: $dbm_list" "$LINENO" 5 ;; esac @@ -30948,18 +18597,98 @@ $as_echo "$apu_default_dbm" >&6; } if test "$apu_have_db" = "1"; then + + if test "x$LDADD_dbm_db" = "x"; then + test "x$silent" != "xyes" && echo " setting LDADD_dbm_db to \"-l$apu_db_lib\"" LDADD_dbm_db="-l$apu_db_lib" + else + apr_addto_bugger="-l$apu_db_lib" + for i in $apr_addto_bugger; do + apr_addto_duplicate="0" + for j in $LDADD_dbm_db; do + if test "x$i" = "x$j"; then + apr_addto_duplicate="1" + break + fi + done + if test $apr_addto_duplicate = "0"; then + test "x$silent" != "xyes" && echo " adding \"$i\" to LDADD_dbm_db" + LDADD_dbm_db="$LDADD_dbm_db $i" + fi + done + fi + if test -n "apu_db_xtra_libs"; then - LDADD_dbm_db="$LDADD_dbm_db $apu_db_xtra_libs" + + if test "x$LDADD_dbm_db" = "x"; then + test "x$silent" != "xyes" && echo " setting LDADD_dbm_db to \"$apu_db_xtra_libs\"" + LDADD_dbm_db="$apu_db_xtra_libs" + else + apr_addto_bugger="$apu_db_xtra_libs" + for i in $apr_addto_bugger; do + apr_addto_duplicate="0" + for j in $LDADD_dbm_db; do + if test "x$i" = "x$j"; then + apr_addto_duplicate="1" + break + fi + done + if test $apr_addto_duplicate = "0"; then + test "x$silent" != "xyes" && echo " adding \"$i\" to LDADD_dbm_db" + LDADD_dbm_db="$LDADD_dbm_db $i" + fi + done + fi + fi fi if test "$apu_have_gdbm" = "1"; then + + if test "x$LDADD_dbm_gdbm" = "x"; then + test "x$silent" != "xyes" && echo " setting LDADD_dbm_gdbm to \"-lgdbm\"" LDADD_dbm_gdbm="-lgdbm" + else + apr_addto_bugger="-lgdbm" + for i in $apr_addto_bugger; do + apr_addto_duplicate="0" + for j in $LDADD_dbm_gdbm; do + if test "x$i" = "x$j"; then + apr_addto_duplicate="1" + break + fi + done + if test $apr_addto_duplicate = "0"; then + test "x$silent" != "xyes" && echo " adding \"$i\" to LDADD_dbm_gdbm" + LDADD_dbm_gdbm="$LDADD_dbm_gdbm $i" + fi + done + fi + fi if test "$apu_have_ndbm" = "1"; then + + if test "x$LDADD_dbm_ndbm" = "x"; then + test "x$silent" != "xyes" && echo " setting LDADD_dbm_ndbm to \"-l$apu_ndbm_lib\"" LDADD_dbm_ndbm="-l$apu_ndbm_lib" + else + apr_addto_bugger="-l$apu_ndbm_lib" + for i in $apr_addto_bugger; do + apr_addto_duplicate="0" + for j in $LDADD_dbm_ndbm; do + if test "x$i" = "x$j"; then + apr_addto_duplicate="1" + break + fi + done + if test $apr_addto_duplicate = "0"; then + test "x$silent" != "xyes" && echo " adding \"$i\" to LDADD_dbm_ndbm" + LDADD_dbm_ndbm="$LDADD_dbm_ndbm $i" + fi + done + fi + fi @@ -30996,7 +18725,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PGSQL_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -31354,7 +19083,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PGSQL_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -31718,7 +19447,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PGSQL_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -32060,7 +19789,27 @@ fi if test "$apu_have_pgsql" = "1"; then + + if test "x$LDADD_dbd_pgsql" = "x"; then + test "x$silent" != "xyes" && echo " setting LDADD_dbd_pgsql to \"$pgsql_LDFLAGS -lpq $pgsql_LIBS\"" LDADD_dbd_pgsql="$pgsql_LDFLAGS -lpq $pgsql_LIBS" + else + apr_addto_bugger="$pgsql_LDFLAGS -lpq $pgsql_LIBS" + for i in $apr_addto_bugger; do + apr_addto_duplicate="0" + for j in $LDADD_dbd_pgsql; do + if test "x$i" = "x$j"; then + apr_addto_duplicate="1" + break + fi + done + if test $apr_addto_duplicate = "0"; then + test "x$silent" != "xyes" && echo " adding \"$i\" to LDADD_dbd_pgsql" + LDADD_dbd_pgsql="$LDADD_dbd_pgsql $i" + fi + done + fi + fi @@ -32098,7 +19847,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_MYSQL_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -32325,7 +20074,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_MYSQL_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -32566,7 +20315,27 @@ fi if test "$apu_have_mysql" = "1"; then + + if test "x$LDADD_dbd_mysql" = "x"; then + test "x$silent" != "xyes" && echo " setting LDADD_dbd_mysql to \"$mysql_LDFLAGS -lmysqlclient_r $mysql_LIBS\"" LDADD_dbd_mysql="$mysql_LDFLAGS -lmysqlclient_r $mysql_LIBS" + else + apr_addto_bugger="$mysql_LDFLAGS -lmysqlclient_r $mysql_LIBS" + for i in $apr_addto_bugger; do + apr_addto_duplicate="0" + for j in $LDADD_dbd_mysql; do + if test "x$i" = "x$j"; then + apr_addto_duplicate="1" + break + fi + done + if test $apr_addto_duplicate = "0"; then + test "x$silent" != "xyes" && echo " adding \"$i\" to LDADD_dbd_mysql" + LDADD_dbd_mysql="$LDADD_dbd_mysql $i" + fi + done + fi + fi @@ -32824,7 +20593,27 @@ fi if test "$apu_have_sqlite3" = "1"; then + + if test "x$LDADD_dbd_sqlite3" = "x"; then + test "x$silent" != "xyes" && echo " setting LDADD_dbd_sqlite3 to \"$sqlite3_LDFLAGS -lsqlite3\"" LDADD_dbd_sqlite3="$sqlite3_LDFLAGS -lsqlite3" + else + apr_addto_bugger="$sqlite3_LDFLAGS -lsqlite3" + for i in $apr_addto_bugger; do + apr_addto_duplicate="0" + for j in $LDADD_dbd_sqlite3; do + if test "x$i" = "x$j"; then + apr_addto_duplicate="1" + break + fi + done + if test $apr_addto_duplicate = "0"; then + test "x$silent" != "xyes" && echo " adding \"$i\" to LDADD_dbd_sqlite3" + LDADD_dbd_sqlite3="$LDADD_dbd_sqlite3 $i" + fi + done + fi + fi @@ -33082,7 +20871,27 @@ fi if test "$apu_have_sqlite2" = "1"; then + + if test "x$LDADD_dbd_sqlite2" = "x"; then + test "x$silent" != "xyes" && echo " setting LDADD_dbd_sqlite2 to \"$sqlite2_LDFLAGS -lsqlite\"" LDADD_dbd_sqlite2="$sqlite2_LDFLAGS -lsqlite" + else + apr_addto_bugger="$sqlite2_LDFLAGS -lsqlite" + for i in $apr_addto_bugger; do + apr_addto_duplicate="0" + for j in $LDADD_dbd_sqlite2; do + if test "x$i" = "x$j"; then + apr_addto_duplicate="1" + break + fi + done + if test $apr_addto_duplicate = "0"; then + test "x$silent" != "xyes" && echo " adding \"$i\" to LDADD_dbd_sqlite2" + LDADD_dbd_sqlite2="$LDADD_dbd_sqlite2 $i" + fi + done + fi + fi @@ -33692,7 +21501,27 @@ fi if test "$apu_have_oracle" = "1"; then + + if test "x$LDADD_dbd_oracle" = "x"; then + test "x$silent" != "xyes" && echo " setting LDADD_dbd_oracle to \"$oracle_LDFLAGS -lclntsh $oracle_LIBS\"" LDADD_dbd_oracle="$oracle_LDFLAGS -lclntsh $oracle_LIBS" + else + apr_addto_bugger="$oracle_LDFLAGS -lclntsh $oracle_LIBS" + for i in $apr_addto_bugger; do + apr_addto_duplicate="0" + for j in $LDADD_dbd_oracle; do + if test "x$i" = "x$j"; then + apr_addto_duplicate="1" + break + fi + done + if test $apr_addto_duplicate = "0"; then + test "x$silent" != "xyes" && echo " adding \"$i\" to LDADD_dbd_oracle" + LDADD_dbd_oracle="$LDADD_dbd_oracle $i" + fi + done + fi + fi @@ -34109,7 +21938,27 @@ fi if test "$apu_have_freetds" = "1"; then + + if test "x$LDADD_dbd_freetds" = "x"; then + test "x$silent" != "xyes" && echo " setting LDADD_dbd_freetds to \"$sybdb_LDFLAGS -lsybdb\"" LDADD_dbd_freetds="$sybdb_LDFLAGS -lsybdb" + else + apr_addto_bugger="$sybdb_LDFLAGS -lsybdb" + for i in $apr_addto_bugger; do + apr_addto_duplicate="0" + for j in $LDADD_dbd_freetds; do + if test "x$i" = "x$j"; then + apr_addto_duplicate="1" + break + fi + done + if test $apr_addto_duplicate = "0"; then + test "x$silent" != "xyes" && echo " adding \"$i\" to LDADD_dbd_freetds" + LDADD_dbd_freetds="$LDADD_dbd_freetds $i" + fi + done + fi + fi @@ -34147,7 +21996,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ODBC_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -34387,7 +22236,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ODBC_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -34639,7 +22488,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ODBC_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -34863,7 +22712,27 @@ fi if test "$apu_have_odbc" = "1"; then + + if test "x$LDADD_dbd_odbc" = "x"; then + test "x$silent" != "xyes" && echo " setting LDADD_dbd_odbc to \"$odbc_LDFLAGS -lodbc $odbc_LIBS\"" LDADD_dbd_odbc="$odbc_LDFLAGS -lodbc $odbc_LIBS" + else + apr_addto_bugger="$odbc_LDFLAGS -lodbc $odbc_LIBS" + for i in $apr_addto_bugger; do + apr_addto_duplicate="0" + for j in $LDADD_dbd_odbc; do + if test "x$i" = "x$j"; then + apr_addto_duplicate="1" + break + fi + done + if test $apr_addto_duplicate = "0"; then + test "x$silent" != "xyes" && echo " adding \"$i\" to LDADD_dbd_odbc" + LDADD_dbd_odbc="$LDADD_dbd_odbc $i" + fi + done + fi + fi @@ -35982,11 +23851,12 @@ if test "x$apu_iconv_inbuf_const" = "x"; then #include <stddef.h> #include <iconv.h> - int main(int argc, const char *const *argv) { + int main(int argc, const char *const *argv) { iconv(0,(char **)0,(size_t *)0,(char **)0,(size_t *)0); - return 0; } + return 0; } + _ACEOF if ac_fn_c_try_compile "$LINENO"; then : apu_iconv_inbuf_const="0" @@ -36427,7 +24297,16 @@ _ACEOF if test ! -d ./build; then $mkdir_p build fi -cp $APR_BUILD_DIR/apr_rules.mk $abs_builddir/build/rules.mk +case $host in + *-mingw*) + sed -e 's/-DAPR_DECLARE_EXPORT/-DAPU_DECLARE_EXPORT/' \ + -e 's/-DAPR_DECLARE_STATIC/-DAPU_DECLARE_STATIC -DAPR_DECLARE_STATIC/' \ + < $APR_BUILD_DIR/apr_rules.mk > $abs_builddir/build/rules.mk + ;; + *) + cp $APR_BUILD_DIR/apr_rules.mk $abs_builddir/build/rules.mk + ;; +esac case "$host_alias" in *bsdi* | BSD/OS) @@ -36870,16 +24749,16 @@ if (echo >conf$$.file) 2>/dev/null; then # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -36939,28 +24818,16 @@ else as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -36982,7 +24849,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # values after options handling. ac_log=" This file was extended by $as_me, which was -generated by GNU Autoconf 2.68. Invocation command line was +generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -37048,10 +24915,10 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.68, +configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -37140,7 +25007,7 @@ fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then - set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' diff --git a/contrib/apr-util/configure.in b/contrib/apr-util/configure.in index 3aff5132d1bc..30028102e460 100644 --- a/contrib/apr-util/configure.in +++ b/contrib/apr-util/configure.in @@ -42,13 +42,20 @@ AC_CANONICAL_SYSTEM AC_PROG_INSTALL -# Use -no-install to link the test programs on all platforms -# but Darwin, where it would cause the programs to be linked -# against installed versions of libapr instead of those just -# built. +# Use -no-install or -no-fast-install to link the test +# programs on all platforms but Darwin, where it would cause +# the programs to be linked against installed versions of +# libapr instead of those just built. case $host in -*-apple-darwin*) LT_NO_INSTALL="" ;; -*) LT_NO_INSTALL="-no-install" ;; + *-apple-darwin*) + LT_NO_INSTALL="" + ;; + *-mingw*) + LT_NO_INSTALL="-no-fast-install" + ;; + *) + LT_NO_INSTALL="-no-install" + ;; esac AC_SUBST(LT_NO_INSTALL) @@ -151,8 +158,6 @@ dnl Determine what DBM backend type to use. dnl Find Expat dnl Find an iconv library APU_CHECK_CRYPTO -APU_CHECK_CRYPTO_OPENSSL -APU_CHECK_CRYPTO_NSS APU_FIND_LDAP APU_CHECK_DBM APU_CHECK_DBD @@ -224,7 +229,22 @@ dnl copy apr's rules.mk into our build directory. if test ! -d ./build; then $mkdir_p build fi -cp $APR_BUILD_DIR/apr_rules.mk $abs_builddir/build/rules.mk +dnl +dnl MinGW: If APR is shared, APR_DECLARE_EXPORT will be defined in the +dnl internal CPPFLAGS, but APR-Util needs APU_DECLARE_EXPORT instead. +dnl If APR is static, APR_DECLARE_STATIC will be defined in the +dnl internal CPPFLAGS, but APR-Util needs APU_DECLARE_STATIC too. +dnl +case $host in + *-mingw*) + sed -e 's/-DAPR_DECLARE_EXPORT/-DAPU_DECLARE_EXPORT/' \ + -e 's/-DAPR_DECLARE_STATIC/-DAPU_DECLARE_STATIC -DAPR_DECLARE_STATIC/' \ + < $APR_BUILD_DIR/apr_rules.mk > $abs_builddir/build/rules.mk + ;; + *) + cp $APR_BUILD_DIR/apr_rules.mk $abs_builddir/build/rules.mk + ;; +esac dnl dnl BSD/OS (BSDi) needs to use a different include syntax in the Makefiles diff --git a/contrib/apr-util/crypto/apr_crypto.c b/contrib/apr-util/crypto/apr_crypto.c index 4a1049c4ac91..7643b94e1596 100644 --- a/contrib/apr-util/crypto/apr_crypto.c +++ b/contrib/apr-util/crypto/apr_crypto.c @@ -68,13 +68,14 @@ typedef struct apr_crypto_clear_t { } apr_crypto_clear_t; #if !APU_DSO_BUILD -#define DRIVER_LOAD(name,driver,pool,params) \ +#define DRIVER_LOAD(name,driver_name,pool,params,rv,result) \ { \ - extern const apr_crypto_driver_t driver; \ - apr_hash_set(drivers,name,APR_HASH_KEY_STRING,&driver); \ - if (driver.init) { \ - driver.init(pool, params); \ + extern const apr_crypto_driver_t driver_name; \ + apr_hash_set(drivers,name,APR_HASH_KEY_STRING,&driver_name); \ + if (driver_name.init) { \ + rv = driver_name.init(pool, params, result); \ } \ + *driver = &driver_name; \ } #endif @@ -107,22 +108,6 @@ APU_DECLARE(apr_status_t) apr_crypto_init(apr_pool_t *pool) #endif drivers = apr_hash_make(pool); -#if !APU_DSO_BUILD - /* Load statically-linked drivers: */ -#if APU_HAVE_OPENSSL - DRIVER_LOAD("openssl", apr_crypto_openssl_driver, pool, params); -#endif -#if APU_HAVE_NSS - DRIVER_LOAD("nss", apr_crypto_nss_driver, pool, params); -#endif -#if APU_HAVE_MSCAPI - DRIVER_LOAD("mscapi", apr_crypto_mscapi_driver, pool, params); -#endif -#if APU_HAVE_MSCNG - DRIVER_LOAD("mscng", apr_crypto_mscng_driver, pool, params); -#endif -#endif /* APU_DSO_BUILD */ - apr_pool_cleanup_register(pool, NULL, apr_crypto_term, apr_pool_cleanup_null); @@ -165,7 +150,10 @@ APU_DECLARE(apr_status_t) apr_crypto_get_driver( apr_dso_handle_sym_t symbol; #endif apr_status_t rv; - int rc = 0; + + if (result) { + *result = NULL; /* until further notice */ + } #if APU_DSO_BUILD rv = apu_dso_mutex_lock(); @@ -197,37 +185,53 @@ APU_DECLARE(apr_status_t) apr_crypto_get_driver( #endif apr_snprintf(symname, sizeof(symname), "apr_crypto_%s_driver", name); rv = apu_dso_load(&dso, &symbol, modname, symname, pool); - if (rv != APR_SUCCESS) { /* APR_EDSOOPEN or APR_ESYMNOTFOUND? */ - if (rv == APR_EINIT) { /* previously loaded?!? */ - name = apr_pstrdup(pool, name); - apr_hash_set(drivers, name, APR_HASH_KEY_STRING, *driver); - rv = APR_SUCCESS; + if (rv == APR_SUCCESS || rv == APR_EINIT) { /* previously loaded?!? */ + *driver = symbol; + name = apr_pstrdup(pool, name); + apr_hash_set(drivers, name, APR_HASH_KEY_STRING, *driver); + rv = APR_SUCCESS; + if ((*driver)->init) { + rv = (*driver)->init(pool, params, result); } - goto unlock; - } - *driver = symbol; - if ((*driver)->init) { - rv = (*driver)->init(pool, params, &rc); } - name = apr_pstrdup(pool, name); - apr_hash_set(drivers, name, APR_HASH_KEY_STRING, *driver); - - unlock: apu_dso_mutex_unlock(); + apu_dso_mutex_unlock(); - if (APR_SUCCESS != rv && result) { + if (APR_SUCCESS != rv && result && !*result) { char *buffer = apr_pcalloc(pool, ERROR_SIZE); apu_err_t *err = apr_pcalloc(pool, sizeof(apu_err_t)); if (err && buffer) { apr_dso_error(dso, buffer, ERROR_SIZE - 1); err->msg = buffer; err->reason = modname; - err->rc = rc; *result = err; } } #else /* not builtin and !APR_HAS_DSO => not implemented */ rv = APR_ENOTIMPL; + + /* Load statically-linked drivers: */ +#if APU_HAVE_OPENSSL + if (name[0] == 'o' && !strcmp(name, "openssl")) { + DRIVER_LOAD("openssl", apr_crypto_openssl_driver, pool, params, rv, result); + } +#endif +#if APU_HAVE_NSS + if (name[0] == 'n' && !strcmp(name, "nss")) { + DRIVER_LOAD("nss", apr_crypto_nss_driver, pool, params, rv, result); + } +#endif +#if APU_HAVE_MSCAPI + if (name[0] == 'm' && !strcmp(name, "mscapi")) { + DRIVER_LOAD("mscapi", apr_crypto_mscapi_driver, pool, params, rv, result); + } +#endif +#if APU_HAVE_MSCNG + if (name[0] == 'm' && !strcmp(name, "mscng")) { + DRIVER_LOAD("mscng", apr_crypto_mscng_driver, pool, params, rv, result); + } +#endif + #endif return rv; diff --git a/contrib/apr-util/crypto/apr_crypto_nss.c b/contrib/apr-util/crypto/apr_crypto_nss.c index 0d1d2ca64fde..b345953de73d 100644 --- a/contrib/apr-util/crypto/apr_crypto_nss.c +++ b/contrib/apr-util/crypto/apr_crypto_nss.c @@ -57,7 +57,7 @@ struct apr_crypto_t { }; struct apr_crypto_config_t { - void *opaque; + void *opaque; }; struct apr_crypto_key_t { @@ -121,7 +121,8 @@ static apr_status_t crypto_shutdown_helper(void *data) /** * Initialise the crypto library and perform one time initialisation. */ -static apr_status_t crypto_init(apr_pool_t *pool, const char *params, int *rc) +static apr_status_t crypto_init(apr_pool_t *pool, const char *params, + const apu_err_t **result) { SECStatus s; const char *dir = NULL; @@ -209,8 +210,12 @@ static apr_status_t crypto_init(apr_pool_t *pool, const char *params, int *rc) s = NSS_NoDB_Init(NULL); } if (s != SECSuccess) { - if (rc) { - *rc = PR_GetError(); + if (result) { + apu_err_t *err = apr_pcalloc(pool, sizeof(apu_err_t)); + err->rc = PR_GetError(); + err->msg = PR_ErrorToName(s); + err->reason = "Error during 'nss' initialisation"; + *result = err; } return APR_ECRYPT; } diff --git a/contrib/apr-util/crypto/apr_crypto_nss.dsp b/contrib/apr-util/crypto/apr_crypto_nss.dsp deleted file mode 100644 index 663b240c47b5..000000000000 --- a/contrib/apr-util/crypto/apr_crypto_nss.dsp +++ /dev/null @@ -1,203 +0,0 @@ -# Microsoft Developer Studio Project File - Name="apr_crypto_nss" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=apr_crypto_nss - Win32 Release -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "apr_crypto_nss.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "apr_crypto_nss.mak" CFG="apr_crypto_nss - Win32 Release" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "apr_crypto_nss - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "apr_crypto_nss - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "apr_crypto_nss - x64 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "apr_crypto_nss - x64 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "apr_crypto_nss - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_NSS=1 /D HAVE_NSS_H=1 /D HAVE_PK11PUB_H=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_crypto_nss_src" /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /fo"Release/apr_crypto_nss-1.res" /d DLL_NAME="apr_crypto_nss" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib nss3.lib nspr4.lib /nologo /base:"0x6F110000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib nss3.lib nspr4.lib nspr4.lib /nologo /base:"0x6F110000" /subsystem:windows /dll /incremental:no /debug /out:"Release\apr_crypto_nss-1.dll" /pdb:"Release\apr_crypto_nss-1.pdb" /implib:"Release\apr_crypto_nss-1.lib" /MACHINE:X86 /opt:ref -# Begin Special Build Tool -TargetPath=Release\apr_crypto_nss-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ELSEIF "$(CFG)" == "apr_crypto_nss - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_NSS=1 /D HAVE_NSS_H=1 /D HAVE_PK11PUB_H=1 /D /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_crypto_nss_src" /FD /EHsc /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /fo"Debug/apr_crypto_nss-1.res" /d DLL_NAME="apr_crypto_nss" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib nss3.lib nspr4.lib /nologo /base:"0x6F110000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib nss3.lib nspr4.lib /nologo /base:"0x6F110000" /subsystem:windows /dll /incremental:no /debug /out:"Debug\apr_crypto_nss-1.dll" /pdb:"Debug\apr_crypto_nss-1.pdb" /implib:"Debug\apr_crypto_nss-1.lib" /MACHINE:X86 -# Begin Special Build Tool -TargetPath=Debug\apr_crypto_nss-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ELSEIF "$(CFG)" == "apr_crypto_nss - x64 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "x64\Release" -# PROP BASE Intermediate_Dir "x64\Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "x64\Release" -# PROP Intermediate_Dir "x64\Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_NSS=1 /D HAVE_NSS_H=1 /D HAVE_PK11PUB_H=1 /D /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_crypto_nss_src" /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /fo"x64/Release/apr_crypto_nss-1.res" /d DLL_NAME="apr_crypto_nss" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib nss3.lib nspr4.lib /nologo /base:"0x6F110000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib nss3.lib nspr4.lib /nologo /base:"0x6F110000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Release\apr_crypto_nss-1.dll" /pdb:"x64\Release\apr_crypto_nss-1.pdb" /implib:"x64\Release\apr_crypto_nss-1.lib" /MACHINE:X64 /opt:ref -# Begin Special Build Tool -TargetPath=x64\Release\apr_crypto_nss-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ELSEIF "$(CFG)" == "apr_crypto_nss - x64 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "x64\Debug" -# PROP BASE Intermediate_Dir "x64\Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "x64\Debug" -# PROP Intermediate_Dir "x64\Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_NSS=1 /D HAVE_NSS_H=1 /D HAVE_PK11PUB_H=1 /D /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_crypto_nss_src" /FD /EHsc /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /fo"x64/Debug/apr_crypto_nss-1.res" /d DLL_NAME="apr_crypto_nss" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib nss3.lib nspr4.lib /nologo /base:"0x6F110000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib nss3.lib nspr4.lib /nologo /base:"0x6F110000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Debug\apr_crypto_nss-1.dll" /pdb:"x64\Debug\apr_crypto_nss-1.pdb" /implib:"x64\Debug\apr_crypto_nss-1.lib" /MACHINE:X64 -# Begin Special Build Tool -TargetPath=x64\Debug\apr_crypto_nss-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ENDIF - -# Begin Target - -# Name "apr_crypto_nss - Win32 Release" -# Name "apr_crypto_nss - Win32 Debug" -# Name "apr_crypto_nss - x64 Release" -# Name "apr_crypto_nss - x64 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\apr_crypto_nss.c -# End Source File -# End Group -# Begin Group "Public Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\include\apr_crypto.h -# End Source File -# End Group -# Begin Group "Internal Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\include\private\apu_config.h -# End Source File -# Begin Source File - -SOURCE=..\include\private\apu_internal.h -# End Source File -# End Group -# Begin Source File - -SOURCE=..\libaprutil.rc -# End Source File -# End Target -# End Project diff --git a/contrib/apr-util/crypto/apr_crypto_openssl.c b/contrib/apr-util/crypto/apr_crypto_openssl.c index 97e6008e6a1f..0740f93f6349 100644 --- a/contrib/apr-util/crypto/apr_crypto_openssl.c +++ b/contrib/apr-util/crypto/apr_crypto_openssl.c @@ -108,7 +108,8 @@ static apr_status_t crypto_shutdown_helper(void *data) /** * Initialise the crypto library and perform one time initialisation. */ -static apr_status_t crypto_init(apr_pool_t *pool, const char *params, int *rc) +static apr_status_t crypto_init(apr_pool_t *pool, const char *params, + const apu_err_t **result) { CRYPTO_malloc_init(); ERR_load_crypto_strings(); diff --git a/contrib/apr-util/crypto/apr_crypto_openssl.dsp b/contrib/apr-util/crypto/apr_crypto_openssl.dsp deleted file mode 100644 index 90114ce4352b..000000000000 --- a/contrib/apr-util/crypto/apr_crypto_openssl.dsp +++ /dev/null @@ -1,203 +0,0 @@ -# Microsoft Developer Studio Project File - Name="apr_crypto_openssl" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=apr_crypto_openssl - Win32 Release -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "apr_crypto_openssl.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "apr_crypto_openssl.mak" CFG="apr_crypto_openssl - Win32 Release" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "apr_crypto_openssl - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "apr_crypto_openssl - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "apr_crypto_openssl - x64 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "apr_crypto_openssl - x64 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "apr_crypto_openssl - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_OPENSSL=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_crypto_openssl_src" /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /fo"Release/apr_crypto_openssl-1.res" /d DLL_NAME="apr_crypto_openssl" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libeay32.lib ssleay32.lib /nologo /base:"0x6F100000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libeay32.lib ssleay32.lib /nologo /base:"0x6F100000" /subsystem:windows /dll /incremental:no /debug /out:"Release\apr_crypto_openssl-1.dll" /pdb:"Release\apr_crypto_openssl-1.pdb" /implib:"Release\apr_crypto_openssl-1.lib" /MACHINE:X86 /opt:ref -# Begin Special Build Tool -TargetPath=Release\apr_crypto_openssl-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ELSEIF "$(CFG)" == "apr_crypto_openssl - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_OPENSSL=1 /D /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_crypto_openssl_src" /FD /EHsc /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /fo"Debug/apr_crypto_openssl-1.res" /d DLL_NAME="apr_crypto_openssl" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libeay32.lib ssleay32.lib /nologo /base:"0x6F100000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libeay32.lib ssleay32.lib /nologo /base:"0x6F100000" /subsystem:windows /dll /incremental:no /debug /out:"Debug\apr_crypto_openssl-1.dll" /pdb:"Debug\apr_crypto_openssl-1.pdb" /implib:"Debug\apr_crypto_openssl-1.lib" /MACHINE:X86 -# Begin Special Build Tool -TargetPath=Debug\apr_crypto_openssl-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ELSEIF "$(CFG)" == "apr_crypto_openssl - x64 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "x64\Release" -# PROP BASE Intermediate_Dir "x64\Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "x64\Release" -# PROP Intermediate_Dir "x64\Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_OPENSSL=1 /D /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_crypto_openssl_src" /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /fo"x64/Release/apr_crypto_openssl-1.res" /d DLL_NAME="apr_crypto_openssl" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libeay32.lib ssleay32.lib /nologo /base:"0x6F100000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libeay32.lib ssleay32.lib /nologo /base:"0x6F100000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Release\apr_crypto_openssl-1.dll" /pdb:"x64\Release\apr_crypto_openssl-1.pdb" /implib:"x64\Release\apr_crypto_openssl-1.lib" /MACHINE:X64 /opt:ref -# Begin Special Build Tool -TargetPath=x64\Release\apr_crypto_openssl-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ELSEIF "$(CFG)" == "apr_crypto_openssl - x64 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "x64\Debug" -# PROP BASE Intermediate_Dir "x64\Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "x64\Debug" -# PROP Intermediate_Dir "x64\Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_OPENSSL=1 /D /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_crypto_openssl_src" /FD /EHsc /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /fo"x64/Debug/apr_crypto_openssl-1.res" /d DLL_NAME="apr_crypto_openssl" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libeay32.lib ssleay32.lib /nologo /base:"0x6F100000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libeay32.lib ssleay32.lib /nologo /base:"0x6F100000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Debug\apr_crypto_openssl-1.dll" /pdb:"x64\Debug\apr_crypto_openssl-1.pdb" /implib:"x64\Debug\apr_crypto_openssl-1.lib" /MACHINE:X64 -# Begin Special Build Tool -TargetPath=x64\Debug\apr_crypto_openssl-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ENDIF - -# Begin Target - -# Name "apr_crypto_openssl - Win32 Release" -# Name "apr_crypto_openssl - Win32 Debug" -# Name "apr_crypto_openssl - x64 Release" -# Name "apr_crypto_openssl - x64 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\apr_crypto_openssl.c -# End Source File -# End Group -# Begin Group "Public Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\include\apr_crypto.h -# End Source File -# End Group -# Begin Group "Internal Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\include\private\apu_config.h -# End Source File -# Begin Source File - -SOURCE=..\include\private\apu_internal.h -# End Source File -# End Group -# Begin Source File - -SOURCE=..\libaprutil.rc -# End Source File -# End Target -# End Project diff --git a/contrib/apr-util/crypto/apr_md5.c b/contrib/apr-util/crypto/apr_md5.c index 691cc8787c62..40fa7b27a4ff 100644 --- a/contrib/apr-util/crypto/apr_md5.c +++ b/contrib/apr-util/crypto/apr_md5.c @@ -61,20 +61,10 @@ #include "apr_md5.h" #include "apr_lib.h" #include "apu_config.h" -#include "apr_sha1.h" #if APR_HAVE_STRING_H #include <string.h> #endif -#if APR_HAVE_CRYPT_H -#include <crypt.h> -#endif -#if APR_HAVE_UNISTD_H -#include <unistd.h> -#endif -#if APR_HAVE_PTHREAD_H -#include <pthread.h> -#endif /* Constants for MD5Transform routine. */ @@ -348,9 +338,18 @@ APU_DECLARE(apr_status_t) apr_md5(unsigned char digest[APR_MD5_DIGESTSIZE], static void MD5Transform(apr_uint32_t state[4], const unsigned char block[64]) { apr_uint32_t a = state[0], b = state[1], c = state[2], d = state[3], - x[APR_MD5_DIGESTSIZE]; + tmpbuf[APR_MD5_DIGESTSIZE]; + const apr_uint32_t *x; - Decode(x, block, 64); +#if !APR_IS_BIGENDIAN + if ((apr_uintptr_t)block % sizeof(apr_uint32_t) == 0) { + x = (apr_uint32_t *)block; + } else +#endif + { + Decode(tmpbuf, block, 64); + x = tmpbuf; + } /* Round 1 */ FF(a, b, c, d, x[0], S11, 0xd76aa478); /* 1 */ @@ -429,8 +428,13 @@ static void MD5Transform(apr_uint32_t state[4], const unsigned char block[64]) state[2] += c; state[3] += d; - /* Zeroize sensitive information. */ - memset(x, 0, sizeof(x)); +#if !APR_IS_BIGENDIAN + if (x == tmpbuf) +#endif + { + /* Zeroize sensitive information. */ + memset(tmpbuf, 0, sizeof(tmpbuf)); + } } /* Encodes input (apr_uint32_t) into output (unsigned char). Assumes len is @@ -478,7 +482,7 @@ APU_DECLARE(apr_status_t) apr_MD5InitEBCDIC(apr_xlate_t *xlate) * Define the Magic String prefix that identifies a password as being * hashed using our algorithm. */ -static const char *apr1_id = "$apr1$"; +static const char * const apr1_id = "$apr1$"; /* * The following MD5 password encryption code was largely borrowed from @@ -660,97 +664,3 @@ APU_DECLARE(apr_status_t) apr_md5_encode(const char *pw, const char *salt, apr_cpystrn(result, passwd, nbytes - 1); return APR_SUCCESS; } - -#if !defined(WIN32) && !defined(BEOS) && !defined(NETWARE) -#if defined(APU_CRYPT_THREADSAFE) || !APR_HAS_THREADS || \ - defined(CRYPT_R_CRYPTD) || defined(CRYPT_R_STRUCT_CRYPT_DATA) - -#define crypt_mutex_lock() -#define crypt_mutex_unlock() - -#elif APR_HAVE_PTHREAD_H && defined(PTHREAD_MUTEX_INITIALIZER) - -static pthread_mutex_t crypt_mutex = PTHREAD_MUTEX_INITIALIZER; -static void crypt_mutex_lock(void) -{ - pthread_mutex_lock(&crypt_mutex); -} - -static void crypt_mutex_unlock(void) -{ - pthread_mutex_unlock(&crypt_mutex); -} - -#else - -#error apr_password_validate() is not threadsafe. rebuild APR without thread support. - -#endif -#endif - -/* - * Validate a plaintext password against a smashed one. Uses either - * crypt() (if available) or apr_md5_encode() or apr_sha1_base64(), depending - * upon the format of the smashed input password. Returns APR_SUCCESS if - * they match, or APR_EMISMATCH if they don't. If the platform doesn't - * support crypt, then the default check is against a clear text string. - */ -APU_DECLARE(apr_status_t) apr_password_validate(const char *passwd, - const char *hash) -{ - char sample[120]; -#if !defined(WIN32) && !defined(BEOS) && !defined(NETWARE) - char *crypt_pw; -#endif - if (!strncmp(hash, apr1_id, strlen(apr1_id))) { - /* - * The hash was created using our custom algorithm. - */ - apr_md5_encode(passwd, hash, sample, sizeof(sample)); - } - else if (!strncmp(hash, APR_SHA1PW_ID, APR_SHA1PW_IDLEN)) { - apr_sha1_base64(passwd, (int)strlen(passwd), sample); - } - else { - /* - * It's not our algorithm, so feed it to crypt() if possible. - */ -#if defined(WIN32) || defined(BEOS) || defined(NETWARE) - apr_cpystrn(sample, passwd, sizeof(sample) - 1); -#elif defined(CRYPT_R_CRYPTD) - CRYPTD buffer; - - crypt_pw = crypt_r(passwd, hash, &buffer); - apr_cpystrn(sample, crypt_pw, sizeof(sample) - 1); -#elif defined(CRYPT_R_STRUCT_CRYPT_DATA) - struct crypt_data buffer; - - /* having to clear this seems bogus... GNU doc is - * confusing... user report found from google says - * the crypt_data struct had to be cleared to get - * the same result as plain crypt() - */ - memset(&buffer, 0, sizeof(buffer)); - crypt_pw = crypt_r(passwd, hash, &buffer); - apr_cpystrn(sample, crypt_pw, sizeof(sample) - 1); -#else - /* Do a bit of sanity checking since we know that crypt_r() - * should always be used for threaded builds on AIX, and - * problems in configure logic can result in the wrong - * choice being made. - */ -#if defined(_AIX) && APR_HAS_THREADS -#error Configuration error! crypt_r() should have been selected! -#endif - - /* Handle thread safety issues by holding a mutex around the - * call to crypt(). - */ - crypt_mutex_lock(); - crypt_pw = crypt(passwd, hash); - apr_cpystrn(sample, crypt_pw, sizeof(sample) - 1); - crypt_mutex_unlock(); -#endif - } - return (strcmp(sample, hash) == 0) ? APR_SUCCESS : APR_EMISMATCH; -} diff --git a/contrib/apr-util/crypto/apr_passwd.c b/contrib/apr-util/crypto/apr_passwd.c new file mode 100644 index 000000000000..1b4b47bdf314 --- /dev/null +++ b/contrib/apr-util/crypto/apr_passwd.c @@ -0,0 +1,194 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr_strings.h" +#include "apr_md5.h" +#include "apr_lib.h" +#include "apr_sha1.h" +#include "apu_config.h" +#include "crypt_blowfish.h" + +#if APR_HAVE_STRING_H +#include <string.h> +#endif +#if APR_HAVE_CRYPT_H +#include <crypt.h> +#endif +#if APR_HAVE_UNISTD_H +#include <unistd.h> +#endif +#if APR_HAVE_PTHREAD_H +#include <pthread.h> +#endif +#if APR_HAVE_STDLIB_H +#include <stdlib.h> +#endif + +static const char * const apr1_id = "$apr1$"; + +#if !defined(WIN32) && !defined(BEOS) && !defined(NETWARE) +#if defined(APU_CRYPT_THREADSAFE) || !APR_HAS_THREADS || \ + defined(CRYPT_R_CRYPTD) || defined(CRYPT_R_STRUCT_CRYPT_DATA) + +#define crypt_mutex_lock() +#define crypt_mutex_unlock() + +#elif APR_HAVE_PTHREAD_H && defined(PTHREAD_MUTEX_INITIALIZER) + +static pthread_mutex_t crypt_mutex = PTHREAD_MUTEX_INITIALIZER; +static void crypt_mutex_lock(void) +{ + pthread_mutex_lock(&crypt_mutex); +} + +static void crypt_mutex_unlock(void) +{ + pthread_mutex_unlock(&crypt_mutex); +} + +#else + +#error apr_password_validate() is not threadsafe. rebuild APR without thread support. + +#endif +#endif + +/* + * Validate a plaintext password against a smashed one. Uses either + * crypt() (if available) or apr_md5_encode() or apr_sha1_base64(), depending + * upon the format of the smashed input password. Returns APR_SUCCESS if + * they match, or APR_EMISMATCH if they don't. If the platform doesn't + * support crypt, then the default check is against a clear text string. + */ +APU_DECLARE(apr_status_t) apr_password_validate(const char *passwd, + const char *hash) +{ + char sample[200]; +#if !defined(WIN32) && !defined(BEOS) && !defined(NETWARE) + char *crypt_pw; +#endif + if (hash[0] == '$' + && hash[1] == '2' + && (hash[2] == 'a' || hash[2] == 'y') + && hash[3] == '$') { + if (_crypt_blowfish_rn(passwd, hash, sample, sizeof(sample)) == NULL) + return APR_FROM_OS_ERROR(errno); + } + else if (!strncmp(hash, apr1_id, strlen(apr1_id))) { + /* + * The hash was created using our custom algorithm. + */ + apr_md5_encode(passwd, hash, sample, sizeof(sample)); + } + else if (!strncmp(hash, APR_SHA1PW_ID, APR_SHA1PW_IDLEN)) { + apr_sha1_base64(passwd, (int)strlen(passwd), sample); + } + else { + /* + * It's not our algorithm, so feed it to crypt() if possible. + */ +#if defined(WIN32) || defined(BEOS) || defined(NETWARE) + return (strcmp(passwd, hash) == 0) ? APR_SUCCESS : APR_EMISMATCH; +#elif defined(CRYPT_R_CRYPTD) + apr_status_t rv; + CRYPTD *buffer = malloc(sizeof(*buffer)); + + if (buffer == NULL) + return APR_ENOMEM; + crypt_pw = crypt_r(passwd, hash, buffer); + if (!crypt_pw) + rv = APR_EMISMATCH; + else + rv = (strcmp(crypt_pw, hash) == 0) ? APR_SUCCESS : APR_EMISMATCH; + free(buffer); + return rv; +#elif defined(CRYPT_R_STRUCT_CRYPT_DATA) + apr_status_t rv; + struct crypt_data *buffer = malloc(sizeof(*buffer)); + + if (buffer == NULL) + return APR_ENOMEM; + +#ifdef __GLIBC_PREREQ + /* + * For not too old glibc (>= 2.3.2), it's enough to set + * buffer.initialized = 0. For < 2.3.2 and for other platforms, + * we need to zero the whole struct. + */ +#if __GLIBC_PREREQ(2,4) +#define USE_CRYPT_DATA_INITALIZED +#endif +#endif + +#ifdef USE_CRYPT_DATA_INITALIZED + buffer->initialized = 0; +#else + memset(buffer, 0, sizeof(*buffer)); +#endif + + crypt_pw = crypt_r(passwd, hash, buffer); + if (!crypt_pw) + rv = APR_EMISMATCH; + else + rv = (strcmp(crypt_pw, hash) == 0) ? APR_SUCCESS : APR_EMISMATCH; + free(buffer); + return rv; +#else + /* Do a bit of sanity checking since we know that crypt_r() + * should always be used for threaded builds on AIX, and + * problems in configure logic can result in the wrong + * choice being made. + */ +#if defined(_AIX) && APR_HAS_THREADS +#error Configuration error! crypt_r() should have been selected! +#endif + { + apr_status_t rv; + + /* Handle thread safety issues by holding a mutex around the + * call to crypt(). + */ + crypt_mutex_lock(); + crypt_pw = crypt(passwd, hash); + if (!crypt_pw) { + rv = APR_EMISMATCH; + } + else { + rv = (strcmp(crypt_pw, hash) == 0) ? APR_SUCCESS : APR_EMISMATCH; + } + crypt_mutex_unlock(); + return rv; + } +#endif + } + return (strcmp(sample, hash) == 0) ? APR_SUCCESS : APR_EMISMATCH; +} + +static const char * const bcrypt_id = "$2y$"; +APU_DECLARE(apr_status_t) apr_bcrypt_encode(const char *pw, + unsigned int count, + const unsigned char *salt, + apr_size_t salt_len, + char *out, apr_size_t out_len) +{ + char setting[40]; + if (_crypt_gensalt_blowfish_rn(bcrypt_id, count, (const char *)salt, + salt_len, setting, sizeof(setting)) == NULL) + return APR_FROM_OS_ERROR(errno); + if (_crypt_blowfish_rn(pw, setting, out, out_len) == NULL) + return APR_FROM_OS_ERROR(errno); + return APR_SUCCESS; +} diff --git a/contrib/apr-util/crypto/crypt_blowfish.c b/contrib/apr-util/crypto/crypt_blowfish.c new file mode 100644 index 000000000000..ec9a188b3a28 --- /dev/null +++ b/contrib/apr-util/crypto/crypt_blowfish.c @@ -0,0 +1,902 @@ +/* + * The crypt_blowfish homepage is: + * + * http://www.openwall.com/crypt/ + * + * This code comes from John the Ripper password cracker, with reentrant + * and crypt(3) interfaces added, but optimizations specific to password + * cracking removed. + * + * Written by Solar Designer <solar at openwall.com> in 1998-2011. + * No copyright is claimed, and the software is hereby placed in the public + * domain. In case this attempt to disclaim copyright and place the software + * in the public domain is deemed null and void, then the software is + * Copyright (c) 1998-2011 Solar Designer and it is hereby released to the + * general public under the following terms: + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted. + * + * There's ABSOLUTELY NO WARRANTY, express or implied. + * + * It is my intent that you should be able to use this on your system, + * as part of a software package, or anywhere else to improve security, + * ensure compatibility, or for any other purpose. I would appreciate + * it if you give credit where it is due and keep your modifications in + * the public domain as well, but I don't require that in order to let + * you place this code and any modifications you make under a license + * of your choice. + * + * This implementation is mostly compatible with OpenBSD's bcrypt.c (prefix + * "$2a$") by Niels Provos <provos at citi.umich.edu>, and uses some of his + * ideas. The password hashing algorithm was designed by David Mazieres + * <dm at lcs.mit.edu>. For more information on the level of compatibility, + * prefer refer to the comments in BF_set_key() below and to the included + * crypt(3) man page. + * + * There's a paper on the algorithm that explains its design decisions: + * + * http://www.usenix.org/events/usenix99/provos.html + * + * Some of the tricks in BF_ROUND might be inspired by Eric Young's + * Blowfish library (I can't be sure if I would think of something if I + * hadn't seen his code). + */ + +#include <string.h> + +#include <errno.h> +#ifndef __set_errno +#define __set_errno(val) errno = (val) +#endif + +/* Just to make sure the prototypes match the actual definitions */ +#include "crypt_blowfish.h" + +#ifdef __i386__ +#define BF_ASM 0 +#define BF_SCALE 1 +#elif defined(__x86_64__) || defined(__alpha__) || defined(__hppa__) +#define BF_ASM 0 +#define BF_SCALE 1 +#else +#define BF_ASM 0 +#define BF_SCALE 0 +#endif + +typedef unsigned int BF_word; +typedef signed int BF_word_signed; + +/* Number of Blowfish rounds, this is also hardcoded into a few places */ +#define BF_N 16 + +typedef BF_word BF_key[BF_N + 2]; + +typedef struct { + BF_word S[4][0x100]; + BF_key P; +} BF_ctx; + +/* + * Magic IV for 64 Blowfish encryptions that we do at the end. + * The string is "OrpheanBeholderScryDoubt" on big-endian. + */ +static BF_word BF_magic_w[6] = { + 0x4F727068, 0x65616E42, 0x65686F6C, + 0x64657253, 0x63727944, 0x6F756274 +}; + +/* + * P-box and S-box tables initialized with digits of Pi. + */ +static BF_ctx BF_init_state = { + { + { + 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, + 0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99, + 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16, + 0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e, + 0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee, + 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013, + 0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef, + 0x8e79dcb0, 0x603a180e, 0x6c9e0e8b, 0xb01e8a3e, + 0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60, + 0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440, + 0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce, + 0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a, + 0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e, + 0xafd6ba33, 0x6c24cf5c, 0x7a325381, 0x28958677, + 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193, + 0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032, + 0xef845d5d, 0xe98575b1, 0xdc262302, 0xeb651b88, + 0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239, + 0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e, + 0x21c66842, 0xf6e96c9a, 0x670c9c61, 0xabd388f0, + 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3, + 0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98, + 0xa1f1651d, 0x39af0176, 0x66ca593e, 0x82430e88, + 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe, + 0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6, + 0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d, + 0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b, + 0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7, + 0xe3fe501a, 0xb6794c3b, 0x976ce0bd, 0x04c006ba, + 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463, + 0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f, + 0x6dfc511f, 0x9b30952c, 0xcc814544, 0xaf5ebd09, + 0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3, + 0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb, + 0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279, + 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8, + 0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab, + 0x323db5fa, 0xfd238760, 0x53317b48, 0x3e00df82, + 0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db, + 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573, + 0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0, + 0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b, + 0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790, + 0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, 0xcee4c6e8, + 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4, + 0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0, + 0xd08ed1d0, 0xafc725e0, 0x8e3c5b2f, 0x8e7594b7, + 0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c, + 0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad, + 0x2f2f2218, 0xbe0e1777, 0xea752dfe, 0x8b021fa1, + 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299, + 0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9, + 0x165fa266, 0x80957705, 0x93cc7314, 0x211a1477, + 0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf, + 0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49, + 0x00250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af, + 0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa, + 0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5, + 0x83260376, 0x6295cfa9, 0x11c81968, 0x4e734a41, + 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915, + 0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400, + 0x08ba6fb5, 0x571be91f, 0xf296ec6b, 0x2a0dd915, + 0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664, + 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a + }, { + 0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623, + 0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266, + 0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1, + 0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e, + 0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6, + 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1, + 0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e, + 0x09686b3f, 0x3ebaefc9, 0x3c971814, 0x6b6a70a1, + 0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737, + 0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8, + 0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff, + 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd, + 0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701, + 0x3ae5e581, 0x37c2dadc, 0xc8b57634, 0x9af3dda7, + 0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41, + 0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331, + 0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf, + 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af, + 0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e, + 0x5512721f, 0x2e6b7124, 0x501adde6, 0x9f84cd87, + 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c, + 0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2, + 0xef1c1847, 0x3215d908, 0xdd433b37, 0x24c2ba16, + 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd, + 0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b, + 0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509, + 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e, + 0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3, + 0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f, + 0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a, + 0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4, + 0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960, + 0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66, + 0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28, + 0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802, + 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84, + 0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510, + 0x13cca830, 0xeb61bd96, 0x0334fe1e, 0xaa0363cf, + 0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14, + 0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e, + 0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50, + 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7, + 0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8, + 0xf837889a, 0x97e32d77, 0x11ed935f, 0x16681281, + 0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99, + 0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696, + 0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128, + 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73, + 0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0, + 0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, 0xfacb4fd0, + 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105, + 0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250, + 0xcf62a1f2, 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3, + 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285, + 0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00, + 0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061, + 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb, + 0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e, + 0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735, + 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc, + 0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9, + 0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340, + 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20, + 0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7 + }, { + 0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934, + 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068, + 0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af, + 0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840, + 0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45, + 0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504, + 0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a, + 0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb, + 0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee, + 0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6, + 0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42, + 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b, + 0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2, + 0x3a6efa74, 0xdd5b4332, 0x6841e7f7, 0xca7820fb, + 0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527, + 0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b, + 0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33, + 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c, + 0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3, + 0x95c11548, 0xe4c66d22, 0x48c1133f, 0xc70f86dc, + 0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17, + 0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564, + 0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b, + 0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115, + 0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922, + 0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728, + 0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0, + 0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e, + 0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37, + 0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d, + 0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804, + 0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b, + 0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3, + 0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb, + 0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d, + 0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c, + 0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350, + 0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9, + 0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a, + 0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe, + 0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d, + 0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc, + 0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f, + 0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61, + 0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2, + 0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9, + 0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2, + 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c, + 0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e, + 0xb77f19b6, 0xe0a9dc09, 0x662d09a1, 0xc4324633, + 0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10, + 0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169, + 0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52, + 0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027, + 0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5, + 0xf0177a28, 0xc0f586e0, 0x006058aa, 0x30dc7d62, + 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634, + 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76, + 0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24, + 0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc, + 0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4, + 0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c, + 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837, + 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0 + }, { + 0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b, + 0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe, + 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b, + 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4, + 0x5748ab2f, 0xbc946e79, 0xc6a376d2, 0x6549c2c8, + 0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6, + 0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304, + 0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22, + 0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4, + 0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6, + 0x2826a2f9, 0xa73a3ae1, 0x4ba99586, 0xef5562e9, + 0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59, + 0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593, + 0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, 0x022b8b51, + 0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28, + 0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c, + 0xe029ac71, 0xe019a5e6, 0x47b0acfd, 0xed93fa9b, + 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28, + 0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c, + 0x15056dd4, 0x88f46dba, 0x03a16125, 0x0564f0bd, + 0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a, + 0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319, + 0x7533d928, 0xb155fdf5, 0x03563482, 0x8aba3cbb, + 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f, + 0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991, + 0xea7a90c2, 0xfb3e7bce, 0x5121ce64, 0x774fbe32, + 0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680, + 0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166, + 0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae, + 0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb, + 0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5, + 0x72eacea8, 0xfa6484bb, 0x8d6612ae, 0xbf3c6f47, + 0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370, + 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d, + 0x4040cb08, 0x4eb4e2cc, 0x34d2466a, 0x0115af84, + 0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048, + 0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8, + 0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd, + 0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9, + 0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7, + 0x1a908749, 0xd44fbd9a, 0xd0dadecb, 0xd50ada38, + 0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f, + 0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c, + 0xbf97222c, 0x15e6fc2a, 0x0f91fc71, 0x9b941525, + 0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1, + 0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442, + 0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, 0x3278e964, + 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e, + 0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8, + 0xdf359f8d, 0x9b992f2e, 0xe60b6f47, 0x0fe3f11d, + 0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f, + 0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299, + 0xf523f357, 0xa6327623, 0x93a83531, 0x56cccd02, + 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc, + 0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614, + 0xe6c6c7bd, 0x327a140a, 0x45e1d006, 0xc3f27b9a, + 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6, + 0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b, + 0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0, + 0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060, + 0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e, + 0x1948c25c, 0x02fb8a8c, 0x01c36ae4, 0xd6ebe1f9, + 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f, + 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6 + } + }, { + 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, + 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89, + 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c, + 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917, + 0x9216d5d9, 0x8979fb1b + } +}; + +static unsigned char BF_itoa64[64 + 1] = + "./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; + +static unsigned char BF_atoi64[0x60] = { + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 0, 1, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 64, 64, 64, 64, 64, + 64, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 64, 64, 64, 64, 64, + 64, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 64, 64, 64, 64, 64 +}; + +#define BF_safe_atoi64(dst, src) \ +{ \ + tmp = (unsigned char)(src); \ + if ((unsigned int)(tmp -= 0x20) >= 0x60) return -1; \ + tmp = BF_atoi64[tmp]; \ + if (tmp > 63) return -1; \ + (dst) = tmp; \ +} + +static int BF_decode(BF_word *dst, const char *src, int size) +{ + unsigned char *dptr = (unsigned char *)dst; + unsigned char *end = dptr + size; + const unsigned char *sptr = (const unsigned char *)src; + unsigned int tmp, c1, c2, c3, c4; + + do { + BF_safe_atoi64(c1, *sptr++); + BF_safe_atoi64(c2, *sptr++); + *dptr++ = (c1 << 2) | ((c2 & 0x30) >> 4); + if (dptr >= end) break; + + BF_safe_atoi64(c3, *sptr++); + *dptr++ = ((c2 & 0x0F) << 4) | ((c3 & 0x3C) >> 2); + if (dptr >= end) break; + + BF_safe_atoi64(c4, *sptr++); + *dptr++ = ((c3 & 0x03) << 6) | c4; + } while (dptr < end); + + return 0; +} + +static void BF_encode(char *dst, const BF_word *src, int size) +{ + const unsigned char *sptr = (const unsigned char *)src; + const unsigned char *end = sptr + size; + unsigned char *dptr = (unsigned char *)dst; + unsigned int c1, c2; + + do { + c1 = *sptr++; + *dptr++ = BF_itoa64[c1 >> 2]; + c1 = (c1 & 0x03) << 4; + if (sptr >= end) { + *dptr++ = BF_itoa64[c1]; + break; + } + + c2 = *sptr++; + c1 |= c2 >> 4; + *dptr++ = BF_itoa64[c1]; + c1 = (c2 & 0x0f) << 2; + if (sptr >= end) { + *dptr++ = BF_itoa64[c1]; + break; + } + + c2 = *sptr++; + c1 |= c2 >> 6; + *dptr++ = BF_itoa64[c1]; + *dptr++ = BF_itoa64[c2 & 0x3f]; + } while (sptr < end); +} + +static void BF_swap(BF_word *x, int count) +{ + static int endianness_check = 1; + char *is_little_endian = (char *)&endianness_check; + BF_word tmp; + + if (*is_little_endian) + do { + tmp = *x; + tmp = (tmp << 16) | (tmp >> 16); + *x++ = ((tmp & 0x00FF00FF) << 8) | ((tmp >> 8) & 0x00FF00FF); + } while (--count); +} + +#if BF_SCALE +/* Architectures which can shift addresses left by 2 bits with no extra cost */ +#define BF_ROUND(L, R, N) \ + tmp1 = L & 0xFF; \ + tmp2 = L >> 8; \ + tmp2 &= 0xFF; \ + tmp3 = L >> 16; \ + tmp3 &= 0xFF; \ + tmp4 = L >> 24; \ + tmp1 = data.ctx.S[3][tmp1]; \ + tmp2 = data.ctx.S[2][tmp2]; \ + tmp3 = data.ctx.S[1][tmp3]; \ + tmp3 += data.ctx.S[0][tmp4]; \ + tmp3 ^= tmp2; \ + R ^= data.ctx.P[N + 1]; \ + tmp3 += tmp1; \ + R ^= tmp3; +#else +/* Architectures with no complicated addressing modes supported */ +#define BF_INDEX(S, i) \ + (*((BF_word *)(((unsigned char *)S) + (i)))) +#define BF_ROUND(L, R, N) \ + tmp1 = L & 0xFF; \ + tmp1 <<= 2; \ + tmp2 = L >> 6; \ + tmp2 &= 0x3FC; \ + tmp3 = L >> 14; \ + tmp3 &= 0x3FC; \ + tmp4 = L >> 22; \ + tmp4 &= 0x3FC; \ + tmp1 = BF_INDEX(data.ctx.S[3], tmp1); \ + tmp2 = BF_INDEX(data.ctx.S[2], tmp2); \ + tmp3 = BF_INDEX(data.ctx.S[1], tmp3); \ + tmp3 += BF_INDEX(data.ctx.S[0], tmp4); \ + tmp3 ^= tmp2; \ + R ^= data.ctx.P[N + 1]; \ + tmp3 += tmp1; \ + R ^= tmp3; +#endif + +/* + * Encrypt one block, BF_N is hardcoded here. + */ +#define BF_ENCRYPT \ + L ^= data.ctx.P[0]; \ + BF_ROUND(L, R, 0); \ + BF_ROUND(R, L, 1); \ + BF_ROUND(L, R, 2); \ + BF_ROUND(R, L, 3); \ + BF_ROUND(L, R, 4); \ + BF_ROUND(R, L, 5); \ + BF_ROUND(L, R, 6); \ + BF_ROUND(R, L, 7); \ + BF_ROUND(L, R, 8); \ + BF_ROUND(R, L, 9); \ + BF_ROUND(L, R, 10); \ + BF_ROUND(R, L, 11); \ + BF_ROUND(L, R, 12); \ + BF_ROUND(R, L, 13); \ + BF_ROUND(L, R, 14); \ + BF_ROUND(R, L, 15); \ + tmp4 = R; \ + R = L; \ + L = tmp4 ^ data.ctx.P[BF_N + 1]; + +#if BF_ASM +#define BF_body() \ + _BF_body_r(&data.ctx); +#else +#define BF_body() \ + L = R = 0; \ + ptr = data.ctx.P; \ + do { \ + ptr += 2; \ + BF_ENCRYPT; \ + *(ptr - 2) = L; \ + *(ptr - 1) = R; \ + } while (ptr < &data.ctx.P[BF_N + 2]); \ +\ + ptr = data.ctx.S[0]; \ + do { \ + ptr += 2; \ + BF_ENCRYPT; \ + *(ptr - 2) = L; \ + *(ptr - 1) = R; \ + } while (ptr < &data.ctx.S[3][0xFF]); +#endif + +static void BF_set_key(const char *key, BF_key expanded, BF_key initial, + unsigned char flags) +{ + const char *ptr = key; + unsigned int bug, i, j; + BF_word safety, sign, diff, tmp[2]; + +/* + * There was a sign extension bug in older revisions of this function. While + * we would have liked to simply fix the bug and move on, we have to provide + * a backwards compatibility feature (essentially the bug) for some systems and + * a safety measure for some others. The latter is needed because for certain + * multiple inputs to the buggy algorithm there exist easily found inputs to + * the correct algorithm that produce the same hash. Thus, we optionally + * deviate from the correct algorithm just enough to avoid such collisions. + * While the bug itself affected the majority of passwords containing + * characters with the 8th bit set (although only a percentage of those in a + * collision-producing way), the anti-collision safety measure affects + * only a subset of passwords containing the '\xff' character (not even all of + * those passwords, just some of them). This character is not found in valid + * UTF-8 sequences and is rarely used in popular 8-bit character encodings. + * Thus, the safety measure is unlikely to cause much annoyance, and is a + * reasonable tradeoff to use when authenticating against existing hashes that + * are not reliably known to have been computed with the correct algorithm. + * + * We use an approach that tries to minimize side-channel leaks of password + * information - that is, we mostly use fixed-cost bitwise operations instead + * of branches or table lookups. (One conditional branch based on password + * length remains. It is not part of the bug aftermath, though, and is + * difficult and possibly unreasonable to avoid given the use of C strings by + * the caller, which results in similar timing leaks anyway.) + * + * For actual implementation, we set an array index in the variable "bug" + * (0 means no bug, 1 means sign extension bug emulation) and a flag in the + * variable "safety" (bit 16 is set when the safety measure is requested). + * Valid combinations of settings are: + * + * Prefix "$2a$": bug = 0, safety = 0x10000 + * Prefix "$2x$": bug = 1, safety = 0 + * Prefix "$2y$": bug = 0, safety = 0 + */ + bug = (unsigned int)flags & 1; + safety = ((BF_word)flags & 2) << 15; + + sign = diff = 0; + + for (i = 0; i < BF_N + 2; i++) { + tmp[0] = tmp[1] = 0; + for (j = 0; j < 4; j++) { + tmp[0] <<= 8; + tmp[0] |= (unsigned char)*ptr; /* correct */ + tmp[1] <<= 8; + tmp[1] |= (BF_word_signed)(signed char)*ptr; /* bug */ +/* + * Sign extension in the first char has no effect - nothing to overwrite yet, + * and those extra 24 bits will be fully shifted out of the 32-bit word. For + * chars 2, 3, 4 in each four-char block, we set bit 7 of "sign" if sign + * extension in tmp[1] occurs. Once this flag is set, it remains set. + */ + if (j) + sign |= tmp[1] & 0x80; + if (!*ptr) + ptr = key; + else + ptr++; + } + diff |= tmp[0] ^ tmp[1]; /* Non-zero on any differences */ + + expanded[i] = tmp[bug]; + initial[i] = BF_init_state.P[i] ^ tmp[bug]; + } + +/* + * At this point, "diff" is zero iff the correct and buggy algorithms produced + * exactly the same result. If so and if "sign" is non-zero, which indicates + * that there was a non-benign sign extension, this means that we have a + * collision between the correctly computed hash for this password and a set of + * passwords that could be supplied to the buggy algorithm. Our safety measure + * is meant to protect from such many-buggy to one-correct collisions, by + * deviating from the correct algorithm in such cases. Let's check for this. + */ + diff |= diff >> 16; /* still zero iff exact match */ + diff &= 0xffff; /* ditto */ + diff += 0xffff; /* bit 16 set iff "diff" was non-zero (on non-match) */ + sign <<= 9; /* move the non-benign sign extension flag to bit 16 */ + sign &= ~diff & safety; /* action needed? */ + +/* + * If we have determined that we need to deviate from the correct algorithm, + * flip bit 16 in initial expanded key. (The choice of 16 is arbitrary, but + * let's stick to it now. It came out of the approach we used above, and it's + * not any worse than any other choice we could make.) + * + * It is crucial that we don't do the same to the expanded key used in the main + * Eksblowfish loop. By doing it to only one of these two, we deviate from a + * state that could be directly specified by a password to the buggy algorithm + * (and to the fully correct one as well, but that's a side-effect). + */ + initial[0] ^= sign; +} + +static char *BF_crypt(const char *key, const char *setting, + char *output, int size, + BF_word min) +{ +#if BF_ASM + extern void _BF_body_r(BF_ctx *ctx); +#endif + static const unsigned char flags_by_subtype[26] = + {2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 0}; + struct { + BF_ctx ctx; + BF_key expanded_key; + union { + BF_word salt[4]; + BF_word output[6]; + } binary; + } data; + BF_word L, R; + BF_word tmp1, tmp2, tmp3, tmp4; + BF_word *ptr; + BF_word count; + int i; + + if (size < 7 + 22 + 31 + 1) { + __set_errno(ERANGE); + return NULL; + } + + if (setting[0] != '$' || + setting[1] != '2' || + setting[2] < 'a' || setting[2] > 'z' || + !flags_by_subtype[(unsigned int)(unsigned char)setting[2] - 'a'] || + setting[3] != '$' || + setting[4] < '0' || setting[4] > '3' || + setting[5] < '0' || setting[5] > '9' || + (setting[4] == '3' && setting[5] > '1') || + setting[6] != '$') { + __set_errno(EINVAL); + return NULL; + } + + count = (BF_word)1 << ((setting[4] - '0') * 10 + (setting[5] - '0')); + if (count < min || BF_decode(data.binary.salt, &setting[7], 16)) { + __set_errno(EINVAL); + return NULL; + } + BF_swap(data.binary.salt, 4); + + BF_set_key(key, data.expanded_key, data.ctx.P, + flags_by_subtype[(unsigned int)(unsigned char)setting[2] - 'a']); + + memcpy(data.ctx.S, BF_init_state.S, sizeof(data.ctx.S)); + + L = R = 0; + for (i = 0; i < BF_N + 2; i += 2) { + L ^= data.binary.salt[i & 2]; + R ^= data.binary.salt[(i & 2) + 1]; + BF_ENCRYPT; + data.ctx.P[i] = L; + data.ctx.P[i + 1] = R; + } + + ptr = data.ctx.S[0]; + do { + ptr += 4; + L ^= data.binary.salt[(BF_N + 2) & 3]; + R ^= data.binary.salt[(BF_N + 3) & 3]; + BF_ENCRYPT; + *(ptr - 4) = L; + *(ptr - 3) = R; + + L ^= data.binary.salt[(BF_N + 4) & 3]; + R ^= data.binary.salt[(BF_N + 5) & 3]; + BF_ENCRYPT; + *(ptr - 2) = L; + *(ptr - 1) = R; + } while (ptr < &data.ctx.S[3][0xFF]); + + do { + int done; + + for (i = 0; i < BF_N + 2; i += 2) { + data.ctx.P[i] ^= data.expanded_key[i]; + data.ctx.P[i + 1] ^= data.expanded_key[i + 1]; + } + + done = 0; + do { + BF_body(); + if (done) + break; + done = 1; + + tmp1 = data.binary.salt[0]; + tmp2 = data.binary.salt[1]; + tmp3 = data.binary.salt[2]; + tmp4 = data.binary.salt[3]; + for (i = 0; i < BF_N; i += 4) { + data.ctx.P[i] ^= tmp1; + data.ctx.P[i + 1] ^= tmp2; + data.ctx.P[i + 2] ^= tmp3; + data.ctx.P[i + 3] ^= tmp4; + } + data.ctx.P[16] ^= tmp1; + data.ctx.P[17] ^= tmp2; + } while (1); + } while (--count); + + for (i = 0; i < 6; i += 2) { + L = BF_magic_w[i]; + R = BF_magic_w[i + 1]; + + count = 64; + do { + BF_ENCRYPT; + } while (--count); + + data.binary.output[i] = L; + data.binary.output[i + 1] = R; + } + + memcpy(output, setting, 7 + 22 - 1); + output[7 + 22 - 1] = BF_itoa64[(int) + BF_atoi64[(int)setting[7 + 22 - 1] - 0x20] & 0x30]; + +/* This has to be bug-compatible with the original implementation, so + * only encode 23 of the 24 bytes. :-) */ + BF_swap(data.binary.output, 6); + BF_encode(&output[7 + 22], data.binary.output, 23); + output[7 + 22 + 31] = '\0'; + + return output; +} + +int _crypt_output_magic(const char *setting, char *output, int size) +{ + if (size < 3) + return -1; + + output[0] = '*'; + output[1] = '0'; + output[2] = '\0'; + + if (setting[0] == '*' && setting[1] == '0') + output[1] = '1'; + + return 0; +} + +/* + * Please preserve the runtime self-test. It serves two purposes at once: + * + * 1. We really can't afford the risk of producing incompatible hashes e.g. + * when there's something like gcc bug 26587 again, whereas an application or + * library integrating this code might not also integrate our external tests or + * it might not run them after every build. Even if it does, the miscompile + * might only occur on the production build, but not on a testing build (such + * as because of different optimization settings). It is painful to recover + * from incorrectly-computed hashes - merely fixing whatever broke is not + * enough. Thus, a proactive measure like this self-test is needed. + * + * 2. We don't want to leave sensitive data from our actual password hash + * computation on the stack or in registers. Previous revisions of the code + * would do explicit cleanups, but simply running the self-test after hash + * computation is more reliable. + * + * The performance cost of this quick self-test is around 0.6% at the "$2a$08" + * setting. + */ +char *_crypt_blowfish_rn(const char *key, const char *setting, + char *output, int size) +{ + const char *test_key = "8b \xd0\xc1\xd2\xcf\xcc\xd8"; + const char *test_setting = "$2a$00$abcdefghijklmnopqrstuu"; + static const char * const test_hash[2] = + {"VUrPmXD6q/nVSSp7pNDhCR9071IfIRe\0\x55", /* $2x$ */ + "i1D709vfamulimlGcq0qq3UvuUasvEa\0\x55"}; /* $2a$, $2y$ */ + char *retval; + const char *p; + int save_errno, ok; + struct { + char s[7 + 22 + 1]; + char o[7 + 22 + 31 + 1 + 1 + 1]; + } buf; + +/* Hash the supplied password */ + _crypt_output_magic(setting, output, size); + retval = BF_crypt(key, setting, output, size, 16); + save_errno = errno; + +/* + * Do a quick self-test. It is important that we make both calls to BF_crypt() + * from the same scope such that they likely use the same stack locations, + * which makes the second call overwrite the first call's sensitive data on the + * stack and makes it more likely that any alignment related issues would be + * detected by the self-test. + */ + memcpy(buf.s, test_setting, sizeof(buf.s)); + if (retval) + buf.s[2] = setting[2]; + memset(buf.o, 0x55, sizeof(buf.o)); + buf.o[sizeof(buf.o) - 1] = 0; + p = BF_crypt(test_key, buf.s, buf.o, sizeof(buf.o) - (1 + 1), 1); + + ok = (p == buf.o && + !memcmp(p, buf.s, 7 + 22) && + !memcmp(p + (7 + 22), + test_hash[(unsigned int)(unsigned char)buf.s[2] & 1], + 31 + 1 + 1 + 1)); + + { + const char *k = "\xff\xa3" "34" "\xff\xff\xff\xa3" "345"; + BF_key ae, ai, ye, yi; + BF_set_key(k, ae, ai, 2); /* $2a$ */ + BF_set_key(k, ye, yi, 4); /* $2y$ */ + ai[0] ^= 0x10000; /* undo the safety (for comparison) */ + ok = ok && ai[0] == 0xdb9c59bc && ye[17] == 0x33343500 && + !memcmp(ae, ye, sizeof(ae)) && + !memcmp(ai, yi, sizeof(ai)); + } + + __set_errno(save_errno); + if (ok) + return retval; + +/* Should not happen */ + _crypt_output_magic(setting, output, size); + __set_errno(EINVAL); /* pretend we don't support this hash type */ + return NULL; +} + +char *_crypt_gensalt_blowfish_rn(const char *prefix, unsigned long count, + const char *input, int size, char *output, int output_size) +{ + if (size < 16 || output_size < 7 + 22 + 1 || + (count && (count < 4 || count > 31)) || + prefix[0] != '$' || prefix[1] != '2' || + (prefix[2] != 'a' && prefix[2] != 'y')) { + if (output_size > 0) output[0] = '\0'; + __set_errno((output_size < 7 + 22 + 1) ? ERANGE : EINVAL); + return NULL; + } + + if (!count) count = 5; + + output[0] = '$'; + output[1] = '2'; + output[2] = prefix[2]; + output[3] = '$'; + output[4] = '0' + count / 10; + output[5] = '0' + count % 10; + output[6] = '$'; + + BF_encode(&output[7], (const BF_word *)input, 16); + output[7 + 22] = '\0'; + + return output; +} diff --git a/contrib/apr-util/crypto/crypt_blowfish.h b/contrib/apr-util/crypto/crypt_blowfish.h new file mode 100644 index 000000000000..2ee0d8c1d805 --- /dev/null +++ b/contrib/apr-util/crypto/crypt_blowfish.h @@ -0,0 +1,27 @@ +/* + * Written by Solar Designer <solar at openwall.com> in 2000-2011. + * No copyright is claimed, and the software is hereby placed in the public + * domain. In case this attempt to disclaim copyright and place the software + * in the public domain is deemed null and void, then the software is + * Copyright (c) 2000-2011 Solar Designer and it is hereby released to the + * general public under the following terms: + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted. + * + * There's ABSOLUTELY NO WARRANTY, express or implied. + * + * See crypt_blowfish.c for more information. + */ + +#ifndef _CRYPT_BLOWFISH_H +#define _CRYPT_BLOWFISH_H + +extern int _crypt_output_magic(const char *setting, char *output, int size); +extern char *_crypt_blowfish_rn(const char *key, const char *setting, + char *output, int size); +extern char *_crypt_gensalt_blowfish_rn(const char *prefix, + unsigned long count, + const char *input, int size, char *output, int output_size); + +#endif diff --git a/contrib/apr-util/dbd/NWGNUdbdmysql b/contrib/apr-util/dbd/NWGNUdbdmysql index 78e865e4ab69..f52d326140e4 100644 --- a/contrib/apr-util/dbd/NWGNUdbdmysql +++ b/contrib/apr-util/dbd/NWGNUdbdmysql @@ -30,6 +30,9 @@ MYSQL_INC = $(MYSQLSDK)/include MYSQL_IMP = libmysql.imp MYSQL_LIB = libmysqlclient_r.lib libz.lib MYSQL_NLM = libmysql +ifneq "$(wildcard $(MYSQL_INC)/mysql.h)" "$(MYSQL_INC)/mysql.h" +$(error MYSQLSDK does not point to a valid MySQL SDK) +endif # # These directories will be at the beginning of the include list, followed by diff --git a/contrib/apr-util/dbd/apr_dbd_freetds.c b/contrib/apr-util/dbd/apr_dbd_freetds.c index 9a0cae7939a8..d0b4b20025ec 100644 --- a/contrib/apr-util/dbd/apr_dbd_freetds.c +++ b/contrib/apr-util/dbd/apr_dbd_freetds.c @@ -327,7 +327,7 @@ static int dbd_freetds_get_row(apr_pool_t *pool, apr_dbd_results_t *res, case SUCCEED: return 0; case REG_ROW: return 0; case NO_MORE_ROWS: - apr_pool_cleanup_run(pool, res->proc, clear_result); + apr_pool_cleanup_run(res->pool, res->proc, clear_result); *rowp = NULL; return -1; case FAIL: return 1; @@ -627,7 +627,7 @@ static apr_dbd_t *dbd_freetds_open(apr_pool_t *pool, const char *params, if (process == NULL) { return NULL; } - sql = apr_palloc (pool, sizeof (apr_dbd_t)); + sql = apr_pcalloc(pool, sizeof (apr_dbd_t)); sql->pool = pool; sql->proc = process; sql->params = params; diff --git a/contrib/apr-util/dbd/apr_dbd_freetds.dsp b/contrib/apr-util/dbd/apr_dbd_freetds.dsp deleted file mode 100644 index 29f385286b04..000000000000 --- a/contrib/apr-util/dbd/apr_dbd_freetds.dsp +++ /dev/null @@ -1,207 +0,0 @@ -# Microsoft Developer Studio Project File - Name="apr_dbd_freetds" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=apr_dbd_freetds - Win32 Release -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "apr_dbd_freetds.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "apr_dbd_freetds.mak" CFG="apr_dbd_freetds - Win32 Release" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "apr_dbd_freetds - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "apr_dbd_freetds - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "apr_dbd_freetds - x64 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "apr_dbd_freetds - x64 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "apr_dbd_freetds - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_FREETDS=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_freetds_src" /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /fo"Release/apr_dbd_freetds-1.res" /d DLL_NAME="apr_dbd_freetds" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libTDS.lib /nologo /base:"0x6EF60000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libTDS.lib /nologo /base:"0x6EF60000" /subsystem:windows /dll /incremental:no /debug /out:"Release\apr_dbd_freetds-1.dll" /pdb:"Release\apr_dbd_freetds-1.pdb" /implib:"Release\apr_dbd_freetds-1.lib" /MACHINE:X86 /opt:ref -# Begin Special Build Tool -TargetPath=Release\apr_dbd_freetds-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ELSEIF "$(CFG)" == "apr_dbd_freetds - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_FREETDS=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_freetds_src" /FD /EHsc /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /fo"Debug/apr_dbd_freetds-1.res" /d DLL_NAME="apr_dbd_freetds" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libTDS.lib /nologo /base:"0x6EF60000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libTDS.lib /nologo /base:"0x6EF60000" /subsystem:windows /dll /incremental:no /debug /out:"Debug\apr_dbd_freetds-1.dll" /pdb:"Debug\apr_dbd_freetds-1.pdb" /implib:"Debug\apr_dbd_freetds-1.lib" /MACHINE:X86 -# Begin Special Build Tool -TargetPath=Debug\apr_dbd_freetds-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ELSEIF "$(CFG)" == "apr_dbd_freetds - x64 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "x64\Release" -# PROP BASE Intermediate_Dir "x64\Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "x64\Release" -# PROP Intermediate_Dir "x64\Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_FREETDS=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_freetds_src" /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /fo"x64/Release/apr_dbd_freetds-1.res" /d DLL_NAME="apr_dbd_freetds" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libTDS.lib /nologo /base:"0x6EF60000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libTDS.lib /nologo /base:"0x6EF60000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Release\apr_dbd_freetds-1.dll" /pdb:"x64\Release\apr_dbd_freetds-1.pdb" /implib:"x64\Release\apr_dbd_freetds-1.lib" /MACHINE:X64 /opt:ref -# Begin Special Build Tool -TargetPath=x64\Release\apr_dbd_freetds-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ELSEIF "$(CFG)" == "apr_dbd_freetds - x64 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "x64\Debug" -# PROP BASE Intermediate_Dir "x64\Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "x64\Debug" -# PROP Intermediate_Dir "x64\Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_FREETDS=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_freetds_src" /FD /EHsc /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /fo"x64/Debug/apr_dbd_freetds-1.res" /d DLL_NAME="apr_dbd_freetds" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libTDS.lib /nologo /base:"0x6EF60000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libTDS.lib /nologo /base:"0x6EF60000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Debug\apr_dbd_freetds-1.dll" /pdb:"x64\Debug\apr_dbd_freetds-1.pdb" /implib:"x64\Debug\apr_dbd_freetds-1.lib" /MACHINE:X64 -# Begin Special Build Tool -TargetPath=x64\Debug\apr_dbd_freetds-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ENDIF - -# Begin Target - -# Name "apr_dbd_freetds - Win32 Release" -# Name "apr_dbd_freetds - Win32 Debug" -# Name "apr_dbd_freetds - x64 Release" -# Name "apr_dbd_freetds - x64 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\apr_dbd_freetds.c -# End Source File -# End Group -# Begin Group "Public Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\include\apr_dbd.h -# End Source File -# End Group -# Begin Group "Internal Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\include\private\apu_config.h -# End Source File -# Begin Source File - -SOURCE=..\include\private\apu_dbd_internal.h -# End Source File -# Begin Source File - -SOURCE=..\include\private\apu_internal.h -# End Source File -# End Group -# Begin Source File - -SOURCE=..\libaprutil.rc -# End Source File -# End Target -# End Project diff --git a/contrib/apr-util/dbd/apr_dbd_mysql.c b/contrib/apr-util/dbd/apr_dbd_mysql.c index 482b82a96a6f..1141c6fd9772 100644 --- a/contrib/apr-util/dbd/apr_dbd_mysql.c +++ b/contrib/apr-util/dbd/apr_dbd_mysql.c @@ -325,7 +325,7 @@ static int dbd_mysql_get_row(apr_pool_t *pool, apr_dbd_results_t *res, (*row)->len = mysql_fetch_lengths(res->res); } else { - apr_pool_cleanup_run(pool, res->res, free_result); + apr_pool_cleanup_run(res->pool, res->res, free_result); } return ret; } diff --git a/contrib/apr-util/dbd/apr_dbd_mysql.dsp b/contrib/apr-util/dbd/apr_dbd_mysql.dsp deleted file mode 100644 index 6b88d77453bd..000000000000 --- a/contrib/apr-util/dbd/apr_dbd_mysql.dsp +++ /dev/null @@ -1,207 +0,0 @@ -# Microsoft Developer Studio Project File - Name="apr_dbd_mysql" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=apr_dbd_mysql - Win32 Release -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "apr_dbd_mysql.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "apr_dbd_mysql.mak" CFG="apr_dbd_mysql - Win32 Release" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "apr_dbd_mysql - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "apr_dbd_mysql - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "apr_dbd_mysql - x64 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "apr_dbd_mysql - x64 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "apr_dbd_mysql - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_MYSQL=1 /D "HAVE_MYSQL_H" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_mysql_src" /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /fo"Release/apr_dbd_mysql-1.res" /d DLL_NAME="apr_dbd_mysql" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libmysql.lib /nologo /base:"0x6EF50000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libmysql.lib /nologo /base:"0x6EF50000" /subsystem:windows /dll /incremental:no /debug /out:"Release\apr_dbd_mysql-1.dll" /pdb:"Release\apr_dbd_mysql-1.pdb" /implib:"Release\apr_dbd_mysql-1.lib" /MACHINE:X86 /opt:ref -# Begin Special Build Tool -TargetPath=Release\apr_dbd_mysql-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ELSEIF "$(CFG)" == "apr_dbd_mysql - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_MYSQL=1 /D "HAVE_MYSQL_H" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_mysql_src" /FD /EHsc /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /fo"Debug/apr_dbd_mysql-1.res" /d DLL_NAME="apr_dbd_mysql" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libmysql.lib /nologo /base:"0x6EF50000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libmysql.lib /nologo /base:"0x6EF50000" /subsystem:windows /dll /incremental:no /debug /out:"Debug\apr_dbd_mysql-1.dll" /pdb:"Debug\apr_dbd_mysql-1.pdb" /implib:"Debug\apr_dbd_mysql-1.lib" /MACHINE:X86 -# Begin Special Build Tool -TargetPath=Debug\apr_dbd_mysql-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ELSEIF "$(CFG)" == "apr_dbd_mysql - x64 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "x64\Release" -# PROP BASE Intermediate_Dir "x64\Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "x64\Release" -# PROP Intermediate_Dir "x64\Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_MYSQL=1 /D "HAVE_MYSQL_H" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_mysql_src" /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /fo"x64/Release/apr_dbd_mysql-1.res" /d DLL_NAME="apr_dbd_mysql" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libmysql.lib /nologo /base:"0x6EF50000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libmysql.lib /nologo /base:"0x6EF50000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Release\apr_dbd_mysql-1.dll" /pdb:"x64\Release\apr_dbd_mysql-1.pdb" /implib:"x64\Release\apr_dbd_mysql-1.lib" /MACHINE:X64 /opt:ref -# Begin Special Build Tool -TargetPath=x64\Release\apr_dbd_mysql-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ELSEIF "$(CFG)" == "apr_dbd_mysql - x64 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "x64\Debug" -# PROP BASE Intermediate_Dir "x64\Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "x64\Debug" -# PROP Intermediate_Dir "x64\Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_MYSQL=1 /D "HAVE_MYSQL_H" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_mysql_src" /FD /EHsc /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /fo"x64/Debug/apr_dbd_mysql-1.res" /d DLL_NAME="apr_dbd_mysql" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libmysql.lib /nologo /base:"0x6EF50000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libmysql.lib /nologo /base:"0x6EF50000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Debug\apr_dbd_mysql-1.dll" /pdb:"x64\Debug\apr_dbd_mysql-1.pdb" /implib:"x64\Debug\apr_dbd_mysql-1.lib" /MACHINE:X64 -# Begin Special Build Tool -TargetPath=x64\Debug\apr_dbd_mysql-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ENDIF - -# Begin Target - -# Name "apr_dbd_mysql - Win32 Release" -# Name "apr_dbd_mysql - Win32 Debug" -# Name "apr_dbd_mysql - x64 Release" -# Name "apr_dbd_mysql - x64 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\apr_dbd_mysql.c -# End Source File -# End Group -# Begin Group "Public Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\include\apr_dbd.h -# End Source File -# End Group -# Begin Group "Internal Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\include\private\apu_config.h -# End Source File -# Begin Source File - -SOURCE=..\include\private\apu_dbd_internal.h -# End Source File -# Begin Source File - -SOURCE=..\include\private\apu_internal.h -# End Source File -# End Group -# Begin Source File - -SOURCE=..\libaprutil.rc -# End Source File -# End Target -# End Project diff --git a/contrib/apr-util/dbd/apr_dbd_odbc.dsp b/contrib/apr-util/dbd/apr_dbd_odbc.dsp deleted file mode 100644 index 4e6cf4c30d75..000000000000 --- a/contrib/apr-util/dbd/apr_dbd_odbc.dsp +++ /dev/null @@ -1,191 +0,0 @@ -# Microsoft Developer Studio Project File - Name="apr_dbd_odbc" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=apr_dbd_odbc - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "apr_dbd_odbc.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "apr_dbd_odbc.mak" CFG="apr_dbd_odbc - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "apr_dbd_odbc - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "apr_dbd_odbc - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "apr_dbd_odbc - x64 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "apr_dbd_odbc - x64 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "apr_dbd_odbc - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "HAVE_SQL_H" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_ODBC=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_odbc_src" /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /fo"Release/apr_dbd_odbc-1.res" /d DLL_NAME="apr_dbd_odbc" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib odbc32.lib odbccp32.lib /nologo /base:"0x6EF00000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib odbc32.lib odbccp32.lib /nologo /base:"0x6EF00000" /subsystem:windows /dll /incremental:no /debug /out:"Release\apr_dbd_odbc-1.dll" /implib:"Release\apr_dbd_odbc-1.lib" /MACHINE:X86 /opt:ref -# Begin Special Build Tool -TargetPath=Release\apr_dbd_odbc-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ELSEIF "$(CFG)" == "apr_dbd_odbc - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_ODBC=1 /D "HAVE_SQL_H" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_odbc_src" /FD /EHsc /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /fo"Debug/apr_dbd_odbc-1.res" /d DLL_NAME="apr_dbd_odbc" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib odbc32.lib odbccp32.lib /nologo /base:"0x6EF00000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib odbc32.lib odbccp32.lib /nologo /base:"0x6EF00000" /subsystem:windows /dll /incremental:no /debug /out:"Debug\apr_dbd_odbc-1.dll" /implib:"Debug\apr_dbd_odbc-1.lib" /MACHINE:X86 -# Begin Special Build Tool -TargetPath=Debug\apr_dbd_odbc-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ELSEIF "$(CFG)" == "apr_dbd_odbc - x64 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "x64\Release" -# PROP BASE Intermediate_Dir "x64\Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "x64\Release" -# PROP Intermediate_Dir "x64\Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "HAVE_SQL_H" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_ODBC=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_odbc_src" /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /fo"x64\Release/apr_dbd_odbc-1.res" /d DLL_NAME="apr_dbd_odbc" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib odbc32.lib odbccp32.lib /nologo /base:"0x6EF00000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib odbc32.lib odbccp32.lib /nologo /base:"0x6EF00000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Release\apr_dbd_odbc-1.dll" /implib:"x64\Release\apr_dbd_odbc-1.lib" /MACHINE:X64 /opt:ref -# Begin Special Build Tool -TargetPath=x64\Release\apr_dbd_odbc-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ELSEIF "$(CFG)" == "apr_dbd_odbc - x64 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "x64\Debug" -# PROP BASE Intermediate_Dir "x64\Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "x64\Debug" -# PROP Intermediate_Dir "x64\Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_ODBC=1 /D "HAVE_SQL_H" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_odbc_src" /FD /EHsc /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /fo"x64/debug/apr_dbd_odbc-1.res" /d DLL_NAME="apr_dbd_odbc" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib odbc32.lib odbccp32.lib /nologo /base:"0x6EF00000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib odbc32.lib odbccp32.lib /nologo /base:"0x6EF00000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Debug\apr_dbd_odbc-1.dll" /implib:"x64\Debug\apr_dbd_odbc-1.lib" /MACHINE:X64 -# Begin Special Build Tool -TargetPath=x64\Debug\apr_dbd_odbc-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ENDIF - -# Begin Target - -# Name "apr_dbd_odbc - Win32 Release" -# Name "apr_dbd_odbc - Win32 Debug" -# Name "apr_dbd_odbc - x64 Release" -# Name "apr_dbd_odbc - x64 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\apr_dbd_odbc.c -# End Source File -# End Group -# Begin Group "Public Header Files" - -# PROP Default_Filter ".h" -# Begin Source File - -SOURCE=..\include\apr_dbd.h -# End Source File -# End Group -# Begin Group "Internal Header Files" - -# PROP Default_Filter ".h" -# End Group -# End Target -# End Project diff --git a/contrib/apr-util/dbd/apr_dbd_oracle.dsp b/contrib/apr-util/dbd/apr_dbd_oracle.dsp deleted file mode 100644 index e5b97d9fedab..000000000000 --- a/contrib/apr-util/dbd/apr_dbd_oracle.dsp +++ /dev/null @@ -1,207 +0,0 @@ -# Microsoft Developer Studio Project File - Name="apr_dbd_oracle" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=apr_dbd_oracle - Win32 Release -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "apr_dbd_oracle.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "apr_dbd_oracle.mak" CFG="apr_dbd_oracle - Win32 Release" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "apr_dbd_oracle - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "apr_dbd_oracle - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "apr_dbd_oracle - x64 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "apr_dbd_oracle - x64 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "apr_dbd_oracle - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_ORACLE=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_oracle_src" /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /fo"Release/apr_dbd_oracle-1.res" /d DLL_NAME="apr_dbd_oracle" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib oci.lib /nologo /base:"0x6EF40000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib oci.lib /nologo /base:"0x6EF40000" /subsystem:windows /dll /incremental:no /debug /out:"Release\apr_dbd_oracle-1.dll" /pdb:"Release\apr_dbd_oracle-1.pdb" /implib:"Release\apr_dbd_oracle-1.lib" /MACHINE:X86 /opt:ref -# Begin Special Build Tool -TargetPath=Release\apr_dbd_oracle-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ELSEIF "$(CFG)" == "apr_dbd_oracle - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_ORACLE=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_oracle_src" /FD /EHsc /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /fo"Debug/apr_dbd_oracle-1.res" /d DLL_NAME="apr_dbd_oracle" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib oci.lib /nologo /base:"0x6EF40000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib oci.lib /nologo /base:"0x6EF40000" /subsystem:windows /dll /incremental:no /debug /out:"Debug\apr_dbd_oracle-1.dll" /pdb:"Debug\apr_dbd_oracle-1.pdb" /implib:"Debug\apr_dbd_oracle-1.lib" /MACHINE:X86 -# Begin Special Build Tool -TargetPath=Debug\apr_dbd_oracle-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ELSEIF "$(CFG)" == "apr_dbd_oracle - x64 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "x64\Release" -# PROP BASE Intermediate_Dir "x64\Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "x64\Release" -# PROP Intermediate_Dir "x64\Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_ORACLE=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_oracle_src" /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /fo"x64/Release/apr_dbd_oracle-1.res" /d DLL_NAME="apr_dbd_oracle" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib oci.lib /nologo /base:"0x6EF40000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib oci.lib /nologo /base:"0x6EF40000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Release\apr_dbd_oracle-1.dll" /pdb:"x64\Release\apr_dbd_oracle-1.pdb" /implib:"x64\Release\apr_dbd_oracle-1.lib" /MACHINE:X64 /opt:ref -# Begin Special Build Tool -TargetPath=x64\Release\apr_dbd_oracle-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ELSEIF "$(CFG)" == "apr_dbd_oracle - x64 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "x64\Debug" -# PROP BASE Intermediate_Dir "x64\Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "x64\Debug" -# PROP Intermediate_Dir "x64\Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_ORACLE=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_oracle_src" /FD /EHsc /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /fo"x64/Debug/apr_dbd_oracle-1.res" /d DLL_NAME="apr_dbd_oracle" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib oci.lib /nologo /base:"0x6EF40000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib oci.lib /nologo /base:"0x6EF40000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Debug\apr_dbd_oracle-1.dll" /pdb:"x64\Debug\apr_dbd_oracle-1.pdb" /implib:"x64\Debug\apr_dbd_oracle-1.lib" /MACHINE:X64 -# Begin Special Build Tool -TargetPath=x64\Debug\apr_dbd_oracle-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ENDIF - -# Begin Target - -# Name "apr_dbd_oracle - Win32 Release" -# Name "apr_dbd_oracle - Win32 Debug" -# Name "apr_dbd_oracle - x64 Release" -# Name "apr_dbd_oracle - x64 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\apr_dbd_oracle.c -# End Source File -# End Group -# Begin Group "Public Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\include\apr_dbd.h -# End Source File -# End Group -# Begin Group "Internal Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\include\private\apu_config.h -# End Source File -# Begin Source File - -SOURCE=..\include\private\apu_dbd_internal.h -# End Source File -# Begin Source File - -SOURCE=..\include\private\apu_internal.h -# End Source File -# End Group -# Begin Source File - -SOURCE=..\libaprutil.rc -# End Source File -# End Target -# End Project diff --git a/contrib/apr-util/dbd/apr_dbd_pgsql.c b/contrib/apr-util/dbd/apr_dbd_pgsql.c index 21f2179b8036..52c83ec99c10 100644 --- a/contrib/apr-util/dbd/apr_dbd_pgsql.c +++ b/contrib/apr-util/dbd/apr_dbd_pgsql.c @@ -265,7 +265,7 @@ static int dbd_pgsql_get_row(apr_pool_t *pool, apr_dbd_results_t *res, if (res->random) { if ((row->n >= 0) && (size_t)row->n >= res->ntuples) { *rowp = NULL; - apr_pool_cleanup_run(pool, res->res, clear_result); + apr_pool_cleanup_run(res->pool, res->res, clear_result); res->res = NULL; return -1; } @@ -470,7 +470,7 @@ static const char *dbd_pgsql_escape(apr_pool_t *pool, const char *arg, { size_t len = strlen(arg); char *ret = apr_palloc(pool, 2*len + 2); - PQescapeString(ret, arg, len); + PQescapeStringConn(sql->conn, ret, arg, len, NULL); return ret; } diff --git a/contrib/apr-util/dbd/apr_dbd_pgsql.dsp b/contrib/apr-util/dbd/apr_dbd_pgsql.dsp deleted file mode 100644 index e7f146648d16..000000000000 --- a/contrib/apr-util/dbd/apr_dbd_pgsql.dsp +++ /dev/null @@ -1,207 +0,0 @@ -# Microsoft Developer Studio Project File - Name="apr_dbd_pgsql" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=apr_dbd_pgsql - Win32 Release -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "apr_dbd_pgsql.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "apr_dbd_pgsql.mak" CFG="apr_dbd_pgsql - Win32 Release" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "apr_dbd_pgsql - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "apr_dbd_pgsql - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "apr_dbd_pgsql - x64 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "apr_dbd_pgsql - x64 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "apr_dbd_pgsql - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_PGSQL=1 /D "HAVE_LIBPQ_FE_H" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_pgsql_src" /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /fo"Release/apr_dbd_pgsql-1.res" /d DLL_NAME="apr_dbd_pgsql" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libpq.lib /nologo /base:"0x6EF30000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libpq.lib /nologo /base:"0x6EF30000" /subsystem:windows /dll /incremental:no /debug /out:"Release\apr_dbd_pgsql-1.dll" /pdb:"Release\apr_dbd_pgsql-1.pdb" /implib:"Release\apr_dbd_pgsql-1.lib" /MACHINE:X86 /opt:ref -# Begin Special Build Tool -TargetPath=Release\apr_dbd_pgsql-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ELSEIF "$(CFG)" == "apr_dbd_pgsql - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_PGSQL=1 /D "HAVE_LIBPQ_FE_H" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_pgsql_src" /FD /EHsc /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /fo"Debug/apr_dbd_pgsql-1.res" /d DLL_NAME="apr_dbd_pgsql" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libpq.lib /nologo /base:"0x6EF30000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libpq.lib /nologo /base:"0x6EF30000" /subsystem:windows /dll /incremental:no /debug /out:"Debug\apr_dbd_pgsql-1.dll" /pdb:"Debug\apr_dbd_pgsql-1.pdb" /implib:"Debug\apr_dbd_pgsql-1.lib" /MACHINE:X86 -# Begin Special Build Tool -TargetPath=Debug\apr_dbd_pgsql-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ELSEIF "$(CFG)" == "apr_dbd_pgsql - x64 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "x64\Release" -# PROP BASE Intermediate_Dir "x64\Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "x64\Release" -# PROP Intermediate_Dir "x64\Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_PGSQL=1 /D "HAVE_LIBPQ_FE_H" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_pgsql_src" /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /fo"x64/Release/apr_dbd_pgsql-1.res" /d DLL_NAME="apr_dbd_pgsql" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libpq.lib /nologo /base:"0x6EF30000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libpq.lib /nologo /base:"0x6EF30000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Release\apr_dbd_pgsql-1.dll" /pdb:"x64\Release\apr_dbd_pgsql-1.pdb" /implib:"x64\Release\apr_dbd_pgsql-1.lib" /MACHINE:X64 /opt:ref -# Begin Special Build Tool -TargetPath=x64\Release\apr_dbd_pgsql-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ELSEIF "$(CFG)" == "apr_dbd_pgsql - x64 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "x64\Debug" -# PROP BASE Intermediate_Dir "x64\Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "x64\Debug" -# PROP Intermediate_Dir "x64\Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_PGSQL=1 /D "HAVE_LIBPQ_FE_H" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_pgsql_src" /FD /EHsc /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /fo"x64/Debug/apr_dbd_pgsql-1.res" /d DLL_NAME="apr_dbd_pgsql" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libpq.lib /nologo /base:"0x6EF30000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libpq.lib /nologo /base:"0x6EF30000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Debug\apr_dbd_pgsql-1.dll" /pdb:"x64\Debug\apr_dbd_pgsql-1.pdb" /implib:"x64\Debug\apr_dbd_pgsql-1.lib" /MACHINE:X64 -# Begin Special Build Tool -TargetPath=x64\Debug\apr_dbd_pgsql-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ENDIF - -# Begin Target - -# Name "apr_dbd_pgsql - Win32 Release" -# Name "apr_dbd_pgsql - Win32 Debug" -# Name "apr_dbd_pgsql - x64 Release" -# Name "apr_dbd_pgsql - x64 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\apr_dbd_pgsql.c -# End Source File -# End Group -# Begin Group "Public Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\include\apr_dbd.h -# End Source File -# End Group -# Begin Group "Internal Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\include\private\apu_config.h -# End Source File -# Begin Source File - -SOURCE=..\include\private\apu_dbd_internal.h -# End Source File -# Begin Source File - -SOURCE=..\include\private\apu_internal.h -# End Source File -# End Group -# Begin Source File - -SOURCE=..\libaprutil.rc -# End Source File -# End Target -# End Project diff --git a/contrib/apr-util/dbd/apr_dbd_sqlite2.c b/contrib/apr-util/dbd/apr_dbd_sqlite2.c index 132ccc4c65ab..342068c3e6f1 100644 --- a/contrib/apr-util/dbd/apr_dbd_sqlite2.c +++ b/contrib/apr-util/dbd/apr_dbd_sqlite2.c @@ -152,7 +152,7 @@ static int dbd_sqlite_get_row(apr_pool_t * pool, apr_dbd_results_t * res, if (row->n >= res->ntuples) { *rowp = NULL; - apr_pool_cleanup_run(pool, res->res, free_table); + apr_pool_cleanup_run(res->pool, res->res, free_table); res->res = NULL; return -1; } diff --git a/contrib/apr-util/dbd/apr_dbd_sqlite2.dsp b/contrib/apr-util/dbd/apr_dbd_sqlite2.dsp deleted file mode 100644 index 29776067045f..000000000000 --- a/contrib/apr-util/dbd/apr_dbd_sqlite2.dsp +++ /dev/null @@ -1,207 +0,0 @@ -# Microsoft Developer Studio Project File - Name="apr_dbd_sqlite2" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=apr_dbd_sqlite2 - Win32 Release -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "apr_dbd_sqlite2.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "apr_dbd_sqlite2.mak" CFG="apr_dbd_sqlite2 - Win32 Release" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "apr_dbd_sqlite2 - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "apr_dbd_sqlite2 - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "apr_dbd_sqlite2 - x64 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "apr_dbd_sqlite2 - x64 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "apr_dbd_sqlite2 - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_SQLITE2=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_sqlite2_src" /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /fo"Release/apr_dbd_sqlite2-1.res" /d DLL_NAME="apr_dbd_sqlite2" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib sqlite2.lib /nologo /base:"0x6EF10000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib sqlite2.lib /nologo /base:"0x6EF10000" /subsystem:windows /dll /incremental:no /debug /out:"Release\apr_dbd_sqlite2-1.dll" /pdb:"Release\apr_dbd_sqlite2-1.pdb" /implib:"Release\apr_dbd_sqlite2-1.lib" /MACHINE:X86 /opt:ref -# Begin Special Build Tool -TargetPath=Release\apr_dbd_sqlite2-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ELSEIF "$(CFG)" == "apr_dbd_sqlite2 - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_SQLITE2=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_sqlite2_src" /FD /EHsc /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /fo"Debug/apr_dbd_sqlite2-1.res" /d DLL_NAME="apr_dbd_sqlite2" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib sqlite2.lib /nologo /base:"0x6EF10000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib sqlite2.lib /nologo /base:"0x6EF10000" /subsystem:windows /dll /incremental:no /debug /out:"Debug\apr_dbd_sqlite2-1.dll" /pdb:"Debug\apr_dbd_sqlite2-1.pdb" /implib:"Debug\apr_dbd_sqlite2-1.lib" /MACHINE:X86 -# Begin Special Build Tool -TargetPath=Debug\apr_dbd_sqlite2-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ELSEIF "$(CFG)" == "apr_dbd_sqlite2 - x64 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "x64\Release" -# PROP BASE Intermediate_Dir "x64\Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "x64\Release" -# PROP Intermediate_Dir "x64\Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_SQLITE2=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_sqlite2_src" /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /fo"x64/Release/apr_dbd_sqlite2-1.res" /d DLL_NAME="apr_dbd_sqlite2" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib sqlite2.lib /nologo /base:"0x6EF10000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib sqlite2.lib /nologo /base:"0x6EF10000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Release\apr_dbd_sqlite2-1.dll" /pdb:"x64\Release\apr_dbd_sqlite2-1.pdb" /implib:"x64\Release\apr_dbd_sqlite2-1.lib" /MACHINE:X64 /opt:ref -# Begin Special Build Tool -TargetPath=x64\Release\apr_dbd_sqlite2-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ELSEIF "$(CFG)" == "apr_dbd_sqlite2 - x64 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "x64\Debug" -# PROP BASE Intermediate_Dir "x64\Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "x64\Debug" -# PROP Intermediate_Dir "x64\Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_SQLITE2=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_sqlite2_src" /FD /EHsc /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /fo"x64/Debug/apr_dbd_sqlite2-1.res" /d DLL_NAME="apr_dbd_sqlite2" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib sqlite2.lib /nologo /base:"0x6EF10000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib sqlite2.lib /nologo /base:"0x6EF10000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Debug\apr_dbd_sqlite2-1.dll" /pdb:"x64\Debug\apr_dbd_sqlite2-1.pdb" /implib:"x64\Debug\apr_dbd_sqlite2-1.lib" /MACHINE:X64 -# Begin Special Build Tool -TargetPath=x64\Debug\apr_dbd_sqlite2-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ENDIF - -# Begin Target - -# Name "apr_dbd_sqlite2 - Win32 Release" -# Name "apr_dbd_sqlite2 - Win32 Debug" -# Name "apr_dbd_sqlite2 - x64 Release" -# Name "apr_dbd_sqlite2 - x64 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\apr_dbd_sqlite2.c -# End Source File -# End Group -# Begin Group "Public Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\include\apr_dbd.h -# End Source File -# End Group -# Begin Group "Internal Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\include\private\apu_config.h -# End Source File -# Begin Source File - -SOURCE=..\include\private\apu_dbd_internal.h -# End Source File -# Begin Source File - -SOURCE=..\include\private\apu_internal.h -# End Source File -# End Group -# Begin Source File - -SOURCE=..\libaprutil.rc -# End Source File -# End Target -# End Project diff --git a/contrib/apr-util/dbd/apr_dbd_sqlite3.dsp b/contrib/apr-util/dbd/apr_dbd_sqlite3.dsp deleted file mode 100644 index 8b332223ade8..000000000000 --- a/contrib/apr-util/dbd/apr_dbd_sqlite3.dsp +++ /dev/null @@ -1,207 +0,0 @@ -# Microsoft Developer Studio Project File - Name="apr_dbd_sqlite3" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=apr_dbd_sqlite3 - Win32 Release -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "apr_dbd_sqlite3.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "apr_dbd_sqlite3.mak" CFG="apr_dbd_sqlite3 - Win32 Release" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "apr_dbd_sqlite3 - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "apr_dbd_sqlite3 - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "apr_dbd_sqlite3 - x64 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "apr_dbd_sqlite3 - x64 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "apr_dbd_sqlite3 - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_SQLITE3=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_sqlite3_src" /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /fo"Release/apr_dbd_sqlite3-1.res" /d DLL_NAME="apr_dbd_sqlite3" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib sqlite3.lib /nologo /base:"0x6EF20000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib sqlite3.lib /nologo /base:"0x6EF20000" /subsystem:windows /dll /incremental:no /debug /out:"Release\apr_dbd_sqlite3-1.dll" /pdb:"Release\apr_dbd_sqlite3-1.pdb" /implib:"Release\apr_dbd_sqlite3-1.lib" /MACHINE:X86 /opt:ref -# Begin Special Build Tool -TargetPath=Release\apr_dbd_sqlite3-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ELSEIF "$(CFG)" == "apr_dbd_sqlite3 - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_SQLITE3=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_sqlite3_src" /FD /EHsc /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /fo"Debug/apr_dbd_sqlite3-1.res" /d DLL_NAME="apr_dbd_sqlite3" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib sqlite3.lib /nologo /base:"0x6EF20000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib sqlite3.lib /nologo /base:"0x6EF20000" /subsystem:windows /dll /incremental:no /debug /out:"Debug\apr_dbd_sqlite3-1.dll" /pdb:"Debug\apr_dbd_sqlite3-1.pdb" /implib:"Debug\apr_dbd_sqlite3-1.lib" /MACHINE:X86 -# Begin Special Build Tool -TargetPath=Debug\apr_dbd_sqlite3-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ELSEIF "$(CFG)" == "apr_dbd_sqlite3 - x64 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "x64\Release" -# PROP BASE Intermediate_Dir "x64\Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "x64\Release" -# PROP Intermediate_Dir "x64\Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_SQLITE3=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_sqlite3_src" /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /fo"x64/Release/apr_dbd_sqlite3-1.res" /d DLL_NAME="apr_dbd_sqlite3" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib sqlite3.lib /nologo /base:"0x6EF20000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib sqlite3.lib /nologo /base:"0x6EF20000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Release\apr_dbd_sqlite3-1.dll" /pdb:"x64\Release\apr_dbd_sqlite3-1.pdb" /implib:"x64\Release\apr_dbd_sqlite3-1.lib" /MACHINE:X64 /opt:ref -# Begin Special Build Tool -TargetPath=x64\Release\apr_dbd_sqlite3-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ELSEIF "$(CFG)" == "apr_dbd_sqlite3 - x64 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "x64\Debug" -# PROP BASE Intermediate_Dir "x64\Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "x64\Debug" -# PROP Intermediate_Dir "x64\Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_SQLITE3=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbd_sqlite3_src" /FD /EHsc /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /fo"x64/Debug/apr_dbd_sqlite3-1.res" /d DLL_NAME="apr_dbd_sqlite3" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib sqlite3.lib /nologo /base:"0x6EF20000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib sqlite3.lib /nologo /base:"0x6EF20000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Debug\apr_dbd_sqlite3-1.dll" /pdb:"x64\Debug\apr_dbd_sqlite3-1.pdb" /implib:"x64\Debug\apr_dbd_sqlite3-1.lib" /MACHINE:X64 -# Begin Special Build Tool -TargetPath=x64\Debug\apr_dbd_sqlite3-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ENDIF - -# Begin Target - -# Name "apr_dbd_sqlite3 - Win32 Release" -# Name "apr_dbd_sqlite3 - Win32 Debug" -# Name "apr_dbd_sqlite3 - x64 Release" -# Name "apr_dbd_sqlite3 - x64 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\apr_dbd_sqlite3.c -# End Source File -# End Group -# Begin Group "Public Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\include\apr_dbd.h -# End Source File -# End Group -# Begin Group "Internal Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\include\private\apu_config.h -# End Source File -# Begin Source File - -SOURCE=..\include\private\apu_dbd_internal.h -# End Source File -# Begin Source File - -SOURCE=..\include\private\apu_internal.h -# End Source File -# End Group -# Begin Source File - -SOURCE=..\libaprutil.rc -# End Source File -# End Target -# End Project diff --git a/contrib/apr-util/dbm/apr_dbm_db.dsp b/contrib/apr-util/dbm/apr_dbm_db.dsp deleted file mode 100644 index 3bd91e96624f..000000000000 --- a/contrib/apr-util/dbm/apr_dbm_db.dsp +++ /dev/null @@ -1,215 +0,0 @@ -# Microsoft Developer Studio Project File - Name="apr_dbm_db" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=apr_dbm_db - Win32 Release -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "apr_dbm_db.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "apr_dbm_db.mak" CFG="apr_dbm_db - Win32 Release" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "apr_dbm_db - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "apr_dbm_db - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "apr_dbm_db - x64 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "apr_dbm_db - x64 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "apr_dbm_db - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_DB=1 /D APU_HAVE_DB_VERSION=4 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbm_db_src" /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /fo"Release/apr_dbm_db-1.res" /d DLL_NAME="apr_dbm_db" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libdb47.lib /nologo /base:"0x6F000000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libdb47.lib /nologo /base:"0x6F000000" /subsystem:windows /dll /incremental:no /debug /out:"Release\apr_dbm_db-1.dll" /pdb:"Release\apr_dbm_db-1.pdb" /implib:"Release\apr_dbm_db-1.lib" /MACHINE:X86 /opt:ref -# Begin Special Build Tool -TargetPath=Release\apr_dbm_db-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ELSEIF "$(CFG)" == "apr_dbm_db - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_DB=1 /D APU_HAVE_DB_VERSION=4 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbm_db_src" /FD /EHsc /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /fo"Debug/apr_dbm_db-1.res" /d DLL_NAME="apr_dbm_db" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libdb47.lib /nologo /base:"0x6F000000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libdb47.lib /nologo /base:"0x6F000000" /subsystem:windows /dll /incremental:no /debug /out:"Debug\apr_dbm_db-1.dll" /pdb:"Debug\apr_dbm_db-1.pdb" /implib:"Debug\apr_dbm_db-1.lib" /MACHINE:X86 -# Begin Special Build Tool -TargetPath=Debug\apr_dbm_db-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ELSEIF "$(CFG)" == "apr_dbm_db - x64 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "x64\Release" -# PROP BASE Intermediate_Dir "x64\Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "x64\Release" -# PROP Intermediate_Dir "x64\Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_DB=1 /D APU_HAVE_DB_VERSION=4 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbm_db_src" /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /fo"x64/Release/apr_dbm_db-1.res" /d DLL_NAME="apr_dbm_db" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libdb47.lib /nologo /base:"0x6F000000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libdb47.lib /nologo /base:"0x6F000000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Release\apr_dbm_db-1.dll" /pdb:"x64\Release\apr_dbm_db-1.pdb" /implib:"x64\Release\apr_dbm_db-1.lib" /MACHINE:X64 /opt:ref -# Begin Special Build Tool -TargetPath=x64\Release\apr_dbm_db-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ELSEIF "$(CFG)" == "apr_dbm_db - x64 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "x64\Debug" -# PROP BASE Intermediate_Dir "x64\Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "x64\Debug" -# PROP Intermediate_Dir "x64\Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_DB=1 /D APU_HAVE_DB_VERSION=4 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbm_db_src" /FD /EHsc /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /fo"x64/Debug/apr_dbm_db-1.res" /d DLL_NAME="apr_dbm_db" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libdb47.lib /nologo /base:"0x6F000000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libdb47.lib /nologo /base:"0x6F000000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Debug\apr_dbm_db-1.dll" /pdb:"x64\Debug\apr_dbm_db-1.pdb" /implib:"x64\Debug\apr_dbm_db-1.lib" /MACHINE:X64 -# Begin Special Build Tool -TargetPath=x64\Debug\apr_dbm_db-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ENDIF - -# Begin Target - -# Name "apr_dbm_db - Win32 Release" -# Name "apr_dbm_db - Win32 Debug" -# Name "apr_dbm_db - x64 Release" -# Name "apr_dbm_db - x64 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\apr_dbm_berkeleydb.c -# End Source File -# End Group -# Begin Group "Public Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\include\apr_dbm.h -# End Source File -# End Group -# Begin Group "Internal Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\include\private\apu_dbm_private.h -# End Source File -# Begin Source File - -SOURCE=..\include\private\apu_config.h -# End Source File -# Begin Source File - -SOURCE=..\include\private\apu_dbd_internal.h -# End Source File -# Begin Source File - -SOURCE=..\include\private\apu_internal.h -# End Source File -# Begin Source File - -SOURCE=..\include\private\apu_select_dbm.h -# End Source File -# End Group -# Begin Source File - -SOURCE=..\libaprutil.rc -# End Source File -# End Target -# End Project diff --git a/contrib/apr-util/dbm/apr_dbm_gdbm.dsp b/contrib/apr-util/dbm/apr_dbm_gdbm.dsp deleted file mode 100644 index ba6375743851..000000000000 --- a/contrib/apr-util/dbm/apr_dbm_gdbm.dsp +++ /dev/null @@ -1,215 +0,0 @@ -# Microsoft Developer Studio Project File - Name="apr_dbm_gdbm" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=apr_dbm_gdbm - Win32 Release -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "apr_dbm_gdbm.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "apr_dbm_gdbm.mak" CFG="apr_dbm_gdbm - Win32 Release" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "apr_dbm_gdbm - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "apr_dbm_gdbm - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "apr_dbm_gdbm - x64 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "apr_dbm_gdbm - x64 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "apr_dbm_gdbm - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_GDBM=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbm_gdbm_src" /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /fo"Release/apr_dbm_gdbm-1.res" /d DLL_NAME="apr_dbm_gdbm" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libgdbm.lib /nologo /base:"0x6F010000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libgdbm.lib /nologo /base:"0x6F010000" /subsystem:windows /dll /incremental:no /debug /out:"Release\apr_dbm_gdbm-1.dll" /pdb:"Release\apr_dbm_gdbm-1.pdb" /implib:"Release\apr_dbm_gdbm-1.lib" /MACHINE:X86 /opt:ref -# Begin Special Build Tool -TargetPath=Release\apr_dbm_gdbm-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ELSEIF "$(CFG)" == "apr_dbm_gdbm - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_GDBM=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbm_gdbm_src" /FD /EHsc /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /fo"Debug/apr_dbm_gdbm-1.res" /d DLL_NAME="apr_dbm_gdbm" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libgdbm.lib /nologo /base:"0x6F010000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libgdbm.lib /nologo /base:"0x6F010000" /subsystem:windows /dll /incremental:no /debug /out:"Debug\apr_dbm_gdbm-1.dll" /pdb:"Debug\apr_dbm_gdbm-1.pdb" /implib:"Debug\apr_dbm_gdbm-1.lib" /MACHINE:X86 -# Begin Special Build Tool -TargetPath=Debug\apr_dbm_gdbm-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ELSEIF "$(CFG)" == "apr_dbm_gdbm - x64 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "x64\Release" -# PROP BASE Intermediate_Dir "x64\Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "x64\Release" -# PROP Intermediate_Dir "x64\Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_GDBM=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbm_gdbm_src" /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /fo"x64/Release/apr_dbm_gdbm-1.res" /d DLL_NAME="apr_dbm_gdbm" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libgdbm.lib /nologo /base:"0x6F010000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libgdbm.lib /nologo /base:"0x6F010000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Release\apr_dbm_gdbm-1.dll" /pdb:"x64\Release\apr_dbm_gdbm-1.pdb" /implib:"x64\Release\apr_dbm_gdbm-1.lib" /MACHINE:X64 /opt:ref -# Begin Special Build Tool -TargetPath=x64\Release\apr_dbm_gdbm-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ELSEIF "$(CFG)" == "apr_dbm_gdbm - x64 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "x64\Debug" -# PROP BASE Intermediate_Dir "x64\Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "x64\Debug" -# PROP Intermediate_Dir "x64\Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_GDBM=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_dbm_gdbm_src" /FD /EHsc /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /fo"x64/Debug/apr_dbm_gdbm-1.res" /d DLL_NAME="apr_dbm_gdbm" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libgdbm.lib /nologo /base:"0x6F010000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib libgdbm.lib /nologo /base:"0x6F010000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Debug\apr_dbm_gdbm-1.dll" /pdb:"x64\Debug\apr_dbm_gdbm-1.pdb" /implib:"x64\Debug\apr_dbm_gdbm-1.lib" /MACHINE:X64 -# Begin Special Build Tool -TargetPath=x64\Debug\apr_dbm_gdbm-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ENDIF - -# Begin Target - -# Name "apr_dbm_gdbm - Win32 Release" -# Name "apr_dbm_gdbm - Win32 Debug" -# Name "apr_dbm_gdbm - x64 Release" -# Name "apr_dbm_gdbm - x64 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\apr_dbm_gdbm.c -# End Source File -# End Group -# Begin Group "Public Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\include\apr_dbm.h -# End Source File -# End Group -# Begin Group "Internal Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\include\private\apu_dbm_private.h -# End Source File -# Begin Source File - -SOURCE=..\include\private\apu_config.h -# End Source File -# Begin Source File - -SOURCE=..\include\private\apu_dbd_internal.h -# End Source File -# Begin Source File - -SOURCE=..\include\private\apu_internal.h -# End Source File -# Begin Source File - -SOURCE=..\include\private\apu_select_dbm.h -# End Source File -# End Group -# Begin Source File - -SOURCE=..\libaprutil.rc -# End Source File -# End Target -# End Project diff --git a/contrib/apr-util/hooks/apr_hooks.c b/contrib/apr-util/hooks/apr_hooks.c index 6abe1935604b..4cedb3a585be 100644 --- a/contrib/apr-util/hooks/apr_hooks.c +++ b/contrib/apr-util/hooks/apr_hooks.c @@ -30,7 +30,7 @@ #include "apr_want.h" #if 0 -#define apr_palloc(pool,size) malloc(size) +#define apr_palloc(pool,size) malloc(size) #endif APU_DECLARE_DATA apr_pool_t *apr_hook_global_pool = NULL; @@ -84,44 +84,44 @@ static TSort *prepare(apr_pool_t *p,TSortData *pItems,int nItems) { TSort *pData=apr_palloc(p,nItems*sizeof *pData); int n; - + qsort(pItems,nItems,sizeof *pItems,crude_order); for(n=0 ; n < nItems ; ++n) { - pData[n].nPredecessors=0; - pData[n].ppPredecessors=apr_pcalloc(p,nItems*sizeof *pData[n].ppPredecessors); - pData[n].pNext=NULL; - pData[n].pData=&pItems[n]; + pData[n].nPredecessors=0; + pData[n].ppPredecessors=apr_pcalloc(p,nItems*sizeof *pData[n].ppPredecessors); + pData[n].pNext=NULL; + pData[n].pData=&pItems[n]; } for(n=0 ; n < nItems ; ++n) { - int i,k; + int i,k; - for(i=0 ; pItems[n].aszPredecessors && pItems[n].aszPredecessors[i] ; ++i) - for(k=0 ; k < nItems ; ++k) - if(!strcmp(pItems[k].szName,pItems[n].aszPredecessors[i])) { - int l; + for(i=0 ; pItems[n].aszPredecessors && pItems[n].aszPredecessors[i] ; ++i) + for(k=0 ; k < nItems ; ++k) + if(!strcmp(pItems[k].szName,pItems[n].aszPredecessors[i])) { + int l; - for(l=0 ; l < pData[n].nPredecessors ; ++l) - if(pData[n].ppPredecessors[l] == &pData[k]) - goto got_it; - pData[n].ppPredecessors[pData[n].nPredecessors]=&pData[k]; - ++pData[n].nPredecessors; - got_it: - break; - } - for(i=0 ; pItems[n].aszSuccessors && pItems[n].aszSuccessors[i] ; ++i) - for(k=0 ; k < nItems ; ++k) - if(!strcmp(pItems[k].szName,pItems[n].aszSuccessors[i])) { - int l; + for(l=0 ; l < pData[n].nPredecessors ; ++l) + if(pData[n].ppPredecessors[l] == &pData[k]) + goto got_it; + pData[n].ppPredecessors[pData[n].nPredecessors]=&pData[k]; + ++pData[n].nPredecessors; + got_it: + break; + } + for(i=0 ; pItems[n].aszSuccessors && pItems[n].aszSuccessors[i] ; ++i) + for(k=0 ; k < nItems ; ++k) + if(!strcmp(pItems[k].szName,pItems[n].aszSuccessors[i])) { + int l; - for(l=0 ; l < pData[k].nPredecessors ; ++l) - if(pData[k].ppPredecessors[l] == &pData[n]) - goto got_it2; - pData[k].ppPredecessors[pData[k].nPredecessors]=&pData[n]; - ++pData[k].nPredecessors; - got_it2: - break; - } + for(l=0 ; l < pData[k].nPredecessors ; ++l) + if(pData[k].ppPredecessors[l] == &pData[n]) + goto got_it2; + pData[k].ppPredecessors[pData[k].nPredecessors]=&pData[n]; + ++pData[k].nPredecessors; + got_it2: + break; + } } return pData; @@ -143,49 +143,49 @@ static TSort *tsort(TSort *pData,int nItems) TSort *pTail=NULL; for(nTotal=0 ; nTotal < nItems ; ++nTotal) { - int n,i,k; + int n,i,k; - for(n=0 ; ; ++n) { - if(n == nItems) - assert(0); /* we have a loop... */ - if(!pData[n].pNext) { - if(pData[n].nPredecessors) { - for(k=0 ; ; ++k) { - assert(k < nItems); - if(pData[n].ppPredecessors[k]) - break; - } - for(i=0 ; ; ++i) { - assert(i < nItems); - if(&pData[i] == pData[n].ppPredecessors[k]) { - n=i-1; - break; - } - } - } else - break; - } - } - if(pTail) - pTail->pNext=&pData[n]; - else - pHead=&pData[n]; - pTail=&pData[n]; - pTail->pNext=pTail; /* fudge it so it looks linked */ - for(i=0 ; i < nItems ; ++i) - for(k=0 ; k < nItems ; ++k) - if(pData[i].ppPredecessors[k] == &pData[n]) { - --pData[i].nPredecessors; - pData[i].ppPredecessors[k]=NULL; - break; - } + for(n=0 ; ; ++n) { + if(n == nItems) + assert(0); /* we have a loop... */ + if(!pData[n].pNext) { + if(pData[n].nPredecessors) { + for(k=0 ; ; ++k) { + assert(k < nItems); + if(pData[n].ppPredecessors[k]) + break; + } + for(i=0 ; ; ++i) { + assert(i < nItems); + if(&pData[i] == pData[n].ppPredecessors[k]) { + n=i-1; + break; + } + } + } else + break; + } + } + if(pTail) + pTail->pNext=&pData[n]; + else + pHead=&pData[n]; + pTail=&pData[n]; + pTail->pNext=pTail; /* fudge it so it looks linked */ + for(i=0 ; i < nItems ; ++i) + for(k=0 ; k < nItems ; ++k) + if(pData[i].ppPredecessors[k] == &pData[n]) { + --pData[i].nPredecessors; + pData[i].ppPredecessors[k]=NULL; + break; + } } pTail->pNext=NULL; /* unfudge the tail */ return pHead; } static apr_array_header_t *sort_hook(apr_array_header_t *pHooks, - const char *szName) + const char *szName) { apr_pool_t *p; TSort *pSort; @@ -197,17 +197,21 @@ static apr_array_header_t *sort_hook(apr_array_header_t *pHooks, pSort=tsort(pSort,pHooks->nelts); pNew=apr_array_make(apr_hook_global_pool,pHooks->nelts,sizeof(TSortData)); if(apr_hook_debug_enabled) - printf("Sorting %s:",szName); + printf("Sorting %s:",szName); for(n=0 ; pSort ; pSort=pSort->pNext,++n) { - TSortData *pHook; - assert(n < pHooks->nelts); - pHook=apr_array_push(pNew); - memcpy(pHook,pSort->pData,sizeof *pHook); - if(apr_hook_debug_enabled) - printf(" %s",pHook->szName); + TSortData *pHook; + assert(n < pHooks->nelts); + pHook=apr_array_push(pNew); + memcpy(pHook,pSort->pData,sizeof *pHook); + if(apr_hook_debug_enabled) + printf(" %s",pHook->szName); } if(apr_hook_debug_enabled) - fputc('\n',stdout); + fputc('\n',stdout); + + /* destroy the pool - the sorted hooks were already copied */ + apr_pool_destroy(p); + return pNew; } @@ -222,7 +226,7 @@ typedef struct } HookSortEntry; APU_DECLARE(void) apr_hook_sort_register(const char *szHookName, - apr_array_header_t **paHooks) + apr_array_header_t **paHooks) { #ifdef NETWARE get_apd @@ -246,10 +250,10 @@ APU_DECLARE(void) apr_hook_sort_all(void) if (!s_aHooksToSort) { s_aHooksToSort = apr_array_make(apr_hook_global_pool, 1, sizeof(HookSortEntry)); } - + for(n=0 ; n < s_aHooksToSort->nelts ; ++n) { - HookSortEntry *pEntry=&((HookSortEntry *)s_aHooksToSort->elts)[n]; - *pEntry->paHooks=sort_hook(*pEntry->paHooks,pEntry->szHookName); + HookSortEntry *pEntry=&((HookSortEntry *)s_aHooksToSort->elts)[n]; + *pEntry->paHooks=sort_hook(*pEntry->paHooks,pEntry->szHookName); } } @@ -263,7 +267,7 @@ APU_DECLARE(void) apr_hook_deregister_all(void) #ifdef NETWARE get_apd #endif - int n; + int n; if (!s_aHooksToSort) { return; @@ -280,34 +284,34 @@ APU_DECLARE(void) apr_hook_deregister_all(void) APU_DECLARE(void) apr_hook_debug_show(const char *szName, const char * const *aszPre, - const char * const *aszSucc) + const char * const *aszSucc) { int nFirst; printf(" Hooked %s",szName); if(aszPre) { - fputs(" pre(",stdout); - nFirst=1; - while(*aszPre) { - if(!nFirst) - fputc(',',stdout); - nFirst=0; - fputs(*aszPre,stdout); - ++aszPre; - } - fputc(')',stdout); + fputs(" pre(",stdout); + nFirst=1; + while(*aszPre) { + if(!nFirst) + fputc(',',stdout); + nFirst=0; + fputs(*aszPre,stdout); + ++aszPre; + } + fputc(')',stdout); } if(aszSucc) { - fputs(" succ(",stdout); - nFirst=1; - while(*aszSucc) { - if(!nFirst) - fputc(',',stdout); - nFirst=0; - fputs(*aszSucc,stdout); - ++aszSucc; - } - fputc(')',stdout); + fputs(" succ(",stdout); + nFirst=1; + while(*aszSucc) { + if(!nFirst) + fputc(',',stdout); + nFirst=0; + fputs(*aszSucc,stdout); + ++aszSucc; + } + fputc(')',stdout); } fputc('\n',stdout); } @@ -324,16 +328,16 @@ APU_DECLARE(apr_array_header_t *) apr_optional_hook_get(const char *szName) apr_array_header_t **ppArray; if(!s_phOptionalHooks) - return NULL; + return NULL; ppArray=apr_hash_get(s_phOptionalHooks,szName,strlen(szName)); if(!ppArray) - return NULL; + return NULL; return *ppArray; } APU_DECLARE(void) apr_optional_hook_add(const char *szName,void (*pfn)(void), - const char * const *aszPre, - const char * const *aszSucc,int nOrder) + const char * const *aszPre, + const char * const *aszSucc,int nOrder) { #ifdef NETWARE get_apd @@ -342,16 +346,16 @@ APU_DECLARE(void) apr_optional_hook_add(const char *szName,void (*pfn)(void), apr_LINK__optional_t *pHook; if(!pArray) { - apr_array_header_t **ppArray; + apr_array_header_t **ppArray; - pArray=apr_array_make(apr_hook_global_pool,1, - sizeof(apr_LINK__optional_t)); - if(!s_phOptionalHooks) - s_phOptionalHooks=apr_hash_make(apr_hook_global_pool); - ppArray=apr_palloc(apr_hook_global_pool,sizeof *ppArray); - *ppArray=pArray; - apr_hash_set(s_phOptionalHooks,szName,strlen(szName),ppArray); - apr_hook_sort_register(szName,ppArray); + pArray=apr_array_make(apr_hook_global_pool,1, + sizeof(apr_LINK__optional_t)); + if(!s_phOptionalHooks) + s_phOptionalHooks=apr_hash_make(apr_hook_global_pool); + ppArray=apr_palloc(apr_hook_global_pool,sizeof *ppArray); + *ppArray=pArray; + apr_hash_set(s_phOptionalHooks,szName,strlen(szName),ppArray); + apr_hook_sort_register(szName,ppArray); } pHook=apr_array_push(pArray); pHook->pFunc=pfn; @@ -360,7 +364,7 @@ APU_DECLARE(void) apr_optional_hook_add(const char *szName,void (*pfn)(void), pHook->nOrder=nOrder; pHook->szName=apr_hook_debug_current; if(apr_hook_debug_enabled) - apr_hook_debug_show(szName,aszPre,aszSucc); + apr_hook_debug_show(szName,aszPre,aszSucc); } /* optional function support */ @@ -371,7 +375,7 @@ APU_DECLARE(apr_opt_fn_t *) apr_dynamic_fn_retrieve(const char *szName) get_apd #endif if(!s_phOptionalFunctions) - return NULL; + return NULL; return (void(*)(void))apr_hash_get(s_phOptionalFunctions,szName,strlen(szName)); } @@ -383,7 +387,7 @@ APU_DECLARE_NONSTD(void) apr_dynamic_fn_register(const char *szName, get_apd #endif if(!s_phOptionalFunctions) - s_phOptionalFunctions=apr_hash_make(apr_hook_global_pool); + s_phOptionalFunctions=apr_hash_make(apr_hook_global_pool); apr_hash_set(s_phOptionalFunctions,szName,strlen(szName),(void *)pfn); } @@ -395,9 +399,9 @@ void main() const char *aszCPost[]={"b",NULL}; TSortData t1[]= { - { "a",aszAPre,NULL }, - { "b",NULL,aszBPost }, - { "c",NULL,aszCPost } + { "a",aszAPre,NULL }, + { "b",NULL,aszBPost }, + { "c",NULL,aszCPost } }; TSort *pResult; @@ -405,6 +409,6 @@ void main() pResult=tsort(pResult,3); for( ; pResult ; pResult=pResult->pNext) - printf("%s\n",pResult->pData->szName); + printf("%s\n",pResult->pData->szName); } #endif diff --git a/contrib/apr-util/include/apr_base64.h b/contrib/apr-util/include/apr_base64.h index b4b2b88fe462..17de1c58db86 100644 --- a/contrib/apr-util/include/apr_base64.h +++ b/contrib/apr-util/include/apr_base64.h @@ -51,10 +51,11 @@ extern "C" { */ /** - * Given the length of an un-encrypted string, get the length of the - * encrypted string. - * @param len the length of an unencrypted string. - * @return the length of the string after it is encrypted + * Given the length of an un-encoded string, get the length of the + * encoded string. + * @param len the length of an unencoded string. + * @return the length of the string after it is encoded, including the + * trailing \0 */ APU_DECLARE(int) apr_base64_encode_len(int len); diff --git a/contrib/apr-util/include/apr_buckets.h b/contrib/apr-util/include/apr_buckets.h index b1d186137da1..4838ab28d972 100644 --- a/contrib/apr-util/include/apr_buckets.h +++ b/contrib/apr-util/include/apr_buckets.h @@ -687,9 +687,10 @@ APU_DECLARE(apr_status_t) apr_brigade_cleanup(void *data); * @param b The brigade to split * @param e The first bucket to move * @param a The brigade which should be used for the result or NULL if - * a new brigade should be created. - * @return The brigade supplied in @param a or a new one if @param a was NULL. - * @warning Note that this function allocates a new brigade if @param a is + * a new brigade should be created. The brigade @a a will be + * cleared if it is not empty. + * @return The brigade supplied in @a a or a new one if @a a was NULL. + * @warning Note that this function allocates a new brigade if @a a is * NULL so memory consumption should be carefully considered. */ APU_DECLARE(apr_bucket_brigade *) apr_brigade_split_ex(apr_bucket_brigade *b, @@ -699,8 +700,8 @@ APU_DECLARE(apr_bucket_brigade *) apr_brigade_split_ex(apr_bucket_brigade *b, /** * Create a new bucket brigade and move the buckets from the tail end * of an existing brigade into the new brigade. Buckets from - * @param e to the last bucket (inclusively) of brigade @param b - * are moved from @param b to the returned brigade. + * @a e to the last bucket (inclusively) of brigade @a b + * are moved from @a b to the returned brigade. * @param b The brigade to split * @param e The first bucket to move * @return The new brigade diff --git a/contrib/apr-util/include/apr_md5.h b/contrib/apr-util/include/apr_md5.h index 367324a761e9..e0202dfdf9ff 100644 --- a/contrib/apr-util/include/apr_md5.h +++ b/contrib/apr-util/include/apr_md5.h @@ -132,16 +132,30 @@ APU_DECLARE(apr_status_t) apr_md5(unsigned char digest[APR_MD5_DIGESTSIZE], /** * Encode a password using an MD5 algorithm * @param password The password to encode - * @param salt The salt to use for the encoding + * @param salt The salt string to use for the encoding * @param result The string to store the encoded password in * @param nbytes The size of the result buffer */ APU_DECLARE(apr_status_t) apr_md5_encode(const char *password, const char *salt, char *result, apr_size_t nbytes); +/** + * Encode a password using the bcrypt algorithm + * @param password The password to encode + * @param count The cost of the encoding, possible values are 4 to 31 + * @param salt Pointer to binary data to be used as salt for the encoding + * @param salt_len The size of the salt data (must be >= 16) + * @param out The string to store the encoded password in + * @param out_len The size of the result buffer (must be >= 61) + */ +APU_DECLARE(apr_status_t) apr_bcrypt_encode(const char *pw, + unsigned int count, + const unsigned char *salt, + apr_size_t salt_len, + char *out, apr_size_t out_len); /** - * Validate hashes created by APR-supported algorithms: md5 and sha1. + * Validate hashes created by APR-supported algorithms: md5, bcrypt, and sha1. * hashes created by crypt are supported only on platforms that provide * crypt(3), so don't rely on that function unless you know that your * application will be run only on platforms that support it. On platforms diff --git a/contrib/apr-util/include/apr_queue.h b/contrib/apr-util/include/apr_queue.h index bf5df74d92e1..20c425db38ff 100644 --- a/contrib/apr-util/include/apr_queue.h +++ b/contrib/apr-util/include/apr_queue.h @@ -98,7 +98,7 @@ APU_DECLARE(apr_status_t) apr_queue_trypush(apr_queue_t *queue, void *data); * @returns APR_EINTR the blocking operation was interrupted (try again) * @returns APR_EAGAIN the queue is empty * @returns APR_EOF the queue has been terminated - * @returns APR_SUCCESS on a successful push + * @returns APR_SUCCESS on a successful pop */ APU_DECLARE(apr_status_t) apr_queue_trypop(apr_queue_t *queue, void **data); diff --git a/contrib/apr-util/include/apu.h.in b/contrib/apr-util/include/apu.h.in index 4037094da847..82380cc21bd5 100644 --- a/contrib/apr-util/include/apu.h.in +++ b/contrib/apr-util/include/apu.h.in @@ -42,6 +42,7 @@ * conventions at compile time. */ +#if defined(DOXYGEN) || !defined(WIN32) /** * The public APR-UTIL functions are declared with APU_DECLARE(), so they may * use the most appropriate calling convention. Public APR functions with @@ -66,6 +67,19 @@ * declarations within headers to properly import the variable. */ #define APU_DECLARE_DATA +#elif defined(APU_DECLARE_STATIC) +#define APU_DECLARE(type) type __stdcall +#define APU_DECLARE_NONSTD(type) type __cdecl +#define APU_DECLARE_DATA +#elif defined(APU_DECLARE_EXPORT) +#define APU_DECLARE(type) __declspec(dllexport) type __stdcall +#define APU_DECLARE_NONSTD(type) __declspec(dllexport) type __cdecl +#define APU_DECLARE_DATA __declspec(dllexport) +#else +#define APU_DECLARE(type) __declspec(dllimport) type __stdcall +#define APU_DECLARE_NONSTD(type) __declspec(dllimport) type __cdecl +#define APU_DECLARE_DATA __declspec(dllimport) +#endif #if !defined(WIN32) || defined(APU_MODULE_DECLARE_STATIC) /** diff --git a/contrib/apr-util/include/apu_version.h b/contrib/apr-util/include/apu_version.h index 3f263fe934b9..7435084f3288 100644 --- a/contrib/apr-util/include/apu_version.h +++ b/contrib/apr-util/include/apu_version.h @@ -53,13 +53,13 @@ * Minor API changes that do not cause binary compatibility problems. * Reset to 0 when upgrading APU_MAJOR_VERSION */ -#define APU_MINOR_VERSION 4 +#define APU_MINOR_VERSION 5 /** patch level * The Patch Level never includes API changes, simply bug fixes. * Reset to 0 when upgrading APR_MINOR_VERSION */ -#define APU_PATCH_VERSION 1 +#define APU_PATCH_VERSION 2 /** * The symbol APU_IS_DEV_VERSION is only defined for internal, diff --git a/contrib/apr-util/include/private/apr_crypto_internal.h b/contrib/apr-util/include/private/apr_crypto_internal.h index b571451a23c8..5da92e558879 100644 --- a/contrib/apr-util/include/private/apr_crypto_internal.h +++ b/contrib/apr-util/include/private/apr_crypto_internal.h @@ -39,7 +39,8 @@ struct apr_crypto_driver_t { * @param params Optional init parameter string. * @param rc Driver-specific additional error code */ - apr_status_t (*init)(apr_pool_t *pool, const char *params, int *rc); + apr_status_t (*init)(apr_pool_t *pool, const char *params, + const apu_err_t **result); /** * @brief Create a context for supporting encryption. Keys, certificates, diff --git a/contrib/apr-util/ldap/apr_ldap.dsp b/contrib/apr-util/ldap/apr_ldap.dsp deleted file mode 100644 index 095e3af5aafc..000000000000 --- a/contrib/apr-util/ldap/apr_ldap.dsp +++ /dev/null @@ -1,227 +0,0 @@ -# Microsoft Developer Studio Project File - Name="apr_ldap" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=apr_ldap - Win32 Release -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "apr_ldap.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "apr_ldap.mak" CFG="apr_ldap - Win32 Release" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "apr_ldap - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "apr_ldap - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "apr_ldap - x64 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "apr_ldap - x64 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "apr_ldap - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_ldap_src" /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /fo"Release/apr_ldap-1.res" /d DLL_NAME="apr_ldap" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib wldap32.lib ole32.lib /nologo /base:"0x6EEB0000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib wldap32.lib ole32.lib /nologo /base:"0x6EEB0000" /subsystem:windows /dll /incremental:no /debug /out:"Release\apr_ldap-1.dll" /pdb:"Release\apr_ldap-1.pdb" /implib:"Release\apr_ldap-1.lib" /MACHINE:X86 /opt:ref -# Begin Special Build Tool -TargetPath=Release\apr_ldap-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ELSEIF "$(CFG)" == "apr_ldap - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_ldap_src" /FD /EHsc /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /fo"Debug/apr_ldap-1.res" /d DLL_NAME="apr_ldap" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib wldap32.lib ole32.lib /nologo /base:"0x6EEB0000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib wldap32.lib ole32.lib /nologo /base:"0x6EEB0000" /subsystem:windows /dll /incremental:no /debug /out:"Debug\apr_ldap-1.dll" /pdb:"Debug\apr_ldap-1.pdb" /implib:"Debug\apr_ldap-1.lib" /MACHINE:X86 -# Begin Special Build Tool -TargetPath=Debug\apr_ldap-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ELSEIF "$(CFG)" == "apr_ldap - x64 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "x64\Release" -# PROP BASE Intermediate_Dir "x64\Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "x64\Release" -# PROP Intermediate_Dir "x64\Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_ldap_src" /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /fo"x64/Release/apr_ldap-1.res" /d DLL_NAME="apr_ldap" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib wldap32.lib ole32.lib /nologo /base:"0x6EEB0000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib wldap32.lib ole32.lib /nologo /base:"0x6EEB0000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Release\apr_ldap-1.dll" /pdb:"x64\Release\apr_ldap-1.pdb" /implib:"x64\Release\apr_ldap-1.lib" /MACHINE:X64 /opt:ref -# Begin Special Build Tool -TargetPath=x64\Release\apr_ldap-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ELSEIF "$(CFG)" == "apr_ldap - x64 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "x64\Debug" -# PROP BASE Intermediate_Dir "x64\Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "x64\Debug" -# PROP Intermediate_Dir "x64\Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_ldap_src" /FD /EHsc /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /fo"x64/Debug/apr_ldap-1.res" /d DLL_NAME="apr_ldap" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib wldap32.lib ole32.lib /nologo /base:"0x6EEB0000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib wldap32.lib ole32.lib /nologo /base:"0x6EEB0000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Debug\apr_ldap-1.dll" /pdb:"x64\Debug\apr_ldap-1.pdb" /implib:"x64\Debug\apr_ldap-1.lib" /MACHINE:X64 -# Begin Special Build Tool -TargetPath=x64\Debug\apr_ldap-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ENDIF - -# Begin Target - -# Name "apr_ldap - Win32 Release" -# Name "apr_ldap - Win32 Debug" -# Name "apr_ldap - x64 Release" -# Name "apr_ldap - x64 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\apr_ldap_init.c -# End Source File -# Begin Source File - -SOURCE=.\apr_ldap_option.c -# End Source File -# Begin Source File - -SOURCE=.\apr_ldap_rebind.c -# End Source File -# End Group -# Begin Group "Public Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\include\apr_ldap.h -# End Source File -# Begin Source File - -SOURCE=..\include\apr_ldap_init.h -# End Source File -# Begin Source File - -SOURCE=..\include\apr_ldap_option.h -# End Source File -# Begin Source File - -SOURCE=..\include\apr_ldap_rebind.h -# End Source File -# Begin Source File - -SOURCE=..\include\apr_ldap_url.h -# End Source File -# End Group -# Begin Group "Internal Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\include\private\apu_config.h -# End Source File -# Begin Source File - -SOURCE=..\include\private\apu_internal.h -# End Source File -# End Group -# Begin Source File - -SOURCE=..\libaprutil.rc -# End Source File -# End Target -# End Project diff --git a/contrib/apr-util/libaprutil.dsp b/contrib/apr-util/libaprutil.dsp deleted file mode 100644 index fc7b151ac7a7..000000000000 --- a/contrib/apr-util/libaprutil.dsp +++ /dev/null @@ -1,845 +0,0 @@ -# Microsoft Developer Studio Project File - Name="libaprutil" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=libaprutil - Win32 Release -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "libaprutil.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "libaprutil.mak" CFG="libaprutil - Win32 Release" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "libaprutil - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "libaprutil - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "libaprutil - x64 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "libaprutil - x64 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "libaprutil - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "../apr/include" /I "./include/private" /I "../apr-iconv/include" /I "./dbm/sdbm" /I "./xml/expat/lib" /D "NDEBUG" /D "APU_DECLARE_EXPORT" /D "APU_USE_SDBM" /D "XML_STATIC" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\libaprutil_src" /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" /d "APU_VERSION_ONLY" /I "./include" /I "../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE60000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE60000" /subsystem:windows /dll /incremental:no /debug /out:"Release\libaprutil-1.dll" /pdb:"Release\libaprutil-1.pdb" /implib:"Release\libaprutil-1.lib" /MACHINE:X86 /opt:ref -# Begin Special Build Tool -TargetPath=Release\libaprutil-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ELSEIF "$(CFG)" == "libaprutil - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "../apr/include" /I "./include/private" /I "../apr-iconv/include" /I "./dbm/sdbm" /I "./xml/expat/lib" /D "_DEBUG" /D "APU_DECLARE_EXPORT" /D "APU_USE_SDBM" /D "XML_STATIC" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\libaprutil_src" /FD /EHsc /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" /d "APU_VERSION_ONLY" /I "./include" /I "../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE60000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE60000" /subsystem:windows /dll /incremental:no /debug /out:"Debug\libaprutil-1.dll" /pdb:"Debug\libaprutil-1.pdb" /implib:"Debug\libaprutil-1.lib" /MACHINE:X86 -# Begin Special Build Tool -TargetPath=Debug\libaprutil-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ELSEIF "$(CFG)" == "libaprutil - x64 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "x64\Release" -# PROP BASE Intermediate_Dir "x64\Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "x64\Release" -# PROP Intermediate_Dir "x64\Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "../apr/include" /I "./include/private" /I "../apr-iconv/include" /I "./dbm/sdbm" /I "./xml/expat/lib" /D "NDEBUG" /D "APU_DECLARE_EXPORT" /D "APU_USE_SDBM" /D "XML_STATIC" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\libaprutil_src" /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" /d "APU_VERSION_ONLY" /I "./include" /I "../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE60000" /subsystem:windows /dll /incremental:no /debug /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE60000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Release\libaprutil-1.dll" /pdb:"x64\Release\libaprutil-1.pdb" /implib:"x64\Release\libaprutil-1.lib" /MACHINE:X64 /opt:ref -# Begin Special Build Tool -TargetPath=x64\Release\libaprutil-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ELSEIF "$(CFG)" == "libaprutil - x64 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "x64\Debug" -# PROP BASE Intermediate_Dir "x64\Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "x64\Debug" -# PROP Intermediate_Dir "x64\Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c -# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "../apr/include" /I "./include/private" /I "../apr-iconv/include" /I "./dbm/sdbm" /I "./xml/expat/lib" /D "_DEBUG" /D "APU_DECLARE_EXPORT" /D "APU_USE_SDBM" /D "XML_STATIC" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\libaprutil_src" /FD /EHsc /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" /d "APU_VERSION_ONLY" /I "./include" /I "../apr/include" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE60000" /subsystem:windows /dll /incremental:no /debug -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE60000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Debug\libaprutil-1.dll" /pdb:"x64\Debug\libaprutil-1.pdb" /implib:"x64\Debug\libaprutil-1.lib" /MACHINE:X64 -# Begin Special Build Tool -TargetPath=x64\Debug\libaprutil-1.dll -SOURCE="$(InputPath)" -PostBuild_Desc=Embed .manifest -PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2 -# End Special Build Tool - -!ENDIF - -# Begin Target - -# Name "libaprutil - Win32 Release" -# Name "libaprutil - Win32 Debug" -# Name "libaprutil - x64 Release" -# Name "libaprutil - x64 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "" -# Begin Group "buckets" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\buckets\apr_brigade.c -# End Source File -# Begin Source File - -SOURCE=.\buckets\apr_buckets.c -# End Source File -# Begin Source File - -SOURCE=.\buckets\apr_buckets_alloc.c -# End Source File -# Begin Source File - -SOURCE=.\buckets\apr_buckets_eos.c -# End Source File -# Begin Source File - -SOURCE=.\buckets\apr_buckets_file.c -# End Source File -# Begin Source File - -SOURCE=.\buckets\apr_buckets_flush.c -# End Source File -# Begin Source File - -SOURCE=.\buckets\apr_buckets_heap.c -# End Source File -# Begin Source File - -SOURCE=.\buckets\apr_buckets_mmap.c -# End Source File -# Begin Source File - -SOURCE=.\buckets\apr_buckets_pipe.c -# End Source File -# Begin Source File - -SOURCE=.\buckets\apr_buckets_pool.c -# End Source File -# Begin Source File - -SOURCE=.\buckets\apr_buckets_refcount.c -# End Source File -# Begin Source File - -SOURCE=.\buckets\apr_buckets_simple.c -# End Source File -# Begin Source File - -SOURCE=.\buckets\apr_buckets_socket.c -# End Source File -# End Group -# Begin Group "crypto" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\crypto\apr_crypto.c -# End Source File -# Begin Source File - -SOURCE=.\crypto\apr_md4.c -# End Source File -# Begin Source File - -SOURCE=.\crypto\apr_md5.c -# End Source File -# Begin Source File - -SOURCE=.\crypto\apr_sha1.c -# End Source File -# Begin Source File - -SOURCE=.\crypto\getuuid.c -# End Source File -# Begin Source File - -SOURCE=.\crypto\uuid.c -# End Source File -# End Group -# Begin Group "dbd" -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\dbd\apr_dbd.c -# End Source File -# Begin Source File - -SOURCE=.\dbd\apr_dbd_freetds.c -# PROP Exclude_From_Build 1 -# End Source File -# Begin Source File - -SOURCE=.\dbd\apr_dbd_mysql.c -# PROP Exclude_From_Build 1 -# End Source File -# Begin Source File - -SOURCE=.\dbd\apr_dbd_odbc.c -# PROP Exclude_From_Build 1 -# End Source File -# Begin Source File - -SOURCE=.\dbd\apr_dbd_oracle.c -# PROP Exclude_From_Build 1 -# End Source File -# Begin Source File - -SOURCE=.\dbd\apr_dbd_pgsql.c -# PROP Exclude_From_Build 1 -# End Source File -# Begin Source File - -SOURCE=.\dbd\apr_dbd_sqlite2.c -# PROP Exclude_From_Build 1 -# End Source File -# Begin Source File - -SOURCE=.\dbd\apr_dbd_sqlite3.c -# PROP Exclude_From_Build 1 -# End Source File -# End Group -# Begin Group "dbm" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\dbm\apr_dbm.c -# End Source File -# Begin Source File - -SOURCE=.\dbm\apr_dbm_berkeleydb.c -# PROP Exclude_From_Build 1 -# End Source File -# Begin Source File - -SOURCE=.\dbm\apr_dbm_gdbm.c -# PROP Exclude_From_Build 1 -# End Source File -# Begin Source File - -SOURCE=.\dbm\apr_dbm_sdbm.c -# End Source File -# End Group -# Begin Group "encoding" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\encoding\apr_base64.c -# End Source File -# End Group -# Begin Group "hooks" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\hooks\apr_hooks.c -# End Source File -# End Group -# Begin Group "ldap" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\ldap\apr_ldap_init.c -# PROP Exclude_From_Build 1 -# End Source File -# Begin Source File - -SOURCE=.\ldap\apr_ldap_option.c -# PROP Exclude_From_Build 1 -# End Source File -# Begin Source File - -SOURCE=.\ldap\apr_ldap_rebind.c -# PROP Exclude_From_Build 1 -# End Source File -# Begin Source File - -SOURCE=.\ldap\apr_ldap_stub.c -# End Source File -# Begin Source File - -SOURCE=.\ldap\apr_ldap_url.c -# End Source File -# End Group -# Begin Group "memcache" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\memcache\apr_memcache.c -# End Source File -# End Group -# Begin Group "misc" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\misc\apr_date.c -# End Source File -# Begin Source File - -SOURCE=.\misc\apu_dso.c -# End Source File -# Begin Source File - -SOURCE=.\misc\apr_queue.c -# End Source File -# Begin Source File - -SOURCE=.\misc\apr_reslist.c -# End Source File -# Begin Source File - -SOURCE=.\misc\apr_rmm.c -# End Source File -# Begin Source File - -SOURCE=.\misc\apr_thread_pool.c -# End Source File -# Begin Source File - -SOURCE=.\misc\apu_version.c -# End Source File -# End Group -# Begin Group "sdbm" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\dbm\sdbm\sdbm.c -# End Source File -# Begin Source File - -SOURCE=.\dbm\sdbm\sdbm_hash.c -# End Source File -# Begin Source File - -SOURCE=.\dbm\sdbm\sdbm_lock.c -# End Source File -# Begin Source File - -SOURCE=.\dbm\sdbm\sdbm_pair.c -# End Source File -# Begin Source File - -SOURCE=.\dbm\sdbm\sdbm_pair.h -# End Source File -# Begin Source File - -SOURCE=.\dbm\sdbm\sdbm_private.h -# End Source File -# Begin Source File - -SOURCE=.\dbm\sdbm\sdbm_tune.h -# End Source File -# End Group -# Begin Group "strmatch" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\strmatch\apr_strmatch.c -# End Source File -# End Group -# Begin Group "uri" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\uri\apr_uri.c -# End Source File -# End Group -# Begin Group "xlate" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\xlate\xlate.c -# End Source File -# End Group -# Begin Group "xml" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\xml\apr_xml.c -# End Source File -# End Group -# End Group -# Begin Group "Generated Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\include\apr_ldap.h.in -# End Source File -# Begin Source File - -SOURCE=.\include\apr_ldap.hnw -# End Source File -# Begin Source File - -SOURCE=.\include\apr_ldap.hw - -!IF "$(CFG)" == "libaprutil - Win32 Release" - -# Begin Custom Build - Creating apr_ldap.h from apr_ldap.hw -InputPath=.\include\apr_ldap.hw - -".\include\apr_ldap.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apr_ldap.hw > .\include\apr_ldap.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "libaprutil - Win32 Debug" - -# Begin Custom Build - Creating apr_ldap.h from apr_ldap.hw -InputPath=.\include\apr_ldap.hw - -".\include\apr_ldap.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apr_ldap.hw > .\include\apr_ldap.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "libaprutil - x64 Release" - -# Begin Custom Build - Creating apr_ldap.h from apr_ldap.hw -InputPath=.\include\apr_ldap.hw - -".\include\apr_ldap.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apr_ldap.hw > .\include\apr_ldap.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "libaprutil - x64 Debug" - -# Begin Custom Build - Creating apr_ldap.h from apr_ldap.hw -InputPath=.\include\apr_ldap.hw - -".\include\apr_ldap.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apr_ldap.hw > .\include\apr_ldap.h - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\include\apu.h.in -# End Source File -# Begin Source File - -SOURCE=.\include\apu.hnw -# End Source File -# Begin Source File - -SOURCE=.\include\apu.hw - -!IF "$(CFG)" == "libaprutil - Win32 Release" - -# Begin Custom Build - Creating apu.h from apu.hw -InputPath=.\include\apu.hw - -".\include\apu.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apu.hw > .\include\apu.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "libaprutil - Win32 Debug" - -# Begin Custom Build - Creating apu.h from apu.hw -InputPath=.\include\apu.hw - -".\include\apu.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apu.hw > .\include\apu.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "libaprutil - x64 Release" - -# Begin Custom Build - Creating apu.h from apu.hw -InputPath=.\include\apu.hw - -".\include\apu.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apu.hw > .\include\apu.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "libaprutil - x64 Debug" - -# Begin Custom Build - Creating apu.h from apu.hw -InputPath=.\include\apu.hw - -".\include\apu.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apu.hw > .\include\apu.h - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\include\private\apu_config.h.in -# End Source File -# Begin Source File - -SOURCE=.\include\private\apu_config.hw - -!IF "$(CFG)" == "libaprutil - Win32 Release" - -# Begin Custom Build - Creating apu_config.h from apu_config.hw -InputPath=.\include\private\apu_config.hw - -".\include\private\apu_config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\private\apu_config.hw > .\include\private\apu_config.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "libaprutil - Win32 Debug" - -# Begin Custom Build - Creating apu_config.h from apu_config.hw -InputPath=.\include\private\apu_config.hw - -".\include\private\apu_config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\private\apu_config.hw > .\include\private\apu_config.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "libaprutil - x64 Release" - -# Begin Custom Build - Creating apu_config.h from apu_config.hw -InputPath=.\include\private\apu_config.hw - -".\include\private\apu_config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\private\apu_config.hw > .\include\private\apu_config.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "libaprutil - x64 Debug" - -# Begin Custom Build - Creating apu_config.h from apu_config.hw -InputPath=.\include\private\apu_config.hw - -".\include\private\apu_config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\private\apu_config.hw > .\include\private\apu_config.h - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\include\private\apu_select_dbm.h.in -# End Source File -# Begin Source File - -SOURCE=.\include\private\apu_select_dbm.hw - -!IF "$(CFG)" == "libaprutil - Win32 Release" - -# Begin Custom Build - Creating apu_select_dbm.h from apu_select_dbm.hw -InputPath=.\include\private\apu_select_dbm.hw - -".\include\private\apu_select_dbm.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\private\apu_select_dbm.hw > .\include\private\apu_select_dbm.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "libaprutil - Win32 Debug" - -# Begin Custom Build - Creating apu_select_dbm.h from apu_select_dbm.hw -InputPath=.\include\private\apu_select_dbm.hw - -".\include\private\apu_select_dbm.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\private\apu_select_dbm.hw > .\include\private\apu_select_dbm.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "libaprutil - x64 Release" - -# Begin Custom Build - Creating apu_select_dbm.h from apu_select_dbm.hw -InputPath=.\include\private\apu_select_dbm.hw - -".\include\private\apu_select_dbm.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\private\apu_select_dbm.hw > .\include\private\apu_select_dbm.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "libaprutil - x64 Debug" - -# Begin Custom Build - Creating apu_select_dbm.h from apu_select_dbm.hw -InputPath=.\include\private\apu_select_dbm.hw - -".\include\private\apu_select_dbm.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\private\apu_select_dbm.hw > .\include\private\apu_select_dbm.h - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\include\apu_want.h.in -# End Source File -# Begin Source File - -SOURCE=.\include\apu_want.hnw -# End Source File -# Begin Source File - -SOURCE=.\include\apu_want.hw - -!IF "$(CFG)" == "libaprutil - Win32 Release" - -# Begin Custom Build - Creating apu_want.h from apu_want.hw -InputPath=.\include\apu_want.hw - -".\include\apu_want.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apu_want.hw > .\include\apu_want.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "libaprutil - Win32 Debug" - -# Begin Custom Build - Creating apu_want.h from apu_want.hw -InputPath=.\include\apu_want.hw - -".\include\apu_want.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apu_want.hw > .\include\apu_want.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "libaprutil - x64 Release" - -# Begin Custom Build - Creating apu_want.h from apu_want.hw -InputPath=.\include\apu_want.hw - -".\include\apu_want.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apu_want.hw > .\include\apu_want.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "libaprutil - x64 Debug" - -# Begin Custom Build - Creating apu_want.h from apu_want.hw -InputPath=.\include\apu_want.hw - -".\include\apu_want.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - type .\include\apu_want.hw > .\include\apu_want.h - -# End Custom Build - -!ENDIF - -# End Source File -# End Group -# Begin Group "Public Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\include\apr_anylock.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_base64.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_buckets.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_date.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_dbm.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_hooks.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_ldap_url.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_md4.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_md5.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_memcache.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_optional.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_optional_hooks.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_queue.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_reslist.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_rmm.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_sdbm.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_sha1.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_strmatch.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_thread_pool.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_uri.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_uuid.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_xlate.h -# End Source File -# Begin Source File - -SOURCE=.\include\apr_xml.h -# End Source File -# Begin Source File - -SOURCE=.\include\apu_version.h -# End Source File -# End Group -# Begin Source File - -SOURCE=.\libaprutil.rc -# End Source File -# End Target -# End Project diff --git a/contrib/apr-util/memcache/apr_memcache.c b/contrib/apr-util/memcache/apr_memcache.c index f96d887ac1f4..f6b911d99203 100644 --- a/contrib/apr-util/memcache/apr_memcache.c +++ b/contrib/apr-util/memcache/apr_memcache.c @@ -183,8 +183,8 @@ apr_memcache_find_server_hash_default(void *baton, apr_memcache_t *mc, #endif /* Try the the dead server, every 5 seconds */ if (curtime - ms->btime > apr_time_from_sec(5)) { + ms->btime = curtime; if (mc_version_ping(ms) == APR_SUCCESS) { - ms->btime = curtime; make_server_live(mc, ms); #if APR_HAS_THREADS apr_thread_mutex_unlock(ms->lock); @@ -787,10 +787,10 @@ apr_memcache_getp(apr_memcache_t *mc, length = apr_strtok(NULL, " ", &last); if (length) { - len = atoi(length); + len = strtol(length, (char **)NULL, 10); } - if (len < 0) { + if (len == 0 ) { *new_length = 0; *baton = NULL; } @@ -1356,14 +1356,14 @@ apr_memcache_multgetp(apr_memcache_t *mc, length = apr_strtok(NULL, " ", &last); if (length) { - len = atoi(length); + len = strtol(length, (char **) NULL, 10); } value = apr_hash_get(values, key, strlen(key)); if (value) { - if (len >= 0) { + if (len != 0) { apr_bucket_brigade *bbb; apr_bucket *e; diff --git a/contrib/apr-util/misc/apr_thread_pool.c b/contrib/apr-util/misc/apr_thread_pool.c index 01c2e21d4268..a12f31ab091e 100644 --- a/contrib/apr-util/misc/apr_thread_pool.c +++ b/contrib/apr-util/misc/apr_thread_pool.c @@ -363,8 +363,7 @@ APU_DECLARE(apr_status_t) apr_thread_pool_create(apr_thread_pool_t ** me, rv = thread_pool_construct(tp, init_threads, max_threads); if (APR_SUCCESS != rv) return rv; - apr_pool_cleanup_register(tp->pool, tp, thread_pool_cleanup, - apr_pool_cleanup_null); + apr_pool_pre_cleanup_register(tp->pool, tp, thread_pool_cleanup); while (init_threads) { /* Grab the mutex as apr_thread_create() and thread_pool_func() will @@ -393,7 +392,8 @@ APU_DECLARE(apr_status_t) apr_thread_pool_create(apr_thread_pool_t ** me, APU_DECLARE(apr_status_t) apr_thread_pool_destroy(apr_thread_pool_t * me) { - return apr_pool_cleanup_run(me->pool, me, thread_pool_cleanup); + apr_pool_destroy(me->pool); + return APR_SUCCESS; } /* diff --git a/contrib/apr-util/test/Makefile.in b/contrib/apr-util/test/Makefile.in index cf89a5487cbd..5f4cf91b9b13 100644 --- a/contrib/apr-util/test/Makefile.in +++ b/contrib/apr-util/test/Makefile.in @@ -34,7 +34,7 @@ APRUTIL_LDFLAGS = $(ALL_LDFLAGS) @LT_NO_INSTALL@ @APRUTIL_LDFLAGS@ # link programs using -no-install to get real executables not # libtool wrapper scripts which link an executable when first run. -LINK_PROG = $(LIBTOOL) $(LTFLAGS) --mode=link $(LT_LDFLAGS) $(COMPILE) \ +LINK_PROG = $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) $(LT_LDFLAGS) \ $(APRUTIL_LDFLAGS) -o $@ # STDTEST_PORTABLE; diff --git a/contrib/apr-util/test/Makefile.win b/contrib/apr-util/test/Makefile.win index 9f5ca8428b35..030585009c56 100644 --- a/contrib/apr-util/test/Makefile.win +++ b/contrib/apr-util/test/Makefile.win @@ -61,7 +61,8 @@ ALL_TESTS = $(INTDIR)\teststrmatch.obj $(INTDIR)\testuri.obj \ $(INTDIR)\testdbm.obj $(INTDIR)\testreslist.obj \ $(INTDIR)\testxml.obj $(INTDIR)\testqueue.obj \ $(INTDIR)\testrmm.obj $(INTDIR)\testxlate.obj \ - $(INTDIR)\testdate.obj $(INTDIR)\testmemcache.obj + $(INTDIR)\testdate.obj $(INTDIR)\testmemcache.obj \ + $(INTDIR)\testcrypto.obj CLEAN_DATA = manyfile.bin testfile.txt data\sqlite*.db diff --git a/contrib/apr-util/test/NWGNUmakefile b/contrib/apr-util/test/NWGNUmakefile index a36d1784d4a0..a955f2c0be46 100644 --- a/contrib/apr-util/test/NWGNUmakefile +++ b/contrib/apr-util/test/NWGNUmakefile @@ -243,6 +243,7 @@ nlms :: libs $(TARGET_nlm) # install :: nlms FORCE $(call COPY,$(OBJDIR)/*.nlm,$(INSTALLBASE)) + $(call COPYR,data,$(INSTALLBASE)/data/) # # Any specialized rules here diff --git a/contrib/apr-util/test/testbuckets.c b/contrib/apr-util/test/testbuckets.c index 807b2a59afc7..3d0d46d0a5b4 100644 --- a/contrib/apr-util/test/testbuckets.c +++ b/contrib/apr-util/test/testbuckets.c @@ -469,6 +469,48 @@ static void test_partition(abts_case *tc, void *data) apr_bucket_alloc_destroy(ba); } +static void test_write_split(abts_case *tc, void *data) +{ + apr_bucket_alloc_t *ba = apr_bucket_alloc_create(p); + apr_bucket_brigade *bb1 = apr_brigade_create(p, ba); + apr_bucket_brigade *bb2; + apr_bucket *e; + + e = apr_bucket_heap_create(hello, strlen(hello), NULL, ba); + APR_BRIGADE_INSERT_HEAD(bb1, e); + apr_bucket_split(e, strlen("hello, ")); + bb2 = apr_brigade_split(bb1, APR_BRIGADE_LAST(bb1)); + apr_brigade_write(bb1, NULL, NULL, "foo", strlen("foo")); + test_bucket_content(tc, APR_BRIGADE_FIRST(bb2), "world", 5); + + apr_brigade_destroy(bb1); + apr_brigade_destroy(bb2); + apr_bucket_alloc_destroy(ba); +} + +static void test_write_putstrs(abts_case *tc, void *data) +{ + apr_bucket_alloc_t *ba = apr_bucket_alloc_create(p); + apr_bucket_brigade *bb = apr_brigade_create(p, ba); + apr_bucket *e; + char buf[30]; + apr_size_t len = sizeof(buf); + const char *expect = "123456789abcdefghij"; + + e = apr_bucket_heap_create("1", 1, NULL, ba); + APR_BRIGADE_INSERT_HEAD(bb, e); + + apr_brigade_putstrs(bb, NULL, NULL, "2", "34", "567", "8", "9a", "bcd", + "e", "f", "gh", "i", NULL); + apr_brigade_putstrs(bb, NULL, NULL, "j", NULL); + apr_assert_success(tc, "apr_brigade_flatten", + apr_brigade_flatten(bb, buf, &len)); + ABTS_STR_NEQUAL(tc, expect, buf, strlen(expect)); + + apr_brigade_destroy(bb); + apr_bucket_alloc_destroy(ba); +} + abts_suite *testbuckets(abts_suite *suite) { suite = ADD_SUITE(suite); @@ -484,6 +526,8 @@ abts_suite *testbuckets(abts_suite *suite) abts_run_test(suite, test_manyfile, NULL); abts_run_test(suite, test_truncfile, NULL); abts_run_test(suite, test_partition, NULL); + abts_run_test(suite, test_write_split, NULL); + abts_run_test(suite, test_write_putstrs, NULL); return suite; } diff --git a/contrib/apr-util/test/testmd5.c b/contrib/apr-util/test/testmd5.c index 5189993b410c..4e13da2371a8 100644 --- a/contrib/apr-util/test/testmd5.c +++ b/contrib/apr-util/test/testmd5.c @@ -66,6 +66,30 @@ static void test_md5sum(abts_case *tc, void *data) (memcmp(digest, sum, APR_MD5_DIGESTSIZE) == 0)); } +static void test_md5sum_unaligned(abts_case *tc, void *data) +{ + apr_md5_ctx_t context; + const char *string = "abcdefghijklmnopqrstuvwxyz01234" + "abcdefghijklmnopqrstuvwxyz01234" + "abcdefghijklmnopqrstuvwxyz01234" + "abcdefghijklmnopqrstuvwxyz01234_"; + const char *sum = + "\x93\x17\x22\x78\xee\x30\x82\xb3\xeb\x95\x33\xec\xea\x78\xb7\x89"; + unsigned char digest[APR_MD5_DIGESTSIZE]; + unsigned int i; + + ABTS_ASSERT(tc, "apr_md5_init", (apr_md5_init(&context) == 0)); + for (i = 0; i < 10; i++) { + ABTS_ASSERT(tc, "apr_md5_update", + (apr_md5_update(&context, string, strlen(string)) == 0)); + string++; + } + ABTS_ASSERT(tc, "apr_md5_final", (apr_md5_final(digest, &context) + == 0)); + ABTS_ASSERT(tc, "check for correct md5 digest of unaligned data", + (memcmp(digest, sum, APR_MD5_DIGESTSIZE) == 0)); +} + abts_suite *testmd5(abts_suite *suite) { suite = ADD_SUITE(suite); @@ -73,6 +97,7 @@ abts_suite *testmd5(abts_suite *suite) for (count=0; count < num_sums; count++) { abts_run_test(suite, test_md5sum, NULL); } + abts_run_test(suite, test_md5sum_unaligned, NULL); return suite; } diff --git a/contrib/apr-util/test/testmemcache.c b/contrib/apr-util/test/testmemcache.c index 494762106e8a..958afa66131d 100644 --- a/contrib/apr-util/test/testmemcache.c +++ b/contrib/apr-util/test/testmemcache.c @@ -433,6 +433,7 @@ static void test_memcache_multiget(abts_case * tc, void *data) rv = apr_memcache_add_server(memcache, server); ABTS_ASSERT(tc, "server add failed", rv == APR_SUCCESS); + values = apr_hash_make(p); tdata = apr_hash_make(p); create_test_hash(pool, tdata); @@ -603,10 +604,10 @@ abts_suite *testmemcache(abts_suite * suite) apr_status_t rv; suite = ADD_SUITE(suite); /* check for a running memcached on the typical port before - * trying to run the tests. succeed silently if we don't find one. + * trying to run the tests. succeed if we don't find one. */ rv = check_mc(); - if(rv == APR_SUCCESS) { + if (rv == APR_SUCCESS) { abts_run_test(suite, test_memcache_create, NULL); abts_run_test(suite, test_memcache_user_funcs, NULL); abts_run_test(suite, test_memcache_meta, NULL); @@ -615,6 +616,11 @@ abts_suite *testmemcache(abts_suite * suite) abts_run_test(suite, test_memcache_addreplace, NULL); abts_run_test(suite, test_memcache_incrdecr, NULL); } + else { + abts_log_message("Error %d occurred attempting to reach memcached " + "on %s:%d. Skipping apr_memcache tests...", + rv, HOST, PORT); + } return suite; } diff --git a/contrib/apr-util/test/testpass.c b/contrib/apr-util/test/testpass.c index 0ec128bdc97e..0b0ebccff830 100644 --- a/contrib/apr-util/test/testpass.c +++ b/contrib/apr-util/test/testpass.c @@ -34,6 +34,12 @@ #define CRYPT_ALGO_SUPPORTED 1 #endif +#if defined __GLIBC_PREREQ +#if __GLIBC_PREREQ(2,7) +#define GLIBCSHA_ALGO_SUPPORTED +#endif +#endif + #if CRYPT_ALGO_SUPPORTED static struct { @@ -117,25 +123,80 @@ static void test_threadsafe(abts_case *tc, void *data) static void test_shapass(abts_case *tc, void *data) { const char *pass = "hellojed"; + const char *pass2 = "hellojed2"; char hash[100]; apr_sha1_base64(pass, strlen(pass), hash); apr_assert_success(tc, "SHA1 password validated", apr_password_validate(pass, hash)); + APR_ASSERT_FAILURE(tc, "wrong SHA1 password should not validate", + apr_password_validate(pass2, hash)); } static void test_md5pass(abts_case *tc, void *data) { const char *pass = "hellojed", *salt = "sardine"; + const char *pass2 = "hellojed2"; char hash[100]; apr_md5_encode(pass, salt, hash, sizeof hash); apr_assert_success(tc, "MD5 password validated", apr_password_validate(pass, hash)); + APR_ASSERT_FAILURE(tc, "wrong MD5 password should not validate", + apr_password_validate(pass2, hash)); +} + +#ifdef GLIBCSHA_ALGO_SUPPORTED + +static struct { + const char *password; + const char *hash; +} glibc_sha_pws[] = { + /* SHA256 */ + { "secret1", "$5$0123456789abcdef$SFX.CooXBS8oXsbAPgU/UyiCodhrLQ19sBgvcA3Zh1D" }, + { "secret2", "$5$rounds=100000$0123456789abcdef$dLXfO5m4d.xv8G66kpz2LyL0.Mi5wjLlH0m7rtgyhyB" }, + /* SHA512 */ + { "secret3", "$6$0123456789abcdef$idOsOfoWwnCQkJm9hd2hxS4NnEs9nBA9poOFXsvtrYSoSHaOToCfyUoZwKe.ZCZnq7D95tGVoi2jxZZMyVwTL1" }, + { "secret4", "$6$rounds=100000$0123456789abcdef$ZiAMjbeA.iIGTWxq2oks9Bvz9sfxaoGPgAtpwimPEwFwkSNMTK7lLwABzzldds/n4UgCQ16HqawPrCrePr4YX1" }, + { NULL, NULL } +}; + +static void test_glibc_shapass(abts_case *tc, void *data) +{ + int i = 0; + while (glibc_sha_pws[i].password) { + apr_assert_success(tc, "check for valid glibc crypt-sha password", + apr_password_validate(glibc_sha_pws[i].password, + glibc_sha_pws[i].hash)); + i++; + } +} +#endif + +static void test_bcryptpass(abts_case *tc, void *data) +{ + const char *pass = "hellojed"; + const char *pass2 = "hellojed2"; + unsigned char salt[] = "sardine_sardine"; + char hash[100]; + const char *hash2 = "$2a$08$qipUJiI9fySUN38hcbz.lucXvAmtgowKOWYtB9y3CXyl6lTknruou"; + const char *pass3 = "foobar"; + + apr_assert_success(tc, "bcrypt encode password", + apr_bcrypt_encode(pass, 5, salt, sizeof(salt), hash, + sizeof(hash))); + + apr_assert_success(tc, "bcrypt password validated", + apr_password_validate(pass, hash)); + APR_ASSERT_FAILURE(tc, "wrong bcrypt password should not validate", + apr_password_validate(pass2, hash)); + apr_assert_success(tc, "bcrypt password validated", + apr_password_validate(pass3, hash2)); } + abts_suite *testpass(abts_suite *suite) { suite = ADD_SUITE(suite); @@ -148,6 +209,10 @@ abts_suite *testpass(abts_suite *suite) #endif /* CRYPT_ALGO_SUPPORTED */ abts_run_test(suite, test_shapass, NULL); abts_run_test(suite, test_md5pass, NULL); + abts_run_test(suite, test_bcryptpass, NULL); +#ifdef GLIBCSHA_ALGO_SUPPORTED + abts_run_test(suite, test_glibc_shapass, NULL); +#endif return suite; } diff --git a/contrib/apr-util/test/testuri.c b/contrib/apr-util/test/testuri.c index ef433888b577..d0b51e16cfbe 100644 --- a/contrib/apr-util/test/testuri.c +++ b/contrib/apr-util/test/testuri.c @@ -123,6 +123,66 @@ struct aup_test aup_tests[] = "file:../photos/image.jpg", 0, "file", NULL, NULL, NULL, NULL, NULL, "../photos/image.jpg", NULL, NULL, 0 }, + { + "file+ssh-2:../photos/image.jpg", + 0, "file+ssh-2", NULL, NULL, NULL, NULL, NULL, "../photos/image.jpg", NULL, NULL, 0 + }, + { + "script/foo.js", + 0, NULL, NULL, NULL, NULL, NULL, NULL, "script/foo.js", NULL, NULL, 0 + }, + { + "../foo2.js", + 0, NULL, NULL, NULL, NULL, NULL, NULL, "../foo2.js", NULL, NULL, 0 + }, + { + "foo3.js", + 0, NULL, NULL, NULL, NULL, NULL, NULL, "foo3.js", NULL, NULL, 0 + }, + { + "_foo/bar", + 0, NULL, NULL, NULL, NULL, NULL, NULL, "_foo/bar", NULL, NULL, 0 + }, + { + "_foo:/bar", + APR_EGENERAL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0 + }, + { + "2foo:/bar", + APR_EGENERAL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0 + }, + { + ".foo:/bar", + APR_EGENERAL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0 + }, + { + "-foo:/bar", + APR_EGENERAL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0 + }, + { + "+foo:/bar", + APR_EGENERAL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0 + }, + { + "::/bar", + APR_EGENERAL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0 + }, + { + ":/bar", + APR_EGENERAL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0 + }, + { + ":foo", + APR_EGENERAL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0 + }, + { + ":", + APR_EGENERAL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0 + }, + { + "@localhost::8080", + APR_EGENERAL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0 + }, }; struct uph_test { diff --git a/contrib/apr-util/test/testutil.c b/contrib/apr-util/test/testutil.c index 11a1923a344f..e5f8460023bc 100644 --- a/contrib/apr-util/test/testutil.c +++ b/contrib/apr-util/test/testutil.c @@ -37,6 +37,18 @@ void apr_assert_success(abts_case* tc, const char* context, apr_status_t rv) } } +void apr_assert_failure(abts_case* tc, const char* context, apr_status_t rv, + int lineno) +{ + if (rv == APR_ENOTIMPL) { + abts_not_impl(tc, context, lineno); + } else if (rv == APR_SUCCESS) { + char buf[STRING_MAX]; + sprintf(buf, "%s (%d): expected failure, got success\n", context, rv); + abts_fail(tc, buf, lineno); + } +} + void initialize(void) { if (apr_initialize() != APR_SUCCESS) { abort(); diff --git a/contrib/apr-util/test/testutil.h b/contrib/apr-util/test/testutil.h index 07b34a84452e..c471af40a4a6 100644 --- a/contrib/apr-util/test/testutil.h +++ b/contrib/apr-util/test/testutil.h @@ -41,6 +41,12 @@ extern apr_pool_t *p; * for RV and CONTEXT message. */ void apr_assert_success(abts_case* tc, const char *context, apr_status_t rv); +void apr_assert_failure(abts_case* tc, const char *context, + apr_status_t rv, int lineno); +#define APR_ASSERT_FAILURE(tc, ctxt, rv) \ + apr_assert_failure(tc, ctxt, rv, __LINE__) + + void initialize(void); abts_suite *teststrmatch(abts_suite *suite); diff --git a/contrib/apr-util/test/testutildll.dsp b/contrib/apr-util/test/testutildll.dsp deleted file mode 100644 index 9c90a16d9624..000000000000 --- a/contrib/apr-util/test/testutildll.dsp +++ /dev/null @@ -1,270 +0,0 @@ -# Microsoft Developer Studio Project File - Name="testutildll" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) External Target" 0x0106 - -CFG=testutildll - Win32 Release -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "testutildll.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "testutildll.mak" CFG="testutildll - Win32 Release" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "testutildll - Win32 Release" (based on "Win32 (x86) External Target") -!MESSAGE "testutildll - Win32 Debug" (based on "Win32 (x86) External Target") -!MESSAGE "testutildll - Win32 Release9x" (based on "Win32 (x86) External Target") -!MESSAGE "testutildll - Win32 Debug9x" (based on "Win32 (x86) External Target") -!MESSAGE "testutildll - x64 Release" (based on "Win32 (x86) External Target") -!MESSAGE "testutildll - x64 Debug" (based on "Win32 (x86) External Target") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" - -!IF "$(CFG)" == "testutildll - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "" -# PROP BASE Intermediate_Dir "" -# PROP BASE Cmd_Line "NMAKE /f Makefile.win INTDIR=Release OUTDIR=Release MODEL=dynamic all check" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "Release\testall.exe" -# PROP BASE Bsc_Name "" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "" -# PROP Intermediate_Dir "" -# PROP Cmd_Line "NMAKE /f Makefile.win INTDIR=Release OUTDIR=Release MODEL=dynamic all check" -# PROP Rebuild_Opt "/a" -# PROP Target_File "Release\testall.exe" -# PROP Bsc_Name "" -# PROP Target_Dir "" - -!ELSEIF "$(CFG)" == "testutildll - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "" -# PROP BASE Intermediate_Dir "" -# PROP BASE Cmd_Line "NMAKE /f Makefile.win INTDIR=Debug OUTDIR=Debug MODEL=dynamic _DEBUG=1 all check" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "Debug\testall.exe" -# PROP BASE Bsc_Name "" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "" -# PROP Intermediate_Dir "" -# PROP Cmd_Line "NMAKE /f Makefile.win INTDIR=Debug OUTDIR=Debug MODEL=dynamic _DEBUG=1 all check" -# PROP Rebuild_Opt "/a" -# PROP Target_File "Debug\testall.exe" -# PROP Bsc_Name "" -# PROP Target_Dir "" - -!ELSEIF "$(CFG)" == "testutildll - Win32 Release9x" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "" -# PROP BASE Intermediate_Dir "" -# PROP BASE Cmd_Line "NMAKE /f Makefile.win INTDIR=9x\Release OUTDIR=9x\Release MODEL=dynamic all check" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "9x\Release\testall.exe" -# PROP BASE Bsc_Name "" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "" -# PROP Intermediate_Dir "" -# PROP Cmd_Line "NMAKE /f Makefile.win INTDIR=9x\Release OUTDIR=9x\Release MODEL=dynamic all check" -# PROP Rebuild_Opt "/a" -# PROP Target_File "9x\Release\testall.exe" -# PROP Bsc_Name "" -# PROP Target_Dir "" - -!ELSEIF "$(CFG)" == "testutildll - Win32 Debug9x" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "" -# PROP BASE Intermediate_Dir "" -# PROP BASE Cmd_Line "NMAKE /f Makefile.win INTDIR=9x\Debug OUTDIR=9x\Debug MODEL=dynamic _DEBUG=1 all check" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "9x\Debug\testall.exe" -# PROP BASE Bsc_Name "" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "" -# PROP Intermediate_Dir "" -# PROP Cmd_Line "NMAKE /f Makefile.win INTDIR=9x\Debug OUTDIR=9x\Debug MODEL=dynamic _DEBUG=1 all check" -# PROP Rebuild_Opt "/a" -# PROP Target_File "9x\Debug\testall.exe" -# PROP Bsc_Name "" -# PROP Target_Dir "" - -!ELSEIF "$(CFG)" == "testutildll - x64 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "" -# PROP BASE Intermediate_Dir "" -# PROP BASE Cmd_Line "NMAKE /f Makefile.win INTDIR=x64\Release OUTDIR=x64\Release MODEL=dynamic all check" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "x64\Release\testall.exe" -# PROP BASE Bsc_Name "" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "" -# PROP Intermediate_Dir "" -# PROP Cmd_Line "NMAKE /f Makefile.win INTDIR=x64\Release OUTDIR=x64\Release MODEL=dynamic all check" -# PROP Rebuild_Opt "/a" -# PROP Target_File "x64\Release\testall.exe" -# PROP Bsc_Name "" -# PROP Target_Dir "" - -!ELSEIF "$(CFG)" == "testutildll - x64 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "" -# PROP BASE Intermediate_Dir "" -# PROP BASE Cmd_Line "NMAKE /f Makefile.win INTDIR=x64\Debug OUTDIR=x64\Debug MODEL=dynamic _DEBUG=1 all check" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "x64\Debug\testall.exe" -# PROP BASE Bsc_Name "" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "" -# PROP Intermediate_Dir "" -# PROP Cmd_Line "NMAKE /f Makefile.win INTDIR=x64\Debug OUTDIR=x64\Debug MODEL=dynamic _DEBUG=1 all check" -# PROP Rebuild_Opt "/a" -# PROP Target_File "x64\Debug\testall.exe" -# PROP Bsc_Name "" -# PROP Target_Dir "" - -!ENDIF - -# Begin Target - -# Name "testutildll - Win32 Release" -# Name "testutildll - Win32 Debug" -# Name "testutildll - Win32 Release9x" -# Name "testutildll - Win32 Debug9x" -# Name "testutildll - x64 Release" -# Name "testutildll - x64 Debug" -# Begin Group "testall Source Files" - -# PROP Default_Filter ".c" -# Begin Source File - -SOURCE=.\abts.c -# End Source File -# Begin Source File - -SOURCE=.\abts.h -# End Source File -# Begin Source File - -SOURCE=.\abts_tests.h -# End Source File -# Begin Source File - -SOURCE=.\testbuckets.c -# End Source File -# Begin Source File - -SOURCE=.\testdate.c -# End Source File -# Begin Source File - -SOURCE=.\testdbd.c -# End Source File -# Begin Source File - -SOURCE=.\testdbm.c -# End Source File -# Begin Source File - -SOURCE=.\testldap.c -# End Source File -# Begin Source File - -SOURCE=.\testmd4.c -# End Source File -# Begin Source File - -SOURCE=.\testmd5.c -# End Source File -# Begin Source File - -SOURCE=.\testmemcache.c -# End Source File -# Begin Source File - -SOURCE=.\testpass.c -# End Source File -# Begin Source File - -SOURCE=.\testqueue.c -# End Source File -# Begin Source File - -SOURCE=.\testreslist.c -# End Source File -# Begin Source File - -SOURCE=.\testrmm.c -# End Source File -# Begin Source File - -SOURCE=.\teststrmatch.c -# End Source File -# Begin Source File - -SOURCE=.\testuri.c -# End Source File -# Begin Source File - -SOURCE=.\testutil.c -# End Source File -# Begin Source File - -SOURCE=.\testuuid.c -# End Source File -# Begin Source File - -SOURCE=.\testxlate.c -# End Source File -# Begin Source File - -SOURCE=.\testxml.c -# End Source File -# End Group -# Begin Group "Other Source Files" - -# PROP Default_Filter ".c" -# Begin Source File - -SOURCE=.\dbd.c -# End Source File -# End Group -# Begin Source File - -SOURCE=.\Makefile.win -# End Source File -# End Target -# End Project diff --git a/contrib/apr-util/test/testutillib.dsp b/contrib/apr-util/test/testutillib.dsp deleted file mode 100644 index 6df114ca530e..000000000000 --- a/contrib/apr-util/test/testutillib.dsp +++ /dev/null @@ -1,270 +0,0 @@ -# Microsoft Developer Studio Project File - Name="testutillib" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) External Target" 0x0106 - -CFG=testutillib - Win32 Release -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "testutillib.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "testutillib.mak" CFG="testutillib - Win32 Release" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "testutillib - Win32 Release" (based on "Win32 (x86) External Target") -!MESSAGE "testutillib - Win32 Debug" (based on "Win32 (x86) External Target") -!MESSAGE "testutillib - Win32 Release9x" (based on "Win32 (x86) External Target") -!MESSAGE "testutillib - Win32 Debug9x" (based on "Win32 (x86) External Target") -!MESSAGE "testutillib - x64 Release" (based on "Win32 (x86) External Target") -!MESSAGE "testutillib - x64 Debug" (based on "Win32 (x86) External Target") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" - -!IF "$(CFG)" == "testutillib - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "" -# PROP BASE Intermediate_Dir "" -# PROP BASE Cmd_Line "NMAKE /f Makefile.win INTDIR=LibR OUTDIR=LibR MODEL=static all check" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "LibR\testall.exe" -# PROP BASE Bsc_Name "" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "" -# PROP Intermediate_Dir "" -# PROP Cmd_Line "NMAKE /f Makefile.win INTDIR=LibR OUTDIR=LibR MODEL=static all check" -# PROP Rebuild_Opt "/a" -# PROP Target_File "LibR\testall.exe" -# PROP Bsc_Name "" -# PROP Target_Dir "" - -!ELSEIF "$(CFG)" == "testutillib - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "" -# PROP BASE Intermediate_Dir "" -# PROP BASE Cmd_Line "NMAKE /f Makefile.win INTDIR=LibD OUTDIR=LibD MODEL=static _DEBUG=1 all check" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "LibD\testall.exe" -# PROP BASE Bsc_Name "" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "" -# PROP Intermediate_Dir "" -# PROP Cmd_Line "NMAKE /f Makefile.win INTDIR=LibD OUTDIR=LibD MODEL=static _DEBUG=1 all check" -# PROP Rebuild_Opt "/a" -# PROP Target_File "LibD\testall.exe" -# PROP Bsc_Name "" -# PROP Target_Dir "" - -!ELSEIF "$(CFG)" == "testutillib - Win32 Release9x" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "" -# PROP BASE Intermediate_Dir "" -# PROP BASE Cmd_Line "NMAKE /f Makefile.win INTDIR=9x\LibR OUTDIR=9x\LibR MODEL=static all check" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "9x\LibR\testall.exe" -# PROP BASE Bsc_Name "" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "" -# PROP Intermediate_Dir "" -# PROP Cmd_Line "NMAKE /f Makefile.win INTDIR=9x\LibR OUTDIR=9x\LibR MODEL=static all check" -# PROP Rebuild_Opt "/a" -# PROP Target_File "9x\LibR\testall.exe" -# PROP Bsc_Name "" -# PROP Target_Dir "" - -!ELSEIF "$(CFG)" == "testutillib - Win32 Debug9x" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "" -# PROP BASE Intermediate_Dir "" -# PROP BASE Cmd_Line "NMAKE /f Makefile.win INTDIR=9x\LibD OUTDIR=9x\LibD MODEL=static _DEBUG=1 all check" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "9x\LibD\testall.exe" -# PROP BASE Bsc_Name "" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "" -# PROP Intermediate_Dir "" -# PROP Cmd_Line "NMAKE /f Makefile.win INTDIR=9x\LibD OUTDIR=9x\LibD MODEL=static _DEBUG=1 all check" -# PROP Rebuild_Opt "/a" -# PROP Target_File "9x\LibD\testall.exe" -# PROP Bsc_Name "" -# PROP Target_Dir "" - -!ELSEIF "$(CFG)" == "testutillib - x64 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "" -# PROP BASE Intermediate_Dir "" -# PROP BASE Cmd_Line "NMAKE /f Makefile.win INTDIR=x64\LibR OUTDIR=x64\LibR MODEL=static all check" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "x64\LibR\testall.exe" -# PROP BASE Bsc_Name "" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "" -# PROP Intermediate_Dir "" -# PROP Cmd_Line "NMAKE /f Makefile.win INTDIR=x64\LibR OUTDIR=x64\LibR MODEL=static all check" -# PROP Rebuild_Opt "/a" -# PROP Target_File "x64\LibR\testall.exe" -# PROP Bsc_Name "" -# PROP Target_Dir "" - -!ELSEIF "$(CFG)" == "testutillib - x64 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "" -# PROP BASE Intermediate_Dir "" -# PROP BASE Cmd_Line "NMAKE /f Makefile.win INTDIR=x64\LibD OUTDIR=x64\LibD MODEL=static _DEBUG=1 all check" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "x64\LibD\testall.exe" -# PROP BASE Bsc_Name "" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "" -# PROP Intermediate_Dir "" -# PROP Cmd_Line "NMAKE /f Makefile.win INTDIR=x64\LibD OUTDIR=x64\LibD MODEL=static _DEBUG=1 all check" -# PROP Rebuild_Opt "/a" -# PROP Target_File "x64\LibD\testall.exe" -# PROP Bsc_Name "" -# PROP Target_Dir "" - -!ENDIF - -# Begin Target - -# Name "testutillib - Win32 Release" -# Name "testutillib - Win32 Debug" -# Name "testutillib - Win32 Release9x" -# Name "testutillib - Win32 Debug9x" -# Name "testutillib - x64 Release" -# Name "testutillib - x64 Debug" -# Begin Group "testall Source Files" - -# PROP Default_Filter ".c" -# Begin Source File - -SOURCE=.\abts.c -# End Source File -# Begin Source File - -SOURCE=.\abts.h -# End Source File -# Begin Source File - -SOURCE=.\abts_tests.h -# End Source File -# Begin Source File - -SOURCE=.\testbuckets.c -# End Source File -# Begin Source File - -SOURCE=.\testdate.c -# End Source File -# Begin Source File - -SOURCE=.\testdbd.c -# End Source File -# Begin Source File - -SOURCE=.\testdbm.c -# End Source File -# Begin Source File - -SOURCE=.\testldap.c -# End Source File -# Begin Source File - -SOURCE=.\testmd4.c -# End Source File -# Begin Source File - -SOURCE=.\testmd5.c -# End Source File -# Begin Source File - -SOURCE=.\testmemcache.c -# End Source File -# Begin Source File - -SOURCE=.\testpass.c -# End Source File -# Begin Source File - -SOURCE=.\testqueue.c -# End Source File -# Begin Source File - -SOURCE=.\testreslist.c -# End Source File -# Begin Source File - -SOURCE=.\testrmm.c -# End Source File -# Begin Source File - -SOURCE=.\teststrmatch.c -# End Source File -# Begin Source File - -SOURCE=.\testuri.c -# End Source File -# Begin Source File - -SOURCE=.\testutil.c -# End Source File -# Begin Source File - -SOURCE=.\testuuid.c -# End Source File -# Begin Source File - -SOURCE=.\testxlate.c -# End Source File -# Begin Source File - -SOURCE=.\testxml.c -# End Source File -# End Group -# Begin Group "Other Source Files" - -# PROP Default_Filter ".c" -# Begin Source File - -SOURCE=.\dbd.c -# End Source File -# End Group -# Begin Source File - -SOURCE=.\Makefile.win -# End Source File -# End Target -# End Project diff --git a/contrib/apr-util/uri/apr_uri.c b/contrib/apr-util/uri/apr_uri.c index e5acb3467b82..ca5c49d5df8b 100644 --- a/contrib/apr-util/uri/apr_uri.c +++ b/contrib/apr-util/uri/apr_uri.c @@ -170,51 +170,534 @@ APU_DECLARE(char *) apr_uri_unparse(apr_pool_t *p, * compares for NUL for free -- it's just another delimiter. */ -#define T_COLON 0x01 /* ':' */ -#define T_SLASH 0x02 /* '/' */ -#define T_QUESTION 0x04 /* '?' */ -#define T_HASH 0x08 /* '#' */ +#define T_SLASH 0x01 /* '/' */ +#define T_QUESTION 0x02 /* '?' */ +#define T_HASH 0x04 /* '#' */ +#define T_ALPHA 0x08 /* 'A' ... 'Z', 'a' ... 'z' */ +#define T_SCHEME 0x10 /* '0' ... '9', '-', '+', '.' + * (allowed in scheme except first char) + */ #define T_NUL 0x80 /* '\0' */ #if APR_CHARSET_EBCDIC /* Delimiter table for the EBCDIC character set */ static const unsigned char uri_delims[256] = { - T_NUL,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,T_SLASH,0,0,0,0,0,0,0,0,0,0,0,0,0,T_QUESTION, - 0,0,0,0,0,0,0,0,0,0,T_COLON,T_HASH,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + T_NUL, /* 0x00 */ + 0, /* 0x01 */ + 0, /* 0x02 */ + 0, /* 0x03 */ + 0, /* 0x04 */ + 0, /* 0x05 */ + 0, /* 0x06 */ + 0, /* 0x07 */ + 0, /* 0x08 */ + 0, /* 0x09 */ + 0, /* 0x0a */ + 0, /* 0x0b */ + 0, /* 0x0c */ + 0, /* 0x0d */ + 0, /* 0x0e */ + 0, /* 0x0f */ + 0, /* 0x10 */ + 0, /* 0x11 */ + 0, /* 0x12 */ + 0, /* 0x13 */ + 0, /* 0x14 */ + 0, /* 0x15 */ + 0, /* 0x16 */ + 0, /* 0x17 */ + 0, /* 0x18 */ + 0, /* 0x19 */ + 0, /* 0x1a */ + 0, /* 0x1b */ + 0, /* 0x1c */ + 0, /* 0x1d */ + 0, /* 0x1e */ + 0, /* 0x1f */ + 0, /* 0x20 */ + 0, /* 0x21 */ + 0, /* 0x22 */ + 0, /* 0x23 */ + 0, /* 0x24 */ + 0, /* 0x25 */ + 0, /* 0x26 */ + 0, /* 0x27 */ + 0, /* 0x28 */ + 0, /* 0x29 */ + 0, /* 0x2a */ + 0, /* 0x2b */ + 0, /* 0x2c */ + 0, /* 0x2d */ + 0, /* 0x2e */ + 0, /* 0x2f */ + 0, /* 0x30 */ + 0, /* 0x31 */ + 0, /* 0x32 */ + 0, /* 0x33 */ + 0, /* 0x34 */ + 0, /* 0x35 */ + 0, /* 0x36 */ + 0, /* 0x37 */ + 0, /* 0x38 */ + 0, /* 0x39 */ + 0, /* 0x3a */ + 0, /* 0x3b */ + 0, /* 0x3c */ + 0, /* 0x3d */ + 0, /* 0x3e */ + 0, /* 0x3f */ + 0, /* 0x40 ' ' */ + 0, /* 0x41 */ + 0, /* 0x42 */ + 0, /* 0x43 */ + 0, /* 0x44 */ + 0, /* 0x45 */ + 0, /* 0x46 */ + 0, /* 0x47 */ + 0, /* 0x48 */ + 0, /* 0x49 */ + 0, /* 0x4a '[' */ + T_SCHEME, /* 0x4b '.' */ + 0, /* 0x4c '<' */ + 0, /* 0x4d '(' */ + T_SCHEME, /* 0x4e '+' */ + 0, /* 0x4f '!' */ + 0, /* 0x50 '&' */ + 0, /* 0x51 */ + 0, /* 0x52 */ + 0, /* 0x53 */ + 0, /* 0x54 */ + 0, /* 0x55 */ + 0, /* 0x56 */ + 0, /* 0x57 */ + 0, /* 0x58 */ + 0, /* 0x59 */ + 0, /* 0x5a ']' */ + 0, /* 0x5b '$' */ + 0, /* 0x5c '*' */ + 0, /* 0x5d ')' */ + 0, /* 0x5e ';' */ + 0, /* 0x5f '^' */ + T_SCHEME, /* 0x60 '-' */ + T_SLASH, /* 0x61 '/' */ + 0, /* 0x62 */ + 0, /* 0x63 */ + 0, /* 0x64 */ + 0, /* 0x65 */ + 0, /* 0x66 */ + 0, /* 0x67 */ + 0, /* 0x68 */ + 0, /* 0x69 */ + 0, /* 0x6a '|' */ + 0, /* 0x6b ',' */ + 0, /* 0x6c '%' */ + 0, /* 0x6d '_' */ + 0, /* 0x6e '>' */ + T_QUESTION, /* 0x6f '?' */ + 0, /* 0x70 */ + 0, /* 0x71 */ + 0, /* 0x72 */ + 0, /* 0x73 */ + 0, /* 0x74 */ + 0, /* 0x75 */ + 0, /* 0x76 */ + 0, /* 0x77 */ + 0, /* 0x78 */ + 0, /* 0x79 '`' */ + 0, /* 0x7a ':' */ + T_HASH, /* 0x7b '#' */ + 0, /* 0x7c '@' */ + 0, /* 0x7d ''' */ + 0, /* 0x7e '=' */ + 0, /* 0x7f '"' */ + 0, /* 0x80 */ + T_ALPHA, /* 0x81 'a' */ + T_ALPHA, /* 0x82 'b' */ + T_ALPHA, /* 0x83 'c' */ + T_ALPHA, /* 0x84 'd' */ + T_ALPHA, /* 0x85 'e' */ + T_ALPHA, /* 0x86 'f' */ + T_ALPHA, /* 0x87 'g' */ + T_ALPHA, /* 0x88 'h' */ + T_ALPHA, /* 0x89 'i' */ + 0, /* 0x8a */ + 0, /* 0x8b */ + 0, /* 0x8c */ + 0, /* 0x8d */ + 0, /* 0x8e */ + 0, /* 0x8f */ + 0, /* 0x90 */ + T_ALPHA, /* 0x91 'j' */ + T_ALPHA, /* 0x92 'k' */ + T_ALPHA, /* 0x93 'l' */ + T_ALPHA, /* 0x94 'm' */ + T_ALPHA, /* 0x95 'n' */ + T_ALPHA, /* 0x96 'o' */ + T_ALPHA, /* 0x97 'p' */ + T_ALPHA, /* 0x98 'q' */ + T_ALPHA, /* 0x99 'r' */ + 0, /* 0x9a */ + 0, /* 0x9b */ + 0, /* 0x9c */ + 0, /* 0x9d */ + 0, /* 0x9e */ + 0, /* 0x9f */ + 0, /* 0xa0 */ + 0, /* 0xa1 '~' */ + T_ALPHA, /* 0xa2 's' */ + T_ALPHA, /* 0xa3 't' */ + T_ALPHA, /* 0xa4 'u' */ + T_ALPHA, /* 0xa5 'v' */ + T_ALPHA, /* 0xa6 'w' */ + T_ALPHA, /* 0xa7 'x' */ + T_ALPHA, /* 0xa8 'y' */ + T_ALPHA, /* 0xa9 'z' */ + 0, /* 0xaa */ + 0, /* 0xab */ + 0, /* 0xac */ + 0, /* 0xad */ + 0, /* 0xae */ + 0, /* 0xaf */ + 0, /* 0xb0 */ + 0, /* 0xb1 */ + 0, /* 0xb2 */ + 0, /* 0xb3 */ + 0, /* 0xb4 */ + 0, /* 0xb5 */ + 0, /* 0xb6 */ + 0, /* 0xb7 */ + 0, /* 0xb8 */ + 0, /* 0xb9 */ + 0, /* 0xba */ + 0, /* 0xbb */ + 0, /* 0xbc */ + 0, /* 0xbd */ + 0, /* 0xbe */ + 0, /* 0xbf */ + 0, /* 0xc0 '{' */ + T_ALPHA, /* 0xc1 'A' */ + T_ALPHA, /* 0xc2 'B' */ + T_ALPHA, /* 0xc3 'C' */ + T_ALPHA, /* 0xc4 'D' */ + T_ALPHA, /* 0xc5 'E' */ + T_ALPHA, /* 0xc6 'F' */ + T_ALPHA, /* 0xc7 'G' */ + T_ALPHA, /* 0xc8 'H' */ + T_ALPHA, /* 0xc9 'I' */ + 0, /* 0xca */ + 0, /* 0xcb */ + 0, /* 0xcc */ + 0, /* 0xcd */ + 0, /* 0xce */ + 0, /* 0xcf */ + 0, /* 0xd0 '}' */ + T_ALPHA, /* 0xd1 'J' */ + T_ALPHA, /* 0xd2 'K' */ + T_ALPHA, /* 0xd3 'L' */ + T_ALPHA, /* 0xd4 'M' */ + T_ALPHA, /* 0xd5 'N' */ + T_ALPHA, /* 0xd6 'O' */ + T_ALPHA, /* 0xd7 'P' */ + T_ALPHA, /* 0xd8 'Q' */ + T_ALPHA, /* 0xd9 'R' */ + 0, /* 0xda */ + 0, /* 0xdb */ + 0, /* 0xdc */ + 0, /* 0xdd */ + 0, /* 0xde */ + 0, /* 0xdf */ + 0, /* 0xe0 '\' */ + 0, /* 0xe1 */ + T_ALPHA, /* 0xe2 'S' */ + T_ALPHA, /* 0xe3 'T' */ + T_ALPHA, /* 0xe4 'U' */ + T_ALPHA, /* 0xe5 'V' */ + T_ALPHA, /* 0xe6 'W' */ + T_ALPHA, /* 0xe7 'X' */ + T_ALPHA, /* 0xe8 'Y' */ + T_ALPHA, /* 0xe9 'Z' */ + 0, /* 0xea */ + 0, /* 0xeb */ + 0, /* 0xec */ + 0, /* 0xed */ + 0, /* 0xee */ + 0, /* 0xef */ + T_SCHEME, /* 0xf0 '0' */ + T_SCHEME, /* 0xf1 '1' */ + T_SCHEME, /* 0xf2 '2' */ + T_SCHEME, /* 0xf3 '3' */ + T_SCHEME, /* 0xf4 '4' */ + T_SCHEME, /* 0xf5 '5' */ + T_SCHEME, /* 0xf6 '6' */ + T_SCHEME, /* 0xf7 '7' */ + T_SCHEME, /* 0xf8 '8' */ + T_SCHEME, /* 0xf9 '9' */ + 0, /* 0xfa */ + 0, /* 0xfb */ + 0, /* 0xfc */ + 0, /* 0xfd */ + 0, /* 0xfe */ + 0 /* 0xff */ }; #else /* Delimiter table for the ASCII character set */ static const unsigned char uri_delims[256] = { - T_NUL,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,T_HASH,0,0,0,0,0,0,0,0,0,0,0,T_SLASH, - 0,0,0,0,0,0,0,0,0,0,T_COLON,0,0,0,0,T_QUESTION, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + T_NUL, /* 0x00 */ + 0, /* 0x01 */ + 0, /* 0x02 */ + 0, /* 0x03 */ + 0, /* 0x04 */ + 0, /* 0x05 */ + 0, /* 0x06 */ + 0, /* 0x07 */ + 0, /* 0x08 */ + 0, /* 0x09 */ + 0, /* 0x0a */ + 0, /* 0x0b */ + 0, /* 0x0c */ + 0, /* 0x0d */ + 0, /* 0x0e */ + 0, /* 0x0f */ + 0, /* 0x10 */ + 0, /* 0x11 */ + 0, /* 0x12 */ + 0, /* 0x13 */ + 0, /* 0x14 */ + 0, /* 0x15 */ + 0, /* 0x16 */ + 0, /* 0x17 */ + 0, /* 0x18 */ + 0, /* 0x19 */ + 0, /* 0x1a */ + 0, /* 0x1b */ + 0, /* 0x1c */ + 0, /* 0x1d */ + 0, /* 0x1e */ + 0, /* 0x1f */ + 0, /* 0x20 ' ' */ + 0, /* 0x21 '!' */ + 0, /* 0x22 '"' */ + T_HASH, /* 0x23 '#' */ + 0, /* 0x24 '$' */ + 0, /* 0x25 '%' */ + 0, /* 0x26 '&' */ + 0, /* 0x27 ''' */ + 0, /* 0x28 '(' */ + 0, /* 0x29 ')' */ + 0, /* 0x2a '*' */ + T_SCHEME, /* 0x2b '+' */ + 0, /* 0x2c ',' */ + T_SCHEME, /* 0x2d '-' */ + T_SCHEME, /* 0x2e '.' */ + T_SLASH, /* 0x2f '/' */ + T_SCHEME, /* 0x30 '0' */ + T_SCHEME, /* 0x31 '1' */ + T_SCHEME, /* 0x32 '2' */ + T_SCHEME, /* 0x33 '3' */ + T_SCHEME, /* 0x34 '4' */ + T_SCHEME, /* 0x35 '5' */ + T_SCHEME, /* 0x36 '6' */ + T_SCHEME, /* 0x37 '7' */ + T_SCHEME, /* 0x38 '8' */ + T_SCHEME, /* 0x39 '9' */ + 0, /* 0x3a ':' */ + 0, /* 0x3b ';' */ + 0, /* 0x3c '<' */ + 0, /* 0x3d '=' */ + 0, /* 0x3e '>' */ + T_QUESTION, /* 0x3f '?' */ + 0, /* 0x40 '@' */ + T_ALPHA, /* 0x41 'A' */ + T_ALPHA, /* 0x42 'B' */ + T_ALPHA, /* 0x43 'C' */ + T_ALPHA, /* 0x44 'D' */ + T_ALPHA, /* 0x45 'E' */ + T_ALPHA, /* 0x46 'F' */ + T_ALPHA, /* 0x47 'G' */ + T_ALPHA, /* 0x48 'H' */ + T_ALPHA, /* 0x49 'I' */ + T_ALPHA, /* 0x4a 'J' */ + T_ALPHA, /* 0x4b 'K' */ + T_ALPHA, /* 0x4c 'L' */ + T_ALPHA, /* 0x4d 'M' */ + T_ALPHA, /* 0x4e 'N' */ + T_ALPHA, /* 0x4f 'O' */ + T_ALPHA, /* 0x50 'P' */ + T_ALPHA, /* 0x51 'Q' */ + T_ALPHA, /* 0x52 'R' */ + T_ALPHA, /* 0x53 'S' */ + T_ALPHA, /* 0x54 'T' */ + T_ALPHA, /* 0x55 'U' */ + T_ALPHA, /* 0x56 'V' */ + T_ALPHA, /* 0x57 'W' */ + T_ALPHA, /* 0x58 'X' */ + T_ALPHA, /* 0x59 'Y' */ + T_ALPHA, /* 0x5a 'Z' */ + 0, /* 0x5b '[' */ + 0, /* 0x5c '\' */ + 0, /* 0x5d ']' */ + 0, /* 0x5e '^' */ + 0, /* 0x5f '_' */ + 0, /* 0x60 '`' */ + T_ALPHA, /* 0x61 'a' */ + T_ALPHA, /* 0x62 'b' */ + T_ALPHA, /* 0x63 'c' */ + T_ALPHA, /* 0x64 'd' */ + T_ALPHA, /* 0x65 'e' */ + T_ALPHA, /* 0x66 'f' */ + T_ALPHA, /* 0x67 'g' */ + T_ALPHA, /* 0x68 'h' */ + T_ALPHA, /* 0x69 'i' */ + T_ALPHA, /* 0x6a 'j' */ + T_ALPHA, /* 0x6b 'k' */ + T_ALPHA, /* 0x6c 'l' */ + T_ALPHA, /* 0x6d 'm' */ + T_ALPHA, /* 0x6e 'n' */ + T_ALPHA, /* 0x6f 'o' */ + T_ALPHA, /* 0x70 'p' */ + T_ALPHA, /* 0x71 'q' */ + T_ALPHA, /* 0x72 'r' */ + T_ALPHA, /* 0x73 's' */ + T_ALPHA, /* 0x74 't' */ + T_ALPHA, /* 0x75 'u' */ + T_ALPHA, /* 0x76 'v' */ + T_ALPHA, /* 0x77 'w' */ + T_ALPHA, /* 0x78 'x' */ + T_ALPHA, /* 0x79 'y' */ + T_ALPHA, /* 0x7a 'z' */ + 0, /* 0x7b '{' */ + 0, /* 0x7c '|' */ + 0, /* 0x7d '}' */ + 0, /* 0x7e '~' */ + 0, /* 0x7f */ + 0, /* 0x80 */ + 0, /* 0x81 */ + 0, /* 0x82 */ + 0, /* 0x83 */ + 0, /* 0x84 */ + 0, /* 0x85 */ + 0, /* 0x86 */ + 0, /* 0x87 */ + 0, /* 0x88 */ + 0, /* 0x89 */ + 0, /* 0x8a */ + 0, /* 0x8b */ + 0, /* 0x8c */ + 0, /* 0x8d */ + 0, /* 0x8e */ + 0, /* 0x8f */ + 0, /* 0x90 */ + 0, /* 0x91 */ + 0, /* 0x92 */ + 0, /* 0x93 */ + 0, /* 0x94 */ + 0, /* 0x95 */ + 0, /* 0x96 */ + 0, /* 0x97 */ + 0, /* 0x98 */ + 0, /* 0x99 */ + 0, /* 0x9a */ + 0, /* 0x9b */ + 0, /* 0x9c */ + 0, /* 0x9d */ + 0, /* 0x9e */ + 0, /* 0x9f */ + 0, /* 0xa0 */ + 0, /* 0xa1 */ + 0, /* 0xa2 */ + 0, /* 0xa3 */ + 0, /* 0xa4 */ + 0, /* 0xa5 */ + 0, /* 0xa6 */ + 0, /* 0xa7 */ + 0, /* 0xa8 */ + 0, /* 0xa9 */ + 0, /* 0xaa */ + 0, /* 0xab */ + 0, /* 0xac */ + 0, /* 0xad */ + 0, /* 0xae */ + 0, /* 0xaf */ + 0, /* 0xb0 */ + 0, /* 0xb1 */ + 0, /* 0xb2 */ + 0, /* 0xb3 */ + 0, /* 0xb4 */ + 0, /* 0xb5 */ + 0, /* 0xb6 */ + 0, /* 0xb7 */ + 0, /* 0xb8 */ + 0, /* 0xb9 */ + 0, /* 0xba */ + 0, /* 0xbb */ + 0, /* 0xbc */ + 0, /* 0xbd */ + 0, /* 0xbe */ + 0, /* 0xbf */ + 0, /* 0xc0 */ + 0, /* 0xc1 */ + 0, /* 0xc2 */ + 0, /* 0xc3 */ + 0, /* 0xc4 */ + 0, /* 0xc5 */ + 0, /* 0xc6 */ + 0, /* 0xc7 */ + 0, /* 0xc8 */ + 0, /* 0xc9 */ + 0, /* 0xca */ + 0, /* 0xcb */ + 0, /* 0xcc */ + 0, /* 0xcd */ + 0, /* 0xce */ + 0, /* 0xcf */ + 0, /* 0xd0 */ + 0, /* 0xd1 */ + 0, /* 0xd2 */ + 0, /* 0xd3 */ + 0, /* 0xd4 */ + 0, /* 0xd5 */ + 0, /* 0xd6 */ + 0, /* 0xd7 */ + 0, /* 0xd8 */ + 0, /* 0xd9 */ + 0, /* 0xda */ + 0, /* 0xdb */ + 0, /* 0xdc */ + 0, /* 0xdd */ + 0, /* 0xde */ + 0, /* 0xdf */ + 0, /* 0xe0 */ + 0, /* 0xe1 */ + 0, /* 0xe2 */ + 0, /* 0xe3 */ + 0, /* 0xe4 */ + 0, /* 0xe5 */ + 0, /* 0xe6 */ + 0, /* 0xe7 */ + 0, /* 0xe8 */ + 0, /* 0xe9 */ + 0, /* 0xea */ + 0, /* 0xeb */ + 0, /* 0xec */ + 0, /* 0xed */ + 0, /* 0xee */ + 0, /* 0xef */ + 0, /* 0xf0 */ + 0, /* 0xf1 */ + 0, /* 0xf2 */ + 0, /* 0xf3 */ + 0, /* 0xf4 */ + 0, /* 0xf5 */ + 0, /* 0xf6 */ + 0, /* 0xf7 */ + 0, /* 0xf8 */ + 0, /* 0xf9 */ + 0, /* 0xfa */ + 0, /* 0xfb */ + 0, /* 0xfc */ + 0, /* 0xfd */ + 0, /* 0xfe */ + 0 /* 0xff */ }; #endif @@ -225,10 +708,6 @@ static const unsigned char uri_delims[256] = { } */ -/* Note that we optimize the scheme scanning here, we cheat and let the - * compiler know that it doesn't have to do the & masking. - */ -#define NOTEND_SCHEME (0xff) #define NOTEND_HOSTINFO (T_SLASH | T_QUESTION | T_HASH | T_NUL) #define NOTEND_PATH (T_QUESTION | T_HASH | T_NUL) @@ -308,21 +787,50 @@ deal_with_path: /* find the scheme: */ s = uri; - while ((uri_delims[*(unsigned char *)s] & NOTEND_SCHEME) == 0) { + /* first char must be letter */ + if (uri_delims[*(unsigned char *)s] & T_ALPHA) { ++s; + while ((uri_delims[*(unsigned char *)s] & (T_ALPHA|T_SCHEME))) + ++s; } /* scheme must be non-empty and followed by : */ - if (s == uri || s[0] != ':') { - goto deal_with_path; /* backwards predicted taken! */ + if (s != uri && s[0] == ':') { + uptr->scheme = apr_pstrmemdup(p, uri, s - uri); + s++; + } + else { + /* No valid scheme, restart from the beginning */ + s = uri; } - uptr->scheme = apr_pstrmemdup(p, uri, s - uri); - if (s[1] != '/' || s[2] != '/') { - uri = s + 1; + if (s[0] != '/' || s[1] != '/') { + if (uri == s) { + /* + * RFC 3986 3.3: If we have no scheme and no authority, + * the leading segment of a relative path must not contain a ':'. + */ + char *first_slash = strchr(uri, '/'); + if (first_slash) { + while (s < first_slash) { + if (s[0] == ':') + return APR_EGENERAL; + ++s; + } + /* no scheme but relative path, e.g. '../image.jpg' */ + } + else { + if (strchr(uri, ':') != NULL) + return APR_EGENERAL; + /* no scheme, no slash, but relative path, e.g. 'image.jpg' */ + } + goto deal_with_path; + } + /* scheme and relative path */ + uri = s; goto deal_with_path; } - s += 3; + s += 2; deal_with_authority: hostinfo = s; @@ -334,7 +842,7 @@ deal_with_authority: /* If there's a username:password@host:port, the @ we want is the last @... * too bad there's no memrchr()... For the C purists, note that hostinfo - * is definately not the first character of the original uri so therefore + * is definitely not the first character of the original uri so therefore * &hostinfo[-1] < &hostinfo[0] ... and this loop is valid C. */ do { diff --git a/contrib/apr/CHANGES b/contrib/apr/CHANGES index f3213bfc09f2..51d12367195a 100644 --- a/contrib/apr/CHANGES +++ b/contrib/apr/CHANGES @@ -1,11 +1,73 @@ -*- coding: utf-8 -*- +Changes for APR 1.4.8 + + *) Fix compiltation with FreeBSD on ARM. [Olli Hauer <ohauer gmx.de>] + + *) Fix 1.4.7 regression in apr_mcast_hops() and apr_mcast_loopback() + for AF_INET (IPv4) sockets on most Unix platforms. [Joe Orton] + + *) Fix the return value of apr_threadattr_detach_get() on some + platforms like OS X and Solaris. [Rainer Jung, <dusanv gmail com>] + +Changes for APR 1.4.7 + + *) Fix apr_sockaddr_info_get() not returning an error in some cases. + PR 54779. [Jan Kaluža <jkaluza redhat com>] + + *) Fix amd64 assembler version of apr_atomic_xchgptr(). PR 51851. [Mattias + Engdegård <mattiase acm org>] + + *) Fix PPC atomics to work with gcc 4.0. PR 54840. [Mattias Engdegård + <mattiase acm org>] + + *) configure: Fix detection of O_NONBLOCK inheritance on busy + systems. [Rainer Jung] + + *) Remove unused code, fix strict C compliance bug in SHA-256 + implementation. [Jan Kaluza <jkaluza redhat.com>] + + *) Fix apr_ipsubnet_test() false positives when comparing IPv4 + subnet representation against an IPv6 address. PR 54047. [Joe Orton] + + *) apr_socket_accept_filter: Return success when trying to again set + the filter to the same value as before, avoiding an unhelpful + APR_EINVAL. PR 37863. [Jeff Trawick] + + *) configure: Fix Linux 3.x detection. PR 54001. [Gilles Espinasse + <g esp free fr>] + + *) apr_time_exp_*() on Windows: Fix error in the tm_yday field of + apr_time_exp_t for times within leap years. PR 53175. + [Jeff Trawick] + + *) Improve platform detection by updating config.guess and config.sub. + [Rainer Jung] + + *) Add support for OSX Mountain Lion (10.8) [Jim Jagielski] + + *) Add various gcc function attributes. [Stefan Fritsch] + + *) Fix some problems in apr_sockaddr_info_get() when trying to resolve + the loopback addresses of a protocol family that is not otherwise + configured on the system. PR 52709. [Nirgal Vourgère + <jmv_deb nirgal com>, Stefan Fritsch] + + *) Fix file not being unlocked if truncate call on a file fails. + [Mladen Turk] + + *) apr_mcast_hops: Fix EINVAL for IPv6 sockets caused by using byte + instead integer for setsockopt. [Mladen Turk] + + *) Windows: Fix compile-time checks for 64-bit builds, resolving a + crash in httpd's mod_rewrite. PR 49155. [<anindyabaruah gmail.com>] + Changes for APR 1.4.6 *) Flush write buffer before truncate call on a file. [Mladen Turk] - *) Security: oCERT-2011-003 - Randomise hashes by providing a seed. + *) Randomise hashes by providing a seed. + Assigned CVE-2012-0840, oCERT-2011-003, but not known to be exploitable. [Bojan Smojver, Branko Čibej, Ruediger Pluem et al.] *) apr_random: Prevent segfault if pool used to initialize apr_random is diff --git a/contrib/apr/Makefile.win b/contrib/apr/Makefile.win index d2090f3f8fef..5f9c3133f452 100644 --- a/contrib/apr/Makefile.win +++ b/contrib/apr/Makefile.win @@ -25,7 +25,7 @@ # # For example; # -# nmake -f Makefile.win PREFIX=C:\APR buildall checkall installall clean +# nmake -f Makefile.win PREFIX=C:\APR buildall checkall install clean # !IF EXIST("apr.sln") && ([devenv /help > NUL 2>&1] == 0) \ diff --git a/contrib/apr/apr.spec b/contrib/apr/apr.spec index abecbdfd6761..40204ffa049a 100644 --- a/contrib/apr/apr.spec +++ b/contrib/apr/apr.spec @@ -3,7 +3,7 @@ Summary: Apache Portable Runtime library Name: apr -Version: 1.4.6 +Version: 1.4.8 Release: 1 License: Apache Software License Group: System Environment/Libraries diff --git a/contrib/apr/atomic/unix/ia32.c b/contrib/apr/atomic/unix/ia32.c index 3826f9275509..63f48a753a9f 100644 --- a/contrib/apr/atomic/unix/ia32.c +++ b/contrib/apr/atomic/unix/ia32.c @@ -117,7 +117,7 @@ APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with) #elif APR_SIZEOF_VOIDP == 8 asm volatile ("xchgq %q2, %1" : "=a" (prev), "+m" (*mem) - : "r" ((unsigned long)with)); + : "0" (with)); #else #error APR_SIZEOF_VOIDP value not supported #endif diff --git a/contrib/apr/atomic/unix/ppc.c b/contrib/apr/atomic/unix/ppc.c index db9fca934d3e..ae8d503cc4d2 100644 --- a/contrib/apr/atomic/unix/ppc.c +++ b/contrib/apr/atomic/unix/ppc.c @@ -19,7 +19,7 @@ #ifdef USE_ATOMICS_PPC #ifdef PPC405_ERRATA -# define PPC405_ERR77_SYNC " sync\n" +# define PPC405_ERR77_SYNC " sync\n" #else # define PPC405_ERR77_SYNC #endif @@ -43,12 +43,12 @@ APR_DECLARE(apr_uint32_t) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint3 { apr_uint32_t prev, temp; - asm volatile ("loop_%=:\n" /* lost reservation */ - " lwarx %0,0,%3\n" /* load and reserve */ - " add %1,%0,%4\n" /* add val and prev */ - PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ - " stwcx. %1,0,%3\n" /* store new value */ - " bne- loop_%=\n" /* loop if lost */ + asm volatile ("1:\n" /* lost reservation */ + " lwarx %0,0,%3\n" /* load and reserve */ + " add %1,%0,%4\n" /* add val and prev */ + PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ + " stwcx. %1,0,%3\n" /* store new value */ + " bne- 1b\n" /* loop if lost */ : "=&r" (prev), "=&r" (temp), "=m" (*mem) : "b" (mem), "r" (val) : "cc", "memory"); @@ -60,12 +60,12 @@ APR_DECLARE(void) apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val) { apr_uint32_t temp; - asm volatile ("loop_%=:\n" /* lost reservation */ - " lwarx %0,0,%2\n" /* load and reserve */ - " subf %0,%3,%0\n" /* subtract val */ - PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ - " stwcx. %0,0,%2\n" /* store new value */ - " bne- loop_%=\n" /* loop if lost */ + asm volatile ("1:\n" /* lost reservation */ + " lwarx %0,0,%2\n" /* load and reserve */ + " subf %0,%3,%0\n" /* subtract val */ + PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ + " stwcx. %0,0,%2\n" /* store new value */ + " bne- 1b\n" /* loop if lost */ : "=&r" (temp), "=m" (*mem) : "b" (mem), "r" (val) : "cc", "memory"); @@ -75,13 +75,13 @@ APR_DECLARE(apr_uint32_t) apr_atomic_inc32(volatile apr_uint32_t *mem) { apr_uint32_t prev; - asm volatile ("loop_%=:\n" /* lost reservation */ - " lwarx %0,0,%2\n" /* load and reserve */ - " addi %0,%0,1\n" /* add immediate */ - PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ - " stwcx. %0,0,%2\n" /* store new value */ - " bne- loop_%=\n" /* loop if lost */ - " subi %0,%0,1\n" /* return old value */ + asm volatile ("1:\n" /* lost reservation */ + " lwarx %0,0,%2\n" /* load and reserve */ + " addi %0,%0,1\n" /* add immediate */ + PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ + " stwcx. %0,0,%2\n" /* store new value */ + " bne- 1b\n" /* loop if lost */ + " subi %0,%0,1\n" /* return old value */ : "=&b" (prev), "=m" (*mem) : "b" (mem), "m" (*mem) : "cc", "memory"); @@ -93,12 +93,12 @@ APR_DECLARE(int) apr_atomic_dec32(volatile apr_uint32_t *mem) { apr_uint32_t prev; - asm volatile ("loop_%=:\n" /* lost reservation */ - " lwarx %0,0,%2\n" /* load and reserve */ - " subi %0,%0,1\n" /* subtract immediate */ - PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ - " stwcx. %0,0,%2\n" /* store new value */ - " bne- loop_%=\n" /* loop if lost */ + asm volatile ("1:\n" /* lost reservation */ + " lwarx %0,0,%2\n" /* load and reserve */ + " subi %0,%0,1\n" /* subtract immediate */ + PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ + " stwcx. %0,0,%2\n" /* store new value */ + " bne- 1b\n" /* loop if lost */ : "=&b" (prev), "=m" (*mem) : "b" (mem), "m" (*mem) : "cc", "memory"); @@ -111,14 +111,14 @@ APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint3 { apr_uint32_t prev; - asm volatile ("loop_%=:\n" /* lost reservation */ - " lwarx %0,0,%1\n" /* load and reserve */ - " cmpw %0,%3\n" /* compare operands */ - " bne- exit_%=\n" /* skip if not equal */ - PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ - " stwcx. %2,0,%1\n" /* store new value */ - " bne- loop_%=\n" /* loop if lost */ - "exit_%=:\n" /* not equal */ + asm volatile ("1:\n" /* lost reservation */ + " lwarx %0,0,%1\n" /* load and reserve */ + " cmpw %0,%3\n" /* compare operands */ + " bne- exit_%=\n" /* skip if not equal */ + PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ + " stwcx. %2,0,%1\n" /* store new value */ + " bne- 1b\n" /* loop if lost */ + "exit_%=:\n" /* not equal */ : "=&r" (prev) : "b" (mem), "r" (with), "r" (cmp) : "cc", "memory"); @@ -130,11 +130,11 @@ APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint { apr_uint32_t prev; - asm volatile ("loop_%=:\n" /* lost reservation */ - " lwarx %0,0,%1\n" /* load and reserve */ - PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ - " stwcx. %2,0,%1\n" /* store new value */ - " bne- loop_%=" /* loop if lost */ + asm volatile ("1:\n" /* lost reservation */ + " lwarx %0,0,%1\n" /* load and reserve */ + PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ + " stwcx. %2,0,%1\n" /* store new value */ + " bne- 1b" /* loop if lost */ : "=&r" (prev) : "b" (mem), "r" (val) : "cc", "memory"); @@ -146,26 +146,26 @@ APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void { void *prev; #if APR_SIZEOF_VOIDP == 4 - asm volatile ("loop_%=:\n" /* lost reservation */ - " lwarx %0,0,%1\n" /* load and reserve */ - " cmpw %0,%3\n" /* compare operands */ - " bne- exit_%=\n" /* skip if not equal */ - PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ - " stwcx. %2,0,%1\n" /* store new value */ - " bne- loop_%=\n" /* loop if lost */ - "exit_%=:\n" /* not equal */ + asm volatile ("1:\n" /* lost reservation */ + " lwarx %0,0,%1\n" /* load and reserve */ + " cmpw %0,%3\n" /* compare operands */ + " bne- 2f\n" /* skip if not equal */ + PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ + " stwcx. %2,0,%1\n" /* store new value */ + " bne- 1b\n" /* loop if lost */ + "2:\n" /* not equal */ : "=&r" (prev) : "b" (mem), "r" (with), "r" (cmp) : "cc", "memory"); #elif APR_SIZEOF_VOIDP == 8 - asm volatile ("loop_%=:\n" /* lost reservation */ - " ldarx %0,0,%1\n" /* load and reserve */ - " cmpd %0,%3\n" /* compare operands */ - " bne- exit_%=\n" /* skip if not equal */ - PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ - " stdcx. %2,0,%1\n" /* store new value */ - " bne- loop_%=\n" /* loop if lost */ - "exit_%=:\n" /* not equal */ + asm volatile ("1:\n" /* lost reservation */ + " ldarx %0,0,%1\n" /* load and reserve */ + " cmpd %0,%3\n" /* compare operands */ + " bne- 2f\n" /* skip if not equal */ + PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ + " stdcx. %2,0,%1\n" /* store new value */ + " bne- 1b\n" /* loop if lost */ + "2:\n" /* not equal */ : "=&r" (prev) : "b" (mem), "r" (with), "r" (cmp) : "cc", "memory"); @@ -179,22 +179,22 @@ APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with) { void *prev; #if APR_SIZEOF_VOIDP == 4 - asm volatile ("loop_%=:\n" /* lost reservation */ - " lwarx %0,0,%1\n" /* load and reserve */ - PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ - " stwcx. %2,0,%1\n" /* store new value */ - " bne- loop_%=\n" /* loop if lost */ - " isync\n" /* memory barrier */ + asm volatile ("1:\n" /* lost reservation */ + " lwarx %0,0,%1\n" /* load and reserve */ + PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ + " stwcx. %2,0,%1\n" /* store new value */ + " bne- 1b\n" /* loop if lost */ + " isync\n" /* memory barrier */ : "=&r" (prev) : "b" (mem), "r" (with) : "cc", "memory"); #elif APR_SIZEOF_VOIDP == 8 - asm volatile ("loop_%=:\n" /* lost reservation */ - " ldarx %0,0,%1\n" /* load and reserve */ - PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ - " stdcx. %2,0,%1\n" /* store new value */ - " bne- loop_%=\n" /* loop if lost */ - " isync\n" /* memory barrier */ + asm volatile ("1:\n" /* lost reservation */ + " ldarx %0,0,%1\n" /* load and reserve */ + PPC405_ERR77_SYNC /* ppc405 Erratum 77 */ + " stdcx. %2,0,%1\n" /* store new value */ + " bne- 1b\n" /* loop if lost */ + " isync\n" /* memory barrier */ : "=&r" (prev) : "b" (mem), "r" (with) : "cc", "memory"); diff --git a/contrib/apr/atomic/unix/s390.c b/contrib/apr/atomic/unix/s390.c index 3e2332077f43..b6b6f42de02d 100644 --- a/contrib/apr/atomic/unix/s390.c +++ b/contrib/apr/atomic/unix/s390.c @@ -38,10 +38,10 @@ static APR_INLINE apr_uint32_t atomic_add(volatile apr_uint32_t *mem, apr_uint32 apr_uint32_t prev = *mem, temp; asm volatile ("loop_%=:\n" - " lr %1,%0\n" - " alr %1,%3\n" - " cs %0,%1,%2\n" - " jl loop_%=\n" + " lr %1,%0\n" + " alr %1,%3\n" + " cs %0,%1,%2\n" + " jl loop_%=\n" : "+d" (prev), "+d" (temp), "=Q" (*mem) : "d" (val), "m" (*mem) : "cc", "memory"); @@ -64,10 +64,10 @@ static APR_INLINE apr_uint32_t atomic_sub(volatile apr_uint32_t *mem, apr_uint32 apr_uint32_t prev = *mem, temp; asm volatile ("loop_%=:\n" - " lr %1,%0\n" - " slr %1,%3\n" - " cs %0,%1,%2\n" - " jl loop_%=\n" + " lr %1,%0\n" + " slr %1,%3\n" + " cs %0,%1,%2\n" + " jl loop_%=\n" : "+d" (prev), "+d" (temp), "=Q" (*mem) : "d" (val), "m" (*mem) : "cc", "memory"); @@ -88,7 +88,7 @@ APR_DECLARE(int) apr_atomic_dec32(volatile apr_uint32_t *mem) APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint32_t with, apr_uint32_t cmp) { - asm volatile (" cs %0,%2,%1\n" + asm volatile (" cs %0,%2,%1\n" : "+d" (cmp), "=Q" (*mem) : "d" (with), "m" (*mem) : "cc", "memory"); @@ -101,8 +101,8 @@ APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint apr_uint32_t prev = *mem; asm volatile ("loop_%=:\n" - " cs %0,%2,%1\n" - " jl loop_%=\n" + " cs %0,%2,%1\n" + " jl loop_%=\n" : "+d" (prev), "=Q" (*mem) : "d" (val), "m" (*mem) : "cc", "memory"); @@ -114,12 +114,12 @@ APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void { void *prev = (void *) cmp; #if APR_SIZEOF_VOIDP == 4 - asm volatile (" cs %0,%2,%1\n" + asm volatile (" cs %0,%2,%1\n" : "+d" (prev), "=Q" (*mem) : "d" (with), "m" (*mem) : "cc", "memory"); #elif APR_SIZEOF_VOIDP == 8 - asm volatile (" csg %0,%2,%1\n" + asm volatile (" csg %0,%2,%1\n" : "+d" (prev), "=Q" (*mem) : "d" (with), "m" (*mem) : "cc", "memory"); @@ -134,15 +134,15 @@ APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with) void *prev = (void *) *mem; #if APR_SIZEOF_VOIDP == 4 asm volatile ("loop_%=:\n" - " cs %0,%2,%1\n" - " jl loop_%=\n" + " cs %0,%2,%1\n" + " jl loop_%=\n" : "+d" (prev), "=Q" (*mem) : "d" (with), "m" (*mem) : "cc", "memory"); #elif APR_SIZEOF_VOIDP == 8 asm volatile ("loop_%=:\n" - " csg %0,%2,%1\n" - " jl loop_%=\n" + " csg %0,%2,%1\n" + " jl loop_%=\n" : "+d" (prev), "=Q" (*mem) : "d" (with), "m" (*mem) : "cc", "memory"); diff --git a/contrib/apr/configure b/contrib/apr/configure index cee0f0e635db..00122df8871f 100755 --- a/contrib/apr/configure +++ b/contrib/apr/configure @@ -1,11 +1,9 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68. +# Generated by GNU Autoconf 2.69. # # -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software -# Foundation, Inc. +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation @@ -134,6 +132,31 @@ export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh @@ -167,7 +190,8 @@ if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi -test x\$exitcode = x0 || exit 1" +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && @@ -220,21 +244,25 @@ IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : - # We cannot yet assume a decent shell, so we have to provide a - # neutralization value for shells without unset; and this also - # works around shells that cannot unset nonexistent variables. - # Preserve -v and -x to the replacement shell. - BASH_ENV=/dev/null - ENV=/dev/null - (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV - export CONFIG_SHELL - case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; - esac - exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 fi if test x$as_have_required = xno; then : @@ -336,6 +364,14 @@ $as_echo X"$as_dir" | } # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take @@ -457,6 +493,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). @@ -491,16 +531,16 @@ if (echo >conf$$.file) 2>/dev/null; then # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -512,28 +552,8 @@ else as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -1371,8 +1391,6 @@ target=$target_alias if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used" >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi @@ -1642,9 +1660,9 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure -generated by GNU Autoconf 2.68 +generated by GNU Autoconf 2.69 -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1917,7 +1935,7 @@ $as_echo "$ac_try_echo"; } >&5 test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext + test -x conftest$ac_exeext }; then : ac_retval=0 else @@ -2074,7 +2092,8 @@ int main () { static int test_array [1 - 2 * !(($2) >= 0)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -2090,7 +2109,8 @@ int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -2116,7 +2136,8 @@ int main () { static int test_array [1 - 2 * !(($2) < 0)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -2132,7 +2153,8 @@ int main () { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -2166,7 +2188,8 @@ int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -2342,7 +2365,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was -generated by GNU Autoconf 2.68. Invocation command line was +generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3192,14 +3215,6 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # _LT_LANG - -############################################################ -# 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 #m4_ifndef @@ -5069,7 +5084,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5109,7 +5124,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5162,7 +5177,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5203,7 +5218,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue @@ -5261,7 +5276,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5305,7 +5320,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5751,8 +5766,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <stdarg.h> #include <stdio.h> -#include <sys/types.h> -#include <sys/stat.h> +struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); @@ -5860,7 +5874,7 @@ do for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue + as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in @@ -6444,83 +6458,12 @@ if test "x$apr_preload_done" != "xyes" ; then ;; *-linux*) - case `uname -r` in - 2.* ) - if test "x$CPPFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting CPPFLAGS to \"-DLINUX=2\"" - CPPFLAGS="-DLINUX=2" - else - apr_addto_bugger="-DLINUX=2" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $CPPFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to CPPFLAGS" - CPPFLAGS="$CPPFLAGS $i" - fi - done - fi - - ;; - 1.* ) - if test "x$CPPFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting CPPFLAGS to \"-DLINUX=1\"" - CPPFLAGS="-DLINUX=1" - else - apr_addto_bugger="-DLINUX=1" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $CPPFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to CPPFLAGS" - CPPFLAGS="$CPPFLAGS $i" - fi - done - fi - - ;; - * ) - ;; - esac - - if test "x$CPPFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting CPPFLAGS to \"-D_REENTRANT -D_GNU_SOURCE\"" - CPPFLAGS="-D_REENTRANT -D_GNU_SOURCE" - else - apr_addto_bugger="-D_REENTRANT -D_GNU_SOURCE" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $CPPFLAGS; do - if test "x$i" = "x$j"; then - apr_addto_duplicate="1" - break - fi - done - if test $apr_addto_duplicate = "0"; then - test "x$silent" != "xyes" && echo " adding \"$i\" to CPPFLAGS" - CPPFLAGS="$CPPFLAGS $i" - fi - done - fi - - ;; - *-GNU*) if test "x$CPPFLAGS" = "x"; then - test "x$silent" != "xyes" && echo " setting CPPFLAGS to \"-DHURD -D_GNU_SOURCE\"" - CPPFLAGS="-DHURD -D_GNU_SOURCE" + test "x$silent" != "xyes" && echo " setting CPPFLAGS to \"-DLINUX -D_REENTRANT -D_GNU_SOURCE\"" + CPPFLAGS="-DLINUX -D_REENTRANT -D_GNU_SOURCE" else - apr_addto_bugger="-DHURD -D_GNU_SOURCE" + apr_addto_bugger="-DLINUX -D_REENTRANT -D_GNU_SOURCE" for i in $apr_addto_bugger; do apr_addto_duplicate="0" for j in $CPPFLAGS; do @@ -6770,6 +6713,29 @@ if test "x$apr_preload_done" != "xyes" ; then fi ;; + *-gnu*|*-GNU*) + + if test "x$CPPFLAGS" = "x"; then + test "x$silent" != "xyes" && echo " setting CPPFLAGS to \"-D_REENTRANT -D_GNU_SOURCE -DHURD\"" + CPPFLAGS="-D_REENTRANT -D_GNU_SOURCE -DHURD" + else + apr_addto_bugger="-D_REENTRANT -D_GNU_SOURCE -DHURD" + for i in $apr_addto_bugger; do + apr_addto_duplicate="0" + for j in $CPPFLAGS; do + if test "x$i" = "x$j"; then + apr_addto_duplicate="1" + break + fi + done + if test $apr_addto_duplicate = "0"; then + test "x$silent" != "xyes" && echo " adding \"$i\" to CPPFLAGS" + CPPFLAGS="$CPPFLAGS $i" + fi + done + fi + + ;; *-next-nextstep*) if test -z "$CFLAGS"; then @@ -6898,7 +6864,7 @@ if test "x$apr_preload_done" != "xyes" ; then fi # See issue 34332 ;; - *-apple-darwin1[01].*) + *-apple-darwin1?.*) if test "x$CPPFLAGS" = "x"; then test "x$silent" != "xyes" && echo " setting CPPFLAGS to \"-DDARWIN_10\"" @@ -9512,7 +9478,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -9564,7 +9530,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -9604,7 +9570,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -9676,7 +9642,7 @@ case $as_dir/ in #(( # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. @@ -9748,7 +9714,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RM="rm" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -9785,7 +9751,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AS="as" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -9822,7 +9788,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ASCPP="cpp" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -9860,7 +9826,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="${ac_tool_prefix}ar" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -9900,7 +9866,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="ar" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -9955,7 +9921,7 @@ do for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in @@ -10021,7 +9987,7 @@ do for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in @@ -10228,8 +10194,8 @@ else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -# define __EXTENSIONS__ 1 - $ac_includes_default +# define __EXTENSIONS__ 1 + $ac_includes_default int main () { @@ -10421,7 +10387,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AS="${ac_tool_prefix}as" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -10461,7 +10427,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AS="as" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -10513,7 +10479,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -10553,7 +10519,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -10605,7 +10571,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -10645,7 +10611,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -10819,7 +10785,7 @@ do for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue + as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in @@ -10898,7 +10864,7 @@ do for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue + as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in @@ -11154,7 +11120,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -11198,7 +11164,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -11611,7 +11577,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -11651,7 +11617,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -11954,7 +11920,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -11994,7 +11960,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -12094,7 +12060,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -12138,7 +12104,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -12263,7 +12229,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -12303,7 +12269,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -12362,7 +12328,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -12402,7 +12368,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -13051,7 +13017,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -13091,7 +13057,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -13171,7 +13137,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -13211,7 +13177,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -13263,7 +13229,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -13303,7 +13269,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -13355,7 +13321,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -13395,7 +13361,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -13447,7 +13413,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -13487,7 +13453,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -13539,7 +13505,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -13579,7 +13545,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -21805,23 +21771,20 @@ else /* end confdefs.h. */ $ac_includes_default int -find_stack_direction () +find_stack_direction (int *addr, int depth) { - static char *addr = 0; - auto char dummy; - if (addr == 0) - { - addr = &dummy; - return find_stack_direction (); - } - else - return (&dummy > addr) ? 1 : -1; + int dir, dummy = 0; + if (! addr) + addr = &dummy; + *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1; + dir = depth ? find_stack_direction (addr, depth - 1) : 0; + return dir + dummy; } int -main () +main (int argc, char **argv) { - return find_stack_direction () < 0; + return find_stack_direction (0, argc + !argv + 20) < 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : @@ -22960,11 +22923,11 @@ else int main () { -/* FIXME: Include the comments suggested by Paul. */ + #ifndef __cplusplus - /* Ultrix mips cc rejects this. */ + /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; - const charset cs; + const charset cs = { 0, 0 }; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; @@ -22981,8 +22944,9 @@ main () ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; - { /* SCO 3.2v4 cc rejects this. */ - char *t; + { /* SCO 3.2v4 cc rejects this sort of thing. */ + char tx; + char *t = &tx; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; @@ -22998,10 +22962,10 @@ main () iptr p = 0; ++p; } - { /* AIX XL C 1.02.0.0 rejects this saying + { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ - struct s { int j; const int *ap[3]; }; - struct s *b; b->j = 5; + struct s { int j; const int *ap[3]; } bx; + struct s *b = &bx; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; @@ -27149,13 +27113,24 @@ else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#ifdef HAVE_STDLIB_H +#include <stdlib.h> +#endif +#ifdef HAVE_STRING_H +#include <string.h> +#endif +#ifdef HAVE_STDIO_H #include <stdio.h> +#endif #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> #endif #ifdef HAVE_SYS_SOCKET_H #include <sys/socket.h> #endif +#ifdef HAVE_SYS_SELECT_H +#include <sys/select.h> +#endif #ifdef HAVE_NETINET_IN_H #include <netinet/in.h> #endif @@ -27226,6 +27201,26 @@ int main(void) { exit(1); } sa_len = sizeof sa; + /* 1 second select timeout */ + tv.tv_sec = 1; + tv.tv_usec = 0; + /* Set up fd set */ + FD_ZERO(&fds); + FD_SET(listen_s, &fds); + /* Wait for socket to become readable */ + rc = select(listen_s + 1, &fds, NULL, NULL, &tv); + if (rc < 0) { + perror("select"); + exit(1); + } + if (rc == 0) { + fprintf(stderr, "Socket failed to become readable (timeout)\n"); + exit(1); + } + if (!FD_ISSET(listen_s, &fds)) { + fprintf(stderr, "Socket failed to become readable (selected another fd)\n"); + exit(1); + } connected_s = accept(listen_s, (struct sockaddr *)&sa, &sa_len); if (connected_s < 0) { perror("accept"); @@ -28875,16 +28870,16 @@ if (echo >conf$$.file) 2>/dev/null; then # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -28944,28 +28939,16 @@ else as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -28987,7 +28970,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # values after options handling. ac_log=" This file was extended by $as_me, which was -generated by GNU Autoconf 2.68. Invocation command line was +generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -29053,10 +29036,10 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.68, +configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -29146,7 +29129,7 @@ fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then - set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' diff --git a/contrib/apr/docs/pool-design.html b/contrib/apr/docs/pool-design.html index f039d46552de..90d845257c1a 100644 --- a/contrib/apr/docs/pool-design.html +++ b/contrib/apr/docs/pool-design.html @@ -4,7 +4,7 @@ </head> <body> <div align="right"> - Last modified at [$Date: 2004-11-25 09:51:51 +1100 (Thu, 25 Nov 2004) $] + Last modified at [$Date: 2004-11-24 17:51:51 -0500 (Wed, 24 Nov 2004) $] </div> <h1>Using APR Pools</h1> diff --git a/contrib/apr/file_io/unix/seek.c b/contrib/apr/file_io/unix/seek.c index e70805d7f5d7..3f5aa00e9567 100644 --- a/contrib/apr/file_io/unix/seek.c +++ b/contrib/apr/file_io/unix/seek.c @@ -117,10 +117,10 @@ apr_status_t apr_file_trunc(apr_file_t *fp, apr_off_t offset) /* Reset buffer positions for write mode */ fp->bufpos = fp->direction = fp->dataRead = 0; } + file_unlock(fp); if (rc) { return rc; } - file_unlock(fp); } if (ftruncate(fp->filedes, offset) == -1) { return errno; diff --git a/contrib/apr/include/apr.hw b/contrib/apr/include/apr.hw index 0aaa62c63ee6..a75bc602943d 100644 --- a/contrib/apr/include/apr.hw +++ b/contrib/apr/include/apr.hw @@ -36,6 +36,12 @@ * for Win32 or Netware by those build environments, respectively. */ +/* Make sure we have our platform identifier macro defined we ask for later. + */ +#if defined(_WIN32) && !defined(WIN32) +#define WIN32 1 +#endif + #if defined(WIN32) || defined(DOXYGEN) /* Ignore most warnings (back down to /W3) for poorly constructed headers @@ -377,7 +383,7 @@ typedef int apr_off_t; typedef int apr_socklen_t; typedef apr_uint64_t apr_ino_t; -#ifdef WIN64 +#ifdef _WIN64 #define APR_SIZEOF_VOIDP 8 #else #define APR_SIZEOF_VOIDP 4 @@ -552,7 +558,7 @@ typedef apr_uint32_t apr_uintptr_t; #define APR_DECLARE_DATA __declspec(dllimport) #endif -#ifdef WIN64 +#ifdef _WIN64 #define APR_SSIZE_T_FMT "I64d" #define APR_SIZE_T_FMT "I64u" #else diff --git a/contrib/apr/include/apr_allocator.h b/contrib/apr/include/apr_allocator.h index 5aaeb1b2faf9..5d6677645db7 100644 --- a/contrib/apr/include/apr_allocator.h +++ b/contrib/apr/include/apr_allocator.h @@ -71,7 +71,8 @@ struct apr_memnode_t { * @param allocator The allocator we have just created. * */ -APR_DECLARE(apr_status_t) apr_allocator_create(apr_allocator_t **allocator); +APR_DECLARE(apr_status_t) apr_allocator_create(apr_allocator_t **allocator) + __attribute__((nonnull(1))); /** * Destroy an allocator @@ -79,7 +80,8 @@ APR_DECLARE(apr_status_t) apr_allocator_create(apr_allocator_t **allocator); * @remark Any memnodes not given back to the allocator prior to destroying * will _not_ be free()d. */ -APR_DECLARE(void) apr_allocator_destroy(apr_allocator_t *allocator); +APR_DECLARE(void) apr_allocator_destroy(apr_allocator_t *allocator) + __attribute__((nonnull(1))); /** * Allocate a block of mem from the allocator @@ -88,7 +90,8 @@ APR_DECLARE(void) apr_allocator_destroy(apr_allocator_t *allocator); * memnode structure) */ APR_DECLARE(apr_memnode_t *) apr_allocator_alloc(apr_allocator_t *allocator, - apr_size_t size); + apr_size_t size) + __attribute__((nonnull(1))); /** * Free a list of blocks of mem, giving them back to the allocator. @@ -98,7 +101,8 @@ APR_DECLARE(apr_memnode_t *) apr_allocator_alloc(apr_allocator_t *allocator, * @param memnode The memory node to return */ APR_DECLARE(void) apr_allocator_free(apr_allocator_t *allocator, - apr_memnode_t *memnode); + apr_memnode_t *memnode) + __attribute__((nonnull(1,2))); #include "apr_pools.h" @@ -114,13 +118,15 @@ APR_DECLARE(void) apr_allocator_free(apr_allocator_t *allocator, * the allocator will never be destroyed. */ APR_DECLARE(void) apr_allocator_owner_set(apr_allocator_t *allocator, - apr_pool_t *pool); + apr_pool_t *pool) + __attribute__((nonnull(1))); /** * Get the current owner of the allocator * @param allocator The allocator to get the owner from */ -APR_DECLARE(apr_pool_t *) apr_allocator_owner_get(apr_allocator_t *allocator); +APR_DECLARE(apr_pool_t *) apr_allocator_owner_get(apr_allocator_t *allocator) + __attribute__((nonnull(1))); /** * Set the current threshold at which the allocator should start @@ -129,7 +135,8 @@ APR_DECLARE(apr_pool_t *) apr_allocator_owner_get(apr_allocator_t *allocator); * @param size The threshold. 0 == unlimited. */ APR_DECLARE(void) apr_allocator_max_free_set(apr_allocator_t *allocator, - apr_size_t size); + apr_size_t size) + __attribute__((nonnull(1))); #include "apr_thread_mutex.h" @@ -140,14 +147,16 @@ APR_DECLARE(void) apr_allocator_max_free_set(apr_allocator_t *allocator, * @param mutex The mutex */ APR_DECLARE(void) apr_allocator_mutex_set(apr_allocator_t *allocator, - apr_thread_mutex_t *mutex); + apr_thread_mutex_t *mutex) + __attribute__((nonnull(1))); /** * Get the mutex currently set for the allocator * @param allocator The allocator */ APR_DECLARE(apr_thread_mutex_t *) apr_allocator_mutex_get( - apr_allocator_t *allocator); + apr_allocator_t *allocator) + __attribute__((nonnull(1))); #endif /* APR_HAS_THREADS */ diff --git a/contrib/apr/include/apr_general.h b/contrib/apr/include/apr_general.h index 1b7de93cdbed..c7389ec92969 100644 --- a/contrib/apr/include/apr_general.h +++ b/contrib/apr/include/apr_general.h @@ -76,7 +76,7 @@ typedef int apr_signum_t; * @return offset */ -#if defined(CRAY) || (defined(__arm) && !defined(LINUX) && !defined(__FreeBSD__)) +#if defined(CRAY) || (defined(__arm) && !(defined(LINUX) || defined(__FreeBSD__))) #ifdef __STDC__ #define APR_OFFSET(p_type,field) _Offsetof(p_type,field) #else diff --git a/contrib/apr/include/apr_network_io.h b/contrib/apr/include/apr_network_io.h index 0335da9d7010..8b9209efd703 100644 --- a/contrib/apr/include/apr_network_io.h +++ b/contrib/apr/include/apr_network_io.h @@ -756,6 +756,8 @@ APR_DECLARE(int) apr_ipsubnet_test(apr_ipsubnet_t *ipsub, apr_sockaddr_t *sa); * @param name The accept filter * @param args Any extra args to the accept filter. Passing NULL here removes * the accept filter. + * @bug name and args should have been declared as const char *, as they are in + * APR 2.0 */ apr_status_t apr_socket_accept_filter(apr_socket_t *sock, char *name, char *args); diff --git a/contrib/apr/include/apr_pools.h b/contrib/apr/include/apr_pools.h index 7ae1ed6b61fa..0f0b95e56adc 100644 --- a/contrib/apr/include/apr_pools.h +++ b/contrib/apr/include/apr_pools.h @@ -196,7 +196,8 @@ APR_DECLARE(void) apr_pool_terminate(void); APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, apr_pool_t *parent, apr_abortfunc_t abort_fn, - apr_allocator_t *allocator); + apr_allocator_t *allocator) + __attribute__((nonnull(1))); /** * Create a new pool. @@ -220,7 +221,8 @@ APR_DECLARE(apr_status_t) apr_pool_create_core_ex(apr_pool_t **newpool, */ APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex(apr_pool_t **newpool, apr_abortfunc_t abort_fn, - apr_allocator_t *allocator); + apr_allocator_t *allocator) + __attribute__((nonnull(1))); /** * Debug version of apr_pool_create_ex. @@ -242,7 +244,8 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, apr_pool_t *parent, apr_abortfunc_t abort_fn, apr_allocator_t *allocator, - const char *file_line); + const char *file_line) + __attribute__((nonnull(1))); #if APR_POOL_DEBUG #define apr_pool_create_ex(newpool, parent, abort_fn, allocator) \ @@ -277,7 +280,8 @@ APR_DECLARE(apr_status_t) apr_pool_create_core_ex_debug(apr_pool_t **newpool, APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex_debug(apr_pool_t **newpool, apr_abortfunc_t abort_fn, apr_allocator_t *allocator, - const char *file_line); + const char *file_line) + __attribute__((nonnull(1))); #if APR_POOL_DEBUG #define apr_pool_create_core_ex(newpool, abort_fn, allocator) \ @@ -343,7 +347,8 @@ APR_DECLARE(apr_status_t) apr_pool_create_unmanaged(apr_pool_t **newpool); * Find the pool's allocator * @param pool The pool to get the allocator from. */ -APR_DECLARE(apr_allocator_t *) apr_pool_allocator_get(apr_pool_t *pool); +APR_DECLARE(apr_allocator_t *) apr_pool_allocator_get(apr_pool_t *pool) + __attribute__((nonnull(1))); /** * Clear all memory in the pool and run all the cleanups. This also destroys all @@ -353,7 +358,7 @@ APR_DECLARE(apr_allocator_t *) apr_pool_allocator_get(apr_pool_t *pool); * to re-use this memory for the next allocation. * @see apr_pool_destroy() */ -APR_DECLARE(void) apr_pool_clear(apr_pool_t *p); +APR_DECLARE(void) apr_pool_clear(apr_pool_t *p) __attribute__((nonnull(1))); /** * Debug version of apr_pool_clear. @@ -369,7 +374,8 @@ APR_DECLARE(void) apr_pool_clear(apr_pool_t *p); * and don't call apr_pool_destroy_clear directly. */ APR_DECLARE(void) apr_pool_clear_debug(apr_pool_t *p, - const char *file_line); + const char *file_line) + __attribute__((nonnull(1))); #if APR_POOL_DEBUG #define apr_pool_clear(p) \ @@ -382,7 +388,7 @@ APR_DECLARE(void) apr_pool_clear_debug(apr_pool_t *p, * @param p The pool to destroy * @remark This will actually free the memory */ -APR_DECLARE(void) apr_pool_destroy(apr_pool_t *p); +APR_DECLARE(void) apr_pool_destroy(apr_pool_t *p) __attribute__((nonnull(1))); /** * Debug version of apr_pool_destroy. @@ -398,7 +404,8 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *p); * and don't call apr_pool_destroy_debug directly. */ APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *p, - const char *file_line); + const char *file_line) + __attribute__((nonnull(1))); #if APR_POOL_DEBUG #define apr_pool_destroy(p) \ @@ -416,7 +423,11 @@ APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *p, * @param size The amount of memory to allocate * @return The allocated memory */ -APR_DECLARE(void *) apr_palloc(apr_pool_t *p, apr_size_t size); +APR_DECLARE(void *) apr_palloc(apr_pool_t *p, apr_size_t size) +#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) + __attribute__((alloc_size(2))) +#endif + __attribute__((nonnull(1))); /** * Debug version of apr_palloc @@ -427,7 +438,11 @@ APR_DECLARE(void *) apr_palloc(apr_pool_t *p, apr_size_t size); * @return See: apr_palloc */ APR_DECLARE(void *) apr_palloc_debug(apr_pool_t *p, apr_size_t size, - const char *file_line); + const char *file_line) +#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) + __attribute__((alloc_size(2))) +#endif + __attribute__((nonnull(1))); #if APR_POOL_DEBUG #define apr_palloc(p, size) \ @@ -455,7 +470,8 @@ APR_DECLARE(void *) apr_pcalloc(apr_pool_t *p, apr_size_t size); * @return See: apr_pcalloc */ APR_DECLARE(void *) apr_pcalloc_debug(apr_pool_t *p, apr_size_t size, - const char *file_line); + const char *file_line) + __attribute__((nonnull(1))); #if APR_POOL_DEBUG #define apr_pcalloc(p, size) \ @@ -476,21 +492,24 @@ APR_DECLARE(void *) apr_pcalloc_debug(apr_pool_t *p, apr_size_t size, * deal with the error accordingly. */ APR_DECLARE(void) apr_pool_abort_set(apr_abortfunc_t abortfunc, - apr_pool_t *pool); + apr_pool_t *pool) + __attribute__((nonnull(2))); /** * Get the abort function associated with the specified pool. * @param pool The pool for retrieving the abort function. * @return The abort function for the given pool. */ -APR_DECLARE(apr_abortfunc_t) apr_pool_abort_get(apr_pool_t *pool); +APR_DECLARE(apr_abortfunc_t) apr_pool_abort_get(apr_pool_t *pool) + __attribute__((nonnull(1))); /** * Get the parent pool of the specified pool. * @param pool The pool for retrieving the parent pool. * @return The parent of the given pool. */ -APR_DECLARE(apr_pool_t *) apr_pool_parent_get(apr_pool_t *pool); +APR_DECLARE(apr_pool_t *) apr_pool_parent_get(apr_pool_t *pool) + __attribute__((nonnull(1))); /** * Determine if pool a is an ancestor of pool b. @@ -510,7 +529,8 @@ APR_DECLARE(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b); * @param pool The pool to tag * @param tag The tag */ -APR_DECLARE(void) apr_pool_tag(apr_pool_t *pool, const char *tag); +APR_DECLARE(void) apr_pool_tag(apr_pool_t *pool, const char *tag) + __attribute__((nonnull(1))); /* @@ -536,11 +556,11 @@ APR_DECLARE(void) apr_pool_tag(apr_pool_t *pool, const char *tag); * key names is a typical way to help ensure this uniqueness. * */ -APR_DECLARE(apr_status_t) apr_pool_userdata_set( - const void *data, - const char *key, - apr_status_t (*cleanup)(void *), - apr_pool_t *pool); +APR_DECLARE(apr_status_t) apr_pool_userdata_set(const void *data, + const char *key, + apr_status_t (*cleanup)(void *), + apr_pool_t *pool) + __attribute__((nonnull(2,4))); /** * Set the data associated with the current pool @@ -562,10 +582,10 @@ APR_DECLARE(apr_status_t) apr_pool_userdata_set( * */ APR_DECLARE(apr_status_t) apr_pool_userdata_setn( - const void *data, - const char *key, - apr_status_t (*cleanup)(void *), - apr_pool_t *pool); + const void *data, const char *key, + apr_status_t (*cleanup)(void *), + apr_pool_t *pool) + __attribute__((nonnull(2,4))); /** * Return the data associated with the current pool. @@ -574,7 +594,8 @@ APR_DECLARE(apr_status_t) apr_pool_userdata_setn( * @param pool The current pool. */ APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key, - apr_pool_t *pool); + apr_pool_t *pool) + __attribute__((nonnull(1,2,3))); /** @@ -601,10 +622,10 @@ APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key, * to exec - this function is called in the child, obviously! */ APR_DECLARE(void) apr_pool_cleanup_register( - apr_pool_t *p, - const void *data, - apr_status_t (*plain_cleanup)(void *), - apr_status_t (*child_cleanup)(void *)); + apr_pool_t *p, const void *data, + apr_status_t (*plain_cleanup)(void *), + apr_status_t (*child_cleanup)(void *)) + __attribute__((nonnull(3,4))); /** * Register a function to be called when a pool is cleared or destroyed. @@ -619,9 +640,9 @@ APR_DECLARE(void) apr_pool_cleanup_register( * or destroyed */ APR_DECLARE(void) apr_pool_pre_cleanup_register( - apr_pool_t *p, - const void *data, - apr_status_t (*plain_cleanup)(void *)); + apr_pool_t *p, const void *data, + apr_status_t (*plain_cleanup)(void *)) + __attribute__((nonnull(3))); /** * Remove a previously registered cleanup function. @@ -636,7 +657,8 @@ APR_DECLARE(void) apr_pool_pre_cleanup_register( * function */ APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data, - apr_status_t (*cleanup)(void *)); + apr_status_t (*cleanup)(void *)) + __attribute__((nonnull(3))); /** * Replace the child cleanup function of a previously registered cleanup. @@ -651,10 +673,10 @@ APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data, * @param child_cleanup The function to register as the child cleanup */ APR_DECLARE(void) apr_pool_child_cleanup_set( - apr_pool_t *p, - const void *data, - apr_status_t (*plain_cleanup)(void *), - apr_status_t (*child_cleanup)(void *)); + apr_pool_t *p, const void *data, + apr_status_t (*plain_cleanup)(void *), + apr_status_t (*child_cleanup)(void *)) + __attribute__((nonnull(3,4))); /** * Run the specified cleanup function immediately and unregister it. @@ -667,10 +689,9 @@ APR_DECLARE(void) apr_pool_child_cleanup_set( * @param data The data to remove from cleanup * @param cleanup The function to remove from cleanup */ -APR_DECLARE(apr_status_t) apr_pool_cleanup_run( - apr_pool_t *p, - void *data, - apr_status_t (*cleanup)(void *)); +APR_DECLARE(apr_status_t) apr_pool_cleanup_run(apr_pool_t *p, void *data, + apr_status_t (*cleanup)(void *)) + __attribute__((nonnull(3))); /** * An empty cleanup function. @@ -739,7 +760,8 @@ APR_DECLARE(void) apr_pool_cleanup_for_exec(void); * @param p The parent pool * @param sub The subpool */ -APR_DECLARE(void) apr_pool_join(apr_pool_t *p, apr_pool_t *sub); +APR_DECLARE(void) apr_pool_join(apr_pool_t *p, apr_pool_t *sub) + __attribute__((nonnull(2))); /** * Find a pool from something allocated in it. @@ -754,7 +776,8 @@ APR_DECLARE(apr_pool_t *) apr_pool_find(const void *mem); * @param recurse Recurse/include the subpools' sizes * @return The number of bytes */ -APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *p, int recurse); +APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *p, int recurse) + __attribute__((nonnull(1))); /** * Lock a pool diff --git a/contrib/apr/include/apr_strings.h b/contrib/apr/include/apr_strings.h index 6b71ff17eb6f..457217358c8e 100644 --- a/contrib/apr/include/apr_strings.h +++ b/contrib/apr/include/apr_strings.h @@ -106,7 +106,11 @@ APR_DECLARE(char *) apr_pstrdup(apr_pool_t *p, const char *s); * has 'n' or more characters. If the string might contain * fewer characters, use apr_pstrndup. */ -APR_DECLARE(char *) apr_pstrmemdup(apr_pool_t *p, const char *s, apr_size_t n); +APR_DECLARE(char *) apr_pstrmemdup(apr_pool_t *p, const char *s, apr_size_t n) +#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) + __attribute__((alloc_size(3))) +#endif + ; /** * Duplicate at most n characters of a string into memory allocated @@ -128,7 +132,11 @@ APR_DECLARE(char *) apr_pstrndup(apr_pool_t *p, const char *s, apr_size_t n); * @param n The number of bytes to duplicate * @return The new block of memory */ -APR_DECLARE(void *) apr_pmemdup(apr_pool_t *p, const void *m, apr_size_t n); +APR_DECLARE(void *) apr_pmemdup(apr_pool_t *p, const void *m, apr_size_t n) +#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) + __attribute__((alloc_size(3))) +#endif + ; /** * Concatenate multiple strings, allocating memory out a pool diff --git a/contrib/apr/include/apr_thread_proc.h b/contrib/apr/include/apr_thread_proc.h index 7df84ef32abb..0a97c955c4b6 100644 --- a/contrib/apr/include/apr_thread_proc.h +++ b/contrib/apr/include/apr_thread_proc.h @@ -315,7 +315,7 @@ APR_DECLARE(apr_status_t) apr_thread_once(apr_thread_once_t *control, APR_DECLARE(apr_status_t) apr_thread_detach(apr_thread_t *thd); /** - * Return the pool associated with the current thread. + * Return user data associated with the current thread. * @param data The user data associated with the thread. * @param key The key to associate with the data * @param thread The currently open thread. @@ -324,7 +324,7 @@ APR_DECLARE(apr_status_t) apr_thread_data_get(void **data, const char *key, apr_thread_t *thread); /** - * Return the pool associated with the current thread. + * Set user data associated with the current thread. * @param data The user data to associate with the thread. * @param key The key to use for associating the data with the thread * @param cleanup The cleanup routine to use when the thread is destroyed. diff --git a/contrib/apr/include/apr_version.h b/contrib/apr/include/apr_version.h index 81223207ac8b..4b06508eecba 100644 --- a/contrib/apr/include/apr_version.h +++ b/contrib/apr/include/apr_version.h @@ -38,6 +38,9 @@ */ +#define APR_COPYRIGHT "Copyright (c) 2013 The Apache Software " \ + "Foundation or its licensors, as applicable." + /* The numeric compile-time version constants. These constants are the * authoritative version numbers for APR. */ @@ -59,7 +62,7 @@ * The Patch Level never includes API changes, simply bug fixes. * Reset to 0 when upgrading APR_MINOR_VERSION */ -#define APR_PATCH_VERSION 6 +#define APR_PATCH_VERSION 8 /** * The symbol APR_IS_DEV_VERSION is only defined for internal, @@ -87,7 +90,9 @@ #if defined(APR_IS_DEV_VERSION) || defined(DOXYGEN) /** Internal: string form of the "is dev" flag */ +#ifndef APR_IS_DEV_STRING #define APR_IS_DEV_STRING "-dev" +#endif #else #define APR_IS_DEV_STRING "" #endif diff --git a/contrib/apr/libapr.rc b/contrib/apr/libapr.rc index 098b5f15240f..604fc7c06e4f 100644 --- a/contrib/apr/libapr.rc +++ b/contrib/apr/libapr.rc @@ -1,8 +1,5 @@ #include "apr_version.h" -#define APR_COPYRIGHT "Copyright (c) 2011 The Apache Software " \ - "Foundation or its licensors, as applicable." - #define APR_LICENSE \ "Licensed to the Apache Software Foundation (ASF) under one or more " \ "contributor license agreements. See the NOTICE file distributed with " \ diff --git a/contrib/apr/network_io/unix/multicast.c b/contrib/apr/network_io/unix/multicast.c index 67ab24574038..3767bfdd15c1 100644 --- a/contrib/apr/network_io/unix/multicast.c +++ b/contrib/apr/network_io/unix/multicast.c @@ -193,36 +193,39 @@ static apr_status_t do_mcast(int type, apr_socket_t *sock, return rv; } +/* Set the IP_MULTICAST_TTL or IP_MULTICAST_LOOP option, or IPv6 + * equivalents, for the socket, to the given value. Note that this + * function *only works* for those particular option types. */ static apr_status_t do_mcast_opt(int type, apr_socket_t *sock, apr_byte_t value) { apr_status_t rv = APR_SUCCESS; if (sock_is_ipv4(sock)) { + /* For the IP_MULTICAST_* options, this must be a (char *) + * pointer. */ if (setsockopt(sock->socketdes, IPPROTO_IP, type, (const void *) &value, sizeof(value)) == -1) { rv = errno; } } #if APR_HAVE_IPV6 - else if (sock_is_ipv6(sock) && type == IP_MULTICAST_LOOP) { - unsigned int loopopt = value; - type = IPV6_MULTICAST_LOOP; - if (setsockopt(sock->socketdes, IPPROTO_IPV6, type, - (const void *) &loopopt, sizeof(loopopt)) == -1) { - rv = errno; - } - } else if (sock_is_ipv6(sock)) { + /* For the IPV6_* options, an (int *) pointer must be used. */ + int ivalue = value; + if (type == IP_MULTICAST_TTL) { type = IPV6_MULTICAST_HOPS; } + else if (type == IP_MULTICAST_LOOP) { + type = IPV6_MULTICAST_LOOP; + } else { return APR_ENOTIMPL; } if (setsockopt(sock->socketdes, IPPROTO_IPV6, type, - &value, sizeof(value)) == -1) { + (const void *) &ivalue, sizeof(ivalue)) == -1) { rv = errno; } } diff --git a/contrib/apr/network_io/unix/sendrecv.c b/contrib/apr/network_io/unix/sendrecv.c index c133a26d9c7b..6b14643cd58b 100644 --- a/contrib/apr/network_io/unix/sendrecv.c +++ b/contrib/apr/network_io/unix/sendrecv.c @@ -174,7 +174,14 @@ apr_status_t apr_socket_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, return errno; } - apr_sockaddr_vars_set(from, from->sa.sin.sin_family, ntohs(from->sa.sin.sin_port)); + /* + * Check if we have a valid address. recvfrom() with MSG_PEEK may return + * success without filling in the address. + */ + if (from->salen > APR_OFFSETOF(struct sockaddr_in, sin_port)) { + apr_sockaddr_vars_set(from, from->sa.sin.sin_family, + ntohs(from->sa.sin.sin_port)); + } (*len) = rv; if (rv == 0 && sock->type == SOCK_STREAM) { @@ -245,7 +252,7 @@ do_select: /* Define a structure to pass in when we have a NULL header value */ static apr_hdtr_t no_hdtr; -#if defined(__linux__) && defined(HAVE_WRITEV) +#if (defined(__linux__) || defined(__GNU__)) && defined(HAVE_WRITEV) apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, apr_hdtr_t *hdtr, apr_off_t *offset, @@ -285,9 +292,6 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, hdtr = &no_hdtr; } - /* Ignore flags for now. */ - flags = 0; - if (hdtr->numheaders > 0) { apr_size_t hdrbytes; diff --git a/contrib/apr/network_io/unix/sockaddr.c b/contrib/apr/network_io/unix/sockaddr.c index ed4c474dc63d..9253a27461fb 100644 --- a/contrib/apr/network_io/unix/sockaddr.c +++ b/contrib/apr/network_io/unix/sockaddr.c @@ -356,9 +356,27 @@ static apr_status_t call_resolver(apr_sockaddr_t **sa, } error = getaddrinfo(hostname, servname, &hints, &ai_list); #ifdef HAVE_GAI_ADDRCONFIG - if (error == EAI_BADFLAGS && family == APR_UNSPEC) { - /* Retry with no flags if AI_ADDRCONFIG was rejected. */ - hints.ai_flags = 0; + /* + * Using AI_ADDRCONFIG involves some unfortunate guesswork because it + * does not consider loopback addresses when trying to determine if + * IPv4 or IPv6 is configured on a system (see RFC 3493). + * This is a problem if one actually wants to listen on or connect to + * the loopback address of a protocol family that is not otherwise + * configured on the system. See PR 52709. + * To work around some of the problems, retry without AI_ADDRCONFIG + * in case of EAI_ADDRFAMILY. + * XXX: apr_sockaddr_info_get() should really accept a flag to determine + * XXX: if AI_ADDRCONFIG's guesswork is wanted and if the address is + * XXX: to be used for listen() or connect(). + * + * In case of EAI_BADFLAGS, AI_ADDRCONFIG is not supported. + */ + if ((family == APR_UNSPEC) && (error == EAI_BADFLAGS +#ifdef EAI_ADDRFAMILY + || error == EAI_ADDRFAMILY +#endif + )) { + hints.ai_flags &= ~AI_ADDRCONFIG; error = getaddrinfo(hostname, servname, &hints, &ai_list); } #endif @@ -367,7 +385,7 @@ static apr_status_t call_resolver(apr_sockaddr_t **sa, return apr_get_netos_error(); #else if (error == EAI_SYSTEM) { - return errno; + return errno ? errno : APR_EGENERAL; } else { @@ -422,6 +440,15 @@ static apr_status_t call_resolver(apr_sockaddr_t **sa, ai = ai->ai_next; } freeaddrinfo(ai_list); + + if (prev_sa == NULL) { + /* + * getaddrinfo returned only useless entries and *sa is still empty. + * This should be treated as an error. + */ + return APR_EGENERAL; + } + return APR_SUCCESS; } @@ -555,6 +582,11 @@ static apr_status_t find_addresses(apr_sockaddr_t **sa, ++curaddr; } + if (prev_sa == NULL) { + /* this should not happen but no result should be treated as error */ + return APR_EGENERAL; + } + return APR_SUCCESS; } @@ -1010,7 +1042,7 @@ APR_DECLARE(int) apr_ipsubnet_test(apr_ipsubnet_t *ipsub, apr_sockaddr_t *sa) /* XXX This line will segv on Win32 build with APR_HAVE_IPV6, * but without the IPV6 drivers installed. */ - if (sa->sa.sin.sin_family == AF_INET) { + if (sa->family == AF_INET) { if (ipsub->family == AF_INET && ((sa->sa.sin.sin_addr.s_addr & ipsub->mask[0]) == ipsub->sub[0])) { return 1; @@ -1022,7 +1054,7 @@ APR_DECLARE(int) apr_ipsubnet_test(apr_ipsubnet_t *ipsub, apr_sockaddr_t *sa) return 1; } } - else { + else if (sa->family == AF_INET6 && ipsub->family == AF_INET6) { apr_uint32_t *addr = (apr_uint32_t *)sa->ipaddr_ptr; if ((addr[0] & ipsub->mask[0]) == ipsub->sub[0] && diff --git a/contrib/apr/network_io/unix/sockopt.c b/contrib/apr/network_io/unix/sockopt.c index 3fc932f42f5e..7b67c2ec13a1 100644 --- a/contrib/apr/network_io/unix/sockopt.c +++ b/contrib/apr/network_io/unix/sockopt.c @@ -381,12 +381,33 @@ apr_status_t apr_gethostname(char *buf, apr_int32_t len, apr_pool_t *cont) } #if APR_HAS_SO_ACCEPTFILTER -apr_status_t apr_socket_accept_filter(apr_socket_t *sock, char *name, - char *args) +apr_status_t apr_socket_accept_filter(apr_socket_t *sock, char *nonconst_name, + char *nonconst_args) { + /* these should have been const; act like they are */ + const char *name = nonconst_name; + const char *args = nonconst_args; + struct accept_filter_arg af; - strncpy(af.af_name, name, 16); - strncpy(af.af_arg, args, 256 - 16); + socklen_t optlen = sizeof(af); + + /* FreeBSD returns an error if the filter is already set; ignore + * this call if we previously set it to the same value. + */ + if ((getsockopt(sock->socketdes, SOL_SOCKET, SO_ACCEPTFILTER, + &af, &optlen)) == 0) { + if (!strcmp(name, af.af_name) && !strcmp(args, af.af_arg)) { + return APR_SUCCESS; + } + } + + /* Uhh, at least in FreeBSD 9 the fields are declared as arrays of + * these lengths; did sizeof not work in some ancient release? + * + * FreeBSD kernel sets the last byte to a '\0'. + */ + apr_cpystrn(af.af_name, name, 16); + apr_cpystrn(af.af_arg, args, 256 - 16); if ((setsockopt(sock->socketdes, SOL_SOCKET, SO_ACCEPTFILTER, &af, sizeof(af))) < 0) { diff --git a/contrib/apr/random/unix/sha2.c b/contrib/apr/random/unix/sha2.c index 212c1b732a4e..12c257d1fa1b 100644 --- a/contrib/apr/random/unix/sha2.c +++ b/contrib/apr/random/unix/sha2.c @@ -52,8 +52,6 @@ typedef apr_uint64_t sha2_word64; /* Exactly 8 bytes */ /*** SHA-256/384/512 Various Length Definitions ***********************/ /* NOTE: Most of these are in sha2.h */ #define SHA256_SHORT_BLOCK_LENGTH (SHA256_BLOCK_LENGTH - 8) -#define SHA384_SHORT_BLOCK_LENGTH (SHA384_BLOCK_LENGTH - 16) -#define SHA512_SHORT_BLOCK_LENGTH (SHA512_BLOCK_LENGTH - 16) /*** ENDIAN REVERSAL MACROS *******************************************/ @@ -150,9 +148,7 @@ typedef apr_uint64_t sha2_word64; /* Exactly 8 bytes */ * library -- they are intended for private internal visibility/use * only. */ -void apr__SHA512_Last(SHA512_CTX*); void apr__SHA256_Transform(SHA256_CTX*, const sha2_word32*); -void apr__SHA512_Transform(SHA512_CTX*, const sha2_word64*); /*** SHA-XYZ INITIAL HASH VALUES AND CONSTANTS ************************/ @@ -188,74 +184,6 @@ static const sha2_word32 sha256_initial_hash_value[8] = { 0x5be0cd19UL }; -/* Hash constant words K for SHA-384 and SHA-512: */ -static const sha2_word64 K512[80] = { - APR_UINT64_C(0x428a2f98d728ae22), APR_UINT64_C(0x7137449123ef65cd), - APR_UINT64_C(0xb5c0fbcfec4d3b2f), APR_UINT64_C(0xe9b5dba58189dbbc), - APR_UINT64_C(0x3956c25bf348b538), APR_UINT64_C(0x59f111f1b605d019), - APR_UINT64_C(0x923f82a4af194f9b), APR_UINT64_C(0xab1c5ed5da6d8118), - APR_UINT64_C(0xd807aa98a3030242), APR_UINT64_C(0x12835b0145706fbe), - APR_UINT64_C(0x243185be4ee4b28c), APR_UINT64_C(0x550c7dc3d5ffb4e2), - APR_UINT64_C(0x72be5d74f27b896f), APR_UINT64_C(0x80deb1fe3b1696b1), - APR_UINT64_C(0x9bdc06a725c71235), APR_UINT64_C(0xc19bf174cf692694), - APR_UINT64_C(0xe49b69c19ef14ad2), APR_UINT64_C(0xefbe4786384f25e3), - APR_UINT64_C(0x0fc19dc68b8cd5b5), APR_UINT64_C(0x240ca1cc77ac9c65), - APR_UINT64_C(0x2de92c6f592b0275), APR_UINT64_C(0x4a7484aa6ea6e483), - APR_UINT64_C(0x5cb0a9dcbd41fbd4), APR_UINT64_C(0x76f988da831153b5), - APR_UINT64_C(0x983e5152ee66dfab), APR_UINT64_C(0xa831c66d2db43210), - APR_UINT64_C(0xb00327c898fb213f), APR_UINT64_C(0xbf597fc7beef0ee4), - APR_UINT64_C(0xc6e00bf33da88fc2), APR_UINT64_C(0xd5a79147930aa725), - APR_UINT64_C(0x06ca6351e003826f), APR_UINT64_C(0x142929670a0e6e70), - APR_UINT64_C(0x27b70a8546d22ffc), APR_UINT64_C(0x2e1b21385c26c926), - APR_UINT64_C(0x4d2c6dfc5ac42aed), APR_UINT64_C(0x53380d139d95b3df), - APR_UINT64_C(0x650a73548baf63de), APR_UINT64_C(0x766a0abb3c77b2a8), - APR_UINT64_C(0x81c2c92e47edaee6), APR_UINT64_C(0x92722c851482353b), - APR_UINT64_C(0xa2bfe8a14cf10364), APR_UINT64_C(0xa81a664bbc423001), - APR_UINT64_C(0xc24b8b70d0f89791), APR_UINT64_C(0xc76c51a30654be30), - APR_UINT64_C(0xd192e819d6ef5218), APR_UINT64_C(0xd69906245565a910), - APR_UINT64_C(0xf40e35855771202a), APR_UINT64_C(0x106aa07032bbd1b8), - APR_UINT64_C(0x19a4c116b8d2d0c8), APR_UINT64_C(0x1e376c085141ab53), - APR_UINT64_C(0x2748774cdf8eeb99), APR_UINT64_C(0x34b0bcb5e19b48a8), - APR_UINT64_C(0x391c0cb3c5c95a63), APR_UINT64_C(0x4ed8aa4ae3418acb), - APR_UINT64_C(0x5b9cca4f7763e373), APR_UINT64_C(0x682e6ff3d6b2b8a3), - APR_UINT64_C(0x748f82ee5defb2fc), APR_UINT64_C(0x78a5636f43172f60), - APR_UINT64_C(0x84c87814a1f0ab72), APR_UINT64_C(0x8cc702081a6439ec), - APR_UINT64_C(0x90befffa23631e28), APR_UINT64_C(0xa4506cebde82bde9), - APR_UINT64_C(0xbef9a3f7b2c67915), APR_UINT64_C(0xc67178f2e372532b), - APR_UINT64_C(0xca273eceea26619c), APR_UINT64_C(0xd186b8c721c0c207), - APR_UINT64_C(0xeada7dd6cde0eb1e), APR_UINT64_C(0xf57d4f7fee6ed178), - APR_UINT64_C(0x06f067aa72176fba), APR_UINT64_C(0x0a637dc5a2c898a6), - APR_UINT64_C(0x113f9804bef90dae), APR_UINT64_C(0x1b710b35131c471b), - APR_UINT64_C(0x28db77f523047d84), APR_UINT64_C(0x32caab7b40c72493), - APR_UINT64_C(0x3c9ebe0a15c9bebc), APR_UINT64_C(0x431d67c49c100d4c), - APR_UINT64_C(0x4cc5d4becb3e42b6), APR_UINT64_C(0x597f299cfc657e2a), - APR_UINT64_C(0x5fcb6fab3ad6faec), APR_UINT64_C(0x6c44198c4a475817) -}; - -/* Initial hash value H for SHA-384 */ -static const sha2_word64 sha384_initial_hash_value[8] = { - APR_UINT64_C(0xcbbb9d5dc1059ed8), - APR_UINT64_C(0x629a292a367cd507), - APR_UINT64_C(0x9159015a3070dd17), - APR_UINT64_C(0x152fecd8f70e5939), - APR_UINT64_C(0x67332667ffc00b31), - APR_UINT64_C(0x8eb44a8768581511), - APR_UINT64_C(0xdb0c2e0d64f98fa7), - APR_UINT64_C(0x47b5481dbefa4fa4) -}; - -/* Initial hash value H for SHA-512 */ -static const sha2_word64 sha512_initial_hash_value[8] = { - APR_UINT64_C(0x6a09e667f3bcc908), - APR_UINT64_C(0xbb67ae8584caa73b), - APR_UINT64_C(0x3c6ef372fe94f82b), - APR_UINT64_C(0xa54ff53a5f1d36f1), - APR_UINT64_C(0x510e527fade682d1), - APR_UINT64_C(0x9b05688c2b3e6c1f), - APR_UINT64_C(0x1f83d9abfb41bd6b), - APR_UINT64_C(0x5be0cd19137e2179) -}; - /* * Constant used by SHA256/384/512_End() functions for converting the * digest to a readable hexadecimal character string: @@ -537,7 +465,14 @@ void apr__SHA256_Final(sha2_byte digest[], SHA256_CTX* context) { *context->buffer = 0x80; } /* Set the bit count: */ - *(sha2_word64*)&context->buffer[SHA256_SHORT_BLOCK_LENGTH] = context->bitcount; + { + union dummy { + apr_uint64_t bitcount; + apr_byte_t bytes[8]; + } bitcount; + bitcount.bitcount = context->bitcount; + MEMCPY_BCOPY(&context->buffer[SHA256_SHORT_BLOCK_LENGTH], bitcount.bytes, 8); + } /* Final transform: */ apr__SHA256_Transform(context, (sha2_word32*)context->buffer); @@ -591,410 +526,3 @@ char* apr__SHA256_Data(const sha2_byte* data, size_t len, char digest[SHA256_DIG apr__SHA256_Update(&context, data, len); return apr__SHA256_End(&context, digest); } - - -/*** SHA-512: *********************************************************/ -void apr__SHA512_Init(SHA512_CTX* context) { - if (context == (SHA512_CTX*)0) { - return; - } - MEMCPY_BCOPY(context->state, sha512_initial_hash_value, SHA512_DIGEST_LENGTH); - MEMSET_BZERO(context->buffer, SHA512_BLOCK_LENGTH); - context->bitcount[0] = context->bitcount[1] = 0; -} - -#ifdef SHA2_UNROLL_TRANSFORM - -/* Unrolled SHA-512 round macros: */ -#if !APR_IS_BIGENDIAN - -#define ROUND512_0_TO_15(a,b,c,d,e,f,g,h) \ - REVERSE64(*data++, W512[j]); \ - T1 = (h) + Sigma1_512(e) + Ch((e), (f), (g)) + \ - K512[j] + W512[j]; \ - (d) += T1, \ - (h) = T1 + Sigma0_512(a) + Maj((a), (b), (c)), \ - j++ - - -#else /* APR_IS_BIGENDIAN */ - -#define ROUND512_0_TO_15(a,b,c,d,e,f,g,h) \ - T1 = (h) + Sigma1_512(e) + Ch((e), (f), (g)) + \ - K512[j] + (W512[j] = *data++); \ - (d) += T1; \ - (h) = T1 + Sigma0_512(a) + Maj((a), (b), (c)); \ - j++ - -#endif /* APR_IS_BIGENDIAN */ - -#define ROUND512(a,b,c,d,e,f,g,h) \ - s0 = W512[(j+1)&0x0f]; \ - s0 = sigma0_512(s0); \ - s1 = W512[(j+14)&0x0f]; \ - s1 = sigma1_512(s1); \ - T1 = (h) + Sigma1_512(e) + Ch((e), (f), (g)) + K512[j] + \ - (W512[j&0x0f] += s1 + W512[(j+9)&0x0f] + s0); \ - (d) += T1; \ - (h) = T1 + Sigma0_512(a) + Maj((a), (b), (c)); \ - j++ - -void apr__SHA512_Transform(SHA512_CTX* context, const sha2_word64* data) { - sha2_word64 a, b, c, d, e, f, g, h, s0, s1; - sha2_word64 T1, *W512 = (sha2_word64*)context->buffer; - int j; - - /* Initialize registers with the prev. intermediate value */ - a = context->state[0]; - b = context->state[1]; - c = context->state[2]; - d = context->state[3]; - e = context->state[4]; - f = context->state[5]; - g = context->state[6]; - h = context->state[7]; - - j = 0; - do { - ROUND512_0_TO_15(a,b,c,d,e,f,g,h); - ROUND512_0_TO_15(h,a,b,c,d,e,f,g); - ROUND512_0_TO_15(g,h,a,b,c,d,e,f); - ROUND512_0_TO_15(f,g,h,a,b,c,d,e); - ROUND512_0_TO_15(e,f,g,h,a,b,c,d); - ROUND512_0_TO_15(d,e,f,g,h,a,b,c); - ROUND512_0_TO_15(c,d,e,f,g,h,a,b); - ROUND512_0_TO_15(b,c,d,e,f,g,h,a); - } while (j < 16); - - /* Now for the remaining rounds up to 79: */ - do { - ROUND512(a,b,c,d,e,f,g,h); - ROUND512(h,a,b,c,d,e,f,g); - ROUND512(g,h,a,b,c,d,e,f); - ROUND512(f,g,h,a,b,c,d,e); - ROUND512(e,f,g,h,a,b,c,d); - ROUND512(d,e,f,g,h,a,b,c); - ROUND512(c,d,e,f,g,h,a,b); - ROUND512(b,c,d,e,f,g,h,a); - } while (j < 80); - - /* Compute the current intermediate hash value */ - context->state[0] += a; - context->state[1] += b; - context->state[2] += c; - context->state[3] += d; - context->state[4] += e; - context->state[5] += f; - context->state[6] += g; - context->state[7] += h; - - /* Clean up */ - a = b = c = d = e = f = g = h = T1 = 0; -} - -#else /* SHA2_UNROLL_TRANSFORM */ - -void apr__SHA512_Transform(SHA512_CTX* context, const sha2_word64* data) { - sha2_word64 a, b, c, d, e, f, g, h, s0, s1; - sha2_word64 T1, T2, *W512 = (sha2_word64*)context->buffer; - int j; - - /* Initialize registers with the prev. intermediate value */ - a = context->state[0]; - b = context->state[1]; - c = context->state[2]; - d = context->state[3]; - e = context->state[4]; - f = context->state[5]; - g = context->state[6]; - h = context->state[7]; - - j = 0; - do { -#if !APR_IS_BIGENDIAN - /* Convert TO host byte order */ - REVERSE64(*data++, W512[j]); - /* Apply the SHA-512 compression function to update a..h */ - T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + W512[j]; -#else /* APR_IS_BIGENDIAN */ - /* Apply the SHA-512 compression function to update a..h with copy */ - T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + (W512[j] = *data++); -#endif /* APR_IS_BIGENDIAN */ - T2 = Sigma0_512(a) + Maj(a, b, c); - h = g; - g = f; - f = e; - e = d + T1; - d = c; - c = b; - b = a; - a = T1 + T2; - - j++; - } while (j < 16); - - do { - /* Part of the message block expansion: */ - s0 = W512[(j+1)&0x0f]; - s0 = sigma0_512(s0); - s1 = W512[(j+14)&0x0f]; - s1 = sigma1_512(s1); - - /* Apply the SHA-512 compression function to update a..h */ - T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + - (W512[j&0x0f] += s1 + W512[(j+9)&0x0f] + s0); - T2 = Sigma0_512(a) + Maj(a, b, c); - h = g; - g = f; - f = e; - e = d + T1; - d = c; - c = b; - b = a; - a = T1 + T2; - - j++; - } while (j < 80); - - /* Compute the current intermediate hash value */ - context->state[0] += a; - context->state[1] += b; - context->state[2] += c; - context->state[3] += d; - context->state[4] += e; - context->state[5] += f; - context->state[6] += g; - context->state[7] += h; - - /* Clean up */ - a = b = c = d = e = f = g = h = T1 = T2 = 0; -} - -#endif /* SHA2_UNROLL_TRANSFORM */ - -void apr__SHA512_Update(SHA512_CTX* context, const sha2_byte *data, size_t len) { - unsigned int freespace, usedspace; - - if (len == 0) { - /* Calling with no data is valid - we do nothing */ - return; - } - - /* Sanity check: */ - assert(context != (SHA512_CTX*)0 && data != (sha2_byte*)0); - - usedspace = (unsigned int)((context->bitcount[0] >> 3) - % SHA512_BLOCK_LENGTH); - if (usedspace > 0) { - /* Calculate how much free space is available in the buffer */ - freespace = SHA512_BLOCK_LENGTH - usedspace; - - if (len >= freespace) { - /* Fill the buffer completely and process it */ - MEMCPY_BCOPY(&context->buffer[usedspace], data, freespace); - ADDINC128(context->bitcount, freespace << 3); - len -= freespace; - data += freespace; - apr__SHA512_Transform(context, (sha2_word64*)context->buffer); - } else { - /* The buffer is not yet full */ - MEMCPY_BCOPY(&context->buffer[usedspace], data, len); - ADDINC128(context->bitcount, len << 3); - /* Clean up: */ - usedspace = freespace = 0; - return; - } - } - while (len >= SHA512_BLOCK_LENGTH) { - /* Process as many complete blocks as we can */ - apr__SHA512_Transform(context, (sha2_word64*)data); - ADDINC128(context->bitcount, SHA512_BLOCK_LENGTH << 3); - len -= SHA512_BLOCK_LENGTH; - data += SHA512_BLOCK_LENGTH; - } - if (len > 0) { - /* There's left-overs, so save 'em */ - MEMCPY_BCOPY(context->buffer, data, len); - ADDINC128(context->bitcount, len << 3); - } - /* Clean up: */ - usedspace = freespace = 0; -} - -void apr__SHA512_Last(SHA512_CTX* context) { - unsigned int usedspace; - - usedspace = (unsigned int)((context->bitcount[0] >> 3) - % SHA512_BLOCK_LENGTH); -#if !APR_IS_BIGENDIAN - /* Convert FROM host byte order */ - REVERSE64(context->bitcount[0],context->bitcount[0]); - REVERSE64(context->bitcount[1],context->bitcount[1]); -#endif - if (usedspace > 0) { - /* Begin padding with a 1 bit: */ - context->buffer[usedspace++] = 0x80; - - if (usedspace <= SHA512_SHORT_BLOCK_LENGTH) { - /* Set-up for the last transform: */ - MEMSET_BZERO(&context->buffer[usedspace], SHA512_SHORT_BLOCK_LENGTH - usedspace); - } else { - if (usedspace < SHA512_BLOCK_LENGTH) { - MEMSET_BZERO(&context->buffer[usedspace], SHA512_BLOCK_LENGTH - usedspace); - } - /* Do second-to-last transform: */ - apr__SHA512_Transform(context, (sha2_word64*)context->buffer); - - /* And set-up for the last transform: */ - MEMSET_BZERO(context->buffer, SHA512_BLOCK_LENGTH - 2); - } - } else { - /* Prepare for final transform: */ - MEMSET_BZERO(context->buffer, SHA512_SHORT_BLOCK_LENGTH); - - /* Begin padding with a 1 bit: */ - *context->buffer = 0x80; - } - /* Store the length of input data (in bits): */ - *(sha2_word64*)&context->buffer[SHA512_SHORT_BLOCK_LENGTH] = context->bitcount[1]; - *(sha2_word64*)&context->buffer[SHA512_SHORT_BLOCK_LENGTH+8] = context->bitcount[0]; - - /* Final transform: */ - apr__SHA512_Transform(context, (sha2_word64*)context->buffer); -} - -void apr__SHA512_Final(sha2_byte digest[], SHA512_CTX* context) { - sha2_word64 *d = (sha2_word64*)digest; - - /* Sanity check: */ - assert(context != (SHA512_CTX*)0); - - /* If no digest buffer is passed, we don't bother doing this: */ - if (digest != (sha2_byte*)0) { - apr__SHA512_Last(context); - - /* Save the hash data for output: */ -#if !APR_IS_BIGENDIAN - { - /* Convert TO host byte order */ - int j; - for (j = 0; j < 8; j++) { - REVERSE64(context->state[j],context->state[j]); - *d++ = context->state[j]; - } - } -#else /* APR_IS_BIGENDIAN */ - MEMCPY_BCOPY(d, context->state, SHA512_DIGEST_LENGTH); -#endif /* APR_IS_BIGENDIAN */ - } - - /* Zero out state data */ - MEMSET_BZERO(context, sizeof(*context)); -} - -char *apr__SHA512_End(SHA512_CTX* context, char buffer[]) { - sha2_byte digest[SHA512_DIGEST_LENGTH], *d = digest; - int i; - - /* Sanity check: */ - assert(context != (SHA512_CTX*)0); - - if (buffer != (char*)0) { - apr__SHA512_Final(digest, context); - - for (i = 0; i < SHA512_DIGEST_LENGTH; i++) { - *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4]; - *buffer++ = sha2_hex_digits[*d & 0x0f]; - d++; - } - *buffer = (char)0; - } else { - MEMSET_BZERO(context, sizeof(*context)); - } - MEMSET_BZERO(digest, SHA512_DIGEST_LENGTH); - return buffer; -} - -char* apr__SHA512_Data(const sha2_byte* data, size_t len, char digest[SHA512_DIGEST_STRING_LENGTH]) { - SHA512_CTX context; - - apr__SHA512_Init(&context); - apr__SHA512_Update(&context, data, len); - return apr__SHA512_End(&context, digest); -} - - -/*** SHA-384: *********************************************************/ -void apr__SHA384_Init(SHA384_CTX* context) { - if (context == (SHA384_CTX*)0) { - return; - } - MEMCPY_BCOPY(context->state, sha384_initial_hash_value, SHA512_DIGEST_LENGTH); - MEMSET_BZERO(context->buffer, SHA384_BLOCK_LENGTH); - context->bitcount[0] = context->bitcount[1] = 0; -} - -void apr__SHA384_Update(SHA384_CTX* context, const sha2_byte* data, size_t len) { - apr__SHA512_Update((SHA512_CTX*)context, data, len); -} - -void apr__SHA384_Final(sha2_byte digest[], SHA384_CTX* context) { - sha2_word64 *d = (sha2_word64*)digest; - - /* Sanity check: */ - assert(context != (SHA384_CTX*)0); - - /* If no digest buffer is passed, we don't bother doing this: */ - if (digest != (sha2_byte*)0) { - apr__SHA512_Last((SHA512_CTX*)context); - - /* Save the hash data for output: */ -#if !APR_IS_BIGENDIAN - { - /* Convert TO host byte order */ - int j; - for (j = 0; j < 6; j++) { - REVERSE64(context->state[j],context->state[j]); - *d++ = context->state[j]; - } - } -#else /* APR_IS_BIGENDIAN */ - MEMCPY_BCOPY(d, context->state, SHA384_DIGEST_LENGTH); -#endif /* APR_IS_BIGENDIAN */ - } - - /* Zero out state data */ - MEMSET_BZERO(context, sizeof(*context)); -} - -char *apr__SHA384_End(SHA384_CTX* context, char buffer[]) { - sha2_byte digest[SHA384_DIGEST_LENGTH], *d = digest; - int i; - - /* Sanity check: */ - assert(context != (SHA384_CTX*)0); - - if (buffer != (char*)0) { - apr__SHA384_Final(digest, context); - - for (i = 0; i < SHA384_DIGEST_LENGTH; i++) { - *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4]; - *buffer++ = sha2_hex_digits[*d & 0x0f]; - d++; - } - *buffer = (char)0; - } else { - MEMSET_BZERO(context, sizeof(*context)); - } - MEMSET_BZERO(digest, SHA384_DIGEST_LENGTH); - return buffer; -} - -char* apr__SHA384_Data(const sha2_byte* data, size_t len, char digest[SHA384_DIGEST_STRING_LENGTH]) { - SHA384_CTX context; - - apr__SHA384_Init(&context); - apr__SHA384_Update(&context, data, len); - return apr__SHA384_End(&context, digest); -} - diff --git a/contrib/apr/random/unix/sha2.h b/contrib/apr/random/unix/sha2.h index 9f0d93e1e015..0a030d7dbae0 100644 --- a/contrib/apr/random/unix/sha2.h +++ b/contrib/apr/random/unix/sha2.h @@ -29,16 +29,10 @@ extern "C" { #include "apr.h" -/*** SHA-256/384/512 Various Length Definitions ***********************/ +/*** SHA-256 Various Length Definitions ***********************/ #define SHA256_BLOCK_LENGTH 64 #define SHA256_DIGEST_LENGTH 32 #define SHA256_DIGEST_STRING_LENGTH (SHA256_DIGEST_LENGTH * 2 + 1) -#define SHA384_BLOCK_LENGTH 128 -#define SHA384_DIGEST_LENGTH 48 -#define SHA384_DIGEST_STRING_LENGTH (SHA384_DIGEST_LENGTH * 2 + 1) -#define SHA512_BLOCK_LENGTH 128 -#define SHA512_DIGEST_LENGTH 64 -#define SHA512_DIGEST_STRING_LENGTH (SHA512_DIGEST_LENGTH * 2 + 1) /*** SHA-256/384/512 Context Structures *******************************/ @@ -47,13 +41,6 @@ typedef struct _SHA256_CTX { apr_uint64_t bitcount; apr_byte_t buffer[SHA256_BLOCK_LENGTH]; } SHA256_CTX; -typedef struct _SHA512_CTX { - apr_uint64_t state[8]; - apr_uint64_t bitcount[2]; - apr_byte_t buffer[SHA512_BLOCK_LENGTH]; -} SHA512_CTX; - -typedef SHA512_CTX SHA384_CTX; /*** SHA-256/384/512 Function Prototypes ******************************/ @@ -63,21 +50,7 @@ void apr__SHA256_Final(apr_byte_t [SHA256_DIGEST_LENGTH], SHA256_CTX *); char* apr__SHA256_End(SHA256_CTX *, char [SHA256_DIGEST_STRING_LENGTH]); char* apr__SHA256_Data(const apr_byte_t *, size_t, char [SHA256_DIGEST_STRING_LENGTH]); - -void apr__SHA384_Init(SHA384_CTX *); -void apr__SHA384_Update(SHA384_CTX *, const apr_byte_t *, size_t); -void apr__SHA384_Final(apr_byte_t [SHA384_DIGEST_LENGTH], SHA384_CTX *); -char* apr__SHA384_End(SHA384_CTX *, char [SHA384_DIGEST_STRING_LENGTH]); -char* apr__SHA384_Data(const apr_byte_t *, size_t, - char [SHA384_DIGEST_STRING_LENGTH]); - -void apr__SHA512_Init(SHA512_CTX *); -void apr__SHA512_Update(SHA512_CTX *, const apr_byte_t *, size_t); -void apr__SHA512_Final(apr_byte_t [SHA512_DIGEST_LENGTH], SHA512_CTX *); -char* apr__SHA512_End(SHA512_CTX *, char [SHA512_DIGEST_STRING_LENGTH]); -char* apr__SHA512_Data(const apr_byte_t *, size_t, - char [SHA512_DIGEST_STRING_LENGTH]); - + #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/contrib/apr/random/unix/sha2_glue.c b/contrib/apr/random/unix/sha2_glue.c index 4909a8fe1f83..cb6e897802f3 100644 --- a/contrib/apr/random/unix/sha2_glue.c +++ b/contrib/apr/random/unix/sha2_glue.c @@ -1,26 +1,42 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + #include <apr.h> #include <apr_random.h> #include <apr_pools.h> #include "sha2.h" static void sha256_init(apr_crypto_hash_t *h) - { +{ apr__SHA256_Init(h->data); - } +} static void sha256_add(apr_crypto_hash_t *h,const void *data, - apr_size_t bytes) - { + apr_size_t bytes) +{ apr__SHA256_Update(h->data,data,bytes); - } +} static void sha256_finish(apr_crypto_hash_t *h,unsigned char *result) - { +{ apr__SHA256_Final(result,h->data); - } +} APR_DECLARE(apr_crypto_hash_t *) apr_crypto_sha256_new(apr_pool_t *p) - { +{ apr_crypto_hash_t *h=apr_palloc(p,sizeof *h); h->data=apr_palloc(p,sizeof(SHA256_CTX)); @@ -30,4 +46,4 @@ APR_DECLARE(apr_crypto_hash_t *) apr_crypto_sha256_new(apr_pool_t *p) h->size=256/8; return h; - } +} diff --git a/contrib/apr/tables/apr_tables.c b/contrib/apr/tables/apr_tables.c index 51b23407cc0e..7479ef47c7ae 100644 --- a/contrib/apr/tables/apr_tables.c +++ b/contrib/apr/tables/apr_tables.c @@ -734,11 +734,14 @@ APR_DECLARE(void) apr_table_mergen(apr_table_t *t, const char *key, #if APR_POOL_DEBUG { - if (!apr_pool_is_ancestor(apr_pool_find(key), t->a.pool)) { + apr_pool_t *pool; + pool = apr_pool_find(key); + if ((pool != key) && (!apr_pool_is_ancestor(pool, t->a.pool))) { fprintf(stderr, "apr_table_mergen: key not in ancestor pool of t\n"); abort(); } - if (!apr_pool_is_ancestor(apr_pool_find(val), t->a.pool)) { + pool = apr_pool_find(val); + if ((pool != val) && (!apr_pool_is_ancestor(pool, t->a.pool))) { fprintf(stderr, "apr_table_mergen: val not in ancestor pool of t\n"); abort(); } diff --git a/contrib/apr/threadproc/unix/thread.c b/contrib/apr/threadproc/unix/thread.c index 5639ac706873..6d060be55e7e 100644 --- a/contrib/apr/threadproc/unix/thread.c +++ b/contrib/apr/threadproc/unix/thread.c @@ -96,7 +96,7 @@ APR_DECLARE(apr_status_t) apr_threadattr_detach_get(apr_threadattr_t *attr) #else pthread_attr_getdetachstate(&attr->attr, &state); #endif - if (state == 1) + if (state == DETACH_ARG(1)) return APR_DETACH; return APR_NOTDETACH; } diff --git a/contrib/bind9/lib/dns/rdata/generic/keydata_65533.c b/contrib/bind9/lib/dns/rdata/generic/keydata_65533.c index 2592c30f6a08..317e1a87246a 100644 --- a/contrib/bind9/lib/dns/rdata/generic/keydata_65533.c +++ b/contrib/bind9/lib/dns/rdata/generic/keydata_65533.c @@ -176,7 +176,7 @@ fromwire_keydata(ARGS_FROMWIRE) { UNUSED(options); isc_buffer_activeregion(source, &sr); - if (sr.length < 4) + if (sr.length < 16) return (ISC_R_UNEXPECTEDEND); isc_buffer_forward(source, sr.length); diff --git a/contrib/binutils/ld/ldmain.c b/contrib/binutils/ld/ldmain.c index 354c41aeccda..a94b6ee9d78c 100644 --- a/contrib/binutils/ld/ldmain.c +++ b/contrib/binutils/ld/ldmain.c @@ -98,7 +98,7 @@ bfd_boolean as_needed; /* Nonzero means never create DT_NEEDED entries for dynamic libraries in DT_NEEDED tags. */ -bfd_boolean add_needed = TRUE; +bfd_boolean add_needed = FALSE; /* TRUE if we should demangle symbol names. */ bfd_boolean demangling; diff --git a/contrib/libstdc++/include/c_std/std_cmath.h b/contrib/libstdc++/include/c_std/std_cmath.h index 897290ac089f..a5cb69a4891c 100644 --- a/contrib/libstdc++/include/c_std/std_cmath.h +++ b/contrib/libstdc++/include/c_std/std_cmath.h @@ -589,6 +589,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std) { return ::__gnu_cxx::__capture_isunordered(__f1, __f2); } _GLIBCXX_END_NAMESPACE +using std::isnan; +using std::isinf; #endif /* _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC */ #endif diff --git a/contrib/llvm/tools/clang/lib/Headers/cpuid.h b/contrib/llvm/tools/clang/lib/Headers/cpuid.h index 7b012384a2aa..8f12caeb4978 100644 --- a/contrib/llvm/tools/clang/lib/Headers/cpuid.h +++ b/contrib/llvm/tools/clang/lib/Headers/cpuid.h @@ -25,10 +25,132 @@ #error this header is for x86 only #endif +/* Features in %ecx for level 1 */ +#define bit_SSE3 0x00000001 +#define bit_PCLMULQDQ 0x00000002 +#define bit_DTES64 0x00000004 +#define bit_MONITOR 0x00000008 +#define bit_DSCPL 0x00000010 +#define bit_VMX 0x00000020 +#define bit_SMX 0x00000040 +#define bit_EIST 0x00000080 +#define bit_TM2 0x00000100 +#define bit_SSSE3 0x00000200 +#define bit_CNXTID 0x00000400 +#define bit_FMA 0x00001000 +#define bit_CMPXCHG16B 0x00002000 +#define bit_xTPR 0x00004000 +#define bit_PDCM 0x00008000 +#define bit_PCID 0x00020000 +#define bit_DCA 0x00040000 +#define bit_SSE41 0x00080000 +#define bit_SSE42 0x00100000 +#define bit_x2APIC 0x00200000 +#define bit_MOVBE 0x00400000 +#define bit_POPCNT 0x00800000 +#define bit_TSCDeadline 0x01000000 +#define bit_AESNI 0x02000000 +#define bit_XSAVE 0x04000000 +#define bit_OSXSAVE 0x08000000 +#define bit_AVX 0x10000000 +#define bit_RDRAND 0x40000000 + +/* Features in %edx for level 1 */ +#define bit_FPU 0x00000001 +#define bit_VME 0x00000002 +#define bit_DE 0x00000004 +#define bit_PSE 0x00000008 +#define bit_TSC 0x00000010 +#define bit_MSR 0x00000020 +#define bit_PAE 0x00000040 +#define bit_MCE 0x00000080 +#define bit_CX8 0x00000100 +#define bit_APIC 0x00000200 +#define bit_SEP 0x00000800 +#define bit_MTRR 0x00001000 +#define bit_PGE 0x00002000 +#define bit_MCA 0x00004000 +#define bit_CMOV 0x00008000 +#define bit_PAT 0x00010000 +#define bit_PSE36 0x00020000 +#define bit_PSN 0x00040000 +#define bit_CLFSH 0x00080000 +#define bit_DS 0x00200000 +#define bit_ACPI 0x00400000 +#define bit_MMX 0x00800000 +#define bit_FXSR 0x01000000 +#define bit_SSE 0x02000000 +#define bit_SSE2 0x04000000 +#define bit_SS 0x08000000 +#define bit_HTT 0x10000000 +#define bit_TM 0x20000000 +#define bit_PBE 0x80000000 + +/* Features in %ebx for level 7 sub-leaf 0 */ +#define bit_FSGSBASE 0x00000001 +#define bit_SMEP 0x00000080 +#define bit_ENH_MOVSB 0x00000200 + +/* PIC on i386 uses %ebx, so preserve it. */ +#if __i386__ +#define __cpuid(__level, __eax, __ebx, __ecx, __edx) \ + __asm(" pushl %%ebx\n" \ + " cpuid\n" \ + " mov %%ebx,%1\n" \ + " popl %%ebx" \ + : "=a"(__eax), "=r" (__ebx), "=c"(__ecx), "=d"(__edx) \ + : "0"(__level)) + +#define __cpuid_count(__level, __count, __eax, __ebx, __ecx, __edx) \ + __asm(" pushl %%ebx\n" \ + " cpuid\n" \ + " mov %%ebx,%1\n" \ + " popl %%ebx" \ + : "=a"(__eax), "=r" (__ebx), "=c"(__ecx), "=d"(__edx) \ + : "0"(__level), "2"(__count)) +#else +#define __cpuid(__level, __eax, __ebx, __ecx, __edx) \ + __asm("cpuid" : "=a"(__eax), "=b" (__ebx), "=c"(__ecx), "=d"(__edx) \ + : "0"(__level)) + +#define __cpuid_count(__level, __count, __eax, __ebx, __ecx, __edx) \ + __asm("cpuid" : "=a"(__eax), "=b" (__ebx), "=c"(__ecx), "=d"(__edx) \ + : "0"(__level), "2"(__count)) +#endif + static __inline int __get_cpuid (unsigned int __level, unsigned int *__eax, unsigned int *__ebx, unsigned int *__ecx, unsigned int *__edx) { - __asm("cpuid" : "=a"(*__eax), "=b" (*__ebx), "=c"(*__ecx), "=d"(*__edx) - : "0"(__level)); + __cpuid(__level, *__eax, *__ebx, *__ecx, *__edx); return 1; } + +static __inline int __get_cpuid_max (unsigned int __level, unsigned int *__sig) +{ + unsigned int __eax, __ebx, __ecx, __edx; +#if __i386__ + int __cpuid_supported; + + __asm(" pushfl\n" + " popl %%eax\n" + " movl %%eax,%%ecx\n" + " xorl $0x00200000,%%eax\n" + " pushl %%eax\n" + " popfl\n" + " pushfl\n" + " popl %%eax\n" + " movl $0,%0\n" + " cmpl %%eax,%%ecx\n" + " je 1f\n" + " movl $1,%0\n" + "1:" + : "=r" (__cpuid_supported) : : "eax", "ecx"); + if (!__cpuid_supported) + return 0; +#endif + + __cpuid(__level, __eax, __ebx, __ecx, __edx); + if (__sig) + *__sig = __ebx; + return __eax; +} diff --git a/contrib/openbsm/m4/lt~obsolete.m4 b/contrib/openbsm/m4/lt~obsolete.m4 deleted file mode 100644 index c573da90c5cc..000000000000 --- a/contrib/openbsm/m4/lt~obsolete.m4 +++ /dev/null @@ -1,98 +0,0 @@ -# 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])]) diff --git a/contrib/subversion/CHANGES b/contrib/subversion/CHANGES index b0e61f2d67df..55b1b4d9e72b 100644 --- a/contrib/subversion/CHANGES +++ b/contrib/subversion/CHANGES @@ -1,3 +1,91 @@ +Version 1.8.1 +(23 July 2013, from /branches/1.8.x) +http://svn.apache.org/repos/asf/subversion/tags/1.8.1 + + User-visible changes: + - Client- and server-side bugfixes: + * translation updates for German and Simplified Chinese + * improve sqlite error message output (r1497804) + * support platforms lacking mmap (r1498136) + * allow configuration files to start with UTF-8 BOM (r1499100 et al) + * don't fail on UTF-8 data when encoding conversion not available (r1503009) + * improve error messages when encoding conversion fails (r1503010) + + - Client-side bugfixes: + * merge: rename 'automatic merge' to 'complete merge' (r1491432) + * mergeinfo: reduce network usage for '--show-revs' (r1492005) + * ra_serf: improve http status handling (r1495104) + * merge: avoid unneeded ra session (r1493475) + * merge: reduce network usage (r1478987) + * merge: remove duplicated ancestry check (r1493424, r1495597) + * ra_serf: fix 'Accept-Encoding' header for IIS interoperability (r1497551) + * svn status: improve documentation for lock columns (r1497318, r1497319) + * ra_serf: fix support for 'get-file-revs-reversed' capability (r1498456) + * log: reduce network usage on repository roots (r1496957) + * diff: avoid temporary files when calling external diff (issue #4382) + * upgrade: fix notification of 1.7.x working copies (r1493703, r1494171) + * fix crash during tree conflict resolution (issue #4388) + * interactive file merge: add two additional choices (r1491816, r1494089) + * diff: use local style paths in error messages (r1500680) + * resolve: improve the interactive conflict resolution menu (r1491739 et al) + * switch: use local style path in error message (r1500074) + * ra_serf: improve error output when receiving invalid XML (r1498851) + * svn cleanup: explain what the command does in help output (r1497310) + * blame: error on -r M:N where M>N unless server supports (r1498449 et al) + * gpg-agent auth: don't try to use agent when unavailable (r1500762 et al) + * gpg-agent auth: don't require GPG_TTY or TERM env vars (r1500801) + * update: fix some tree conflicts not triggering resolver (r1491868 et al) + * commit: remove stale entries from wc lock table when deleting (r1491756) + * merge: fix --record-only erroring out on renamed path (issue #4387) + * svnmucc: fix 'make install' symlink to work when DESTDIR is set (r1501072) + * wc: fix crash when target is symlink to a working copy root (issue #4383) + * ra_serf: change "internal malfunction" errors to normal errors (r1502577) + * ra_serf: handle proxies not supporting chunked requests (r1502401 et al) + + - Server-side bugfixes: + * fsfs: resolve endless loop problem when repos/db/uuid has \r\n (r1492145) + * fsfs: remove revision property buffer limit (r1491770) + * mod_dav_svn: better status codes for anonymous user errors (r1495918) + * mod_dav_svn: better status codes for commit failures (r1490684) + * fix performance regression in 'svn log' against root (r1494913) + * allow deleting non-user-visible 'svn:' properties (r1495432) + * fsfs: fix crash on strict-alignment architectures (r1495806, r1495985) + * svnadmin upgrade: fix error of non-sharded fsfs repositories (r1494287) + * svnadmin create: deny '--fs-type=fsfs --compatible-version=1.0' (r1494223) + * svnadmin upgrade: fix data loss when cancelling in last stage (r1494298) + * mod_dav_svn: fix incorrect path canonicalization (r1503528) + + - Other tool improvements and bugfixes: + * fsfs-stats (tool): resolve segfault when passing invalid path (r1492164) + * svn-bench: fix help output (r1493951) + * svnpubsub: add version header to server (r1491707) + + Developer-visible changes + - General: + * ra_serf: fix some test runner issues on Windows (r1490679) + * fix two issues in reverse svn_ra_get_file_revs() (r1492148, et al) + * handle --compatible-version=1.8 in the C tests (r1494342) + * improve clang compatibility (r1480080 et al) + * use proper cancel baton when handling conflicts (r1495850) + * fs: BDB: provide proper error value from BDB (r1495428) + * ra_serf: tweak connection failed error value (r1496132, et al) + * svn_client_log5: resolve possible segfault (r1496110) + * fix metadata_only move to work when target is unversioned node (r1498564) + * ra_svn: fix segfault with a NULL commit message (r1498550, r1499727) + * Ev2: correctly initialize node kind in shims' change table (r1501058) + * Ev2: fix copyfrom URL construction in shims (r1500226) + * fs: improve test against newlines in filenames (r1498483 et al) + * make building with BDB 6 an opt-in feature (r1499438) + * sqlite: allow placing amalgamation in build dir (r1499034, r1500175) + * ra_svn: make sessions usable after log callback early out (r1503554) + + - Bindings: + * swig-rb: fix tests with out-of-tree-builds (r1492295) + * javahl: fix encoding of error messages produced by javahl (r1492264) + * swig-pl: silence compiler warnings (r1487094) + * swig-pl: improve documentation (r1488693, r1490721, r1500904) + + Version 1.8.0 (18 Jun 2013, from /branches/1.8.x) http://svn.apache.org/repos/asf/subversion/tags/1.8.0 @@ -99,7 +187,6 @@ http://svn.apache.org/repos/asf/subversion/tags/1.8.0 * support ipv6 in URLs (e.g. http://[::1]/svn/repos) (r1454047) * conflict resolver now iterates paths in a sorted order (r1461820) * mod_dav_svn does keyword expansion with 'kw=1' query arg (r1466055) - * add support for custom keyword definitions (issue #890) - Minor new features and improvements (server-side): * improve performance of config file parsing (r1344347 et al) @@ -339,6 +426,25 @@ http://svn.apache.org/repos/asf/subversion/tags/1.8.0 * fix some reference counting bugs in swig-py bindings (r1464899, r1466524) +Version 1.7.11 +(23 Jul 2013, from /branches/1.7.x) +http://svn.apache.org/repos/asf/subversion/tags/1.7.11 + + User-visible changes: + - General + * translation updates for Simplified Chinese + + - Server-side bugfixes: + * mod_dav_svn: fix incorrect path canonicalization (r1503528) + + - Other tool improvements and bugfixes: + * fix argument processing in contrib hook scripts (r1485350) + + Developer-visible changes: + - Bindings: + * javahl: fix bug in error constructing code (r1405922) + + Version 1.7.10 (30 May 2013, from /branches/1.7.x) http://svn.apache.org/repos/asf/subversion/tags/1.7.10 diff --git a/contrib/subversion/Makefile.in b/contrib/subversion/Makefile.in index fdcd5445ede3..1b5d9d8191a0 100644 --- a/contrib/subversion/Makefile.in +++ b/contrib/subversion/Makefile.in @@ -903,5 +903,5 @@ INSTALL_EXTRA_TOOLS=\ test -n "$$SVN_SVNMUCC_IS_SVNSYITF" && \ ln -sf svnmucc$(EXEEXT) $(DESTDIR)$(bindir)/svnsyitf$(EXEEXT); \ if test "$(DESTDIR)$(bindir)" != "$(DESTDIR)$(toolsdir)"; then \ - ln -sf $(DESTDIR)$(bindir)/svnmucc$(EXEEXT) $(DESTDIR)$(toolsdir)/svnmucc$(EXEEXT); \ + ln -sf $(bindir)/svnmucc$(EXEEXT) $(DESTDIR)$(toolsdir)/svnmucc$(EXEEXT); \ fi diff --git a/contrib/subversion/build-outputs.mk b/contrib/subversion/build-outputs.mk index 7bee70d5f7c1..55bac4fb2e7d 100644 --- a/contrib/subversion/build-outputs.mk +++ b/contrib/subversion/build-outputs.mk @@ -1985,7 +1985,7 @@ subversion/libsvn_client/delete.lo: subversion/libsvn_client/delete.c subversion subversion/libsvn_client/deprecated.lo: subversion/libsvn_client/deprecated.c subversion/include/private/svn_client_private.h subversion/include/private/svn_debug.h subversion/include/private/svn_diff_tree.h subversion/include/private/svn_editor.h subversion/include/private/svn_magic.h subversion/include/private/svn_opt_private.h subversion/include/private/svn_wc_private.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_client.h subversion/include/svn_compat.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_diff.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_opt.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_props.h subversion/include/svn_ra.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_utf.h subversion/include/svn_wc.h subversion/libsvn_client/client.h subversion/libsvn_client/mergeinfo.h subversion/svn_private_config.h -subversion/libsvn_client/diff.lo: subversion/libsvn_client/diff.c subversion/include/private/svn_client_private.h subversion/include/private/svn_debug.h subversion/include/private/svn_diff_private.h subversion/include/private/svn_diff_tree.h subversion/include/private/svn_editor.h subversion/include/private/svn_magic.h subversion/include/private/svn_subr_private.h subversion/include/private/svn_wc_private.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_client.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_diff.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_opt.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_props.h subversion/include/svn_ra.h subversion/include/svn_string.h subversion/include/svn_subst.h subversion/include/svn_types.h subversion/include/svn_utf.h subversion/include/svn_wc.h subversion/libsvn_client/client.h subversion/svn_private_config.h +subversion/libsvn_client/diff.lo: subversion/libsvn_client/diff.c subversion/include/private/svn_client_private.h subversion/include/private/svn_debug.h subversion/include/private/svn_diff_private.h subversion/include/private/svn_diff_tree.h subversion/include/private/svn_editor.h subversion/include/private/svn_io_private.h subversion/include/private/svn_magic.h subversion/include/private/svn_subr_private.h subversion/include/private/svn_wc_private.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_client.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_diff.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_opt.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_props.h subversion/include/svn_ra.h subversion/include/svn_string.h subversion/include/svn_subst.h subversion/include/svn_types.h subversion/include/svn_utf.h subversion/include/svn_wc.h subversion/libsvn_client/client.h subversion/svn_private_config.h subversion/libsvn_client/diff_local.lo: subversion/libsvn_client/diff_local.c subversion/include/private/svn_client_private.h subversion/include/private/svn_debug.h subversion/include/private/svn_diff_tree.h subversion/include/private/svn_editor.h subversion/include/private/svn_magic.h subversion/include/private/svn_wc_private.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_client.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_diff.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_opt.h subversion/include/svn_pools.h subversion/include/svn_props.h subversion/include/svn_ra.h subversion/include/svn_sorts.h subversion/include/svn_string.h subversion/include/svn_subst.h subversion/include/svn_types.h subversion/include/svn_wc.h subversion/libsvn_client/client.h subversion/svn_private_config.h @@ -2703,7 +2703,7 @@ subversion/svnadmin/svnadmin.lo: subversion/svnadmin/svnadmin.c subversion/inclu subversion/svndumpfilter/svndumpfilter.lo: subversion/svndumpfilter/svndumpfilter.c subversion/include/private/svn_cmdline_private.h subversion/include/private/svn_debug.h subversion/include/private/svn_mergeinfo_private.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_cmdline.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_opt.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_props.h subversion/include/svn_repos.h subversion/include/svn_sorts.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_utf.h subversion/include/svn_version.h subversion/svn_private_config.h -subversion/svnlook/svnlook.lo: subversion/svnlook/svnlook.c subversion/include/private/svn_cmdline_private.h subversion/include/private/svn_debug.h subversion/include/private/svn_diff_private.h subversion/include/private/svn_fspath.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_cmdline.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_diff.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_opt.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_props.h subversion/include/svn_repos.h subversion/include/svn_sorts.h subversion/include/svn_string.h subversion/include/svn_subst.h subversion/include/svn_time.h subversion/include/svn_types.h subversion/include/svn_utf.h subversion/include/svn_version.h subversion/include/svn_xml.h subversion/svn_private_config.h +subversion/svnlook/svnlook.lo: subversion/svnlook/svnlook.c subversion/include/private/svn_cmdline_private.h subversion/include/private/svn_debug.h subversion/include/private/svn_diff_private.h subversion/include/private/svn_fspath.h subversion/include/private/svn_io_private.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_cmdline.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_diff.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_opt.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_props.h subversion/include/svn_repos.h subversion/include/svn_sorts.h subversion/include/svn_string.h subversion/include/svn_subst.h subversion/include/svn_time.h subversion/include/svn_types.h subversion/include/svn_utf.h subversion/include/svn_version.h subversion/include/svn_xml.h subversion/svn_private_config.h subversion/svnmucc/svnmucc.lo: subversion/svnmucc/svnmucc.c subversion/include/private/svn_cmdline_private.h subversion/include/private/svn_debug.h subversion/include/private/svn_editor.h subversion/include/private/svn_ra_private.h subversion/include/private/svn_string_private.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_client.h subversion/include/svn_cmdline.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_diff.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_opt.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_props.h subversion/include/svn_ra.h subversion/include/svn_string.h subversion/include/svn_subst.h subversion/include/svn_types.h subversion/include/svn_utf.h subversion/include/svn_version.h subversion/include/svn_wc.h subversion/svn_private_config.h @@ -2749,7 +2749,7 @@ subversion/tests/libsvn_diff/diff-diff3-test.lo: subversion/tests/libsvn_diff/di subversion/tests/libsvn_diff/parse-diff-test.lo: subversion/tests/libsvn_diff/parse-diff-test.c subversion/include/private/svn_debug.h subversion/include/svn_checksum.h subversion/include/svn_delta.h subversion/include/svn_diff.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_io.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_utf.h subversion/tests/svn_test.h -subversion/tests/libsvn_fs/fs-test.lo: subversion/tests/libsvn_fs/fs-test.c subversion/include/private/svn_debug.h subversion/include/private/svn_editor.h subversion/include/private/svn_fs_private.h subversion/include/svn_checksum.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_props.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_time.h subversion/include/svn_types.h subversion/include/svn_version.h subversion/libsvn_delta/delta.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h +subversion/tests/libsvn_fs/fs-test.lo: subversion/tests/libsvn_fs/fs-test.c subversion/include/private/svn_debug.h subversion/include/private/svn_editor.h subversion/include/private/svn_fs_private.h subversion/include/svn_checksum.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_props.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_time.h subversion/include/svn_types.h subversion/include/svn_version.h subversion/libsvn_delta/delta.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h subversion/tests/libsvn_fs/locks-test.lo: subversion/tests/libsvn_fs/locks-test.c subversion/include/private/svn_debug.h subversion/include/svn_checksum.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h @@ -2849,7 +2849,7 @@ subversion/tests/libsvn_wc/wc-queries-test.lo: subversion/tests/libsvn_wc/wc-que subversion/tests/libsvn_wc/wc-test.lo: subversion/tests/libsvn_wc/wc-test.c subversion/include/private/svn_debug.h subversion/include/private/svn_dep_compat.h subversion/include/private/svn_diff_tree.h subversion/include/private/svn_skel.h subversion/include/private/svn_sqlite.h subversion/include/private/svn_token.h subversion/include/private/svn_wc_private.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_client.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_diff.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_opt.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_ra.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_wc.h subversion/libsvn_wc/wc.h subversion/libsvn_wc/wc_db.h subversion/libsvn_wc/wc_db_private.h subversion/svn_private_config.h subversion/tests/libsvn_wc/utils.h subversion/tests/svn_test.h -subversion/tests/svn_test_fs.lo: subversion/tests/svn_test_fs.c subversion/include/private/svn_debug.h subversion/include/svn_checksum.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_utf.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h +subversion/tests/svn_test_fs.lo: subversion/tests/svn_test_fs.c subversion/include/private/svn_debug.h subversion/include/svn_checksum.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_utf.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h subversion/tests/svn_test_main.lo: subversion/tests/svn_test_main.c subversion/include/private/svn_cmdline_private.h subversion/include/private/svn_debug.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_cmdline.h subversion/include/svn_config.h subversion/include/svn_ctype.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_io.h subversion/include/svn_opt.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/svn_private_config.h subversion/tests/svn_test.h diff --git a/contrib/subversion/configure b/contrib/subversion/configure index 57dadd66df4d..fd905fb3a1ad 100755 --- a/contrib/subversion/configure +++ b/contrib/subversion/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for subversion 1.8.0. +# Generated by GNU Autoconf 2.69 for subversion 1.8.1. # # Report bugs to <http://subversion.apache.org/>. # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='subversion' PACKAGE_TARNAME='subversion' -PACKAGE_VERSION='1.8.0' -PACKAGE_STRING='subversion 1.8.0' +PACKAGE_VERSION='1.8.1' +PACKAGE_STRING='subversion 1.8.1' PACKAGE_BUGREPORT='http://subversion.apache.org/' PACKAGE_URL='' @@ -872,6 +872,7 @@ with_trang with_doxygen with_expat with_berkeley_db +enable_bdb6 with_sasl enable_keychain with_gpg_agent @@ -1455,7 +1456,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures subversion 1.8.0 to adapt to many kinds of systems. +\`configure' configures subversion 1.8.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1521,7 +1522,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of subversion 1.8.0:";; + short | recursive ) echo "Configuration of subversion 1.8.1:";; esac cat <<\_ACEOF @@ -1547,6 +1548,10 @@ Optional Features: testing prior to installation on some platforms. It does not work on some platforms (Darwin, OpenBSD, ...). + --enable-bdb6 Allow building against BDB 6+. See + --with-berkeley-db for specifying the location of + the Berkeley DB installation. Using BDB 6 will fail + if this option is not used. --disable-keychain Disable use of Mac OS KeyChain for auth credentials --enable-ev2-impl Use Ev2 implementations, where available [EXPERIMENTAL] @@ -1609,9 +1614,9 @@ Optional Packages: Specify location of Expat --with-berkeley-db[=HEADER:INCLUDES:LIB_SEARCH_DIRS:LIBS] The Subversion Berkeley DB based filesystem library - requires Berkeley DB $db_version or newer. If you - specify `--without-berkeley-db', that library will - not be built. If you omit the argument of this + requires Berkeley DB $db_version or $db_alt_version. + If you specify `--without-berkeley-db', that library + will not be built. If you omit the argument of this option completely, the configure script will use Berkeley DB used by APR-UTIL. --with-sasl=PATH Compile with libsasl2 in PATH @@ -1731,7 +1736,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -subversion configure 1.8.0 +subversion configure 1.8.1 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2275,7 +2280,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by subversion $as_me 1.8.0, which was +It was created by subversion $as_me 1.8.1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2655,8 +2660,8 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. -{ $as_echo "$as_me:${as_lineno-$LINENO}: Configuring Subversion 1.8.0" >&5 -$as_echo "$as_me: Configuring Subversion 1.8.0" >&6;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: Configuring Subversion 1.8.1" >&5 +$as_echo "$as_me: Configuring Subversion 1.8.1" >&6;} abs_srcdir="`cd $srcdir && pwd`" @@ -3612,6 +3617,44 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + _svn_xxflags__save="$CFLAGS" + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC accepts -Werror=unknown-warning-option" >&5 +$as_echo_n "checking if $CC accepts -Werror=unknown-warning-option... " >&6; } + CFLAGS="-Werror=unknown-warning-option $CFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + CFLAGS="$_svn_xxflags__save" + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + # Look for a C++ compiler (before anything can set CXXFLAGS) CXXMAINTAINERFLAGS="$CXXUSERFLAGS" CXXUSERFLAGS="$CXXFLAGS" @@ -3921,6 +3964,44 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + _svn_xxflags__save="$CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CXX accepts -Werror=unknown-warning-option" >&5 +$as_echo_n "checking if $CXX accepts -Werror=unknown-warning-option... " >&6; } + CXXFLAGS="-Werror=unknown-warning-option $CXXFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + CXXFLAGS="$_svn_xxflags__save" + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + # Look for a C pre-processor ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -6161,6 +6242,10 @@ $as_echo "$as_me: WARNING: no suitable sqlite found in $sqlite_dir" >&2;} echo "unpack the archive using unzip and rename the resulting" echo "directory to:" echo "$abs_srcdir/sqlite-amalgamation" + if test x"$abs_srcdir" != x"$abs_builddir"; then + echo "or to:" + echo "$abs_builddir/sqlite-amalgamation" + fi echo "" as_fn_error $? "Subversion requires SQLite" "$LINENO" 5 @@ -6461,6 +6546,299 @@ rm -f conftest* if test -z "$svn_lib_sqlite"; then + sqlite_amalg="$abs_builddir/sqlite-amalgamation/sqlite3.c" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking sqlite amalgamation" >&5 +$as_echo_n "checking sqlite amalgamation... " >&6; } + if test ! -e $sqlite_amalg; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking sqlite amalgamation file version" >&5 +$as_echo_n "checking sqlite amalgamation file version... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include "$sqlite_amalg" +#if SQLITE_VERSION_NUMBER >= $sqlite_min_ver_num +SQLITE_VERSION_OKAY +#endif +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "SQLITE_VERSION_OKAY" >/dev/null 2>&1; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: amalgamation found and is okay" >&5 +$as_echo "amalgamation found and is okay" >&6; } + + case $host_os in + beos* | mingw* | pw32* | cegcc* | cygwin*) + svn_sqlite_dso_ldflags= + ;; + + darwin*) + # if libdl is installed we need to link against it + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" svn_sqlite_dso_ldflags="-ldl" +else + + svn_sqlite_dso_ldflags= + +fi + + ;; + + *) + ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" +if test "x$ac_cv_func_shl_load" = xyes; then : + svn_sqlite_dso_ldflags= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if ${ac_cv_lib_dld_shl_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_shl_load=yes +else + ac_cv_lib_dld_shl_load=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = xyes; then : + svn_sqlite_dso_ldflags="-ldld" +else + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = xyes; then : + svn_sqlite_dso_ldflags= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + svn_sqlite_dso_ldflags="-ldl" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +$as_echo_n "checking for dlopen in -lsvld... " >&6; } +if ${ac_cv_lib_svld_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_svld_dlopen=yes +else + ac_cv_lib_svld_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +$as_echo "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = xyes; then : + svn_sqlite_dso_ldflags="-lsvld" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +$as_echo_n "checking for dld_link in -ldld... " >&6; } +if ${ac_cv_lib_dld_dld_link+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (); +int +main () +{ +return dld_link (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_dld_link=yes +else + ac_cv_lib_dld_dld_link=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +$as_echo "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = xyes; then : + svn_sqlite_dso_ldflags="-ldld" +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking additional libraries for sqlite" >&5 +$as_echo_n "checking additional libraries for sqlite... " >&6; } + if test -n "$svn_sqlite_dso_ldflags"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${svn_sqlite_dso_ldflags}" >&5 +$as_echo "${svn_sqlite_dso_ldflags}" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } + fi + + +$as_echo "#define SVN_SQLITE_INLINE 1" >>confdefs.h + + SVN_SQLITE_INCLUDES="-I`dirname $sqlite_amalg`" + if test -n "$svn_sqlite_dso_ldflags"; then + SVN_SQLITE_LIBS="$svn_sqlite_dso_ldflags -lpthread" + else + SVN_SQLITE_LIBS="-lpthread" + fi + svn_lib_sqlite="yes" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported amalgamation SQLite version" >&5 +$as_echo "unsupported amalgamation SQLite version" >&6; } +fi +rm -f conftest* + + fi + + fi + + if test -z "$svn_lib_sqlite"; then + if test -z ""; then sqlite_dir="" sqlite_include="sqlite3.h" @@ -6633,6 +7011,10 @@ $as_echo "no" >&6; } echo "unpack the archive using unzip and rename the resulting" echo "directory to:" echo "$abs_srcdir/sqlite-amalgamation" + if test x"$abs_srcdir" != x"$abs_builddir"; then + echo "or to:" + echo "$abs_builddir/sqlite-amalgamation" + fi echo "" as_fn_error $? "Subversion requires SQLite" "$LINENO" 5 @@ -17537,6 +17919,7 @@ powerpc-apple-darwin*) SVN_FS_WANT_DB_PATCH=14 ;; esac +db_alt_version="5.x" # Look for libdb4.so first: db_version=$SVN_FS_WANT_DB_MAJOR.$SVN_FS_WANT_DB_MINOR.$SVN_FS_WANT_DB_PATCH @@ -17624,6 +18007,14 @@ fi else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for availability of Berkeley DB" >&5 $as_echo_n "checking for availability of Berkeley DB... " >&6; } + # Check whether --enable-bdb6 was given. +if test "${enable_bdb6+set}" = set; then : + enableval=$enable_bdb6; enable_bdb6=$enableval +else + enable_bdb6=unspecified +fi + + svn_lib_berkeley_db_try_save_cppflags="$CPPFLAGS" svn_lib_berkeley_db_try_save_libs="$LIBS" @@ -17631,6 +18022,7 @@ $as_echo_n "checking for availability of Berkeley DB... " >&6; } svn_check_berkeley_db_major=$SVN_FS_WANT_DB_MAJOR svn_check_berkeley_db_minor=$SVN_FS_WANT_DB_MINOR svn_check_berkeley_db_patch=$SVN_FS_WANT_DB_PATCH + enable_bdb6=$enable_bdb6 if test -z "$SVN_DB_LIBS"; then # We pass --dbm-libs here since Debian has modified apu-config not @@ -17673,6 +18065,7 @@ else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#include <string.h> #include <stdlib.h> $svn_db_header @@ -17688,6 +18081,12 @@ int main () || patch != DB_VERSION_PATCH) exit (1); + /* Block Berkeley DB 6, because (a) we haven't tested with it, (b) 6.0.20 + and newer are under the AGPL, and we want use of AGPL dependencies to be + opt-in. */ + if (major >= 6 && strcmp("$enable_bdb6", "yes")) + exit(2); + /* Run-time check: ensure the library claims to be the correct version. */ if (major < $svn_check_berkeley_db_major) @@ -17710,7 +18109,11 @@ _ACEOF if ac_fn_c_try_run "$LINENO"; then : svn_have_berkeley_db=yes else - svn_have_berkeley_db=no + rc=$? + svn_have_berkeley_db=no + if test $rc = 2; then + svn_have_berkeley_db=no6 + fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -17726,11 +18129,17 @@ fi $as_echo "yes" >&6; } svn_lib_berkeley_db=yes else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + if test "$svn_have_berkeley_db" = "no6"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no (found version 6, but --enable-bdb6 not specified)" >&5 +$as_echo "no (found version 6, but --enable-bdb6 not specified)" >&6; } + # A warning will be printed at the end of configure.ac. + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } + fi svn_lib_berkeley_db=no if test "$bdb_status" = "required"; then - as_fn_error $? "Berkeley DB $db_version or newer wasn't found." "$LINENO" 5 + as_fn_error $? "Berkeley DB $db_version or $db_alt_version wasn't found." "$LINENO" 5 fi fi fi @@ -21156,6 +21565,18 @@ $as_echo "$as_me: Disabling optimizations" >&6;} # # do nothing fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: C compiler flags: $CFLAGS" >&5 +$as_echo "$as_me: C compiler flags: $CFLAGS" >&6;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: user-defined: $CUSERFLAGS" >&5 +$as_echo "$as_me: user-defined: $CUSERFLAGS" >&6;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: maintainer-mode: $CMAINTAINERFLAGS" >&5 +$as_echo "$as_me: maintainer-mode: $CMAINTAINERFLAGS" >&6;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: C++ compiler flags: $CXXFLAGS" >&5 +$as_echo "$as_me: C++ compiler flags: $CXXFLAGS" >&6;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: user-defined: $CXXUSERFLAGS" >&5 +$as_echo "$as_me: user-defined: $CXXUSERFLAGS" >&6;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: maintainer-mode: $CXXMAINTAINERFLAGS" >&5 +$as_echo "$as_me: maintainer-mode: $CXXMAINTAINERFLAGS" >&6;} # Check whether --enable-full-version-match was given. if test "${enable_full_version_match+set}" = set; then : @@ -25315,7 +25736,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by subversion $as_me 1.8.0, which was +This file was extended by subversion $as_me 1.8.1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -25381,7 +25802,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -subversion config.status 1.8.0 +subversion config.status 1.8.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -27295,30 +27716,51 @@ fi # ==== Print final messages to user ========================================== -if test "$svn_lib_berkeley_db" = "no" && test "$with_berkeley_db" != "no"; then - db_version="$SVN_FS_WANT_DB_MAJOR.$SVN_FS_WANT_DB_MINOR.$SVN_FS_WANT_DB_PATCH" - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: we have configured without BDB filesystem support +if test "$svn_have_berkeley_db" = "no6" && test "$enable_bdb6" != "no"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: We have configured without BDB filesystem support + + +Berkeley DB 6 was found, but not used. Please re-run configure (see +./config.nice) with the '--enable-bdb6' flag to use it, +or explicitly specify '--disable-bdb6' or '--without-berkeley-db' +to silence this warning. +Please note that some versions of Berkeley DB 6+ are under the GNU Affero +General Public License, version 3: +https://oss.oracle.com/pipermail/bdb/2013-June/000056.html -You don't seem to have Berkeley DB version $db_version or newer -installed and linked to APR-UTIL. We have created a Makefile which will build -Subversion without support for the Berkeley DB back-end. You can find the -latest version of Berkeley DB here: +The AGPL-3.0 licence may impose special requirements for making available +source code of server-side software. The text of the licence is: +https://www.gnu.org/licenses/agpl-3.0.html +http://opensource.org/licenses/AGPL-3.0 - http://www.oracle.com/technetwork/products/berkeleydb/downloads/index.html +The Berkeley DB backend to Subversion is deprecated; see +http://subversion.apache.org/docs/release-notes/1.8#bdb-deprecated -or explicitly specify --without-berkeley-db to silence this warning. +The Subversion developers have not tested Subversion with Berkeley DB 6 for +technical problems or bugs. " >&5 -$as_echo "$as_me: WARNING: we have configured without BDB filesystem support +$as_echo "$as_me: WARNING: We have configured without BDB filesystem support + + +Berkeley DB 6 was found, but not used. Please re-run configure (see +./config.nice) with the '--enable-bdb6' flag to use it, +or explicitly specify '--disable-bdb6' or '--without-berkeley-db' +to silence this warning. +Please note that some versions of Berkeley DB 6+ are under the GNU Affero +General Public License, version 3: +https://oss.oracle.com/pipermail/bdb/2013-June/000056.html -You don't seem to have Berkeley DB version $db_version or newer -installed and linked to APR-UTIL. We have created a Makefile which will build -Subversion without support for the Berkeley DB back-end. You can find the -latest version of Berkeley DB here: +The AGPL-3.0 licence may impose special requirements for making available +source code of server-side software. The text of the licence is: +https://www.gnu.org/licenses/agpl-3.0.html +http://opensource.org/licenses/AGPL-3.0 - http://www.oracle.com/technetwork/products/berkeleydb/downloads/index.html +The Berkeley DB backend to Subversion is deprecated; see +http://subversion.apache.org/docs/release-notes/1.8#bdb-deprecated -or explicitly specify --without-berkeley-db to silence this warning. +The Subversion developers have not tested Subversion with Berkeley DB 6 for +technical problems or bugs. " >&2;} fi diff --git a/contrib/subversion/configure.ac b/contrib/subversion/configure.ac index b1748ce9e531..169b34bc0131 100644 --- a/contrib/subversion/configure.ac +++ b/contrib/subversion/configure.ac @@ -460,6 +460,7 @@ powerpc-apple-darwin*) SVN_FS_WANT_DB_PATCH=14 ;; esac +db_alt_version="5.x" # Look for libdb4.so first: SVN_LIB_BERKELEY_DB($SVN_FS_WANT_DB_MAJOR, $SVN_FS_WANT_DB_MINOR, $SVN_FS_WANT_DB_PATCH, [db4 db]) @@ -1117,6 +1118,13 @@ elif test "$enable_optimization" = "no"; then # # do nothing fi +dnl Dump the current compiler options +AC_MSG_NOTICE([C compiler flags: $CFLAGS]) +AC_MSG_NOTICE([ user-defined: $CUSERFLAGS]) +AC_MSG_NOTICE([ maintainer-mode: $CMAINTAINERFLAGS]) +AC_MSG_NOTICE([C++ compiler flags: $CXXFLAGS]) +AC_MSG_NOTICE([ user-defined: $CXXUSERFLAGS]) +AC_MSG_NOTICE([ maintainer-mode: $CXXMAINTAINERFLAGS]) AC_ARG_ENABLE(full-version-match, AS_HELP_STRING([--disable-full-version-match], @@ -1504,18 +1512,28 @@ dnl Configure is long - users tend to miss warnings printed during it. dnl Hence, print a warnings about what we did and didn't configure at the dnl end, where people will actually see them. -if test "$svn_lib_berkeley_db" = "no" && test "$with_berkeley_db" != "no"; then - db_version="$SVN_FS_WANT_DB_MAJOR.$SVN_FS_WANT_DB_MINOR.$SVN_FS_WANT_DB_PATCH" - AC_MSG_WARN([we have configured without BDB filesystem support +if test "$svn_have_berkeley_db" = "no6" && test "$enable_bdb6" != "no"; then + AC_MSG_WARN([We have configured without BDB filesystem support -You don't seem to have Berkeley DB version $db_version or newer -installed and linked to APR-UTIL. We have created a Makefile which will build -Subversion without support for the Berkeley DB back-end. You can find the -latest version of Berkeley DB here: +Berkeley DB 6 was found, but not used. Please re-run configure (see +./config.nice) with the '--enable-bdb6' flag to use it, +or explicitly specify '--disable-bdb6' or '--without-berkeley-db' +to silence this warning. - http://www.oracle.com/technetwork/products/berkeleydb/downloads/index.html +Please note that some versions of Berkeley DB 6+ are under the GNU Affero +General Public License, version 3: +https://oss.oracle.com/pipermail/bdb/2013-June/000056.html -or explicitly specify --without-berkeley-db to silence this warning. +The AGPL-3.0 licence may impose special requirements for making available +source code of server-side software. The text of the licence is: +https://www.gnu.org/licenses/agpl-3.0.html +http://opensource.org/licenses/AGPL-3.0 + +The Berkeley DB backend to Subversion is deprecated; see +http://subversion.apache.org/docs/release-notes/1.8#bdb-deprecated + +The Subversion developers have not tested Subversion with Berkeley DB 6 for +technical problems or bugs. ]) fi diff --git a/contrib/subversion/get-deps.sh b/contrib/subversion/get-deps.sh index 5d8f49cd8798..0c0be8cc175d 100755 --- a/contrib/subversion/get-deps.sh +++ b/contrib/subversion/get-deps.sh @@ -37,7 +37,7 @@ SERF_VERSION=${SERF_VERSION:-"1.2.1"} ZLIB_VERSION=${ZLIB_VERSION:-"1.2.8"} SQLITE_VERSION=${SQLITE_VERSION:-"3.7.15.1"} GTEST_VERSION=${GTEST_VERSION:-"1.6.0"} -HTTPD_VERSION=${HTTPD_VERSION:-"2.4.3"} +HTTPD_VERSION=${HTTPD_VERSION:-"2.4.6"} APR_ICONV_VERSION=${APR_ICONV_VERSION:-"1.2.1"} APR=apr-${APR_VERSION} diff --git a/contrib/subversion/subversion/include/private/svn_client_private.h b/contrib/subversion/subversion/include/private/svn_client_private.h index 9eebc184c187..3e6efb56dbca 100644 --- a/contrib/subversion/subversion/include/private/svn_client_private.h +++ b/contrib/subversion/subversion/include/private/svn_client_private.h @@ -291,6 +291,39 @@ svn_client__copy_foreign(const char *url, svn_client_ctx_t *ctx, apr_pool_t *scratch_pool); +/* Same as the public svn_client_mergeinfo_log2 API, except for the addition + * of the TARGET_MERGEINFO_CATALOG and RESULT_POOL parameters. + * + * If TARGET_MERGEINFO_CATALOG is NULL then this acts exactly as the public + * API. If *TARGET_MERGEINFO_CATALOG is NULL, then *TARGET_MERGEINFO_CATALOG + * is set to the a mergeinfo catalog representing the mergeinfo on + * TARGET_PATH_OR_URL@TARGET_PEG_REVISION at DEPTH, (like the public API only + * depths of svn_depth_empty or svn_depth_infinity are supported) allocated in + * RESULT_POOL. Finally, if *TARGET_MERGEINFO_CATALOG is non-NULL, then it is + * assumed to be a mergeinfo catalog representing the mergeinfo on + * TARGET_PATH_OR_URL@TARGET_PEG_REVISION at DEPTH. + * + * The keys for the subtree mergeinfo are the repository root-relative + * paths of TARGET_PATH_OR_URL and/or its subtrees, regardless of whether + * TARGET_PATH_OR_URL is a URL or WC path. + */ +svn_error_t * +svn_client__mergeinfo_log(svn_boolean_t finding_merged, + const char *target_path_or_url, + const svn_opt_revision_t *target_peg_revision, + svn_mergeinfo_catalog_t *target_mergeinfo_catalog, + const char *source_path_or_url, + const svn_opt_revision_t *source_peg_revision, + const svn_opt_revision_t *source_start_revision, + const svn_opt_revision_t *source_end_revision, + svn_log_entry_receiver_t log_receiver, + void *log_receiver_baton, + svn_boolean_t discover_changed_paths, + svn_depth_t depth, + const apr_array_header_t *revprops, + svn_client_ctx_t *ctx, + apr_pool_t *result_pool, + apr_pool_t *scratch_pool); #ifdef __cplusplus } diff --git a/contrib/subversion/subversion/include/private/svn_io_private.h b/contrib/subversion/subversion/include/private/svn_io_private.h index 2fb4fa5b35ea..239cd6e61108 100644 --- a/contrib/subversion/subversion/include/private/svn_io_private.h +++ b/contrib/subversion/subversion/include/private/svn_io_private.h @@ -90,6 +90,11 @@ svn_stream__set_is_buffered(svn_stream_t *stream, svn_boolean_t svn_stream__is_buffered(svn_stream_t *stream); +/** Return the underlying file, if any, associated with the stream, or + * NULL if not available. Accessing the file bypasses the stream. + */ +apr_file_t * +svn_stream__aprfile(svn_stream_t *stream); #ifdef __cplusplus } diff --git a/contrib/subversion/subversion/include/private/svn_ra_private.h b/contrib/subversion/subversion/include/private/svn_ra_private.h index 4531bcb00a41..accca3d4f484 100644 --- a/contrib/subversion/subversion/include/private/svn_ra_private.h +++ b/contrib/subversion/subversion/include/private/svn_ra_private.h @@ -39,15 +39,23 @@ extern "C" { #endif /* __cplusplus */ -/* Return an error with code SVN_ERR_UNSUPPORTED_FEATURE, and an error - message referencing PATH_OR_URL, if the "server" pointed to by - RA_SESSION doesn't support Merge Tracking (e.g. is pre-1.5). - Perform temporary allocations in POOL. */ +/* Equivalent to svn_ra__assert_capable_server() + for SVN_RA_CAPABILITY_MERGEINFO. */ svn_error_t * svn_ra__assert_mergeinfo_capable_server(svn_ra_session_t *ra_session, const char *path_or_url, apr_pool_t *pool); +/* Return an error with code SVN_ERR_UNSUPPORTED_FEATURE, and an error + message referencing PATH_OR_URL, if the "server" pointed to by + RA_SESSION doesn't support CAPABILITY (an SVN_RA_CAPABILITY_* constant). + Perform temporary allocations in POOL. */ +svn_error_t * +svn_ra__assert_capable_server(svn_ra_session_t *ra_session, + const char *capability, + const char *path_or_url, + apr_pool_t *pool); + /*** Operational Locks ***/ diff --git a/contrib/subversion/subversion/include/svn_version.h b/contrib/subversion/subversion/include/svn_version.h index 1dee5b852345..d466d84e9843 100644 --- a/contrib/subversion/subversion/include/svn_version.h +++ b/contrib/subversion/subversion/include/svn_version.h @@ -72,7 +72,7 @@ extern "C" { * * @since New in 1.1. */ -#define SVN_VER_PATCH 0 +#define SVN_VER_PATCH 1 /** @deprecated Provided for backward compatibility with the 1.0 API. */ @@ -95,7 +95,7 @@ extern "C" { * * Always change this at the same time as SVN_VER_NUMTAG. */ -#define SVN_VER_TAG " (r1490375)" +#define SVN_VER_TAG " (r1503906)" /** Number tag: a string describing the version. @@ -121,7 +121,7 @@ extern "C" { * When rolling a tarball, we automatically replace it with what we * guess to be the correct revision number. */ -#define SVN_VER_REVISION 1490375 +#define SVN_VER_REVISION 1503906 /* Version strings composed from the above definitions. */ diff --git a/contrib/subversion/subversion/libsvn_client/client.h b/contrib/subversion/subversion/libsvn_client/client.h index 9ea25f270398..f13688828744 100644 --- a/contrib/subversion/subversion/libsvn_client/client.h +++ b/contrib/subversion/subversion/libsvn_client/client.h @@ -20,7 +20,8 @@ * under the License. * ==================================================================== */ - + + #ifndef SVN_LIBSVN_CLIENT_H #define SVN_LIBSVN_CLIENT_H @@ -208,6 +209,9 @@ svn_client__repos_location_segments(apr_array_header_t **segments, Use the authentication baton cached in CTX to authenticate against the repository. Use POOL for all allocations. + See also svn_client__calc_youngest_common_ancestor() to find youngest + common ancestor for already fetched history-as-mergeinfo information. + See also svn_client__youngest_common_ancestor(). */ svn_error_t * @@ -219,6 +223,34 @@ svn_client__get_youngest_common_ancestor(svn_client__pathrev_t **ancestor_p, apr_pool_t *result_pool, apr_pool_t *scratch_pool); +/* Find the common ancestor of two locations in a repository using already + fetched history-as-mergeinfo information. + + Ancestry is determined by the 'copy-from' relationship and the normal + successor relationship. + + Set *ANCESTOR_P to the location of the youngest common ancestor of + LOC1 and LOC2. If the locations have no common ancestor (including if + they don't have the same repository root URL), set *ANCESTOR_P to NULL. + + HISTORY1, HAS_REV_ZERO_HISTORY1, HISTORY2, HAS_REV_ZERO_HISTORY2 are + history-as-mergeinfo information as returned by + svn_client__get_history_as_mergeinfo() for LOC1 and LOC2 respectively. + + See also svn_client__get_youngest_common_ancestor(). + +*/ +svn_error_t * +svn_client__calc_youngest_common_ancestor(svn_client__pathrev_t **ancestor_p, + const svn_client__pathrev_t *loc1, + apr_hash_t *history1, + svn_boolean_t has_rev_zero_history1, + const svn_client__pathrev_t *loc2, + apr_hash_t *history2, + svn_boolean_t has_rev_zero_history2, + apr_pool_t *result_pool, + apr_pool_t *scratch_pool); + /* Ensure that RA_SESSION's session URL matches SESSION_URL, reparenting that session if necessary. Store the previous session URL in *OLD_SESSION_URL (so that if the @@ -247,7 +279,8 @@ svn_client__ensure_ra_session_url(const char **old_session_url, apr_pool_t *pool); /* ---------------------------------------------------------------- */ - + + /*** RA callbacks ***/ @@ -329,7 +362,8 @@ svn_client__ra_make_cb_baton(svn_wc_context_t *wc_ctx, apr_pool_t *result_pool); /* ---------------------------------------------------------------- */ - + + /*** Add/delete ***/ /* If AUTOPROPS is not null: Then read automatic properties matching PATH @@ -442,7 +476,8 @@ svn_client__make_local_parents(const char *path, apr_pool_t *pool); /* ---------------------------------------------------------------- */ - + + /*** Checkout, update and switch ***/ /* Update a working copy LOCAL_ABSPATH to REVISION, and (if not NULL) set @@ -581,7 +616,8 @@ svn_client__switch_internal(svn_revnum_t *result_rev, apr_pool_t *pool); /* ---------------------------------------------------------------- */ - + + /*** Inheritable Properties ***/ /* Convert any svn_prop_inherited_item_t elements in INHERITED_PROPS which @@ -626,7 +662,8 @@ svn_client__get_inheritable_props(apr_hash_t **wcroot_iprops, apr_pool_t *scratch_pool); /* ---------------------------------------------------------------- */ - + + /*** Editor for repository diff ***/ /* Create an editor for a pure repository comparison, i.e. comparing one @@ -666,7 +703,8 @@ svn_client__get_diff_editor2(const svn_delta_editor_t **editor, apr_pool_t *result_pool); /* ---------------------------------------------------------------- */ - + + /*** Editor for diff summary ***/ /* Set *CALLBACKS and *CALLBACK_BATON to a set of diff callbacks that will @@ -689,7 +727,8 @@ svn_client__get_diff_summarize_callbacks( apr_pool_t *pool); /* ---------------------------------------------------------------- */ - + + /*** Copy Stuff ***/ /* This structure is used to associate a specific copy or move SRC with a @@ -730,7 +769,8 @@ typedef struct svn_client__copy_pair_t } svn_client__copy_pair_t; /* ---------------------------------------------------------------- */ - + + /*** Commit Stuff ***/ /* WARNING: This is all new, untested, un-peer-reviewed conceptual @@ -944,7 +984,8 @@ svn_client__do_commit(const char *base_url, apr_pool_t *scratch_pool); - + + /*** Externals (Modules) ***/ /* Handle changes to the svn:externals property described by EXTERNALS_NEW, @@ -1116,7 +1157,8 @@ svn_client__resolve_conflicts(svn_boolean_t *conflicts_remain, svn_client_ctx_t *ctx, apr_pool_t *scratch_pool); - + + #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/contrib/subversion/subversion/libsvn_client/commit.c b/contrib/subversion/subversion/libsvn_client/commit.c index 3f6bfef2030a..6b3088558210 100644 --- a/contrib/subversion/subversion/libsvn_client/commit.c +++ b/contrib/subversion/subversion/libsvn_client/commit.c @@ -240,6 +240,13 @@ post_process_commit_item(svn_wc_committed_queue_t *queue, remove_lock = (! keep_locks && (item->state_flags & SVN_CLIENT_COMMIT_ITEM_LOCK_TOKEN)); + /* When the node was deleted (or replaced), we need to always remove the + locks, as they're invalidated on the server. We cannot honor the + SVN_CLIENT_COMMIT_ITEM_LOCK_TOKEN flag here because it does not tell + us whether we have locked children. */ + if (item->state_flags & SVN_CLIENT_COMMIT_ITEM_DELETE) + remove_lock = TRUE; + return svn_wc_queue_committed3(queue, wc_ctx, item->path, loop_recurse, item->incoming_prop_changes, remove_lock, !keep_changelists, diff --git a/contrib/subversion/subversion/libsvn_client/copy.c b/contrib/subversion/subversion/libsvn_client/copy.c index c0501b952a04..000ae0c2ff1c 100644 --- a/contrib/subversion/subversion/libsvn_client/copy.c +++ b/contrib/subversion/subversion/libsvn_client/copy.c @@ -385,6 +385,7 @@ static svn_error_t * verify_wc_dsts(const apr_array_header_t *copy_pairs, svn_boolean_t make_parents, svn_boolean_t is_move, + svn_boolean_t metadata_only, svn_client_ctx_t *ctx, apr_pool_t *result_pool, apr_pool_t *scratch_pool) @@ -435,8 +436,11 @@ verify_wc_dsts(const apr_array_header_t *copy_pairs, } /* Check that there is no unversioned obstruction */ - SVN_ERR(svn_io_check_path(pair->dst_abspath_or_url, &dst_kind, - iterpool)); + if (metadata_only) + dst_kind = svn_node_none; + else + SVN_ERR(svn_io_check_path(pair->dst_abspath_or_url, &dst_kind, + iterpool)); if (dst_kind != svn_node_none) { @@ -527,6 +531,7 @@ static svn_error_t * verify_wc_srcs_and_dsts(const apr_array_header_t *copy_pairs, svn_boolean_t make_parents, svn_boolean_t is_move, + svn_boolean_t metadata_only, svn_client_ctx_t *ctx, apr_pool_t *result_pool, apr_pool_t *scratch_pool) @@ -557,7 +562,7 @@ verify_wc_srcs_and_dsts(const apr_array_header_t *copy_pairs, scratch_pool)); } - SVN_ERR(verify_wc_dsts(copy_pairs, make_parents, is_move, ctx, + SVN_ERR(verify_wc_dsts(copy_pairs, make_parents, is_move, metadata_only, ctx, result_pool, iterpool)); svn_pool_destroy(iterpool); @@ -1727,8 +1732,8 @@ repos_to_wc_copy_locked(svn_boolean_t *timestamp_sleep, /* We've already checked for physical obstruction by a working file. But there could also be logical obstruction by an entry whose working file happens to be missing.*/ - SVN_ERR(verify_wc_dsts(copy_pairs, FALSE, FALSE, ctx, - scratch_pool, iterpool)); + SVN_ERR(verify_wc_dsts(copy_pairs, FALSE, FALSE, FALSE /* metadata_only */, + ctx, scratch_pool, iterpool)); /* Decide whether the two repositories are the same or not. */ { @@ -2210,7 +2215,7 @@ try_copy(svn_boolean_t *timestamp_sleep, if ((! srcs_are_urls) && (! dst_is_url)) { SVN_ERR(verify_wc_srcs_and_dsts(copy_pairs, make_parents, is_move, - ctx, pool, pool)); + metadata_only, ctx, pool, pool)); /* Copy or move all targets. */ if (is_move) diff --git a/contrib/subversion/subversion/libsvn_client/diff.c b/contrib/subversion/subversion/libsvn_client/diff.c index a5a36bd184a9..26890aec66b5 100644 --- a/contrib/subversion/subversion/libsvn_client/diff.c +++ b/contrib/subversion/subversion/libsvn_client/diff.c @@ -51,6 +51,7 @@ #include "private/svn_wc_private.h" #include "private/svn_diff_private.h" #include "private/svn_subr_private.h" +#include "private/svn_io_private.h" #include "svn_private_config.h" @@ -807,14 +808,23 @@ diff_content_changed(svn_boolean_t *wrote_header, * ### a non-git compatible diff application.*/ /* We deal in streams, but svn_io_run_diff2() deals in file handles, - unfortunately, so we need to make these temporary files, and then - copy the contents to our stream. */ - SVN_ERR(svn_io_open_unique_file3(&outfile, &outfilename, NULL, - svn_io_file_del_on_pool_cleanup, - scratch_pool, scratch_pool)); - SVN_ERR(svn_io_open_unique_file3(&errfile, &errfilename, NULL, - svn_io_file_del_on_pool_cleanup, - scratch_pool, scratch_pool)); + so we may need to make temporary files and then copy the contents + to our stream. */ + outfile = svn_stream__aprfile(outstream); + if (outfile) + outfilename = NULL; + else + SVN_ERR(svn_io_open_unique_file3(&outfile, &outfilename, NULL, + svn_io_file_del_on_pool_cleanup, + scratch_pool, scratch_pool)); + + errfile = svn_stream__aprfile(errstream); + if (errfile) + errfilename = NULL; + else + SVN_ERR(svn_io_open_unique_file3(&errfile, &errfilename, NULL, + svn_io_file_del_on_pool_cleanup, + scratch_pool, scratch_pool)); SVN_ERR(svn_io_run_diff2(".", diff_cmd_baton->options.for_external.argv, @@ -824,20 +834,25 @@ diff_content_changed(svn_boolean_t *wrote_header, &exitcode, outfile, errfile, diff_cmd_baton->diff_cmd, scratch_pool)); - SVN_ERR(svn_io_file_close(outfile, scratch_pool)); - SVN_ERR(svn_io_file_close(errfile, scratch_pool)); - /* Now, open and copy our files to our output streams. */ - SVN_ERR(svn_stream_open_readonly(&stream, outfilename, - scratch_pool, scratch_pool)); - SVN_ERR(svn_stream_copy3(stream, svn_stream_disown(outstream, - scratch_pool), - NULL, NULL, scratch_pool)); - SVN_ERR(svn_stream_open_readonly(&stream, errfilename, - scratch_pool, scratch_pool)); - SVN_ERR(svn_stream_copy3(stream, svn_stream_disown(errstream, - scratch_pool), - NULL, NULL, scratch_pool)); + if (outfilename) + { + SVN_ERR(svn_io_file_close(outfile, scratch_pool)); + SVN_ERR(svn_stream_open_readonly(&stream, outfilename, + scratch_pool, scratch_pool)); + SVN_ERR(svn_stream_copy3(stream, svn_stream_disown(outstream, + scratch_pool), + NULL, NULL, scratch_pool)); + } + if (errfilename) + { + SVN_ERR(svn_io_file_close(errfile, scratch_pool)); + SVN_ERR(svn_stream_open_readonly(&stream, errfilename, + scratch_pool, scratch_pool)); + SVN_ERR(svn_stream_copy3(stream, svn_stream_disown(errstream, + scratch_pool), + NULL, NULL, scratch_pool)); + } /* We have a printed a diff for this path, mark it as visited. */ *wrote_header = TRUE; diff --git a/contrib/subversion/subversion/libsvn_client/diff_local.c b/contrib/subversion/subversion/libsvn_client/diff_local.c index cc7184f12cba..2dd8a1b67da0 100644 --- a/contrib/subversion/subversion/libsvn_client/diff_local.c +++ b/contrib/subversion/subversion/libsvn_client/diff_local.c @@ -607,7 +607,10 @@ svn_client__arbitrary_nodes_diff(const char *local_abspath1, if (kind1 != kind2) return svn_error_createf(SVN_ERR_NODE_UNEXPECTED_KIND, NULL, _("'%s' is not the same node kind as '%s'"), - local_abspath1, local_abspath2); + svn_dirent_local_style(local_abspath1, + scratch_pool), + svn_dirent_local_style(local_abspath2, + scratch_pool)); if (depth == svn_depth_unknown) depth = svn_depth_infinity; @@ -627,7 +630,10 @@ svn_client__arbitrary_nodes_diff(const char *local_abspath1, else return svn_error_createf(SVN_ERR_NODE_UNEXPECTED_KIND, NULL, _("'%s' is not a file or directory"), - kind1 == svn_node_none ? - local_abspath1 : local_abspath2); + kind1 == svn_node_none + ? svn_dirent_local_style(local_abspath1, + scratch_pool) + : svn_dirent_local_style(local_abspath2, + scratch_pool)); return SVN_NO_ERROR; } diff --git a/contrib/subversion/subversion/libsvn_client/log.c b/contrib/subversion/subversion/libsvn_client/log.c index ca3edac4becb..73bd61211eb4 100644 --- a/contrib/subversion/subversion/libsvn_client/log.c +++ b/contrib/subversion/subversion/libsvn_client/log.c @@ -712,7 +712,17 @@ run_ra_get_log(apr_array_header_t *revision_ranges, matching_segment = bsearch(&younger_rev, log_segments->elts, log_segments->nelts, log_segments->elt_size, compare_rev_to_segment); - SVN_ERR_ASSERT(*matching_segment); + /* LOG_SEGMENTS is supposed to represent the history of PATHS from + the oldest to youngest revs in REVISION_RANGES. This function's + current sole caller svn_client_log5 *should* be providing + LOG_SEGMENTS that span the oldest to youngest revs in + REVISION_RANGES, even if one or more of the svn_location_segment_t's + returned have NULL path members indicating a gap in the history. So + MATCHING_SEGMENT should never be NULL, but clearly sometimes it is, + see http://svn.haxx.se/dev/archive-2013-06/0522.shtml + So to be safe we handle that case. */ + if (matching_segment == NULL) + continue; /* A segment with a NULL path means there is gap in the history. We'll just proceed and let svn_ra_get_log2 fail with a useful @@ -850,13 +860,32 @@ svn_client_log5(const apr_array_header_t *targets, SVN_ERR(svn_client__ensure_ra_session_url(&old_session_url, ra_session, actual_loc->url, pool)); - /* Get the svn_location_segment_t's representing the requested log ranges. */ - SVN_ERR(svn_client__repos_location_segments(&log_segments, ra_session, - actual_loc->url, - actual_loc->rev, /* peg */ - actual_loc->rev, /* start */ - oldest_rev, /* end */ - ctx, pool)); + /* Save us an RA layer round trip if we are on the repository root and + know the result in advance. All the revision data has already been + validated. + */ + if (strcmp(actual_loc->url, actual_loc->repos_root_url) == 0) + { + svn_location_segment_t *segment = apr_pcalloc(pool, sizeof(*segment)); + log_segments = apr_array_make(pool, 1, sizeof(segment)); + + segment->range_start = oldest_rev; + segment->range_end = actual_loc->rev; + segment->path = ""; + APR_ARRAY_PUSH(log_segments, svn_location_segment_t *) = segment; + } + else + { + /* Get the svn_location_segment_t's representing the requested log + * ranges. */ + SVN_ERR(svn_client__repos_location_segments(&log_segments, ra_session, + actual_loc->url, + actual_loc->rev, /* peg */ + actual_loc->rev, /* start */ + oldest_rev, /* end */ + ctx, pool)); + } + SVN_ERR(run_ra_get_log(revision_ranges, relative_targets, log_segments, actual_loc, ra_session, targets, limit, diff --git a/contrib/subversion/subversion/libsvn_client/merge.c b/contrib/subversion/subversion/libsvn_client/merge.c index 884d63d57e8e..17a5d23f5c44 100644 --- a/contrib/subversion/subversion/libsvn_client/merge.c +++ b/contrib/subversion/subversion/libsvn_client/merge.c @@ -1307,6 +1307,9 @@ record_tree_conflict(merge_cmd_baton_t *merge_b, { svn_wc_context_t *wc_ctx = merge_b->ctx->wc_ctx; + if (merge_b->record_only) + return SVN_NO_ERROR; + if (merge_b->merge_source.ancestral || merge_b->reintegrate_merge) { @@ -1316,8 +1319,7 @@ record_tree_conflict(merge_cmd_baton_t *merge_b, alloc_and_store_path(&merge_b->conflicted_paths, local_abspath, merge_b->pool); - - if (!merge_b->record_only && !merge_b->dry_run) + if (!merge_b->dry_run) { svn_wc_conflict_description2_t *conflict; const svn_wc_conflict_version_t *left; @@ -12029,16 +12031,17 @@ operative_rev_receiver(void *baton, return svn_error_create(SVN_ERR_CEASE_INVOCATION, NULL, NULL); } -/* Wrapper around svn_client_mergeinfo_log2. All arguments are as per - that API. The discover_changed_paths, depth, and revprops args to - svn_client_mergeinfo_log2 are always TRUE, svn_depth_infinity_t, - and NULL respectively. +/* Wrapper around svn_client__mergeinfo_log. All arguments are as per + that private API. The discover_changed_paths, depth, and revprops args to + svn_client__mergeinfo_log are always TRUE, svn_depth_infinity_t, + and empty array respectively. If RECEIVER raises a SVN_ERR_CEASE_INVOCATION error, but still sets *REVISION to a valid revnum, then clear the error. Otherwise return any error. */ static svn_error_t* -short_circuit_mergeinfo_log(svn_boolean_t finding_merged, +short_circuit_mergeinfo_log(svn_mergeinfo_catalog_t *target_mergeinfo_cat, + svn_boolean_t finding_merged, const char *target_path_or_url, const svn_opt_revision_t *target_peg_revision, const char *source_path_or_url, @@ -12048,18 +12051,25 @@ short_circuit_mergeinfo_log(svn_boolean_t finding_merged, svn_log_entry_receiver_t receiver, svn_revnum_t *revision, svn_client_ctx_t *ctx, + apr_pool_t *result_pool, apr_pool_t *scratch_pool) { - svn_error_t *err = svn_client_mergeinfo_log2(finding_merged, - target_path_or_url, - target_peg_revision, - source_path_or_url, - source_peg_revision, - source_start_revision, - source_end_revision, - receiver, revision, - TRUE, svn_depth_infinity, - NULL, ctx, scratch_pool); + apr_array_header_t *revprops; + svn_error_t *err; + + revprops = apr_array_make(scratch_pool, 0, sizeof(const char *)); + err = svn_client__mergeinfo_log(finding_merged, + target_path_or_url, + target_peg_revision, + target_mergeinfo_cat, + source_path_or_url, + source_peg_revision, + source_start_revision, + source_end_revision, + receiver, revision, + TRUE, svn_depth_infinity, + revprops, ctx, result_pool, + scratch_pool); if (err) { @@ -12129,6 +12139,7 @@ find_last_merged_location(svn_client__pathrev_t **base_p, svn_opt_revision_t source_peg_rev, source_start_rev, source_end_rev, target_opt_rev; svn_revnum_t youngest_merged_rev = SVN_INVALID_REVNUM; + svn_mergeinfo_catalog_t target_mergeinfo_cat = NULL; source_peg_rev.kind = svn_opt_revision_number; source_peg_rev.value.number = source_branch->tip->rev; @@ -12141,14 +12152,15 @@ find_last_merged_location(svn_client__pathrev_t **base_p, /* Find the youngest revision fully merged from SOURCE_BRANCH to TARGET, if such a revision exists. */ - SVN_ERR(short_circuit_mergeinfo_log(TRUE, /* Find merged */ + SVN_ERR(short_circuit_mergeinfo_log(&target_mergeinfo_cat, + TRUE, /* Find merged */ target->url, &target_opt_rev, source_branch->tip->url, &source_peg_rev, &source_end_rev, &source_start_rev, operative_rev_receiver, &youngest_merged_rev, - ctx, scratch_pool)); + ctx, result_pool, scratch_pool)); if (!SVN_IS_VALID_REVNUM(youngest_merged_rev)) { @@ -12175,14 +12187,15 @@ find_last_merged_location(svn_client__pathrev_t **base_p, (i.e. finding the youngest revision after the YCA where all revs have been merged) that doesn't matter. */ source_end_rev.value.number = youngest_merged_rev; - SVN_ERR(short_circuit_mergeinfo_log(FALSE, /* Find eligible */ + SVN_ERR(short_circuit_mergeinfo_log(&target_mergeinfo_cat, + FALSE, /* Find eligible */ target->url, &target_opt_rev, source_branch->tip->url, &source_peg_rev, &source_start_rev, &source_end_rev, operative_rev_receiver, &oldest_eligible_rev, - ctx, scratch_pool)); + ctx, scratch_pool, scratch_pool)); /* If there are revisions eligible for merging, use the oldest one to calculate the base. Otherwise there are no operative revisions @@ -12298,9 +12311,13 @@ find_automatic_merge(svn_client__pathrev_t **base_p, &s_t->target->loc, SVN_INVALID_REVNUM, SVN_INVALID_REVNUM, s_t->target_ra_session, ctx, scratch_pool)); - SVN_ERR(svn_client__get_youngest_common_ancestor( - &s_t->yca, s_t->source, &s_t->target->loc, s_t->source_ra_session, - ctx, result_pool, result_pool)); + SVN_ERR(svn_client__calc_youngest_common_ancestor( + &s_t->yca, s_t->source, s_t->source_branch.history, + s_t->source_branch.has_r0_history, + &s_t->target->loc, s_t->target_branch.history, + s_t->target_branch.has_r0_history, + result_pool, scratch_pool)); + if (! s_t->yca) return svn_error_createf(SVN_ERR_CLIENT_NOT_READY_TO_MERGE, NULL, _("'%s@%ld' must be ancestrally related to " diff --git a/contrib/subversion/subversion/libsvn_client/mergeinfo.c b/contrib/subversion/subversion/libsvn_client/mergeinfo.c index 453cc66a7772..6dd34343e0d1 100644 --- a/contrib/subversion/subversion/libsvn_client/mergeinfo.c +++ b/contrib/subversion/subversion/libsvn_client/mergeinfo.c @@ -1651,11 +1651,11 @@ svn_client_mergeinfo_get_merged(apr_hash_t **mergeinfo_p, return SVN_NO_ERROR; } - svn_error_t * -svn_client_mergeinfo_log2(svn_boolean_t finding_merged, +svn_client__mergeinfo_log(svn_boolean_t finding_merged, const char *target_path_or_url, const svn_opt_revision_t *target_peg_revision, + svn_mergeinfo_catalog_t *target_mergeinfo_catalog, const char *source_path_or_url, const svn_opt_revision_t *source_peg_revision, const svn_opt_revision_t *source_start_revision, @@ -1666,12 +1666,15 @@ svn_client_mergeinfo_log2(svn_boolean_t finding_merged, svn_depth_t depth, const apr_array_header_t *revprops, svn_client_ctx_t *ctx, + apr_pool_t *result_pool, apr_pool_t *scratch_pool) { const char *log_target = NULL; const char *repos_root; const char *target_repos_relpath; svn_mergeinfo_catalog_t target_mergeinfo_cat; + svn_ra_session_t *target_session = NULL; + svn_client__pathrev_t *pathrev; /* A hash of paths, at or under TARGET_PATH_OR_URL, mapped to rangelists. Not technically mergeinfo, so not using the @@ -1688,6 +1691,7 @@ svn_client_mergeinfo_log2(svn_boolean_t finding_merged, apr_hash_index_t *hi; apr_pool_t *iterpool; svn_boolean_t oldest_revs_first = TRUE; + apr_pool_t *subpool; /* We currently only support depth = empty | infinity. */ if (depth != svn_depth_infinity && depth != svn_depth_empty) @@ -1713,6 +1717,8 @@ svn_client_mergeinfo_log2(svn_boolean_t finding_merged, && (source_start_revision->kind != svn_opt_revision_unspecified)) return svn_error_create(SVN_ERR_CLIENT_BAD_REVISION, NULL, NULL); + subpool = svn_pool_create(scratch_pool); + /* We need the union of TARGET_PATH_OR_URL@TARGET_PEG_REVISION's mergeinfo and MERGE_SOURCE_URL's history. It's not enough to do path matching, because renames in the history of MERGE_SOURCE_URL @@ -1720,10 +1726,45 @@ svn_client_mergeinfo_log2(svn_boolean_t finding_merged, the target, that vastly simplifies matters (we'll have nothing to do). */ /* This get_mergeinfo() call doubles as a mergeinfo capabilities check. */ - SVN_ERR(get_mergeinfo(&target_mergeinfo_cat, &repos_root, - target_path_or_url, target_peg_revision, - depth == svn_depth_infinity, TRUE, - ctx, scratch_pool, scratch_pool)); + if (target_mergeinfo_catalog) + { + if (*target_mergeinfo_catalog) + { + /* The caller provided the mergeinfo catalog for + TARGET_PATH_OR_URL, so we don't need to accquire + it ourselves. We do need to get the repos_root + though, because get_mergeinfo() won't do it for us. */ + target_mergeinfo_cat = *target_mergeinfo_catalog; + SVN_ERR(svn_client__ra_session_from_path2(&target_session, &pathrev, + target_path_or_url, NULL, + target_peg_revision, + target_peg_revision, + ctx, subpool)); + SVN_ERR(svn_ra_get_repos_root2(target_session, &repos_root, + scratch_pool)); + } + else + { + /* The caller didn't provide the mergeinfo catalog for + TARGET_PATH_OR_URL, but wants us to pass a copy back + when we get it, so use RESULT_POOL. */ + SVN_ERR(get_mergeinfo(target_mergeinfo_catalog, &repos_root, + target_path_or_url, target_peg_revision, + depth == svn_depth_infinity, TRUE, + ctx, result_pool, scratch_pool)); + target_mergeinfo_cat = *target_mergeinfo_catalog; + } + } + else + { + /* The caller didn't provide the mergeinfo catalog for + TARGET_PATH_OR_URL, nor does it want a copy, so we can use + nothing but SCRATCH_POOL. */ + SVN_ERR(get_mergeinfo(&target_mergeinfo_cat, &repos_root, + target_path_or_url, target_peg_revision, + depth == svn_depth_infinity, TRUE, + ctx, scratch_pool, scratch_pool)); + } if (!svn_path_is_url(target_path_or_url)) { @@ -1755,6 +1796,7 @@ svn_client_mergeinfo_log2(svn_boolean_t finding_merged, history. */ if (finding_merged) { + svn_pool_destroy(subpool); return SVN_NO_ERROR; } else @@ -1772,18 +1814,17 @@ svn_client_mergeinfo_log2(svn_boolean_t finding_merged, * ### TODO: As the source and target must be in the same repository, we * should share a single session, tracking the two URLs separately. */ { - apr_pool_t *sesspool = svn_pool_create(scratch_pool); - svn_ra_session_t *source_session, *target_session; - svn_client__pathrev_t *pathrev; + svn_ra_session_t *source_session; svn_revnum_t start_rev, end_rev, youngest_rev = SVN_INVALID_REVNUM; if (! finding_merged) { - SVN_ERR(svn_client__ra_session_from_path2(&target_session, &pathrev, - target_path_or_url, NULL, - target_peg_revision, - target_peg_revision, - ctx, sesspool)); + if (!target_session) + SVN_ERR(svn_client__ra_session_from_path2(&target_session, &pathrev, + target_path_or_url, NULL, + target_peg_revision, + target_peg_revision, + ctx, subpool)); SVN_ERR(svn_client__get_history_as_mergeinfo(&target_history, NULL, pathrev, SVN_INVALID_REVNUM, @@ -1796,17 +1837,17 @@ svn_client_mergeinfo_log2(svn_boolean_t finding_merged, source_path_or_url, NULL, source_peg_revision, source_peg_revision, - ctx, sesspool)); + ctx, subpool)); SVN_ERR(svn_client__get_revision_number(&start_rev, &youngest_rev, ctx->wc_ctx, source_path_or_url, source_session, source_start_revision, - sesspool)); + subpool)); SVN_ERR(svn_client__get_revision_number(&end_rev, &youngest_rev, ctx->wc_ctx, source_path_or_url, source_session, source_end_revision, - sesspool)); + subpool)); SVN_ERR(svn_client__get_history_as_mergeinfo(&source_history, NULL, pathrev, MAX(end_rev, start_rev), @@ -1817,7 +1858,7 @@ svn_client_mergeinfo_log2(svn_boolean_t finding_merged, oldest_revs_first = FALSE; /* Close the source and target sessions. */ - svn_pool_destroy(sesspool); + svn_pool_destroy(subpool); } /* Separate the explicit or inherited mergeinfo on TARGET_PATH_OR_URL, @@ -2090,6 +2131,31 @@ svn_client_mergeinfo_log2(svn_boolean_t finding_merged, } svn_error_t * +svn_client_mergeinfo_log2(svn_boolean_t finding_merged, + const char *target_path_or_url, + const svn_opt_revision_t *target_peg_revision, + const char *source_path_or_url, + const svn_opt_revision_t *source_peg_revision, + const svn_opt_revision_t *source_start_revision, + const svn_opt_revision_t *source_end_revision, + svn_log_entry_receiver_t log_receiver, + void *log_receiver_baton, + svn_boolean_t discover_changed_paths, + svn_depth_t depth, + const apr_array_header_t *revprops, + svn_client_ctx_t *ctx, + apr_pool_t *scratch_pool) +{ + return svn_client__mergeinfo_log(finding_merged, target_path_or_url, + target_peg_revision, NULL, + source_path_or_url, source_peg_revision, + source_start_revision, source_end_revision, + log_receiver, log_receiver_baton, + discover_changed_paths, depth, revprops, + ctx, scratch_pool, scratch_pool); +} + +svn_error_t * svn_client_suggest_merge_sources(apr_array_header_t **suggestions, const char *path_or_url, const svn_opt_revision_t *peg_revision, diff --git a/contrib/subversion/subversion/libsvn_client/ra.c b/contrib/subversion/subversion/libsvn_client/ra.c index 33d3de509d68..a0d4ceab5f40 100644 --- a/contrib/subversion/subversion/libsvn_client/ra.c +++ b/contrib/subversion/subversion/libsvn_client/ra.c @@ -862,23 +862,20 @@ svn_client__repos_locations(const char **start_url, return SVN_NO_ERROR; } - svn_error_t * -svn_client__get_youngest_common_ancestor(svn_client__pathrev_t **ancestor_p, - const svn_client__pathrev_t *loc1, - const svn_client__pathrev_t *loc2, - svn_ra_session_t *session, - svn_client_ctx_t *ctx, - apr_pool_t *result_pool, - apr_pool_t *scratch_pool) +svn_client__calc_youngest_common_ancestor(svn_client__pathrev_t **ancestor_p, + const svn_client__pathrev_t *loc1, + apr_hash_t *history1, + svn_boolean_t has_rev_zero_history1, + const svn_client__pathrev_t *loc2, + apr_hash_t *history2, + svn_boolean_t has_rev_zero_history2, + apr_pool_t *result_pool, + apr_pool_t *scratch_pool) { - apr_pool_t *sesspool = NULL; - apr_hash_t *history1, *history2; apr_hash_index_t *hi; svn_revnum_t yc_revision = SVN_INVALID_REVNUM; const char *yc_relpath = NULL; - svn_boolean_t has_rev_zero_history1; - svn_boolean_t has_rev_zero_history2; if (strcmp(loc1->repos_root_url, loc2->repos_root_url) != 0) { @@ -886,32 +883,6 @@ svn_client__get_youngest_common_ancestor(svn_client__pathrev_t **ancestor_p, return SVN_NO_ERROR; } - /* Open an RA session for the two locations. */ - if (session == NULL) - { - sesspool = svn_pool_create(scratch_pool); - SVN_ERR(svn_client_open_ra_session2(&session, loc1->url, NULL, ctx, - sesspool, sesspool)); - } - - /* We're going to cheat and use history-as-mergeinfo because it - saves us a bunch of annoying custom data comparisons and such. */ - SVN_ERR(svn_client__get_history_as_mergeinfo(&history1, - &has_rev_zero_history1, - loc1, - SVN_INVALID_REVNUM, - SVN_INVALID_REVNUM, - session, ctx, scratch_pool)); - SVN_ERR(svn_client__get_history_as_mergeinfo(&history2, - &has_rev_zero_history2, - loc2, - SVN_INVALID_REVNUM, - SVN_INVALID_REVNUM, - session, ctx, scratch_pool)); - /* Close the ra session if we opened one. */ - if (sesspool) - svn_pool_destroy(sesspool); - /* Loop through the first location's history, check for overlapping paths and ranges in the second location's history, and remembering the youngest matching location. */ @@ -965,6 +936,63 @@ svn_client__get_youngest_common_ancestor(svn_client__pathrev_t **ancestor_p, } svn_error_t * +svn_client__get_youngest_common_ancestor(svn_client__pathrev_t **ancestor_p, + const svn_client__pathrev_t *loc1, + const svn_client__pathrev_t *loc2, + svn_ra_session_t *session, + svn_client_ctx_t *ctx, + apr_pool_t *result_pool, + apr_pool_t *scratch_pool) +{ + apr_pool_t *sesspool = NULL; + apr_hash_t *history1, *history2; + svn_boolean_t has_rev_zero_history1; + svn_boolean_t has_rev_zero_history2; + + if (strcmp(loc1->repos_root_url, loc2->repos_root_url) != 0) + { + *ancestor_p = NULL; + return SVN_NO_ERROR; + } + + /* Open an RA session for the two locations. */ + if (session == NULL) + { + sesspool = svn_pool_create(scratch_pool); + SVN_ERR(svn_client_open_ra_session2(&session, loc1->url, NULL, ctx, + sesspool, sesspool)); + } + + /* We're going to cheat and use history-as-mergeinfo because it + saves us a bunch of annoying custom data comparisons and such. */ + SVN_ERR(svn_client__get_history_as_mergeinfo(&history1, + &has_rev_zero_history1, + loc1, + SVN_INVALID_REVNUM, + SVN_INVALID_REVNUM, + session, ctx, scratch_pool)); + SVN_ERR(svn_client__get_history_as_mergeinfo(&history2, + &has_rev_zero_history2, + loc2, + SVN_INVALID_REVNUM, + SVN_INVALID_REVNUM, + session, ctx, scratch_pool)); + /* Close the ra session if we opened one. */ + if (sesspool) + svn_pool_destroy(sesspool); + + SVN_ERR(svn_client__calc_youngest_common_ancestor(ancestor_p, + loc1, history1, + has_rev_zero_history1, + loc2, history2, + has_rev_zero_history2, + result_pool, + scratch_pool)); + + return SVN_NO_ERROR; +} + +svn_error_t * svn_client__youngest_common_ancestor(const char **ancestor_url, svn_revnum_t *ancestor_rev, const char *path_or_url1, diff --git a/contrib/subversion/subversion/libsvn_client/switch.c b/contrib/subversion/subversion/libsvn_client/switch.c index fae03de09753..cd39cad936cf 100644 --- a/contrib/subversion/subversion/libsvn_client/switch.c +++ b/contrib/subversion/subversion/libsvn_client/switch.c @@ -241,7 +241,7 @@ switch_internal(svn_revnum_t *result_rev, return svn_error_createf(SVN_ERR_CLIENT_UNRELATED_RESOURCES, NULL, _("'%s' shares no common ancestry with '%s'"), switch_url, - svn_dirent_dirname(local_abspath, pool)); + svn_dirent_local_style(local_abspath, pool)); } wcroot_iprops = apr_hash_make(pool); diff --git a/contrib/subversion/subversion/libsvn_delta/compat.c b/contrib/subversion/subversion/libsvn_delta/compat.c index 8d315d194d57..470efa2a6bc1 100644 --- a/contrib/subversion/subversion/libsvn_delta/compat.c +++ b/contrib/subversion/subversion/libsvn_delta/compat.c @@ -218,6 +218,7 @@ locate_change(struct ev2_edit_baton *eb, change = apr_pcalloc(eb->edit_pool, sizeof(*change)); change->changing = SVN_INVALID_REVNUM; change->deleting = SVN_INVALID_REVNUM; + change->kind = svn_node_unknown; svn_hash_sets(eb->changes, relpath, change); @@ -1633,11 +1634,14 @@ apply_change(void **dir_baton, change->copyfrom_path, scratch_pool); else - copyfrom_url = change->copyfrom_path; + { + copyfrom_url = change->copyfrom_path; - /* Make this an FS path by prepending "/" */ - if (copyfrom_url[0] != '/') - copyfrom_url = apr_pstrcat(scratch_pool, "/", copyfrom_url, NULL); + /* Make this an FS path by prepending "/" */ + if (copyfrom_url[0] != '/') + copyfrom_url = apr_pstrcat(scratch_pool, "/", + copyfrom_url, NULL); + } copyfrom_rev = change->copyfrom_rev; } diff --git a/contrib/subversion/subversion/libsvn_fs_base/bdb/env.c b/contrib/subversion/subversion/libsvn_fs_base/bdb/env.c index 557c9dc36bb2..7309a80150dd 100644 --- a/contrib/subversion/subversion/libsvn_fs_base/bdb/env.c +++ b/contrib/subversion/subversion/libsvn_fs_base/bdb/env.c @@ -227,7 +227,7 @@ bdb_error_gatherer(const DB_ENV *dbenv, const char *baton, const char *msg) SVN_BDB_ERROR_GATHERER_IGNORE(dbenv); - new_err = svn_error_createf(APR_SUCCESS, NULL, "bdb: %s", msg); + new_err = svn_error_createf(SVN_ERR_FS_BERKELEY_DB, NULL, "bdb: %s", msg); if (error_info->pending_errors) svn_error_compose(error_info->pending_errors, new_err); else diff --git a/contrib/subversion/subversion/libsvn_fs_base/tree.c b/contrib/subversion/subversion/libsvn_fs_base/tree.c index e603af41e778..046ab5daa072 100644 --- a/contrib/subversion/subversion/libsvn_fs_base/tree.c +++ b/contrib/subversion/subversion/libsvn_fs_base/tree.c @@ -4811,6 +4811,13 @@ base_node_origin_rev(svn_revnum_t *revision, prev_location() does below will work. */ path = svn_fs__canonicalize_abspath(path, pool); + /* Special-case the root node (for performance reasons) */ + if (strcmp(path, "/") == 0) + { + *revision = 0; + return SVN_NO_ERROR; + } + /* If we have support for the node-origins table, we'll try to use it. */ if (bfd->format >= SVN_FS_BASE__MIN_NODE_ORIGINS_FORMAT) diff --git a/contrib/subversion/subversion/libsvn_fs_fs/fs_fs.c b/contrib/subversion/subversion/libsvn_fs_fs/fs_fs.c index 0354a1f5ffe9..c6074acee073 100644 --- a/contrib/subversion/subversion/libsvn_fs_fs/fs_fs.c +++ b/contrib/subversion/subversion/libsvn_fs_fs/fs_fs.c @@ -1467,6 +1467,12 @@ delete_revprops_shard(const char *shard_path, apr_pool_t *scratch_pool); /* In the filesystem FS, pack all revprop shards up to min_unpacked_rev. + * + * NOTE: Keep the old non-packed shards around until after the format bump. + * Otherwise, re-running upgrade will drop the packed revprop shard but + * have no unpacked data anymore. Call upgrade_cleanup_pack_revprops after + * the bump. + * * Use SCRATCH_POOL for temporary allocations. */ static svn_error_t * @@ -1507,6 +1513,29 @@ upgrade_pack_revprops(svn_fs_t *fs, svn_pool_clear(iterpool); } + svn_pool_destroy(iterpool); + + return SVN_NO_ERROR; +} + +/* In the filesystem FS, remove all non-packed revprop shards up to + * min_unpacked_rev. Use SCRATCH_POOL for temporary allocations. + * See upgrade_pack_revprops for more info. + */ +static svn_error_t * +upgrade_cleanup_pack_revprops(svn_fs_t *fs, + apr_pool_t *scratch_pool) +{ + fs_fs_data_t *ffd = fs->fsap_data; + const char *revprops_shard_path; + apr_int64_t shard; + apr_int64_t first_unpacked_shard + = ffd->min_unpacked_rev / ffd->max_files_per_dir; + + apr_pool_t *iterpool = svn_pool_create(scratch_pool); + const char *revsprops_dir = svn_dirent_join(fs->path, PATH_REVPROPS_DIR, + scratch_pool); + /* delete the non-packed revprops shards afterwards */ for (shard = 0; shard < first_unpacked_shard; ++shard) { @@ -1531,6 +1560,7 @@ upgrade_body(void *baton, apr_pool_t *pool) int format, max_files_per_dir; const char *format_path = path_format(fs, pool); svn_node_kind_t kind; + svn_boolean_t needs_revprop_shard_cleanup = FALSE; /* Read the FS format number and max-files-per-dir setting. */ SVN_ERR(read_format(&format, &max_files_per_dir, format_path, pool)); @@ -1582,15 +1612,28 @@ upgrade_body(void *baton, apr_pool_t *pool) if (format < SVN_FS_FS__MIN_PACKED_FORMAT) SVN_ERR(svn_io_file_create(path_min_unpacked_rev(fs, pool), "0\n", pool)); - /* If the file system supports revision packing but not revprop packing, - pack the revprops up to the point that revision data has been packed. */ + /* If the file system supports revision packing but not revprop packing + *and* the FS has been sharded, pack the revprops up to the point that + revision data has been packed. However, keep the non-packed revprop + files around until after the format bump */ if ( format >= SVN_FS_FS__MIN_PACKED_FORMAT - && format < SVN_FS_FS__MIN_PACKED_REVPROP_FORMAT) - SVN_ERR(upgrade_pack_revprops(fs, pool)); + && format < SVN_FS_FS__MIN_PACKED_REVPROP_FORMAT + && max_files_per_dir > 0) + { + needs_revprop_shard_cleanup = TRUE; + SVN_ERR(upgrade_pack_revprops(fs, pool)); + } /* Bump the format file. */ - return write_format(format_path, SVN_FS_FS__FORMAT_NUMBER, max_files_per_dir, - TRUE, pool); + SVN_ERR(write_format(format_path, SVN_FS_FS__FORMAT_NUMBER, + max_files_per_dir, TRUE, pool)); + + /* Now, it is safe to remove the redundant revprop files. */ + if (needs_revprop_shard_cleanup) + SVN_ERR(upgrade_cleanup_pack_revprops(fs, pool)); + + /* Done */ + return SVN_NO_ERROR; } @@ -3664,7 +3707,7 @@ parse_packed_revprops(svn_fs_t *fs, svn_string_t *compressed = svn_stringbuf__morph_into_string(revprops->packed_revprops); svn_stringbuf_t *uncompressed = svn_stringbuf_create_empty(pool); - SVN_ERR(svn__decompress(compressed, uncompressed, 0x1000000)); + SVN_ERR(svn__decompress(compressed, uncompressed, APR_SIZE_MAX)); /* read first revision number and number of revisions in the pack */ stream = svn_stream_from_stringbuf(uncompressed, scratch_pool); diff --git a/contrib/subversion/subversion/libsvn_fs_fs/rep-cache-db.h b/contrib/subversion/subversion/libsvn_fs_fs/rep-cache-db.h index fb44c617192d..9f64e8234c8f 100644 --- a/contrib/subversion/subversion/libsvn_fs_fs/rep-cache-db.h +++ b/contrib/subversion/subversion/libsvn_fs_fs/rep-cache-db.h @@ -1,4 +1,4 @@ -/* This file is automatically generated from rep-cache-db.sql and .dist_sandbox/subversion-1.8.0/subversion/libsvn_fs_fs/token-map.h. +/* This file is automatically generated from rep-cache-db.sql and .dist_sandbox/subversion-1.8.1/subversion/libsvn_fs_fs/token-map.h. * Do not edit this file -- edit the source and rerun gen-make.py */ #define STMT_CREATE_SCHEMA 0 diff --git a/contrib/subversion/subversion/libsvn_fs_fs/tree.c b/contrib/subversion/subversion/libsvn_fs_fs/tree.c index c14955d737b8..64c8395295a8 100644 --- a/contrib/subversion/subversion/libsvn_fs_fs/tree.c +++ b/contrib/subversion/subversion/libsvn_fs_fs/tree.c @@ -151,7 +151,7 @@ typedef struct cache_entry_t { /* hash value derived from PATH, REVISION. Used to short-circuit failed lookups. */ - long int hash_value; + apr_uint32_t hash_value; /* revision to which the NODE belongs */ svn_revnum_t revision; @@ -340,7 +340,12 @@ cache_lookup( fs_fs_dag_cache_t *cache { apr_size_t i, bucket_index; apr_size_t path_len = strlen(path); - long int hash_value = revision; + apr_uint32_t hash_value = (apr_uint32_t)revision; + +#if SVN_UNALIGNED_ACCESS_IS_OK + /* "randomizing" / distributing factor used in our hash function */ + const apr_uint32_t factor = 0xd1f3da69; +#endif /* optimistic lookup: hit the same bucket again? */ cache_entry_t *result = &cache->buckets[cache->last_hit]; @@ -353,11 +358,25 @@ cache_lookup( fs_fs_dag_cache_t *cache /* need to do a full lookup. Calculate the hash value (HASH_VALUE has been initialized to REVISION). */ - for (i = 0; i + 4 <= path_len; i += 4) - hash_value = hash_value * 0xd1f3da69 + *(const apr_uint32_t*)(path + i); + i = 0; +#if SVN_UNALIGNED_ACCESS_IS_OK + /* We relax the dependency chain between iterations by processing + two chunks from the input per hash_value self-multiplication. + The HASH_VALUE update latency is now 1 MUL latency + 1 ADD latency + per 2 chunks instead of 1 chunk. + */ + for (; i + 8 <= path_len; i += 8) + hash_value = hash_value * factor * factor + + ( *(const apr_uint32_t*)(path + i) * factor + + *(const apr_uint32_t*)(path + i + 4)); +#endif for (; i < path_len; ++i) - hash_value = hash_value * 33 + path[i]; + /* Help GCC to minimize the HASH_VALUE update latency by splitting the + MUL 33 of the naive implementation: h = h * 33 + path[i]. This + shortens the dependency chain from 1 shift + 2 ADDs to 1 shift + 1 ADD. + */ + hash_value = hash_value * 32 + (hash_value + (unsigned char)path[i]); bucket_index = hash_value + (hash_value >> 16); bucket_index = (bucket_index + (bucket_index >> 8)) % BUCKET_COUNT; @@ -3364,6 +3383,14 @@ fs_node_origin_rev(svn_revnum_t *revision, return SVN_NO_ERROR; } + /* The root node always has ID 0, created in revision 0 and will never + use the new-style ID format. */ + if (strcmp(node_id, "0") == 0) + { + *revision = 0; + return SVN_NO_ERROR; + } + /* OK, it's an old-style ID? Maybe it's cached. */ SVN_ERR(svn_fs_fs__get_node_origin(&cached_origin_id, fs, diff --git a/contrib/subversion/subversion/libsvn_ra/ra_loader.c b/contrib/subversion/subversion/libsvn_ra/ra_loader.c index 4afcb5969bb6..91c9cc14bcc9 100644 --- a/contrib/subversion/subversion/libsvn_ra/ra_loader.c +++ b/contrib/subversion/subversion/libsvn_ra/ra_loader.c @@ -1030,6 +1030,13 @@ svn_error_t *svn_ra_get_file_revs2(svn_ra_session_t *session, if (include_merged_revisions) SVN_ERR(svn_ra__assert_mergeinfo_capable_server(session, NULL, pool)); + if (start > end) + SVN_ERR( + svn_ra__assert_capable_server(session, + SVN_RA_CAPABILITY_GET_FILE_REVS_REVERSE, + NULL, + pool)); + err = session->vtable->get_file_revs(session, path, start, end, include_merged_revisions, handler, handler_baton, pool); diff --git a/contrib/subversion/subversion/libsvn_ra/util.c b/contrib/subversion/subversion/libsvn_ra/util.c index 47e48657c2a7..d9a4520b2e69 100644 --- a/contrib/subversion/subversion/libsvn_ra/util.c +++ b/contrib/subversion/subversion/libsvn_ra/util.c @@ -38,6 +38,26 @@ #include "svn_private_config.h" #include "private/svn_ra_private.h" +static const char * +get_path(const char *path_or_url, + svn_ra_session_t *ra_session, + apr_pool_t *pool) +{ + if (path_or_url == NULL) + { + svn_error_t *err = svn_ra_get_session_url(ra_session, &path_or_url, + pool); + if (err) + { + /* The SVN_ERR_UNSUPPORTED_FEATURE error in the caller is more + important, so dummy up the session's URL and chuck this error. */ + svn_error_clear(err); + return _("<repository>"); + } + } + return path_or_url; +} + svn_error_t * svn_ra__assert_mergeinfo_capable_server(svn_ra_session_t *ra_session, const char *path_or_url, @@ -48,18 +68,7 @@ svn_ra__assert_mergeinfo_capable_server(svn_ra_session_t *ra_session, SVN_RA_CAPABILITY_MERGEINFO, pool)); if (! mergeinfo_capable) { - if (path_or_url == NULL) - { - svn_error_t *err = svn_ra_get_session_url(ra_session, &path_or_url, - pool); - if (err) - { - /* The SVN_ERR_UNSUPPORTED_FEATURE error is more important, - so dummy up the session's URL and chuck this error. */ - svn_error_clear(err); - path_or_url = "<repository>"; - } - } + path_or_url = get_path(path_or_url, ra_session, pool); return svn_error_createf(SVN_ERR_UNSUPPORTED_FEATURE, NULL, _("Retrieval of mergeinfo unsupported by '%s'"), svn_path_is_url(path_or_url) @@ -69,6 +78,35 @@ svn_ra__assert_mergeinfo_capable_server(svn_ra_session_t *ra_session, return SVN_NO_ERROR; } +svn_error_t * +svn_ra__assert_capable_server(svn_ra_session_t *ra_session, + const char *capability, + const char *path_or_url, + apr_pool_t *pool) +{ + if (!strcmp(capability, SVN_RA_CAPABILITY_MERGEINFO)) + return svn_ra__assert_mergeinfo_capable_server(ra_session, path_or_url, + pool); + + else + { + svn_boolean_t has; + SVN_ERR(svn_ra_has_capability(ra_session, &has, capability, pool)); + if (! has) + { + path_or_url = get_path(path_or_url, ra_session, pool); + return svn_error_createf(SVN_ERR_UNSUPPORTED_FEATURE, NULL, + _("The '%s' feature is not supported by '%s'"), + capability, + svn_path_is_url(path_or_url) + ? path_or_url + : svn_dirent_local_style(path_or_url, + pool)); + } + } + return SVN_NO_ERROR; +} + /* Does ERR mean "the current value of the revprop isn't equal to the *OLD_VALUE_P you gave me"? */ diff --git a/contrib/subversion/subversion/libsvn_ra_serf/blame.c b/contrib/subversion/subversion/libsvn_ra_serf/blame.c index fa4243c0840b..b6f136a2bdad 100644 --- a/contrib/subversion/subversion/libsvn_ra_serf/blame.c +++ b/contrib/subversion/subversion/libsvn_ra_serf/blame.c @@ -366,7 +366,7 @@ svn_ra_serf__get_file_revs(svn_ra_session_t *ra_session, err = svn_ra_serf__context_run_one(handler, pool); err = svn_error_compose_create( - svn_ra_serf__error_on_status(handler->sline.code, + svn_ra_serf__error_on_status(handler->sline, handler->path, handler->location), err); diff --git a/contrib/subversion/subversion/libsvn_ra_serf/commit.c b/contrib/subversion/subversion/libsvn_ra_serf/commit.c index aaf17177d9d4..56a2bcea1e3b 100644 --- a/contrib/subversion/subversion/libsvn_ra_serf/commit.c +++ b/contrib/subversion/subversion/libsvn_ra_serf/commit.c @@ -223,7 +223,7 @@ return_response_err(svn_ra_serf__handler_t *handler) /* Try to return one of the standard errors for 301, 404, etc., then look for an error embedded in the response. */ return svn_error_compose_create(svn_ra_serf__error_on_status( - handler->sline.code, + handler->sline, handler->path, handler->location), err); @@ -2269,7 +2269,9 @@ abort_edit(void *edit_baton, && handler->sline.code != 404 ) { - SVN_ERR_MALFUNCTION(); + return svn_error_createf(SVN_ERR_RA_DAV_MALFORMED_DATA, NULL, + _("DELETE returned unexpected status: %d"), + handler->sline.code); } return SVN_NO_ERROR; diff --git a/contrib/subversion/subversion/libsvn_ra_serf/getdate.c b/contrib/subversion/subversion/libsvn_ra_serf/getdate.c index 867e86fbd501..cc1014ef0297 100644 --- a/contrib/subversion/subversion/libsvn_ra_serf/getdate.c +++ b/contrib/subversion/subversion/libsvn_ra_serf/getdate.c @@ -131,6 +131,7 @@ svn_ra_serf__get_dated_revision(svn_ra_session_t *ra_session, svn_ra_serf__handler_t *handler; svn_ra_serf__xml_context_t *xmlctx; const char *report_target; + svn_error_t *err; date_ctx = apr_palloc(pool, sizeof(*date_ctx)); date_ctx->time = tm; @@ -155,7 +156,15 @@ svn_ra_serf__get_dated_revision(svn_ra_session_t *ra_session, *date_ctx->revision = SVN_INVALID_REVNUM; - /* ### use svn_ra_serf__error_on_status() ? */ + err = svn_ra_serf__context_run_one(handler, pool); - return svn_error_trace(svn_ra_serf__context_run_one(handler, pool)); + SVN_ERR(svn_error_compose_create( + svn_ra_serf__error_on_status(handler->sline, + report_target, + handler->location), + err)); + + SVN_ERR_ASSERT(SVN_IS_VALID_REVNUM(*revision)); + + return SVN_NO_ERROR; } diff --git a/contrib/subversion/subversion/libsvn_ra_serf/getlocations.c b/contrib/subversion/subversion/libsvn_ra_serf/getlocations.c index d3e3175fac3d..1ae4f82dd8c8 100644 --- a/contrib/subversion/subversion/libsvn_ra_serf/getlocations.c +++ b/contrib/subversion/subversion/libsvn_ra_serf/getlocations.c @@ -192,7 +192,7 @@ svn_ra_serf__get_locations(svn_ra_session_t *ra_session, err = svn_ra_serf__context_run_one(handler, pool); SVN_ERR(svn_error_compose_create( - svn_ra_serf__error_on_status(handler->sline.code, + svn_ra_serf__error_on_status(handler->sline, req_url, handler->location), err)); diff --git a/contrib/subversion/subversion/libsvn_ra_serf/getlocationsegments.c b/contrib/subversion/subversion/libsvn_ra_serf/getlocationsegments.c index d2b69bf685c4..e5c58a90b5a7 100644 --- a/contrib/subversion/subversion/libsvn_ra_serf/getlocationsegments.c +++ b/contrib/subversion/subversion/libsvn_ra_serf/getlocationsegments.c @@ -194,7 +194,7 @@ svn_ra_serf__get_location_segments(svn_ra_session_t *ra_session, err = svn_ra_serf__context_run_one(handler, pool); err = svn_error_compose_create( - svn_ra_serf__error_on_status(handler->sline.code, + svn_ra_serf__error_on_status(handler->sline, handler->path, handler->location), err); diff --git a/contrib/subversion/subversion/libsvn_ra_serf/getlocks.c b/contrib/subversion/subversion/libsvn_ra_serf/getlocks.c index 61b8b8c7b051..04e556179936 100644 --- a/contrib/subversion/subversion/libsvn_ra_serf/getlocks.c +++ b/contrib/subversion/subversion/libsvn_ra_serf/getlocks.c @@ -266,7 +266,7 @@ svn_ra_serf__get_locks(svn_ra_session_t *ra_session, have existed earlier (E.g. 'svn ls http://s/svn/trunk/file@1' */ if (handler->sline.code != 404) { - SVN_ERR(svn_ra_serf__error_on_status(handler->sline.code, + SVN_ERR(svn_ra_serf__error_on_status(handler->sline, handler->path, handler->location)); } diff --git a/contrib/subversion/subversion/libsvn_ra_serf/inherited_props.c b/contrib/subversion/subversion/libsvn_ra_serf/inherited_props.c index 9283a5a53005..54eae0b5be7c 100644 --- a/contrib/subversion/subversion/libsvn_ra_serf/inherited_props.c +++ b/contrib/subversion/subversion/libsvn_ra_serf/inherited_props.c @@ -332,7 +332,7 @@ svn_ra_serf__get_inherited_props(svn_ra_session_t *ra_session, err = svn_ra_serf__context_run_one(handler, scratch_pool); SVN_ERR(svn_error_compose_create( - svn_ra_serf__error_on_status(handler->sline.code, + svn_ra_serf__error_on_status(handler->sline, handler->path, handler->location), err)); diff --git a/contrib/subversion/subversion/libsvn_ra_serf/log.c b/contrib/subversion/subversion/libsvn_ra_serf/log.c index e44753b07ae6..58a57d890ee4 100644 --- a/contrib/subversion/subversion/libsvn_ra_serf/log.c +++ b/contrib/subversion/subversion/libsvn_ra_serf/log.c @@ -595,7 +595,7 @@ svn_ra_serf__get_log(svn_ra_session_t *ra_session, err = svn_ra_serf__context_run_one(handler, pool); SVN_ERR(svn_error_compose_create( - svn_ra_serf__error_on_status(handler->sline.code, + svn_ra_serf__error_on_status(handler->sline, req_url, handler->location), err)); diff --git a/contrib/subversion/subversion/libsvn_ra_serf/mergeinfo.c b/contrib/subversion/subversion/libsvn_ra_serf/mergeinfo.c index b0bf8337cdfd..bd4fcbab5e7b 100644 --- a/contrib/subversion/subversion/libsvn_ra_serf/mergeinfo.c +++ b/contrib/subversion/subversion/libsvn_ra_serf/mergeinfo.c @@ -191,7 +191,7 @@ svn_ra_serf__get_mergeinfo(svn_ra_session_t *ra_session, svn_boolean_t include_descendants, apr_pool_t *pool) { - svn_error_t *err, *err2; + svn_error_t *err; mergeinfo_context_t *mergeinfo_ctx; svn_ra_serf__session_t *session = ra_session->priv; svn_ra_serf__handler_t *handler; @@ -229,15 +229,10 @@ svn_ra_serf__get_mergeinfo(svn_ra_session_t *ra_session, err = svn_ra_serf__context_run_one(handler, pool); - err2 = svn_ra_serf__error_on_status(handler->sline.code, handler->path, - handler->location); - if (err2) - { - svn_error_clear(err); - return err2; - } - - SVN_ERR(err); + SVN_ERR(svn_error_compose_create( + svn_ra_serf__error_on_status(handler->sline, handler->path, + handler->location), + err)); if (handler->done && apr_hash_count(mergeinfo_ctx->result_catalog)) *catalog = mergeinfo_ctx->result_catalog; diff --git a/contrib/subversion/subversion/libsvn_ra_serf/options.c b/contrib/subversion/subversion/libsvn_ra_serf/options.c index 0af0b1599c6d..a3c2fb95c881 100644 --- a/contrib/subversion/subversion/libsvn_ra_serf/options.c +++ b/contrib/subversion/subversion/libsvn_ra_serf/options.c @@ -362,6 +362,8 @@ options_response_handler(serf_request_t *request, capability_no); svn_hash_sets(session->capabilities, SVN_RA_CAPABILITY_EPHEMERAL_TXNPROPS, capability_no); + svn_hash_sets(session->capabilities, SVN_RA_CAPABILITY_GET_FILE_REVS_REVERSE, + capability_no); /* Then see which ones we can discover. */ serf_bucket_headers_do(hdrs, capabilities_headers_iterator_callback, @@ -436,11 +438,12 @@ svn_ra_serf__v2_get_youngest_revnum(svn_revnum_t *youngest, SVN_ERR(create_options_req(&opt_ctx, session, conn, scratch_pool)); SVN_ERR(svn_ra_serf__context_run_one(opt_ctx->handler, scratch_pool)); - SVN_ERR(svn_ra_serf__error_on_status(opt_ctx->handler->sline.code, + SVN_ERR(svn_ra_serf__error_on_status(opt_ctx->handler->sline, opt_ctx->handler->path, opt_ctx->handler->location)); *youngest = opt_ctx->youngest_rev; + SVN_ERR_ASSERT(SVN_IS_VALID_REVNUM(*youngest)); return SVN_NO_ERROR; } @@ -460,7 +463,7 @@ svn_ra_serf__v1_get_activity_collection(const char **activity_url, SVN_ERR(create_options_req(&opt_ctx, session, conn, scratch_pool)); SVN_ERR(svn_ra_serf__context_run_one(opt_ctx->handler, scratch_pool)); - SVN_ERR(svn_ra_serf__error_on_status(opt_ctx->handler->sline.code, + SVN_ERR(svn_ra_serf__error_on_status(opt_ctx->handler->sline, opt_ctx->handler->path, opt_ctx->handler->location)); @@ -499,7 +502,7 @@ svn_ra_serf__exchange_capabilities(svn_ra_serf__session_t *serf_sess, } SVN_ERR(svn_error_compose_create( - svn_ra_serf__error_on_status(opt_ctx->handler->sline.code, + svn_ra_serf__error_on_status(opt_ctx->handler->sline, serf_sess->session_url.path, opt_ctx->handler->location), err)); @@ -517,6 +520,65 @@ svn_ra_serf__exchange_capabilities(svn_ra_serf__session_t *serf_sess, } +static svn_error_t * +create_simple_options_body(serf_bucket_t **body_bkt, + void *baton, + serf_bucket_alloc_t *alloc, + apr_pool_t *pool) +{ + serf_bucket_t *body; + serf_bucket_t *s; + + body = serf_bucket_aggregate_create(alloc); + svn_ra_serf__add_xml_header_buckets(body, alloc); + + s = SERF_BUCKET_SIMPLE_STRING("<D:options xmlns:D=\"DAV:\" />", alloc); + serf_bucket_aggregate_append(body, s); + + *body_bkt = body; + return SVN_NO_ERROR; +} + + +svn_error_t * +svn_ra_serf__probe_proxy(svn_ra_serf__session_t *serf_sess, + apr_pool_t *scratch_pool) +{ + svn_ra_serf__handler_t *handler; + + handler = apr_pcalloc(scratch_pool, sizeof(*handler)); + handler->handler_pool = scratch_pool; + handler->method = "OPTIONS"; + handler->path = serf_sess->session_url.path; + handler->conn = serf_sess->conns[0]; + handler->session = serf_sess; + + /* We don't care about the response body, so discard it. */ + handler->response_handler = svn_ra_serf__handle_discard_body; + + /* We need a simple body, in order to send it in chunked format. */ + handler->body_delegate = create_simple_options_body; + + /* No special headers. */ + + SVN_ERR(svn_ra_serf__context_run_one(handler, scratch_pool)); + /* Some versions of nginx in reverse proxy mode will return 411. They want + a Content-Length header, rather than chunked requests. We can keep other + HTTP/1.1 features, but will disable the chunking. */ + if (handler->sline.code == 411) + { + serf_sess->using_chunked_requests = FALSE; + + return SVN_NO_ERROR; + } + SVN_ERR(svn_ra_serf__error_on_status(handler->sline, + handler->path, + handler->location)); + + return SVN_NO_ERROR; +} + + svn_error_t * svn_ra_serf__has_capability(svn_ra_session_t *ra_session, svn_boolean_t *has, diff --git a/contrib/subversion/subversion/libsvn_ra_serf/property.c b/contrib/subversion/subversion/libsvn_ra_serf/property.c index 63972e8597f1..586d38ff46ca 100644 --- a/contrib/subversion/subversion/libsvn_ra_serf/property.c +++ b/contrib/subversion/subversion/libsvn_ra_serf/property.c @@ -635,7 +635,7 @@ svn_ra_serf__wait_for_props(svn_ra_serf__handler_t *handler, err = svn_ra_serf__context_run_one(handler, scratch_pool); - err2 = svn_ra_serf__error_on_status(handler->sline.code, + err2 = svn_ra_serf__error_on_status(handler->sline, handler->path, handler->location); diff --git a/contrib/subversion/subversion/libsvn_ra_serf/ra_serf.h b/contrib/subversion/subversion/libsvn_ra_serf/ra_serf.h index 3f3f3ded05af..f6310b351dc7 100644 --- a/contrib/subversion/subversion/libsvn_ra_serf/ra_serf.h +++ b/contrib/subversion/subversion/libsvn_ra_serf/ra_serf.h @@ -144,6 +144,13 @@ struct svn_ra_serf__session_t { HTTP/1.0. Thus, we cannot send chunked requests. */ svn_boolean_t http10; + /* Should we use Transfer-Encoding: chunked for HTTP/1.1 servers. */ + svn_boolean_t using_chunked_requests; + + /* Do we need to detect whether the connection supports chunked requests? + i.e. is there a (reverse) proxy that does not support them? */ + svn_boolean_t detect_chunking; + /* Our Version-Controlled-Configuration; may be NULL until we know it. */ const char *vcc_url; @@ -186,7 +193,7 @@ struct svn_ra_serf__session_t { const char *activity_collection_url; /* Are we using a proxy? */ - int using_proxy; + svn_boolean_t using_proxy; const char *proxy_username; const char *proxy_password; @@ -1334,6 +1341,14 @@ svn_ra_serf__run_merge(const svn_commit_info_t **commit_info, /** OPTIONS-related functions **/ +/* When running with a proxy, we may need to detect and correct for problems. + This probing function will send a simple OPTIONS request to detect problems + with the connection. */ +svn_error_t * +svn_ra_serf__probe_proxy(svn_ra_serf__session_t *serf_sess, + apr_pool_t *scratch_pool); + + /* On HTTPv2 connections, run an OPTIONS request over CONN to fetch the current youngest revnum, returning it in *YOUNGEST. @@ -1744,7 +1759,7 @@ svn_ra_serf__credentials_callback(char **username, char **password, * where it necessary. */ svn_error_t * -svn_ra_serf__error_on_status(int status_code, +svn_ra_serf__error_on_status(serf_status_line sline, const char *path, const char *location); diff --git a/contrib/subversion/subversion/libsvn_ra_serf/replay.c b/contrib/subversion/subversion/libsvn_ra_serf/replay.c index 1fcecf43f878..2d385f345f36 100644 --- a/contrib/subversion/subversion/libsvn_ra_serf/replay.c +++ b/contrib/subversion/subversion/libsvn_ra_serf/replay.c @@ -696,7 +696,7 @@ svn_ra_serf__replay(svn_ra_session_t *ra_session, err = svn_ra_serf__context_run_wait(&replay_ctx->done, session, pool); SVN_ERR(svn_error_compose_create( - svn_ra_serf__error_on_status(handler->sline.code, + svn_ra_serf__error_on_status(handler->sline, handler->path, handler->location), err)); @@ -905,7 +905,7 @@ svn_ra_serf__replay_range(svn_ra_session_t *ra_session, svn_ra_serf__handler_t *done_handler = ctx->report_handler; done_list = done_list->next; - SVN_ERR(svn_ra_serf__error_on_status(done_handler->sline.code, + SVN_ERR(svn_ra_serf__error_on_status(done_handler->sline, done_handler->path, done_handler->location)); svn_pool_destroy(ctx->src_rev_pool); diff --git a/contrib/subversion/subversion/libsvn_ra_serf/serf.c b/contrib/subversion/subversion/libsvn_ra_serf/serf.c index 601615738043..b0b6346c5a92 100644 --- a/contrib/subversion/subversion/libsvn_ra_serf/serf.c +++ b/contrib/subversion/subversion/libsvn_ra_serf/serf.c @@ -137,6 +137,10 @@ load_http_auth_types(apr_pool_t *pool, svn_config_t *config, runtime configuration variable. */ #define DEFAULT_HTTP_TIMEOUT 600 +/* Private symbol for the 1.9-public SVN_CONFIG_OPTION_HTTP_CHUNKED_REQUESTS */ +#define OPTION_HTTP_CHUNKED_REQUESTS "http-chunked-requests" + + static svn_error_t * load_config(svn_ra_serf__session_t *session, apr_hash_t *config_hash, @@ -149,6 +153,7 @@ load_config(svn_ra_serf__session_t *session, const char *timeout_str = NULL; const char *exceptions; apr_port_t proxy_port; + svn_tristate_t chunked_requests; if (config_hash) { @@ -225,6 +230,12 @@ load_config(svn_ra_serf__session_t *session, SVN_CONFIG_OPTION_HTTP_MAX_CONNECTIONS, SVN_CONFIG_DEFAULT_OPTION_HTTP_MAX_CONNECTIONS)); + /* Should we use chunked transfer encoding. */ + SVN_ERR(svn_config_get_tristate(config, &chunked_requests, + SVN_CONFIG_SECTION_GLOBAL, + OPTION_HTTP_CHUNKED_REQUESTS, + "auto", svn_tristate_unknown)); + if (config) server_group = svn_config_find_group(config, session->session_url.hostname, @@ -281,6 +292,12 @@ load_config(svn_ra_serf__session_t *session, server_group, SVN_CONFIG_OPTION_HTTP_MAX_CONNECTIONS, session->max_connections)); + + /* Should we use chunked transfer encoding. */ + SVN_ERR(svn_config_get_tristate(config, &chunked_requests, + server_group, + OPTION_HTTP_CHUNKED_REQUESTS, + "auto", chunked_requests)); } /* Don't allow the http-max-connections value to be larger than our @@ -355,6 +372,24 @@ load_config(svn_ra_serf__session_t *session, session->using_proxy = FALSE; } + /* Setup detect_chunking and using_chunked_requests based on + * the chunked_requests tristate */ + if (chunked_requests == svn_tristate_unknown) + { + session->detect_chunking = TRUE; + session->using_chunked_requests = TRUE; + } + else if (chunked_requests == svn_tristate_true) + { + session->detect_chunking = FALSE; + session->using_chunked_requests = TRUE; + } + else /* chunked_requests == svn_tristate_false */ + { + session->detect_chunking = FALSE; + session->using_chunked_requests = FALSE; + } + /* Setup authentication. */ SVN_ERR(load_http_auth_types(pool, config, server_group, &session->authn_types)); @@ -392,6 +427,7 @@ svn_ra_serf__open(svn_ra_session_t *session, svn_ra_serf__session_t *serf_sess; apr_uri_t url; const char *client_string = NULL; + svn_error_t *err; if (corrected_url) *corrected_url = NULL; @@ -441,6 +477,10 @@ svn_ra_serf__open(svn_ra_session_t *session, HTTP/1.1 is supported, we can upgrade. */ serf_sess->http10 = TRUE; + /* If we switch to HTTP/1.1, then we will use chunked requests. We may disable + this, if we find an intervening proxy does not support chunked requests. */ + serf_sess->using_chunked_requests = TRUE; + SVN_ERR(load_config(serf_sess, config, serf_sess->pool)); serf_sess->conns[0] = apr_pcalloc(serf_sess->pool, @@ -479,7 +519,23 @@ svn_ra_serf__open(svn_ra_session_t *session, session->priv = serf_sess; - return svn_ra_serf__exchange_capabilities(serf_sess, corrected_url, pool); + err = svn_ra_serf__exchange_capabilities(serf_sess, corrected_url, pool); + + /* serf should produce a usable error code instead of APR_EGENERAL */ + if (err && err->apr_err == APR_EGENERAL) + err = svn_error_createf(SVN_ERR_RA_DAV_REQUEST_FAILED, err, + _("Connection to '%s' failed"), session_URL); + SVN_ERR(err); + + /* We have set up a useful connection (that doesn't indication a redirect). + If we've been told there is possibly a worrisome proxy in our path to the + server AND we switched to HTTP/1.1 (chunked requests), then probe for + problems in any proxy. */ + if ((corrected_url == NULL || *corrected_url == NULL) + && serf_sess->detect_chunking && !serf_sess->http10) + SVN_ERR(svn_ra_serf__probe_proxy(serf_sess, pool)); + + return SVN_NO_ERROR; } /* Implements svn_ra__vtable_t.reparent(). */ diff --git a/contrib/subversion/subversion/libsvn_ra_serf/update.c b/contrib/subversion/subversion/libsvn_ra_serf/update.c index 21ed2dfc9cd9..06a16c06effd 100644 --- a/contrib/subversion/subversion/libsvn_ra_serf/update.c +++ b/contrib/subversion/subversion/libsvn_ra_serf/update.c @@ -1268,7 +1268,7 @@ handle_stream(serf_request_t *request, /* ### new field. make sure we didn't miss some initialization. */ SVN_ERR_ASSERT(fetch_ctx->handler != NULL); - err = svn_ra_serf__error_on_status(fetch_ctx->handler->sline.code, + err = svn_ra_serf__error_on_status(fetch_ctx->handler->sline, fetch_ctx->info->name, fetch_ctx->handler->location); if (err) @@ -2739,7 +2739,7 @@ setup_update_report_headers(serf_bucket_t *headers, if (report->sess->using_compression) { serf_bucket_headers_setn(headers, "Accept-Encoding", - "gzip;svndiff1;q=0.9,svndiff;q=0.8"); + "gzip,svndiff1;q=0.9,svndiff;q=0.8"); } else { @@ -2891,7 +2891,7 @@ finish_report(void *report_baton, { return svn_error_trace( svn_error_compose_create( - svn_ra_serf__error_on_status(handler->sline.code, + svn_ra_serf__error_on_status(handler->sline, handler->path, handler->location), err)); diff --git a/contrib/subversion/subversion/libsvn_ra_serf/util.c b/contrib/subversion/subversion/libsvn_ra_serf/util.c index c7a171627e2b..ce1e31a94c8a 100644 --- a/contrib/subversion/subversion/libsvn_ra_serf/util.c +++ b/contrib/subversion/subversion/libsvn_ra_serf/util.c @@ -373,10 +373,8 @@ conn_setup(apr_socket_t *sock, { conn->ssl_context = serf_bucket_ssl_encrypt_context_get(*read_bkt); -#if SERF_VERSION_AT_LEAST(1,0,0) serf_ssl_set_hostname(conn->ssl_context, conn->session->session_url.hostname); -#endif serf_ssl_client_cert_provider_set(conn->ssl_context, svn_ra_serf__handle_client_cert, @@ -477,7 +475,7 @@ connection_closed(svn_ra_serf__connection_t *conn, { if (why) { - SVN_ERR_MALFUNCTION(); + return svn_error_wrap_apr(why, NULL); } if (conn->session->using_ssl) @@ -642,10 +640,10 @@ setup_serf_req(serf_request_t *request, { serf_bucket_alloc_t *allocator = serf_request_get_alloc(request); -#if SERF_VERSION_AT_LEAST(1, 1, 0) svn_spillbuf_t *buf; + svn_boolean_t set_CL = session->http10 || !session->using_chunked_requests; - if (session->http10 && body_bkt != NULL) + if (set_CL && body_bkt != NULL) { /* Ugh. Use HTTP/1.0 to talk to the server because we don't know if it speaks HTTP/1.1 (and thus, chunked requests), or because the @@ -665,7 +663,6 @@ setup_serf_req(serf_request_t *request, request_pool, scratch_pool); } -#endif /* Create a request bucket. Note that this sucker is kind enough to add a "Host" header for us. */ @@ -674,15 +671,13 @@ setup_serf_req(serf_request_t *request, /* Set the Content-Length value. This will also trigger an HTTP/1.0 request (rather than the default chunked request). */ -#if SERF_VERSION_AT_LEAST(1, 1, 0) - if (session->http10) + if (set_CL) { if (body_bkt == NULL) serf_bucket_request_set_CL(*req_bkt, 0); else serf_bucket_request_set_CL(*req_bkt, svn_spillbuf__get_size(buf)); } -#endif *hdrs_bkt = serf_bucket_request_get_headers(*req_bkt); @@ -696,10 +691,10 @@ setup_serf_req(serf_request_t *request, serf_bucket_headers_setn(*hdrs_bkt, "Content-Type", content_type); } -#if SERF_VERSION_AT_LEAST(1, 1, 0) if (session->http10) + { serf_bucket_headers_setn(*hdrs_bkt, "Connection", "keep-alive"); -#endif + } if (accept_encoding) { @@ -2390,17 +2385,17 @@ svn_ra_serf__report_resource(const char **report_target, } svn_error_t * -svn_ra_serf__error_on_status(int status_code, +svn_ra_serf__error_on_status(serf_status_line sline, const char *path, const char *location) { - switch(status_code) + switch(sline.code) { case 301: case 302: case 307: return svn_error_createf(SVN_ERR_RA_DAV_RELOCATED, NULL, - (status_code == 301) + (sline.code == 301) ? _("Repository moved permanently to '%s';" " please relocate") : _("Repository moved temporarily to '%s';" @@ -2415,8 +2410,20 @@ svn_ra_serf__error_on_status(int status_code, case 423: return svn_error_createf(SVN_ERR_FS_NO_LOCK_TOKEN, NULL, _("'%s': no lock token available"), path); + + case 411: + return svn_error_createf(SVN_ERR_RA_DAV_REQUEST_FAILED, NULL, + _("DAV request failed: 411 Content length required. The " + "server or an intermediate proxy does not accept " + "chunked encoding. Try setting 'http-chunked-requests' " + "to 'auto' or 'no' in your client configuration.")); } + if (sline.code >= 300) + return svn_error_createf(SVN_ERR_RA_DAV_REQUEST_FAILED, NULL, + _("Unexpected HTTP status %d '%s' on '%s'\n"), + sline.code, sline.reason, path); + return SVN_NO_ERROR; } diff --git a/contrib/subversion/subversion/libsvn_ra_serf/xml.c b/contrib/subversion/subversion/libsvn_ra_serf/xml.c index 95017d5e3be4..a95eaccd2199 100644 --- a/contrib/subversion/subversion/libsvn_ra_serf/xml.c +++ b/contrib/subversion/subversion/libsvn_ra_serf/xml.c @@ -615,6 +615,14 @@ svn_ra_serf__xml_cb_start(svn_ra_serf__xml_context_t *xmlctx, } if (scan->ns == NULL) { + if (current->state == 0) + { + return svn_error_createf( + SVN_ERR_RA_DAV_MALFORMED_DATA, NULL, + _("XML Parsing failed: Unexpected root element '%s'"), + elemname.name); + } + xmlctx->waiting = elemname; /* ### return? */ return SVN_NO_ERROR; diff --git a/contrib/subversion/subversion/libsvn_ra_svn/client.c b/contrib/subversion/subversion/libsvn_ra_svn/client.c index 4b3762c33d3d..2157e4206192 100644 --- a/contrib/subversion/subversion/libsvn_ra_svn/client.c +++ b/contrib/subversion/subversion/libsvn_ra_svn/client.c @@ -977,6 +977,28 @@ static svn_error_t *ra_svn_commit(svn_ra_session_t *session, const svn_string_t *log_msg = svn_hash_gets(revprop_table, SVN_PROP_REVISION_LOG); + if (log_msg == NULL && + ! svn_ra_svn_has_capability(conn, SVN_RA_SVN_CAP_COMMIT_REVPROPS)) + { + return svn_error_createf(SVN_ERR_BAD_PROPERTY_VALUE, NULL, + _("ra_svn does not support not specifying " + "a log message with pre-1.5 servers; " + "consider passing an empty one, or upgrading " + "the server")); + } + else if (log_msg == NULL) + /* 1.5+ server. Set LOG_MSG to something, since the 'logmsg' argument + to the 'commit' protocol command is non-optional; on the server side, + only REVPROP_TABLE will be used, and LOG_MSG will be ignored. The + "svn:log" member of REVPROP_TABLE table is NULL, therefore the commit + will have a NULL log message (not just "", really NULL). + + svnserve 1.5.x+ has always ignored LOG_MSG when REVPROP_TABLE was + present; this was elevated to a protocol promise in r1498550 (and + later documented in this comment) in order to fix the segmentation + fault bug described in the log message of r1498550.*/ + log_msg = svn_string_create("", pool); + /* If we're sending revprops other than svn:log, make sure the server won't silently ignore them. */ if (apr_hash_count(revprop_table) > 1 && @@ -1456,16 +1478,19 @@ static svn_error_t *ra_svn_diff(svn_ra_session_t *session, } -static svn_error_t *ra_svn_log(svn_ra_session_t *session, - const apr_array_header_t *paths, - svn_revnum_t start, svn_revnum_t end, - int limit, - svn_boolean_t discover_changed_paths, - svn_boolean_t strict_node_history, - svn_boolean_t include_merged_revisions, - const apr_array_header_t *revprops, - svn_log_entry_receiver_t receiver, - void *receiver_baton, apr_pool_t *pool) +static svn_error_t * +perform_ra_svn_log(svn_error_t **outer_error, + svn_ra_session_t *session, + const apr_array_header_t *paths, + svn_revnum_t start, svn_revnum_t end, + int limit, + svn_boolean_t discover_changed_paths, + svn_boolean_t strict_node_history, + svn_boolean_t include_merged_revisions, + const apr_array_header_t *revprops, + svn_log_entry_receiver_t receiver, + void *receiver_baton, + apr_pool_t *pool) { svn_ra_svn__session_baton_t *sess_baton = session->priv; svn_ra_svn_conn_t *conn = sess_baton->conn; @@ -1606,8 +1631,10 @@ static svn_error_t *ra_svn_log(svn_ra_session_t *session, cphash = NULL; nreceived = 0; - if (! (limit && (nest_level == 0) && (++nreceived > limit))) + if (! (limit && (nest_level == 0) && (++nreceived > limit)) + && ! *outer_error) { + svn_error_t *err; log_entry = svn_log_entry_create(iterpool); log_entry->changed_paths = cphash; @@ -1650,7 +1677,15 @@ static svn_error_t *ra_svn_log(svn_ra_session_t *session, SVN_PROP_REVISION_LOG, message); } } - SVN_ERR(receiver(receiver_baton, log_entry, iterpool)); + err = receiver(receiver_baton, log_entry, iterpool); + if (err && err->apr_err == SVN_ERR_CEASE_INVOCATION) + { + *outer_error = svn_error_trace( + svn_error_compose_create(*outer_error, err)); + } + else + SVN_ERR(err); + if (log_entry->has_children) { nest_level++; @@ -1665,10 +1700,41 @@ static svn_error_t *ra_svn_log(svn_ra_session_t *session, svn_pool_destroy(iterpool); /* Read the response. */ - return svn_ra_svn__read_cmd_response(conn, pool, ""); + return svn_error_trace(svn_ra_svn__read_cmd_response(conn, pool, "")); +} + +static svn_error_t * +ra_svn_log(svn_ra_session_t *session, + const apr_array_header_t *paths, + svn_revnum_t start, svn_revnum_t end, + int limit, + svn_boolean_t discover_changed_paths, + svn_boolean_t strict_node_history, + svn_boolean_t include_merged_revisions, + const apr_array_header_t *revprops, + svn_log_entry_receiver_t receiver, + void *receiver_baton, apr_pool_t *pool) +{ + svn_error_t *outer_error = NULL; + svn_error_t *err; + + err = svn_error_trace(perform_ra_svn_log(&outer_error, + session, paths, + start, end, + limit, + discover_changed_paths, + strict_node_history, + include_merged_revisions, + revprops, + receiver, receiver_baton, + pool)); + return svn_error_trace( + svn_error_compose_create(outer_error, + err)); } + static svn_error_t *ra_svn_check_path(svn_ra_session_t *session, const char *path, svn_revnum_t rev, svn_node_kind_t *kind, apr_pool_t *pool) diff --git a/contrib/subversion/subversion/libsvn_ra_svn/protocol b/contrib/subversion/subversion/libsvn_ra_svn/protocol index 059873c8365a..d056b74a5138 100644 --- a/contrib/subversion/subversion/libsvn_ra_svn/protocol +++ b/contrib/subversion/subversion/libsvn_ra_svn/protocol @@ -294,8 +294,12 @@ second place for auth-request point as noted below. Upon receiving response, client switches to editor command set. Upon successful completion of edit, server sends auth-request. After auth exchange completes, server sends commit-info. + If rev-props is present, logmsg is ignored. Only the svn:log entry in + rev-props (if any) will be used. commit-info: ( new-rev:number date:string author:string ? ( post-commit-err:string ) ) + NOTE: when revving this, make 'logmsg' optional, or delete that parameter + and have the log message specified in 'rev-props'. get-file params: ( path:string [ rev:number ] want-props:bool want-contents:bool diff --git a/contrib/subversion/subversion/libsvn_repos/fs-wrap.c b/contrib/subversion/subversion/libsvn_repos/fs-wrap.c index b759c57fe101..755fa61bbb05 100644 --- a/contrib/subversion/subversion/libsvn_repos/fs-wrap.c +++ b/contrib/subversion/subversion/libsvn_repos/fs-wrap.c @@ -172,6 +172,10 @@ svn_repos__validate_prop(const char *name, { svn_prop_kind_t kind = svn_property_kind2(name); + /* Allow deleting any property, even a property we don't allow to set. */ + if (value == NULL) + return SVN_NO_ERROR; + /* Disallow setting non-regular properties. */ if (kind != svn_prop_regular_kind) return svn_error_createf diff --git a/contrib/subversion/subversion/libsvn_subr/config_file.c b/contrib/subversion/subversion/libsvn_subr/config_file.c index 9d15f6b149f8..c705b14fd40a 100644 --- a/contrib/subversion/subversion/libsvn_subr/config_file.c +++ b/contrib/subversion/subversion/libsvn_subr/config_file.c @@ -94,7 +94,7 @@ parser_getc(parse_context_t *ctx, int *c) } else if (ctx->buffer_pos < ctx->buffer_size) { - *c = ctx->parser_buffer[ctx->buffer_pos]; + *c = (unsigned char)ctx->parser_buffer[ctx->buffer_pos]; ctx->buffer_pos++; } else @@ -107,7 +107,7 @@ parser_getc(parse_context_t *ctx, int *c) if (ctx->buffer_pos < ctx->buffer_size) { - *c = ctx->parser_buffer[ctx->buffer_pos]; + *c = (unsigned char)ctx->parser_buffer[ctx->buffer_pos]; ctx->buffer_pos++; } else @@ -131,7 +131,7 @@ parser_getc_plain(parse_context_t *ctx, int *c) { if (ctx->buffer_pos < ctx->buffer_size) { - *c = ctx->parser_buffer[ctx->buffer_pos]; + *c = (unsigned char)ctx->parser_buffer[ctx->buffer_pos]; ctx->buffer_pos++; return SVN_NO_ERROR; @@ -189,6 +189,32 @@ skip_to_eoln(parse_context_t *ctx, int *c) return SVN_NO_ERROR; } +/* Skip a UTF-8 Byte Order Mark if found. */ +static APR_INLINE svn_error_t * +skip_bom(parse_context_t *ctx) +{ + int ch; + + SVN_ERR(parser_getc(ctx, &ch)); + if (ch == 0xEF) + { + const unsigned char *buf = (unsigned char *)ctx->parser_buffer; + /* This makes assumptions about the implementation of parser_getc and + * the use of skip_bom. Specifically that parser_getc() will get all + * of the BOM characters into the parse_context_t buffer. This can + * safely be assumed as long as we only try to use skip_bom() at the + * start of the stream and the buffer is longer than 3 characters. */ + SVN_ERR_ASSERT(ctx->buffer_size > ctx->buffer_pos + 1); + if (buf[ctx->buffer_pos] == 0xBB && buf[ctx->buffer_pos + 1] == 0xBF) + ctx->buffer_pos += 2; + else + SVN_ERR(parser_ungetc(ctx, ch)); + } + else + SVN_ERR(parser_ungetc(ctx, ch)); + + return SVN_NO_ERROR; +} /* Parse a single option value */ static svn_error_t * @@ -450,6 +476,8 @@ svn_config__parse_stream(svn_config_t *cfg, svn_stream_t *stream, ctx->buffer_pos = 0; ctx->buffer_size = 0; + SVN_ERR(skip_bom(ctx)); + do { SVN_ERR(skip_whitespace(ctx, &ch, &count)); @@ -806,6 +834,8 @@ svn_config_ensure(const char *config_dir, apr_pool_t *pool) "### http-max-connections Maximum number of parallel server" NL "### connections to use for any given" NL "### HTTP operation." NL + "### http-chunked-requests Whether to use chunked transfer" NL + "### encoding for HTTP requests body." NL "### neon-debug-mask Debug mask for Neon HTTP library" NL "### ssl-authority-files List of files, each of a trusted CA" NL diff --git a/contrib/subversion/subversion/libsvn_subr/gpg_agent.c b/contrib/subversion/subversion/libsvn_subr/gpg_agent.c index f0395c00c750..e23339074a40 100644 --- a/contrib/subversion/subversion/libsvn_subr/gpg_agent.c +++ b/contrib/subversion/subversion/libsvn_subr/gpg_agent.c @@ -156,42 +156,28 @@ send_option(int sd, char *buf, size_t n, const char *option, const char *value, return (strncmp(buf, "OK", 2) == 0); } -/* Implementation of svn_auth__password_get_t that retrieves the password - from gpg-agent */ + +/* Locate a running GPG Agent, and return an open file descriptor + * for communication with the agent in *NEW_SD. If no running agent + * can be found, set *NEW_SD to -1. */ static svn_error_t * -password_get_gpg_agent(svn_boolean_t *done, - const char **password, - apr_hash_t *creds, - const char *realmstring, - const char *username, - apr_hash_t *parameters, - svn_boolean_t non_interactive, - apr_pool_t *pool) +find_running_gpg_agent(int *new_sd, apr_pool_t *pool) { - int sd; + char *buffer; char *gpg_agent_info = NULL; + const char *socket_name = NULL; + const char *request = NULL; const char *p = NULL; char *ep = NULL; - char *buffer; - - apr_array_header_t *socket_details; - const char *request = NULL; - const char *cache_id = NULL; - struct sockaddr_un addr; - const char *tty_name; - const char *tty_type; - const char *lc_ctype; - const char *display; - const char *socket_name = NULL; - svn_checksum_t *digest = NULL; - char *password_prompt; - char *realm_prompt; + int sd; - *done = FALSE; + *new_sd = -1; gpg_agent_info = getenv("GPG_AGENT_INFO"); if (gpg_agent_info != NULL) { + apr_array_header_t *socket_details; + socket_details = svn_cstring_split(gpg_agent_info, ":", TRUE, pool); socket_name = APR_ARRAY_IDX(socket_details, 0, const char *); @@ -201,6 +187,8 @@ password_get_gpg_agent(svn_boolean_t *done, if (socket_name != NULL) { + struct sockaddr_un addr; + addr.sun_family = AF_UNIX; strncpy(addr.sun_path, socket_name, sizeof(addr.sun_path) - 1); addr.sun_path[sizeof(addr.sun_path) - 1] = '\0'; @@ -273,6 +261,44 @@ password_get_gpg_agent(svn_boolean_t *done, return SVN_NO_ERROR; } + *new_sd = sd; + return SVN_NO_ERROR; +} + +/* Implementation of svn_auth__password_get_t that retrieves the password + from gpg-agent */ +static svn_error_t * +password_get_gpg_agent(svn_boolean_t *done, + const char **password, + apr_hash_t *creds, + const char *realmstring, + const char *username, + apr_hash_t *parameters, + svn_boolean_t non_interactive, + apr_pool_t *pool) +{ + int sd; + const char *p = NULL; + char *ep = NULL; + char *buffer; + const char *request = NULL; + const char *cache_id = NULL; + const char *tty_name; + const char *tty_type; + const char *lc_ctype; + const char *display; + svn_checksum_t *digest = NULL; + char *password_prompt; + char *realm_prompt; + + *done = FALSE; + + SVN_ERR(find_running_gpg_agent(&sd, pool)); + if (sd == -1) + return SVN_NO_ERROR; + + buffer = apr_palloc(pool, BUFFER_SIZE); + /* Send TTY_NAME to the gpg-agent daemon. */ tty_name = getenv("GPG_TTY"); if (tty_name != NULL) @@ -283,11 +309,6 @@ password_get_gpg_agent(svn_boolean_t *done, return SVN_NO_ERROR; } } - else - { - close(sd); - return SVN_NO_ERROR; - } /* Send TTY_TYPE to the gpg-agent daemon. */ tty_type = getenv("TERM"); @@ -299,11 +320,6 @@ password_get_gpg_agent(svn_boolean_t *done, return SVN_NO_ERROR; } } - else - { - close(sd); - return SVN_NO_ERROR; - } /* Compute LC_CTYPE. */ lc_ctype = getenv("LC_ALL"); @@ -388,8 +404,8 @@ password_get_gpg_agent(svn_boolean_t *done, password in GPG Agent if that's how this particular integration worked. But it isn't. GPG Agent stores the password provided by the user via the pinentry program immediately upon its provision - (and regardless of its accuracy as passwords go), so there's - nothing really to do here. */ + (and regardless of its accuracy as passwords go), so we just need + to check if a running GPG Agent exists. */ static svn_error_t * password_set_gpg_agent(svn_boolean_t *done, apr_hash_t *creds, @@ -400,6 +416,15 @@ password_set_gpg_agent(svn_boolean_t *done, svn_boolean_t non_interactive, apr_pool_t *pool) { + int sd; + + *done = FALSE; + + SVN_ERR(find_running_gpg_agent(&sd, pool)); + if (sd == -1) + return SVN_NO_ERROR; + + close(sd); *done = TRUE; return SVN_NO_ERROR; diff --git a/contrib/subversion/subversion/libsvn_subr/internal_statements.h b/contrib/subversion/subversion/libsvn_subr/internal_statements.h index 9e31e74badae..dd81d9fb7deb 100644 --- a/contrib/subversion/subversion/libsvn_subr/internal_statements.h +++ b/contrib/subversion/subversion/libsvn_subr/internal_statements.h @@ -1,4 +1,4 @@ -/* This file is automatically generated from internal_statements.sql and .dist_sandbox/subversion-1.8.0/subversion/libsvn_subr/token-map.h. +/* This file is automatically generated from internal_statements.sql and .dist_sandbox/subversion-1.8.1/subversion/libsvn_subr/token-map.h. * Do not edit this file -- edit the source and rerun gen-make.py */ #define STMT_INTERNAL_SAVEPOINT_SVN 0 diff --git a/contrib/subversion/subversion/libsvn_subr/io.c b/contrib/subversion/subversion/libsvn_subr/io.c index 58bc5403653b..d31819410f05 100644 --- a/contrib/subversion/subversion/libsvn_subr/io.c +++ b/contrib/subversion/subversion/libsvn_subr/io.c @@ -3533,6 +3533,9 @@ svn_io_read_length_line(apr_file_t *file, char *buf, apr_size_t *limit, apr_size_t bytes_read = 0; char *eol; + if (to_read == 0) + break; + /* read data block (or just a part of it) */ SVN_ERR(svn_io_file_read_full2(file, buf, to_read, &bytes_read, &eof, pool)); diff --git a/contrib/subversion/subversion/libsvn_subr/named_atomic.c b/contrib/subversion/subversion/libsvn_subr/named_atomic.c index d07e7424f638..cd58bbb38817 100644 --- a/contrib/subversion/subversion/libsvn_subr/named_atomic.c +++ b/contrib/subversion/subversion/libsvn_subr/named_atomic.c @@ -251,6 +251,7 @@ struct svn_atomic_namespace__t */ static svn_mutex__t *thread_mutex = NULL; +#if APR_HAS_MMAP /* Initialization flag for the above used by svn_atomic__init_once. */ static volatile svn_atomic_t mutex_initialized = FALSE; @@ -266,6 +267,7 @@ init_thread_mutex(void *baton, apr_pool_t *pool) return svn_mutex__init(&thread_mutex, USE_THREAD_MUTEX, global_pool); } +#endif /* APR_HAS_MMAP */ /* Utility that acquires our global mutex and converts error types. */ @@ -297,6 +299,7 @@ unlock(struct mutex_t *mutex, svn_error_t * outer_err) unlock_err)); } +#if APR_HAS_MMAP /* The last user to close a particular namespace should also remove the * lock file. Failure to do so, however, does not affect further uses * of the same namespace. @@ -318,6 +321,7 @@ delete_lock_file(void *arg) return status; } +#endif /* APR_HAS_MMAP */ /* Validate the ATOMIC parameter, i.e it's address. Correct code will * never need this but if someone should accidentally to use a NULL or @@ -351,7 +355,11 @@ return_atomic(svn_named_atomic__t **atomic, svn_boolean_t svn_named_atomic__is_supported(void) { -#ifdef _WIN32 +#if !APR_HAS_MMAP + return FALSE; +#elif !defined(_WIN32) + return TRUE; +#else static svn_tristate_t result = svn_tristate_unknown; if (result == svn_tristate_unknown) @@ -373,9 +381,7 @@ svn_named_atomic__is_supported(void) } return result == svn_tristate_true; -#else - return TRUE; -#endif +#endif /* _WIN32 */ } svn_boolean_t @@ -389,6 +395,9 @@ svn_atomic_namespace__create(svn_atomic_namespace__t **ns, const char *name, apr_pool_t *result_pool) { +#if !APR_HAS_MMAP + return svn_error_create(APR_ENOTIMPL, NULL, NULL); +#else apr_status_t apr_err; svn_error_t *err; apr_file_t *file; @@ -489,6 +498,7 @@ svn_atomic_namespace__create(svn_atomic_namespace__t **ns, /* Unlock to allow other processes may access the shared memory as well. */ return unlock(&new_ns->mutex, err); +#endif /* APR_HAS_MMAP */ } svn_error_t * diff --git a/contrib/subversion/subversion/libsvn_subr/sqlite.c b/contrib/subversion/subversion/libsvn_subr/sqlite.c index 0afceffe6617..149b0253be92 100644 --- a/contrib/subversion/subversion/libsvn_subr/sqlite.c +++ b/contrib/subversion/subversion/libsvn_subr/sqlite.c @@ -140,9 +140,9 @@ struct svn_sqlite__value_t int sqlite_err__temp = (x); \ if (sqlite_err__temp != SQLITE_OK) \ return svn_error_createf(SQLITE_ERROR_CODE(sqlite_err__temp), \ - NULL, "sqlite: %s (S%d)", \ - sqlite3_errmsg((db)->db3), \ - sqlite_err__temp); \ + NULL, "sqlite[S%d]: %s", \ + sqlite_err__temp, \ + sqlite3_errmsg((db)->db3)); \ } while (0) #define SQLITE_ERR_MSG(x, msg) do \ @@ -150,8 +150,8 @@ struct svn_sqlite__value_t int sqlite_err__temp = (x); \ if (sqlite_err__temp != SQLITE_OK) \ return svn_error_createf(SQLITE_ERROR_CODE(sqlite_err__temp), \ - NULL, "sqlite: %s (S%d)", (msg), \ - sqlite_err__temp); \ + NULL, "sqlite[S%d]: %s", \ + sqlite_err__temp, msg); \ } while (0) @@ -173,9 +173,9 @@ exec_sql2(svn_sqlite__db_t *db, const char *sql, int ignored_err) if (sqlite_err != SQLITE_OK && sqlite_err != ignored_err) { svn_error_t *err = svn_error_createf(SQLITE_ERROR_CODE(sqlite_err), NULL, - _("sqlite: %s (S%d)," + _("sqlite[S%d]: %s," " executing statement '%s'"), - err_msg, sqlite_err, sql); + sqlite_err, err_msg, sql); sqlite3_free(err_msg); return err; } @@ -292,8 +292,8 @@ svn_sqlite__step(svn_boolean_t *got_row, svn_sqlite__stmt_t *stmt) svn_error_t *err1, *err2; err1 = svn_error_createf(SQLITE_ERROR_CODE(sqlite_result), NULL, - "sqlite: %s (S%d)", - sqlite3_errmsg(stmt->db->db3), sqlite_result); + "sqlite[S%d]: %s", + sqlite_result, sqlite3_errmsg(stmt->db->db3)); err2 = svn_sqlite__reset(stmt); return svn_error_compose_create(err1, err2); } @@ -744,7 +744,7 @@ init_sqlite(void *baton, apr_pool_t *pool) int err = sqlite3_config(SQLITE_CONFIG_MULTITHREAD); if (err != SQLITE_OK && err != SQLITE_MISUSE) return svn_error_createf(SQLITE_ERROR_CODE(err), NULL, - _("Could not configure SQLite (S%d)"), err); + _("Could not configure SQLite [S%d]"), err); } SQLITE_ERR_MSG(sqlite3_initialize(), _("Could not initialize SQLite")); diff --git a/contrib/subversion/subversion/libsvn_subr/stream.c b/contrib/subversion/subversion/libsvn_subr/stream.c index e2529c746765..93a4c423c9a9 100644 --- a/contrib/subversion/subversion/libsvn_subr/stream.c +++ b/contrib/subversion/subversion/libsvn_subr/stream.c @@ -56,6 +56,7 @@ struct svn_stream_t { svn_stream_mark_fn_t mark_fn; svn_stream_seek_fn_t seek_fn; svn_stream__is_buffered_fn_t is_buffered_fn; + apr_file_t *file; /* Maybe NULL */ }; @@ -81,6 +82,7 @@ svn_stream_create(void *baton, apr_pool_t *pool) stream->mark_fn = NULL; stream->seek_fn = NULL; stream->is_buffered_fn = NULL; + stream->file = NULL; return stream; } @@ -913,6 +915,7 @@ svn_stream_from_aprfile2(apr_file_t *file, svn_stream_set_mark(stream, mark_handler_apr); svn_stream_set_seek(stream, seek_handler_apr); svn_stream__set_is_buffered(stream, is_buffered_handler_apr); + stream->file = file; if (! disown) svn_stream_set_close(stream, close_handler_apr); @@ -920,6 +923,12 @@ svn_stream_from_aprfile2(apr_file_t *file, return stream; } +apr_file_t * +svn_stream__aprfile(svn_stream_t *stream) +{ + return stream->file; +} + /* Compressed stream support */ diff --git a/contrib/subversion/subversion/libsvn_subr/subst.c b/contrib/subversion/subversion/libsvn_subr/subst.c index f69dcf8f2bae..3545289baf81 100644 --- a/contrib/subversion/subversion/libsvn_subr/subst.c +++ b/contrib/subversion/subversion/libsvn_subr/subst.c @@ -1944,7 +1944,11 @@ svn_subst_translate_string2(svn_string_t **new_value, return SVN_NO_ERROR; } - if (encoding) + if (encoding && !strcmp(encoding, "UTF-8")) + { + val_utf8 = value->data; + } + else if (encoding) { SVN_ERR(svn_utf_cstring_to_utf8_ex2(&val_utf8, value->data, encoding, scratch_pool)); diff --git a/contrib/subversion/subversion/libsvn_subr/utf.c b/contrib/subversion/subversion/libsvn_subr/utf.c index 355e068f5e55..535e3daf9f5c 100644 --- a/contrib/subversion/subversion/libsvn_subr/utf.c +++ b/contrib/subversion/subversion/libsvn_subr/utf.c @@ -233,6 +233,8 @@ xlate_alloc_handle(xlate_handle_node_t **ret, else if (apr_err != APR_SUCCESS) { const char *errstr; + char apr_strerr[512]; + /* Can't use svn_error_wrap_apr here because it calls functions in this file, leading to infinite recursion. */ if (frompage == SVN_APR_LOCALE_CHARSET) @@ -248,7 +250,13 @@ xlate_alloc_handle(xlate_handle_node_t **ret, _("Can't create a character converter from " "'%s' to '%s'"), frompage, topage); - return svn_error_create(apr_err, NULL, errstr); + /* Just put the error on the stack, since svn_error_create duplicates it + later. APR_STRERR will be in the local encoding, not in UTF-8, though. + */ + svn_strerror(apr_err, apr_strerr, sizeof(apr_strerr)); + return svn_error_create(apr_err, + svn_error_create(apr_err, NULL, apr_strerr), + errstr); } /* Allocate and initialize the node. */ diff --git a/contrib/subversion/subversion/libsvn_wc/adm_ops.c b/contrib/subversion/subversion/libsvn_wc/adm_ops.c index 1f391fcc372f..e1e7fe4b9104 100644 --- a/contrib/subversion/subversion/libsvn_wc/adm_ops.c +++ b/contrib/subversion/subversion/libsvn_wc/adm_ops.c @@ -148,6 +148,7 @@ process_committed_leaf(svn_wc__db_t *db, db, local_abspath, FALSE /* keep_as_working */, FALSE /* queue_deletes */, + TRUE /* remove_locks */, (! via_recurse) ? new_revnum : SVN_INVALID_REVNUM, NULL, NULL, diff --git a/contrib/subversion/subversion/libsvn_wc/crop.c b/contrib/subversion/subversion/libsvn_wc/crop.c index 2278476d2355..a8d5ce2571ad 100644 --- a/contrib/subversion/subversion/libsvn_wc/crop.c +++ b/contrib/subversion/subversion/libsvn_wc/crop.c @@ -110,6 +110,7 @@ crop_children(svn_wc__db_t *db, SVN_ERR(svn_wc__db_base_remove(db, child_abspath, FALSE /* keep_as_working */, FALSE /* queue_deletes */, + FALSE /* remove_locks */, SVN_INVALID_REVNUM, NULL, NULL, iterpool)); diff --git a/contrib/subversion/subversion/libsvn_wc/externals.c b/contrib/subversion/subversion/libsvn_wc/externals.c index 514148fe3e3f..99127304ec4c 100644 --- a/contrib/subversion/subversion/libsvn_wc/externals.c +++ b/contrib/subversion/subversion/libsvn_wc/externals.c @@ -1413,6 +1413,7 @@ svn_wc__external_remove(svn_wc_context_t *wc_ctx, SVN_ERR(svn_wc__db_base_remove(wc_ctx->db, local_abspath, FALSE /* keep_as_working */, TRUE /* queue_deletes */, + FALSE /* remove_locks */, SVN_INVALID_REVNUM, NULL, NULL, scratch_pool)); SVN_ERR(svn_wc__wq_run(wc_ctx->db, local_abspath, diff --git a/contrib/subversion/subversion/libsvn_wc/update_editor.c b/contrib/subversion/subversion/libsvn_wc/update_editor.c index 617ad4775b90..a353b1b07178 100644 --- a/contrib/subversion/subversion/libsvn_wc/update_editor.c +++ b/contrib/subversion/subversion/libsvn_wc/update_editor.c @@ -924,6 +924,7 @@ mark_directory_edited(struct dir_baton *db, apr_pool_t *scratch_pool) do_notification(db->edit_baton, db->local_abspath, svn_node_dir, svn_wc_notify_tree_conflict, scratch_pool); db->already_notified = TRUE; + } return SVN_NO_ERROR; @@ -1813,6 +1814,7 @@ delete_entry(const char *path, SVN_ERR(svn_wc__db_base_remove(eb->db, local_abspath, FALSE /* keep_as_working */, FALSE /* queue_deletes */, + FALSE /* remove_locks */, SVN_INVALID_REVNUM /* not_present_rev */, NULL, NULL, scratch_pool)); @@ -1911,7 +1913,7 @@ delete_entry(const char *path, { /* Delete, and do not leave a not-present node. */ SVN_ERR(svn_wc__db_base_remove(eb->db, local_abspath, - keep_as_working, queue_deletes, + keep_as_working, queue_deletes, FALSE, SVN_INVALID_REVNUM /* not_present_rev */, tree_conflict, NULL, scratch_pool)); @@ -1920,7 +1922,7 @@ delete_entry(const char *path, { /* Delete, leaving a not-present node. */ SVN_ERR(svn_wc__db_base_remove(eb->db, local_abspath, - keep_as_working, queue_deletes, + keep_as_working, queue_deletes, FALSE, *eb->target_revision, tree_conflict, NULL, scratch_pool)); @@ -1939,8 +1941,19 @@ delete_entry(const char *path, /* Notify. */ if (tree_conflict) - do_notification(eb, local_abspath, svn_node_unknown, - svn_wc_notify_tree_conflict, scratch_pool); + { + if (eb->conflict_func) + SVN_ERR(svn_wc__conflict_invoke_resolver(eb->db, local_abspath, + tree_conflict, + NULL /* merge_options */, + eb->conflict_func, + eb->conflict_baton, + eb->cancel_func, + eb->cancel_baton, + scratch_pool)); + do_notification(eb, local_abspath, svn_node_unknown, + svn_wc_notify_tree_conflict, scratch_pool); + } else { svn_wc_notify_action_t action = svn_wc_notify_update_delete; @@ -2289,6 +2302,16 @@ add_directory(const char *path, if (tree_conflict != NULL) { + if (eb->conflict_func) + SVN_ERR(svn_wc__conflict_invoke_resolver(eb->db, db->local_abspath, + tree_conflict, + NULL /* merge_options */, + eb->conflict_func, + eb->conflict_baton, + eb->cancel_func, + eb->cancel_baton, + pool)); + db->already_notified = TRUE; do_notification(eb, db->local_abspath, svn_node_dir, svn_wc_notify_tree_conflict, pool); @@ -2907,7 +2930,7 @@ close_directory(void *dir_baton, eb->conflict_func, eb->conflict_baton, eb->cancel_func, - eb->conflict_baton, + eb->cancel_baton, scratch_pool)); /* Notify of any prop changes on this directory -- but do nothing if @@ -3380,6 +3403,16 @@ add_file(const char *path, tree_conflict, NULL, scratch_pool)); + if (eb->conflict_func) + SVN_ERR(svn_wc__conflict_invoke_resolver(eb->db, fb->local_abspath, + tree_conflict, + NULL /* merge_options */, + eb->conflict_func, + eb->conflict_baton, + eb->cancel_func, + eb->cancel_baton, + scratch_pool)); + fb->already_notified = TRUE; do_notification(eb, fb->local_abspath, svn_node_file, svn_wc_notify_tree_conflict, scratch_pool); @@ -4703,6 +4736,7 @@ close_edit(void *edit_baton, SVN_ERR(svn_wc__db_base_remove(eb->db, eb->target_abspath, FALSE /* keep_as_working */, FALSE /* queue_deletes */, + FALSE /* remove_locks */, SVN_INVALID_REVNUM, NULL, NULL, scratch_pool)); } diff --git a/contrib/subversion/subversion/libsvn_wc/upgrade.c b/contrib/subversion/subversion/libsvn_wc/upgrade.c index 983892cc35b0..ff5543c47b6b 100644 --- a/contrib/subversion/subversion/libsvn_wc/upgrade.c +++ b/contrib/subversion/subversion/libsvn_wc/upgrade.c @@ -2196,13 +2196,15 @@ svn_wc_upgrade(svn_wc_context_t *wc_ctx, upgrade_working_copy_baton_t cb_baton; svn_error_t *err; int result_format; + svn_boolean_t bumped_format; /* Try upgrading a wc-ng-style working copy. */ SVN_ERR(svn_wc__db_open(&db, NULL /* ### config */, TRUE, FALSE, scratch_pool, scratch_pool)); - err = svn_wc__db_bump_format(&result_format, local_abspath, db, + err = svn_wc__db_bump_format(&result_format, &bumped_format, + db, local_abspath, scratch_pool); if (err) { @@ -2224,6 +2226,17 @@ svn_wc_upgrade(svn_wc_context_t *wc_ctx, SVN_ERR_ASSERT(result_format == SVN_WC__VERSION); + if (bumped_format && notify_func) + { + svn_wc_notify_t *notify; + + notify = svn_wc_create_notify(local_abspath, + svn_wc_notify_upgraded_path, + scratch_pool); + + notify_func(notify_baton, notify, scratch_pool); + } + return SVN_NO_ERROR; } diff --git a/contrib/subversion/subversion/libsvn_wc/wc-checks.h b/contrib/subversion/subversion/libsvn_wc/wc-checks.h index 3c05e61a5e45..43ab4cc18ee1 100644 --- a/contrib/subversion/subversion/libsvn_wc/wc-checks.h +++ b/contrib/subversion/subversion/libsvn_wc/wc-checks.h @@ -1,4 +1,4 @@ -/* This file is automatically generated from wc-checks.sql and .dist_sandbox/subversion-1.8.0/subversion/libsvn_wc/token-map.h. +/* This file is automatically generated from wc-checks.sql and .dist_sandbox/subversion-1.8.1/subversion/libsvn_wc/token-map.h. * Do not edit this file -- edit the source and rerun gen-make.py */ #define STMT_VERIFICATION_TRIGGERS 0 diff --git a/contrib/subversion/subversion/libsvn_wc/wc-metadata.h b/contrib/subversion/subversion/libsvn_wc/wc-metadata.h index 7925f5eb4487..d0421788d8ad 100644 --- a/contrib/subversion/subversion/libsvn_wc/wc-metadata.h +++ b/contrib/subversion/subversion/libsvn_wc/wc-metadata.h @@ -1,4 +1,4 @@ -/* This file is automatically generated from wc-metadata.sql and .dist_sandbox/subversion-1.8.0/subversion/libsvn_wc/token-map.h. +/* This file is automatically generated from wc-metadata.sql and .dist_sandbox/subversion-1.8.1/subversion/libsvn_wc/token-map.h. * Do not edit this file -- edit the source and rerun gen-make.py */ #define STMT_CREATE_SCHEMA 0 diff --git a/contrib/subversion/subversion/libsvn_wc/wc-queries.h b/contrib/subversion/subversion/libsvn_wc/wc-queries.h index 2fd8f1ac9f11..950f6257f9a2 100644 --- a/contrib/subversion/subversion/libsvn_wc/wc-queries.h +++ b/contrib/subversion/subversion/libsvn_wc/wc-queries.h @@ -1,4 +1,4 @@ -/* This file is automatically generated from wc-queries.sql and .dist_sandbox/subversion-1.8.0/subversion/libsvn_wc/token-map.h. +/* This file is automatically generated from wc-queries.sql and .dist_sandbox/subversion-1.8.1/subversion/libsvn_wc/token-map.h. * Do not edit this file -- edit the source and rerun gen-make.py */ #define STMT_SELECT_NODE_INFO 0 @@ -589,57 +589,64 @@ "WHERE repos_id = ?1 AND repos_relpath = ?2 " \ "" -#define STMT_CLEAR_BASE_NODE_RECURSIVE_DAV_CACHE 56 -#define STMT_56_INFO {"STMT_CLEAR_BASE_NODE_RECURSIVE_DAV_CACHE", NULL} +#define STMT_DELETE_LOCK_RECURSIVELY 56 +#define STMT_56_INFO {"STMT_DELETE_LOCK_RECURSIVELY", NULL} #define STMT_56 \ + "DELETE FROM lock " \ + "WHERE repos_id = ?1 AND (repos_relpath = ?2 OR (((repos_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((repos_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END))) " \ + "" + +#define STMT_CLEAR_BASE_NODE_RECURSIVE_DAV_CACHE 57 +#define STMT_57_INFO {"STMT_CLEAR_BASE_NODE_RECURSIVE_DAV_CACHE", NULL} +#define STMT_57 \ "UPDATE nodes SET dav_cache = NULL " \ "WHERE dav_cache IS NOT NULL AND wc_id = ?1 AND op_depth = 0 " \ " AND (local_relpath = ?2 " \ " OR (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END))) " \ "" -#define STMT_RECURSIVE_UPDATE_NODE_REPO 57 -#define STMT_57_INFO {"STMT_RECURSIVE_UPDATE_NODE_REPO", NULL} -#define STMT_57 \ +#define STMT_RECURSIVE_UPDATE_NODE_REPO 58 +#define STMT_58_INFO {"STMT_RECURSIVE_UPDATE_NODE_REPO", NULL} +#define STMT_58 \ "UPDATE nodes SET repos_id = ?4, dav_cache = NULL " \ "WHERE (wc_id = ?1 AND local_relpath = ?2 AND repos_id = ?3) " \ " OR (wc_id = ?1 AND (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \ " AND repos_id = ?3) " \ "" -#define STMT_UPDATE_LOCK_REPOS_ID 58 -#define STMT_58_INFO {"STMT_UPDATE_LOCK_REPOS_ID", NULL} -#define STMT_58 \ +#define STMT_UPDATE_LOCK_REPOS_ID 59 +#define STMT_59_INFO {"STMT_UPDATE_LOCK_REPOS_ID", NULL} +#define STMT_59 \ "UPDATE lock SET repos_id = ?2 " \ "WHERE repos_id = ?1 " \ "" -#define STMT_UPDATE_NODE_FILEINFO 59 -#define STMT_59_INFO {"STMT_UPDATE_NODE_FILEINFO", NULL} -#define STMT_59 \ +#define STMT_UPDATE_NODE_FILEINFO 60 +#define STMT_60_INFO {"STMT_UPDATE_NODE_FILEINFO", NULL} +#define STMT_60 \ "UPDATE nodes SET translated_size = ?3, last_mod_time = ?4 " \ "WHERE wc_id = ?1 AND local_relpath = ?2 " \ " AND op_depth = (SELECT MAX(op_depth) FROM nodes " \ " WHERE wc_id = ?1 AND local_relpath = ?2) " \ "" -#define STMT_INSERT_ACTUAL_CONFLICT 60 -#define STMT_60_INFO {"STMT_INSERT_ACTUAL_CONFLICT", NULL} -#define STMT_60 \ +#define STMT_INSERT_ACTUAL_CONFLICT 61 +#define STMT_61_INFO {"STMT_INSERT_ACTUAL_CONFLICT", NULL} +#define STMT_61 \ "INSERT INTO actual_node (wc_id, local_relpath, conflict_data, parent_relpath) " \ "VALUES (?1, ?2, ?3, ?4) " \ "" -#define STMT_UPDATE_ACTUAL_CONFLICT 61 -#define STMT_61_INFO {"STMT_UPDATE_ACTUAL_CONFLICT", NULL} -#define STMT_61 \ +#define STMT_UPDATE_ACTUAL_CONFLICT 62 +#define STMT_62_INFO {"STMT_UPDATE_ACTUAL_CONFLICT", NULL} +#define STMT_62 \ "UPDATE actual_node SET conflict_data = ?3 " \ "WHERE wc_id = ?1 AND local_relpath = ?2 " \ "" -#define STMT_UPDATE_ACTUAL_CHANGELISTS 62 -#define STMT_62_INFO {"STMT_UPDATE_ACTUAL_CHANGELISTS", NULL} -#define STMT_62 \ +#define STMT_UPDATE_ACTUAL_CHANGELISTS 63 +#define STMT_63_INFO {"STMT_UPDATE_ACTUAL_CHANGELISTS", NULL} +#define STMT_63 \ "UPDATE actual_node SET changelist = ?3 " \ "WHERE wc_id = ?1 " \ " AND (local_relpath = ?2 OR (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END))) " \ @@ -649,16 +656,16 @@ " AND kind = 'file') " \ "" -#define STMT_UPDATE_ACTUAL_CLEAR_CHANGELIST 63 -#define STMT_63_INFO {"STMT_UPDATE_ACTUAL_CLEAR_CHANGELIST", NULL} -#define STMT_63 \ +#define STMT_UPDATE_ACTUAL_CLEAR_CHANGELIST 64 +#define STMT_64_INFO {"STMT_UPDATE_ACTUAL_CLEAR_CHANGELIST", NULL} +#define STMT_64 \ "UPDATE actual_node SET changelist = NULL " \ " WHERE wc_id = ?1 AND local_relpath = ?2 " \ "" -#define STMT_MARK_SKIPPED_CHANGELIST_DIRS 64 -#define STMT_64_INFO {"STMT_MARK_SKIPPED_CHANGELIST_DIRS", NULL} -#define STMT_64 \ +#define STMT_MARK_SKIPPED_CHANGELIST_DIRS 65 +#define STMT_65_INFO {"STMT_MARK_SKIPPED_CHANGELIST_DIRS", NULL} +#define STMT_65 \ "INSERT INTO changelist_list (wc_id, local_relpath, notify, changelist) " \ "SELECT wc_id, local_relpath, 7, ?3 " \ "FROM targets_list " \ @@ -667,17 +674,17 @@ " AND kind = 'dir' " \ "" -#define STMT_RESET_ACTUAL_WITH_CHANGELIST 65 -#define STMT_65_INFO {"STMT_RESET_ACTUAL_WITH_CHANGELIST", NULL} -#define STMT_65 \ +#define STMT_RESET_ACTUAL_WITH_CHANGELIST 66 +#define STMT_66_INFO {"STMT_RESET_ACTUAL_WITH_CHANGELIST", NULL} +#define STMT_66 \ "REPLACE INTO actual_node ( " \ " wc_id, local_relpath, parent_relpath, changelist) " \ "VALUES (?1, ?2, ?3, ?4) " \ "" -#define STMT_CREATE_CHANGELIST_LIST 66 -#define STMT_66_INFO {"STMT_CREATE_CHANGELIST_LIST", NULL} -#define STMT_66 \ +#define STMT_CREATE_CHANGELIST_LIST 67 +#define STMT_67_INFO {"STMT_CREATE_CHANGELIST_LIST", NULL} +#define STMT_67 \ "DROP TABLE IF EXISTS changelist_list; " \ "CREATE TEMPORARY TABLE changelist_list ( " \ " wc_id INTEGER NOT NULL, " \ @@ -688,9 +695,9 @@ ") " \ "" -#define STMT_CREATE_CHANGELIST_TRIGGER 67 -#define STMT_67_INFO {"STMT_CREATE_CHANGELIST_TRIGGER", NULL} -#define STMT_67 \ +#define STMT_CREATE_CHANGELIST_TRIGGER 68 +#define STMT_68_INFO {"STMT_CREATE_CHANGELIST_TRIGGER", NULL} +#define STMT_68 \ "DROP TRIGGER IF EXISTS trigger_changelist_list_change; " \ "CREATE TEMPORARY TRIGGER trigger_changelist_list_change " \ "BEFORE UPDATE ON actual_node " \ @@ -705,25 +712,25 @@ "END " \ "" -#define STMT_FINALIZE_CHANGELIST 68 -#define STMT_68_INFO {"STMT_FINALIZE_CHANGELIST", NULL} -#define STMT_68 \ +#define STMT_FINALIZE_CHANGELIST 69 +#define STMT_69_INFO {"STMT_FINALIZE_CHANGELIST", NULL} +#define STMT_69 \ "DROP TRIGGER trigger_changelist_list_change; " \ "DROP TABLE changelist_list; " \ "DROP TABLE targets_list " \ "" -#define STMT_SELECT_CHANGELIST_LIST 69 -#define STMT_69_INFO {"STMT_SELECT_CHANGELIST_LIST", NULL} -#define STMT_69 \ +#define STMT_SELECT_CHANGELIST_LIST 70 +#define STMT_70_INFO {"STMT_SELECT_CHANGELIST_LIST", NULL} +#define STMT_70 \ "SELECT wc_id, local_relpath, notify, changelist " \ "FROM changelist_list " \ "ORDER BY wc_id, local_relpath ASC, notify DESC " \ "" -#define STMT_CREATE_TARGETS_LIST 70 -#define STMT_70_INFO {"STMT_CREATE_TARGETS_LIST", NULL} -#define STMT_70 \ +#define STMT_CREATE_TARGETS_LIST 71 +#define STMT_71_INFO {"STMT_CREATE_TARGETS_LIST", NULL} +#define STMT_71 \ "DROP TABLE IF EXISTS targets_list; " \ "CREATE TEMPORARY TABLE targets_list ( " \ " wc_id INTEGER NOT NULL, " \ @@ -734,15 +741,15 @@ " ); " \ "" -#define STMT_DROP_TARGETS_LIST 71 -#define STMT_71_INFO {"STMT_DROP_TARGETS_LIST", NULL} -#define STMT_71 \ +#define STMT_DROP_TARGETS_LIST 72 +#define STMT_72_INFO {"STMT_DROP_TARGETS_LIST", NULL} +#define STMT_72 \ "DROP TABLE targets_list " \ "" -#define STMT_INSERT_TARGET 72 -#define STMT_72_INFO {"STMT_INSERT_TARGET", NULL} -#define STMT_72 \ +#define STMT_INSERT_TARGET 73 +#define STMT_73_INFO {"STMT_INSERT_TARGET", NULL} +#define STMT_73 \ "INSERT INTO targets_list(wc_id, local_relpath, parent_relpath, kind) " \ "SELECT wc_id, local_relpath, parent_relpath, kind " \ "FROM nodes_current " \ @@ -750,9 +757,9 @@ " AND local_relpath = ?2 " \ "" -#define STMT_INSERT_TARGET_DEPTH_FILES 73 -#define STMT_73_INFO {"STMT_INSERT_TARGET_DEPTH_FILES", NULL} -#define STMT_73 \ +#define STMT_INSERT_TARGET_DEPTH_FILES 74 +#define STMT_74_INFO {"STMT_INSERT_TARGET_DEPTH_FILES", NULL} +#define STMT_74 \ "INSERT INTO targets_list(wc_id, local_relpath, parent_relpath, kind) " \ "SELECT wc_id, local_relpath, parent_relpath, kind " \ "FROM nodes_current " \ @@ -761,9 +768,9 @@ " AND kind = 'file' " \ "" -#define STMT_INSERT_TARGET_DEPTH_IMMEDIATES 74 -#define STMT_74_INFO {"STMT_INSERT_TARGET_DEPTH_IMMEDIATES", NULL} -#define STMT_74 \ +#define STMT_INSERT_TARGET_DEPTH_IMMEDIATES 75 +#define STMT_75_INFO {"STMT_INSERT_TARGET_DEPTH_IMMEDIATES", NULL} +#define STMT_75 \ "INSERT INTO targets_list(wc_id, local_relpath, parent_relpath, kind) " \ "SELECT wc_id, local_relpath, parent_relpath, kind " \ "FROM nodes_current " \ @@ -771,9 +778,9 @@ " AND parent_relpath = ?2 " \ "" -#define STMT_INSERT_TARGET_DEPTH_INFINITY 75 -#define STMT_75_INFO {"STMT_INSERT_TARGET_DEPTH_INFINITY", NULL} -#define STMT_75 \ +#define STMT_INSERT_TARGET_DEPTH_INFINITY 76 +#define STMT_76_INFO {"STMT_INSERT_TARGET_DEPTH_INFINITY", NULL} +#define STMT_76 \ "INSERT INTO targets_list(wc_id, local_relpath, parent_relpath, kind) " \ "SELECT wc_id, local_relpath, parent_relpath, kind " \ "FROM nodes_current " \ @@ -781,9 +788,9 @@ " AND (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \ "" -#define STMT_INSERT_TARGET_WITH_CHANGELIST 76 -#define STMT_76_INFO {"STMT_INSERT_TARGET_WITH_CHANGELIST", NULL} -#define STMT_76 \ +#define STMT_INSERT_TARGET_WITH_CHANGELIST 77 +#define STMT_77_INFO {"STMT_INSERT_TARGET_WITH_CHANGELIST", NULL} +#define STMT_77 \ "INSERT INTO targets_list(wc_id, local_relpath, parent_relpath, kind) " \ "SELECT N.wc_id, N.local_relpath, N.parent_relpath, N.kind " \ " FROM actual_node AS A JOIN nodes_current AS N " \ @@ -793,9 +800,9 @@ " AND A.changelist = ?3 " \ "" -#define STMT_INSERT_TARGET_WITH_CHANGELIST_DEPTH_FILES 77 -#define STMT_77_INFO {"STMT_INSERT_TARGET_WITH_CHANGELIST_DEPTH_FILES", NULL} -#define STMT_77 \ +#define STMT_INSERT_TARGET_WITH_CHANGELIST_DEPTH_FILES 78 +#define STMT_78_INFO {"STMT_INSERT_TARGET_WITH_CHANGELIST_DEPTH_FILES", NULL} +#define STMT_78 \ "INSERT INTO targets_list(wc_id, local_relpath, parent_relpath, kind) " \ "SELECT N.wc_id, N.local_relpath, N.parent_relpath, N.kind " \ " FROM actual_node AS A JOIN nodes_current AS N " \ @@ -806,9 +813,9 @@ " AND A.changelist = ?3 " \ "" -#define STMT_INSERT_TARGET_WITH_CHANGELIST_DEPTH_IMMEDIATES 78 -#define STMT_78_INFO {"STMT_INSERT_TARGET_WITH_CHANGELIST_DEPTH_IMMEDIATES", NULL} -#define STMT_78 \ +#define STMT_INSERT_TARGET_WITH_CHANGELIST_DEPTH_IMMEDIATES 79 +#define STMT_79_INFO {"STMT_INSERT_TARGET_WITH_CHANGELIST_DEPTH_IMMEDIATES", NULL} +#define STMT_79 \ "INSERT INTO targets_list(wc_id, local_relpath, parent_relpath, kind) " \ "SELECT N.wc_id, N.local_relpath, N.parent_relpath, N.kind " \ " FROM actual_node AS A JOIN nodes_current AS N " \ @@ -818,9 +825,9 @@ " AND A.changelist = ?3 " \ "" -#define STMT_INSERT_TARGET_WITH_CHANGELIST_DEPTH_INFINITY 79 -#define STMT_79_INFO {"STMT_INSERT_TARGET_WITH_CHANGELIST_DEPTH_INFINITY", NULL} -#define STMT_79 \ +#define STMT_INSERT_TARGET_WITH_CHANGELIST_DEPTH_INFINITY 80 +#define STMT_80_INFO {"STMT_INSERT_TARGET_WITH_CHANGELIST_DEPTH_INFINITY", NULL} +#define STMT_80 \ "INSERT INTO targets_list(wc_id, local_relpath, parent_relpath, kind) " \ "SELECT N.wc_id, N.local_relpath, N.parent_relpath, N.kind " \ " FROM actual_node AS A JOIN nodes_current AS N " \ @@ -830,18 +837,18 @@ " AND A.changelist = ?3 " \ "" -#define STMT_INSERT_ACTUAL_EMPTIES 80 -#define STMT_80_INFO {"STMT_INSERT_ACTUAL_EMPTIES", NULL} -#define STMT_80 \ +#define STMT_INSERT_ACTUAL_EMPTIES 81 +#define STMT_81_INFO {"STMT_INSERT_ACTUAL_EMPTIES", NULL} +#define STMT_81 \ "INSERT OR IGNORE INTO actual_node ( " \ " wc_id, local_relpath, parent_relpath) " \ "SELECT wc_id, local_relpath, parent_relpath " \ "FROM targets_list " \ "" -#define STMT_DELETE_ACTUAL_EMPTY 81 -#define STMT_81_INFO {"STMT_DELETE_ACTUAL_EMPTY", NULL} -#define STMT_81 \ +#define STMT_DELETE_ACTUAL_EMPTY 82 +#define STMT_82_INFO {"STMT_DELETE_ACTUAL_EMPTY", NULL} +#define STMT_82 \ "DELETE FROM actual_node " \ "WHERE wc_id = ?1 AND local_relpath = ?2 " \ " AND properties IS NULL " \ @@ -853,9 +860,9 @@ " AND left_checksum IS NULL " \ "" -#define STMT_DELETE_ACTUAL_EMPTIES 82 -#define STMT_82_INFO {"STMT_DELETE_ACTUAL_EMPTIES", NULL} -#define STMT_82 \ +#define STMT_DELETE_ACTUAL_EMPTIES 83 +#define STMT_83_INFO {"STMT_DELETE_ACTUAL_EMPTIES", NULL} +#define STMT_83 \ "DELETE FROM actual_node " \ "WHERE wc_id = ?1 " \ " AND (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \ @@ -868,25 +875,25 @@ " AND left_checksum IS NULL " \ "" -#define STMT_DELETE_BASE_NODE 83 -#define STMT_83_INFO {"STMT_DELETE_BASE_NODE", NULL} -#define STMT_83 \ +#define STMT_DELETE_BASE_NODE 84 +#define STMT_84_INFO {"STMT_DELETE_BASE_NODE", NULL} +#define STMT_84 \ "DELETE FROM nodes " \ "WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0 " \ "" -#define STMT_DELETE_WORKING_NODE 84 -#define STMT_84_INFO {"STMT_DELETE_WORKING_NODE", NULL} -#define STMT_84 \ +#define STMT_DELETE_WORKING_NODE 85 +#define STMT_85_INFO {"STMT_DELETE_WORKING_NODE", NULL} +#define STMT_85 \ "DELETE FROM nodes " \ "WHERE wc_id = ?1 AND local_relpath = ?2 " \ " AND op_depth = (SELECT MAX(op_depth) FROM nodes " \ " WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth > 0) " \ "" -#define STMT_DELETE_LOWEST_WORKING_NODE 85 -#define STMT_85_INFO {"STMT_DELETE_LOWEST_WORKING_NODE", NULL} -#define STMT_85 \ +#define STMT_DELETE_LOWEST_WORKING_NODE 86 +#define STMT_86_INFO {"STMT_DELETE_LOWEST_WORKING_NODE", NULL} +#define STMT_86 \ "DELETE FROM nodes " \ "WHERE wc_id = ?1 AND local_relpath = ?2 " \ " AND op_depth = (SELECT MIN(op_depth) FROM nodes " \ @@ -894,16 +901,16 @@ " AND presence = 'base-deleted' " \ "" -#define STMT_DELETE_ALL_LAYERS 86 -#define STMT_86_INFO {"STMT_DELETE_ALL_LAYERS", NULL} -#define STMT_86 \ +#define STMT_DELETE_ALL_LAYERS 87 +#define STMT_87_INFO {"STMT_DELETE_ALL_LAYERS", NULL} +#define STMT_87 \ "DELETE FROM nodes " \ "WHERE wc_id = ?1 AND local_relpath = ?2 " \ "" -#define STMT_DELETE_NODES_ABOVE_DEPTH_RECURSIVE 87 -#define STMT_87_INFO {"STMT_DELETE_NODES_ABOVE_DEPTH_RECURSIVE", NULL} -#define STMT_87 \ +#define STMT_DELETE_NODES_ABOVE_DEPTH_RECURSIVE 88 +#define STMT_88_INFO {"STMT_DELETE_NODES_ABOVE_DEPTH_RECURSIVE", NULL} +#define STMT_88 \ "DELETE FROM nodes " \ "WHERE wc_id = ?1 " \ " AND (local_relpath = ?2 " \ @@ -911,25 +918,25 @@ " AND op_depth >= ?3 " \ "" -#define STMT_DELETE_ACTUAL_NODE 88 -#define STMT_88_INFO {"STMT_DELETE_ACTUAL_NODE", NULL} -#define STMT_88 \ +#define STMT_DELETE_ACTUAL_NODE 89 +#define STMT_89_INFO {"STMT_DELETE_ACTUAL_NODE", NULL} +#define STMT_89 \ "DELETE FROM actual_node " \ "WHERE wc_id = ?1 AND local_relpath = ?2 " \ "" -#define STMT_DELETE_ACTUAL_NODE_RECURSIVE 89 -#define STMT_89_INFO {"STMT_DELETE_ACTUAL_NODE_RECURSIVE", NULL} -#define STMT_89 \ +#define STMT_DELETE_ACTUAL_NODE_RECURSIVE 90 +#define STMT_90_INFO {"STMT_DELETE_ACTUAL_NODE_RECURSIVE", NULL} +#define STMT_90 \ "DELETE FROM actual_node " \ "WHERE wc_id = ?1 " \ " AND (local_relpath = ?2 " \ " OR (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END))) " \ "" -#define STMT_DELETE_ACTUAL_NODE_LEAVING_CHANGELIST 90 -#define STMT_90_INFO {"STMT_DELETE_ACTUAL_NODE_LEAVING_CHANGELIST", NULL} -#define STMT_90 \ +#define STMT_DELETE_ACTUAL_NODE_LEAVING_CHANGELIST 91 +#define STMT_91_INFO {"STMT_DELETE_ACTUAL_NODE_LEAVING_CHANGELIST", NULL} +#define STMT_91 \ "DELETE FROM actual_node " \ "WHERE wc_id = ?1 " \ " AND local_relpath = ?2 " \ @@ -939,9 +946,9 @@ " AND c.kind = 'file')) " \ "" -#define STMT_DELETE_ACTUAL_NODE_LEAVING_CHANGELIST_RECURSIVE 91 -#define STMT_91_INFO {"STMT_DELETE_ACTUAL_NODE_LEAVING_CHANGELIST_RECURSIVE", NULL} -#define STMT_91 \ +#define STMT_DELETE_ACTUAL_NODE_LEAVING_CHANGELIST_RECURSIVE 92 +#define STMT_92_INFO {"STMT_DELETE_ACTUAL_NODE_LEAVING_CHANGELIST_RECURSIVE", NULL} +#define STMT_92 \ "DELETE FROM actual_node " \ "WHERE wc_id = ?1 " \ " AND (local_relpath = ?2 " \ @@ -953,9 +960,9 @@ " AND c.kind = 'file')) " \ "" -#define STMT_CLEAR_ACTUAL_NODE_LEAVING_CHANGELIST 92 -#define STMT_92_INFO {"STMT_CLEAR_ACTUAL_NODE_LEAVING_CHANGELIST", NULL} -#define STMT_92 \ +#define STMT_CLEAR_ACTUAL_NODE_LEAVING_CHANGELIST 93 +#define STMT_93_INFO {"STMT_CLEAR_ACTUAL_NODE_LEAVING_CHANGELIST", NULL} +#define STMT_93 \ "UPDATE actual_node " \ "SET properties = NULL, " \ " text_mod = NULL, " \ @@ -967,9 +974,9 @@ "WHERE wc_id = ?1 AND local_relpath = ?2 " \ "" -#define STMT_CLEAR_ACTUAL_NODE_LEAVING_CHANGELIST_RECURSIVE 93 -#define STMT_93_INFO {"STMT_CLEAR_ACTUAL_NODE_LEAVING_CHANGELIST_RECURSIVE", NULL} -#define STMT_93 \ +#define STMT_CLEAR_ACTUAL_NODE_LEAVING_CHANGELIST_RECURSIVE 94 +#define STMT_94_INFO {"STMT_CLEAR_ACTUAL_NODE_LEAVING_CHANGELIST_RECURSIVE", NULL} +#define STMT_94 \ "UPDATE actual_node " \ "SET properties = NULL, " \ " text_mod = NULL, " \ @@ -983,108 +990,108 @@ " OR (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END))) " \ "" -#define STMT_UPDATE_NODE_BASE_DEPTH 94 -#define STMT_94_INFO {"STMT_UPDATE_NODE_BASE_DEPTH", NULL} -#define STMT_94 \ +#define STMT_UPDATE_NODE_BASE_DEPTH 95 +#define STMT_95_INFO {"STMT_UPDATE_NODE_BASE_DEPTH", NULL} +#define STMT_95 \ "UPDATE nodes SET depth = ?3 " \ "WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0 " \ " AND kind='dir' " \ "" -#define STMT_UPDATE_NODE_BASE_PRESENCE 95 -#define STMT_95_INFO {"STMT_UPDATE_NODE_BASE_PRESENCE", NULL} -#define STMT_95 \ +#define STMT_UPDATE_NODE_BASE_PRESENCE 96 +#define STMT_96_INFO {"STMT_UPDATE_NODE_BASE_PRESENCE", NULL} +#define STMT_96 \ "UPDATE nodes SET presence = ?3 " \ "WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0 " \ "" -#define STMT_UPDATE_BASE_NODE_PRESENCE_REVNUM_AND_REPOS_PATH 96 -#define STMT_96_INFO {"STMT_UPDATE_BASE_NODE_PRESENCE_REVNUM_AND_REPOS_PATH", NULL} -#define STMT_96 \ +#define STMT_UPDATE_BASE_NODE_PRESENCE_REVNUM_AND_REPOS_PATH 97 +#define STMT_97_INFO {"STMT_UPDATE_BASE_NODE_PRESENCE_REVNUM_AND_REPOS_PATH", NULL} +#define STMT_97 \ "UPDATE nodes SET presence = ?3, revision = ?4, repos_path = ?5 " \ "WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0 " \ "" -#define STMT_LOOK_FOR_WORK 97 -#define STMT_97_INFO {"STMT_LOOK_FOR_WORK", NULL} -#define STMT_97 \ +#define STMT_LOOK_FOR_WORK 98 +#define STMT_98_INFO {"STMT_LOOK_FOR_WORK", NULL} +#define STMT_98 \ "SELECT id FROM work_queue LIMIT 1 " \ "" -#define STMT_INSERT_WORK_ITEM 98 -#define STMT_98_INFO {"STMT_INSERT_WORK_ITEM", NULL} -#define STMT_98 \ +#define STMT_INSERT_WORK_ITEM 99 +#define STMT_99_INFO {"STMT_INSERT_WORK_ITEM", NULL} +#define STMT_99 \ "INSERT INTO work_queue (work) VALUES (?1) " \ "" -#define STMT_SELECT_WORK_ITEM 99 -#define STMT_99_INFO {"STMT_SELECT_WORK_ITEM", NULL} -#define STMT_99 \ +#define STMT_SELECT_WORK_ITEM 100 +#define STMT_100_INFO {"STMT_SELECT_WORK_ITEM", NULL} +#define STMT_100 \ "SELECT id, work FROM work_queue ORDER BY id LIMIT 1 " \ "" -#define STMT_DELETE_WORK_ITEM 100 -#define STMT_100_INFO {"STMT_DELETE_WORK_ITEM", NULL} -#define STMT_100 \ +#define STMT_DELETE_WORK_ITEM 101 +#define STMT_101_INFO {"STMT_DELETE_WORK_ITEM", NULL} +#define STMT_101 \ "DELETE FROM work_queue WHERE id = ?1 " \ "" -#define STMT_INSERT_OR_IGNORE_PRISTINE 101 -#define STMT_101_INFO {"STMT_INSERT_OR_IGNORE_PRISTINE", NULL} -#define STMT_101 \ +#define STMT_INSERT_OR_IGNORE_PRISTINE 102 +#define STMT_102_INFO {"STMT_INSERT_OR_IGNORE_PRISTINE", NULL} +#define STMT_102 \ "INSERT OR IGNORE INTO pristine (checksum, md5_checksum, size, refcount) " \ "VALUES (?1, ?2, ?3, 0) " \ "" -#define STMT_INSERT_PRISTINE 102 -#define STMT_102_INFO {"STMT_INSERT_PRISTINE", NULL} -#define STMT_102 \ +#define STMT_INSERT_PRISTINE 103 +#define STMT_103_INFO {"STMT_INSERT_PRISTINE", NULL} +#define STMT_103 \ "INSERT INTO pristine (checksum, md5_checksum, size, refcount) " \ "VALUES (?1, ?2, ?3, 0) " \ "" -#define STMT_SELECT_PRISTINE 103 -#define STMT_103_INFO {"STMT_SELECT_PRISTINE", NULL} -#define STMT_103 \ +#define STMT_SELECT_PRISTINE 104 +#define STMT_104_INFO {"STMT_SELECT_PRISTINE", NULL} +#define STMT_104 \ "SELECT md5_checksum " \ "FROM pristine " \ "WHERE checksum = ?1 " \ "" -#define STMT_SELECT_PRISTINE_SIZE 104 -#define STMT_104_INFO {"STMT_SELECT_PRISTINE_SIZE", NULL} -#define STMT_104 \ +#define STMT_SELECT_PRISTINE_SIZE 105 +#define STMT_105_INFO {"STMT_SELECT_PRISTINE_SIZE", NULL} +#define STMT_105 \ "SELECT size " \ "FROM pristine " \ "WHERE checksum = ?1 LIMIT 1 " \ "" -#define STMT_SELECT_PRISTINE_BY_MD5 105 -#define STMT_105_INFO {"STMT_SELECT_PRISTINE_BY_MD5", NULL} -#define STMT_105 \ +#define STMT_SELECT_PRISTINE_BY_MD5 106 +#define STMT_106_INFO {"STMT_SELECT_PRISTINE_BY_MD5", NULL} +#define STMT_106 \ "SELECT checksum " \ "FROM pristine " \ "WHERE md5_checksum = ?1 " \ "" -#define STMT_SELECT_UNREFERENCED_PRISTINES 106 -#define STMT_106_INFO {"STMT_SELECT_UNREFERENCED_PRISTINES", NULL} -#define STMT_106 \ +#define STMT_SELECT_UNREFERENCED_PRISTINES 107 +#define STMT_107_INFO {"STMT_SELECT_UNREFERENCED_PRISTINES", NULL} +#define STMT_107 \ "SELECT checksum " \ "FROM pristine " \ "WHERE refcount = 0 " \ "" -#define STMT_DELETE_PRISTINE_IF_UNREFERENCED 107 -#define STMT_107_INFO {"STMT_DELETE_PRISTINE_IF_UNREFERENCED", NULL} -#define STMT_107 \ +#define STMT_DELETE_PRISTINE_IF_UNREFERENCED 108 +#define STMT_108_INFO {"STMT_DELETE_PRISTINE_IF_UNREFERENCED", NULL} +#define STMT_108 \ "DELETE FROM pristine " \ "WHERE checksum = ?1 AND refcount = 0 " \ "" -#define STMT_SELECT_COPY_PRISTINES 108 -#define STMT_108_INFO {"STMT_SELECT_COPY_PRISTINES", NULL} -#define STMT_108 \ +#define STMT_SELECT_COPY_PRISTINES 109 +#define STMT_109_INFO {"STMT_SELECT_COPY_PRISTINES", NULL} +#define STMT_109 \ "SELECT n.checksum, md5_checksum, size " \ "FROM nodes_current n " \ "LEFT JOIN pristine p ON n.checksum = p.checksum " \ @@ -1102,62 +1109,62 @@ " AND n.checksum IS NOT NULL " \ "" -#define STMT_VACUUM 109 -#define STMT_109_INFO {"STMT_VACUUM", NULL} -#define STMT_109 \ +#define STMT_VACUUM 110 +#define STMT_110_INFO {"STMT_VACUUM", NULL} +#define STMT_110 \ "VACUUM " \ "" -#define STMT_SELECT_CONFLICT_VICTIMS 110 -#define STMT_110_INFO {"STMT_SELECT_CONFLICT_VICTIMS", NULL} -#define STMT_110 \ +#define STMT_SELECT_CONFLICT_VICTIMS 111 +#define STMT_111_INFO {"STMT_SELECT_CONFLICT_VICTIMS", NULL} +#define STMT_111 \ "SELECT local_relpath, conflict_data " \ "FROM actual_node " \ "WHERE wc_id = ?1 AND parent_relpath = ?2 AND " \ " NOT (conflict_data IS NULL) " \ "" -#define STMT_INSERT_WC_LOCK 111 -#define STMT_111_INFO {"STMT_INSERT_WC_LOCK", NULL} -#define STMT_111 \ +#define STMT_INSERT_WC_LOCK 112 +#define STMT_112_INFO {"STMT_INSERT_WC_LOCK", NULL} +#define STMT_112 \ "INSERT INTO wc_lock (wc_id, local_dir_relpath, locked_levels) " \ "VALUES (?1, ?2, ?3) " \ "" -#define STMT_SELECT_WC_LOCK 112 -#define STMT_112_INFO {"STMT_SELECT_WC_LOCK", NULL} -#define STMT_112 \ +#define STMT_SELECT_WC_LOCK 113 +#define STMT_113_INFO {"STMT_SELECT_WC_LOCK", NULL} +#define STMT_113 \ "SELECT locked_levels FROM wc_lock " \ "WHERE wc_id = ?1 AND local_dir_relpath = ?2 " \ "" -#define STMT_SELECT_ANCESTOR_WCLOCKS 113 -#define STMT_113_INFO {"STMT_SELECT_ANCESTOR_WCLOCKS", NULL} -#define STMT_113 \ +#define STMT_SELECT_ANCESTOR_WCLOCKS 114 +#define STMT_114_INFO {"STMT_SELECT_ANCESTOR_WCLOCKS", NULL} +#define STMT_114 \ "SELECT local_dir_relpath, locked_levels FROM wc_lock " \ "WHERE wc_id = ?1 " \ " AND ((local_dir_relpath >= ?3 AND local_dir_relpath <= ?2) " \ " OR local_dir_relpath = '') " \ "" -#define STMT_DELETE_WC_LOCK 114 -#define STMT_114_INFO {"STMT_DELETE_WC_LOCK", NULL} -#define STMT_114 \ +#define STMT_DELETE_WC_LOCK 115 +#define STMT_115_INFO {"STMT_DELETE_WC_LOCK", NULL} +#define STMT_115 \ "DELETE FROM wc_lock " \ "WHERE wc_id = ?1 AND local_dir_relpath = ?2 " \ "" -#define STMT_FIND_WC_LOCK 115 -#define STMT_115_INFO {"STMT_FIND_WC_LOCK", NULL} -#define STMT_115 \ +#define STMT_FIND_WC_LOCK 116 +#define STMT_116_INFO {"STMT_FIND_WC_LOCK", NULL} +#define STMT_116 \ "SELECT local_dir_relpath FROM wc_lock " \ "WHERE wc_id = ?1 " \ " AND (((local_dir_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_dir_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \ "" -#define STMT_DELETE_WC_LOCK_ORPHAN 116 -#define STMT_116_INFO {"STMT_DELETE_WC_LOCK_ORPHAN", NULL} -#define STMT_116 \ +#define STMT_DELETE_WC_LOCK_ORPHAN 117 +#define STMT_117_INFO {"STMT_DELETE_WC_LOCK_ORPHAN", NULL} +#define STMT_117 \ "DELETE FROM wc_lock " \ "WHERE wc_id = ?1 AND local_dir_relpath = ?2 " \ "AND NOT EXISTS (SELECT 1 FROM nodes " \ @@ -1165,9 +1172,9 @@ " AND nodes.local_relpath = wc_lock.local_dir_relpath) " \ "" -#define STMT_DELETE_WC_LOCK_ORPHAN_RECURSIVE 117 -#define STMT_117_INFO {"STMT_DELETE_WC_LOCK_ORPHAN_RECURSIVE", NULL} -#define STMT_117 \ +#define STMT_DELETE_WC_LOCK_ORPHAN_RECURSIVE 118 +#define STMT_118_INFO {"STMT_DELETE_WC_LOCK_ORPHAN_RECURSIVE", NULL} +#define STMT_118 \ "DELETE FROM wc_lock " \ "WHERE wc_id = ?1 " \ " AND (local_dir_relpath = ?2 " \ @@ -1177,9 +1184,9 @@ " AND nodes.local_relpath = wc_lock.local_dir_relpath) " \ "" -#define STMT_APPLY_CHANGES_TO_BASE_NODE 118 -#define STMT_118_INFO {"STMT_APPLY_CHANGES_TO_BASE_NODE", NULL} -#define STMT_118 \ +#define STMT_APPLY_CHANGES_TO_BASE_NODE 119 +#define STMT_119_INFO {"STMT_APPLY_CHANGES_TO_BASE_NODE", NULL} +#define STMT_119 \ "INSERT OR REPLACE INTO nodes ( " \ " wc_id, local_relpath, op_depth, parent_relpath, repos_id, repos_path, " \ " revision, presence, depth, kind, changed_revision, changed_date, " \ @@ -1193,18 +1200,18 @@ " AND op_depth = 0)) " \ "" -#define STMT_INSTALL_WORKING_NODE_FOR_DELETE 119 -#define STMT_119_INFO {"STMT_INSTALL_WORKING_NODE_FOR_DELETE", NULL} -#define STMT_119 \ +#define STMT_INSTALL_WORKING_NODE_FOR_DELETE 120 +#define STMT_120_INFO {"STMT_INSTALL_WORKING_NODE_FOR_DELETE", NULL} +#define STMT_120 \ "INSERT OR REPLACE INTO nodes ( " \ " wc_id, local_relpath, op_depth, " \ " parent_relpath, presence, kind) " \ "VALUES(?1, ?2, ?3, ?4, 'base-deleted', ?5) " \ "" -#define STMT_DELETE_NO_LOWER_LAYER 120 -#define STMT_120_INFO {"STMT_DELETE_NO_LOWER_LAYER", NULL} -#define STMT_120 \ +#define STMT_DELETE_NO_LOWER_LAYER 121 +#define STMT_121_INFO {"STMT_DELETE_NO_LOWER_LAYER", NULL} +#define STMT_121 \ "DELETE FROM nodes " \ " WHERE wc_id = ?1 " \ " AND (local_relpath = ?2 OR (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END))) " \ @@ -1216,9 +1223,9 @@ " AND n.presence IN ('normal', 'incomplete')) " \ "" -#define STMT_REPLACE_WITH_BASE_DELETED 121 -#define STMT_121_INFO {"STMT_REPLACE_WITH_BASE_DELETED", NULL} -#define STMT_121 \ +#define STMT_REPLACE_WITH_BASE_DELETED 122 +#define STMT_122_INFO {"STMT_REPLACE_WITH_BASE_DELETED", NULL} +#define STMT_122 \ "INSERT OR REPLACE INTO nodes (wc_id, local_relpath, op_depth, parent_relpath, " \ " kind, moved_to, presence) " \ "SELECT wc_id, local_relpath, op_depth, parent_relpath, " \ @@ -1229,9 +1236,9 @@ " AND op_depth = ?3 " \ "" -#define STMT_INSERT_DELETE_FROM_NODE_RECURSIVE 122 -#define STMT_122_INFO {"STMT_INSERT_DELETE_FROM_NODE_RECURSIVE", NULL} -#define STMT_122 \ +#define STMT_INSERT_DELETE_FROM_NODE_RECURSIVE 123 +#define STMT_123_INFO {"STMT_INSERT_DELETE_FROM_NODE_RECURSIVE", NULL} +#define STMT_123 \ "INSERT INTO nodes ( " \ " wc_id, local_relpath, op_depth, parent_relpath, presence, kind) " \ "SELECT wc_id, local_relpath, ?4 , parent_relpath, 'base-deleted', " \ @@ -1245,9 +1252,9 @@ " AND file_external IS NULL " \ "" -#define STMT_INSERT_WORKING_NODE_FROM_BASE_COPY 123 -#define STMT_123_INFO {"STMT_INSERT_WORKING_NODE_FROM_BASE_COPY", NULL} -#define STMT_123 \ +#define STMT_INSERT_WORKING_NODE_FROM_BASE_COPY 124 +#define STMT_124_INFO {"STMT_INSERT_WORKING_NODE_FROM_BASE_COPY", NULL} +#define STMT_124 \ "INSERT INTO nodes ( " \ " wc_id, local_relpath, op_depth, parent_relpath, repos_id, repos_path, " \ " revision, presence, depth, kind, changed_revision, changed_date, " \ @@ -1261,9 +1268,9 @@ "WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0 " \ "" -#define STMT_INSERT_DELETE_FROM_BASE 124 -#define STMT_124_INFO {"STMT_INSERT_DELETE_FROM_BASE", NULL} -#define STMT_124 \ +#define STMT_INSERT_DELETE_FROM_BASE 125 +#define STMT_125_INFO {"STMT_INSERT_DELETE_FROM_BASE", NULL} +#define STMT_125 \ "INSERT INTO nodes ( " \ " wc_id, local_relpath, op_depth, parent_relpath, presence, kind) " \ "SELECT wc_id, local_relpath, ?3 , parent_relpath, " \ @@ -1272,34 +1279,34 @@ "WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0 " \ "" -#define STMT_UPDATE_OP_DEPTH_INCREASE_RECURSIVE 125 -#define STMT_125_INFO {"STMT_UPDATE_OP_DEPTH_INCREASE_RECURSIVE", NULL} -#define STMT_125 \ +#define STMT_UPDATE_OP_DEPTH_INCREASE_RECURSIVE 126 +#define STMT_126_INFO {"STMT_UPDATE_OP_DEPTH_INCREASE_RECURSIVE", NULL} +#define STMT_126 \ "UPDATE nodes SET op_depth = ?3 + 1 " \ "WHERE wc_id = ?1 " \ " AND (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \ " AND op_depth = ?3 " \ "" -#define STMT_UPDATE_OP_DEPTH_RECURSIVE 126 -#define STMT_126_INFO {"STMT_UPDATE_OP_DEPTH_RECURSIVE", NULL} -#define STMT_126 \ +#define STMT_UPDATE_OP_DEPTH_RECURSIVE 127 +#define STMT_127_INFO {"STMT_UPDATE_OP_DEPTH_RECURSIVE", NULL} +#define STMT_127 \ "UPDATE nodes SET op_depth = ?4, moved_here = NULL " \ "WHERE wc_id = ?1 " \ " AND (local_relpath = ?2 OR (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END))) " \ " AND op_depth = ?3 " \ "" -#define STMT_DOES_NODE_EXIST 127 -#define STMT_127_INFO {"STMT_DOES_NODE_EXIST", NULL} -#define STMT_127 \ +#define STMT_DOES_NODE_EXIST 128 +#define STMT_128_INFO {"STMT_DOES_NODE_EXIST", NULL} +#define STMT_128 \ "SELECT 1 FROM nodes WHERE wc_id = ?1 AND local_relpath = ?2 " \ "LIMIT 1 " \ "" -#define STMT_HAS_SERVER_EXCLUDED_DESCENDANTS 128 -#define STMT_128_INFO {"STMT_HAS_SERVER_EXCLUDED_DESCENDANTS", NULL} -#define STMT_128 \ +#define STMT_HAS_SERVER_EXCLUDED_DESCENDANTS 129 +#define STMT_129_INFO {"STMT_HAS_SERVER_EXCLUDED_DESCENDANTS", NULL} +#define STMT_129 \ "SELECT local_relpath FROM nodes " \ "WHERE wc_id = ?1 " \ " AND (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \ @@ -1307,9 +1314,9 @@ "LIMIT 1 " \ "" -#define STMT_SELECT_ALL_EXCLUDED_DESCENDANTS 129 -#define STMT_129_INFO {"STMT_SELECT_ALL_EXCLUDED_DESCENDANTS", NULL} -#define STMT_129 \ +#define STMT_SELECT_ALL_EXCLUDED_DESCENDANTS 130 +#define STMT_130_INFO {"STMT_SELECT_ALL_EXCLUDED_DESCENDANTS", NULL} +#define STMT_130 \ "SELECT local_relpath FROM nodes " \ "WHERE wc_id = ?1 " \ " AND (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \ @@ -1317,9 +1324,9 @@ " AND (presence = 'server-excluded' OR presence = 'excluded') " \ "" -#define STMT_INSERT_WORKING_NODE_COPY_FROM 130 -#define STMT_130_INFO {"STMT_INSERT_WORKING_NODE_COPY_FROM", NULL} -#define STMT_130 \ +#define STMT_INSERT_WORKING_NODE_COPY_FROM 131 +#define STMT_131_INFO {"STMT_INSERT_WORKING_NODE_COPY_FROM", NULL} +#define STMT_131 \ "INSERT OR REPLACE INTO nodes ( " \ " wc_id, local_relpath, op_depth, parent_relpath, repos_id, " \ " repos_path, revision, presence, depth, moved_here, kind, changed_revision, " \ @@ -1338,9 +1345,9 @@ "WHERE wc_id = ?1 AND local_relpath = ?2 " \ "" -#define STMT_INSERT_WORKING_NODE_COPY_FROM_DEPTH 131 -#define STMT_131_INFO {"STMT_INSERT_WORKING_NODE_COPY_FROM_DEPTH", NULL} -#define STMT_131 \ +#define STMT_INSERT_WORKING_NODE_COPY_FROM_DEPTH 132 +#define STMT_132_INFO {"STMT_INSERT_WORKING_NODE_COPY_FROM_DEPTH", NULL} +#define STMT_132 \ "INSERT OR REPLACE INTO nodes ( " \ " wc_id, local_relpath, op_depth, parent_relpath, repos_id, " \ " repos_path, revision, presence, depth, moved_here, kind, changed_revision, " \ @@ -1359,49 +1366,49 @@ "WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = ?7 " \ "" -#define STMT_UPDATE_BASE_REVISION 132 -#define STMT_132_INFO {"STMT_UPDATE_BASE_REVISION", NULL} -#define STMT_132 \ +#define STMT_UPDATE_BASE_REVISION 133 +#define STMT_133_INFO {"STMT_UPDATE_BASE_REVISION", NULL} +#define STMT_133 \ "UPDATE nodes SET revision = ?3 " \ "WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0 " \ "" -#define STMT_UPDATE_BASE_REPOS 133 -#define STMT_133_INFO {"STMT_UPDATE_BASE_REPOS", NULL} -#define STMT_133 \ +#define STMT_UPDATE_BASE_REPOS 134 +#define STMT_134_INFO {"STMT_UPDATE_BASE_REPOS", NULL} +#define STMT_134 \ "UPDATE nodes SET repos_id = ?3, repos_path = ?4 " \ "WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0 " \ "" -#define STMT_ACTUAL_HAS_CHILDREN 134 -#define STMT_134_INFO {"STMT_ACTUAL_HAS_CHILDREN", NULL} -#define STMT_134 \ +#define STMT_ACTUAL_HAS_CHILDREN 135 +#define STMT_135_INFO {"STMT_ACTUAL_HAS_CHILDREN", NULL} +#define STMT_135 \ "SELECT 1 FROM actual_node " \ "WHERE wc_id = ?1 AND parent_relpath = ?2 " \ "LIMIT 1 " \ "" -#define STMT_INSERT_EXTERNAL 135 -#define STMT_135_INFO {"STMT_INSERT_EXTERNAL", NULL} -#define STMT_135 \ +#define STMT_INSERT_EXTERNAL 136 +#define STMT_136_INFO {"STMT_INSERT_EXTERNAL", NULL} +#define STMT_136 \ "INSERT OR REPLACE INTO externals ( " \ " wc_id, local_relpath, parent_relpath, presence, kind, def_local_relpath, " \ " repos_id, def_repos_relpath, def_operational_revision, def_revision) " \ "VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10) " \ "" -#define STMT_SELECT_EXTERNAL_INFO 136 -#define STMT_136_INFO {"STMT_SELECT_EXTERNAL_INFO", NULL} -#define STMT_136 \ +#define STMT_SELECT_EXTERNAL_INFO 137 +#define STMT_137_INFO {"STMT_SELECT_EXTERNAL_INFO", NULL} +#define STMT_137 \ "SELECT presence, kind, def_local_relpath, repos_id, " \ " def_repos_relpath, def_operational_revision, def_revision " \ "FROM externals WHERE wc_id = ?1 AND local_relpath = ?2 " \ "LIMIT 1 " \ "" -#define STMT_DELETE_FILE_EXTERNALS 137 -#define STMT_137_INFO {"STMT_DELETE_FILE_EXTERNALS", NULL} -#define STMT_137 \ +#define STMT_DELETE_FILE_EXTERNALS 138 +#define STMT_138_INFO {"STMT_DELETE_FILE_EXTERNALS", NULL} +#define STMT_138 \ "DELETE FROM nodes " \ "WHERE wc_id = ?1 " \ " AND (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \ @@ -1409,26 +1416,26 @@ " AND file_external IS NOT NULL " \ "" -#define STMT_DELETE_FILE_EXTERNAL_REGISTATIONS 138 -#define STMT_138_INFO {"STMT_DELETE_FILE_EXTERNAL_REGISTATIONS", NULL} -#define STMT_138 \ +#define STMT_DELETE_FILE_EXTERNAL_REGISTATIONS 139 +#define STMT_139_INFO {"STMT_DELETE_FILE_EXTERNAL_REGISTATIONS", NULL} +#define STMT_139 \ "DELETE FROM externals " \ "WHERE wc_id = ?1 " \ " AND (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \ " AND kind != 'dir' " \ "" -#define STMT_DELETE_EXTERNAL_REGISTATIONS 139 -#define STMT_139_INFO {"STMT_DELETE_EXTERNAL_REGISTATIONS", NULL} -#define STMT_139 \ +#define STMT_DELETE_EXTERNAL_REGISTATIONS 140 +#define STMT_140_INFO {"STMT_DELETE_EXTERNAL_REGISTATIONS", NULL} +#define STMT_140 \ "DELETE FROM externals " \ "WHERE wc_id = ?1 " \ " AND (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \ "" -#define STMT_SELECT_COMMITTABLE_EXTERNALS_BELOW 140 -#define STMT_140_INFO {"STMT_SELECT_COMMITTABLE_EXTERNALS_BELOW", NULL} -#define STMT_140 \ +#define STMT_SELECT_COMMITTABLE_EXTERNALS_BELOW 141 +#define STMT_141_INFO {"STMT_SELECT_COMMITTABLE_EXTERNALS_BELOW", NULL} +#define STMT_141 \ "SELECT local_relpath, kind, def_repos_relpath, " \ " (SELECT root FROM repository AS r WHERE r.id = e.repos_id) " \ "FROM externals e " \ @@ -1446,9 +1453,9 @@ " AND nodes.local_relpath = e.parent_relpath)) " \ "" -#define STMT_SELECT_COMMITTABLE_EXTERNALS_IMMEDIATELY_BELOW 141 -#define STMT_141_INFO {"STMT_SELECT_COMMITTABLE_EXTERNALS_IMMEDIATELY_BELOW", NULL} -#define STMT_141 \ +#define STMT_SELECT_COMMITTABLE_EXTERNALS_IMMEDIATELY_BELOW 142 +#define STMT_142_INFO {"STMT_SELECT_COMMITTABLE_EXTERNALS_IMMEDIATELY_BELOW", NULL} +#define STMT_142 \ "SELECT local_relpath, kind, def_repos_relpath, " \ " (SELECT root FROM repository AS r WHERE r.id = e.repos_id) " \ "FROM externals e " \ @@ -1467,25 +1474,25 @@ " AND nodes.local_relpath = e.parent_relpath)) " \ "" -#define STMT_SELECT_EXTERNALS_DEFINED 142 -#define STMT_142_INFO {"STMT_SELECT_EXTERNALS_DEFINED", NULL} -#define STMT_142 \ +#define STMT_SELECT_EXTERNALS_DEFINED 143 +#define STMT_143_INFO {"STMT_SELECT_EXTERNALS_DEFINED", NULL} +#define STMT_143 \ "SELECT local_relpath, def_local_relpath " \ "FROM externals " \ "WHERE (wc_id = ?1 AND def_local_relpath = ?2) " \ " OR (wc_id = ?1 AND (((def_local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((def_local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END))) " \ "" -#define STMT_DELETE_EXTERNAL 143 -#define STMT_143_INFO {"STMT_DELETE_EXTERNAL", NULL} -#define STMT_143 \ +#define STMT_DELETE_EXTERNAL 144 +#define STMT_144_INFO {"STMT_DELETE_EXTERNAL", NULL} +#define STMT_144 \ "DELETE FROM externals " \ "WHERE wc_id = ?1 AND local_relpath = ?2 " \ "" -#define STMT_SELECT_EXTERNAL_PROPERTIES 144 -#define STMT_144_INFO {"STMT_SELECT_EXTERNAL_PROPERTIES", NULL} -#define STMT_144 \ +#define STMT_SELECT_EXTERNAL_PROPERTIES 145 +#define STMT_145_INFO {"STMT_SELECT_EXTERNAL_PROPERTIES", NULL} +#define STMT_145 \ "SELECT IFNULL((SELECT properties FROM actual_node a " \ " WHERE a.wc_id = ?1 AND A.local_relpath = n.local_relpath), " \ " properties), " \ @@ -1503,9 +1510,9 @@ " AND kind = 'dir' AND presence IN ('normal', 'incomplete') " \ "" -#define STMT_SELECT_CURRENT_PROPS_RECURSIVE 145 -#define STMT_145_INFO {"STMT_SELECT_CURRENT_PROPS_RECURSIVE", NULL} -#define STMT_145 \ +#define STMT_SELECT_CURRENT_PROPS_RECURSIVE 146 +#define STMT_146_INFO {"STMT_SELECT_CURRENT_PROPS_RECURSIVE", NULL} +#define STMT_146 \ "SELECT IFNULL((SELECT properties FROM actual_node a " \ " WHERE a.wc_id = ?1 AND A.local_relpath = n.local_relpath), " \ " properties), " \ @@ -1515,57 +1522,57 @@ " OR (wc_id = ?1 AND (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END))) " \ "" -#define STMT_PRAGMA_LOCKING_MODE 146 -#define STMT_146_INFO {"STMT_PRAGMA_LOCKING_MODE", NULL} -#define STMT_146 \ +#define STMT_PRAGMA_LOCKING_MODE 147 +#define STMT_147_INFO {"STMT_PRAGMA_LOCKING_MODE", NULL} +#define STMT_147 \ "PRAGMA locking_mode = exclusive " \ "" -#define STMT_INSERT_ACTUAL_NODE 147 -#define STMT_147_INFO {"STMT_INSERT_ACTUAL_NODE", NULL} -#define STMT_147 \ +#define STMT_INSERT_ACTUAL_NODE 148 +#define STMT_148_INFO {"STMT_INSERT_ACTUAL_NODE", NULL} +#define STMT_148 \ "INSERT OR REPLACE INTO actual_node ( " \ " wc_id, local_relpath, parent_relpath, properties, changelist, conflict_data) " \ "VALUES (?1, ?2, ?3, ?4, ?5, ?6) " \ "" -#define STMT_UPDATE_ACTUAL_CONFLICT_DATA 148 -#define STMT_148_INFO {"STMT_UPDATE_ACTUAL_CONFLICT_DATA", NULL} -#define STMT_148 \ +#define STMT_UPDATE_ACTUAL_CONFLICT_DATA 149 +#define STMT_149_INFO {"STMT_UPDATE_ACTUAL_CONFLICT_DATA", NULL} +#define STMT_149 \ "UPDATE actual_node SET conflict_data = ?3 " \ "WHERE wc_id = ?1 AND local_relpath = ?2 " \ "" -#define STMT_INSERT_ACTUAL_CONFLICT_DATA 149 -#define STMT_149_INFO {"STMT_INSERT_ACTUAL_CONFLICT_DATA", NULL} -#define STMT_149 \ +#define STMT_INSERT_ACTUAL_CONFLICT_DATA 150 +#define STMT_150_INFO {"STMT_INSERT_ACTUAL_CONFLICT_DATA", NULL} +#define STMT_150 \ "INSERT INTO actual_node (wc_id, local_relpath, conflict_data, parent_relpath) " \ "VALUES (?1, ?2, ?3, ?4) " \ "" -#define STMT_SELECT_ALL_FILES 150 -#define STMT_150_INFO {"STMT_SELECT_ALL_FILES", NULL} -#define STMT_150 \ +#define STMT_SELECT_ALL_FILES 151 +#define STMT_151_INFO {"STMT_SELECT_ALL_FILES", NULL} +#define STMT_151 \ "SELECT local_relpath FROM nodes_current " \ "WHERE wc_id = ?1 AND parent_relpath = ?2 AND kind = 'file' " \ "" -#define STMT_UPDATE_NODE_PROPS 151 -#define STMT_151_INFO {"STMT_UPDATE_NODE_PROPS", NULL} -#define STMT_151 \ +#define STMT_UPDATE_NODE_PROPS 152 +#define STMT_152_INFO {"STMT_UPDATE_NODE_PROPS", NULL} +#define STMT_152 \ "UPDATE nodes SET properties = ?4 " \ "WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = ?3 " \ "" -#define STMT_PRAGMA_TABLE_INFO_NODES 152 -#define STMT_152_INFO {"STMT_PRAGMA_TABLE_INFO_NODES", NULL} -#define STMT_152 \ +#define STMT_PRAGMA_TABLE_INFO_NODES 153 +#define STMT_153_INFO {"STMT_PRAGMA_TABLE_INFO_NODES", NULL} +#define STMT_153 \ "PRAGMA table_info(\"NODES\") " \ "" -#define STMT_CREATE_TARGET_PROP_CACHE 153 -#define STMT_153_INFO {"STMT_CREATE_TARGET_PROP_CACHE", NULL} -#define STMT_153 \ +#define STMT_CREATE_TARGET_PROP_CACHE 154 +#define STMT_154_INFO {"STMT_CREATE_TARGET_PROP_CACHE", NULL} +#define STMT_154 \ "DROP TABLE IF EXISTS target_prop_cache; " \ "CREATE TEMPORARY TABLE target_prop_cache ( " \ " local_relpath TEXT NOT NULL PRIMARY KEY, " \ @@ -1574,9 +1581,9 @@ "); " \ "" -#define STMT_CACHE_TARGET_PROPS 154 -#define STMT_154_INFO {"STMT_CACHE_TARGET_PROPS", NULL} -#define STMT_154 \ +#define STMT_CACHE_TARGET_PROPS 155 +#define STMT_155_INFO {"STMT_CACHE_TARGET_PROPS", NULL} +#define STMT_155 \ "INSERT INTO target_prop_cache(local_relpath, kind, properties) " \ " SELECT n.local_relpath, n.kind, " \ " IFNULL((SELECT properties FROM actual_node AS a " \ @@ -1595,9 +1602,9 @@ " ORDER BY t.local_relpath " \ "" -#define STMT_CACHE_TARGET_PRISTINE_PROPS 155 -#define STMT_155_INFO {"STMT_CACHE_TARGET_PRISTINE_PROPS", NULL} -#define STMT_155 \ +#define STMT_CACHE_TARGET_PRISTINE_PROPS 156 +#define STMT_156_INFO {"STMT_CACHE_TARGET_PRISTINE_PROPS", NULL} +#define STMT_156 \ "INSERT INTO target_prop_cache(local_relpath, kind, properties) " \ " SELECT n.local_relpath, n.kind, " \ " CASE n.presence " \ @@ -1622,22 +1629,22 @@ " ORDER BY t.local_relpath " \ "" -#define STMT_SELECT_ALL_TARGET_PROP_CACHE 156 -#define STMT_156_INFO {"STMT_SELECT_ALL_TARGET_PROP_CACHE", NULL} -#define STMT_156 \ +#define STMT_SELECT_ALL_TARGET_PROP_CACHE 157 +#define STMT_157_INFO {"STMT_SELECT_ALL_TARGET_PROP_CACHE", NULL} +#define STMT_157 \ "SELECT local_relpath, properties FROM target_prop_cache " \ "ORDER BY local_relpath " \ "" -#define STMT_DROP_TARGET_PROP_CACHE 157 -#define STMT_157_INFO {"STMT_DROP_TARGET_PROP_CACHE", NULL} -#define STMT_157 \ +#define STMT_DROP_TARGET_PROP_CACHE 158 +#define STMT_158_INFO {"STMT_DROP_TARGET_PROP_CACHE", NULL} +#define STMT_158 \ "DROP TABLE target_prop_cache; " \ "" -#define STMT_CREATE_REVERT_LIST 158 -#define STMT_158_INFO {"STMT_CREATE_REVERT_LIST", NULL} -#define STMT_158 \ +#define STMT_CREATE_REVERT_LIST 159 +#define STMT_159_INFO {"STMT_CREATE_REVERT_LIST", NULL} +#define STMT_159 \ "DROP TABLE IF EXISTS revert_list; " \ "CREATE TEMPORARY TABLE revert_list ( " \ " local_relpath TEXT NOT NULL, " \ @@ -1693,26 +1700,26 @@ "END " \ "" -#define STMT_DROP_REVERT_LIST_TRIGGERS 159 -#define STMT_159_INFO {"STMT_DROP_REVERT_LIST_TRIGGERS", NULL} -#define STMT_159 \ +#define STMT_DROP_REVERT_LIST_TRIGGERS 160 +#define STMT_160_INFO {"STMT_DROP_REVERT_LIST_TRIGGERS", NULL} +#define STMT_160 \ "DROP TRIGGER trigger_revert_list_nodes; " \ "DROP TRIGGER trigger_revert_list_actual_delete; " \ "DROP TRIGGER trigger_revert_list_actual_update " \ "" -#define STMT_SELECT_REVERT_LIST 160 -#define STMT_160_INFO {"STMT_SELECT_REVERT_LIST", NULL} -#define STMT_160 \ +#define STMT_SELECT_REVERT_LIST 161 +#define STMT_161_INFO {"STMT_SELECT_REVERT_LIST", NULL} +#define STMT_161 \ "SELECT actual, notify, kind, op_depth, repos_id, conflict_data " \ "FROM revert_list " \ "WHERE local_relpath = ?1 " \ "ORDER BY actual DESC " \ "" -#define STMT_SELECT_REVERT_LIST_COPIED_CHILDREN 161 -#define STMT_161_INFO {"STMT_SELECT_REVERT_LIST_COPIED_CHILDREN", NULL} -#define STMT_161 \ +#define STMT_SELECT_REVERT_LIST_COPIED_CHILDREN 162 +#define STMT_162_INFO {"STMT_SELECT_REVERT_LIST_COPIED_CHILDREN", NULL} +#define STMT_162 \ "SELECT local_relpath, kind " \ "FROM revert_list " \ "WHERE (((local_relpath) > (CASE (?1) WHEN '' THEN '' ELSE (?1) || '/' END)) AND ((local_relpath) < CASE (?1) WHEN '' THEN X'FFFF' ELSE (?1) || '0' END)) " \ @@ -1721,15 +1728,15 @@ "ORDER BY local_relpath " \ "" -#define STMT_DELETE_REVERT_LIST 162 -#define STMT_162_INFO {"STMT_DELETE_REVERT_LIST", NULL} -#define STMT_162 \ +#define STMT_DELETE_REVERT_LIST 163 +#define STMT_163_INFO {"STMT_DELETE_REVERT_LIST", NULL} +#define STMT_163 \ "DELETE FROM revert_list WHERE local_relpath = ?1 " \ "" -#define STMT_SELECT_REVERT_LIST_RECURSIVE 163 -#define STMT_163_INFO {"STMT_SELECT_REVERT_LIST_RECURSIVE", NULL} -#define STMT_163 \ +#define STMT_SELECT_REVERT_LIST_RECURSIVE 164 +#define STMT_164_INFO {"STMT_SELECT_REVERT_LIST_RECURSIVE", NULL} +#define STMT_164 \ "SELECT DISTINCT local_relpath " \ "FROM revert_list " \ "WHERE (local_relpath = ?1 " \ @@ -1738,32 +1745,32 @@ "ORDER BY local_relpath " \ "" -#define STMT_DELETE_REVERT_LIST_RECURSIVE 164 -#define STMT_164_INFO {"STMT_DELETE_REVERT_LIST_RECURSIVE", NULL} -#define STMT_164 \ +#define STMT_DELETE_REVERT_LIST_RECURSIVE 165 +#define STMT_165_INFO {"STMT_DELETE_REVERT_LIST_RECURSIVE", NULL} +#define STMT_165 \ "DELETE FROM revert_list " \ "WHERE (local_relpath = ?1 " \ " OR (((local_relpath) > (CASE (?1) WHEN '' THEN '' ELSE (?1) || '/' END)) AND ((local_relpath) < CASE (?1) WHEN '' THEN X'FFFF' ELSE (?1) || '0' END))) " \ "" -#define STMT_DROP_REVERT_LIST 165 -#define STMT_165_INFO {"STMT_DROP_REVERT_LIST", NULL} -#define STMT_165 \ +#define STMT_DROP_REVERT_LIST 166 +#define STMT_166_INFO {"STMT_DROP_REVERT_LIST", NULL} +#define STMT_166 \ "DROP TABLE IF EXISTS revert_list " \ "" -#define STMT_CREATE_DELETE_LIST 166 -#define STMT_166_INFO {"STMT_CREATE_DELETE_LIST", NULL} -#define STMT_166 \ +#define STMT_CREATE_DELETE_LIST 167 +#define STMT_167_INFO {"STMT_CREATE_DELETE_LIST", NULL} +#define STMT_167 \ "DROP TABLE IF EXISTS delete_list; " \ "CREATE TEMPORARY TABLE delete_list ( " \ " local_relpath TEXT PRIMARY KEY NOT NULL UNIQUE " \ " ) " \ "" -#define STMT_INSERT_DELETE_LIST 167 -#define STMT_167_INFO {"STMT_INSERT_DELETE_LIST", NULL} -#define STMT_167 \ +#define STMT_INSERT_DELETE_LIST 168 +#define STMT_168_INFO {"STMT_INSERT_DELETE_LIST", NULL} +#define STMT_168 \ "INSERT INTO delete_list(local_relpath) " \ "SELECT local_relpath FROM nodes AS n " \ "WHERE wc_id = ?1 " \ @@ -1777,22 +1784,22 @@ " AND file_external IS NULL " \ "" -#define STMT_SELECT_DELETE_LIST 168 -#define STMT_168_INFO {"STMT_SELECT_DELETE_LIST", NULL} -#define STMT_168 \ +#define STMT_SELECT_DELETE_LIST 169 +#define STMT_169_INFO {"STMT_SELECT_DELETE_LIST", NULL} +#define STMT_169 \ "SELECT local_relpath FROM delete_list " \ "ORDER BY local_relpath " \ "" -#define STMT_FINALIZE_DELETE 169 -#define STMT_169_INFO {"STMT_FINALIZE_DELETE", NULL} -#define STMT_169 \ +#define STMT_FINALIZE_DELETE 170 +#define STMT_170_INFO {"STMT_FINALIZE_DELETE", NULL} +#define STMT_170 \ "DROP TABLE IF EXISTS delete_list " \ "" -#define STMT_CREATE_UPDATE_MOVE_LIST 170 -#define STMT_170_INFO {"STMT_CREATE_UPDATE_MOVE_LIST", NULL} -#define STMT_170 \ +#define STMT_CREATE_UPDATE_MOVE_LIST 171 +#define STMT_171_INFO {"STMT_CREATE_UPDATE_MOVE_LIST", NULL} +#define STMT_171 \ "DROP TABLE IF EXISTS update_move_list; " \ "CREATE TEMPORARY TABLE update_move_list ( " \ " local_relpath TEXT PRIMARY KEY NOT NULL UNIQUE, " \ @@ -1803,31 +1810,31 @@ " ) " \ "" -#define STMT_INSERT_UPDATE_MOVE_LIST 171 -#define STMT_171_INFO {"STMT_INSERT_UPDATE_MOVE_LIST", NULL} -#define STMT_171 \ +#define STMT_INSERT_UPDATE_MOVE_LIST 172 +#define STMT_172_INFO {"STMT_INSERT_UPDATE_MOVE_LIST", NULL} +#define STMT_172 \ "INSERT INTO update_move_list(local_relpath, action, kind, content_state, " \ " prop_state) " \ "VALUES (?1, ?2, ?3, ?4, ?5) " \ "" -#define STMT_SELECT_UPDATE_MOVE_LIST 172 -#define STMT_172_INFO {"STMT_SELECT_UPDATE_MOVE_LIST", NULL} -#define STMT_172 \ +#define STMT_SELECT_UPDATE_MOVE_LIST 173 +#define STMT_173_INFO {"STMT_SELECT_UPDATE_MOVE_LIST", NULL} +#define STMT_173 \ "SELECT local_relpath, action, kind, content_state, prop_state " \ "FROM update_move_list " \ "ORDER BY local_relpath " \ "" -#define STMT_FINALIZE_UPDATE_MOVE 173 -#define STMT_173_INFO {"STMT_FINALIZE_UPDATE_MOVE", NULL} -#define STMT_173 \ +#define STMT_FINALIZE_UPDATE_MOVE 174 +#define STMT_174_INFO {"STMT_FINALIZE_UPDATE_MOVE", NULL} +#define STMT_174 \ "DROP TABLE IF EXISTS update_move_list " \ "" -#define STMT_SELECT_MIN_MAX_REVISIONS 174 -#define STMT_174_INFO {"STMT_SELECT_MIN_MAX_REVISIONS", NULL} -#define STMT_174 \ +#define STMT_SELECT_MIN_MAX_REVISIONS 175 +#define STMT_175_INFO {"STMT_SELECT_MIN_MAX_REVISIONS", NULL} +#define STMT_175 \ "SELECT MIN(revision), MAX(revision), " \ " MIN(changed_revision), MAX(changed_revision) FROM nodes " \ " WHERE wc_id = ?1 " \ @@ -1838,9 +1845,9 @@ " AND op_depth = 0 " \ "" -#define STMT_HAS_SPARSE_NODES 175 -#define STMT_175_INFO {"STMT_HAS_SPARSE_NODES", NULL} -#define STMT_175 \ +#define STMT_HAS_SPARSE_NODES 176 +#define STMT_176_INFO {"STMT_HAS_SPARSE_NODES", NULL} +#define STMT_176 \ "SELECT 1 FROM nodes " \ "WHERE wc_id = ?1 " \ " AND (local_relpath = ?2 " \ @@ -1852,9 +1859,9 @@ "LIMIT 1 " \ "" -#define STMT_SUBTREE_HAS_TREE_MODIFICATIONS 176 -#define STMT_176_INFO {"STMT_SUBTREE_HAS_TREE_MODIFICATIONS", NULL} -#define STMT_176 \ +#define STMT_SUBTREE_HAS_TREE_MODIFICATIONS 177 +#define STMT_177_INFO {"STMT_SUBTREE_HAS_TREE_MODIFICATIONS", NULL} +#define STMT_177 \ "SELECT 1 FROM nodes " \ "WHERE wc_id = ?1 " \ " AND (local_relpath = ?2 " \ @@ -1863,9 +1870,9 @@ "LIMIT 1 " \ "" -#define STMT_SUBTREE_HAS_PROP_MODIFICATIONS 177 -#define STMT_177_INFO {"STMT_SUBTREE_HAS_PROP_MODIFICATIONS", NULL} -#define STMT_177 \ +#define STMT_SUBTREE_HAS_PROP_MODIFICATIONS 178 +#define STMT_178_INFO {"STMT_SUBTREE_HAS_PROP_MODIFICATIONS", NULL} +#define STMT_178 \ "SELECT 1 FROM actual_node " \ "WHERE wc_id = ?1 " \ " AND (local_relpath = ?2 " \ @@ -1874,9 +1881,9 @@ "LIMIT 1 " \ "" -#define STMT_HAS_SWITCHED 178 -#define STMT_178_INFO {"STMT_HAS_SWITCHED", NULL} -#define STMT_178 \ +#define STMT_HAS_SWITCHED 179 +#define STMT_179_INFO {"STMT_HAS_SWITCHED", NULL} +#define STMT_179 \ "SELECT 1 " \ "FROM nodes " \ "WHERE wc_id = ?1 " \ @@ -1888,9 +1895,9 @@ "LIMIT 1 " \ "" -#define STMT_SELECT_BASE_FILES_RECURSIVE 179 -#define STMT_179_INFO {"STMT_SELECT_BASE_FILES_RECURSIVE", NULL} -#define STMT_179 \ +#define STMT_SELECT_BASE_FILES_RECURSIVE 180 +#define STMT_180_INFO {"STMT_SELECT_BASE_FILES_RECURSIVE", NULL} +#define STMT_180 \ "SELECT local_relpath, translated_size, last_mod_time FROM nodes AS n " \ "WHERE wc_id = ?1 " \ " AND (local_relpath = ?2 " \ @@ -1901,47 +1908,47 @@ " AND file_external IS NULL " \ "" -#define STMT_SELECT_MOVED_FROM_RELPATH 180 -#define STMT_180_INFO {"STMT_SELECT_MOVED_FROM_RELPATH", NULL} -#define STMT_180 \ +#define STMT_SELECT_MOVED_FROM_RELPATH 181 +#define STMT_181_INFO {"STMT_SELECT_MOVED_FROM_RELPATH", NULL} +#define STMT_181 \ "SELECT local_relpath, op_depth FROM nodes " \ "WHERE wc_id = ?1 AND moved_to = ?2 AND op_depth > 0 " \ "" -#define STMT_UPDATE_MOVED_TO_RELPATH 181 -#define STMT_181_INFO {"STMT_UPDATE_MOVED_TO_RELPATH", NULL} -#define STMT_181 \ +#define STMT_UPDATE_MOVED_TO_RELPATH 182 +#define STMT_182_INFO {"STMT_UPDATE_MOVED_TO_RELPATH", NULL} +#define STMT_182 \ "UPDATE nodes SET moved_to = ?4 " \ "WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = ?3 " \ "" -#define STMT_CLEAR_MOVED_TO_RELPATH 182 -#define STMT_182_INFO {"STMT_CLEAR_MOVED_TO_RELPATH", NULL} -#define STMT_182 \ +#define STMT_CLEAR_MOVED_TO_RELPATH 183 +#define STMT_183_INFO {"STMT_CLEAR_MOVED_TO_RELPATH", NULL} +#define STMT_183 \ "UPDATE nodes SET moved_to = NULL " \ "WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = ?3 " \ "" -#define STMT_CLEAR_MOVED_HERE_RECURSIVE 183 -#define STMT_183_INFO {"STMT_CLEAR_MOVED_HERE_RECURSIVE", NULL} -#define STMT_183 \ +#define STMT_CLEAR_MOVED_HERE_RECURSIVE 184 +#define STMT_184_INFO {"STMT_CLEAR_MOVED_HERE_RECURSIVE", NULL} +#define STMT_184 \ "UPDATE nodes SET moved_here = NULL " \ "WHERE wc_id = ?1 " \ " AND (local_relpath = ?2 OR (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END))) " \ " AND op_depth = ?3 " \ "" -#define STMT_SELECT_MOVED_HERE_CHILDREN 184 -#define STMT_184_INFO {"STMT_SELECT_MOVED_HERE_CHILDREN", NULL} -#define STMT_184 \ +#define STMT_SELECT_MOVED_HERE_CHILDREN 185 +#define STMT_185_INFO {"STMT_SELECT_MOVED_HERE_CHILDREN", NULL} +#define STMT_185 \ "SELECT moved_to, local_relpath FROM nodes " \ "WHERE wc_id = ?1 AND op_depth > 0 " \ " AND (((moved_to) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((moved_to) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \ "" -#define STMT_SELECT_MOVED_FOR_DELETE 185 -#define STMT_185_INFO {"STMT_SELECT_MOVED_FOR_DELETE", NULL} -#define STMT_185 \ +#define STMT_SELECT_MOVED_FOR_DELETE 186 +#define STMT_186_INFO {"STMT_SELECT_MOVED_FOR_DELETE", NULL} +#define STMT_186 \ "SELECT local_relpath, moved_to, op_depth FROM nodes " \ "WHERE wc_id = ?1 " \ " AND (local_relpath = ?2 OR (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END))) " \ @@ -1951,25 +1958,25 @@ " AND o.local_relpath = ?2) " \ "" -#define STMT_UPDATE_MOVED_TO_DESCENDANTS 186 -#define STMT_186_INFO {"STMT_UPDATE_MOVED_TO_DESCENDANTS", NULL} -#define STMT_186 \ +#define STMT_UPDATE_MOVED_TO_DESCENDANTS 187 +#define STMT_187_INFO {"STMT_UPDATE_MOVED_TO_DESCENDANTS", NULL} +#define STMT_187 \ "UPDATE nodes SET moved_to = (CASE WHEN (?2) = '' THEN (CASE WHEN (?3) = '' THEN (moved_to) WHEN (moved_to) = '' THEN (?3) ELSE (?3) || '/' || (moved_to) END) WHEN (?3) = '' THEN (CASE WHEN (?2) = '' THEN (moved_to) WHEN SUBSTR((moved_to), 1, LENGTH(?2)) = (?2) THEN CASE WHEN LENGTH(?2) = LENGTH(moved_to) THEN '' WHEN SUBSTR((moved_to), LENGTH(?2)+1, 1) = '/' THEN SUBSTR((moved_to), LENGTH(?2)+2) END END) WHEN SUBSTR((moved_to), 1, LENGTH(?2)) = (?2) THEN CASE WHEN LENGTH(?2) = LENGTH(moved_to) THEN (?3) WHEN SUBSTR((moved_to), LENGTH(?2)+1, 1) = '/' THEN (?3) || SUBSTR((moved_to), LENGTH(?2)+1) END END) " \ " WHERE wc_id = ?1 " \ " AND (((moved_to) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((moved_to) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \ "" -#define STMT_CLEAR_MOVED_TO_DESCENDANTS 187 -#define STMT_187_INFO {"STMT_CLEAR_MOVED_TO_DESCENDANTS", NULL} -#define STMT_187 \ +#define STMT_CLEAR_MOVED_TO_DESCENDANTS 188 +#define STMT_188_INFO {"STMT_CLEAR_MOVED_TO_DESCENDANTS", NULL} +#define STMT_188 \ "UPDATE nodes SET moved_to = NULL " \ " WHERE wc_id = ?1 " \ " AND (((moved_to) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((moved_to) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \ "" -#define STMT_SELECT_MOVED_PAIR2 188 -#define STMT_188_INFO {"STMT_SELECT_MOVED_PAIR2", NULL} -#define STMT_188 \ +#define STMT_SELECT_MOVED_PAIR2 189 +#define STMT_189_INFO {"STMT_SELECT_MOVED_PAIR2", NULL} +#define STMT_189 \ "SELECT local_relpath, moved_to, op_depth FROM nodes " \ "WHERE wc_id = ?1 " \ " AND (local_relpath = ?2 OR (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END))) " \ @@ -1980,9 +1987,9 @@ " AND o.local_relpath = ?2) " \ "" -#define STMT_SELECT_MOVED_PAIR3 189 -#define STMT_189_INFO {"STMT_SELECT_MOVED_PAIR3", NULL} -#define STMT_189 \ +#define STMT_SELECT_MOVED_PAIR3 190 +#define STMT_190_INFO {"STMT_SELECT_MOVED_PAIR3", NULL} +#define STMT_190 \ "SELECT local_relpath, moved_to, op_depth, kind FROM nodes " \ "WHERE wc_id = ?1 " \ " AND (local_relpath = ?2 OR (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END))) " \ @@ -1990,9 +1997,9 @@ " AND moved_to IS NOT NULL " \ "" -#define STMT_SELECT_MOVED_OUTSIDE 190 -#define STMT_190_INFO {"STMT_SELECT_MOVED_OUTSIDE", NULL} -#define STMT_190 \ +#define STMT_SELECT_MOVED_OUTSIDE 191 +#define STMT_191_INFO {"STMT_SELECT_MOVED_OUTSIDE", NULL} +#define STMT_191 \ "SELECT local_relpath, moved_to FROM nodes " \ "WHERE wc_id = ?1 " \ " AND (local_relpath = ?2 OR (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END))) " \ @@ -2001,9 +2008,9 @@ " AND NOT (((moved_to) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((moved_to) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \ "" -#define STMT_SELECT_OP_DEPTH_MOVED_PAIR 191 -#define STMT_191_INFO {"STMT_SELECT_OP_DEPTH_MOVED_PAIR", NULL} -#define STMT_191 \ +#define STMT_SELECT_OP_DEPTH_MOVED_PAIR 192 +#define STMT_192_INFO {"STMT_SELECT_OP_DEPTH_MOVED_PAIR", NULL} +#define STMT_192 \ "SELECT n.local_relpath, n.moved_to, " \ " (SELECT o.repos_path FROM nodes AS o " \ " WHERE o.wc_id = n.wc_id " \ @@ -2016,9 +2023,9 @@ " AND n.moved_to IS NOT NULL " \ "" -#define STMT_SELECT_MOVED_DESCENDANTS 192 -#define STMT_192_INFO {"STMT_SELECT_MOVED_DESCENDANTS", NULL} -#define STMT_192 \ +#define STMT_SELECT_MOVED_DESCENDANTS 193 +#define STMT_193_INFO {"STMT_SELECT_MOVED_DESCENDANTS", NULL} +#define STMT_193 \ "SELECT n.local_relpath, h.moved_to " \ "FROM nodes n, nodes h " \ "WHERE n.wc_id = ?1 " \ @@ -2034,9 +2041,9 @@ " AND h.moved_to IS NOT NULL " \ "" -#define STMT_COMMIT_UPDATE_ORIGIN 193 -#define STMT_193_INFO {"STMT_COMMIT_UPDATE_ORIGIN", NULL} -#define STMT_193 \ +#define STMT_COMMIT_UPDATE_ORIGIN 194 +#define STMT_194_INFO {"STMT_COMMIT_UPDATE_ORIGIN", NULL} +#define STMT_194 \ "UPDATE nodes SET repos_id = ?4, " \ " repos_path = ?5 || SUBSTR(local_relpath, LENGTH(?2)+1), " \ " revision = ?6 " \ @@ -2046,16 +2053,16 @@ " AND op_depth = ?3 " \ "" -#define STMT_HAS_LAYER_BETWEEN 194 -#define STMT_194_INFO {"STMT_HAS_LAYER_BETWEEN", NULL} -#define STMT_194 \ +#define STMT_HAS_LAYER_BETWEEN 195 +#define STMT_195_INFO {"STMT_HAS_LAYER_BETWEEN", NULL} +#define STMT_195 \ "SELECT 1 FROM NODES " \ "WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth > ?3 AND op_depth < ?4 " \ "" -#define STMT_SELECT_REPOS_PATH_REVISION 195 -#define STMT_195_INFO {"STMT_SELECT_REPOS_PATH_REVISION", NULL} -#define STMT_195 \ +#define STMT_SELECT_REPOS_PATH_REVISION 196 +#define STMT_196_INFO {"STMT_SELECT_REPOS_PATH_REVISION", NULL} +#define STMT_196 \ "SELECT local_relpath, repos_path, revision FROM nodes " \ "WHERE wc_id = ?1 " \ " AND (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \ @@ -2063,16 +2070,16 @@ "ORDER BY local_relpath " \ "" -#define STMT_SELECT_HAS_NON_FILE_CHILDREN 196 -#define STMT_196_INFO {"STMT_SELECT_HAS_NON_FILE_CHILDREN", NULL} -#define STMT_196 \ +#define STMT_SELECT_HAS_NON_FILE_CHILDREN 197 +#define STMT_197_INFO {"STMT_SELECT_HAS_NON_FILE_CHILDREN", NULL} +#define STMT_197 \ "SELECT 1 FROM nodes " \ "WHERE wc_id = ?1 AND parent_relpath = ?2 AND op_depth = 0 AND kind != 'file' " \ "" -#define STMT_SELECT_HAS_GRANDCHILDREN 197 -#define STMT_197_INFO {"STMT_SELECT_HAS_GRANDCHILDREN", NULL} -#define STMT_197 \ +#define STMT_SELECT_HAS_GRANDCHILDREN 198 +#define STMT_198_INFO {"STMT_SELECT_HAS_GRANDCHILDREN", NULL} +#define STMT_198 \ "SELECT 1 FROM nodes " \ "WHERE wc_id = ?1 " \ " AND (((parent_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((parent_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \ @@ -2080,33 +2087,33 @@ " AND file_external IS NULL " \ "" -#define STMT_SELECT_ALL_NODES 198 -#define STMT_198_INFO {"STMT_SELECT_ALL_NODES", NULL} -#define STMT_198 \ +#define STMT_SELECT_ALL_NODES 199 +#define STMT_199_INFO {"STMT_SELECT_ALL_NODES", NULL} +#define STMT_199 \ "SELECT op_depth, local_relpath, parent_relpath, file_external FROM nodes " \ "WHERE wc_id = ?1 " \ "" -#define STMT_SELECT_IPROPS 199 -#define STMT_199_INFO {"STMT_SELECT_IPROPS", NULL} -#define STMT_199 \ +#define STMT_SELECT_IPROPS 200 +#define STMT_200_INFO {"STMT_SELECT_IPROPS", NULL} +#define STMT_200 \ "SELECT inherited_props FROM nodes " \ "WHERE wc_id = ?1 " \ " AND local_relpath = ?2 " \ " AND op_depth = 0 " \ "" -#define STMT_UPDATE_IPROP 200 -#define STMT_200_INFO {"STMT_UPDATE_IPROP", NULL} -#define STMT_200 \ +#define STMT_UPDATE_IPROP 201 +#define STMT_201_INFO {"STMT_UPDATE_IPROP", NULL} +#define STMT_201 \ "UPDATE nodes " \ "SET inherited_props = ?3 " \ "WHERE (wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0) " \ "" -#define STMT_SELECT_IPROPS_NODE 201 -#define STMT_201_INFO {"STMT_SELECT_IPROPS_NODE", NULL} -#define STMT_201 \ +#define STMT_SELECT_IPROPS_NODE 202 +#define STMT_202_INFO {"STMT_SELECT_IPROPS_NODE", NULL} +#define STMT_202 \ "SELECT local_relpath, repos_path FROM nodes " \ "WHERE wc_id = ?1 " \ " AND local_relpath = ?2 " \ @@ -2114,9 +2121,9 @@ " AND (inherited_props not null) " \ "" -#define STMT_SELECT_IPROPS_RECURSIVE 202 -#define STMT_202_INFO {"STMT_SELECT_IPROPS_RECURSIVE", NULL} -#define STMT_202 \ +#define STMT_SELECT_IPROPS_RECURSIVE 203 +#define STMT_203_INFO {"STMT_SELECT_IPROPS_RECURSIVE", NULL} +#define STMT_203 \ "SELECT local_relpath, repos_path FROM nodes " \ "WHERE wc_id = ?1 " \ " AND (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \ @@ -2124,9 +2131,9 @@ " AND (inherited_props not null) " \ "" -#define STMT_SELECT_IPROPS_CHILDREN 203 -#define STMT_203_INFO {"STMT_SELECT_IPROPS_CHILDREN", NULL} -#define STMT_203 \ +#define STMT_SELECT_IPROPS_CHILDREN 204 +#define STMT_204_INFO {"STMT_SELECT_IPROPS_CHILDREN", NULL} +#define STMT_204 \ "SELECT local_relpath, repos_path FROM nodes " \ "WHERE wc_id = ?1 " \ " AND parent_relpath = ?2 " \ @@ -2134,9 +2141,9 @@ " AND (inherited_props not null) " \ "" -#define STMT_CREATE_SCHEMA 204 -#define STMT_204_INFO {"STMT_CREATE_SCHEMA", NULL} -#define STMT_204 \ +#define STMT_CREATE_SCHEMA 205 +#define STMT_205_INFO {"STMT_CREATE_SCHEMA", NULL} +#define STMT_205 \ "CREATE TABLE REPOSITORY ( " \ " id INTEGER PRIMARY KEY AUTOINCREMENT, " \ " root TEXT UNIQUE NOT NULL, " \ @@ -2201,9 +2208,9 @@ "; " \ "" -#define STMT_CREATE_NODES 205 -#define STMT_205_INFO {"STMT_CREATE_NODES", NULL} -#define STMT_205 \ +#define STMT_CREATE_NODES 206 +#define STMT_206_INFO {"STMT_CREATE_NODES", NULL} +#define STMT_206 \ "CREATE TABLE NODES ( " \ " wc_id INTEGER NOT NULL REFERENCES WCROOT (id), " \ " local_relpath TEXT NOT NULL, " \ @@ -2243,9 +2250,9 @@ " WHERE op_depth = 0; " \ "" -#define STMT_CREATE_NODES_TRIGGERS 206 -#define STMT_206_INFO {"STMT_CREATE_NODES_TRIGGERS", NULL} -#define STMT_206 \ +#define STMT_CREATE_NODES_TRIGGERS 207 +#define STMT_207_INFO {"STMT_CREATE_NODES_TRIGGERS", NULL} +#define STMT_207 \ "CREATE TRIGGER nodes_insert_trigger " \ "AFTER INSERT ON nodes " \ "WHEN NEW.checksum IS NOT NULL " \ @@ -2271,9 +2278,9 @@ "END; " \ "" -#define STMT_CREATE_EXTERNALS 207 -#define STMT_207_INFO {"STMT_CREATE_EXTERNALS", NULL} -#define STMT_207 \ +#define STMT_CREATE_EXTERNALS 208 +#define STMT_208_INFO {"STMT_CREATE_EXTERNALS", NULL} +#define STMT_208 \ "CREATE TABLE EXTERNALS ( " \ " wc_id INTEGER NOT NULL REFERENCES WCROOT (id), " \ " local_relpath TEXT NOT NULL, " \ @@ -2292,9 +2299,9 @@ " local_relpath); " \ "" -#define STMT_UPGRADE_TO_20 208 -#define STMT_208_INFO {"STMT_UPGRADE_TO_20", NULL} -#define STMT_208 \ +#define STMT_UPGRADE_TO_20 209 +#define STMT_209_INFO {"STMT_UPGRADE_TO_20", NULL} +#define STMT_209 \ "UPDATE BASE_NODE SET checksum = (SELECT checksum FROM pristine " \ " WHERE md5_checksum = BASE_NODE.checksum) " \ "WHERE EXISTS (SELECT 1 FROM pristine WHERE md5_checksum = BASE_NODE.checksum); " \ @@ -2335,59 +2342,59 @@ "PRAGMA user_version = 20; " \ "" -#define STMT_UPGRADE_TO_21 209 -#define STMT_209_INFO {"STMT_UPGRADE_TO_21", NULL} -#define STMT_209 \ +#define STMT_UPGRADE_TO_21 210 +#define STMT_210_INFO {"STMT_UPGRADE_TO_21", NULL} +#define STMT_210 \ "PRAGMA user_version = 21; " \ "" -#define STMT_UPGRADE_21_SELECT_OLD_TREE_CONFLICT 210 -#define STMT_210_INFO {"STMT_UPGRADE_21_SELECT_OLD_TREE_CONFLICT", NULL} -#define STMT_210 \ +#define STMT_UPGRADE_21_SELECT_OLD_TREE_CONFLICT 211 +#define STMT_211_INFO {"STMT_UPGRADE_21_SELECT_OLD_TREE_CONFLICT", NULL} +#define STMT_211 \ "SELECT wc_id, local_relpath, tree_conflict_data " \ "FROM actual_node " \ "WHERE tree_conflict_data IS NOT NULL " \ "" -#define STMT_UPGRADE_21_ERASE_OLD_CONFLICTS 211 -#define STMT_211_INFO {"STMT_UPGRADE_21_ERASE_OLD_CONFLICTS", NULL} -#define STMT_211 \ +#define STMT_UPGRADE_21_ERASE_OLD_CONFLICTS 212 +#define STMT_212_INFO {"STMT_UPGRADE_21_ERASE_OLD_CONFLICTS", NULL} +#define STMT_212 \ "UPDATE actual_node SET tree_conflict_data = NULL " \ "" -#define STMT_UPGRADE_TO_22 212 -#define STMT_212_INFO {"STMT_UPGRADE_TO_22", NULL} -#define STMT_212 \ +#define STMT_UPGRADE_TO_22 213 +#define STMT_213_INFO {"STMT_UPGRADE_TO_22", NULL} +#define STMT_213 \ "UPDATE actual_node SET tree_conflict_data = conflict_data; " \ "UPDATE actual_node SET conflict_data = NULL; " \ "PRAGMA user_version = 22; " \ "" -#define STMT_UPGRADE_TO_23 213 -#define STMT_213_INFO {"STMT_UPGRADE_TO_23", NULL} -#define STMT_213 \ +#define STMT_UPGRADE_TO_23 214 +#define STMT_214_INFO {"STMT_UPGRADE_TO_23", NULL} +#define STMT_214 \ "PRAGMA user_version = 23; " \ "" -#define STMT_UPGRADE_23_HAS_WORKING_NODES 214 -#define STMT_214_INFO {"STMT_UPGRADE_23_HAS_WORKING_NODES", NULL} -#define STMT_214 \ +#define STMT_UPGRADE_23_HAS_WORKING_NODES 215 +#define STMT_215_INFO {"STMT_UPGRADE_23_HAS_WORKING_NODES", NULL} +#define STMT_215 \ "SELECT 1 FROM nodes WHERE op_depth > 0 " \ "LIMIT 1 " \ "" -#define STMT_UPGRADE_TO_24 215 -#define STMT_215_INFO {"STMT_UPGRADE_TO_24", NULL} -#define STMT_215 \ +#define STMT_UPGRADE_TO_24 216 +#define STMT_216_INFO {"STMT_UPGRADE_TO_24", NULL} +#define STMT_216 \ "UPDATE pristine SET refcount = " \ " (SELECT COUNT(*) FROM nodes " \ " WHERE checksum = pristine.checksum ); " \ "PRAGMA user_version = 24; " \ "" -#define STMT_UPGRADE_TO_25 216 -#define STMT_216_INFO {"STMT_UPGRADE_TO_25", NULL} -#define STMT_216 \ +#define STMT_UPGRADE_TO_25 217 +#define STMT_217_INFO {"STMT_UPGRADE_TO_25", NULL} +#define STMT_217 \ "DROP VIEW IF EXISTS NODES_CURRENT; " \ "CREATE VIEW NODES_CURRENT AS " \ " SELECT * FROM nodes " \ @@ -2399,9 +2406,9 @@ "PRAGMA user_version = 25; " \ "" -#define STMT_UPGRADE_TO_26 217 -#define STMT_217_INFO {"STMT_UPGRADE_TO_26", NULL} -#define STMT_217 \ +#define STMT_UPGRADE_TO_26 218 +#define STMT_218_INFO {"STMT_UPGRADE_TO_26", NULL} +#define STMT_218 \ "DROP VIEW IF EXISTS NODES_BASE; " \ "CREATE VIEW NODES_BASE AS " \ " SELECT * FROM nodes " \ @@ -2409,15 +2416,15 @@ "PRAGMA user_version = 26; " \ "" -#define STMT_UPGRADE_TO_27 218 -#define STMT_218_INFO {"STMT_UPGRADE_TO_27", NULL} -#define STMT_218 \ +#define STMT_UPGRADE_TO_27 219 +#define STMT_219_INFO {"STMT_UPGRADE_TO_27", NULL} +#define STMT_219 \ "PRAGMA user_version = 27; " \ "" -#define STMT_UPGRADE_27_HAS_ACTUAL_NODES_CONFLICTS 219 -#define STMT_219_INFO {"STMT_UPGRADE_27_HAS_ACTUAL_NODES_CONFLICTS", NULL} -#define STMT_219 \ +#define STMT_UPGRADE_27_HAS_ACTUAL_NODES_CONFLICTS 220 +#define STMT_220_INFO {"STMT_UPGRADE_27_HAS_ACTUAL_NODES_CONFLICTS", NULL} +#define STMT_220 \ "SELECT 1 FROM actual_node " \ "WHERE NOT ((prop_reject IS NULL) AND (conflict_old IS NULL) " \ " AND (conflict_new IS NULL) AND (conflict_working IS NULL) " \ @@ -2425,18 +2432,18 @@ "LIMIT 1 " \ "" -#define STMT_UPGRADE_TO_28 220 -#define STMT_220_INFO {"STMT_UPGRADE_TO_28", NULL} -#define STMT_220 \ +#define STMT_UPGRADE_TO_28 221 +#define STMT_221_INFO {"STMT_UPGRADE_TO_28", NULL} +#define STMT_221 \ "UPDATE NODES SET checksum = (SELECT checksum FROM pristine " \ " WHERE md5_checksum = nodes.checksum) " \ "WHERE EXISTS (SELECT 1 FROM pristine WHERE md5_checksum = nodes.checksum); " \ "PRAGMA user_version = 28; " \ "" -#define STMT_UPGRADE_TO_29 221 -#define STMT_221_INFO {"STMT_UPGRADE_TO_29", NULL} -#define STMT_221 \ +#define STMT_UPGRADE_TO_29 222 +#define STMT_222_INFO {"STMT_UPGRADE_TO_29", NULL} +#define STMT_222 \ "DROP TRIGGER IF EXISTS nodes_update_checksum_trigger; " \ "DROP TRIGGER IF EXISTS nodes_insert_trigger; " \ "DROP TRIGGER IF EXISTS nodes_delete_trigger; " \ @@ -2466,9 +2473,9 @@ "PRAGMA user_version = 29; " \ "" -#define STMT_UPGRADE_TO_30 222 -#define STMT_222_INFO {"STMT_UPGRADE_TO_30", NULL} -#define STMT_222 \ +#define STMT_UPGRADE_TO_30 223 +#define STMT_223_INFO {"STMT_UPGRADE_TO_30", NULL} +#define STMT_223 \ "CREATE UNIQUE INDEX IF NOT EXISTS I_NODES_MOVED " \ "ON NODES (wc_id, moved_to, op_depth); " \ "CREATE INDEX IF NOT EXISTS I_PRISTINE_MD5 ON PRISTINE (md5_checksum); " \ @@ -2476,9 +2483,9 @@ "UPDATE nodes SET file_external=1 WHERE file_external IS NOT NULL; " \ "" -#define STMT_UPGRADE_30_SELECT_CONFLICT_SEPARATE 223 -#define STMT_223_INFO {"STMT_UPGRADE_30_SELECT_CONFLICT_SEPARATE", NULL} -#define STMT_223 \ +#define STMT_UPGRADE_30_SELECT_CONFLICT_SEPARATE 224 +#define STMT_224_INFO {"STMT_UPGRADE_30_SELECT_CONFLICT_SEPARATE", NULL} +#define STMT_224 \ "SELECT wc_id, local_relpath, " \ " conflict_old, conflict_working, conflict_new, prop_reject, tree_conflict_data " \ "FROM actual_node " \ @@ -2490,24 +2497,24 @@ "ORDER by wc_id, local_relpath " \ "" -#define STMT_UPGRADE_30_SET_CONFLICT 224 -#define STMT_224_INFO {"STMT_UPGRADE_30_SET_CONFLICT", NULL} -#define STMT_224 \ +#define STMT_UPGRADE_30_SET_CONFLICT 225 +#define STMT_225_INFO {"STMT_UPGRADE_30_SET_CONFLICT", NULL} +#define STMT_225 \ "UPDATE actual_node SET conflict_data = ?3, conflict_old = NULL, " \ " conflict_working = NULL, conflict_new = NULL, prop_reject = NULL, " \ " tree_conflict_data = NULL " \ "WHERE wc_id = ?1 and local_relpath = ?2 " \ "" -#define STMT_UPGRADE_TO_31_ALTER_TABLE 225 -#define STMT_225_INFO {"STMT_UPGRADE_TO_31_ALTER_TABLE", NULL} -#define STMT_225 \ +#define STMT_UPGRADE_TO_31_ALTER_TABLE 226 +#define STMT_226_INFO {"STMT_UPGRADE_TO_31_ALTER_TABLE", NULL} +#define STMT_226 \ "ALTER TABLE NODES ADD COLUMN inherited_props BLOB; " \ "" -#define STMT_UPGRADE_TO_31_FINALIZE 226 -#define STMT_226_INFO {"STMT_UPGRADE_TO_31_FINALIZE", NULL} -#define STMT_226 \ +#define STMT_UPGRADE_TO_31_FINALIZE 227 +#define STMT_227_INFO {"STMT_UPGRADE_TO_31_FINALIZE", NULL} +#define STMT_227 \ "DROP INDEX IF EXISTS I_ACTUAL_CHANGELIST; " \ "DROP INDEX IF EXISTS I_EXTERNALS_PARENT; " \ "DROP INDEX I_NODES_PARENT; " \ @@ -2519,9 +2526,9 @@ "PRAGMA user_version = 31; " \ "" -#define STMT_UPGRADE_31_SELECT_WCROOT_NODES 227 -#define STMT_227_INFO {"STMT_UPGRADE_31_SELECT_WCROOT_NODES", NULL} -#define STMT_227 \ +#define STMT_UPGRADE_31_SELECT_WCROOT_NODES 228 +#define STMT_228_INFO {"STMT_UPGRADE_31_SELECT_WCROOT_NODES", NULL} +#define STMT_228 \ "SELECT l.wc_id, l.local_relpath FROM nodes as l " \ "LEFT OUTER JOIN nodes as r " \ "ON l.wc_id = r.wc_id " \ @@ -2533,9 +2540,9 @@ " OR (l.repos_path IS NOT (CASE WHEN (r.local_relpath) = '' THEN (CASE WHEN (r.repos_path) = '' THEN (l.local_relpath) WHEN (l.local_relpath) = '' THEN (r.repos_path) ELSE (r.repos_path) || '/' || (l.local_relpath) END) WHEN (r.repos_path) = '' THEN (CASE WHEN (r.local_relpath) = '' THEN (l.local_relpath) WHEN SUBSTR((l.local_relpath), 1, LENGTH(r.local_relpath)) = (r.local_relpath) THEN CASE WHEN LENGTH(r.local_relpath) = LENGTH(l.local_relpath) THEN '' WHEN SUBSTR((l.local_relpath), LENGTH(r.local_relpath)+1, 1) = '/' THEN SUBSTR((l.local_relpath), LENGTH(r.local_relpath)+2) END END) WHEN SUBSTR((l.local_relpath), 1, LENGTH(r.local_relpath)) = (r.local_relpath) THEN CASE WHEN LENGTH(r.local_relpath) = LENGTH(l.local_relpath) THEN (r.repos_path) WHEN SUBSTR((l.local_relpath), LENGTH(r.local_relpath)+1, 1) = '/' THEN (r.repos_path) || SUBSTR((l.local_relpath), LENGTH(r.local_relpath)+1) END END))) " \ "" -#define STMT_UPGRADE_TO_32 228 -#define STMT_228_INFO {"STMT_UPGRADE_TO_32", NULL} -#define STMT_228 \ +#define STMT_UPGRADE_TO_32 229 +#define STMT_229_INFO {"STMT_UPGRADE_TO_32", NULL} +#define STMT_229 \ "DROP INDEX IF EXISTS I_ACTUAL_CHANGELIST; " \ "DROP INDEX IF EXISTS I_EXTERNALS_PARENT; " \ "CREATE INDEX I_EXTERNALS_PARENT ON EXTERNALS (wc_id, parent_relpath); " \ @@ -2588,9 +2595,9 @@ "DROP TABLE ACTUAL_NODE_BACKUP; " \ "" -#define STMT_VERIFICATION_TRIGGERS 229 -#define STMT_229_INFO {"STMT_VERIFICATION_TRIGGERS", NULL} -#define STMT_229 \ +#define STMT_VERIFICATION_TRIGGERS 230 +#define STMT_230_INFO {"STMT_VERIFICATION_TRIGGERS", NULL} +#define STMT_230 \ "CREATE TEMPORARY TRIGGER no_repository_updates BEFORE UPDATE ON repository " \ "BEGIN " \ " SELECT RAISE(FAIL, 'Updates to REPOSITORY are not allowed.'); " \ @@ -2861,6 +2868,7 @@ STMT_227, \ STMT_228, \ STMT_229, \ + STMT_230, \ NULL \ } @@ -3096,5 +3104,6 @@ STMT_227_INFO, \ STMT_228_INFO, \ STMT_229_INFO, \ + STMT_230_INFO, \ {NULL, NULL} \ } diff --git a/contrib/subversion/subversion/libsvn_wc/wc-queries.sql b/contrib/subversion/subversion/libsvn_wc/wc-queries.sql index 0ffe6f07d4e4..d5f7e82557f0 100644 --- a/contrib/subversion/subversion/libsvn_wc/wc-queries.sql +++ b/contrib/subversion/subversion/libsvn_wc/wc-queries.sql @@ -472,6 +472,10 @@ WHERE wc_id = ?1 DELETE FROM lock WHERE repos_id = ?1 AND repos_relpath = ?2 +-- STMT_DELETE_LOCK_RECURSIVELY +DELETE FROM lock +WHERE repos_id = ?1 AND (repos_relpath = ?2 OR IS_STRICT_DESCENDANT_OF(repos_relpath, ?2)) + -- STMT_CLEAR_BASE_NODE_RECURSIVE_DAV_CACHE UPDATE nodes SET dav_cache = NULL WHERE dav_cache IS NOT NULL AND wc_id = ?1 AND op_depth = 0 diff --git a/contrib/subversion/subversion/libsvn_wc/wc_db.c b/contrib/subversion/subversion/libsvn_wc/wc_db.c index 7e1e8777eea7..e41165765d42 100644 --- a/contrib/subversion/subversion/libsvn_wc/wc_db.c +++ b/contrib/subversion/subversion/libsvn_wc/wc_db.c @@ -2086,6 +2086,7 @@ db_base_remove(svn_wc__db_wcroot_t *wcroot, svn_wc__db_t *db, /* For checking conflicts */ svn_boolean_t keep_as_working, svn_boolean_t queue_deletes, + svn_boolean_t remove_locks, svn_revnum_t not_present_revision, svn_skel_t *conflict, svn_skel_t *work_items, @@ -2106,6 +2107,16 @@ db_base_remove(svn_wc__db_wcroot_t *wcroot, wcroot, local_relpath, scratch_pool, scratch_pool)); + if (remove_locks) + { + svn_sqlite__stmt_t *lock_stmt; + + SVN_ERR(svn_sqlite__get_statement(&lock_stmt, wcroot->sdb, + STMT_DELETE_LOCK_RECURSIVELY)); + SVN_ERR(svn_sqlite__bindf(lock_stmt, "is", repos_id, repos_relpath)); + SVN_ERR(svn_sqlite__step_done(lock_stmt)); + } + if (status == svn_wc__db_status_normal && keep_as_working) { @@ -2333,6 +2344,7 @@ svn_wc__db_base_remove(svn_wc__db_t *db, const char *local_abspath, svn_boolean_t keep_as_working, svn_boolean_t queue_deletes, + svn_boolean_t remove_locks, svn_revnum_t not_present_revision, svn_skel_t *conflict, svn_skel_t *work_items, @@ -2349,7 +2361,7 @@ svn_wc__db_base_remove(svn_wc__db_t *db, SVN_WC__DB_WITH_TXN(db_base_remove(wcroot, local_relpath, db, keep_as_working, queue_deletes, - not_present_revision, + remove_locks, not_present_revision, conflict, work_items, scratch_pool), wcroot); @@ -10814,7 +10826,7 @@ commit_node(svn_wc__db_wcroot_t *wcroot, svn_sqlite__stmt_t *lock_stmt; SVN_ERR(svn_sqlite__get_statement(&lock_stmt, wcroot->sdb, - STMT_DELETE_LOCK)); + STMT_DELETE_LOCK_RECURSIVELY)); SVN_ERR(svn_sqlite__bindf(lock_stmt, "is", repos_id, repos_relpath)); SVN_ERR(svn_sqlite__step_done(lock_stmt)); } @@ -11058,7 +11070,7 @@ bump_node_revision(svn_wc__db_wcroot_t *wcroot, revision != new_rev))) { return svn_error_trace(db_base_remove(wcroot, local_relpath, - db, FALSE, FALSE, + db, FALSE, FALSE, FALSE, SVN_INVALID_REVNUM, NULL, NULL, scratch_pool)); } @@ -14978,14 +14990,18 @@ svn_wc__db_verify(svn_wc__db_t *db, svn_error_t * svn_wc__db_bump_format(int *result_format, - const char *wcroot_abspath, + svn_boolean_t *bumped_format, svn_wc__db_t *db, + const char *wcroot_abspath, apr_pool_t *scratch_pool) { svn_sqlite__db_t *sdb; svn_error_t *err; int format; + if (bumped_format) + *bumped_format = FALSE; + /* Do not scan upwards for a working copy root here to prevent accidental * upgrades of any working copies the WCROOT might be nested in. * Just try to open a DB at the specified path instead. */ @@ -15020,7 +15036,10 @@ svn_wc__db_bump_format(int *result_format, SVN_ERR(svn_sqlite__read_schema_version(&format, sdb, scratch_pool)); err = svn_wc__upgrade_sdb(result_format, wcroot_abspath, - sdb, format, scratch_pool); + sdb, format, scratch_pool); + + if (err == SVN_NO_ERROR && bumped_format) + *bumped_format = (*result_format > format); /* Make sure we return a different error than expected for upgrades from entries */ diff --git a/contrib/subversion/subversion/libsvn_wc/wc_db.h b/contrib/subversion/subversion/libsvn_wc/wc_db.h index 154262d7d21a..88e455fb51df 100644 --- a/contrib/subversion/subversion/libsvn_wc/wc_db.h +++ b/contrib/subversion/subversion/libsvn_wc/wc_db.h @@ -702,6 +702,9 @@ svn_wc__db_base_add_not_present_node(svn_wc__db_t *db, (With KEEP_AS_WORKING TRUE, this is a no-op, as everything is automatically shadowed by the created copy) + If REMOVE_LOCKS is TRUE, all locks of this node and any subnodes + are also removed. This is to be done during commit of deleted nodes. + If NOT_PRESENT_REVISION specifies a valid revision a not-present node is installed in BASE node with kind NOT_PRESENT_KIND after deleting. @@ -715,6 +718,7 @@ svn_wc__db_base_remove(svn_wc__db_t *db, const char *local_abspath, svn_boolean_t keep_as_working, svn_boolean_t queue_deletes, + svn_boolean_t remove_locks, svn_revnum_t not_present_revision, svn_skel_t *conflict, svn_skel_t *work_items, @@ -2909,11 +2913,15 @@ svn_wc__db_upgrade_get_repos_id(apr_int64_t *repos_id, * Upgrading subdirectories of a working copy is not supported. * If WCROOT_ABSPATH is not a working copy root SVN_ERR_WC_INVALID_OP_ON_CWD * is returned. + * + * If BUMPED_FORMAT is not NULL, set *BUMPED_FORMAT to TRUE if the format + * was bumped or to FALSE if the wc was already at the resulting format. */ svn_error_t * svn_wc__db_bump_format(int *result_format, - const char *wcroot_abspath, + svn_boolean_t *bumped_format, svn_wc__db_t *db, + const char *wcroot_abspath, apr_pool_t *scratch_pool); /* @} */ diff --git a/contrib/subversion/subversion/libsvn_wc/wc_db_update_move.c b/contrib/subversion/subversion/libsvn_wc/wc_db_update_move.c index fa5afe4f70aa..a8cce76c0c0d 100644 --- a/contrib/subversion/subversion/libsvn_wc/wc_db_update_move.c +++ b/contrib/subversion/subversion/libsvn_wc/wc_db_update_move.c @@ -1988,8 +1988,12 @@ svn_wc__db_update_moved_away_conflict_victim(svn_wc__db_t *db, /* Send all queued up notifications. */ SVN_ERR(svn_wc__db_update_move_list_notify(wcroot, - old_version->peg_rev, - new_version->peg_rev, + (old_version + ? old_version->peg_rev + : SVN_INVALID_REVNUM), + (new_version + ? new_version->peg_rev + : SVN_INVALID_REVNUM), notify_func, notify_baton, scratch_pool)); if (notify_func) @@ -2395,7 +2399,9 @@ svn_wc__db_resolve_delete_raise_moved_away(svn_wc__db_t *db, wcroot); SVN_ERR(svn_wc__db_update_move_list_notify(wcroot, - old_version->peg_rev, + (old_version + ? old_version->peg_rev + : SVN_INVALID_REVNUM), (new_version ? new_version->peg_rev : SVN_INVALID_REVNUM), diff --git a/contrib/subversion/subversion/libsvn_wc/wc_db_wcroot.c b/contrib/subversion/subversion/libsvn_wc/wc_db_wcroot.c index 1091f1b5cc03..21173e50cfa2 100644 --- a/contrib/subversion/subversion/libsvn_wc/wc_db_wcroot.c +++ b/contrib/subversion/subversion/libsvn_wc/wc_db_wcroot.c @@ -434,6 +434,8 @@ svn_wc__db_wcroot_parse_local_abspath(svn_wc__db_wcroot_t **wcroot, svn_boolean_t always_check = FALSE; int wc_format = 0; const char *adm_relpath; + /* Non-NULL if WCROOT is found through a symlink: */ + const char *symlink_wcroot_abspath = NULL; /* ### we need more logic for finding the database (if it is located ### outside of the wcroot) and then managing all of that within DB. @@ -611,6 +613,7 @@ svn_wc__db_wcroot_parse_local_abspath(svn_wc__db_wcroot_t **wcroot, if (found_wcroot) break; + symlink_wcroot_abspath = local_abspath; SVN_ERR(read_link_target(&local_abspath, local_abspath, scratch_pool)); try_symlink_as_dir: @@ -632,6 +635,7 @@ try_symlink_as_dir: local_abspath = svn_dirent_dirname(local_abspath, scratch_pool); moved_upwards = TRUE; + symlink_wcroot_abspath = NULL; /* Is the parent directory recorded in our hash? */ found_wcroot = svn_hash_gets(db->dir_data, local_abspath); @@ -669,7 +673,10 @@ try_symlink_as_dir: (ie. where we found it). */ err = svn_wc__db_pdh_create_wcroot(wcroot, - apr_pstrdup(db->state_pool, local_abspath), + apr_pstrdup(db->state_pool, + symlink_wcroot_abspath + ? symlink_wcroot_abspath + : local_abspath), sdb, wc_id, FORMAT_FROM_SDB, db->verify_format, db->enforce_empty_wq, db->state_pool, scratch_pool); @@ -737,7 +744,10 @@ try_symlink_as_dir: } SVN_ERR(svn_wc__db_pdh_create_wcroot(wcroot, - apr_pstrdup(db->state_pool, local_abspath), + apr_pstrdup(db->state_pool, + symlink_wcroot_abspath + ? symlink_wcroot_abspath + : local_abspath), NULL, UNKNOWN_WC_ID, wc_format, db->verify_format, db->enforce_empty_wq, db->state_pool, scratch_pool)); @@ -747,6 +757,13 @@ try_symlink_as_dir: { const char *dir_relpath; + if (symlink_wcroot_abspath) + { + /* The WCROOT was found through a symlink pointing at the root of + * the WC. Cache the WCROOT under the symlink's path. */ + local_dir_abspath = symlink_wcroot_abspath; + } + /* The subdirectory's relpath is easily computed relative to the wcroot that we just found. */ dir_relpath = compute_relpath(*wcroot, local_dir_abspath, NULL); @@ -809,6 +826,7 @@ try_symlink_as_dir: scratch_pool)); if (resolved_kind == svn_node_dir) { + symlink_wcroot_abspath = original_abspath; SVN_ERR(read_link_target(&local_abspath, original_abspath, scratch_pool)); /* This handle was opened in this function but is not going diff --git a/contrib/subversion/subversion/libsvn_wc/workqueue.c b/contrib/subversion/subversion/libsvn_wc/workqueue.c index ddbac150dcf9..b034d7d124ce 100644 --- a/contrib/subversion/subversion/libsvn_wc/workqueue.c +++ b/contrib/subversion/subversion/libsvn_wc/workqueue.c @@ -143,6 +143,7 @@ run_base_remove(work_item_baton_t *wqb, SVN_ERR(svn_wc__db_base_remove(db, local_abspath, FALSE /* keep_as_working */, TRUE /* queue_deletes */, + FALSE /* remove_locks */, not_present_rev, NULL, NULL, scratch_pool)); diff --git a/contrib/subversion/subversion/svn/cl.h b/contrib/subversion/subversion/svn/cl.h index f7ebee668290..8cc358c9822d 100644 --- a/contrib/subversion/subversion/svn/cl.h +++ b/contrib/subversion/subversion/svn/cl.h @@ -806,23 +806,6 @@ svn_cl__local_style_skip_ancestor(const char *parent_path, const char *path, apr_pool_t *pool); -/* Check that PATH_OR_URL1@REVISION1 is related to PATH_OR_URL2@REVISION2. - * Raise an error if not. - * - * ### Ideally we would also check that they are on different lines of - * history. That is easy in common cases, but to give a correct answer in - * general we need to know the operative revision(s) as well. For example, - * when one location is the branch point from which the other branch was - * copied. - */ -svn_error_t * -svn_cl__check_related_source_and_target(const char *path_or_url1, - const svn_opt_revision_t *revision1, - const char *path_or_url2, - const svn_opt_revision_t *revision2, - svn_client_ctx_t *ctx, - apr_pool_t *pool); - /* If the user is setting a mime-type to mark one of the TARGETS as binary, * as determined by property name PROPNAME and value PROPVAL, then check * whether Subversion's own binary-file detection recognizes the target as diff --git a/contrib/subversion/subversion/svn/conflict-callbacks.c b/contrib/subversion/subversion/svn/conflict-callbacks.c index 096a1892cdec..d5a98ddf6fbb 100644 --- a/contrib/subversion/subversion/svn/conflict-callbacks.c +++ b/contrib/subversion/subversion/svn/conflict-callbacks.c @@ -453,7 +453,7 @@ static const resolver_option_t text_conflict_options[] = -1 }, { "df", N_("show diff"), N_("show all changes made to merged file"), -1 }, - { "r", N_("resolved"), N_("accept merged version of file"), + { "r", N_("mark resolved"), N_("accept merged version of file"), svn_wc_conflict_choose_merged }, { "", "", "", svn_wc_conflict_choose_unspecified }, { "dc", N_("display conflict"), N_("show all conflicts " @@ -473,13 +473,13 @@ static const resolver_option_t text_conflict_options[] = "(same) [theirs-full]"), svn_wc_conflict_choose_theirs_full }, { "", "", "", svn_wc_conflict_choose_unspecified }, - { "p", N_("postpone"), N_("mark the conflict to be resolved later" - " [postpone]"), - svn_wc_conflict_choose_postpone }, { "m", N_("merge"), N_("use internal merge tool to resolve " "conflict"), -1 }, { "l", N_("launch tool"), N_("launch external tool to resolve " "conflict [launch]"), -1 }, + { "p", N_("postpone"), N_("mark the conflict to be resolved later" + " [postpone]"), + svn_wc_conflict_choose_postpone }, { "q", N_("quit resolution"), N_("postpone all remaining conflicts"), svn_wc_conflict_choose_postpone }, { "s", N_("show all options"), N_("show this list (also 'h', '?')"), -1 }, @@ -489,9 +489,6 @@ static const resolver_option_t text_conflict_options[] = /* Resolver options for a property conflict */ static const resolver_option_t prop_conflict_options[] = { - { "p", N_("postpone"), N_("mark the conflict to be resolved later" - " [postpone]"), - svn_wc_conflict_choose_postpone }, { "mf", N_("my version"), N_("accept my version of entire file (even " "non-conflicts) [mine-full]"), svn_wc_conflict_choose_mine_full }, @@ -501,8 +498,11 @@ static const resolver_option_t prop_conflict_options[] = { "dc", N_("display conflict"), N_("show conflicts in this property"), -1 }, { "e", N_("edit property"), N_("change merged property value in an editor" " [edit]"), -1 }, - { "r", N_("resolved"), N_("accept edited version of property"), + { "r", N_("mark resolved"), N_("accept edited version of property"), svn_wc_conflict_choose_merged }, + { "p", N_("postpone"), N_("mark the conflict to be resolved later" + " [postpone]"), + svn_wc_conflict_choose_postpone }, { "q", N_("quit resolution"), N_("postpone all remaining conflicts"), svn_wc_conflict_choose_postpone }, { "h", N_("help"), N_("show this help (also '?')"), -1 }, @@ -512,15 +512,15 @@ static const resolver_option_t prop_conflict_options[] = /* Resolver options for an obstructued addition */ static const resolver_option_t obstructed_add_options[] = { - { "p", N_("postpone"), N_("mark the conflict to be resolved later" - " [postpone]"), - svn_wc_conflict_choose_postpone }, { "mf", N_("my version"), N_("accept pre-existing item (ignore " "upstream addition) [mine-full]"), svn_wc_conflict_choose_mine_full }, { "tf", N_("their version"), N_("accept incoming item (overwrite " "pre-existing item) [theirs-full]"), svn_wc_conflict_choose_theirs_full }, + { "p", N_("postpone"), N_("mark the conflict to be resolved later" + " [postpone]"), + svn_wc_conflict_choose_postpone }, { "q", N_("quit resolution"), N_("postpone all remaining conflicts"), svn_wc_conflict_choose_postpone }, { "h", N_("help"), N_("show this help (also '?')"), -1 }, @@ -530,10 +530,10 @@ static const resolver_option_t obstructed_add_options[] = /* Resolver options for a tree conflict */ static const resolver_option_t tree_conflict_options[] = { + { "r", N_("mark resolved"), N_("accept current working copy state"), + svn_wc_conflict_choose_merged }, { "p", N_("postpone"), N_("resolve the conflict later [postpone]"), svn_wc_conflict_choose_postpone }, - { "r", N_("resolved"), N_("accept current working copy state"), - svn_wc_conflict_choose_merged }, { "q", N_("quit resolution"), N_("postpone all remaining conflicts"), svn_wc_conflict_choose_postpone }, { "h", N_("help"), N_("show this help (also '?')"), -1 }, @@ -542,30 +542,46 @@ static const resolver_option_t tree_conflict_options[] = static const resolver_option_t tree_conflict_options_update_moved_away[] = { - { "p", N_("postpone"), N_("resolve the conflict later [postpone]"), - svn_wc_conflict_choose_postpone }, - { "mc", N_("my side of conflict"), N_("apply update to the move destination" - " [mine-conflict]"), + { "mc", N_("apply update (recommended)"), + N_("apply update to the move destination" + " [mine-conflict]"), svn_wc_conflict_choose_mine_conflict }, - { "r", N_("resolved"), N_("mark resolved " - "(the move will become a copy)"), + { "r", N_("discard update (breaks move)"), N_("discard update, mark " + "resolved, the move will " + "will become a copy"), svn_wc_conflict_choose_merged }, + { "p", N_("postpone"), N_("resolve the conflict later [postpone]"), + svn_wc_conflict_choose_postpone }, { "q", N_("quit resolution"), N_("postpone all remaining conflicts"), svn_wc_conflict_choose_postpone }, { "h", N_("help"), N_("show this help (also '?')"), -1 }, { NULL } }; -static const resolver_option_t tree_conflict_options_update_deleted[] = +static const resolver_option_t tree_conflict_options_update_edit_moved_away[] = { + { "mc", N_("apply update to move destination"), + N_("apply incoming update to move destination" + " [mine-conflict]"), + svn_wc_conflict_choose_mine_conflict }, { "p", N_("postpone"), N_("resolve the conflict later [postpone]"), svn_wc_conflict_choose_postpone }, - { "mc", N_("my side of conflict"), N_("keep any moves affected " - "by this deletion [mine-conflict]"), + { "q", N_("quit resolution"), N_("postpone all remaining conflicts"), + svn_wc_conflict_choose_postpone }, + { "h", N_("help"), N_("show this help (also '?')"), -1 }, + { NULL } +}; + +static const resolver_option_t tree_conflict_options_update_deleted[] = +{ + { "mc", N_("keep affected local moves"), N_("keep any local moves affected " + "by this deletion [mine-conflict]"), svn_wc_conflict_choose_mine_conflict }, - { "r", N_("resolved"), N_("mark resolved (any affected moves will " - "become copies)"), + { "r", N_("mark resolved (breaks moves)"), N_("mark resolved, any affected " + "moves will become copies"), svn_wc_conflict_choose_merged }, + { "p", N_("postpone"), N_("resolve the conflict later [postpone]"), + svn_wc_conflict_choose_postpone }, { "q", N_("quit resolution"), N_("postpone all remaining conflicts"), svn_wc_conflict_choose_postpone }, { "h", N_("help"), N_("show this help (also '?')"), -1 }, @@ -574,14 +590,14 @@ static const resolver_option_t tree_conflict_options_update_deleted[] = static const resolver_option_t tree_conflict_options_update_replaced[] = { - { "p", N_("postpone"), N_("resolve the conflict later [postpone]"), - svn_wc_conflict_choose_postpone }, - { "mc", N_("my side of conflict"), N_("keep any moves affected by this " - "replacement [mine-conflict]"), + { "mc", N_("keep affected local moves"), N_("keep any moves affected by this " + "replacement [mine-conflict]"), svn_wc_conflict_choose_mine_conflict }, - { "r", N_("resolved"), N_("mark resolved (any affected moves will " - "become copies)"), + { "r", N_("mark resolved (breaks moves)"), N_("mark resolved (any affected " + "moves will become copies)"), svn_wc_conflict_choose_merged }, + { "p", N_("postpone"), N_("resolve the conflict later [postpone]"), + svn_wc_conflict_choose_postpone }, { "q", N_("quit resolution"), N_("postpone all remaining conflicts"), svn_wc_conflict_choose_postpone }, { "h", N_("help"), N_("show this help (also '?')"), -1 }, @@ -925,7 +941,7 @@ handle_text_conflict(svn_wc_conflict_result_t *result, SVN_ERR(svn_cmdline_fprintf( stderr, iterpool, _("Invalid option; use diff/edit/merge/launch " - "before choosing 'resolved'.\n\n"))); + "before choosing 'mark resolved'.\n\n"))); continue; } @@ -1078,7 +1094,12 @@ handle_tree_conflict(svn_wc_conflict_result_t *result, desc->operation == svn_wc_operation_switch) { if (desc->reason == svn_wc_conflict_reason_moved_away) - tc_opts = tree_conflict_options_update_moved_away; + { + if (desc->action == svn_wc_conflict_action_edit) + tc_opts = tree_conflict_options_update_edit_moved_away; + else + tc_opts = tree_conflict_options_update_moved_away; + } else if (desc->reason == svn_wc_conflict_reason_deleted) tc_opts = tree_conflict_options_update_deleted; else if (desc->reason == svn_wc_conflict_reason_replaced) diff --git a/contrib/subversion/subversion/svn/file-merge.c b/contrib/subversion/subversion/svn/file-merge.c index 43ebba920406..c64f5772df45 100644 --- a/contrib/subversion/subversion/svn/file-merge.c +++ b/contrib/subversion/subversion/svn/file-merge.c @@ -655,6 +655,8 @@ merge_chunks(apr_array_header_t **merged_chunk, svn_stringbuf_appendcstr( prompt, _("Select: (1) use their version, (2) use your version,\n" + " (12) their version first, then yours,\n" + " (21) your version first, then theirs,\n" " (e1) edit their version and use the result,\n" " (e2) edit your version and use the result,\n" " (eb) edit both versions and use the result,\n" @@ -679,6 +681,24 @@ merge_chunks(apr_array_header_t **merged_chunk, *merged_chunk = chunk2; break; } + if (strcmp(answer, "12") == 0) + { + *merged_chunk = apr_array_make(result_pool, + chunk1->nelts + chunk2->nelts, + sizeof(svn_stringbuf_t *)); + apr_array_cat(*merged_chunk, chunk1); + apr_array_cat(*merged_chunk, chunk2); + break; + } + if (strcmp(answer, "21") == 0) + { + *merged_chunk = apr_array_make(result_pool, + chunk1->nelts + chunk2->nelts, + sizeof(svn_stringbuf_t *)); + apr_array_cat(*merged_chunk, chunk2); + apr_array_cat(*merged_chunk, chunk1); + break; + } else if (strcmp(answer, "p") == 0) { *merged_chunk = NULL; diff --git a/contrib/subversion/subversion/svn/merge-cmd.c b/contrib/subversion/subversion/svn/merge-cmd.c index c14f769a8d26..17507a2cbaee 100644 --- a/contrib/subversion/subversion/svn/merge-cmd.c +++ b/contrib/subversion/subversion/svn/merge-cmd.c @@ -101,15 +101,6 @@ run_merge(svn_boolean_t two_sources_specified, && (first_range_end.kind == svn_opt_revision_unspecified)) { ranges_to_merge = NULL; - - /* This must be a 'sync' merge so check branch relationship. */ - if (opt_state->verbose) - SVN_ERR(svn_cmdline_printf( - scratch_pool, _("--- Checking branch relationship\n"))); - SVN_ERR_W(svn_cl__check_related_source_and_target( - sourcepath1, &peg_revision1, - targetpath, &unspecified_revision, ctx, scratch_pool), - _("Source and target must be different but related branches")); } if (opt_state->verbose) diff --git a/contrib/subversion/subversion/svn/mergeinfo-cmd.c b/contrib/subversion/subversion/svn/mergeinfo-cmd.c index a78c42a6c388..41edcdafc730 100644 --- a/contrib/subversion/subversion/svn/mergeinfo-cmd.c +++ b/contrib/subversion/subversion/svn/mergeinfo-cmd.c @@ -297,11 +297,6 @@ svn_cl__mergeinfo(apr_getopt_t *os, tgt_peg_revision.kind = svn_opt_revision_base; } - SVN_ERR_W(svn_cl__check_related_source_and_target(source, &src_peg_revision, - target, &tgt_peg_revision, - ctx, pool), - _("Source and target must be different but related branches")); - src_start_revision = &(opt_state->start_revision); if (opt_state->end_revision.kind == svn_opt_revision_unspecified) src_end_revision = src_start_revision; @@ -311,22 +306,32 @@ svn_cl__mergeinfo(apr_getopt_t *os, /* Do the real work, depending on the requested data flavor. */ if (opt_state->show_revs == svn_cl__show_revs_merged) { + apr_array_header_t *revprops; + + /* We need only revisions number, not revision properties. */ + revprops = apr_array_make(pool, 0, sizeof(const char *)); + SVN_ERR(svn_client_mergeinfo_log2(TRUE, target, &tgt_peg_revision, source, &src_peg_revision, src_start_revision, src_end_revision, print_log_rev, NULL, - TRUE, depth, NULL, ctx, + TRUE, depth, revprops, ctx, pool)); } else if (opt_state->show_revs == svn_cl__show_revs_eligible) { + apr_array_header_t *revprops; + + /* We need only revisions number, not revision properties. */ + revprops = apr_array_make(pool, 0, sizeof(const char *)); + SVN_ERR(svn_client_mergeinfo_log2(FALSE, target, &tgt_peg_revision, source, &src_peg_revision, src_start_revision, src_end_revision, print_log_rev, NULL, - TRUE, depth, NULL, ctx, + TRUE, depth, revprops, ctx, pool)); } else diff --git a/contrib/subversion/subversion/svn/svn.c b/contrib/subversion/subversion/svn/svn.c index cbcec87cf07a..5432e8bac086 100644 --- a/contrib/subversion/subversion/svn/svn.c +++ b/contrib/subversion/subversion/svn/svn.c @@ -484,9 +484,19 @@ const svn_opt_subcommand_desc2_t svn_cl__cmd_table[] = {'r', 'q', 'N', opt_depth, opt_force, opt_ignore_externals} }, { "cleanup", svn_cl__cleanup, {0}, N_ - ("Recursively clean up the working copy, removing locks, resuming\n" + ("Recursively clean up the working copy, removing write locks, resuming\n" "unfinished operations, etc.\n" - "usage: cleanup [WCPATH...]\n"), + "usage: cleanup [WCPATH...]\n" + "\n" + " Finish any unfinished business in the working copy at WCPATH, and remove\n" + " write locks (shown as 'L' by the 'svn status' command) from the working\n" + " copy. Usually, this is only necessary if a Subversion client has crashed\n" + " while using the working copy, leaving it in an unusable state.\n" + "\n" + " WARNING: There is no mechanism that will protect write locks still\n" + " being used by other Subversion clients. Running this command\n" + " while another client is using the working copy can corrupt\n" + " the working copy beyond repair!\n"), {opt_merge_cmd} }, { "commit", svn_cl__commit, {"ci"}, @@ -750,18 +760,18 @@ const svn_opt_subcommand_desc2_t svn_cl__cmd_table[] = * (with quotes and newlines removed). */ "Merge changes into a working copy.\n" "usage: 1. merge SOURCE[@REV] [TARGET_WCPATH]\n" -" (the 'automatic' merge)\n" +" (the 'complete' merge)\n" " 2. merge [-c M[,N...] | -r N:M ...] SOURCE[@REV] [TARGET_WCPATH]\n" " (the 'cherry-pick' merge)\n" " 3. merge SOURCE1[@REV1] SOURCE2[@REV2] [TARGET_WCPATH]\n" " (the '2-URL' merge)\n" "\n" " 1. This form, with one source path and no revision range, is called\n" -" an 'automatic' merge:\n" +" a 'complete' merge:\n" "\n" " svn merge SOURCE[@REV] [TARGET_WCPATH]\n" "\n" -" The automatic merge is used for the 'sync' and 'reintegrate' merges\n" +" The complete merge is used for the 'sync' and 'reintegrate' merges\n" " in the 'feature branch' pattern described below. It finds all the\n" " changes on the source branch that have not already been merged to the\n" " target branch, and merges them into the working copy. Merge tracking\n" @@ -900,7 +910,7 @@ const svn_opt_subcommand_desc2_t svn_cl__cmd_table[] = " of 'REV' is the base revision (usually the revision last updated to).\n" "\n" " TARGET_WCPATH is a working copy path; if omitted, '.' is generally\n" -" assumed. The special cases noted above in the 'automatic' merge form\n" +" assumed. The special cases noted above in the 'complete' merge form\n" " also apply here.\n" "\n" " The revision ranges to be merged are specified by the '-r' and/or '-c'\n" @@ -971,7 +981,7 @@ const svn_opt_subcommand_desc2_t svn_cl__cmd_table[] = " The three branches involved can be completely unrelated.\n" "\n" " TARGET_WCPATH is a working copy path; if omitted, '.' is generally\n" -" assumed. The special cases noted above in the 'automatic' merge form\n" +" assumed. The special cases noted above in the 'complete' merge form\n" " also apply here.\n" "\n" " SOURCE1 and/or SOURCE2 can also be specified as a working copy path,\n" @@ -1088,7 +1098,7 @@ const svn_opt_subcommand_desc2_t svn_cl__cmd_table[] = " shows, from left to right:\n" " the youngest common ancestor of the branches;\n" " the latest full merge in either direction, and thus the common base\n" - " that will be used for the next automatic merge;\n" + " that will be used for the next complete merge;\n" " the repository path and revision number of the tip of each branch.\n" "\n" " 2. Print the revision numbers on SOURCE that have been merged to TARGET\n" @@ -1430,9 +1440,10 @@ const svn_opt_subcommand_desc2_t svn_cl__cmd_table[] = " ' ' no modifications\n" " 'C' Conflicted\n" " 'M' Modified\n" - " Third column: Whether the working copy directory is locked\n" - " ' ' not locked\n" - " 'L' locked\n" + " Third column: Whether the working copy is locked for writing by\n" + " another Subversion client modifying the working copy\n" + " ' ' not locked for writing\n" + " 'L' locked for writing\n" " Fourth column: Scheduled commit will contain addition-with-history\n" " ' ' no history scheduled with commit\n" " '+' history scheduled with commit\n" @@ -1440,16 +1451,16 @@ const svn_opt_subcommand_desc2_t svn_cl__cmd_table[] = " ' ' normal\n" " 'S' the item has a Switched URL relative to the parent\n" " 'X' a versioned file created by an eXternals definition\n" - " Sixth column: Repository lock token\n" + " Sixth column: Whether the item is locked in repository for exclusive commit\n" " (without -u)\n" - " ' ' no lock token\n" - " 'K' lock token present\n" + " ' ' not locked by this working copy\n" + " 'K' locked by this working copy, but lock might be stolen or broken\n" " (with -u)\n" - " ' ' not locked in repository, no lock token\n" - " 'K' locked in repository, lock toKen present\n" - " 'O' locked in repository, lock token in some Other working copy\n" - " 'T' locked in repository, lock token present but sTolen\n" - " 'B' not locked in repository, lock token present but Broken\n" + " ' ' not locked in repository, not locked by this working copy\n" + " 'K' locked in repository, lock owned by this working copy\n" + " 'O' locked in repository, lock owned by another working copy\n" + " 'T' locked in repository, lock owned by this working copy was stolen\n" + " 'B' not locked in repository, lock owned by this working copy is broken\n" " Seventh column: Whether the item is the victim of a tree conflict\n" " ' ' normal\n" " 'C' tree-Conflicted\n" diff --git a/contrib/subversion/subversion/svn/util.c b/contrib/subversion/subversion/svn/util.c index e67d72ff8aaf..b167319a66cd 100644 --- a/contrib/subversion/subversion/svn/util.c +++ b/contrib/subversion/subversion/svn/util.c @@ -1108,46 +1108,6 @@ svn_cl__local_style_skip_ancestor(const char *parent_path, return svn_dirent_local_style(relpath ? relpath : path, pool); } -/* Return a string of the form "PATH_OR_URL@REVISION". */ -static const char * -path_for_display(const char *path_or_url, - const svn_opt_revision_t *revision, - apr_pool_t *pool) -{ - const char *rev_str = svn_opt__revision_to_string(revision, pool); - - if (! svn_path_is_url(path_or_url)) - path_or_url = svn_dirent_local_style(path_or_url, pool); - return apr_psprintf(pool, "%s@%s", path_or_url, rev_str); -} - -svn_error_t * -svn_cl__check_related_source_and_target(const char *path_or_url1, - const svn_opt_revision_t *revision1, - const char *path_or_url2, - const svn_opt_revision_t *revision2, - svn_client_ctx_t *ctx, - apr_pool_t *pool) -{ - const char *ancestor_url; - svn_revnum_t ancestor_rev; - - SVN_ERR(svn_client__youngest_common_ancestor( - &ancestor_url, &ancestor_rev, - path_or_url1, revision1, path_or_url2, revision2, - ctx, pool, pool)); - - if (ancestor_url == NULL) - { - return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL, - _("Source and target have no common ancestor: " - "'%s' and '%s'"), - path_for_display(path_or_url1, revision1, pool), - path_for_display(path_or_url2, revision2, pool)); - } - return SVN_NO_ERROR; -} - svn_error_t * svn_cl__propset_print_binary_mime_type_warning(apr_array_header_t *targets, const char *propname, diff --git a/contrib/subversion/subversion/svnadmin/svnadmin.c b/contrib/subversion/subversion/svnadmin/svnadmin.c index 65ff9712716c..2a9d63ed65e2 100644 --- a/contrib/subversion/subversion/svnadmin/svnadmin.c +++ b/contrib/subversion/subversion/svnadmin/svnadmin.c @@ -685,6 +685,18 @@ subcommand_create(apr_getopt_t *os, void *baton, apr_pool_t *pool) svn_hash_sets(fs_config, SVN_FS_CONFIG_PRE_1_8_COMPATIBLE, "1"); } + if (opt_state->compatible_version + && ! svn_version__at_least(opt_state->compatible_version, 1, 1, 0) + /* ### TODO: this NULL check hard-codes knowledge of the library's + default fs-type value */ + && (opt_state->fs_type == NULL + || !strcmp(opt_state->fs_type, SVN_FS_TYPE_FSFS))) + { + return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL, + _("Repositories compatible with 1.0.x must use " + "--fs-type=bdb")); + } + SVN_ERR(svn_repos_create(&repos, opt_state->repository_path, NULL, NULL, NULL, fs_config, pool)); svn_fs_set_warning_func(svn_repos_fs(repos), warning_func, NULL); diff --git a/contrib/subversion/subversion/svnlook/svnlook.c b/contrib/subversion/subversion/svnlook/svnlook.c index e619450628ec..0006a8fef185 100644 --- a/contrib/subversion/subversion/svnlook/svnlook.c +++ b/contrib/subversion/subversion/svnlook/svnlook.c @@ -57,6 +57,7 @@ #include "private/svn_diff_private.h" #include "private/svn_cmdline_private.h" #include "private/svn_fspath.h" +#include "private/svn_io_private.h" #include "svn_private_config.h" @@ -983,12 +984,21 @@ print_diff_tree(svn_stream_t *out_stream, SVN_ERR(generate_label(&new_label, root, path, pool)); /* We deal in streams, but svn_io_run_diff2() deals in file - handles, unfortunately, so we need to make these temporary - files, and then copy the contents to our stream. */ - SVN_ERR(svn_io_open_unique_file3(&outfile, &outfilename, NULL, - svn_io_file_del_on_pool_cleanup, pool, pool)); - SVN_ERR(svn_io_open_unique_file3(&errfile, &errfilename, NULL, - svn_io_file_del_on_pool_cleanup, pool, pool)); + handles, so we may need to make temporary files and then + copy the contents to our stream. */ + outfile = svn_stream__aprfile(out_stream); + if (outfile) + outfilename = NULL; + else + SVN_ERR(svn_io_open_unique_file3(&outfile, &outfilename, NULL, + svn_io_file_del_on_pool_cleanup, pool, pool)); + SVN_ERR(svn_stream_for_stderr(&err_stream, pool)); + errfile = svn_stream__aprfile(err_stream); + if (errfile) + errfilename = NULL; + else + SVN_ERR(svn_io_open_unique_file3(&errfile, &errfilename, NULL, + svn_io_file_del_on_pool_cleanup, pool, pool)); SVN_ERR(svn_io_run_diff2(".", diff_cmd_argv, @@ -998,21 +1008,25 @@ print_diff_tree(svn_stream_t *out_stream, &exitcode, outfile, errfile, c->diff_cmd, pool)); - SVN_ERR(svn_io_file_close(outfile, pool)); - SVN_ERR(svn_io_file_close(errfile, pool)); - /* Now, open and copy our files to our output streams. */ - SVN_ERR(svn_stream_for_stderr(&err_stream, pool)); - SVN_ERR(svn_stream_open_readonly(&stream, outfilename, - pool, pool)); - SVN_ERR(svn_stream_copy3(stream, - svn_stream_disown(out_stream, pool), - NULL, NULL, pool)); - SVN_ERR(svn_stream_open_readonly(&stream, errfilename, - pool, pool)); - SVN_ERR(svn_stream_copy3(stream, - svn_stream_disown(err_stream, pool), - NULL, NULL, pool)); + if (outfilename) + { + SVN_ERR(svn_io_file_close(outfile, pool)); + SVN_ERR(svn_stream_open_readonly(&stream, outfilename, + pool, pool)); + SVN_ERR(svn_stream_copy3(stream, + svn_stream_disown(out_stream, pool), + NULL, NULL, pool)); + } + if (errfilename) + { + SVN_ERR(svn_io_file_close(errfile, pool)); + SVN_ERR(svn_stream_open_readonly(&stream, errfilename, + pool, pool)); + SVN_ERR(svn_stream_copy3(stream, + svn_stream_disown(err_stream, pool), + NULL, NULL, pool)); + } SVN_ERR(svn_stream_printf_from_utf8(out_stream, encoding, pool, "\n")); diff --git a/contrib/subversion/subversion/svnserve/serve.c b/contrib/subversion/subversion/svnserve/serve.c index 9e49bdded725..6b66b199f266 100644 --- a/contrib/subversion/subversion/svnserve/serve.c +++ b/contrib/subversion/subversion/svnserve/serve.c @@ -1441,6 +1441,7 @@ static svn_error_t *commit(svn_ra_svn_conn_t *conn, apr_pool_t *pool, if (lock_tokens && lock_tokens->nelts) SVN_CMD_ERR(add_lock_tokens(conn, lock_tokens, b, pool)); + /* Ignore LOG_MSG, per the protocol. See ra_svn_commit(). */ if (revprop_list) SVN_ERR(svn_ra_svn__parse_proplist(revprop_list, pool, &revprop_table)); else diff --git a/contrib/subversion/win-tests.py b/contrib/subversion/win-tests.py index 04723bdfabf4..62afe6c2c7ce 100644 --- a/contrib/subversion/win-tests.py +++ b/contrib/subversion/win-tests.py @@ -25,7 +25,7 @@ For a list of options, run this script with the --help option. """ # $HeadURL: http://svn.apache.org/repos/asf/subversion/branches/1.8.x/win-tests.py $ -# $LastChangedRevision: 1467191 $ +# $LastChangedRevision: 1492044 $ import os, sys, subprocess import filecmp @@ -600,6 +600,12 @@ class Httpd: def _create_dontdothat_file(self): "Create empty mime.types file" + # If the tests have not previously been run or were cleaned + # up, then 'svn-test-work' does not exist yet. + parent_dir = os.path.dirname(self.dontdothat_file) + if not os.path.exists(parent_dir): + os.makedirs(parent_dir) + fp = open(self.dontdothat_file, 'w') fp.write('[recursive-actions]\n') fp.write('/ = deny\n') diff --git a/contrib/tcpdump/tcpdump.c b/contrib/tcpdump/tcpdump.c index 7cfcc6868537..48b774df686e 100644 --- a/contrib/tcpdump/tcpdump.c +++ b/contrib/tcpdump/tcpdump.c @@ -71,6 +71,8 @@ extern int SIZE_BUF; #ifdef __FreeBSD__ #include <sys/capability.h> #include <sys/ioccom.h> +#include <sys/types.h> +#include <sys/sysctl.h> #include <net/bpf.h> #include <fcntl.h> #include <libgen.h> @@ -1307,6 +1309,27 @@ main(int argc, char **argv) *cp != '\0') error("%s: %s\n(%s)", device, pcap_statustostr(status), cp); +#ifdef __FreeBSD__ + else if (status == PCAP_ERROR_RFMON_NOTSUP && + strncmp(device, "wlan", 4) == 0) { + char parent[8], newdev[8]; + char sysctl[32]; + size_t s = sizeof(parent); + + snprintf(sysctl, sizeof(sysctl), + "net.wlan.%d.%%parent", atoi(device + 4)); + sysctlbyname(sysctl, parent, &s, NULL, 0); + strlcpy(newdev, device, sizeof(newdev)); + /* Suggest a new wlan device. */ + newdev[strlen(newdev)-1]++; + error("%s is not a monitor mode VAP\n" + "To create a new monitor mode VAP use:\n" + " ifconfig %s create wlandev %s wlanmode " + "monitor\nand use %s as the tcpdump " + "interface", device, newdev, parent, + newdev); + } +#endif else error("%s: %s", device, pcap_statustostr(status)); diff --git a/etc/Makefile b/etc/Makefile index f509a19c388e..6e2a716cbcaf 100644 --- a/etc/Makefile +++ b/etc/Makefile @@ -22,6 +22,7 @@ BIN1= crontab \ hosts.equiv \ inetd.conf \ libalias.conf \ + libmap.conf \ login.access \ login.conf \ mac.conf \ diff --git a/etc/devd/usb.conf b/etc/devd/usb.conf index 9aaa6362027b..577fc64fde04 100644 --- a/etc/devd/usb.conf +++ b/etc/devd/usb.conf @@ -8,72 +8,6 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x05ac"; - match "product" "0x1290"; - match "intclass" "0xff"; - match "intsubclass" "0xfd"; - match "intprotocol" "0x01"; - action "kldload -n if_ipheth"; -}; - -nomatch 32 { - match "bus" "uhub[0-9]+"; - match "mode" "host"; - match "vendor" "0x05ac"; - match "product" "0x1292"; - match "intclass" "0xff"; - match "intsubclass" "0xfd"; - match "intprotocol" "0x01"; - action "kldload -n if_ipheth"; -}; - -nomatch 32 { - match "bus" "uhub[0-9]+"; - match "mode" "host"; - match "vendor" "0x05ac"; - match "product" "0x1294"; - match "intclass" "0xff"; - match "intsubclass" "0xfd"; - match "intprotocol" "0x01"; - action "kldload -n if_ipheth"; -}; - -nomatch 32 { - match "bus" "uhub[0-9]+"; - match "mode" "host"; - match "vendor" "0x05ac"; - match "product" "0x1297"; - match "intclass" "0xff"; - match "intsubclass" "0xfd"; - match "intprotocol" "0x01"; - action "kldload -n if_ipheth"; -}; - -nomatch 32 { - match "bus" "uhub[0-9]+"; - match "mode" "host"; - match "vendor" "0x05ac"; - match "product" "0x12a0"; - match "intclass" "0xff"; - match "intsubclass" "0xfd"; - match "intprotocol" "0x01"; - action "kldload -n if_ipheth"; -}; - -nomatch 32 { - match "bus" "uhub[0-9]+"; - match "mode" "host"; - match "vendor" "0x05ac"; - match "product" "0x12a8"; - match "intclass" "0xff"; - match "intsubclass" "0xfd"; - match "intprotocol" "0x01"; - action "kldload -n if_ipheth"; -}; - -nomatch 32 { - match "bus" "uhub[0-9]+"; - match "mode" "host"; match "vendor" "0x0104"; match "product" "0x00be"; action "kldload -n uipaq"; @@ -2938,6 +2872,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x1004"; + match "product" "0x618f"; + action "kldload -n u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x100d"; match "product" "(0x9031|0x9032)"; action "kldload -n if_run"; @@ -4042,6 +3984,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x17ef"; + match "product" "0x7203"; + action "kldload -n if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x17f4"; match "product" "0xaaaa"; action "kldload -n uslcom"; @@ -4826,6 +4776,16 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x05ac"; + match "intclass" "0xff"; + match "intsubclass" "0xfd"; + match "intprotocol" "0x01"; + action "kldload -n if_ipheth"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x0a5c"; match "intclass" "0xff"; match "intsubclass" "0x01"; @@ -4976,5 +4936,5 @@ nomatch 32 { action "kldload -n umass"; }; -# 2480 USB entries processed +# 2477 USB entries processed diff --git a/etc/libmap.conf b/etc/libmap.conf new file mode 100644 index 000000000000..b2c91b29f777 --- /dev/null +++ b/etc/libmap.conf @@ -0,0 +1,2 @@ +# $FreeBSD$ +includedir /usr/local/etc/libmap.d diff --git a/etc/mtree/BSD.usr.dist b/etc/mtree/BSD.usr.dist index 98e89b90bcf4..339ae550c55d 100644 --- a/etc/mtree/BSD.usr.dist +++ b/etc/mtree/BSD.usr.dist @@ -38,6 +38,8 @@ .. lint .. + pkgconfig + .. .. libexec bsdinstall diff --git a/etc/network.subr b/etc/network.subr index 3c26b1347ff3..3b13f99dba8f 100644 --- a/etc/network.subr +++ b/etc/network.subr @@ -113,9 +113,18 @@ ifconfig_up() # backward compatibility: $ipv6_enable case $ipv6_enable in [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) - if ! checkyesno ipv6_gateway_enable; then - _ipv6_opts="${_ipv6_opts} accept_rtadv" - fi + case $1 in + bridge[0-9]*) + # No accept_rtadv by default on if_bridge(4) + # to avoid a conflict with the member + # interfaces. + ;; + *) + if ! checkyesno ipv6_gateway_enable; then + _ipv6_opts="${_ipv6_opts} accept_rtadv" + fi + ;; + esac ;; esac @@ -550,9 +559,18 @@ ipv6_autoconfif() [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) if checkyesno ipv6_gateway_enable; then return 1 - else - return 0 fi + case $1 in + bridge[0-9]*) + # No accept_rtadv by default on if_bridge(4) + # to avoid a conflict with the member + # interfaces. + return 1 + ;; + *) + return 0 + ;; + esac ;; esac @@ -721,9 +739,14 @@ ifalias() # ifalias_expand_addr() { + local _af _action - afexists $1 || return - ifalias_expand_addr_$1 $2 $3 + _af=$1 + _action=$2 + shift 2 + + afexists $_af || return + ifalias_expand_addr_$_af $_action $* } # ifalias_expand_addr_inet action addr @@ -731,19 +754,34 @@ ifalias_expand_addr() # ifalias_expand_addr_inet() { - local _action _arg _cidr _cidr_addr + local _action _arg _cidr _cidr_addr _exargs local _ipaddr _plen _range _iphead _iptail _iplow _iphigh _ipcount local _retstr _c _action=$1 _arg=$2 + shift 2 + _exargs=$* _retstr= - case $_action:$_arg in - *:*--*) return ;; # invalid - tmp:*) echo $_arg && return ;; # already expanded - tmp:*-*) _action="alias" ;; # to be expanded - *:*-*) ;; # to be expanded - *:*) echo inet $_arg && return ;; # already expanded + case $_action:$_arg:$_exargs in + *:*--*) return ;; # invalid + tmp:*[0-9]-[0-9]*:*) # to be expanded + _action="alias" + ;; + *:*[0-9]-[0-9]*:*) # to be expanded + ;; + tmp:*:*netmask*) # already expanded w/ netmask option + echo ${_arg%/[0-9]*} $_exargs && return + ;; + tmp:*:*) # already expanded w/o netmask option + echo $_arg $_exargs && return + ;; + *:*:*netmask*) # already expanded w/ netmask option + echo inet ${_arg%/[0-9]*} $_exargs && return + ;; + *:*:*) # already expanded w/o netmask option + echo inet $_arg $_exargs && return + ;; esac for _cidr in $_arg; do @@ -796,7 +834,7 @@ ifalias_expand_addr_inet() done for _c in $_retstr; do - ifalias_expand_addr_inet $_action $_c + ifalias_expand_addr_inet $_action $_c $_exargs done } @@ -805,20 +843,35 @@ ifalias_expand_addr_inet() # ifalias_expand_addr_inet6() { - local _action _arg _cidr _cidr_addr + local _action _arg _cidr _cidr_addr _exargs local _ipaddr _plen _ipleft _ipright _iplow _iphigh _ipcount local _ipv4part local _retstr _c _action=$1 _arg=$2 + shift 2 + _exargs=$* _retstr= - case $_action:$_arg in - *:*--*) return ;; # invalid - tmp:*) echo $_arg && return ;; - tmp:*-*) _action="alias" ;; - *:*-*) ;; - *:*) echo inet6 $_arg && return ;; + case $_action:$_arg:$_exargs in + *:*--*:*) return ;; # invalid + tmp:*[0-9a-zA-Z]-[0-9a-zA-Z]*:*)# to be expanded + _action="alias" + ;; + *:*[0-9a-zA-Z]-[0-9a-zA-Z]*:*) # to be expanded + ;; + tmp:*:*prefixlen*) # already expanded w/ prefixlen option + echo ${_arg%/[0-9]*} $_exargs && return + ;; + tmp:*:*) # already expanded w/o prefixlen option + echo $_arg $_exargs && return + ;; + *:*:*prefixlen*) # already expanded w/ prefixlen option + echo inet6 ${_arg%/[0-9]*} $_exargs && return + ;; + *:*:*) # already expanded w/o prefixlen option + echo inet6 $_arg $_exargs && return + ;; esac for _cidr in $_arg; do @@ -872,7 +925,7 @@ ifalias_expand_addr_inet6() fi for _c in $_retstr; do - ifalias_expand_addr_inet6 $_action $_c + ifalias_expand_addr_inet6 $_action $_c $_exargs done else # v4mapped/v4compat should handle as an IPv4 alias @@ -888,7 +941,7 @@ ifalias_expand_addr_inet6() _retstr=`ifalias_expand_addr_inet \ tmp ${_ipv4part}${_plen:+/}${_plen}` for _c in $_retstr; do - ifalias_expand_addr_inet $_action $_c + ifalias_expand_addr_inet $_action $_c $_exargs done fi done diff --git a/gnu/usr.bin/patch/Makefile b/gnu/usr.bin/patch/Makefile index 76d28e839a3c..3f26cec66787 100644 --- a/gnu/usr.bin/patch/Makefile +++ b/gnu/usr.bin/patch/Makefile @@ -2,14 +2,14 @@ .include <bsd.own.mk> -.if ${MK_BSD_PATCH} == "yes" +.if ${MK_GNU_PATCH} == "yes" +PROG= patch +.else PROG= gnupatch CLEANFILES+= gnupatch.1 gnupatch.1: patch.1 cp ${.ALLSRC} ${.TARGET} -.else -PROG= patch .endif SRCS= backupfile.c inp.c patch.c pch.c util.c version.c diff --git a/lib/libc/arm/gen/sigsetjmp.S b/lib/libc/arm/gen/sigsetjmp.S index 320c40da2e05..79f1f9d4cebe 100644 --- a/lib/libc/arm/gen/sigsetjmp.S +++ b/lib/libc/arm/gen/sigsetjmp.S @@ -57,8 +57,10 @@ ENTRY(sigsetjmp) WEAK_ALIAS(__siglongjmp, siglongjmp) ENTRY(siglongjmp) - ldr r2, .L_setjmp_magic - ldr r3, [r0] - teq r2, r3 + ldr r2, .L_setjmp_magic /* load magic */ + ldr r3, [r0] /* get magic from jmp_buf */ + bic r3, r3, #(_JB_MAGIC__SETJMP ^ _JB_MAGIC__SETJMP_VFP) + /* ignore VFP-ness of magic */ + teq r2, r3 /* magic correct? */ beq PIC_SYM(_C_LABEL(_longjmp), PLT) b PIC_SYM(_C_LABEL(longjmp), PLT) diff --git a/lib/libc/gen/sysctl.3 b/lib/libc/gen/sysctl.3 index d689b7ccaad3..7d7b90a7442e 100644 --- a/lib/libc/gen/sysctl.3 +++ b/lib/libc/gen/sysctl.3 @@ -735,7 +735,6 @@ privilege may change the value. .It Sy "Second level name Type Changeable" .It "VM_LOADAVG struct loadavg no" .It "VM_TOTAL struct vmtotal no" -.It "VM_PAGEOUT_ALGORITHM integer yes" .It "VM_SWAPPING_ENABLED integer maybe" .It "VM_V_CACHE_MAX integer yes" .It "VM_V_CACHE_MIN integer yes" @@ -754,9 +753,6 @@ The returned data consists of a Return the system wide virtual memory statistics. The returned data consists of a .Va struct vmtotal . -.It Li VM_PAGEOUT_ALGORITHM -0 if the statistics-based page management algorithm is in use -or 1 if the near-LRU algorithm is in use. .It Li VM_SWAPPING_ENABLED 1 if process swapping is enabled or 0 if disabled. This variable is diff --git a/lib/libc/gen/wordexp.c b/lib/libc/gen/wordexp.c index 7d8b8f9044ee..c361980d0ddd 100644 --- a/lib/libc/gen/wordexp.c +++ b/lib/libc/gen/wordexp.c @@ -251,7 +251,8 @@ we_check(const char *words, int flags) while ((c = *words++) != '\0') { switch (c) { case '\\': - quote ^= 1; + if (squote == 0) + quote ^= 1; continue; case '\'': if (quote + dquote == 0) diff --git a/lib/libc/sys/kqueue.2 b/lib/libc/sys/kqueue.2 index 6ae79143d621..ed3a8adfa730 100644 --- a/lib/libc/sys/kqueue.2 +++ b/lib/libc/sys/kqueue.2 @@ -388,20 +388,25 @@ The process has called .It NOTE_EXEC The process has executed a new process via .Xr execve 2 -or similar call. +or a similar call. .It NOTE_TRACK Follow a process across .Fn fork calls. -The parent process will return with NOTE_TRACK set in the +The parent process registers a new kevent to monitor the child process +using the same .Va fflags -field, while the child process will return with NOTE_CHILD set in +as the original event. +The child process will signal an event with NOTE_CHILD set in .Va fflags and the parent PID in .Va data . -.It NOTE_TRACKERR -This flag is returned if the system was unable to attach an event to -the child process, usually due to resource limitations. +.Pp +If the parent process fails to register a new kevent +.Pq usually due to resource limitations , +it will signal an event with NOTE_TRACKERR set in +.Va fflags , +and the child process will not signal a NOTE_CHILD event. .El .Pp On return, diff --git a/lib/libc/sys/ptrace.2 b/lib/libc/sys/ptrace.2 index 90c45442561e..458ad8dbaf3d 100644 --- a/lib/libc/sys/ptrace.2 +++ b/lib/libc/sys/ptrace.2 @@ -2,7 +2,7 @@ .\" $NetBSD: ptrace.2,v 1.2 1995/02/27 12:35:37 cgd Exp $ .\" .\" This file is in the public domain. -.Dd February 7, 2013 +.Dd July 22, 2013 .Dt PTRACE 2 .Os .Sh NAME @@ -556,6 +556,14 @@ was attempted on a process with no valid register set. was given an invalid value for .Fa pve_entry . This can also be caused by changes to the VM map of the process. +.It +The size (in +.Fa data ) +provided to +.Dv PT_LWPINFO +was less than or equal to zero, or larger than the +.Vt ptrace_lwpinfo +structure known to the kernel. .El .It Bq Er EBUSY .Bl -bullet -compact diff --git a/lib/libfetch/common.c b/lib/libfetch/common.c index 425b6de13145..15d5a25de83b 100644 --- a/lib/libfetch/common.c +++ b/lib/libfetch/common.c @@ -1,5 +1,6 @@ /*- * Copyright (c) 1998-2011 Dag-Erling Smørgrav + * Copyright (c) 2013 Michael Gmelin <freebsd@grem.de> * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -47,6 +48,10 @@ __FBSDID("$FreeBSD$"); #include <string.h> #include <unistd.h> +#ifdef WITH_SSL +#include <openssl/x509v3.h> +#endif + #include "fetch.h" #include "common.h" @@ -317,15 +322,488 @@ fetch_connect(const char *host, int port, int af, int verbose) return (conn); } +#ifdef WITH_SSL +/* + * Convert characters A-Z to lowercase (intentionally avoid any locale + * specific conversions). + */ +static char +fetch_ssl_tolower(char in) +{ + if (in >= 'A' && in <= 'Z') + return (in + 32); + else + return (in); +} + +/* + * isalpha implementation that intentionally avoids any locale specific + * conversions. + */ +static int +fetch_ssl_isalpha(char in) +{ + return ((in >= 'A' && in <= 'Z') || (in >= 'a' && in <= 'z')); +} + +/* + * Check if passed hostnames a and b are equal. + */ +static int +fetch_ssl_hname_equal(const char *a, size_t alen, const char *b, + size_t blen) +{ + size_t i; + + if (alen != blen) + return (0); + for (i = 0; i < alen; ++i) { + if (fetch_ssl_tolower(a[i]) != fetch_ssl_tolower(b[i])) + return (0); + } + return (1); +} + +/* + * Check if domain label is traditional, meaning that only A-Z, a-z, 0-9 + * and '-' (hyphen) are allowed. Hyphens have to be surrounded by alpha- + * numeric characters. Double hyphens (like they're found in IDN a-labels + * 'xn--') are not allowed. Empty labels are invalid. + */ +static int +fetch_ssl_is_trad_domain_label(const char *l, size_t len, int wcok) +{ + size_t i; + + if (!len || l[0] == '-' || l[len-1] == '-') + return (0); + for (i = 0; i < len; ++i) { + if (!isdigit(l[i]) && + !fetch_ssl_isalpha(l[i]) && + !(l[i] == '*' && wcok) && + !(l[i] == '-' && l[i - 1] != '-')) + return (0); + } + return (1); +} + +/* + * Check if host name consists only of numbers. This might indicate an IP + * address, which is not a good idea for CN wildcard comparison. + */ +static int +fetch_ssl_hname_is_only_numbers(const char *hostname, size_t len) +{ + size_t i; + + for (i = 0; i < len; ++i) { + if (!((hostname[i] >= '0' && hostname[i] <= '9') || + hostname[i] == '.')) + return (0); + } + return (1); +} + +/* + * Check if the host name h passed matches the pattern passed in m which + * is usually part of subjectAltName or CN of a certificate presented to + * the client. This includes wildcard matching. The algorithm is based on + * RFC6125, sections 6.4.3 and 7.2, which clarifies RFC2818 and RFC3280. + */ +static int +fetch_ssl_hname_match(const char *h, size_t hlen, const char *m, + size_t mlen) +{ + int delta, hdotidx, mdot1idx, wcidx; + const char *hdot, *mdot1, *mdot2; + const char *wc; /* wildcard */ + + if (!(h && *h && m && *m)) + return (0); + if ((wc = strnstr(m, "*", mlen)) == NULL) + return (fetch_ssl_hname_equal(h, hlen, m, mlen)); + wcidx = wc - m; + /* hostname should not be just dots and numbers */ + if (fetch_ssl_hname_is_only_numbers(h, hlen)) + return (0); + /* only one wildcard allowed in pattern */ + if (strnstr(wc + 1, "*", mlen - wcidx - 1) != NULL) + return (0); + /* + * there must be at least two more domain labels and + * wildcard has to be in the leftmost label (RFC6125) + */ + mdot1 = strnstr(m, ".", mlen); + if (mdot1 == NULL || mdot1 < wc || (mlen - (mdot1 - m)) < 4) + return (0); + mdot1idx = mdot1 - m; + mdot2 = strnstr(mdot1 + 1, ".", mlen - mdot1idx - 1); + if (mdot2 == NULL || (mlen - (mdot2 - m)) < 2) + return (0); + /* hostname must contain a dot and not be the 1st char */ + hdot = strnstr(h, ".", hlen); + if (hdot == NULL || hdot == h) + return (0); + hdotidx = hdot - h; + /* + * host part of hostname must be at least as long as + * pattern it's supposed to match + */ + if (hdotidx < mdot1idx) + return (0); + /* + * don't allow wildcards in non-traditional domain names + * (IDN, A-label, U-label...) + */ + if (!fetch_ssl_is_trad_domain_label(h, hdotidx, 0) || + !fetch_ssl_is_trad_domain_label(m, mdot1idx, 1)) + return (0); + /* match domain part (part after first dot) */ + if (!fetch_ssl_hname_equal(hdot, hlen - hdotidx, mdot1, + mlen - mdot1idx)) + return (0); + /* match part left of wildcard */ + if (!fetch_ssl_hname_equal(h, wcidx, m, wcidx)) + return (0); + /* match part right of wildcard */ + delta = mdot1idx - wcidx - 1; + if (!fetch_ssl_hname_equal(hdot - delta, delta, + mdot1 - delta, delta)) + return (0); + /* all tests succeded, it's a match */ + return (1); +} + +/* + * Get numeric host address info - returns NULL if host was not an IP + * address. The caller is responsible for deallocation using + * freeaddrinfo(3). + */ +static struct addrinfo * +fetch_ssl_get_numeric_addrinfo(const char *hostname, size_t len) +{ + struct addrinfo hints, *res; + char *host; + + host = (char *)malloc(len + 1); + memcpy(host, hostname, len); + host[len] = '\0'; + memset(&hints, 0, sizeof(hints)); + hints.ai_family = PF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + hints.ai_protocol = 0; + hints.ai_flags = AI_NUMERICHOST; + /* port is not relevant for this purpose */ + getaddrinfo(host, "443", &hints, &res); + free(host); + return res; +} + +/* + * Compare ip address in addrinfo with address passes. + */ +static int +fetch_ssl_ipaddr_match_bin(const struct addrinfo *lhost, const char *rhost, + size_t rhostlen) +{ + const void *left; + + if (lhost->ai_family == AF_INET && rhostlen == 4) { + left = (void *)&((struct sockaddr_in*)(void *) + lhost->ai_addr)->sin_addr.s_addr; +#ifdef INET6 + } else if (lhost->ai_family == AF_INET6 && rhostlen == 16) { + left = (void *)&((struct sockaddr_in6 *)(void *) + lhost->ai_addr)->sin6_addr; +#endif + } else + return (0); + return (!memcmp(left, (const void *)rhost, rhostlen) ? 1 : 0); +} + +/* + * Compare ip address in addrinfo with host passed. If host is not an IP + * address, comparison will fail. + */ +static int +fetch_ssl_ipaddr_match(const struct addrinfo *laddr, const char *r, + size_t rlen) +{ + struct addrinfo *raddr; + int ret; + char *rip; + + ret = 0; + if ((raddr = fetch_ssl_get_numeric_addrinfo(r, rlen)) == NULL) + return 0; /* not a numeric host */ + + if (laddr->ai_family == raddr->ai_family) { + if (laddr->ai_family == AF_INET) { + rip = (char *)&((struct sockaddr_in *)(void *) + raddr->ai_addr)->sin_addr.s_addr; + ret = fetch_ssl_ipaddr_match_bin(laddr, rip, 4); +#ifdef INET6 + } else if (laddr->ai_family == AF_INET6) { + rip = (char *)&((struct sockaddr_in6 *)(void *) + raddr->ai_addr)->sin6_addr; + ret = fetch_ssl_ipaddr_match_bin(laddr, rip, 16); +#endif + } + + } + freeaddrinfo(raddr); + return (ret); +} + +/* + * Verify server certificate by subjectAltName. + */ +static int +fetch_ssl_verify_altname(STACK_OF(GENERAL_NAME) *altnames, + const char *host, struct addrinfo *ip) +{ + const GENERAL_NAME *name; + size_t nslen; + int i; + const char *ns; + + for (i = 0; i < sk_GENERAL_NAME_num(altnames); ++i) { +#if OPENSSL_VERSION_NUMBER < 0x10000000L + /* + * This is a workaround, since the following line causes + * alignment issues in clang: + * name = sk_GENERAL_NAME_value(altnames, i); + * OpenSSL explicitly warns not to use those macros + * directly, but there isn't much choice (and there + * shouldn't be any ill side effects) + */ + name = (GENERAL_NAME *)SKM_sk_value(void, altnames, i); +#else + name = sk_GENERAL_NAME_value(altnames, i); +#endif + ns = (const char *)ASN1_STRING_data(name->d.ia5); + nslen = (size_t)ASN1_STRING_length(name->d.ia5); + + if (name->type == GEN_DNS && ip == NULL && + fetch_ssl_hname_match(host, strlen(host), ns, nslen)) + return (1); + else if (name->type == GEN_IPADD && ip != NULL && + fetch_ssl_ipaddr_match_bin(ip, ns, nslen)) + return (1); + } + return (0); +} + +/* + * Verify server certificate by CN. + */ +static int +fetch_ssl_verify_cn(X509_NAME *subject, const char *host, + struct addrinfo *ip) +{ + ASN1_STRING *namedata; + X509_NAME_ENTRY *nameentry; + int cnlen, lastpos, loc, ret; + unsigned char *cn; + + ret = 0; + lastpos = -1; + loc = -1; + cn = NULL; + /* get most specific CN (last entry in list) and compare */ + while ((lastpos = X509_NAME_get_index_by_NID(subject, + NID_commonName, lastpos)) != -1) + loc = lastpos; + + if (loc > -1) { + nameentry = X509_NAME_get_entry(subject, loc); + namedata = X509_NAME_ENTRY_get_data(nameentry); + cnlen = ASN1_STRING_to_UTF8(&cn, namedata); + if (ip == NULL && + fetch_ssl_hname_match(host, strlen(host), cn, cnlen)) + ret = 1; + else if (ip != NULL && fetch_ssl_ipaddr_match(ip, cn, cnlen)) + ret = 1; + OPENSSL_free(cn); + } + return (ret); +} + +/* + * Verify that server certificate subjectAltName/CN matches + * hostname. First check, if there are alternative subject names. If yes, + * those have to match. Only if those don't exist it falls back to + * checking the subject's CN. + */ +static int +fetch_ssl_verify_hname(X509 *cert, const char *host) +{ + struct addrinfo *ip; + STACK_OF(GENERAL_NAME) *altnames; + X509_NAME *subject; + int ret; + + ret = 0; + ip = fetch_ssl_get_numeric_addrinfo(host, strlen(host)); + altnames = X509_get_ext_d2i(cert, NID_subject_alt_name, + NULL, NULL); + + if (altnames != NULL) { + ret = fetch_ssl_verify_altname(altnames, host, ip); + } else { + subject = X509_get_subject_name(cert); + if (subject != NULL) + ret = fetch_ssl_verify_cn(subject, host, ip); + } + + if (ip != NULL) + freeaddrinfo(ip); + if (altnames != NULL) + GENERAL_NAMES_free(altnames); + return (ret); +} + +/* + * Configure transport security layer based on environment. + */ +static void +fetch_ssl_setup_transport_layer(SSL_CTX *ctx, int verbose) +{ + long ssl_ctx_options; + + ssl_ctx_options = SSL_OP_ALL | SSL_OP_NO_TICKET; + if (getenv("SSL_ALLOW_SSL2") == NULL) + ssl_ctx_options |= SSL_OP_NO_SSLv2; + if (getenv("SSL_NO_SSL3") != NULL) + ssl_ctx_options |= SSL_OP_NO_SSLv3; + if (getenv("SSL_NO_TLS1") != NULL) + ssl_ctx_options |= SSL_OP_NO_TLSv1; + if (verbose) + fetch_info("SSL options: %x", ssl_ctx_options); + SSL_CTX_set_options(ctx, ssl_ctx_options); +} + + +/* + * Configure peer verification based on environment. + */ +static int +fetch_ssl_setup_peer_verification(SSL_CTX *ctx, int verbose) +{ + X509_LOOKUP *crl_lookup; + X509_STORE *crl_store; + const char *ca_cert_file, *ca_cert_path, *crl_file; + + if (getenv("SSL_NO_VERIFY_PEER") == NULL) { + ca_cert_file = getenv("SSL_CA_CERT_FILE") != NULL ? + getenv("SSL_CA_CERT_FILE") : "/etc/ssl/cert.pem"; + ca_cert_path = getenv("SSL_CA_CERT_PATH"); + if (verbose) { + fetch_info("Peer verification enabled"); + if (ca_cert_file != NULL) + fetch_info("Using CA cert file: %s", + ca_cert_file); + if (ca_cert_path != NULL) + fetch_info("Using CA cert path: %s", + ca_cert_path); + } + SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, + fetch_ssl_cb_verify_crt); + SSL_CTX_load_verify_locations(ctx, ca_cert_file, + ca_cert_path); + if ((crl_file = getenv("SSL_CRL_FILE")) != NULL) { + if (verbose) + fetch_info("Using CRL file: %s", crl_file); + crl_store = SSL_CTX_get_cert_store(ctx); + crl_lookup = X509_STORE_add_lookup(crl_store, + X509_LOOKUP_file()); + if (crl_lookup == NULL || + !X509_load_crl_file(crl_lookup, crl_file, + X509_FILETYPE_PEM)) { + fprintf(stderr, + "Could not load CRL file %s\n", + crl_file); + return (0); + } + X509_STORE_set_flags(crl_store, + X509_V_FLAG_CRL_CHECK | + X509_V_FLAG_CRL_CHECK_ALL); + } + } + return (1); +} + +/* + * Configure client certificate based on environment. + */ +static int +fetch_ssl_setup_client_certificate(SSL_CTX *ctx, int verbose) +{ + const char *client_cert_file, *client_key_file; + + if ((client_cert_file = getenv("SSL_CLIENT_CERT_FILE")) != NULL) { + client_key_file = getenv("SSL_CLIENT_KEY_FILE") != NULL ? + getenv("SSL_CLIENT_KEY_FILE") : client_cert_file; + if (verbose) { + fetch_info("Using client cert file: %s", + client_cert_file); + fetch_info("Using client key file: %s", + client_key_file); + } + if (SSL_CTX_use_certificate_chain_file(ctx, + client_cert_file) != 1) { + fprintf(stderr, + "Could not load client certificate %s\n", + client_cert_file); + return (0); + } + if (SSL_CTX_use_PrivateKey_file(ctx, client_key_file, + SSL_FILETYPE_PEM) != 1) { + fprintf(stderr, + "Could not load client key %s\n", + client_key_file); + return (0); + } + } + return (1); +} + +/* + * Callback for SSL certificate verification, this is called on server + * cert verification. It takes no decision, but informs the user in case + * verification failed. + */ +int +fetch_ssl_cb_verify_crt(int verified, X509_STORE_CTX *ctx) +{ + X509 *crt; + X509_NAME *name; + char *str; + + str = NULL; + if (!verified) { + if ((crt = X509_STORE_CTX_get_current_cert(ctx)) != NULL && + (name = X509_get_subject_name(crt)) != NULL) + str = X509_NAME_oneline(name, 0, 0); + fprintf(stderr, "Certificate verification failed for %s\n", + str != NULL ? str : "no relevant certificate"); + OPENSSL_free(str); + } + return (verified); +} + +#endif /* * Enable SSL on a connection. */ int -fetch_ssl(conn_t *conn, int verbose) +fetch_ssl(conn_t *conn, const struct url *URL, int verbose) { #ifdef WITH_SSL int ret, ssl_err; + X509_NAME *name; + char *str; /* Init the SSL library and context */ if (!SSL_library_init()){ @@ -339,8 +817,14 @@ fetch_ssl(conn_t *conn, int verbose) conn->ssl_ctx = SSL_CTX_new(conn->ssl_meth); SSL_CTX_set_mode(conn->ssl_ctx, SSL_MODE_AUTO_RETRY); + fetch_ssl_setup_transport_layer(conn->ssl_ctx, verbose); + if (!fetch_ssl_setup_peer_verification(conn->ssl_ctx, verbose)) + return (-1); + if (!fetch_ssl_setup_client_certificate(conn->ssl_ctx, verbose)) + return (-1); + conn->ssl = SSL_new(conn->ssl_ctx); - if (conn->ssl == NULL){ + if (conn->ssl == NULL) { fprintf(stderr, "SSL context creation failed\n"); return (-1); } @@ -353,22 +837,35 @@ fetch_ssl(conn_t *conn, int verbose) return (-1); } } + conn->ssl_cert = SSL_get_peer_certificate(conn->ssl); - if (verbose) { - X509_NAME *name; - char *str; + if (conn->ssl_cert == NULL) { + fprintf(stderr, "No server SSL certificate\n"); + return (-1); + } + + if (getenv("SSL_NO_VERIFY_HOSTNAME") == NULL) { + if (verbose) + fetch_info("Verify hostname"); + if (!fetch_ssl_verify_hname(conn->ssl_cert, URL->host)) { + fprintf(stderr, + "SSL certificate subject doesn't match host %s\n", + URL->host); + return (-1); + } + } - fprintf(stderr, "SSL connection established using %s\n", + if (verbose) { + fetch_info("SSL connection established using %s", SSL_get_cipher(conn->ssl)); - conn->ssl_cert = SSL_get_peer_certificate(conn->ssl); name = X509_get_subject_name(conn->ssl_cert); str = X509_NAME_oneline(name, 0, 0); - printf("Certificate subject: %s\n", str); - free(str); + fetch_info("Certificate subject: %s", str); + OPENSSL_free(str); name = X509_get_issuer_name(conn->ssl_cert); str = X509_NAME_oneline(name, 0, 0); - printf("Certificate issuer: %s\n", str); - free(str); + fetch_info("Certificate issuer: %s", str); + OPENSSL_free(str); } return (0); @@ -726,6 +1223,22 @@ fetch_close(conn_t *conn) if (--conn->ref > 0) return (0); +#ifdef WITH_SSL + if (conn->ssl) { + SSL_shutdown(conn->ssl); + SSL_set_connect_state(conn->ssl); + SSL_free(conn->ssl); + conn->ssl = NULL; + } + if (conn->ssl_ctx) { + SSL_CTX_free(conn->ssl_ctx); + conn->ssl_ctx = NULL; + } + if (conn->ssl_cert) { + X509_free(conn->ssl_cert); + conn->ssl_cert = NULL; + } +#endif ret = close(conn->sd); free(conn->cache.buf); free(conn->buf); diff --git a/lib/libfetch/common.h b/lib/libfetch/common.h index fe591d3ea0df..1d543a616d00 100644 --- a/lib/libfetch/common.h +++ b/lib/libfetch/common.h @@ -87,7 +87,10 @@ int fetch_bind(int, int, const char *); conn_t *fetch_connect(const char *, int, int, int); conn_t *fetch_reopen(int); conn_t *fetch_ref(conn_t *); -int fetch_ssl(conn_t *, int); +#ifdef WITH_SSL +int fetch_ssl_cb_verify_crt(int, X509_STORE_CTX*); +#endif +int fetch_ssl(conn_t *, const struct url *, int); ssize_t fetch_read(conn_t *, char *, size_t); int fetch_getln(conn_t *); ssize_t fetch_write(conn_t *, const char *, size_t); diff --git a/lib/libfetch/fetch.3 b/lib/libfetch/fetch.3 index 30372f21fdc0..6b2e4c00b50b 100644 --- a/lib/libfetch/fetch.3 +++ b/lib/libfetch/fetch.3 @@ -1,5 +1,6 @@ .\"- -.\" Copyright (c) 1998-2011 Dag-Erling Smørgrav +.\" Copyright (c) 1998-2013 Dag-Erling Smørgrav +.\" Copyright (c) 2013 Michael Gmelin <freebsd@grem.de> .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -25,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 27, 2011 +.Dd July 30, 2013 .Dt FETCH 3 .Os .Sh NAME @@ -392,6 +393,60 @@ method in a manner consistent with the rest of the library, .Fn fetchPutHTTP is currently unimplemented. +.Sh HTTPS SCHEME +Based on HTTP SCHEME. +By default the peer is verified using the CA bundle located in +.Pa /etc/ssl/cert.pem . +The file may contain multiple CA certificates. +A common source of a current CA bundle is +.Pa \%security/ca_root_nss . +.Pp +The CA bundle used for peer verification can be changed by setting the +environment variables +.Ev SSL_CA_CERT_FILE +to point to a concatenated bundle of trusted certificates and +.Ev SSL_CA_CERT_PATH +to point to a directory containing hashes of trusted CAs (see +.Xr verify 1 ) . +.Pp +A certificate revocation list (CRL) can be used by setting the +environment variable +.Ev SSL_CRL_FILE +(see +.Xr crl 1 ) . +.Pp +Peer verification can be disabled by setting the environment variable +.Ev SSL_NO_VERIFY_PEER . +Note that this also disables CRL checking. +.Pp +By default the service identity is verified according to the rules +detailed in RFC6125 (also known as hostname verification). +This feature can be disabled by setting the environment variable +.Ev SSL_NO_VERIFY_HOSTNAME . +.Pp +Client certificate based authentication is supported. +The environment variable +.Ev SSL_CLIENT_CERT_FILE +should be set to point to a file containing key and client certificate +to be used in PEM format. In case the key is stored in a separate +file, the environment variable +.Ev SSL_CLIENT_KEY_FILE +can be set to point to the key in PEM format. +In case the key uses a password, the user will be prompted on standard +input (see +.Xr PEM 3 ) . +.Pp +By default +.Nm libfetch +allows SSLv3 and TLSv1 when negotiating the connecting with the remote +peer. +You can change this behavior by setting the environment variable +.Ev SSL_ALLOW_SSL2 +to allow SSLv2 (not recommended) and +.Ev SSL_NO_SSL3 +or +.Ev SSL_NO_TLS1 +to disable the respective methods. .Sh AUTHENTICATION Apart from setting the appropriate environment variables and specifying the user name and password in the URL or the @@ -516,6 +571,15 @@ variable is set. Same as .Ev FTP_PROXY , for compatibility. +.It Ev HTTP_ACCEPT +Specifies the value of the +.Va Accept +header for HTTP requests. +If empty, no +.Va Accept +header is sent. +The default is +.Dq */* . .It Ev HTTP_AUTH Specifies HTTP authorization parameters as a colon-separated list of items. @@ -579,6 +643,31 @@ which proxies should not be used. Same as .Ev NO_PROXY , for compatibility. +.It Ev SSL_ALLOW_SSL2 +Allow SSL version 2 when negotiating the connection (not recommended). +.It Ev SSL_CA_CERT_FILE +CA certificate bundle containing trusted CA certificates. +Default value: +.Pa /etc/ssl/cert.pem . +.It Ev SSL_CA_CERT_PATH +Path containing trusted CA hashes. +.It Ev SSL_CLIENT_CERT_FILE +PEM encoded client certificate/key which will be used in +client certificate authentication. +.It Ev SSL_CLIENT_KEY_FILE +PEM encoded client key in case key and client certificate +are stored separately. +.It Ev SSL_CRL_FILE +File containing certificate revocation list. +.It Ev SSL_NO_SSL3 +Don't allow SSL version 3 when negotiating the connection. +.It Ev SSL_NO_TLS1 +Don't allow TLV version 1 when negotiating the connection. +.It Ev SSL_NO_VERIFY_HOSTNAME +If set, do not verify that the hostname matches the subject of the +certificate presented by the server. +.It Ev SSL_NO_VERIFY_PEER +If set, do not verify the peer certificate against trusted CAs. .El .Sh EXAMPLES To access a proxy server on @@ -610,6 +699,19 @@ as follows: .Bd -literal -offset indent NO_PROXY=localhost,127.0.0.1 .Ed +.Pp +Access HTTPS website without any certificate verification whatsoever: +.Bd -literal -offset indent +SSL_NO_VERIFY_PEER=1 +SSL_NO_VERIFY_HOSTNAME=1 +.Ed +.Pp +Access HTTPS website using client certificate based authentication +and a private CA: +.Bd -literal -offset indent +SSL_CLIENT_CERT_FILE=/path/to/client.pem +SSL_CA_CERT_FILE=/path/to/myca.pem +.Ed .Sh SEE ALSO .Xr fetch 1 , .Xr ftpio 3 , @@ -678,7 +780,8 @@ with numerous suggestions and contributions from .An Hajimu Umemoto Aq ume@FreeBSD.org , .An Henry Whincup Aq henry@techiebod.com , .An Jukka A. Ukkonen Aq jau@iki.fi , -.An Jean-Fran\(,cois Dockes Aq jf@dockes.org +.An Jean-Fran\(,cois Dockes Aq jf@dockes.org , +.An Michael Gmelin Aq freebsd@grem.de and others. It replaces the older .Nm ftpio @@ -688,7 +791,9 @@ and .An Jordan K. Hubbard Aq jkh@FreeBSD.org . .Pp This manual page was written by -.An Dag-Erling Sm\(/orgrav Aq des@FreeBSD.org . +.An Dag-Erling Sm\(/orgrav Aq des@FreeBSD.org +and +.An Michael Gmelin Aq freebsd@grem.de . .Sh BUGS Some parts of the library are not yet implemented. The most notable @@ -717,6 +822,10 @@ implemented, superfluous at this site" in an FTP context and .Fn fetchStatFTP does not check that the result of an MDTM command is a valid date. .Pp +In case password protected keys are used for client certificate based +authentication the user is prompted for the password on each and every +fetch operation. +.Pp The man page is incomplete, poorly written and produces badly formatted text. .Pp diff --git a/lib/libfetch/http.c b/lib/libfetch/http.c index 28c0e59d50e3..99b8030e7386 100644 --- a/lib/libfetch/http.c +++ b/lib/libfetch/http.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2000-2011 Dag-Erling Smørgrav + * Copyright (c) 2000-2013 Dag-Erling Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -1408,7 +1408,7 @@ http_connect(struct url *URL, struct url *purl, const char *flags) http_get_reply(conn); } if (strcasecmp(URL->scheme, SCHEME_HTTPS) == 0 && - fetch_ssl(conn, verbose) == -1) { + fetch_ssl(conn, URL, verbose) == -1) { fetch_close(conn); /* grrr */ errno = EAUTH; @@ -1581,7 +1581,7 @@ http_request(struct url *URL, const char *op, struct url_stat *us, if (verbose) fetch_info("requesting %s://%s%s", url->scheme, host, url->doc); - if (purl) { + if (purl && strcasecmp(URL->scheme, SCHEME_HTTPS) != 0) { http_cmd(conn, "%s %s://%s%s HTTP/1.1", op, url->scheme, host, url->doc); } else { @@ -1664,6 +1664,12 @@ http_request(struct url *URL, const char *op, struct url_stat *us, } /* other headers */ + if ((p = getenv("HTTP_ACCEPT")) != NULL) { + if (*p != '\0') + http_cmd(conn, "Accept: %s", p); + } else { + http_cmd(conn, "Accept: */*"); + } if ((p = getenv("HTTP_REFERER")) != NULL && *p != '\0') { if (strcasecmp(p, "auto") == 0) http_cmd(conn, "Referer: %s://%s%s", diff --git a/lib/libgeom/geom_xml2tree.c b/lib/libgeom/geom_xml2tree.c index 02be01991c1e..2874cd0abd9c 100644 --- a/lib/libgeom/geom_xml2tree.c +++ b/lib/libgeom/geom_xml2tree.c @@ -282,7 +282,9 @@ EndElement(void *userData, const char *name) } if (p != NULL) { +#if DEBUG_LIBGEOM > 0 printf("Unexpected XML: name=%s data=\"%s\"\n", name, p); +#endif free(p); } diff --git a/lib/libgeom/libgeom.h b/lib/libgeom/libgeom.h index c951f25babfe..73d43352ee84 100644 --- a/lib/libgeom/libgeom.h +++ b/lib/libgeom/libgeom.h @@ -40,6 +40,10 @@ __BEGIN_DECLS +#ifndef DEBUG_LIBGEOM +#define DEBUG_LIBGEOM 0 +#endif + void geom_stats_close(void); void geom_stats_resync(void); int geom_stats_open(void); diff --git a/lib/libusb/Makefile b/lib/libusb/Makefile index d0698e3c2ce5..99bdfc2b9fc9 100644 --- a/lib/libusb/Makefile +++ b/lib/libusb/Makefile @@ -38,6 +38,14 @@ SRCS+= libusb10_io.c CFLAGS+= -DCOMPAT_32BIT .endif +beforeinstall: + ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + ${.CURDIR}/libusb-0.1.pc ${DESTDIR}${LIBDATADIR}/pkgconfig + ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + ${.CURDIR}/libusb-1.0.pc ${DESTDIR}${LIBDATADIR}/pkgconfig + ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + ${.CURDIR}/libusb-2.0.pc ${DESTDIR}${LIBDATADIR}/pkgconfig + # # Cross platform support # diff --git a/lib/libusb/libusb-0.1.pc b/lib/libusb/libusb-0.1.pc new file mode 100644 index 000000000000..afd7a9960798 --- /dev/null +++ b/lib/libusb/libusb-0.1.pc @@ -0,0 +1,11 @@ +# $FreeBSD$ +prefix=/usr +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: libusb-0.1 +Description: Library that abstracts ways to access USB devices (v0.1) +Version: 0.1.0 +Libs: -L${libdir} -lusb +Cflags: -I${includedir} diff --git a/lib/libusb/libusb-1.0.pc b/lib/libusb/libusb-1.0.pc new file mode 100644 index 000000000000..bed98de3f99c --- /dev/null +++ b/lib/libusb/libusb-1.0.pc @@ -0,0 +1,11 @@ +# $FreeBSD$ +prefix=/usr +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: libusb-1.0 +Description: Library that abstracts ways to access USB devices (v1.0) +Version: 1.0.9 +Libs: -L${libdir} -lusb +Cflags: -I${includedir} diff --git a/lib/libusb/libusb-2.0.pc b/lib/libusb/libusb-2.0.pc new file mode 100644 index 000000000000..34eabb88ab17 --- /dev/null +++ b/lib/libusb/libusb-2.0.pc @@ -0,0 +1,11 @@ +# $FreeBSD$ +prefix=/usr +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: libusb-2.0 +Description: Library that abstracts ways to access USB devices (v2.0) +Version: 2.0.0 +Libs: -L${libdir} -lusb +Cflags: -I${includedir} diff --git a/lib/msun/src/math.h b/lib/msun/src/math.h index 458f44141b69..1bd931c318f3 100644 --- a/lib/msun/src/math.h +++ b/lib/msun/src/math.h @@ -83,10 +83,19 @@ extern const union __nan_un { #if (__STDC_VERSION__ >= 201112L && defined(__clang__)) || \ __has_extension(c_generic_selections) -#define __fp_type_select(x, f, d, ld) _Generic((0,(x)), \ +#define __fp_type_select(x, f, d, ld) _Generic((x), \ float: f(x), \ double: d(x), \ - long double: ld(x)) + long double: ld(x), \ + volatile float: f(x), \ + volatile double: d(x), \ + volatile long double: ld(x), \ + volatile const float: f(x), \ + volatile const double: d(x), \ + volatile const long double: ld(x), \ + const float: f(x), \ + const double: d(x), \ + const long double: ld(x)) #elif __GNUC_PREREQ__(3, 1) && !defined(__cplusplus) #define __fp_type_select(x, f, d, ld) __builtin_choose_expr( \ __builtin_types_compatible_p(__typeof(x), long double), ld(x), \ @@ -209,6 +218,21 @@ __inline_isnanl(__const long double __x) return (__x != __x); } +/* + * Version 2 of the Single UNIX Specification (UNIX98) defined isnan() and + * isinf() as functions taking double. C99, and the subsequent POSIX revisions + * (SUSv3, POSIX.1-2001, define it as a macro that accepts any real floating + * point type. If we are targeting SUSv2 and C99 or C11 (or C++11) then we + * expose the newer definition, assuming that the language spec takes + * precedence over the operating system interface spec. + */ +#if __XSI_VISIBLE > 0 && __XSI_VISIBLE < 600 && __ISO_C_VISIBLE < 1999 +#undef isinf +#undef isnan +int isinf(double); +int isnan(double); +#endif + double acos(double); double asin(double); double atan(double); diff --git a/release/Makefile b/release/Makefile index 1222647e5e39..ffe78b0fe673 100644 --- a/release/Makefile +++ b/release/Makefile @@ -3,8 +3,8 @@ # Makefile for building releases and release media. # # User-driven targets: -# cdrom: Builds release CD-ROM media (release.iso) -# memstick: Builds memory stick image (memstick) +# cdrom: Builds release CD-ROM media (disc1.iso) +# memstick: Builds memory stick image (memstick.img) # ftp: Sets up FTP distribution area (ftp) # release: Build all media and FTP distribution area # install: Copies all release media into ${DESTDIR} @@ -70,11 +70,11 @@ RELEASE_TARGETS= ftp IMAGES= .if exists(${.CURDIR}/${TARGET}/mkisoimages.sh) RELEASE_TARGETS+= cdrom -IMAGES+= release.iso bootonly.iso +IMAGES+= disc1.iso bootonly.iso .endif .if exists(${.CURDIR}/${TARGET}/make-memstick.sh) -RELEASE_TARGETS+= memstick -IMAGES+= memstick +RELEASE_TARGETS+= memstick.img +IMAGES+= memstick.img .endif .include <bsd.obj.mk> @@ -161,20 +161,22 @@ bootonly: packagesystem echo hostid_enable=\"NO\" >> bootonly/etc/rc.conf cp ${.CURDIR}/rc.local bootonly/etc -release.iso: system +release.iso: disc1.iso +disc1.iso: system sh ${.CURDIR}/${TARGET}/mkisoimages.sh -b FreeBSD_Install ${.TARGET} release bootonly.iso: bootonly sh ${.CURDIR}/${TARGET}/mkisoimages.sh -b FreeBSD_Install ${.TARGET} bootonly -memstick: system +memstick: memstick.img +memstick.img: system sh ${.CURDIR}/${TARGET}/make-memstick.sh release ${.TARGET} packagesystem: base.txz kernel.txz ${EXTRA_PACKAGES} sh ${.CURDIR}/scripts/make-manifest.sh *.txz > MANIFEST touch ${.TARGET} -cdrom: release.iso bootonly.iso +cdrom: disc1.iso bootonly.iso ftp: packagesystem rm -rf ftp mkdir -p ftp @@ -191,7 +193,7 @@ clean: rm -f *.txz MANIFEST rm -f system rm -rf release bootonly - rm -f release.iso bootonly.iso memstick + rm -f disc1.iso bootonly.iso memstick.img install: .if defined(DESTDIR) && !empty(DESTDIR) diff --git a/release/sparc64/mkisoimages.sh b/release/sparc64/mkisoimages.sh index 82cadab93a92..9c60cb23704e 100644 --- a/release/sparc64/mkisoimages.sh +++ b/release/sparc64/mkisoimages.sh @@ -32,26 +32,28 @@ case $1 in esac LABEL=`echo $1 | tr '[:lower:]' '[:upper:]'`; shift NAME=$1; shift +BASEBITSDIR=$1 # Create an ISO image publisher="The FreeBSD Project. http://www.FreeBSD.org/" -echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > $1/etc/fstab -makefs -t cd9660 -B be -o rockridge -o label="$LABEL" -o publisher="$publisher" ${NAME}.tmp $* -rm $1/etc/fstab +echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > "${BASEBITSDIR}/etc/fstab" +makefs -t cd9660 -o rockridge -o label="$LABEL" -o publisher="$publisher" ${NAME}.tmp $* +rm "${BASEBITSDIR}/etc/fstab" if [ "x$BOPT" != "x-b" ]; then mv ${NAME}.tmp ${NAME} exit 0 fi + TMPIMGDIR=`mktemp -d /tmp/bootfs.XXXXXXXX` || exit 1 BOOTFSDIR="${TMPIMGDIR}/bootfs" BOOTFSIMG="${TMPIMGDIR}/bootfs.img" # Create a boot filesystem mkdir -p "${BOOTFSDIR}/boot" -cp $4/boot/loader "${BOOTFSDIR}/boot" +cp -p "${BASEBITSDIR}/boot/loader" "${BOOTFSDIR}/boot" makefs -t ffs -B be -M 512k "${BOOTFSIMG}" "${BOOTFSDIR}" -dd if=$4/boot/boot1 of="${BOOTFSIMG}" bs=512 conv=notrunc,sync +dd if="${BASEBITSDIR}/boot/boot1" of="${BOOTFSIMG}" bs=512 conv=notrunc,sync # Create a boot ISO image : ${CYLSIZE:=640} diff --git a/sbin/etherswitchcfg/etherswitchcfg.c b/sbin/etherswitchcfg/etherswitchcfg.c index e11758050df3..1eef832edb71 100644 --- a/sbin/etherswitchcfg/etherswitchcfg.c +++ b/sbin/etherswitchcfg/etherswitchcfg.c @@ -471,8 +471,9 @@ print_vlangroup(struct cfg *cfg, int vlangroup) vg.es_vlangroup = vlangroup; if (ioctl(cfg->fd, IOETHERSWITCHGETVLANGROUP, &vg) != 0) err(EX_OSERR, "ioctl(IOETHERSWITCHGETVLANGROUP)"); - if (vg.es_vid == 0 && vg.es_member_ports == 0) + if ((vg.es_vid & ETHERSWITCH_VID_VALID) == 0) return; + vg.es_vid &= ETHERSWITCH_VID_MASK; printf("vlangroup%d:\n", vlangroup); if (cfg->conf.vlan_mode == ETHERSWITCH_VLAN_PORT) printf("\tport: %d\n", vg.es_vid); @@ -626,7 +627,9 @@ main(int argc, char *argv[]) newmode(&cfg, MODE_PORT); } else if (sscanf(argv[0], "vlangroup%d", &cfg.unit) == 1) { if (cfg.unit < 0 || cfg.unit >= cfg.info.es_nvlangroups) - errx(EX_USAGE, "port unit must be between 0 and %d", cfg.info.es_nvlangroups); + errx(EX_USAGE, + "vlangroup unit must be between 0 and %d", + cfg.info.es_nvlangroups - 1); newmode(&cfg, MODE_VLANGROUP); } else if (strcmp(argv[0], "config") == 0) { newmode(&cfg, MODE_CONFIG); diff --git a/sbin/fsck_ffs/fsck.h b/sbin/fsck_ffs/fsck.h index 45b242c4bd4a..632d45433da2 100644 --- a/sbin/fsck_ffs/fsck.h +++ b/sbin/fsck_ffs/fsck.h @@ -324,6 +324,7 @@ char skipclean; /* skip clean file systems if preening */ int fsmodified; /* 1 => write done to file system */ int fsreadfd; /* file descriptor for reading file system */ int fswritefd; /* file descriptor for writing file system */ +int surrender; /* Give up if reads fail */ ufs2_daddr_t maxfsblock; /* number of blocks in the file system */ char *blockmap; /* ptr to primary blk allocation map */ diff --git a/sbin/fsck_ffs/fsck_ffs.8 b/sbin/fsck_ffs/fsck_ffs.8 index 0b3f992e6bad..adf08d7bb434 100644 --- a/sbin/fsck_ffs/fsck_ffs.8 +++ b/sbin/fsck_ffs/fsck_ffs.8 @@ -29,7 +29,7 @@ .\" @(#)fsck.8 8.4 (Berkeley) 5/9/95 .\" $FreeBSD$ .\" -.Dd February 10, 2012 +.Dd July 30, 2013 .Dt FSCK_FFS 8 .Os .Sh NAME @@ -275,6 +275,11 @@ and frees up space that can allocated to files. The .Fl r option is ignored when running in preen mode. +.It Fl S +Surrender on error. +With this flag enabled, a hard error returned on disk i/o will cause +.Nm +to abort instead of continuing on and possibly tripping over more i/o errors. .It Fl y Assume a yes response to all questions asked by .Nm ; diff --git a/sbin/fsck_ffs/fsutil.c b/sbin/fsck_ffs/fsutil.c index f177408ec191..abc987afe20b 100644 --- a/sbin/fsck_ffs/fsutil.c +++ b/sbin/fsck_ffs/fsutil.c @@ -549,7 +549,18 @@ blread(int fd, char *buf, ufs2_daddr_t blk, long size) slowio_end(); return (0); } - rwerror("READ BLK", blk); + + /* + * This is handled specially here instead of in rwerror because + * rwerror is used for all sorts of errors, not just true read/write + * errors. It should be refactored and fixed. + */ + if (surrender) { + pfatal("CANNOT READ_BLK: %ld", (long)blk); + errx(EEXIT, "ABORTING DUE TO READ ERRORS"); + } else + rwerror("READ BLK", blk); + if (lseek(fd, offset, 0) < 0) rwerror("SEEK BLK", blk); errs = 0; diff --git a/sbin/fsck_ffs/main.c b/sbin/fsck_ffs/main.c index d0744472e2ff..1a1c03bc7d85 100644 --- a/sbin/fsck_ffs/main.c +++ b/sbin/fsck_ffs/main.c @@ -82,7 +82,7 @@ main(int argc, char *argv[]) sync(); skipclean = 1; inoopt = 0; - while ((ch = getopt(argc, argv, "b:Bc:CdEfFm:npryZ")) != -1) { + while ((ch = getopt(argc, argv, "b:Bc:CdEfFm:nprSyZ")) != -1) { switch (ch) { case 'b': skipclean = 0; @@ -142,6 +142,10 @@ main(int argc, char *argv[]) inoopt++; break; + case 'S': + surrender = 1; + break; + case 'y': yflag++; nflag = 0; diff --git a/sbin/ipfw/ipfw.8 b/sbin/ipfw/ipfw.8 index 2047385d5317..65fa33499b99 100644 --- a/sbin/ipfw/ipfw.8 +++ b/sbin/ipfw/ipfw.8 @@ -3049,16 +3049,6 @@ option could be used to (re)mark user traffic, by adding the following to the appropriate place in ruleset: .Pp .Dl "ipfw add setdscp be ip from any to any dscp af11,af21" -.Pp -This rule drops all incoming packets that appear to be coming from another -directly connected system but on the wrong interface. -For example, a packet with a source address of -.Li 192.168.0.0/24 , -configured on -.Li fxp0 , -but coming in on -.Li fxp1 -would be dropped. .Ss DYNAMIC RULES In order to protect a site from flood attacks involving fake TCP packets, it is safer to use dynamic rules: diff --git a/sbin/mdconfig/mdconfig.c b/sbin/mdconfig/mdconfig.c index 6ba4cd6e603d..233058d5d661 100644 --- a/sbin/mdconfig/mdconfig.c +++ b/sbin/mdconfig/mdconfig.c @@ -161,7 +161,9 @@ main(int argc, char **argv) case 'f': if (fflag != NULL) errx(1, "-f can be passed only once"); - fflag = optarg; + fflag = realpath(optarg, NULL); + if (fflag == NULL) + err(1, "realpath"); break; case 'o': if (!strcmp(optarg, "async")) diff --git a/sbin/nvmecontrol/Makefile b/sbin/nvmecontrol/Makefile index 46820560f58b..ea60da3c2941 100644 --- a/sbin/nvmecontrol/Makefile +++ b/sbin/nvmecontrol/Makefile @@ -2,7 +2,9 @@ PROG= nvmecontrol SRCS= nvmecontrol.c devlist.c firmware.c identify.c logpage.c \ - perftest.c reset.c + perftest.c reset.c nvme_util.c MAN= nvmecontrol.8 +.PATH: ${.CURDIR}/../../sys/dev/nvme + .include <bsd.prog.mk> diff --git a/sbin/nvmecontrol/devlist.c b/sbin/nvmecontrol/devlist.c index 29c04751c7a9..f73d643e93d2 100644 --- a/sbin/nvmecontrol/devlist.c +++ b/sbin/nvmecontrol/devlist.c @@ -53,7 +53,7 @@ static inline uint32_t ns_get_sector_size(struct nvme_namespace_data *nsdata) { - return (1 << nsdata->lbaf[0].lbads); + return (1 << nsdata->lbaf[nsdata->flbas.format].lbads); } void @@ -62,6 +62,7 @@ devlist(int argc, char *argv[]) struct nvme_controller_data cdata; struct nvme_namespace_data nsdata; char name[64]; + uint8_t mn[64]; uint32_t i; int ch, ctrlr, fd, found, ret; @@ -91,7 +92,8 @@ devlist(int argc, char *argv[]) found++; read_controller_data(fd, &cdata); - printf("%6s: %.*s\n", name, NVME_MODEL_NUMBER_LENGTH, cdata.mn); + nvme_strvis(mn, cdata.mn, sizeof(mn), NVME_MODEL_NUMBER_LENGTH); + printf("%6s: %s\n", name, mn); for (i = 0; i < cdata.nn; i++) { sprintf(name, "%s%d%s%d", NVME_CTRLR_PREFIX, ctrlr, diff --git a/sbin/nvmecontrol/identify.c b/sbin/nvmecontrol/identify.c index 65854303566b..58492e2fd956 100644 --- a/sbin/nvmecontrol/identify.c +++ b/sbin/nvmecontrol/identify.c @@ -43,16 +43,18 @@ __FBSDID("$FreeBSD$"); static void print_controller(struct nvme_controller_data *cdata) { + uint8_t str[128]; + printf("Controller Capabilities/Features\n"); printf("================================\n"); printf("Vendor ID: %04x\n", cdata->vid); printf("Subsystem Vendor ID: %04x\n", cdata->ssvid); - printf("Serial Number: %.*s\n", - NVME_SERIAL_NUMBER_LENGTH, cdata->sn); - printf("Model Number: %.*s\n", - NVME_MODEL_NUMBER_LENGTH, cdata->mn); - printf("Firmware Version: %.*s\n", - NVME_FIRMWARE_REVISION_LENGTH, cdata->fr); + nvme_strvis(str, cdata->sn, sizeof(str), NVME_SERIAL_NUMBER_LENGTH); + printf("Serial Number: %s\n", str); + nvme_strvis(str, cdata->mn, sizeof(str), NVME_MODEL_NUMBER_LENGTH); + printf("Model Number: %s\n", str); + nvme_strvis(str, cdata->fr, sizeof(str), NVME_FIRMWARE_REVISION_LENGTH); + printf("Firmware Version: %s\n", str); printf("Recommended Arb Burst: %d\n", cdata->rab); printf("IEEE OUI Identifier: %02x %02x %02x\n", cdata->ieee[0], cdata->ieee[1], cdata->ieee[2]); diff --git a/sbin/route/route.c b/sbin/route/route.c index b829bd29336b..e575c711329f 100644 --- a/sbin/route/route.c +++ b/sbin/route/route.c @@ -120,7 +120,6 @@ static void set_metric(char *, int); static int set_sofib(int); static void sockaddr(char *, struct sockaddr *, size_t); static void sodump(struct sockaddr *, const char *); -extern char *iso_ntoa(void); struct fibl { TAILQ_ENTRY(fibl) fl_next; @@ -136,7 +135,7 @@ static int fiboptlist_range(const char *, struct fibl_head_t *); static void usage(const char *) __dead2; -void +static void usage(const char *cp) { if (cp != NULL) @@ -445,7 +444,7 @@ retry: (void)printf("Examining routing table from sysctl\n"); seqno = 0; /* ??? */ for (next = buf; next < lim; next += rtm->rtm_msglen) { - rtm = (struct rt_msghdr *)next; + rtm = (struct rt_msghdr *)(void *)next; if (verbose) print_rtmsg(rtm, rtm->rtm_msglen); if ((rtm->rtm_flags & RTF_GATEWAY) == 0) @@ -490,14 +489,12 @@ retry: return (error); } -const char * +static const char * routename(struct sockaddr *sa) { + struct sockaddr_dl *sdl; const char *cp; - static char line[MAXHOSTNAMELEN + 1]; -#ifdef INET - struct hostent *hp; -#endif + static char line[NI_MAXHOST]; static char domain[MAXHOSTNAMELEN + 1]; static int first = 1, n; @@ -511,73 +508,94 @@ routename(struct sockaddr *sa) domain[0] = '\0'; } - if (sa->sa_len == 0) { - strcpy(line, "default"); - return (line); - } + /* If the address is zero-filled, use "default". */ + if (sa->sa_len == 0 && nflag == 0) + return ("default"); +#if defined(INET) || defined(INET6) switch (sa->sa_family) { #ifdef INET case AF_INET: - { - struct in_addr in; - - in = ((struct sockaddr_in *)sa)->sin_addr; - cp = NULL; - if (in.s_addr == INADDR_ANY || sa->sa_len < 4) - cp = "default"; - if (cp == NULL && !nflag) { - hp = gethostbyaddr((char *)&in, sizeof (struct in_addr), - AF_INET); - if (hp != NULL) { - char *cptr; - cptr = strchr(hp->h_name, '.'); - if (cptr != NULL && - strcmp(cptr + 1, domain) == 0) - *cptr = '\0'; - cp = hp->h_name; - } - } - if (cp != NULL) { - strncpy(line, cp, sizeof(line) - 1); - line[sizeof(line) - 1] = '\0'; - } else - (void)sprintf(line, "%s", inet_ntoa(in)); + /* If the address is zero-filled, use "default". */ + if (nflag == 0 && + ((struct sockaddr_in *)(void *)sa)->sin_addr.s_addr == + INADDR_ANY) + return("default"); break; +#endif +#ifdef INET6 + case AF_INET6: + /* If the address is zero-filled, use "default". */ + if (nflag == 0 && + IN6_IS_ADDR_UNSPECIFIED(&((struct sockaddr_in6 *)(void *)sa)->sin6_addr)) + return("default"); + break; +#endif } +#endif + switch (sa->sa_family) { +#if defined(INET) || defined(INET6) +#ifdef INET + case AF_INET: #endif #ifdef INET6 case AF_INET6: +#endif { - struct sockaddr_in6 sin6; /* use static var for safety */ - int niflags = 0; + struct sockaddr_storage ss; + int error; + char *p; - memset(&sin6, 0, sizeof(sin6)); - memcpy(&sin6, sa, sa->sa_len); - sin6.sin6_len = sizeof(struct sockaddr_in6); - sin6.sin6_family = AF_INET6; - if (nflag) - niflags |= NI_NUMERICHOST; - if (getnameinfo((struct sockaddr *)&sin6, sin6.sin6_len, - line, sizeof(line), NULL, 0, niflags) != 0) + memset(&ss, 0, sizeof(ss)); + if (sa->sa_len == 0) + ss.ss_family = sa->sa_family; + else + memcpy(&ss, sa, sa->sa_len); + /* Expand sa->sa_len because it could be shortened. */ + if (sa->sa_family == AF_INET) + ss.ss_len = sizeof(struct sockaddr_in); + else if (sa->sa_family == AF_INET6) + ss.ss_len = sizeof(struct sockaddr_in6); + error = getnameinfo((struct sockaddr *)&ss, ss.ss_len, + line, sizeof(line), NULL, 0, + (nflag == 0) ? 0 : NI_NUMERICHOST); + if (error) { + warnx("getnameinfo(): %s", gai_strerror(error)); strncpy(line, "invalid", sizeof(line)); + } + + /* Remove the domain part if any. */ + p = strchr(line, '.'); + if (p != NULL && strcmp(p + 1, domain) == 0) + *p = '\0'; return (line); + break; } #endif - case AF_APPLETALK: (void)snprintf(line, sizeof(line), "atalk %s", - atalk_ntoa(((struct sockaddr_at *)sa)->sat_addr)); + atalk_ntoa(((struct sockaddr_at *)(void *)sa)->sat_addr)); break; case AF_LINK: - return (link_ntoa((struct sockaddr_dl *)sa)); + sdl = (struct sockaddr_dl *)(void *)sa; + + if (sdl->sdl_nlen == 0 && + sdl->sdl_alen == 0 && + sdl->sdl_slen == 0) { + n = snprintf(line, sizeof(line), "link#%d", + sdl->sdl_index); + if (n > (int)sizeof(line)) + line[0] = '\0'; + return (line); + } else + return (link_ntoa(sdl)); break; default: { - u_short *sp = (u_short *)sa; + u_short *sp = (u_short *)(void *)sa; u_short *splim = sp + ((sa->sa_len + 1) >> 1); char *cps = line + sprintf(line, "(%d)", sa->sa_family); char *cpe = line + sizeof(line); @@ -597,9 +615,10 @@ routename(struct sockaddr *sa) * Return the name of the network whose address is given. * The address is assumed to be that of a net, not a host. */ -const char * +static const char * netname(struct sockaddr *sa) { + struct sockaddr_dl *sdl; static char line[MAXHOSTNAMELEN + 1]; int n; #ifdef INET @@ -614,7 +633,7 @@ netname(struct sockaddr *sa) { struct in_addr in; - in = ((struct sockaddr_in *)sa)->sin_addr; + in = ((struct sockaddr_in *)(void *)sa)->sin_addr; i = in.s_addr = ntohl(in.s_addr); if (in.s_addr == 0) cp = "default"; @@ -664,16 +683,27 @@ netname(struct sockaddr *sa) case AF_APPLETALK: (void)snprintf(line, sizeof(line), "atalk %s", - atalk_ntoa(((struct sockaddr_at *)sa)->sat_addr)); + atalk_ntoa(((struct sockaddr_at *)(void *)sa)->sat_addr)); break; case AF_LINK: - return (link_ntoa((struct sockaddr_dl *)sa)); + sdl = (struct sockaddr_dl *)(void *)sa; + + if (sdl->sdl_nlen == 0 && + sdl->sdl_alen == 0 && + sdl->sdl_slen == 0) { + n = snprintf(line, sizeof(line), "link#%d", + sdl->sdl_index); + if (n > (int)sizeof(line)) + line[0] = '\0'; + return (line); + } else + return (link_ntoa(sdl)); break; default: { - u_short *sp = (u_short *)sa->sa_data; + u_short *sp = (u_short *)(void *)sa->sa_data; u_short *splim = sp + ((sa->sa_len + 1)>>1); char *cps = line + sprintf(line, "af %d:", sa->sa_family); char *cpe = line + sizeof(line); @@ -823,35 +853,35 @@ newroute(int argc, char **argv) case K_IFA: if (!--argc) usage(NULL); - getaddr(RTA_IFA, *++argv, 0, nrflags); + getaddr(RTAX_IFA, *++argv, 0, nrflags); break; case K_IFP: if (!--argc) usage(NULL); - getaddr(RTA_IFP, *++argv, 0, nrflags); + getaddr(RTAX_IFP, *++argv, 0, nrflags); break; case K_GENMASK: if (!--argc) usage(NULL); - getaddr(RTA_GENMASK, *++argv, 0, nrflags); + getaddr(RTAX_GENMASK, *++argv, 0, nrflags); break; case K_GATEWAY: if (!--argc) usage(NULL); - getaddr(RTA_GATEWAY, *++argv, 0, nrflags); + getaddr(RTAX_GATEWAY, *++argv, 0, nrflags); gateway = *argv; break; case K_DST: if (!--argc) usage(NULL); - if (getaddr(RTA_DST, *++argv, &hp, nrflags)) + if (getaddr(RTAX_DST, *++argv, &hp, nrflags)) nrflags |= F_ISHOST; dest = *argv; break; case K_NETMASK: if (!--argc) usage(NULL); - getaddr(RTA_NETMASK, *++argv, 0, nrflags); + getaddr(RTAX_NETMASK, *++argv, 0, nrflags); /* FALLTHROUGH */ case K_NET: nrflags |= F_FORCENET; @@ -886,13 +916,13 @@ newroute(int argc, char **argv) } else { if ((rtm_addrs & RTA_DST) == 0) { dest = *argv; - if (getaddr(RTA_DST, *argv, &hp, nrflags)) + if (getaddr(RTAX_DST, *argv, &hp, nrflags)) nrflags |= F_ISHOST; } else if ((rtm_addrs & RTA_GATEWAY) == 0) { gateway = *argv; - getaddr(RTA_GATEWAY, *argv, &hp, nrflags); + getaddr(RTAX_GATEWAY, *argv, &hp, nrflags); } else { - getaddr(RTA_NETMASK, *argv, 0, nrflags); + getaddr(RTAX_NETMASK, *argv, 0, nrflags); nrflags |= F_FORCENET; } } @@ -1103,7 +1133,7 @@ inet6_makenetandmask(struct sockaddr_in6 *sin6, const char *plen) * returning 1 if a host address, 0 if a network address. */ static int -getaddr(int which, char *str, struct hostent **hpp, int nrflags) +getaddr(int idx, char *str, struct hostent **hpp, int nrflags) { struct sockaddr *sa; #if defined(INET) @@ -1116,6 +1146,8 @@ getaddr(int which, char *str, struct hostent **hpp, int nrflags) char *q; #endif + if (idx < 0 || idx >= RTAX_MAX) + usage("internal error"); if (af == 0) { #if defined(INET) af = AF_INET; @@ -1128,39 +1160,19 @@ getaddr(int which, char *str, struct hostent **hpp, int nrflags) aflen = sizeof(struct sockaddr_dl); #endif } - rtm_addrs |= which; - - switch (which) { - case RTA_DST: - sa = (struct sockaddr *)&so[RTAX_DST]; - break; - case RTA_GATEWAY: - sa = (struct sockaddr *)&so[RTAX_GATEWAY]; - break; - case RTA_NETMASK: - sa = (struct sockaddr *)&so[RTAX_NETMASK]; - break; - case RTA_GENMASK: - sa = (struct sockaddr *)&so[RTAX_GENMASK]; - break; - case RTA_IFA: - sa = (struct sockaddr *)&so[RTAX_IFA]; - break; - case RTA_IFP: - sa = (struct sockaddr *)&so[RTAX_IFP]; - break; - default: - usage("internal error"); - /*NOTREACHED*/ - } +#ifndef INET + hpp = NULL; +#endif + rtm_addrs |= (1 << idx); + sa = (struct sockaddr *)&so[idx]; sa->sa_family = af; sa->sa_len = aflen; - switch (which) { - case RTA_GATEWAY: + switch (idx) { + case RTAX_GATEWAY: if (nrflags & F_INTERFACE) { struct ifaddrs *ifap, *ifa; - struct sockaddr_dl *sdl0 = (struct sockaddr_dl *)sa; + struct sockaddr_dl *sdl0 = (struct sockaddr_dl *)(void *)sa; struct sockaddr_dl *sdl = NULL; if (getifaddrs(&ifap)) @@ -1173,7 +1185,7 @@ getaddr(int which, char *str, struct hostent **hpp, int nrflags) if (strcmp(str, ifa->ifa_name) != 0) continue; - sdl = (struct sockaddr_dl *)ifa->ifa_addr; + sdl = (struct sockaddr_dl *)(void *)ifa->ifa_addr; } /* If we found it, then use it */ if (sdl != NULL) { @@ -1188,7 +1200,7 @@ getaddr(int which, char *str, struct hostent **hpp, int nrflags) return(1); } break; - case RTA_IFP: + case RTAX_IFP: sa->sa_family = AF_LINK; break; } @@ -1196,10 +1208,10 @@ getaddr(int which, char *str, struct hostent **hpp, int nrflags) /* * Default is net 0.0.0.0/0 */ - switch (which) { - case RTA_DST: + switch (idx) { + case RTAX_DST: forcenet++; - getaddr(RTA_NETMASK, str, 0, nrflags); + getaddr(RTAX_NETMASK, str, 0, nrflags); break; } return (0); @@ -1212,7 +1224,7 @@ getaddr(int which, char *str, struct hostent **hpp, int nrflags) int ecode; q = NULL; - if (which == RTA_DST && (q = strchr(str, '/')) != NULL) + if (idx == RTAX_DST && (q = strchr(str, '/')) != NULL) *q = '\0'; memset(&hints, 0, sizeof(hints)); hints.ai_family = sa->sa_family; @@ -1225,16 +1237,15 @@ getaddr(int which, char *str, struct hostent **hpp, int nrflags) freeaddrinfo(res); if (q != NULL) *q++ = '/'; - if (which == RTA_DST) - return (inet6_makenetandmask((struct sockaddr_in6 *)sa, - q)); + if (idx == RTAX_DST) + return (inet6_makenetandmask((struct sockaddr_in6 *)(void *)sa, q)); return (0); } #endif /* INET6 */ case AF_APPLETALK: { - struct sockaddr_at *sat = (struct sockaddr_at *)sa; + struct sockaddr_at *sat = (struct sockaddr_at *)(void *)sa; if (!atalk_aton(str, &sat->sat_addr)) errx(EX_NOHOST, "bad address: %s", str); @@ -1242,7 +1253,7 @@ getaddr(int which, char *str, struct hostent **hpp, int nrflags) return(forcehost || sat->sat_addr.s_node != 0); } case AF_LINK: - link_addr(str, (struct sockaddr_dl *)sa); + link_addr(str, (struct sockaddr_dl *)(void *)sa); return (1); case PF_ROUTE: @@ -1256,13 +1267,13 @@ getaddr(int which, char *str, struct hostent **hpp, int nrflags) } #ifdef INET - sin = (struct sockaddr_in *)sa; + sin = (struct sockaddr_in *)(void *)sa; if (hpp == NULL) hpp = &hp; *hpp = NULL; q = strchr(str,'/'); - if (q != NULL && which == RTA_DST) { + if (q != NULL && idx == RTAX_DST) { *q = '\0'; if ((val = inet_network(str)) != INADDR_NONE) { inet_makenetandmask(val, sin, @@ -1272,10 +1283,10 @@ getaddr(int which, char *str, struct hostent **hpp, int nrflags) } *q = '/'; } - if ((which != RTA_DST || forcenet == 0) && + if ((idx != RTAX_DST || forcenet == 0) && inet_aton(str, &sin->sin_addr)) { val = sin->sin_addr.s_addr; - if (which != RTA_DST || forcehost || + if (idx != RTAX_DST || forcehost || inet_lnaof(sin->sin_addr) != INADDR_ANY) return (1); else { @@ -1283,7 +1294,7 @@ getaddr(int which, char *str, struct hostent **hpp, int nrflags) goto netdone; } } - if (which == RTA_DST && forcehost == 0 && + if (idx == RTAX_DST && forcehost == 0 && ((val = inet_network(str)) != INADDR_NONE || ((np = getnetbyname(str)) != NULL && (val = np->n_net) != 0))) { netdone: @@ -1388,7 +1399,7 @@ retry2: } lim = buf + needed; for (next = buf; next < lim; next += rtm->rtm_msglen) { - rtm = (struct rt_msghdr *)next; + rtm = (struct rt_msghdr *)(void *)next; print_rtmsg(rtm, rtm->rtm_msglen); } } @@ -1438,7 +1449,7 @@ monitor(int argc, char *argv[]) n = read(s, msg, 2048); now = time(NULL); (void)printf("\ngot message of size %d on %s", n, ctime(&now)); - print_rtmsg((struct rt_msghdr *)msg, n); + print_rtmsg((struct rt_msghdr *)(void *)msg, n); } } @@ -1579,7 +1590,7 @@ print_rtmsg(struct rt_msghdr *rtm, size_t msglen) rtm->rtm_version); return; } - if (rtm->rtm_type < sizeof(msgtypes) / sizeof(msgtypes[0])) + if (rtm->rtm_type < nitems(msgtypes)) (void)printf("%s: ", msgtypes[rtm->rtm_type]); else (void)printf("unknown type %d: ", rtm->rtm_type); @@ -1664,12 +1675,11 @@ badlen: static void print_getmsg(struct rt_msghdr *rtm, int msglen, int fib) { - struct sockaddr *dst = NULL, *gate = NULL, *mask = NULL; - struct sockaddr_dl *ifp = NULL; - struct sockaddr *sa; + struct sockaddr *sp[RTAX_MAX]; char *cp; int i; + memset(sp, 0, sizeof(sp)); (void)printf(" route to: %s\n", routename((struct sockaddr *)&so[RTAX_DST])); if (rtm->rtm_version != RTM_VERSION) { @@ -1680,6 +1690,7 @@ print_getmsg(struct rt_msghdr *rtm, int msglen, int fib) if (rtm->rtm_msglen > msglen) { warnx("message length mismatch, in packet %d, returned %d", rtm->rtm_msglen, msglen); + return; } if (rtm->rtm_errno) { errno = rtm->rtm_errno; @@ -1687,54 +1698,36 @@ print_getmsg(struct rt_msghdr *rtm, int msglen, int fib) return; } cp = ((char *)(rtm + 1)); - if (rtm->rtm_addrs) - for (i = 1; i; i <<= 1) - if (i & rtm->rtm_addrs) { - sa = (struct sockaddr *)cp; - switch (i) { - case RTA_DST: - dst = sa; - break; - case RTA_GATEWAY: - gate = sa; - break; - case RTA_NETMASK: - mask = sa; - break; - case RTA_IFP: - if (sa->sa_family == AF_LINK && - ((struct sockaddr_dl *)sa)->sdl_nlen) - ifp = (struct sockaddr_dl *)sa; - break; - } - cp += SA_SIZE(sa); - } - if (dst && mask) - mask->sa_family = dst->sa_family; /* XXX */ - if (dst) - (void)printf("destination: %s\n", routename(dst)); - if (mask) { - int savenflag = nflag; - - nflag = 1; - (void)printf(" mask: %s\n", routename(mask)); - nflag = savenflag; - } - if (gate && rtm->rtm_flags & RTF_GATEWAY) - (void)printf(" gateway: %s\n", routename(gate)); + for (i = 0; i < RTAX_MAX; i++) + if (rtm->rtm_addrs & (1 << i)) { + sp[i] = (struct sockaddr *)cp; + cp += SA_SIZE((struct sockaddr *)cp); + } + if ((rtm->rtm_addrs & RTA_IFP) && + (sp[RTAX_IFP]->sa_family != AF_LINK || + ((struct sockaddr_dl *)(void *)sp[RTAX_IFP])->sdl_nlen == 0)) + sp[RTAX_IFP] = NULL; + if (sp[RTAX_DST] && sp[RTAX_NETMASK]) + sp[RTAX_NETMASK]->sa_family = sp[RTAX_DST]->sa_family; /* XXX */ + if (sp[RTAX_DST]) + (void)printf("destination: %s\n", routename(sp[RTAX_DST])); + if (sp[RTAX_NETMASK]) + (void)printf(" mask: %s\n", routename(sp[RTAX_NETMASK])); + if (sp[RTAX_GATEWAY] && (rtm->rtm_flags & RTF_GATEWAY)) + (void)printf(" gateway: %s\n", routename(sp[RTAX_GATEWAY])); if (fib >= 0) (void)printf(" fib: %u\n", (unsigned int)fib); - if (ifp) + if (sp[RTAX_IFP]) (void)printf(" interface: %.*s\n", - ifp->sdl_nlen, ifp->sdl_data); + ((struct sockaddr_dl *)(void *)sp[RTAX_IFP])->sdl_nlen, + ((struct sockaddr_dl *)(void *)sp[RTAX_IFP])->sdl_data); (void)printf(" flags: "); printb(rtm->rtm_flags, routeflags); #define lock(f) ((rtm->rtm_rmx.rmx_locks & __CONCAT(RTV_,f)) ? 'L' : ' ') #define msec(u) (((u) + 500) / 1000) /* usec to msec */ - - printf("\n%s\n", "\ - recvpipe sendpipe ssthresh rtt,msec mtu weight expire"); + printf("\n%9s %9s %9s %9s %9s %10s %9s\n", "recvpipe", + "sendpipe", "ssthresh", "rtt,msec", "mtu ", "weight", "expire"); printf("%8ld%c ", rtm->rtm_rmx.rmx_recvpipe, lock(RPIPE)); printf("%8ld%c ", rtm->rtm_rmx.rmx_sendpipe, lock(SPIPE)); printf("%8ld%c ", rtm->rtm_rmx.rmx_ssthresh, lock(SSTHRESH)); @@ -1785,8 +1778,8 @@ pmsg_addrs(char *cp, int addrs, size_t len) (void)printf("\nsockaddrs: "); printb(addrs, addrnames); putchar('\n'); - for (i = 1; i != 0; i <<= 1) - if (i & addrs) { + for (i = 0; i < RTAX_MAX; i++) + if (addrs & (1 << i)) { sa = (struct sockaddr *)cp; if (len == 0 || len < SA_SIZE(sa)) { (void)printf(errfmt, __func__, len); @@ -1846,24 +1839,24 @@ sodump(struct sockaddr *sa, const char *which) switch (sa->sa_family) { case AF_LINK: (void)printf("%s: link %s; ", which, - link_ntoa((struct sockaddr_dl *)sa)); + link_ntoa((struct sockaddr_dl *)(void *)sa)); break; #ifdef INET case AF_INET: (void)printf("%s: inet %s; ", which, - inet_ntoa(((struct sockaddr_in *)sa)->sin_addr)); + inet_ntoa(((struct sockaddr_in *)(void *)sa)->sin_addr)); break; #endif #ifdef INET6 case AF_INET6: (void)printf("%s: inet6 %s; ", which, inet_ntop(sa->sa_family, - &((struct sockaddr_in6 *)sa)->sin6_addr, nbuf, + &((struct sockaddr_in6 *)(void *)sa)->sin6_addr, nbuf, sizeof(nbuf))); break; #endif case AF_APPLETALK: (void)printf("%s: atalk %s; ", which, - atalk_ntoa(((struct sockaddr_at *)sa)->sat_addr)); + atalk_ntoa(((struct sockaddr_at *)(void *)sa)->sat_addr)); break; } (void)fflush(stdout); diff --git a/sbin/swapon/swapon.c b/sbin/swapon/swapon.c index 5dcb18d823a4..d93277c6638b 100644 --- a/sbin/swapon/swapon.c +++ b/sbin/swapon/swapon.c @@ -446,7 +446,7 @@ swap_on_off_md(const char *name, char *mntops, int doingall) FILE *sfd; int fd, mdunit, error; const char *ret; - char mdpath[PATH_MAX], linebuf[PATH_MAX]; + static char mdpath[PATH_MAX], linebuf[PATH_MAX]; char *p, *vnodefile; size_t linelen; u_long ul; diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 5beda9fb6a8b..54a14e8edeb8 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -385,6 +385,8 @@ MAN= aac.4 \ rndtest.4 \ route.4 \ rp.4 \ + rsu.4 \ + rsufw.4 \ rue.4 \ rum.4 \ run.4 \ diff --git a/share/man/man4/ath_hal.4 b/share/man/man4/ath_hal.4 index a17393fc4051..e3a7dcf0c6fb 100644 --- a/share/man/man4/ath_hal.4 +++ b/share/man/man4/ath_hal.4 @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd August 28, 2011 +.Dd July 22, 2013 .Dt ATH_HAL 4 .Os .Sh NAME @@ -56,11 +56,13 @@ or .Cd "device ath_ar9280" .Cd "device ath_ar9285" .Cd "device ath_ar9287" +.Cd "device ath_ar9300" .Cd "options AH_SUPPORT_AR5416" .Sh DESCRIPTION The hal provides hardware support for wireless network adapters based on the Atheros AR5210, AR5211, AR5212, AR5213, AR2413, AR2417, AR2425, -AR5413, AR5416, AR5418, AR5424, AR9160, AR9220, AR9280, AR9285 and AR9287 +AR5413, AR5416, AR5418, AR5424, AR9160, AR9220, AR9280, AR9285, AR9287, +AR9380, AR9390, AR9580, AR9590, AR9562 and QCA9565 chips (and companion RF/baseband parts). This code is part of the .Xr ath 4 @@ -128,6 +130,7 @@ module: .It "Sony PCWA-C300S AR5212 Cardbus b/g" .It "Sony PCWA-C500 AR5210 Cardbus a" .It "3Com 3CRPAG175 AR5212 CardBus a/b/g" +.It "TP-LINK TL-WDN4800 AR9380 PCIe a/b/g/n" .El .Sh SEE ALSO .Xr ath 4 diff --git a/share/man/man4/bridge.4 b/share/man/man4/bridge.4 index 69e4d2109328..ec54666c53c1 100644 --- a/share/man/man4/bridge.4 +++ b/share/man/man4/bridge.4 @@ -35,7 +35,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 3, 2013 +.Dd July 27, 2013 .Dt IF_BRIDGE 4 .Os .Sh NAME @@ -185,7 +185,7 @@ and applications use both of them. .Pp To prevent this situation, .Nm -checks whether an link-local scoped IPv6 address is configured on +checks whether a link-local scoped IPv6 address is configured on a member interface to be added and the .Nm interface. @@ -194,13 +194,13 @@ When the interface has IPv6 addresses, IPv6 addresses on the member interface will be automatically removed before the interface is added. -When both -.Nm -interface and the existing member interfaces do not have one, -adding an interface with IPv6 addresses as a new member interface is allowed. -These means only one interface in the link-local scope zone where the -.Nm -interface forms can have link-local scoped IPv6 addresses. +.Pp +This behavior can be disabled by setting +.Xr sysctl 8 +variable +.Va net.link.bridge.allow_llz_overlap +to +.Li 1 . .Pp Note that .Li ACCEPT_RTADV diff --git a/share/man/man4/rsu.4 b/share/man/man4/rsu.4 new file mode 100644 index 000000000000..39c6c599dc34 --- /dev/null +++ b/share/man/man4/rsu.4 @@ -0,0 +1,178 @@ +.\" $OpenBSD: rsu.4,v 1.11 2013/02/14 07:40:42 jmc Exp $ +.\" $FreeBSD$ +.\" +.\" Copyright (c) 2010 Damien Bergamini <damien.bergamini@free.fr> +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.Dd July 29 2013 +.Dt RSU 4 +.Os +.Sh NAME +.Nm rsu +.Nd Realtek RTL8188SU/RTL8192SU USB IEEE 802.11b/g/n wireless network device +.Sh SYNOPSIS +.\.Cd "rsu* at uhub? port ?" +To compile this driver into the kernel, +place the following lines in your kernel configuration file: +.Bd -ragged -offset indent +.Cd "device ehci" +.Cd "device uhci" +.Cd "device ohci" +.Cd "device usb" +.Cd "device rsu" +.Cd "device wlan" +.Ed +.Pp +Alternatively, to load the driver as a module at boot time, +place the following line in +.Xr loader.conf 5: +.Bd -literal -offset indent +.Xr if_rsu_load="YES" +.Ed +.Pp +After you have read the license in /usr/share/doc/legal/realtek +you will want to add the following lines to +.Xr loader.conf 5 : +.Bd -literal -offset indent +legal.realtek.license_ack=1 +rsu-rtl8712fw_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver supports USB 2.0 wireless network devices based on Realtek +RTL8188SU, RTL8191SU and RTL8192SU chipsets. +.Pp +The RTL8188SU is a highly integrated 802.11n adapter that combines +a MAC, a 1T1R capable baseband and an RF in a single chip. +It operates in the 2GHz spectrum only. +.Pp +The RTL8191SU is a highly integrated multiple-in, single-out (MISO) +802.11n adapter that combines a MAC, a 1T2R capable baseband and an +RF in a single chip. +It operates in the 2GHz spectrum only. +.Pp +The RTL8192SU is a highly integrated multiple-in, multiple-out (MIMO) +802.11n adapter that combines a MAC, a 2T2R capable baseband and an +RF in a single chip. +It operates in the 2GHz spectrum only. +.Pp +These are the modes the +.Nm +driver can operate in: +.Bl -tag -width "IBSS-masterXX" +.It BSS mode +Also known as +.Em infrastructure +mode, this is used when associating with an access point, through +which all traffic passes. +This mode is the default. +.El +.Pp +The +.Nm +driver can be configured to use +Wired Equivalent Privacy (WEP) or +Wi-Fi Protected Access (WPA-PSK and WPA2-PSK). +WPA is the de facto encryption standard for wireless networks. +It is strongly recommended that WEP +not be used as the sole mechanism +to secure wireless communication, +due to serious weaknesses in it. +.Pp +The +.Nm +driver can be configured at runtime with +.Xr ifconfig 8 +or on boot with +.Xr hostname 1 . +.Sh FILES +The driver needs at least version 1.2 of the following firmware file, +which is loaded when an interface is attached: +.Pp +.Bl -tag -width Ds -offset indent -compact +.It /boot/kernel/rsu-rtl8712fw.ko +.El +.Sh HARDWARE +The following adapters should work: +.Pp +.Bl -tag -width Ds -offset indent -compact +.It ASUS USB-N10 +.It Belkin F7D1101 v1 +.It D-Link DWA-131 A1 +.It EDUP EP-MS150N(W) +.It Hercules HWGUn-54 +.It Hercules HWNUm-300 +.It Planex GW-USNano +.It Sitecom WL-349 v1 +.It Sitecom WL-353 +.It Sweex LW154 +.It TRENDnet TEW-648UB +.It TRENDnet TEW-649UB +.Sh EXAMPLES +Join an existing BSS network (i.e., connect to an access point): +.Bd -literal -offset indent +ifconfig wlan create wlandev rsu0 inet 192.168.0.20 \e + netmask 0xffffff00 +.Ed +.Pp +Join a specific BSS network with network name +.Dq Li my_net : +.Pp +.Dl "ifconfig wlan create wlandev rsu0 ssid my_net up" +.Pp +Join a specific BSS network with 64-bit WEP encryption: +.Bd -literal -offset indent +ifconfig wlan create wlandev rsu0 ssid my_net \e + wepmode on wepkey 0x1234567890 weptxkey 1 up +.Ed +.Sh DIAGNOSTICS +.Bl -diag +.It "%s: failed load firmware of file rsu-rtl8712fw" +For some reason, the driver was unable to read the microcode file from the +filesystem. +The file might be missing or corrupted. +.It "device timeout" +A frame dispatched to the hardware for transmission did not complete in time. +The driver will reset the hardware. +This should not happen. +.El +.Sh SEE ALSO +.Xr arp 8 , +.Xr intro 1 , +.Xr netintro 4 , +.Xr usb 3 , +.Xr hostname 1 , +.Xr ifconfig 8, +.Xr wlan 4 , +.Xr rsufw 4 +.Sh HISTORY +The +.Nm +driver first appeared in +.Ox 4.9 and +.Fx 10.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An Damien Bergamini Aq damien@openbsd.org +and ported by +.An Rui Paulo Aq rpaulo@freebsd.org . +.Sh CAVEATS +The +.Nm +driver does not support any of the 802.11n capabilities offered by the +adapters. diff --git a/share/man/man4/rsufw.4 b/share/man/man4/rsufw.4 new file mode 100644 index 000000000000..a50e094afe4e --- /dev/null +++ b/share/man/man4/rsufw.4 @@ -0,0 +1,46 @@ +.\" $FreeBSD$ +.\" Copyright (c) 2013 Idwer Vollering <vidwer@gmail.com> +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.Dd July 21, 2013 +.Dt RSUFW 4 +.Os +.Sh NAME +.Nm rsufw +.Nd "Firmware Module for Realtek driver" +.Sh SYNOPSIS +To compile this module into the kernel, place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device rsufw" +.Ed +.Pp +This will include the firmware image, RTL8712, inside the kernel. +.Xr rsu 4 +will load the image into the chip. +.Pp +Alternatively, to load the firmware images as a module at boot time, place +the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +rsu-rtl8712fw_load="YES" +.Ed +.Sh DESCRIPTION +This module provides the firmware for the Realtek RTL8188SU and +RTL8192SU chip based USB WiFi adapters. +Please read Realtek's license, +.Pa /usr/share/license/realtek . +.Sh SEE ALSO +.Xr rsu 4 , +.Xr firmware 9 diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 2409ffb88ecf..86e89a7d1f2b 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -954,7 +954,9 @@ MLINKS+=microuptime.9 binuptime.9 \ microuptime.9 getbinuptime.9 \ microuptime.9 getmicrouptime.9 \ microuptime.9 getnanouptime.9 \ - microuptime.9 nanouptime.9 + microuptime.9 getsbinuptime.9 \ + microuptime.9 nanouptime.9 \ + microuptime.9 sbinuptime.9 MLINKS+=mi_switch.9 cpu_switch.9 \ mi_switch.9 cpu_throw.9 MLINKS+=mtx_pool.9 mtx_pool_alloc.9 \ diff --git a/share/man/man9/microuptime.9 b/share/man/man9/microuptime.9 index 8f9985f72aa9..5a9a71befd48 100644 --- a/share/man/man9/microuptime.9 +++ b/share/man/man9/microuptime.9 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 16, 2004 +.Dd July 25, 2013 .Dt MICROUPTIME 9 .Os .Sh NAME @@ -33,7 +33,9 @@ .Nm microuptime , .Nm getmicrouptime , .Nm nanouptime , -.Nm getnanouptime +.Nm getnanouptime , +.Nm sbinuptime , +.Nm getsbinuptime .Nd get the time elapsed since boot .Sh SYNOPSIS .In sys/time.h @@ -49,6 +51,10 @@ .Fn nanouptime "struct timespec *ts" .Ft void .Fn getnanouptime "struct timespec *tsp" +.Ft sbintime_t +.Fn sbinuptime "void" +.Ft sbintime_t +.Fn getsbinuptime "void" .Sh DESCRIPTION The .Fn binuptime @@ -71,28 +77,37 @@ and .Fn getnanouptime functions store the elapsed time as a .Vt "struct timespec" . +The +.Fn sbinuptime +and +.Fn getsbinuptime +functions return the time elapsed since boot as a +.Vt "sbintime_t" . .Pp The .Fn binuptime , .Fn microuptime , +.Fn nanouptime , and -.Fn nanouptime +.Fn sbinuptime functions always query the timecounter to return the current time as precisely as possible. Whereas .Fn getbinuptime , .Fn getmicrouptime , +.Fn getnanouptime , and -.Fn getnanouptime +.Fn getsbinuptime functions are abstractions which return a less precise, but faster to obtain, time. .Pp The intent of the .Fn getbinuptime , .Fn getmicrouptime , +.Fn getnanouptime , and -.Fn getnanouptime +.Fn getsbinuptime functions is to enforce the user's preference for timer accuracy versus execution time. .Sh SEE ALSO diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk index f2dc4c25fde7..08bcca1c51ee 100644 --- a/share/mk/bsd.own.mk +++ b/share/mk/bsd.own.mk @@ -364,7 +364,6 @@ __DEFAULT_YES_OPTIONS = \ ZONEINFO __DEFAULT_NO_OPTIONS = \ - BSD_PATCH \ BIND_IDN \ BIND_LARGE_FILE \ BIND_LIBS \ @@ -375,6 +374,7 @@ __DEFAULT_NO_OPTIONS = \ CLANG_EXTRAS \ CTF \ DEBUG_FILES \ + GNU_PATCH \ GPL_DTC \ HESIOD \ ICONV \ @@ -385,7 +385,8 @@ __DEFAULT_NO_OPTIONS = \ OFED \ OPENSSH_NONE_CIPHER \ SHARED_TOOLCHAIN \ - SVN + SVN \ + USB_GADGET_EXAMPLES # # Default behaviour of some options depends on the architecture. Unfortunately diff --git a/sys/amd64/amd64/identcpu.c b/sys/amd64/amd64/identcpu.c index e63affc2a7e0..27ea9a6d22ca 100644 --- a/sys/amd64/amd64/identcpu.c +++ b/sys/amd64/amd64/identcpu.c @@ -532,6 +532,13 @@ identify_cpu(void) } } + if (cpu_high >= 5 && (cpu_feature2 & CPUID2_MON) != 0) { + do_cpuid(5, regs); + cpu_mon_mwait_flags = regs[2]; + cpu_mon_min_size = regs[0] & CPUID5_MON_MIN_SIZE; + cpu_mon_max_size = regs[1] & CPUID5_MON_MAX_SIZE; + } + if (cpu_high >= 7) { cpuid_count(7, 0, regs); cpu_stdext_feature = regs[1]; diff --git a/sys/amd64/amd64/initcpu.c b/sys/amd64/amd64/initcpu.c index 4abed4c0e6a2..f7574b1cf176 100644 --- a/sys/amd64/amd64/initcpu.c +++ b/sys/amd64/amd64/initcpu.c @@ -75,6 +75,9 @@ u_int cpu_mxcsr_mask; /* Valid bits in mxcsr */ u_int cpu_clflush_line_size = 32; u_int cpu_stdext_feature; u_int cpu_max_ext_state_size; +u_int cpu_mon_mwait_flags; /* MONITOR/MWAIT flags (CPUID.05H.ECX) */ +u_int cpu_mon_min_size; /* MONITOR minimum range size, bytes */ +u_int cpu_mon_max_size; /* MONITOR minimum range size, bytes */ SYSCTL_UINT(_hw, OID_AUTO, via_feature_rng, CTLFLAG_RD, &via_feature_rng, 0, "VIA RNG feature available in CPU"); diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 19be4e01ba1b..d7e125b8d377 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -4401,6 +4401,7 @@ pmap_remove_pages(pmap_t pmap) int64_t bit; uint64_t inuse, bitmask; int allfree, field, freed, idx; + boolean_t superpage; vm_paddr_t pa; if (pmap != PCPU_GET(curpmap)) { @@ -4427,12 +4428,26 @@ pmap_remove_pages(pmap_t pmap) pte = pmap_pdpe_to_pde(pte, pv->pv_va); tpte = *pte; if ((tpte & (PG_PS | PG_V)) == PG_V) { + superpage = FALSE; ptepde = tpte; pte = (pt_entry_t *)PHYS_TO_DMAP(tpte & PG_FRAME); pte = &pte[pmap_pte_index(pv->pv_va)]; tpte = *pte; + } else { + /* + * Keep track whether 'tpte' is a + * superpage explicitly instead of + * relying on PG_PS being set. + * + * This is because PG_PS is numerically + * identical to PG_PTE_PAT and thus a + * regular page could be mistaken for + * a superpage. + */ + superpage = TRUE; } + if ((tpte & PG_V) == 0) { panic("bad pte va %lx pte %lx", pv->pv_va, tpte); @@ -4446,7 +4461,7 @@ pmap_remove_pages(pmap_t pmap) continue; } - if (tpte & PG_PS) + if (superpage) pa = tpte & PG_PS_FRAME; else pa = tpte & PG_FRAME; @@ -4468,7 +4483,7 @@ pmap_remove_pages(pmap_t pmap) * Update the vm_page_t clean/reference bits. */ if ((tpte & (PG_M | PG_RW)) == (PG_M | PG_RW)) { - if ((tpte & PG_PS) != 0) { + if (superpage) { for (mt = m; mt < &m[NBPDR / PAGE_SIZE]; mt++) vm_page_dirty(mt); } else @@ -4479,7 +4494,7 @@ pmap_remove_pages(pmap_t pmap) /* Mark free */ pc->pc_map[field] |= bitmask; - if ((tpte & PG_PS) != 0) { + if (superpage) { pmap_resident_count_dec(pmap, NBPDR / PAGE_SIZE); pvh = pa_to_pvh(tpte & PG_PS_FRAME); TAILQ_REMOVE(&pvh->pv_list, pv, pv_next); diff --git a/sys/amd64/amd64/sys_machdep.c b/sys/amd64/amd64/sys_machdep.c index 2f136ab55cdb..ac691d0f2bc4 100644 --- a/sys/amd64/amd64/sys_machdep.c +++ b/sys/amd64/amd64/sys_machdep.c @@ -356,8 +356,8 @@ amd64_set_ioperm(td, uap) */ pcb = td->td_pcb; if (pcb->pcb_tssp == NULL) { - tssp = (struct amd64tss *)kmem_alloc(kernel_map, - ctob(IOPAGES+1)); + tssp = (struct amd64tss *)kmem_malloc(kernel_map, + ctob(IOPAGES+1), M_WAITOK); if (tssp == NULL) return (ENOMEM); iomap = (char *)&tssp[1]; @@ -463,8 +463,9 @@ user_ldt_alloc(struct proc *p, int force) return (mdp->md_ldt); mtx_unlock(&dt_lock); new_ldt = malloc(sizeof(struct proc_ldt), M_SUBPROC, M_WAITOK); - new_ldt->ldt_base = (caddr_t)kmem_alloc(kernel_map, - max_ldt_segment * sizeof(struct user_segment_descriptor)); + new_ldt->ldt_base = (caddr_t)kmem_malloc(kernel_map, + max_ldt_segment * sizeof(struct user_segment_descriptor), + M_WAITOK); if (new_ldt->ldt_base == NULL) { FREE(new_ldt, M_SUBPROC); mtx_lock(&dt_lock); diff --git a/sys/amd64/include/md_var.h b/sys/amd64/include/md_var.h index 6ffcf633343d..34bfde4fb00b 100644 --- a/sys/amd64/include/md_var.h +++ b/sys/amd64/include/md_var.h @@ -58,6 +58,9 @@ extern u_int cpu_procinfo; extern u_int cpu_procinfo2; extern char cpu_vendor[]; extern u_int cpu_vendor_id; +extern u_int cpu_mon_mwait_flags; +extern u_int cpu_mon_min_size; +extern u_int cpu_mon_max_size; extern char ctx_switch_xsave[]; extern char kstack[]; extern char sigcode[]; diff --git a/sys/amd64/vmm/intel/vmx.c b/sys/amd64/vmm/intel/vmx.c index 79c5538490a7..cc18abe6b326 100644 --- a/sys/amd64/vmm/intel/vmx.c +++ b/sys/amd64/vmm/intel/vmx.c @@ -647,10 +647,10 @@ vmx_vpid(void) } static int -vmx_setup_cr_shadow(int which, struct vmcs *vmcs) +vmx_setup_cr_shadow(int which, struct vmcs *vmcs, uint32_t initial) { int error, mask_ident, shadow_ident; - uint64_t mask_value, shadow_value; + uint64_t mask_value; if (which != 0 && which != 4) panic("vmx_setup_cr_shadow: unknown cr%d", which); @@ -659,26 +659,24 @@ vmx_setup_cr_shadow(int which, struct vmcs *vmcs) mask_ident = VMCS_CR0_MASK; mask_value = cr0_ones_mask | cr0_zeros_mask; shadow_ident = VMCS_CR0_SHADOW; - shadow_value = cr0_ones_mask; } else { mask_ident = VMCS_CR4_MASK; mask_value = cr4_ones_mask | cr4_zeros_mask; shadow_ident = VMCS_CR4_SHADOW; - shadow_value = cr4_ones_mask; } error = vmcs_setreg(vmcs, 0, VMCS_IDENT(mask_ident), mask_value); if (error) return (error); - error = vmcs_setreg(vmcs, 0, VMCS_IDENT(shadow_ident), shadow_value); + error = vmcs_setreg(vmcs, 0, VMCS_IDENT(shadow_ident), initial); if (error) return (error); return (0); } -#define vmx_setup_cr0_shadow(vmcs) vmx_setup_cr_shadow(0, (vmcs)) -#define vmx_setup_cr4_shadow(vmcs) vmx_setup_cr_shadow(4, (vmcs)) +#define vmx_setup_cr0_shadow(vmcs,init) vmx_setup_cr_shadow(0, (vmcs), (init)) +#define vmx_setup_cr4_shadow(vmcs,init) vmx_setup_cr_shadow(4, (vmcs), (init)) static void * vmx_vminit(struct vm *vm) @@ -784,11 +782,17 @@ vmx_vminit(struct vm *vm) if (error != 0) panic("vmcs_set_msr_save error %d", error); - error = vmx_setup_cr0_shadow(&vmx->vmcs[i]); + /* + * Set up the CR0/4 shadows, and init the read shadow + * to the power-on register value from the Intel Sys Arch. + * CR0 - 0x60000010 + * CR4 - 0 + */ + error = vmx_setup_cr0_shadow(&vmx->vmcs[i], 0x60000010); if (error != 0) panic("vmx_setup_cr0_shadow %d", error); - error = vmx_setup_cr4_shadow(&vmx->vmcs[i]); + error = vmx_setup_cr4_shadow(&vmx->vmcs[i], 0); if (error != 0) panic("vmx_setup_cr4_shadow %d", error); } @@ -1079,7 +1083,7 @@ cantinject: static int vmx_emulate_cr_access(struct vmx *vmx, int vcpu, uint64_t exitqual) { - int error, cr, vmcs_guest_cr; + int error, cr, vmcs_guest_cr, vmcs_shadow_cr; uint64_t regval, ones_mask, zeros_mask; const struct vmxctx *vmxctx; @@ -1156,11 +1160,20 @@ vmx_emulate_cr_access(struct vmx *vmx, int vcpu, uint64_t exitqual) ones_mask = cr0_ones_mask; zeros_mask = cr0_zeros_mask; vmcs_guest_cr = VMCS_GUEST_CR0; + vmcs_shadow_cr = VMCS_CR0_SHADOW; } else { ones_mask = cr4_ones_mask; zeros_mask = cr4_zeros_mask; vmcs_guest_cr = VMCS_GUEST_CR4; + vmcs_shadow_cr = VMCS_CR4_SHADOW; + } + + error = vmwrite(vmcs_shadow_cr, regval); + if (error) { + panic("vmx_emulate_cr_access: error %d writing cr%d shadow", + error, cr); } + regval |= ones_mask; regval &= ~zeros_mask; error = vmwrite(vmcs_guest_cr, regval); @@ -1615,6 +1628,27 @@ vmxctx_setreg(struct vmxctx *vmxctx, int reg, uint64_t val) } static int +vmx_shadow_reg(int reg) +{ + int shreg; + + shreg = -1; + + switch (reg) { + case VM_REG_GUEST_CR0: + shreg = VMCS_CR0_SHADOW; + break; + case VM_REG_GUEST_CR4: + shreg = VMCS_CR4_SHADOW; + break; + default: + break; + } + + return (shreg); +} + +static int vmx_getreg(void *arg, int vcpu, int reg, uint64_t *retval) { int running, hostcpu; @@ -1633,7 +1667,7 @@ vmx_getreg(void *arg, int vcpu, int reg, uint64_t *retval) static int vmx_setreg(void *arg, int vcpu, int reg, uint64_t val) { - int error, hostcpu, running; + int error, hostcpu, running, shadow; uint64_t ctls; struct vmx *vmx = arg; @@ -1663,6 +1697,15 @@ vmx_setreg(void *arg, int vcpu, int reg, uint64_t val) vmcs_setreg(&vmx->vmcs[vcpu], running, VMCS_IDENT(VMCS_ENTRY_CTLS), ctls); } + + shadow = vmx_shadow_reg(reg); + if (shadow > 0) { + /* + * Store the unmodified value in the shadow + */ + error = vmcs_setreg(&vmx->vmcs[vcpu], running, + VMCS_IDENT(shadow), val); + } } return (error); diff --git a/sys/amd64/vmm/vmm.c b/sys/amd64/vmm/vmm.c index 67e9e60402ef..b4f3c33367af 100644 --- a/sys/amd64/vmm/vmm.c +++ b/sys/amd64/vmm/vmm.c @@ -224,8 +224,13 @@ vmm_handler(module_t mod, int what, void *arg) iommu_cleanup(); vmm_ipi_cleanup(); error = VMM_CLEANUP(); + /* + * Something bad happened - prevent new + * VMs from being created + */ + if (error) + vmm_initialized = 0; } - vmm_initialized = 0; break; default: error = 0; diff --git a/sys/amd64/vmm/vmm_instruction_emul.c b/sys/amd64/vmm/vmm_instruction_emul.c index 4e636498767e..f90443e624d0 100644 --- a/sys/amd64/vmm/vmm_instruction_emul.c +++ b/sys/amd64/vmm/vmm_instruction_emul.c @@ -60,6 +60,7 @@ enum { VIE_OP_TYPE_NONE = 0, VIE_OP_TYPE_MOV, VIE_OP_TYPE_AND, + VIE_OP_TYPE_OR, VIE_OP_TYPE_LAST }; @@ -94,7 +95,13 @@ static const struct vie_op one_byte_opcodes[256] = { .op_byte = 0x81, .op_type = VIE_OP_TYPE_AND, .op_flags = VIE_OP_F_IMM, - } + }, + [0x83] = { + /* XXX Group 1 extended opcode - not just OR */ + .op_byte = 0x83, + .op_type = VIE_OP_TYPE_OR, + .op_flags = VIE_OP_F_IMM8, + }, }; /* struct vie.mod */ @@ -338,8 +345,8 @@ emulate_and(void *vm, int vcpuid, uint64_t gpa, struct vie *vie, break; case 0x81: /* - * AND reg (ModRM:reg) with immediate and store the - * result in reg + * AND mem (ModRM:r/m) with immediate and store the + * result in mem. * * 81/ and r/m32, imm32 * REX.W + 81/ and r/m64, imm32 sign-extended to 64 @@ -371,6 +378,52 @@ emulate_and(void *vm, int vcpuid, uint64_t gpa, struct vie *vie, return (error); } +static int +emulate_or(void *vm, int vcpuid, uint64_t gpa, struct vie *vie, + mem_region_read_t memread, mem_region_write_t memwrite, void *arg) +{ + int error, size; + uint64_t val1; + + size = 4; + error = EINVAL; + + switch (vie->op.op_byte) { + case 0x83: + /* + * OR mem (ModRM:r/m) with immediate and store the + * result in mem. + * + * 83/ OR r/m32, imm8 sign-extended to 32 + * REX.W + 83/ OR r/m64, imm8 sign-extended to 64 + * + * Currently, only the OR operation of the 0x83 opcode + * is implemented (ModRM:reg = b001). + */ + if ((vie->reg & 7) != 1) + break; + + if (vie->rex_w) + size = 8; + + /* get the first operand */ + error = memread(vm, vcpuid, gpa, &val1, size, arg); + if (error) + break; + + /* + * perform the operation with the pre-fetched immediate + * operand and write the result + */ + val1 |= vie->immediate; + error = memwrite(vm, vcpuid, gpa, val1, size, arg); + break; + default: + break; + } + return (error); +} + int vmm_emulate_instruction(void *vm, int vcpuid, uint64_t gpa, struct vie *vie, mem_region_read_t memread, mem_region_write_t memwrite, @@ -390,6 +443,10 @@ vmm_emulate_instruction(void *vm, int vcpuid, uint64_t gpa, struct vie *vie, error = emulate_and(vm, vcpuid, gpa, vie, memread, memwrite, memarg); break; + case VIE_OP_TYPE_OR: + error = emulate_or(vm, vcpuid, gpa, vie, + memread, memwrite, memarg); + break; default: error = EINVAL; break; diff --git a/sys/arm/arm/busdma_machdep-v6.c b/sys/arm/arm/busdma_machdep-v6.c index d5da5c7a89c1..485b44a4c015 100644 --- a/sys/arm/arm/busdma_machdep-v6.c +++ b/sys/arm/arm/busdma_machdep-v6.c @@ -1197,11 +1197,6 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus_dmamap_t map, bus_dmasync_op_t op) } if (op & BUS_DMASYNC_POSTREAD) { - cpu_dcache_inv_range((vm_offset_t)bpage->vaddr, - bpage->datacount); - l2cache_inv_range((vm_offset_t)bpage->vaddr, - (vm_offset_t)bpage->busaddr, - bpage->datacount); while (bpage != NULL) { vm_offset_t startv; vm_paddr_t startp; diff --git a/sys/arm/arm/cpufunc.c b/sys/arm/arm/cpufunc.c index 4d9889e3af43..da2328389cc3 100644 --- a/sys/arm/arm/cpufunc.c +++ b/sys/arm/arm/cpufunc.c @@ -1476,7 +1476,8 @@ set_cpufuncs() } #endif /* CPU_ARM1136 || CPU_ARM1176 */ #ifdef CPU_CORTEXA - if (cputype == CPU_ID_CORTEXA8R1 || + if (cputype == CPU_ID_CORTEXA7 || + cputype == CPU_ID_CORTEXA8R1 || cputype == CPU_ID_CORTEXA8R2 || cputype == CPU_ID_CORTEXA8R3 || cputype == CPU_ID_CORTEXA9R1 || diff --git a/sys/arm/arm/identcpu.c b/sys/arm/arm/identcpu.c index 33cfa1e1fa44..fd3266674f78 100644 --- a/sys/arm/arm/identcpu.c +++ b/sys/arm/arm/identcpu.c @@ -236,6 +236,8 @@ const struct cpuidtab cpuids[] = { { CPU_ID_ARM1026EJS, CPU_CLASS_ARM10EJ, "ARM1026EJ-S", generic_steppings }, + { CPU_ID_CORTEXA7, CPU_CLASS_CORTEXA, "Cortex A7", + generic_steppings }, { CPU_ID_CORTEXA8R1, CPU_CLASS_CORTEXA, "Cortex A8-r1", generic_steppings }, { CPU_ID_CORTEXA8R2, CPU_CLASS_CORTEXA, "Cortex A8-r2", diff --git a/sys/arm/arm/pl310.c b/sys/arm/arm/pl310.c index 9d4fc4afe835..758b5e5f61db 100644 --- a/sys/arm/arm/pl310.c +++ b/sys/arm/arm/pl310.c @@ -79,6 +79,8 @@ static const uint32_t g_l2cache_line_size = 32; static const uint32_t g_l2cache_align_mask = (32 - 1); static uint32_t g_l2cache_size; +static uint32_t g_way_size; +static uint32_t g_ways_assoc; static struct pl310_softc *pl310_softc; @@ -146,16 +148,29 @@ pl310_wbinv_all(void) PL310_LOCK(pl310_softc); #ifdef PL310_ERRATA_727915 - if (pl310_softc->sc_rtl_revision == CACHE_ID_RELEASE_r2p0 || - pl310_softc->sc_rtl_revision == CACHE_ID_RELEASE_r3p0) + if (pl310_softc->sc_rtl_revision == CACHE_ID_RELEASE_r2p0) { + int i, j; + + for (i = 0; i < g_ways_assoc; i++) { + for (j = 0; j < g_way_size / g_l2cache_line_size; j++) { + pl310_write4(pl310_softc, + PL310_CLEAN_INV_LINE_IDX, + (i << 28 | j << 5)); + } + } + pl310_cache_sync(); + PL310_UNLOCK(pl310_softc); + return; + + } + if (pl310_softc->sc_rtl_revision == CACHE_ID_RELEASE_r3p0) platform_pl310_write_debug(pl310_softc, 3); #endif pl310_write4(pl310_softc, PL310_CLEAN_INV_WAY, g_l2cache_way_mask); pl310_wait_background_op(PL310_CLEAN_INV_WAY, g_l2cache_way_mask); pl310_cache_sync(); #ifdef PL310_ERRATA_727915 - if (pl310_softc->sc_rtl_revision == CACHE_ID_RELEASE_r2p0 || - pl310_softc->sc_rtl_revision == CACHE_ID_RELEASE_r3p0) + if (pl310_softc->sc_rtl_revision == CACHE_ID_RELEASE_r3p0) platform_pl310_write_debug(pl310_softc, 0); #endif PL310_UNLOCK(pl310_softc); @@ -278,8 +293,6 @@ pl310_attach(device_t dev) struct pl310_softc *sc = device_get_softc(dev); int rid = 0; uint32_t aux_value; - uint32_t way_size; - uint32_t ways_assoc; uint32_t ctrl_value; uint32_t cache_id; @@ -312,18 +325,18 @@ pl310_attach(device_t dev) (cache_id >> CACHE_ID_PARTNUM_SHIFT) & CACHE_ID_PARTNUM_MASK, (cache_id >> CACHE_ID_RELEASE_SHIFT) & CACHE_ID_RELEASE_MASK); aux_value = pl310_read4(sc, PL310_AUX_CTRL); - way_size = (aux_value & AUX_CTRL_WAY_SIZE_MASK) >> + g_way_size = (aux_value & AUX_CTRL_WAY_SIZE_MASK) >> AUX_CTRL_WAY_SIZE_SHIFT; - way_size = 1 << (way_size + 13); + g_way_size = 1 << (g_way_size + 13); if (aux_value & (1 << AUX_CTRL_ASSOCIATIVITY_SHIFT)) - ways_assoc = 16; + g_ways_assoc = 16; else - ways_assoc = 8; - g_l2cache_way_mask = (1 << ways_assoc) - 1; - g_l2cache_size = way_size * ways_assoc; + g_ways_assoc = 8; + g_l2cache_way_mask = (1 << g_ways_assoc) - 1; + g_l2cache_size = g_way_size * g_ways_assoc; /* Print the information */ device_printf(dev, "L2 Cache: %uKB/%dB %d ways\n", (g_l2cache_size / 1024), - g_l2cache_line_size, ways_assoc); + g_l2cache_line_size, g_ways_assoc); ctrl_value = pl310_read4(sc, PL310_CTRL); diff --git a/sys/arm/conf/BEAGLEBONE b/sys/arm/conf/BEAGLEBONE index f6fe35e2b872..997a62f61661 100644 --- a/sys/arm/conf/BEAGLEBONE +++ b/sys/arm/conf/BEAGLEBONE @@ -24,7 +24,6 @@ ident BEAGLEBONE include "../ti/am335x/std.beaglebone" -makeoptions MODULES_OVERRIDE="" makeoptions WITHOUT_MODULES="ahc" options HZ=100 diff --git a/sys/arm/conf/EFIKA_MX b/sys/arm/conf/EFIKA_MX index e2b4ddc27742..71edb8ca1988 100644 --- a/sys/arm/conf/EFIKA_MX +++ b/sys/arm/conf/EFIKA_MX @@ -19,7 +19,7 @@ ident EFIKA_MX -include "../freescale/imx/std.imx" +include "../freescale/imx/std.imx51" makeoptions WITHOUT_MODULES="ahc" diff --git a/sys/arm/conf/RPI-B b/sys/arm/conf/RPI-B index 474f6a9697bb..251bf55ac555 100644 --- a/sys/arm/conf/RPI-B +++ b/sys/arm/conf/RPI-B @@ -20,7 +20,6 @@ ident RPI-B include "../broadcom/bcm2835/std.rpi" -makeoptions MODULES_OVERRIDE="" makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols options HZ=100 diff --git a/sys/arm/freescale/imx/imx.files b/sys/arm/freescale/imx/files.imx51 index dd2a9752c4b9..dd2a9752c4b9 100644 --- a/sys/arm/freescale/imx/imx.files +++ b/sys/arm/freescale/imx/files.imx51 diff --git a/sys/arm/freescale/imx/std.imx b/sys/arm/freescale/imx/std.imx51 index 60903f68e220..6c70ef963d0e 100644 --- a/sys/arm/freescale/imx/std.imx +++ b/sys/arm/freescale/imx/std.imx51 @@ -11,5 +11,5 @@ makeoptions KERNPHYSADDR=0x90100000 options PHYSADDR=0x90000000 options STARTUP_PAGETABLE_ADDR=0x91000000 -files "../freescale/imx/imx.files" +files "../freescale/imx/files.imx51" diff --git a/sys/arm/include/armreg.h b/sys/arm/include/armreg.h index 049d140110ef..1ee3dd1fbce9 100644 --- a/sys/arm/include/armreg.h +++ b/sys/arm/include/armreg.h @@ -147,6 +147,7 @@ #define CPU_ID_ARM1136JS 0x4107b360 #define CPU_ID_ARM1136JSR1 0x4117b360 #define CPU_ID_ARM1176JZS 0x410fb760 +#define CPU_ID_CORTEXA7 0x410fc070 #define CPU_ID_CORTEXA8R1 0x411fc080 #define CPU_ID_CORTEXA8R2 0x412fc080 #define CPU_ID_CORTEXA8R3 0x413fc080 diff --git a/sys/arm/include/atomic.h b/sys/arm/include/atomic.h index 82b7d1b187ec..2bd08c16419d 100644 --- a/sys/arm/include/atomic.h +++ b/sys/arm/include/atomic.h @@ -52,8 +52,8 @@ #define dsb() __asm __volatile("dsb" : : : "memory") #define dmb() __asm __volatile("dmb" : : : "memory") #elif defined (__ARM_ARCH_6__) || defined (__ARM_ARCH_6J__) || \ - defined (__ARM_ARCH_6K__) || defined (__ARM_ARCH_6Z__) || \ - defined (__ARM_ARCH_6ZK__) + defined (__ARM_ARCH_6K__) || defined (__ARM_ARCH_6T2__) || \ + defined (__ARM_ARCH_6Z__) || defined (__ARM_ARCH_6ZK__) #define isb() __asm __volatile("mcr p15, 0, %0, c7, c5, 4" : : "r" (0) : "memory") #define dsb() __asm __volatile("mcr p15, 0, %0, c7, c10, 4" : : "r" (0) : "memory") #define dmb() __asm __volatile("mcr p15, 0, %0, c7, c10, 5" : : "r" (0) : "memory") @@ -81,11 +81,12 @@ * out of asm.h so it can be used in both asm and C code. - kientzle@ */ #if defined (__ARM_ARCH_7__) || \ - defined (__ARM_ARCH_7A__) || \ - defined (__ARM_ARCH_6__) || \ - defined (__ARM_ARCH_6J__) || \ - defined (__ARM_ARCH_6K__) || \ - defined (__ARM_ARCH_6Z__) || \ + defined (__ARM_ARCH_7A__) || \ + defined (__ARM_ARCH_6__) || \ + defined (__ARM_ARCH_6J__) || \ + defined (__ARM_ARCH_6K__) || \ + defined (__ARM_ARCH_6T2__) || \ + defined (__ARM_ARCH_6Z__) || \ defined (__ARM_ARCH_6ZK__) static __inline void __do_dmb(void) @@ -137,6 +138,7 @@ atomic_set_32(volatile uint32_t *address, uint32_t setmask) "orr %0, %0, %3\n" "strex %1, %0, [%2]\n" "cmp %1, #0\n" + "it ne\n" "bne 1b\n" : "=&r" (tmp), "+r" (tmp2) , "+r" (address), "+r" (setmask) : : "cc", "memory"); @@ -152,6 +154,7 @@ atomic_set_long(volatile u_long *address, u_long setmask) "orr %0, %0, %3\n" "strex %1, %0, [%2]\n" "cmp %1, #0\n" + "it ne\n" "bne 1b\n" : "=&r" (tmp), "+r" (tmp2) , "+r" (address), "+r" (setmask) : : "cc", "memory"); @@ -167,6 +170,7 @@ atomic_clear_32(volatile uint32_t *address, uint32_t setmask) "bic %0, %0, %3\n" "strex %1, %0, [%2]\n" "cmp %1, #0\n" + "it ne\n" "bne 1b\n" : "=&r" (tmp), "+r" (tmp2) ,"+r" (address), "+r" (setmask) : : "cc", "memory"); @@ -181,6 +185,7 @@ atomic_clear_long(volatile u_long *address, u_long setmask) "bic %0, %0, %3\n" "strex %1, %0, [%2]\n" "cmp %1, #0\n" + "it ne\n" "bne 1b\n" : "=&r" (tmp), "+r" (tmp2) ,"+r" (address), "+r" (setmask) : : "cc", "memory"); @@ -193,12 +198,14 @@ atomic_cmpset_32(volatile u_int32_t *p, volatile u_int32_t cmpval, volatile u_in __asm __volatile("1: ldrex %0, [%1]\n" "cmp %0, %2\n" + "it ne\n" "movne %0, #0\n" "bne 2f\n" "strex %0, %3, [%1]\n" "cmp %0, #0\n" - "bne 1b\n" + "ite eq\n" "moveq %0, #1\n" + "bne 1b\n" "2:" : "=&r" (ret) ,"+r" (p), "+r" (cmpval), "+r" (newval) : : "cc", @@ -213,12 +220,14 @@ atomic_cmpset_long(volatile u_long *p, volatile u_long cmpval, volatile u_long n __asm __volatile("1: ldrex %0, [%1]\n" "cmp %0, %2\n" + "itt ne\n" "movne %0, #0\n" "bne 2f\n" "strex %0, %3, [%1]\n" "cmp %0, #0\n" - "bne 1b\n" + "ite eq\n" "moveq %0, #1\n" + "bne 1b\n" "2:" : "=&r" (ret) ,"+r" (p), "+r" (cmpval), "+r" (newval) : : "cc", @@ -270,6 +279,7 @@ atomic_add_32(volatile u_int32_t *p, u_int32_t val) "add %0, %0, %3\n" "strex %1, %0, [%2]\n" "cmp %1, #0\n" + "it ne\n" "bne 1b\n" : "=&r" (tmp), "+r" (tmp2) ,"+r" (p), "+r" (val) : : "cc", "memory"); @@ -284,6 +294,7 @@ atomic_add_long(volatile u_long *p, u_long val) "add %0, %0, %3\n" "strex %1, %0, [%2]\n" "cmp %1, #0\n" + "it ne\n" "bne 1b\n" : "=&r" (tmp), "+r" (tmp2) ,"+r" (p), "+r" (val) : : "cc", "memory"); @@ -298,6 +309,7 @@ atomic_subtract_32(volatile u_int32_t *p, u_int32_t val) "sub %0, %0, %3\n" "strex %1, %0, [%2]\n" "cmp %1, #0\n" + "it ne\n" "bne 1b\n" : "=&r" (tmp), "+r" (tmp2) ,"+r" (p), "+r" (val) : : "cc", "memory"); @@ -312,6 +324,7 @@ atomic_subtract_long(volatile u_long *p, u_long val) "sub %0, %0, %3\n" "strex %1, %0, [%2]\n" "cmp %1, #0\n" + "it ne\n" "bne 1b\n" : "=&r" (tmp), "+r" (tmp2) ,"+r" (p), "+r" (val) : : "cc", "memory"); @@ -338,6 +351,7 @@ atomic_fetchadd_32(volatile uint32_t *p, uint32_t val) "add %1, %0, %4\n" "strex %2, %1, [%3]\n" "cmp %2, #0\n" + "it ne\n" "bne 1b\n" : "+r" (ret), "=&r" (tmp), "+r" (tmp2) ,"+r" (p), "+r" (val) : : "cc", "memory"); @@ -353,6 +367,7 @@ atomic_readandclear_32(volatile u_int32_t *p) "mov %1, #0\n" "strex %2, %1, [%3]\n" "cmp %2, #0\n" + "it ne\n" "bne 1b\n" : "=r" (ret), "=&r" (tmp), "+r" (tmp2) ,"+r" (p) : : "cc", "memory"); @@ -386,6 +401,7 @@ atomic_fetchadd_long(volatile u_long *p, u_long val) "add %1, %0, %4\n" "strex %2, %1, [%3]\n" "cmp %2, #0\n" + "it ne\n" "bne 1b\n" : "+r" (ret), "=&r" (tmp), "+r" (tmp2) ,"+r" (p), "+r" (val) : : "cc", "memory"); @@ -401,6 +417,7 @@ atomic_readandclear_long(volatile u_long *p) "mov %1, #0\n" "strex %2, %1, [%3]\n" "cmp %2, #0\n" + "it ne\n" "bne 1b\n" : "=r" (ret), "=&r" (tmp), "+r" (tmp2) ,"+r" (p) : : "cc", "memory"); diff --git a/sys/arm/include/kdb.h b/sys/arm/include/kdb.h index 3195945207f0..2f0b0877e28a 100644 --- a/sys/arm/include/kdb.h +++ b/sys/arm/include/kdb.h @@ -33,6 +33,8 @@ #include <machine/psl.h> #include <machine/cpufunc.h> +#define KDB_STOPPEDPCB(pc) &stoppcbs[pc->pc_cpuid] + static __inline void kdb_cpu_clear_singlestep(void) { diff --git a/sys/arm/include/smp.h b/sys/arm/include/smp.h index 3cf3cc184255..883c5b903528 100644 --- a/sys/arm/include/smp.h +++ b/sys/arm/include/smp.h @@ -4,6 +4,7 @@ #define _MACHINE_SMP_H_ #include <sys/_cpuset.h> +#include <machine/pcb.h> #define IPI_AST 0 #define IPI_PREEMPT 2 @@ -32,4 +33,7 @@ void platform_mp_init_secondary(void); void platform_ipi_send(cpuset_t cpus, u_int ipi); +/* global data in mp_machdep.c */ +extern struct pcb stoppcbs[]; + #endif /* !_MACHINE_SMP_H_ */ diff --git a/sys/arm/ti/am335x/am335x_prcm.c b/sys/arm/ti/am335x/am335x_prcm.c index 3e84764067ea..715153f6bdbb 100644 --- a/sys/arm/ti/am335x/am335x_prcm.c +++ b/sys/arm/ti/am335x/am335x_prcm.c @@ -78,15 +78,19 @@ __FBSDID("$FreeBSD$"); #define CM_PER_EPWMSS2_CLKCTRL (CM_PER + 0x0D8) #define CM_PER_L3_INSTR_CLKCTRL (CM_PER + 0x0DC) #define CM_PER_L3_CLKCTRL (CM_PER + 0x0E0) +#define CM_PER_PRUSS_CLKCTRL (CM_PER + 0x0E8) #define CM_PER_TIMER5_CLKCTRL (CM_PER + 0x0EC) #define CM_PER_TIMER6_CLKCTRL (CM_PER + 0x0F0) #define CM_PER_MMC1_CLKCTRL (CM_PER + 0x0F4) #define CM_PER_MMC2_CLKCTRL (CM_PER + 0x0F8) #define CM_PER_TPTC1_CLKCTRL (CM_PER + 0x0FC) #define CM_PER_TPTC2_CLKCTRL (CM_PER + 0x100) +#define CM_PER_SPINLOCK0_CLKCTRL (CM_PER + 0x10C) +#define CM_PER_MAILBOX0_CLKCTRL (CM_PER + 0x110) #define CM_PER_OCPWP_L3_CLKSTCTRL (CM_PER + 0x12C) #define CM_PER_OCPWP_CLKCTRL (CM_PER + 0x130) #define CM_PER_CPSW_CLKSTCTRL (CM_PER + 0x144) +#define CM_PER_PRUSS_CLKSTCTRL (CM_PER + 0x140) #define CM_WKUP 0x400 #define CM_WKUP_CLKSTCTRL (CM_WKUP + 0x000) @@ -107,6 +111,10 @@ __FBSDID("$FreeBSD$"); #define CLKSEL_TIMER4_CLK (CM_DPLL + 0x010) #define CLKSEL_TIMER5_CLK (CM_DPLL + 0x018) #define CLKSEL_TIMER6_CLK (CM_DPLL + 0x01C) +#define CLKSEL_PRUSS_OCP_CLK (CM_DPLL + 0x030) + +#define PRM_PER 0xC00 +#define PRM_PER_RSTCTRL (PRM_PER + 0x00) #define PRM_DEVICE_OFFSET 0xF00 #define PRM_RSTCTRL (PRM_DEVICE_OFFSET + 0x00) @@ -136,6 +144,7 @@ static void am335x_prcm_reset(void); static int am335x_clk_cpsw_activate(struct ti_clock_dev *clkdev); static int am335x_clk_musb0_activate(struct ti_clock_dev *clkdev); static int am335x_clk_lcdc_activate(struct ti_clock_dev *clkdev); +static int am335x_clk_pruss_activate(struct ti_clock_dev *clkdev); #define AM335X_GENERIC_CLOCK_DEV(i) \ { .id = (i), \ @@ -243,6 +252,23 @@ struct ti_clock_dev ti_clk_devmap[] = { AM335X_GENERIC_CLOCK_DEV(PWMSS1_CLK), AM335X_GENERIC_CLOCK_DEV(PWMSS2_CLK), + /* System Mailbox clock */ + AM335X_GENERIC_CLOCK_DEV(MAILBOX0_CLK), + + /* SPINLOCK */ + AM335X_GENERIC_CLOCK_DEV(SPINLOCK0_CLK), + + /* PRU-ICSS */ + { .id = PRUSS_CLK, + .clk_activate = am335x_clk_pruss_activate, + .clk_deactivate = NULL, + .clk_set_source = NULL, + .clk_accessible = NULL, + .clk_get_source_freq = NULL, + }, + + + { INVALID_CLK_IDENT, NULL, NULL, NULL, NULL } }; @@ -295,6 +321,9 @@ static struct am335x_clk_details g_am335x_clk_details[] = { _CLK_DETAIL(PWMSS1_CLK, CM_PER_EPWMSS1_CLKCTRL, 0), _CLK_DETAIL(PWMSS2_CLK, CM_PER_EPWMSS2_CLKCTRL, 0), + _CLK_DETAIL(MAILBOX0_CLK, CM_PER_MAILBOX0_CLKCTRL, 0), + _CLK_DETAIL(SPINLOCK0_CLK, CM_PER_SPINLOCK0_CLKCTRL, 0), + { INVALID_CLK_IDENT, 0}, }; @@ -628,7 +657,7 @@ am335x_clk_lcdc_activate(struct ti_clock_dev *clkdev) DELAY(10); /* - * For now set frequenct to 5xSYSFREQ + * For now set frequency to 5xSYSFREQ * More flexible control might be required */ prcm_write_4(CM_WKUP_CM_CLKSEL_DPLL_DISP, (5 << 8) | 0); @@ -654,3 +683,44 @@ am335x_clk_lcdc_activate(struct ti_clock_dev *clkdev) return (0); } + +static int +am335x_clk_pruss_activate(struct ti_clock_dev *clkdev) +{ + struct am335x_prcm_softc *sc = am335x_prcm_sc; + + if (sc == NULL) + return (ENXIO); + + /* Set MODULEMODE to ENABLE(2) */ + prcm_write_4(CM_PER_PRUSS_CLKCTRL, 2); + + /* Wait for MODULEMODE to become ENABLE(2) */ + while ((prcm_read_4(CM_PER_PRUSS_CLKCTRL) & 0x3) != 2) + DELAY(10); + + /* Set CLKTRCTRL to SW_WKUP(2) */ + prcm_write_4(CM_PER_PRUSS_CLKSTCTRL, 2); + + /* Wait for the 200 MHz OCP clock to become active */ + while ((prcm_read_4(CM_PER_PRUSS_CLKSTCTRL) & (1<<4)) == 0) + DELAY(10); + + /* Wait for the 200 MHz IEP clock to become active */ + while ((prcm_read_4(CM_PER_PRUSS_CLKSTCTRL) & (1<<5)) == 0) + DELAY(10); + + /* Wait for the 192 MHz UART clock to become active */ + while ((prcm_read_4(CM_PER_PRUSS_CLKSTCTRL) & (1<<6)) == 0) + DELAY(10); + + /* Select DISP DPLL as OCP clock */ + prcm_write_4(CLKSEL_PRUSS_OCP_CLK, 1); + while ((prcm_read_4(CLKSEL_PRUSS_OCP_CLK) & 0x3) != 1) + DELAY(10); + + /* Clear the RESET bit */ + prcm_write_4(PRM_PER_RSTCTRL, prcm_read_4(PRM_PER_RSTCTRL) & ~2); + + return (0); +} diff --git a/sys/arm/ti/ti_prcm.h b/sys/arm/ti/ti_prcm.h index 0c778b19c542..aa9ae7fd6594 100644 --- a/sys/arm/ti/ti_prcm.h +++ b/sys/arm/ti/ti_prcm.h @@ -149,6 +149,14 @@ typedef enum { PWMSS1_CLK, PWMSS2_CLK, + /* Mailbox modules */ + MAILBOX0_CLK = 1500, + + /* Spinlock modules */ + SPINLOCK0_CLK = 1600, + + PRUSS_CLK = 1700, + INVALID_CLK_IDENT } clk_ident_t; diff --git a/sys/boot/arm/uboot/Makefile b/sys/boot/arm/uboot/Makefile index f2cf8ee358d2..236e3f34dc18 100644 --- a/sys/boot/arm/uboot/Makefile +++ b/sys/boot/arm/uboot/Makefile @@ -134,7 +134,20 @@ ldscript.generated:: mv ldscript.generated.tmp ldscript.generated; \ fi +.if !defined(LOADER_ONLY) .PATH: ${.CURDIR}/../../forth -FILES= loader.help +FILES+= loader.help loader.4th support.4th loader.conf +FILES+= screen.4th frames.4th beastie.4th +FILES+= brand.4th check-password.4th color.4th delay.4th +FILES+= menu.4th menu-commands.4th menusets.4th shortcuts.4th version.4th +FILESDIR_loader.conf= /boot/defaults + +# Put sample loader.rc and menu.rc on disk but don't enable them +# by default. +FILES+= loader.rc +FILESNAME_loader.rc= loader.rc.sample +FILES+= menu.rc +FILESNAME_menu.rc= menu.rc.sample +.endif .include <bsd.prog.mk> diff --git a/sys/boot/fdt/dts/am335x.dtsi b/sys/boot/fdt/dts/am335x.dtsi index 1ab047f2bd7e..90fb74191356 100644 --- a/sys/boot/fdt/dts/am335x.dtsi +++ b/sys/boot/fdt/dts/am335x.dtsi @@ -219,5 +219,24 @@ /* 1 - Host Mode, 0 - Device Mode */ modemask = <2>; }; + + mbox0@480C8000 { + compatible = "am335x,system-mbox"; + reg = < 0x480C8000 0x1000 >; + interrupts = <77>; + interrupt-parent = <&AINTC>; + }; + + spinlock0@480CA000 { + compatible = "am335x,spinlock"; + reg = < 0x480CA000 0x1000 >; + }; + + pruss@4A300000 { + compatible = "ti,pruss-v2"; + reg = <0x4A300000 0x80000>; + interrupt-parent = <&AINTC>; + interrupts = <20 21 22 23 24 25 26 27>; + }; }; }; diff --git a/sys/boot/ficl/loader.c b/sys/boot/ficl/loader.c index 939affc10ac7..03ef95fa7a8d 100644 --- a/sys/boot/ficl/loader.c +++ b/sys/boot/ficl/loader.c @@ -33,7 +33,13 @@ *******************************************************************/ #ifdef TESTMAIN +#include <sys/types.h> +#include <sys/stat.h> +#include <dirent.h> +#include <fcntl.h> +#include <stdio.h> #include <stdlib.h> +#include <unistd.h> #else #include <stand.h> #endif @@ -135,9 +141,9 @@ void ficlGetenv(FICL_VM *pVM) { #ifndef TESTMAIN - char *name; + char *name, *value; #endif - char *namep, *value; + char *namep; int names; #if FICL_ROBUST > 1 @@ -243,9 +249,9 @@ void ficlFindfile(FICL_VM *pVM) { #ifndef TESTMAIN - char *name; + char *name, *type; #endif - char *type, *namep, *typep; + char *namep, *typep; struct preloaded_file* fp; int names, types; @@ -511,6 +517,14 @@ static void pfread(FICL_VM *pVM) */ static void pfreaddir(FICL_VM *pVM) { +#ifdef TESTMAIN + static union { + struct dirent dirent; + char buf[512]; + } u; + off_t off; + int len; +#endif struct dirent *d; int fd; @@ -519,7 +533,20 @@ static void pfreaddir(FICL_VM *pVM) #endif fd = stackPopINT(pVM->pStack); +#if TESTMAIN + /* + * The readdirfd() function is specific to the loader environment. + * We do the best we can to make freaddir work, but it's not at + * all guaranteed. + */ + off = lseek(fd, 0LL, SEEK_CUR); + len = getdents(fd, u.buf, sizeof(u.buf)); + d = (len != -1) ? &u.dirent : NULL; + if (d != NULL) + lseek(fd, off + d->d_reclen, SEEK_SET); +#else d = readdirfd(fd); +#endif if (d != NULL) { stackPushPtr(pVM->pStack, d->d_name); stackPushINT(pVM->pStack, strlen(d->d_name)); diff --git a/sys/boot/forth/loader.rc b/sys/boot/forth/loader.rc index 0f9d37eff018..1130cc97ffee 100644 --- a/sys/boot/forth/loader.rc +++ b/sys/boot/forth/loader.rc @@ -10,5 +10,9 @@ start \ Tests for password -- executes autoboot first if a password was defined check-password +\ Uncomment to enable boot menu +\ include /boot/beastie.4th +\ beastie-start + \ Unless set otherwise, autoboot is automatic at this point diff --git a/sys/cam/ata/ata_da.c b/sys/cam/ata/ata_da.c index 6e9c4626d258..f2012315d65b 100644 --- a/sys/cam/ata/ata_da.c +++ b/sys/cam/ata/ata_da.c @@ -86,7 +86,8 @@ typedef enum { ADA_FLAG_SCTX_INIT = 0x0200, ADA_FLAG_CAN_CFA = 0x0400, ADA_FLAG_CAN_POWERMGT = 0x0800, - ADA_FLAG_CAN_DMA48 = 0x1000 + ADA_FLAG_CAN_DMA48 = 0x1000, + ADA_FLAG_DIRTY = 0x2000 } ada_flags; typedef enum { @@ -602,6 +603,7 @@ adaclose(struct disk *dp) struct cam_periph *periph; struct ada_softc *softc; union ccb *ccb; + int error; periph = (struct cam_periph *)dp->d_drv1; cam_periph_lock(periph); @@ -617,7 +619,8 @@ adaclose(struct disk *dp) ("adaclose\n")); /* We only sync the cache if the drive is capable of it. */ - if ((softc->flags & ADA_FLAG_CAN_FLUSHCACHE) != 0 && + if ((softc->flags & ADA_FLAG_DIRTY) != 0 && + (softc->flags & ADA_FLAG_CAN_FLUSHCACHE) != 0 && (periph->flags & CAM_PERIPH_INVALID) == 0) { ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); @@ -634,11 +637,13 @@ adaclose(struct disk *dp) ata_48bit_cmd(&ccb->ataio, ATA_FLUSHCACHE48, 0, 0, 0); else ata_28bit_cmd(&ccb->ataio, ATA_FLUSHCACHE, 0, 0, 0); - cam_periph_runccb(ccb, adaerror, /*cam_flags*/0, + error = cam_periph_runccb(ccb, adaerror, /*cam_flags*/0, /*sense_flags*/0, softc->disk->d_devstat); - if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) + if (error != 0) xpt_print(periph->path, "Synchronize cache failed\n"); + else + softc->flags &= ~ADA_FLAG_DIRTY; xpt_release_ccb(ccb); } @@ -1479,8 +1484,10 @@ adastart(struct cam_periph *periph, union ccb *start_ccb) tag_code = 1; } switch (bp->bio_cmd) { - case BIO_READ: case BIO_WRITE: + softc->flags |= ADA_FLAG_DIRTY; + /* FALLTHROUGH */ + case BIO_READ: { uint64_t lba = bp->bio_pblkno; uint16_t count = bp->bio_bcount / softc->params.secsize; @@ -1677,6 +1684,7 @@ adadone(struct cam_periph *periph, union ccb *done_ccb) struct ccb_ataio *ataio; struct ccb_getdev *cgd; struct cam_path *path; + int state; softc = (struct ada_softc *)periph->softc; ataio = &done_ccb->ataio; @@ -1684,31 +1692,20 @@ adadone(struct cam_periph *periph, union ccb *done_ccb) CAM_DEBUG(path, CAM_DEBUG_TRACE, ("adadone\n")); - switch (ataio->ccb_h.ccb_state & ADA_CCB_TYPE_MASK) { + state = ataio->ccb_h.ccb_state & ADA_CCB_TYPE_MASK; + switch (state) { case ADA_CCB_BUFFER_IO: case ADA_CCB_TRIM: { struct bio *bp; + int error; - bp = (struct bio *)done_ccb->ccb_h.ccb_bp; if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { - int error; - error = adaerror(done_ccb, 0, 0); if (error == ERESTART) { /* A retry was scheduled, so just return. */ return; } - if (error != 0) { - bp->bio_error = error; - bp->bio_resid = bp->bio_bcount; - bp->bio_flags |= BIO_ERROR; - } else { - bp->bio_resid = ataio->resid; - bp->bio_error = 0; - if (bp->bio_resid != 0) - bp->bio_flags |= BIO_ERROR; - } if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) cam_release_devq(path, /*relsim_flags*/0, @@ -1718,26 +1715,38 @@ adadone(struct cam_periph *periph, union ccb *done_ccb) } else { if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) panic("REQ_CMP with QFRZN"); - bp->bio_resid = ataio->resid; - if (ataio->resid > 0) + error = 0; + } + bp = (struct bio *)done_ccb->ccb_h.ccb_bp; + bp->bio_error = error; + if (error != 0) { + bp->bio_resid = bp->bio_bcount; + bp->bio_flags |= BIO_ERROR; + } else { + if (state == ADA_CCB_TRIM) + bp->bio_resid = 0; + else + bp->bio_resid = ataio->resid; + if (bp->bio_resid > 0) bp->bio_flags |= BIO_ERROR; } softc->outstanding_cmds--; if (softc->outstanding_cmds == 0) softc->flags |= ADA_FLAG_WENT_IDLE; - if ((ataio->ccb_h.ccb_state & ADA_CCB_TYPE_MASK) == - ADA_CCB_TRIM) { + if (state == ADA_CCB_TRIM) { struct trim_request *req = (struct trim_request *)ataio->data_ptr; int i; for (i = 1; i < TRIM_MAX_BIOS && req->bps[i]; i++) { struct bio *bp1 = req->bps[i]; - - bp1->bio_resid = bp->bio_resid; + bp1->bio_error = bp->bio_error; - if (bp->bio_flags & BIO_ERROR) + if (bp->bio_flags & BIO_ERROR) { bp1->bio_flags |= BIO_ERROR; + bp1->bio_resid = bp1->bio_bcount; + } else + bp1->bio_resid = 0; biodone(bp1); } softc->trim_running = 0; diff --git a/sys/cam/cam_ccb.h b/sys/cam/cam_ccb.h index 04ed592297c6..401206814c60 100644 --- a/sys/cam/cam_ccb.h +++ b/sys/cam/cam_ccb.h @@ -571,6 +571,7 @@ typedef enum { PIM_NO_6_BYTE = 0x08, /* Do not send 6-byte commands */ PIM_SEQSCAN = 0x04, /* Do bus scans sequentially, not in parallel */ PIM_UNMAPPED = 0x02, + PIM_NOSCAN = 0x01 /* SIM does its own scanning */ } pi_miscflag; /* Path Inquiry CCB */ diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c index 8f2c93e96a16..aac1be2f1efe 100644 --- a/sys/cam/cam_xpt.c +++ b/sys/cam/cam_xpt.c @@ -3895,18 +3895,23 @@ xpt_bus_register(struct cam_sim *sim, device_t parent, u_int32_t bus) /* Notify interested parties */ if (sim->path_id != CAM_XPT_PATH_ID) { - union ccb *scan_ccb; xpt_async(AC_PATH_REGISTERED, path, &cpi); - /* Initiate bus rescan. */ - scan_ccb = xpt_alloc_ccb_nowait(); - if (scan_ccb != NULL) { - scan_ccb->ccb_h.path = path; - scan_ccb->ccb_h.func_code = XPT_SCAN_BUS; - scan_ccb->crcn.flags = 0; - xpt_rescan(scan_ccb); + if ((cpi.hba_misc & PIM_NOSCAN) == 0) { + union ccb *scan_ccb; + + /* Initiate bus rescan. */ + scan_ccb = xpt_alloc_ccb_nowait(); + if (scan_ccb != NULL) { + scan_ccb->ccb_h.path = path; + scan_ccb->ccb_h.func_code = XPT_SCAN_BUS; + scan_ccb->crcn.flags = 0; + xpt_rescan(scan_ccb); + } else + xpt_print(path, + "Can't allocate CCB to scan bus\n"); } else - xpt_print(path, "Can't allocate CCB to scan bus\n"); + xpt_free_path(path); } else xpt_free_path(path); return (CAM_SUCCESS); diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c index a2b802cc669e..8e74fe9e7176 100644 --- a/sys/cam/scsi/scsi_da.c +++ b/sys/cam/scsi/scsi_da.c @@ -89,7 +89,8 @@ typedef enum { DA_FLAG_OPEN = 0x100, DA_FLAG_SCTX_INIT = 0x200, DA_FLAG_CAN_RC16 = 0x400, - DA_FLAG_PROBED = 0x800 + DA_FLAG_PROBED = 0x800, + DA_FLAG_DIRTY = 0x1000 } da_flags; typedef enum { @@ -97,7 +98,8 @@ typedef enum { DA_Q_NO_SYNC_CACHE = 0x01, DA_Q_NO_6_BYTE = 0x02, DA_Q_NO_PREVENT = 0x04, - DA_Q_4K = 0x08 + DA_Q_4K = 0x08, + DA_Q_NO_RC16 = 0x10 } da_quirks; #define DA_Q_BIT_STRING \ @@ -105,7 +107,8 @@ typedef enum { "\001NO_SYNC_CACHE" \ "\002NO_6_BYTE" \ "\003NO_PREVENT" \ - "\0044K" + "\0044K" \ + "\005NO_RC16" typedef enum { DA_CCB_PROBE_RC = 0x01, @@ -679,6 +682,11 @@ static struct da_quirk_entry da_quirk_table[] = {T_DIRECT, SIP_MEDIA_REMOVABLE, "Kingston", "DataTraveler G3", "1.00"}, /*quirks*/ DA_Q_NO_PREVENT }, + { + /* At least several Transcent USB sticks lie on RC16. */ + {T_DIRECT, SIP_MEDIA_REMOVABLE, "JetFlash", "Transcend*", + "*"}, /*quirks*/ DA_Q_NO_RC16 + }, /* ATA/SATA devices over SAS/USB/... */ { /* Hitachi Advanced Format (4k) drives */ @@ -1237,6 +1245,7 @@ daclose(struct disk *dp) { struct cam_periph *periph; struct da_softc *softc; + int error; periph = (struct cam_periph *)dp->d_drv1; cam_periph_lock(periph); @@ -1251,8 +1260,9 @@ daclose(struct disk *dp) CAM_DEBUG(periph->path, CAM_DEBUG_TRACE | CAM_DEBUG_PERIPH, ("daclose\n")); - if ((softc->quirks & DA_Q_NO_SYNC_CACHE) == 0 - && (softc->flags & DA_FLAG_PACK_INVALID) == 0) { + if ((softc->flags & DA_FLAG_DIRTY) != 0 && + (softc->quirks & DA_Q_NO_SYNC_CACHE) == 0 && + (softc->flags & DA_FLAG_PACK_INVALID) == 0) { union ccb *ccb; ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); @@ -1266,9 +1276,11 @@ daclose(struct disk *dp) SSD_FULL_SIZE, 5 * 60 * 1000); - cam_periph_runccb(ccb, daerror, /*cam_flags*/0, + error = cam_periph_runccb(ccb, daerror, /*cam_flags*/0, /*sense_flags*/SF_RETRY_UA | SF_QUIET_IR, softc->disk->d_devstat); + if (error == 0) + softc->flags &= ~DA_FLAG_DIRTY; xpt_release_ccb(ccb); } @@ -2070,7 +2082,8 @@ daregister(struct cam_periph *periph, void *arg) softc->minimum_cmd_size = 16; /* Predict whether device may support READ CAPACITY(16). */ - if (SID_ANSI_REV(&cgd->inq_data) >= SCSI_REV_SPC3) { + if (SID_ANSI_REV(&cgd->inq_data) >= SCSI_REV_SPC3 && + (softc->quirks & DA_Q_NO_RC16) == 0) { softc->flags |= DA_FLAG_CAN_RC16; softc->state = DA_STATE_PROBE_RC16; } @@ -2240,8 +2253,10 @@ skipstate: } switch (bp->bio_cmd) { - case BIO_READ: case BIO_WRITE: + softc->flags |= DA_FLAG_DIRTY; + /* FALLTHROUGH */ + case BIO_READ: scsi_read_write(&start_ccb->csio, /*retries*/da_retry_count, /*cbfcnp*/dadone, @@ -2786,6 +2801,28 @@ cmd6workaround(union ccb *ccb) return (0); } + /* Detect unsupported PREVENT ALLOW MEDIUM REMOVAL. */ + if ((ccb->ccb_h.flags & CAM_CDB_POINTER) == 0 && + (*cdb == PREVENT_ALLOW) && + (softc->quirks & DA_Q_NO_PREVENT) == 0) { + if (bootverbose) + xpt_print(ccb->ccb_h.path, + "PREVENT ALLOW MEDIUM REMOVAL not supported.\n"); + softc->quirks |= DA_Q_NO_PREVENT; + return (0); + } + + /* Detect unsupported SYNCHRONIZE CACHE(10). */ + if ((ccb->ccb_h.flags & CAM_CDB_POINTER) == 0 && + (*cdb == SYNCHRONIZE_CACHE) && + (softc->quirks & DA_Q_NO_SYNC_CACHE) == 0) { + if (bootverbose) + xpt_print(ccb->ccb_h.path, + "SYNCHRONIZE CACHE(10) not supported.\n"); + softc->quirks |= DA_Q_NO_SYNC_CACHE; + return (0); + } + /* Translation only possible if CDB is an array and cmd is R/W6 */ if ((ccb->ccb_h.flags & CAM_CDB_POINTER) != 0 || (*cdb != READ_6 && *cdb != WRITE_6)) @@ -2892,7 +2929,10 @@ dadone(struct cam_periph *periph, union ccb *done_ccb) bp->bio_flags |= BIO_ERROR; } } else if (bp != NULL) { - bp->bio_resid = csio->resid; + if (state == DA_CCB_DELETE) + bp->bio_resid = 0; + else + bp->bio_resid = csio->resid; bp->bio_error = 0; if (bp->bio_resid != 0) bp->bio_flags |= BIO_ERROR; @@ -2906,7 +2946,10 @@ dadone(struct cam_periph *periph, union ccb *done_ccb) } else if (bp != NULL) { if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) panic("REQ_CMP with QFRZN"); - bp->bio_resid = csio->resid; + if (state == DA_CCB_DELETE) + bp->bio_resid = 0; + else + bp->bio_resid = csio->resid; if (csio->resid > 0) bp->bio_flags |= BIO_ERROR; if (softc->error_inject != 0) { @@ -2915,7 +2958,6 @@ dadone(struct cam_periph *periph, union ccb *done_ccb) bp->bio_flags |= BIO_ERROR; softc->error_inject = 0; } - } /* @@ -2930,10 +2972,12 @@ dadone(struct cam_periph *periph, union ccb *done_ccb) if (state == DA_CCB_DELETE) { while ((bp1 = bioq_takefirst(&softc->delete_run_queue)) != NULL) { - bp1->bio_resid = bp->bio_resid; bp1->bio_error = bp->bio_error; - if (bp->bio_flags & BIO_ERROR) + if (bp->bio_flags & BIO_ERROR) { bp1->bio_flags |= BIO_ERROR; + bp1->bio_resid = bp1->bio_bcount; + } else + bp1->bio_resid = 0; biodone(bp1); } softc->delete_running = 0; diff --git a/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c b/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c index 4243c20ecdf7..4bdc946b9b29 100644 --- a/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c +++ b/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c @@ -395,6 +395,8 @@ zfs_prop_init(void) PROP_READONLY, ZFS_TYPE_DATASET, "UNIQUE"); zprop_register_hidden(ZFS_PROP_OBJSETID, "objsetid", PROP_TYPE_NUMBER, PROP_READONLY, ZFS_TYPE_DATASET, "OBJSETID"); + zprop_register_hidden(ZFS_PROP_INCONSISTENT, "inconsistent", + PROP_TYPE_NUMBER, PROP_READONLY, ZFS_TYPE_DATASET, "INCONSISTENT"); /* oddball properties */ zprop_register_impl(ZFS_PROP_CREATION, "creation", PROP_TYPE_NUMBER, 0, diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c index 28aa33049db4..759fd7af36dd 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c @@ -27,6 +27,7 @@ #include <sys/zfs_context.h> #include <sys/dmu.h> +#include <sys/dmu_send.h> #include <sys/dmu_impl.h> #include <sys/dbuf.h> #include <sys/dmu_objset.h> @@ -796,9 +797,12 @@ dbuf_unoverride(dbuf_dirty_record_t *dr) /* * Evict (if its unreferenced) or clear (if its referenced) any level-0 * data blocks in the free range, so that any future readers will find - * empty blocks. Also, if we happen accross any level-1 dbufs in the + * empty blocks. Also, if we happen across any level-1 dbufs in the * range that have not already been marked dirty, mark them dirty so * they stay in memory. + * + * This is a no-op if the dataset is in the middle of an incremental + * receive; see comment below for details. */ void dbuf_free_range(dnode_t *dn, uint64_t start, uint64_t end, dmu_tx_t *tx) @@ -814,6 +818,20 @@ dbuf_free_range(dnode_t *dn, uint64_t start, uint64_t end, dmu_tx_t *tx) last_l1 = end >> epbs; } dprintf_dnode(dn, "start=%llu end=%llu\n", start, end); + + if (dmu_objset_is_receiving(dn->dn_objset)) { + /* + * When processing a free record from a zfs receive, + * there should have been no previous modifications to the + * data in this range. Therefore there should be no dbufs + * in the range. Searching dn_dbufs for these non-existent + * dbufs can be very expensive, so simply ignore this. + */ + VERIFY3P(dbuf_find(dn, 0, start), ==, NULL); + VERIFY3P(dbuf_find(dn, 0, end), ==, NULL); + return; + } + mutex_enter(&dn->dn_dbufs_mtx); for (db = list_head(&dn->dn_dbufs); db; db = db_next) { db_next = list_next(&dn->dn_dbufs, db); diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c index 572b02a16c79..46bf3bfeb234 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c @@ -517,6 +517,38 @@ dmu_objset_rele(objset_t *os, void *tag) dsl_pool_rele(dp, tag); } +/* + * When we are called, os MUST refer to an objset associated with a dataset + * that is owned by 'tag'; that is, is held and long held by 'tag' and ds_owner + * == tag. We will then release and reacquire ownership of the dataset while + * holding the pool config_rwlock to avoid intervening namespace or ownership + * changes may occur. + * + * This exists solely to accommodate zfs_ioc_userspace_upgrade()'s desire to + * release the hold on its dataset and acquire a new one on the dataset of the + * same name so that it can be partially torn down and reconstructed. + */ +void +dmu_objset_refresh_ownership(objset_t *os, void *tag) +{ + dsl_pool_t *dp; + dsl_dataset_t *ds, *newds; + char name[MAXNAMELEN]; + + ds = os->os_dsl_dataset; + VERIFY3P(ds, !=, NULL); + VERIFY3P(ds->ds_owner, ==, tag); + VERIFY(dsl_dataset_long_held(ds)); + + dsl_dataset_name(ds, name); + dp = dmu_objset_pool(os); + dsl_pool_config_enter(dp, FTAG); + dmu_objset_disown(os, tag); + VERIFY0(dsl_dataset_own(dp, name, tag, &newds)); + VERIFY3P(newds, ==, os->os_dsl_dataset); + dsl_pool_config_exit(dp, FTAG); +} + void dmu_objset_disown(objset_t *os, void *tag) { diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c index 5da0700de456..f63625399a38 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c @@ -96,6 +96,32 @@ dump_free(dmu_sendarg_t *dsp, uint64_t object, uint64_t offset, { struct drr_free *drrf = &(dsp->dsa_drr->drr_u.drr_free); + /* + * When we receive a free record, dbuf_free_range() assumes + * that the receiving system doesn't have any dbufs in the range + * being freed. This is always true because there is a one-record + * constraint: we only send one WRITE record for any given + * object+offset. We know that the one-record constraint is + * true because we always send data in increasing order by + * object,offset. + * + * If the increasing-order constraint ever changes, we should find + * another way to assert that the one-record constraint is still + * satisfied. + */ + ASSERT(object > dsp->dsa_last_data_object || + (object == dsp->dsa_last_data_object && + offset > dsp->dsa_last_data_offset)); + + /* + * If we are doing a non-incremental send, then there can't + * be any data in the dataset we're receiving into. Therefore + * a free record would simply be a no-op. Save space by not + * sending it to begin with. + */ + if (!dsp->dsa_incremental) + return (0); + if (length != -1ULL && offset + length < offset) length = -1ULL; @@ -162,6 +188,15 @@ dump_data(dmu_sendarg_t *dsp, dmu_object_type_t type, { struct drr_write *drrw = &(dsp->dsa_drr->drr_u.drr_write); + /* + * We send data in increasing object, offset order. + * See comment in dump_free() for details. + */ + ASSERT(object > dsp->dsa_last_data_object || + (object == dsp->dsa_last_data_object && + offset > dsp->dsa_last_data_offset)); + dsp->dsa_last_data_object = object; + dsp->dsa_last_data_offset = offset + blksz - 1; /* * If there is any kind of pending aggregation (currently either @@ -229,6 +264,10 @@ dump_freeobjects(dmu_sendarg_t *dsp, uint64_t firstobj, uint64_t numobjs) { struct drr_freeobjects *drrfo = &(dsp->dsa_drr->drr_u.drr_freeobjects); + /* See comment in dump_free(). */ + if (!dsp->dsa_incremental) + return (0); + /* * If there is a pending op, but it's not PENDING_FREEOBJECTS, * push it out, since free block aggregation can only be done for @@ -305,9 +344,9 @@ dump_dnode(dmu_sendarg_t *dsp, uint64_t object, dnode_phys_t *dnp) if (dump_bytes(dsp, DN_BONUS(dnp), P2ROUNDUP(dnp->dn_bonuslen, 8)) != 0) return (SET_ERROR(EINTR)); - /* free anything past the end of the file */ + /* Free anything past the end of the file. */ if (dump_free(dsp, object, (dnp->dn_maxblkid + 1) * - (dnp->dn_datablkszsec << SPA_MINBLOCKSHIFT), -1ULL)) + (dnp->dn_datablkszsec << SPA_MINBLOCKSHIFT), -1ULL) != 0) return (SET_ERROR(EINTR)); if (dsp->dsa_err != 0) return (SET_ERROR(EINTR)); @@ -495,6 +534,7 @@ dmu_send_impl(void *tag, dsl_pool_t *dp, dsl_dataset_t *ds, dsp->dsa_toguid = ds->ds_phys->ds_guid; ZIO_SET_CHECKSUM(&dsp->dsa_zc, 0, 0, 0, 0); dsp->dsa_pending_op = PENDING_NONE; + dsp->dsa_incremental = (fromtxg != 0); mutex_enter(&ds->ds_sendstream_lock); list_insert_head(&ds->ds_sendstreams, dsp); @@ -683,6 +723,7 @@ typedef struct dmu_recv_begin_arg { const char *drba_origin; dmu_recv_cookie_t *drba_cookie; cred_t *drba_cred; + uint64_t drba_snapobj; } dmu_recv_begin_arg_t; static int @@ -693,11 +734,6 @@ recv_begin_check_existing_impl(dmu_recv_begin_arg_t *drba, dsl_dataset_t *ds, int error; dsl_pool_t *dp = ds->ds_dir->dd_pool; - /* must not have any changes since most recent snapshot */ - if (!drba->drba_cookie->drc_force && - dsl_dataset_modified_since_lastsnap(ds)) - return (SET_ERROR(ETXTBSY)); - /* temporary clone name must not exist */ error = zap_lookup(dp->dp_meta_objset, ds->ds_dir->dd_phys->dd_child_dir_zapobj, recv_clone_name, @@ -713,41 +749,47 @@ recv_begin_check_existing_impl(dmu_recv_begin_arg_t *drba, dsl_dataset_t *ds, return (error == 0 ? EEXIST : error); if (fromguid != 0) { - /* if incremental, most recent snapshot must match fromguid */ - if (ds->ds_prev == NULL) + dsl_dataset_t *snap; + uint64_t obj = ds->ds_phys->ds_prev_snap_obj; + + /* Find snapshot in this dir that matches fromguid. */ + while (obj != 0) { + error = dsl_dataset_hold_obj(dp, obj, FTAG, + &snap); + if (error != 0) + return (SET_ERROR(ENODEV)); + if (snap->ds_dir != ds->ds_dir) { + dsl_dataset_rele(snap, FTAG); + return (SET_ERROR(ENODEV)); + } + if (snap->ds_phys->ds_guid == fromguid) + break; + obj = snap->ds_phys->ds_prev_snap_obj; + dsl_dataset_rele(snap, FTAG); + } + if (obj == 0) return (SET_ERROR(ENODEV)); - /* - * most recent snapshot must match fromguid, or there are no - * changes since the fromguid one - */ - if (ds->ds_prev->ds_phys->ds_guid != fromguid) { - uint64_t birth = ds->ds_prev->ds_phys->ds_bp.blk_birth; - uint64_t obj = ds->ds_prev->ds_phys->ds_prev_snap_obj; - while (obj != 0) { - dsl_dataset_t *snap; - error = dsl_dataset_hold_obj(dp, obj, FTAG, - &snap); - if (error != 0) - return (SET_ERROR(ENODEV)); - if (snap->ds_phys->ds_creation_txg < birth) { - dsl_dataset_rele(snap, FTAG); - return (SET_ERROR(ENODEV)); - } - if (snap->ds_phys->ds_guid == fromguid) { - dsl_dataset_rele(snap, FTAG); - break; /* it's ok */ - } - obj = snap->ds_phys->ds_prev_snap_obj; + if (drba->drba_cookie->drc_force) { + drba->drba_snapobj = obj; + } else { + /* + * If we are not forcing, there must be no + * changes since fromsnap. + */ + if (dsl_dataset_modified_since_snap(ds, snap)) { dsl_dataset_rele(snap, FTAG); + return (SET_ERROR(ETXTBSY)); } - if (obj == 0) - return (SET_ERROR(ENODEV)); + drba->drba_snapobj = ds->ds_prev->ds_object; } + + dsl_dataset_rele(snap, FTAG); } else { /* if full, most recent snapshot must be $ORIGIN */ if (ds->ds_phys->ds_prev_snap_txg >= TXG_INITIAL) return (SET_ERROR(ENODEV)); + drba->drba_snapobj = ds->ds_phys->ds_prev_snap_obj; } return (0); @@ -856,8 +898,14 @@ dmu_recv_begin_sync(void *arg, dmu_tx_t *tx) error = dsl_dataset_hold(dp, tofs, FTAG, &ds); if (error == 0) { /* create temporary clone */ + dsl_dataset_t *snap = NULL; + if (drba->drba_snapobj != 0) { + VERIFY0(dsl_dataset_hold_obj(dp, + drba->drba_snapobj, FTAG, &snap)); + } dsobj = dsl_dataset_create_sync(ds->ds_dir, recv_clone_name, - ds->ds_prev, crflags, drba->drba_cred, tx); + snap, crflags, drba->drba_cred, tx); + dsl_dataset_rele(snap, FTAG); dsl_dataset_rele(ds, FTAG); } else { dsl_dir_t *dd; @@ -1601,14 +1649,40 @@ dmu_recv_end_check(void *arg, dmu_tx_t *tx) error = dsl_dataset_hold(dp, drc->drc_tofs, FTAG, &origin_head); if (error != 0) return (error); + if (drc->drc_force) { + /* + * We will destroy any snapshots in tofs (i.e. before + * origin_head) that are after the origin (which is + * the snap before drc_ds, because drc_ds can not + * have any snaps of its own). + */ + uint64_t obj = origin_head->ds_phys->ds_prev_snap_obj; + while (obj != drc->drc_ds->ds_phys->ds_prev_snap_obj) { + dsl_dataset_t *snap; + error = dsl_dataset_hold_obj(dp, obj, FTAG, + &snap); + if (error != 0) + return (error); + if (snap->ds_dir != origin_head->ds_dir) + error = SET_ERROR(EINVAL); + if (error == 0) { + error = dsl_destroy_snapshot_check_impl( + snap, B_FALSE); + } + obj = snap->ds_phys->ds_prev_snap_obj; + dsl_dataset_rele(snap, FTAG); + if (error != 0) + return (error); + } + } error = dsl_dataset_clone_swap_check_impl(drc->drc_ds, - origin_head, drc->drc_force); + origin_head, drc->drc_force, drc->drc_owner, tx); if (error != 0) { dsl_dataset_rele(origin_head, FTAG); return (error); } error = dsl_dataset_snapshot_check_impl(origin_head, - drc->drc_tosnap, tx); + drc->drc_tosnap, tx, B_TRUE); dsl_dataset_rele(origin_head, FTAG); if (error != 0) return (error); @@ -1616,7 +1690,7 @@ dmu_recv_end_check(void *arg, dmu_tx_t *tx) error = dsl_destroy_head_check_impl(drc->drc_ds, 1); } else { error = dsl_dataset_snapshot_check_impl(drc->drc_ds, - drc->drc_tosnap, tx); + drc->drc_tosnap, tx, B_TRUE); } return (error); } @@ -1635,6 +1709,27 @@ dmu_recv_end_sync(void *arg, dmu_tx_t *tx) VERIFY0(dsl_dataset_hold(dp, drc->drc_tofs, FTAG, &origin_head)); + + if (drc->drc_force) { + /* + * Destroy any snapshots of drc_tofs (origin_head) + * after the origin (the snap before drc_ds). + */ + uint64_t obj = origin_head->ds_phys->ds_prev_snap_obj; + while (obj != drc->drc_ds->ds_phys->ds_prev_snap_obj) { + dsl_dataset_t *snap; + VERIFY0(dsl_dataset_hold_obj(dp, obj, FTAG, + &snap)); + ASSERT3P(snap->ds_dir, ==, origin_head->ds_dir); + obj = snap->ds_phys->ds_prev_snap_obj; + dsl_destroy_snapshot_sync_impl(snap, + B_FALSE, tx); + dsl_dataset_rele(snap, FTAG); + } + } + VERIFY3P(drc->drc_ds->ds_prev, ==, + origin_head->ds_prev); + dsl_dataset_clone_swap_sync_impl(drc->drc_ds, origin_head, tx); dsl_dataset_snapshot_sync_impl(origin_head, @@ -1654,6 +1749,9 @@ dmu_recv_end_sync(void *arg, dmu_tx_t *tx) dsl_dataset_rele(origin_head, FTAG); dsl_destroy_head_sync_impl(drc->drc_ds, tx); + + if (drc->drc_owner != NULL) + VERIFY3P(origin_head->ds_owner, ==, drc->drc_owner); } else { dsl_dataset_t *ds = drc->drc_ds; @@ -1752,10 +1850,22 @@ dmu_recv_new_end(dmu_recv_cookie_t *drc) } int -dmu_recv_end(dmu_recv_cookie_t *drc) +dmu_recv_end(dmu_recv_cookie_t *drc, void *owner) { + drc->drc_owner = owner; + if (drc->drc_newfs) return (dmu_recv_new_end(drc)); else return (dmu_recv_existing_end(drc)); } + +/* + * Return TRUE if this objset is currently being received into. + */ +boolean_t +dmu_objset_is_receiving(objset_t *os) +{ + return (os->os_dsl_dataset != NULL && + os->os_dsl_dataset->ds_owner == dmu_recv_tag); +} diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c index 53384253268c..929b0c4d97b6 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c @@ -587,8 +587,7 @@ dmu_tx_hold_free(dmu_tx_t *tx, uint64_t object, uint64_t off, uint64_t len) { dmu_tx_hold_t *txh; dnode_t *dn; - uint64_t start, end, i; - int err, shift; + int err; zio_t *zio; ASSERT(tx->tx_txg == 0); @@ -599,34 +598,48 @@ dmu_tx_hold_free(dmu_tx_t *tx, uint64_t object, uint64_t off, uint64_t len) return; dn = txh->txh_dnode; - /* first block */ - if (off != 0) - dmu_tx_count_write(txh, off, 1); - /* last block */ - if (len != DMU_OBJECT_END) - dmu_tx_count_write(txh, off+len, 1); - - dmu_tx_count_dnode(txh); - if (off >= (dn->dn_maxblkid+1) * dn->dn_datablksz) return; if (len == DMU_OBJECT_END) len = (dn->dn_maxblkid+1) * dn->dn_datablksz - off; + dmu_tx_count_dnode(txh); + /* - * For i/o error checking, read the first and last level-0 - * blocks, and all the level-1 blocks. The above count_write's - * have already taken care of the level-0 blocks. + * For i/o error checking, we read the first and last level-0 + * blocks if they are not aligned, and all the level-1 blocks. + * + * Note: dbuf_free_range() assumes that we have not instantiated + * any level-0 dbufs that will be completely freed. Therefore we must + * exercise care to not read or count the first and last blocks + * if they are blocksize-aligned. + */ + if (dn->dn_datablkshift == 0) { + dmu_tx_count_write(txh, off, len); + } else { + /* first block will be modified if it is not aligned */ + if (!IS_P2ALIGNED(off, 1 << dn->dn_datablkshift)) + dmu_tx_count_write(txh, off, 1); + /* last block will be modified if it is not aligned */ + if (!IS_P2ALIGNED(off + len, 1 << dn->dn_datablkshift)) + dmu_tx_count_write(txh, off+len, 1); + } + + /* + * Check level-1 blocks. */ if (dn->dn_nlevels > 1) { - shift = dn->dn_datablkshift + dn->dn_indblkshift - + int shift = dn->dn_datablkshift + dn->dn_indblkshift - SPA_BLKPTRSHIFT; - start = off >> shift; - end = dn->dn_datablkshift ? ((off+len) >> shift) : 0; + uint64_t start = off >> shift; + uint64_t end = (off + len) >> shift; + + ASSERT(dn->dn_datablkshift != 0); + ASSERT(dn->dn_indblkshift != 0); zio = zio_root(tx->tx_pool->dp_spa, NULL, NULL, ZIO_FLAG_CANFAIL); - for (i = start; i <= end; i++) { + for (uint64_t i = start; i <= end; i++) { uint64_t ibyte = i << shift; err = dnode_next_offset(dn, 0, &ibyte, 2, 1, 0); i = ibyte >> shift; diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c index 433ff5358ff1..1faebc185732 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c @@ -994,7 +994,7 @@ typedef struct dsl_dataset_snapshot_arg { int dsl_dataset_snapshot_check_impl(dsl_dataset_t *ds, const char *snapname, - dmu_tx_t *tx) + dmu_tx_t *tx, boolean_t recv) { int error; uint64_t value; @@ -1020,6 +1020,18 @@ dsl_dataset_snapshot_check_impl(dsl_dataset_t *ds, const char *snapname, if (error != ENOENT) return (error); + /* + * We don't allow taking snapshots of inconsistent datasets, such as + * those into which we are currently receiving. However, if we are + * creating this snapshot as part of a receive, this check will be + * executed atomically with respect to the completion of the receive + * itself but prior to the clearing of DS_FLAG_INCONSISTENT; in this + * case we ignore this, knowing it will be fixed up for us shortly in + * dmu_recv_end_sync(). + */ + if (!recv && DS_IS_INCONSISTENT(ds)) + return (SET_ERROR(EBUSY)); + error = dsl_dataset_snapshot_reserve_space(ds, tx); if (error != 0) return (error); @@ -1056,7 +1068,7 @@ dsl_dataset_snapshot_check(void *arg, dmu_tx_t *tx) error = dsl_dataset_hold(dp, dsname, FTAG, &ds); if (error == 0) { error = dsl_dataset_snapshot_check_impl(ds, - atp + 1, tx); + atp + 1, tx, B_FALSE); dsl_dataset_rele(ds, FTAG); } @@ -1322,7 +1334,8 @@ dsl_dataset_snapshot_tmp_check(void *arg, dmu_tx_t *tx) if (error != 0) return (error); - error = dsl_dataset_snapshot_check_impl(ds, ddsta->ddsta_snapname, tx); + error = dsl_dataset_snapshot_check_impl(ds, ddsta->ddsta_snapname, + tx, B_FALSE); if (error != 0) { dsl_dataset_rele(ds, FTAG); return (error); @@ -1580,16 +1593,16 @@ dsl_dataset_space(dsl_dataset_t *ds, } boolean_t -dsl_dataset_modified_since_lastsnap(dsl_dataset_t *ds) +dsl_dataset_modified_since_snap(dsl_dataset_t *ds, dsl_dataset_t *snap) { dsl_pool_t *dp = ds->ds_dir->dd_pool; ASSERT(dsl_pool_config_held(dp)); - if (ds->ds_prev == NULL) + if (snap == NULL) return (B_FALSE); if (ds->ds_phys->ds_bp.blk_birth > - ds->ds_prev->ds_phys->ds_creation_txg) { - objset_t *os, *os_prev; + snap->ds_phys->ds_creation_txg) { + objset_t *os, *os_snap; /* * It may be that only the ZIL differs, because it was * reset in the head. Don't count that as being @@ -1597,10 +1610,10 @@ dsl_dataset_modified_since_lastsnap(dsl_dataset_t *ds) */ if (dmu_objset_from_ds(ds, &os) != 0) return (B_TRUE); - if (dmu_objset_from_ds(ds->ds_prev, &os_prev) != 0) + if (dmu_objset_from_ds(snap, &os_snap) != 0) return (B_TRUE); return (bcmp(&os->os_phys->os_meta_dnode, - &os_prev->os_phys->os_meta_dnode, + &os_snap->os_phys->os_meta_dnode, sizeof (os->os_phys->os_meta_dnode)) != 0); } return (B_FALSE); @@ -1755,16 +1768,52 @@ dsl_dataset_rename_snapshot(const char *fsname, dsl_dataset_rename_snapshot_sync, &ddrsa, 1)); } +/* + * If we're doing an ownership handoff, we need to make sure that there is + * only one long hold on the dataset. We're not allowed to change anything here + * so we don't permanently release the long hold or regular hold here. We want + * to do this only when syncing to avoid the dataset unexpectedly going away + * when we release the long hold. + */ +static int +dsl_dataset_handoff_check(dsl_dataset_t *ds, void *owner, dmu_tx_t *tx) +{ + boolean_t held; + + if (!dmu_tx_is_syncing(tx)) + return (0); + + if (owner != NULL) { + VERIFY3P(ds->ds_owner, ==, owner); + dsl_dataset_long_rele(ds, owner); + } + + held = dsl_dataset_long_held(ds); + + if (owner != NULL) + dsl_dataset_long_hold(ds, owner); + + if (held) + return (SET_ERROR(EBUSY)); + + return (0); +} + +typedef struct dsl_dataset_rollback_arg { + const char *ddra_fsname; + void *ddra_owner; +} dsl_dataset_rollback_arg_t; + static int dsl_dataset_rollback_check(void *arg, dmu_tx_t *tx) { - const char *fsname = arg; + dsl_dataset_rollback_arg_t *ddra = arg; dsl_pool_t *dp = dmu_tx_pool(tx); dsl_dataset_t *ds; int64_t unused_refres_delta; int error; - error = dsl_dataset_hold(dp, fsname, FTAG, &ds); + error = dsl_dataset_hold(dp, ddra->ddra_fsname, FTAG, &ds); if (error != 0) return (error); @@ -1780,9 +1829,10 @@ dsl_dataset_rollback_check(void *arg, dmu_tx_t *tx) return (SET_ERROR(EINVAL)); } - if (dsl_dataset_long_held(ds)) { + error = dsl_dataset_handoff_check(ds, ddra->ddra_owner, tx); + if (error != 0) { dsl_dataset_rele(ds, FTAG); - return (SET_ERROR(EBUSY)); + return (error); } /* @@ -1819,12 +1869,12 @@ dsl_dataset_rollback_check(void *arg, dmu_tx_t *tx) static void dsl_dataset_rollback_sync(void *arg, dmu_tx_t *tx) { - const char *fsname = arg; + dsl_dataset_rollback_arg_t *ddra = arg; dsl_pool_t *dp = dmu_tx_pool(tx); dsl_dataset_t *ds, *clone; uint64_t cloneobj; - VERIFY0(dsl_dataset_hold(dp, fsname, FTAG, &ds)); + VERIFY0(dsl_dataset_hold(dp, ddra->ddra_fsname, FTAG, &ds)); cloneobj = dsl_dataset_create_sync(ds->ds_dir, "%rollback", ds->ds_prev, DS_CREATE_FLAG_NODIRTY, kcred, tx); @@ -1840,11 +1890,26 @@ dsl_dataset_rollback_sync(void *arg, dmu_tx_t *tx) dsl_dataset_rele(ds, FTAG); } +/* + * If owner != NULL: + * + * - The existing dataset MUST be owned by the specified owner at entry + * - Upon return, dataset will still be held by the same owner, whether we + * succeed or not. + * + * This mode is required any time the existing filesystem is mounted. See + * notes above zfs_suspend_fs() for further details. + */ int -dsl_dataset_rollback(const char *fsname) +dsl_dataset_rollback(const char *fsname, void *owner) { + dsl_dataset_rollback_arg_t ddra; + + ddra.ddra_fsname = fsname; + ddra.ddra_owner = owner; + return (dsl_sync_task(fsname, dsl_dataset_rollback_check, - dsl_dataset_rollback_sync, (void *)fsname, 1)); + dsl_dataset_rollback_sync, (void *)&ddra, 1)); } struct promotenode { @@ -2362,7 +2427,7 @@ dsl_dataset_promote(const char *name, char *conflsnap) int dsl_dataset_clone_swap_check_impl(dsl_dataset_t *clone, - dsl_dataset_t *origin_head, boolean_t force) + dsl_dataset_t *origin_head, boolean_t force, void *owner, dmu_tx_t *tx) { int64_t unused_refres_delta; @@ -2371,15 +2436,14 @@ dsl_dataset_clone_swap_check_impl(dsl_dataset_t *clone, dsl_dataset_is_snapshot(origin_head)) return (SET_ERROR(EINVAL)); - /* the branch point should be just before them */ - if (clone->ds_prev != origin_head->ds_prev) + /* if we are not forcing, the branch point should be just before them */ + if (!force && clone->ds_prev != origin_head->ds_prev) return (SET_ERROR(EINVAL)); /* clone should be the clone (unless they are unrelated) */ if (clone->ds_prev != NULL && clone->ds_prev != clone->ds_dir->dd_pool->dp_origin_snap && - origin_head->ds_object != - clone->ds_prev->ds_phys->ds_next_snap_obj) + origin_head->ds_dir != clone->ds_prev->ds_dir) return (SET_ERROR(EINVAL)); /* the clone should be a child of the origin */ @@ -2387,11 +2451,12 @@ dsl_dataset_clone_swap_check_impl(dsl_dataset_t *clone, return (SET_ERROR(EINVAL)); /* origin_head shouldn't be modified unless 'force' */ - if (!force && dsl_dataset_modified_since_lastsnap(origin_head)) + if (!force && + dsl_dataset_modified_since_snap(origin_head, origin_head->ds_prev)) return (SET_ERROR(ETXTBSY)); /* origin_head should have no long holds (e.g. is not mounted) */ - if (dsl_dataset_long_held(origin_head)) + if (dsl_dataset_handoff_check(origin_head, owner, tx)) return (SET_ERROR(EBUSY)); /* check amount of any unconsumed refreservation */ @@ -2424,6 +2489,7 @@ dsl_dataset_clone_swap_sync_impl(dsl_dataset_t *clone, ASSERT(clone->ds_reserved == 0); ASSERT(origin_head->ds_quota == 0 || clone->ds_phys->ds_unique_bytes <= origin_head->ds_quota); + ASSERT3P(clone->ds_prev, ==, origin_head->ds_prev); dmu_buf_will_dirty(clone->ds_dbuf, tx); dmu_buf_will_dirty(origin_head->ds_dbuf, tx); diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c index f968215db0ab..ef46df8e1779 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c @@ -46,10 +46,7 @@ typedef struct dmu_snapshots_destroy_arg { nvlist_t *dsda_errlist; } dmu_snapshots_destroy_arg_t; -/* - * ds must be owned. - */ -static int +int dsl_destroy_snapshot_check_impl(dsl_dataset_t *ds, boolean_t defer) { if (!dsl_dataset_is_snapshot(ds)) diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h index 9a7663e505ba..c41e6dbe303a 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h @@ -172,7 +172,7 @@ extern void ddt_object_name(ddt_t *ddt, enum ddt_type type, extern int ddt_object_walk(ddt_t *ddt, enum ddt_type type, enum ddt_class cls, uint64_t *walk, ddt_entry_t *dde); extern int ddt_object_count(ddt_t *ddt, enum ddt_type type, - enum ddt_class class, uint64_t *count); + enum ddt_class cls, uint64_t *count); extern int ddt_object_info(ddt_t *ddt, enum ddt_type type, enum ddt_class cls, dmu_object_info_t *); extern boolean_t ddt_object_exists(ddt_t *ddt, enum ddt_type type, diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_impl.h b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_impl.h index e28112180bc3..f841989d48fb 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_impl.h +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_impl.h @@ -21,8 +21,11 @@ /* * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + */ +/* * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright (c) 2012, Martin Matuska <mm@FreeBSD.org>. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. */ #ifndef _SYS_DMU_IMPL_H @@ -293,6 +296,9 @@ typedef struct dmu_sendarg { uint64_t dsa_toguid; int dsa_err; dmu_pendop_t dsa_pending_op; + boolean_t dsa_incremental; + uint64_t dsa_last_data_object; + uint64_t dsa_last_data_offset; } dmu_sendarg_t; diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h index 9e52329286fe..f1f5ac2028c0 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h @@ -136,6 +136,7 @@ struct objset { int dmu_objset_hold(const char *name, void *tag, objset_t **osp); int dmu_objset_own(const char *name, dmu_objset_type_t type, boolean_t readonly, void *tag, objset_t **osp); +void dmu_objset_refresh_ownership(objset_t *os, void *tag); void dmu_objset_rele(objset_t *os, void *tag); void dmu_objset_disown(objset_t *os, void *tag); int dmu_objset_from_ds(struct dsl_dataset *ds, objset_t **osp); diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_send.h b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_send.h index 8656e0875bf3..13ef5115b970 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_send.h +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_send.h @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. */ @@ -62,6 +62,7 @@ typedef struct dmu_recv_cookie { struct avl_tree *drc_guid_to_ds_map; zio_cksum_t drc_cksum; uint64_t drc_newsnapobj; + void *drc_owner; } dmu_recv_cookie_t; int dmu_recv_begin(char *tofs, char *tosnap, struct drr_begin *drrb, @@ -72,6 +73,7 @@ int dmu_recv_stream(dmu_recv_cookie_t *drc, struct vnode *vp, offset_t *voffp, int dmu_recv_stream(dmu_recv_cookie_t *drc, struct file *fp, offset_t *voffp, #endif int cleanup_fd, uint64_t *action_handlep); -int dmu_recv_end(dmu_recv_cookie_t *drc); +int dmu_recv_end(dmu_recv_cookie_t *drc, void *owner); +boolean_t dmu_objset_is_receiving(objset_t *os); #endif /* _DMU_SEND_H */ diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h index cbb6f86539f1..fa7cad7f76bb 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. */ @@ -206,7 +206,8 @@ void dsl_dataset_set_blkptr(dsl_dataset_t *ds, blkptr_t *bp, dmu_tx_t *tx); spa_t *dsl_dataset_get_spa(dsl_dataset_t *ds); -boolean_t dsl_dataset_modified_since_lastsnap(dsl_dataset_t *ds); +boolean_t dsl_dataset_modified_since_snap(dsl_dataset_t *ds, + dsl_dataset_t *snap); void dsl_dataset_sync(dsl_dataset_t *os, zio_t *zio, dmu_tx_t *tx); @@ -247,11 +248,11 @@ void dsl_dataset_long_rele(dsl_dataset_t *ds, void *tag); boolean_t dsl_dataset_long_held(dsl_dataset_t *ds); int dsl_dataset_clone_swap_check_impl(dsl_dataset_t *clone, - dsl_dataset_t *origin_head, boolean_t force); + dsl_dataset_t *origin_head, boolean_t force, void *owner, dmu_tx_t *tx); void dsl_dataset_clone_swap_sync_impl(dsl_dataset_t *clone, dsl_dataset_t *origin_head, dmu_tx_t *tx); int dsl_dataset_snapshot_check_impl(dsl_dataset_t *ds, const char *snapname, - dmu_tx_t *tx); + dmu_tx_t *tx, boolean_t recv); void dsl_dataset_snapshot_sync_impl(dsl_dataset_t *ds, const char *snapname, dmu_tx_t *tx); @@ -264,7 +265,7 @@ int dsl_dataset_snap_lookup(dsl_dataset_t *ds, const char *name, int dsl_dataset_snap_remove(dsl_dataset_t *ds, const char *name, dmu_tx_t *tx); void dsl_dataset_set_refreservation_sync_impl(dsl_dataset_t *ds, zprop_source_t source, uint64_t value, dmu_tx_t *tx); -int dsl_dataset_rollback(const char *fsname); +int dsl_dataset_rollback(const char *fsname, void *owner); #ifdef ZFS_DEBUG #define dprintf_ds(ds, fmt, ...) do { \ diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_destroy.h b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_destroy.h index c5a70bb90e4c..3f638643b6f8 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_destroy.h +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_destroy.h @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. */ @@ -35,15 +35,16 @@ struct nvlist; struct dsl_dataset; struct dmu_tx; -int dsl_destroy_snapshots_nvl(struct nvlist *snaps, boolean_t defer, - struct nvlist *errlist); -int dsl_destroy_snapshot(const char *name, boolean_t defer); -int dsl_destroy_head(const char *name); -int dsl_destroy_head_check_impl(struct dsl_dataset *ds, int expected_holds); -void dsl_destroy_head_sync_impl(struct dsl_dataset *ds, struct dmu_tx *tx); -int dsl_destroy_inconsistent(const char *dsname, void *arg); -void dsl_destroy_snapshot_sync_impl(struct dsl_dataset *ds, - boolean_t defer, struct dmu_tx *tx); +int dsl_destroy_snapshots_nvl(struct nvlist *, boolean_t, + struct nvlist *); +int dsl_destroy_snapshot(const char *, boolean_t); +int dsl_destroy_head(const char *); +int dsl_destroy_head_check_impl(struct dsl_dataset *, int); +void dsl_destroy_head_sync_impl(struct dsl_dataset *, struct dmu_tx *); +int dsl_destroy_inconsistent(const char *, void *); +int dsl_destroy_snapshot_check_impl(struct dsl_dataset *, boolean_t); +void dsl_destroy_snapshot_sync_impl(struct dsl_dataset *, + boolean_t, struct dmu_tx *); #ifdef __cplusplus } diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c index dfa5453cd3d0..f79f08d94bba 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c @@ -69,6 +69,8 @@ vdev_geom_orphan(struct g_consumer *cp) g_topology_assert(); vd = cp->private; + if (vd == NULL) + return; /* * Orphan callbacks occur from the GEOM event thread. @@ -689,6 +691,7 @@ vdev_geom_close(vdev_t *vd) return; vd->vdev_tsd = NULL; vd->vdev_delayed_close = B_FALSE; + cp->private = NULL; /* XXX locking */ g_post_event(vdev_geom_detach, cp, M_WAITOK, NULL); } diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c index a4ae7aabe8d8..020d697c0350 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c @@ -3566,13 +3566,13 @@ zfs_ioc_rollback(zfs_cmd_t *zc) if (error == 0) { int resume_err; - error = dsl_dataset_rollback(zc->zc_name); + error = dsl_dataset_rollback(zc->zc_name, zfsvfs); resume_err = zfs_resume_fs(zfsvfs, zc->zc_name); error = error ? error : resume_err; } VFS_RELE(zfsvfs->z_vfs); } else { - error = dsl_dataset_rollback(zc->zc_name); + error = dsl_dataset_rollback(zc->zc_name, NULL); } return (error); } @@ -4101,13 +4101,13 @@ zfs_ioc_recv(zfs_cmd_t *zc) * If the suspend fails, then the recv_end will * likely also fail, and clean up after itself. */ - end_err = dmu_recv_end(&drc); + end_err = dmu_recv_end(&drc, zfsvfs); if (error == 0) error = zfs_resume_fs(zfsvfs, tofs); error = error ? error : end_err; VFS_RELE(zfsvfs->z_vfs); } else { - error = dmu_recv_end(&drc); + error = dmu_recv_end(&drc, NULL); } } @@ -4598,8 +4598,11 @@ zfs_ioc_userspace_upgrade(zfs_cmd_t *zc) * objset_phys_t). Suspend/resume the fs will do that. */ error = zfs_suspend_fs(zfsvfs); - if (error == 0) + if (error == 0) { + dmu_objset_refresh_ownership(zfsvfs->z_os, + zfsvfs); error = zfs_resume_fs(zfsvfs, zc->zc_name); + } } if (error == 0) error = dmu_objset_userspace_upgrade(zfsvfs->z_os); @@ -5495,10 +5498,10 @@ zfs_ioctl_init(void) zfs_secpolicy_read, B_FALSE, POOL_CHECK_NONE); zfs_ioctl_register_pool(ZFS_IOC_ERROR_LOG, zfs_ioc_error_log, - zfs_secpolicy_inject, B_FALSE, POOL_CHECK_SUSPENDED); + zfs_secpolicy_inject, B_FALSE, POOL_CHECK_NONE); zfs_ioctl_register_pool(ZFS_IOC_DSOBJ_TO_DSNAME, zfs_ioc_dsobj_to_dsname, - zfs_secpolicy_diff, B_FALSE, POOL_CHECK_SUSPENDED); + zfs_secpolicy_diff, B_FALSE, POOL_CHECK_NONE); zfs_ioctl_register_pool(ZFS_IOC_POOL_GET_HISTORY, zfs_ioc_pool_get_history, zfs_secpolicy_config, B_FALSE, POOL_CHECK_SUSPENDED); @@ -5507,7 +5510,7 @@ zfs_ioctl_init(void) zfs_secpolicy_config, B_TRUE, POOL_CHECK_NONE); zfs_ioctl_register_pool(ZFS_IOC_CLEAR, zfs_ioc_clear, - zfs_secpolicy_config, B_TRUE, POOL_CHECK_SUSPENDED); + zfs_secpolicy_config, B_TRUE, POOL_CHECK_NONE); zfs_ioctl_register_pool(ZFS_IOC_POOL_REOPEN, zfs_ioc_pool_reopen, zfs_secpolicy_config, B_TRUE, POOL_CHECK_SUSPENDED); @@ -6187,54 +6190,96 @@ _info(struct modinfo *modinfop) } #endif /* sun */ -static int -zfs_modevent(module_t mod, int type, void *unused __unused) +static int zfs__init(void); +static int zfs__fini(void); +static void zfs_shutdown(void *, int); + +static eventhandler_tag zfs_shutdown_event_tag; + +int +zfs__init(void) { - int error = 0; - switch (type) { - case MOD_LOAD: - zfs_root_token = root_mount_hold("ZFS"); + zfs_root_token = root_mount_hold("ZFS"); - mutex_init(&zfs_share_lock, NULL, MUTEX_DEFAULT, NULL); + mutex_init(&zfs_share_lock, NULL, MUTEX_DEFAULT, NULL); - spa_init(FREAD | FWRITE); - zfs_init(); - zvol_init(); - zfs_ioctl_init(); + spa_init(FREAD | FWRITE); + zfs_init(); + zvol_init(); + zfs_ioctl_init(); - tsd_create(&zfs_fsyncer_key, NULL); - tsd_create(&rrw_tsd_key, rrw_tsd_destroy); - tsd_create(&zfs_allow_log_key, zfs_allow_log_destroy); + tsd_create(&zfs_fsyncer_key, NULL); + tsd_create(&rrw_tsd_key, rrw_tsd_destroy); + tsd_create(&zfs_allow_log_key, zfs_allow_log_destroy); - printf("ZFS storage pool version: features support (" SPA_VERSION_STRING ")\n"); - root_mount_rel(zfs_root_token); + printf("ZFS storage pool version: features support (" SPA_VERSION_STRING ")\n"); + root_mount_rel(zfs_root_token); - zfsdev_init(); - break; - case MOD_UNLOAD: - if (spa_busy() || zfs_busy() || zvol_busy() || - zio_injection_enabled) { - error = EBUSY; - break; - } + zfsdev_init(); - zfsdev_fini(); - zvol_fini(); - zfs_fini(); - spa_fini(); + return (0); +} - tsd_destroy(&zfs_fsyncer_key); - tsd_destroy(&rrw_tsd_key); - tsd_destroy(&zfs_allow_log_key); +int +zfs__fini(void) +{ + if (spa_busy() || zfs_busy() || zvol_busy() || + zio_injection_enabled) { + return (EBUSY); + } - mutex_destroy(&zfs_share_lock); - break; + zfsdev_fini(); + zvol_fini(); + zfs_fini(); + spa_fini(); + + tsd_destroy(&zfs_fsyncer_key); + tsd_destroy(&rrw_tsd_key); + tsd_destroy(&zfs_allow_log_key); + + mutex_destroy(&zfs_share_lock); + + return (0); +} + +static void +zfs_shutdown(void *arg __unused, int howto __unused) +{ + + /* + * ZFS fini routines can not properly work in a panic-ed system. + */ + if (panicstr == NULL) + (void)zfs__fini(); +} + + +static int +zfs_modevent(module_t mod, int type, void *unused __unused) +{ + int err; + + switch (type) { + case MOD_LOAD: + err = zfs__init(); + if (err == 0) + zfs_shutdown_event_tag = EVENTHANDLER_REGISTER( + shutdown_post_sync, zfs_shutdown, NULL, + SHUTDOWN_PRI_FIRST); + return (err); + case MOD_UNLOAD: + err = zfs__fini(); + if (err == 0 && zfs_shutdown_event_tag != NULL) + EVENTHANDLER_DEREGISTER(shutdown_post_sync, + zfs_shutdown_event_tag); + return (err); + case MOD_SHUTDOWN: + return (0); default: - error = EOPNOTSUPP; break; } - return (error); + return (EOPNOTSUPP); } static moduledata_t zfs_mod = { diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c index 665627da438e..6e812058877b 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c @@ -2222,7 +2222,9 @@ zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, int flags, vnode_t **vpp) * Block out VOPs and close zfsvfs_t::z_os * * Note, if successful, then we return with the 'z_teardown_lock' and - * 'z_teardown_inactive_lock' write held. + * 'z_teardown_inactive_lock' write held. We leave ownership of the underlying + * dataset and objset intact so that they can be atomically handed off during + * a subsequent rollback or recv operation and the resume thereafter. */ int zfs_suspend_fs(zfsvfs_t *zfsvfs) @@ -2231,71 +2233,76 @@ zfs_suspend_fs(zfsvfs_t *zfsvfs) if ((error = zfsvfs_teardown(zfsvfs, B_FALSE)) != 0) return (error); - dmu_objset_disown(zfsvfs->z_os, zfsvfs); return (0); } /* - * Reopen zfsvfs_t::z_os and release VOPs. + * Rebuild SA and release VOPs. Note that ownership of the underlying dataset + * is an invariant across any of the operations that can be performed while the + * filesystem was suspended. Whether it succeeded or failed, the preconditions + * are the same: the relevant objset and associated dataset are owned by + * zfsvfs, held, and long held on entry. */ int zfs_resume_fs(zfsvfs_t *zfsvfs, const char *osname) { int err; + znode_t *zp; + uint64_t sa_obj = 0; ASSERT(RRW_WRITE_HELD(&zfsvfs->z_teardown_lock)); ASSERT(RW_WRITE_HELD(&zfsvfs->z_teardown_inactive_lock)); - err = dmu_objset_own(osname, DMU_OST_ZFS, B_FALSE, zfsvfs, - &zfsvfs->z_os); - if (err) { - zfsvfs->z_os = NULL; - } else { - znode_t *zp; - uint64_t sa_obj = 0; + /* + * We already own this, so just hold and rele it to update the + * objset_t, as the one we had before may have been evicted. + */ + VERIFY0(dmu_objset_hold(osname, zfsvfs, &zfsvfs->z_os)); + VERIFY3P(zfsvfs->z_os->os_dsl_dataset->ds_owner, ==, zfsvfs); + VERIFY(dsl_dataset_long_held(zfsvfs->z_os->os_dsl_dataset)); + dmu_objset_rele(zfsvfs->z_os, zfsvfs); - /* - * Make sure version hasn't changed - */ + /* + * Make sure version hasn't changed + */ - err = zfs_get_zplprop(zfsvfs->z_os, ZFS_PROP_VERSION, - &zfsvfs->z_version); + err = zfs_get_zplprop(zfsvfs->z_os, ZFS_PROP_VERSION, + &zfsvfs->z_version); - if (err) - goto bail; + if (err) + goto bail; - err = zap_lookup(zfsvfs->z_os, MASTER_NODE_OBJ, - ZFS_SA_ATTRS, 8, 1, &sa_obj); + err = zap_lookup(zfsvfs->z_os, MASTER_NODE_OBJ, + ZFS_SA_ATTRS, 8, 1, &sa_obj); - if (err && zfsvfs->z_version >= ZPL_VERSION_SA) - goto bail; + if (err && zfsvfs->z_version >= ZPL_VERSION_SA) + goto bail; - if ((err = sa_setup(zfsvfs->z_os, sa_obj, - zfs_attr_table, ZPL_END, &zfsvfs->z_attr_table)) != 0) - goto bail; + if ((err = sa_setup(zfsvfs->z_os, sa_obj, + zfs_attr_table, ZPL_END, &zfsvfs->z_attr_table)) != 0) + goto bail; - if (zfsvfs->z_version >= ZPL_VERSION_SA) - sa_register_update_callback(zfsvfs->z_os, - zfs_sa_upgrade); + if (zfsvfs->z_version >= ZPL_VERSION_SA) + sa_register_update_callback(zfsvfs->z_os, + zfs_sa_upgrade); - VERIFY(zfsvfs_setup(zfsvfs, B_FALSE) == 0); + VERIFY(zfsvfs_setup(zfsvfs, B_FALSE) == 0); - zfs_set_fuid_feature(zfsvfs); + zfs_set_fuid_feature(zfsvfs); - /* - * Attempt to re-establish all the active znodes with - * their dbufs. If a zfs_rezget() fails, then we'll let - * any potential callers discover that via ZFS_ENTER_VERIFY_VP - * when they try to use their znode. - */ - mutex_enter(&zfsvfs->z_znodes_lock); - for (zp = list_head(&zfsvfs->z_all_znodes); zp; - zp = list_next(&zfsvfs->z_all_znodes, zp)) { - (void) zfs_rezget(zp); - } - mutex_exit(&zfsvfs->z_znodes_lock); + /* + * Attempt to re-establish all the active znodes with + * their dbufs. If a zfs_rezget() fails, then we'll let + * any potential callers discover that via ZFS_ENTER_VERIFY_VP + * when they try to use their znode. + */ + mutex_enter(&zfsvfs->z_znodes_lock); + for (zp = list_head(&zfsvfs->z_all_znodes); zp; + zp = list_next(&zfsvfs->z_all_znodes, zp)) { + (void) zfs_rezget(zp); } + mutex_exit(&zfsvfs->z_znodes_lock); bail: /* release the VOPs */ @@ -2304,8 +2311,8 @@ bail: if (err) { /* - * Since we couldn't reopen zfsvfs::z_os, or - * setup the sa framework force unmount this file system. + * Since we couldn't setup the sa framework, try to force + * unmount this file system. */ if (vn_vfswlock(zfsvfs->z_vfs->vfs_vnodecovered) == 0) (void) dounmount(zfsvfs->z_vfs, MS_FORCE, curthread); diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c index b1567b296ded..ebb33373af96 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c @@ -113,37 +113,12 @@ extern struct vop_vector zfs_vnodeops; extern struct vop_vector zfs_fifoops; extern struct vop_vector zfs_shareops; -/* - * XXX: We cannot use this function as a cache constructor, because - * there is one global cache for all file systems and we need - * to pass vfsp here, which is not possible, because argument - * 'cdrarg' is defined at kmem_cache_create() time. - */ -/*ARGSUSED*/ static int zfs_znode_cache_constructor(void *buf, void *arg, int kmflags) { znode_t *zp = buf; - vnode_t *vp; - vfs_t *vfsp = arg; - int error; POINTER_INVALIDATE(&zp->z_zfsvfs); - ASSERT(!POINTER_IS_VALID(zp->z_zfsvfs)); - - if (vfsp != NULL) { - error = getnewvnode("zfs", vfsp, &zfs_vnodeops, &vp); - if (error != 0 && (kmflags & KM_NOSLEEP)) - return (-1); - ASSERT(error == 0); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); - zp->z_vnode = vp; - vp->v_data = (caddr_t)zp; - VN_LOCK_AREC(vp); - VN_LOCK_ASHARE(vp); - } else { - zp->z_vnode = NULL; - } list_link_init(&zp->z_link_node); @@ -158,6 +133,7 @@ zfs_znode_cache_constructor(void *buf, void *arg, int kmflags) zp->z_dirlocks = NULL; zp->z_acl_cached = NULL; + zp->z_vnode = NULL; zp->z_moved = 0; return (0); } @@ -377,7 +353,7 @@ zfs_znode_init(void) rw_init(&zfsvfs_lock, NULL, RW_DEFAULT, NULL); ASSERT(znode_cache == NULL); znode_cache = kmem_cache_create("zfs_znode_cache", - sizeof (znode_t), 0, /* zfs_znode_cache_constructor */ NULL, + sizeof (znode_t), 0, zfs_znode_cache_constructor, zfs_znode_cache_destructor, NULL, NULL, NULL, 0); kmem_cache_set_move(znode_cache, zfs_znode_move); } @@ -501,7 +477,6 @@ zfs_create_share_dir(zfsvfs_t *zfsvfs, dmu_tx_t *tx) zfs_acl_ids_t acl_ids; vattr_t vattr; znode_t *sharezp; - vnode_t *vp, vnode; znode_t *zp; int error; @@ -512,7 +487,6 @@ zfs_create_share_dir(zfsvfs_t *zfsvfs, dmu_tx_t *tx) vattr.va_gid = crgetgid(kcred); sharezp = kmem_cache_alloc(znode_cache, KM_SLEEP); - zfs_znode_cache_constructor(sharezp, zfsvfs->z_parent->z_vfs, 0); ASSERT(!POINTER_IS_VALID(sharezp->z_zfsvfs)); sharezp->z_moved = 0; sharezp->z_unlinked = 0; @@ -520,12 +494,6 @@ zfs_create_share_dir(zfsvfs_t *zfsvfs, dmu_tx_t *tx) sharezp->z_zfsvfs = zfsvfs; sharezp->z_is_sa = zfsvfs->z_use_sa; - sharezp->z_vnode = &vnode; - vnode.v_data = sharezp; - - vp = ZTOV(sharezp); - vp->v_type = VDIR; - VERIFY(0 == zfs_acl_ids_create(sharezp, IS_ROOT_NODE, &vattr, kcred, NULL, &acl_ids)); zfs_mknode(sharezp, &vattr, tx, kcred, IS_ROOT_NODE, &zp, &acl_ids); @@ -536,12 +504,7 @@ zfs_create_share_dir(zfsvfs_t *zfsvfs, dmu_tx_t *tx) zfsvfs->z_shares_dir = sharezp->z_id; zfs_acl_ids_free(&acl_ids); - ZTOV(sharezp)->v_data = NULL; - ZTOV(sharezp)->v_count = 0; - ZTOV(sharezp)->v_holdcnt = 0; - zp->z_vnode = NULL; sa_handle_destroy(sharezp->z_sa_hdl); - sharezp->z_vnode = NULL; kmem_cache_free(znode_cache, sharezp); return (error); @@ -657,9 +620,17 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_buf_t *db, int blksz, uint64_t parent; sa_bulk_attr_t bulk[9]; int count = 0; + int error; zp = kmem_cache_alloc(znode_cache, KM_SLEEP); - zfs_znode_cache_constructor(zp, zfsvfs->z_parent->z_vfs, 0); + + error = getnewvnode("zfs", zfsvfs->z_parent->z_vfs, &zfs_vnodeops, &vp); + if (error != 0) { + kmem_cache_free(znode_cache, zp); + return (NULL); + } + zp->z_vnode = vp; + vp->v_data = zp; ASSERT(zp->z_dirlocks == NULL); ASSERT(!POINTER_IS_VALID(zp->z_zfsvfs)); @@ -749,8 +720,6 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_buf_t *db, int blksz, break; #endif /* sun */ } - if (vp->v_type != VFIFO) - VN_LOCK_ASHARE(vp); mutex_enter(&zfsvfs->z_znodes_lock); list_insert_tail(&zfsvfs->z_all_znodes, zp); @@ -762,6 +731,14 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_buf_t *db, int blksz, zp->z_zfsvfs = zfsvfs; mutex_exit(&zfsvfs->z_znodes_lock); + /* + * Acquire vnode lock before making it available to the world. + */ + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + VN_LOCK_AREC(vp); + if (vp->v_type != VFIFO) + VN_LOCK_ASHARE(vp); + VFS_HOLD(zfsvfs->z_vfs); return (zp); } @@ -1830,7 +1807,6 @@ zfs_create_fs(objset_t *os, cred_t *cr, nvlist_t *zplprops, dmu_tx_t *tx) int error; int i; znode_t *rootzp = NULL; - vnode_t vnode; vattr_t vattr; znode_t *zp; zfs_acl_ids_t acl_ids; @@ -1909,17 +1885,12 @@ zfs_create_fs(objset_t *os, cred_t *cr, nvlist_t *zplprops, dmu_tx_t *tx) bzero(&zfsvfs, sizeof (zfsvfs_t)); rootzp = kmem_cache_alloc(znode_cache, KM_SLEEP); - zfs_znode_cache_constructor(rootzp, NULL, 0); ASSERT(!POINTER_IS_VALID(rootzp->z_zfsvfs)); rootzp->z_moved = 0; rootzp->z_unlinked = 0; rootzp->z_atime_dirty = 0; rootzp->z_is_sa = USE_SA(version, os); - vnode.v_type = VDIR; - vnode.v_data = rootzp; - rootzp->z_vnode = &vnode; - zfsvfs.z_os = os; zfsvfs.z_parent = &zfsvfs; zfsvfs.z_version = version; @@ -1957,7 +1928,6 @@ zfs_create_fs(objset_t *os, cred_t *cr, nvlist_t *zplprops, dmu_tx_t *tx) POINTER_INVALIDATE(&rootzp->z_zfsvfs); sa_handle_destroy(rootzp->z_sa_hdl); - rootzp->z_vnode = NULL; kmem_cache_free(znode_cache, rootzp); /* diff --git a/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h b/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h index 51c75068a8e4..478735d496ff 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h +++ b/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h @@ -143,6 +143,7 @@ typedef enum { ZFS_PROP_CLONES, ZFS_PROP_LOGICALUSED, ZFS_PROP_LOGICALREFERENCED, + ZFS_PROP_INCONSISTENT, /* not exposed to the user */ ZFS_NUM_PROPS } zfs_prop_t; diff --git a/sys/cddl/dev/dtrace/amd64/dis_tables.c b/sys/cddl/dev/dtrace/amd64/dis_tables.c index 44b935fccc22..72fa4bffcfcb 100644 --- a/sys/cddl/dev/dtrace/amd64/dis_tables.c +++ b/sys/cddl/dev/dtrace/amd64/dis_tables.c @@ -1,4 +1,5 @@ /* + * * CDDL HEADER START * * The contents of this file are subject to the terms of the @@ -17,21 +18,22 @@ * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END - * - * $FreeBSD$ */ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + */ + +/* + * Copyright (c) 2010, Intel Corporation. + * All rights reserved. */ /* Copyright (c) 1988 AT&T */ /* All Rights Reserved */ - -#if defined(sun) -#pragma ident "@(#)dis_tables.c 1.11 06/03/02 SMI" -#endif +/* + * $FreeBSD$ + */ #include "dis_tables.h" @@ -66,16 +68,16 @@ extern size_t strlcat(char *, const char *, size_t); #endif -#define TERM NULL /* used to indicate that the 'indirect' */ +#define TERM 0 /* used to indicate that the 'indirect' */ /* field terminates - no pointer. */ /* Used to decode instructions. */ typedef struct instable { - const struct instable *it_indirect; /* for decode op codes */ + struct instable *it_indirect; /* for decode op codes */ uchar_t it_adrmode; #ifdef DIS_TEXT char it_name[NCPS]; - uint_t it_suffix:1; /* mneu + "w", "l", or "d" */ + uint_t it_suffix:1; /* mnem + "w", "l", or "d" */ #endif #ifdef DIS_MEM uint_t it_size:16; @@ -106,6 +108,7 @@ enum { MO, /* memory only (no registers) */ PREF, SWAPGS, + MONITOR_MWAIT, R, RA, SEG, @@ -152,8 +155,10 @@ enum { CWD, /* so data16 can be evaluated for cwd and variants */ RET, /* single immediate 16-bit operand */ MOVZ, /* for movs and movz, with different size operands */ + CRC32, /* for crc32, with different size operands */ XADDB, /* for xaddb */ MOVSXZ, /* AMD64 mov sign extend 32 to 64 bit instruction */ + MOVBE, /* movbe instruction */ /* * MMX/SIMD addressing modes. @@ -166,6 +171,7 @@ enum { MMOS, /* Prefixable MMX/SIMD-Int mm -> mm/mem */ MMOMS, /* Prefixable MMX/SIMD-Int mm -> mem */ MMOPM, /* MMX/SIMD-Int mm/mem -> mm,imm8 */ + MMOPM_66o, /* MMX/SIMD-Int 0x66 optional mm/mem -> mm,imm8 */ MMOPRM, /* Prefixable MMX/SIMD-Int r32/mem -> mm,imm8 */ MMOSH, /* Prefixable MMX mm,imm8 */ MM, /* MMX/SIMD-Int mm/mem -> mm */ @@ -180,12 +186,19 @@ enum { XMMOM, /* Prefixable SIMD xmm -> mem */ XMMOMS, /* Prefixable SIMD mem -> xmm */ XMM, /* SIMD xmm/mem -> xmm */ + XMM_66r, /* SIMD 0x66 prefix required xmm/mem -> xmm */ + XMM_66o, /* SIMD 0x66 prefix optional xmm/mem -> xmm */ XMMXIMPL, /* SIMD xmm -> xmm (mem) */ XMM3P, /* SIMD xmm -> r32,imm8 */ + XMM3PM_66r, /* SIMD 0x66 prefix required xmm -> r32/mem,imm8 */ XMMP, /* SIMD xmm/mem w/to xmm,imm8 */ + XMMP_66o, /* SIMD 0x66 prefix optional xmm/mem w/to xmm,imm8 */ + XMMP_66r, /* SIMD 0x66 prefix required xmm/mem w/to xmm,imm8 */ XMMPRM, /* SIMD r32/mem -> xmm,imm8 */ + XMMPRM_66r, /* SIMD 0x66 prefix required r32/mem -> xmm,imm8 */ XMMS, /* SIMD xmm -> xmm/mem */ XMMM, /* SIMD mem -> xmm */ + XMMM_66r, /* SIMD 0x66 prefix required mem -> xmm */ XMMMS, /* SIMD xmm -> mem */ XMM3MX, /* SIMD r32/mem -> xmm */ XMM3MXS, /* SIMD xmm -> r32/mem */ @@ -195,10 +208,35 @@ enum { XMMXMM, /* SIMD xmm/mem -> mm */ XMMMX, /* SIMD mm -> xmm */ XMMXM, /* SIMD xmm -> mm */ + XMMX2I, /* SIMD xmm -> xmm, imm, imm */ + XMM2I, /* SIMD xmm, imm, imm */ XMMFENCE, /* SIMD lfence or mfence */ - XMMSFNC /* SIMD sfence (none or mem) */ + XMMSFNC, /* SIMD sfence (none or mem) */ + XGETBV_XSETBV, + VEX_NONE, /* VEX no operand */ + VEX_MO, /* VEX mod_rm -> implicit reg */ + VEX_RMrX, /* VEX VEX.vvvv, mod_rm -> mod_reg */ + VEX_RRX, /* VEX VEX.vvvv, mod_reg -> mod_rm */ + VEX_RMRX, /* VEX VEX.vvvv, mod_rm, imm8[7:4] -> mod_reg */ + VEX_MX, /* VEX mod_rm -> mod_reg */ + VEX_MXI, /* VEX mod_rm, imm8 -> mod_reg */ + VEX_XXI, /* VEX mod_rm, imm8 -> VEX.vvvv */ + VEX_MR, /* VEX mod_rm -> mod_reg */ + VEX_RRI, /* VEX mod_reg, mod_rm -> implicit(eflags/r32) */ + VEX_RX, /* VEX mod_reg -> mod_rm */ + VEX_RR, /* VEX mod_rm -> mod_reg */ + VEX_RRi, /* VEX mod_rm, imm8 -> mod_reg */ + VEX_RM, /* VEX mod_reg -> mod_rm */ + VEX_RRM, /* VEX VEX.vvvv, mod_reg -> mod_rm */ + VEX_RMX /* VEX VEX.vvvv, mod_rm -> mod_reg */ }; +/* + * VEX prefixes + */ +#define VEX_2bytes 0xC5 /* the first byte of two-byte form */ +#define VEX_3bytes 0xC4 /* the first byte of three-byte form */ + #define FILL 0x90 /* Fill byte used for alignment (nop) */ /* @@ -221,6 +259,7 @@ enum { #define MODE_SIGNED 2 /* sign extended immediate */ #define MODE_IMPLIED 3 /* constant value implied from opcode */ #define MODE_OFFSET 4 /* offset part of an address */ +#define MODE_RIPREL 5 /* like IPREL, but from %rip (amd64) */ /* * The letters used in these macros are: @@ -236,8 +275,8 @@ enum { */ #if defined(DIS_TEXT) && defined(DIS_MEM) -#define IND(table) {table, 0, "", 0, 0, 0, 0, 0, 0} -#define INDx(table) {table, 0, "", 0, 0, 1, 0, 0, 0} +#define IND(table) {(instable_t *)table, 0, "", 0, 0, 0, 0, 0, 0} +#define INDx(table) {(instable_t *)table, 0, "", 0, 0, 1, 0, 0, 0} #define TNS(name, amode) {TERM, amode, name, 0, 0, 0, 0, 0, 0} #define TNSu(name, amode) {TERM, amode, name, 0, 0, 0, 0, 1, 0} #define TNSx(name, amode) {TERM, amode, name, 0, 0, 1, 0, 0, 0} @@ -254,8 +293,8 @@ enum { #define TSZy(name, amode, sz) {TERM, amode, name, 1, sz, 0, 1, 0, 0} #define INVALID {TERM, UNKNOWN, "", 0, 0, 0, 0, 0} #elif defined(DIS_TEXT) -#define IND(table) {table, 0, "", 0, 0, 0, 0, 0} -#define INDx(table) {table, 0, "", 0, 1, 0, 0, 0} +#define IND(table) {(instable_t *)table, 0, "", 0, 0, 0, 0, 0} +#define INDx(table) {(instable_t *)table, 0, "", 0, 1, 0, 0, 0} #define TNS(name, amode) {TERM, amode, name, 0, 0, 0, 0, 0} #define TNSu(name, amode) {TERM, amode, name, 0, 0, 0, 1, 0} #define TNSx(name, amode) {TERM, amode, name, 0, 1, 0, 0, 0} @@ -272,8 +311,8 @@ enum { #define TSZy(name, amode, sz) {TERM, amode, name, 1, 0, 1, 0, 0} #define INVALID {TERM, UNKNOWN, "", 0, 0, 0, 0, 0} #elif defined(DIS_MEM) -#define IND(table) {table, 0, 0, 0, 0, 0, 0} -#define INDx(table) {table, 0, 0, 1, 0, 0, 0} +#define IND(table) {(instable_t *)table, 0, 0, 0, 0, 0, 0} +#define INDx(table) {(instable_t *)table, 0, 0, 1, 0, 0, 0} #define TNS(name, amode) {TERM, amode, 0, 0, 0, 0, 0} #define TNSu(name, amode) {TERM, amode, 0, 0, 0, 1, 0} #define TNSy(name, amode) {TERM, amode, 0, 0, 1, 0, 0} @@ -290,8 +329,8 @@ enum { #define TSZy(name, amode, sz) {TERM, amode, sz, 0, 1, 0, 0} #define INVALID {TERM, UNKNOWN, 0, 0, 0, 0, 0} #else -#define IND(table) {table[0], 0, 0, 0, 0, 0} -#define INDx(table) {table[0], 0, 1, 0, 0, 0} +#define IND(table) {(instable_t *)table, 0, 0, 0, 0, 0} +#define INDx(table) {(instable_t *)table, 0, 1, 0, 0, 0} #define TNS(name, amode) {TERM, amode, 0, 0, 0, 0} #define TNSu(name, amode) {TERM, amode, 0, 0, 1, 0} #define TNSy(name, amode) {TERM, amode, 0, 1, 0, 0} @@ -406,6 +445,11 @@ const char *const dis_XMMREG[16] = { "%xmm8", "%xmm9", "%xmm10", "%xmm11", "%xmm12", "%xmm13", "%xmm14", "%xmm15" }; +const char *const dis_YMMREG[16] = { + "%ymm0", "%ymm1", "%ymm2", "%ymm3", "%ymm4", "%ymm5", "%ymm6", "%ymm7", + "%ymm8", "%ymm9", "%ymm10", "%ymm11", "%ymm12", "%ymm13", "%ymm14", "%ymm15" +}; + const char *const dis_SEGREG[16] = { "%es", "%cs", "%ss", "%ds", "%fs", "%gs", "<reserved>", "<reserved>", "%es", "%cs", "%ss", "%ds", "%fs", "%gs", "<reserved>", "<reserved>" @@ -418,13 +462,15 @@ const char *const dis_PREDSUFFIX[8] = { "eq", "lt", "le", "unord", "neq", "nlt", "nle", "ord" }; - +const char *const dis_AVXvgrp7[3][8] = { + /*0 1 2 3 4 5 6 7*/ +/*71*/ {"", "", "vpsrlw", "", "vpsraw", "", "vpsllw", ""}, +/*72*/ {"", "", "vpsrld", "", "vpsrad", "", "vpslld", ""}, +/*73*/ {"", "", "vpsrlq", "vpsrldq", "", "", "vpsllq", "vpslldq"} +}; #endif /* DIS_TEXT */ - - - /* * "decode table" for 64 bit mode MOVSXD instruction (opcode 0x63) */ @@ -450,7 +496,7 @@ const instable_t dis_op0F00[8] = { */ const instable_t dis_op0F01[8] = { -/* [0] */ TNSZ("sgdt",MO,6), TNSZ("sidt",MO,6), TNSZ("lgdt",MO,6), TNSZ("lidt",MO,6), +/* [0] */ TNSZ("sgdt",MO,6), TNSZ("sidt",MONITOR_MWAIT,6), TNSZ("lgdt",XGETBV_XSETBV,6), TNSZ("lidt",MO,6), /* [4] */ TNSZ("smsw",M,2), INVALID, TNSZ("lmsw",M,2), TNS("invlpg",SWAPGS), }; @@ -468,7 +514,7 @@ const instable_t dis_op0F18[8] = { */ const instable_t dis_op0FAE[8] = { /* [0] */ TNSZ("fxsave",M,512), TNSZ("fxrstor",M,512), TNS("ldmxcsr",M), TNS("stmxcsr",M), -/* [4] */ INVALID, TNS("lfence",XMMFENCE), TNS("mfence",XMMFENCE), TNS("sfence",XMMSFNC), +/* [4] */ TNSZ("xsave",M,512), TNS("lfence",XMMFENCE), TNS("mfence",XMMFENCE), TNS("sfence",XMMSFNC), }; /* @@ -587,7 +633,7 @@ const instable_t dis_opSIMDdata16[256] = { /* [70] */ TNSZ("pshufd",XMMP,16), INVALID, INVALID, INVALID, /* [74] */ TNSZ("pcmpeqb",XMM,16), TNSZ("pcmpeqw",XMM,16), TNSZ("pcmpeqd",XMM,16), INVALID, -/* [78] */ INVALID, INVALID, INVALID, INVALID, +/* [78] */ TNSZ("extrq",XMM2I,16), TNSZ("extrq",XMM,16), INVALID, INVALID, /* [7C] */ INVALID, INVALID, TNSZ("movd",XMM3MXS,4), TNSZ("movdqa",XMMS,16), /* [80] */ INVALID, INVALID, INVALID, INVALID, @@ -631,6 +677,88 @@ const instable_t dis_opSIMDdata16[256] = { /* [FC] */ TNSZ("paddb",XMM,16), TNSZ("paddw",XMM,16), TNSZ("paddd",XMM,16), INVALID, }; +const instable_t dis_opAVX660F[256] = { +/* [00] */ INVALID, INVALID, INVALID, INVALID, +/* [04] */ INVALID, INVALID, INVALID, INVALID, +/* [08] */ INVALID, INVALID, INVALID, INVALID, +/* [0C] */ INVALID, INVALID, INVALID, INVALID, + +/* [10] */ TNSZ("vmovupd",VEX_MX,16), TNSZ("vmovupd",VEX_RX,16), TNSZ("vmovlpd",VEX_RMrX,8), TNSZ("vmovlpd",VEX_RM,8), +/* [14] */ TNSZ("vunpcklpd",VEX_RMrX,16),TNSZ("vunpckhpd",VEX_RMrX,16),TNSZ("vmovhpd",VEX_RMrX,8), TNSZ("vmovhpd",VEX_RM,8), +/* [18] */ INVALID, INVALID, INVALID, INVALID, +/* [1C] */ INVALID, INVALID, INVALID, INVALID, + +/* [20] */ INVALID, INVALID, INVALID, INVALID, +/* [24] */ INVALID, INVALID, INVALID, INVALID, +/* [28] */ TNSZ("vmovapd",VEX_MX,16), TNSZ("vmovapd",VEX_RX,16), INVALID, TNSZ("vmovntpd",VEX_RM,16), +/* [2C] */ INVALID, INVALID, TNSZ("vucomisd",VEX_MX,8),TNSZ("vcomisd",VEX_MX,8), + +/* [30] */ INVALID, INVALID, INVALID, INVALID, +/* [34] */ INVALID, INVALID, INVALID, INVALID, +/* [38] */ INVALID, INVALID, INVALID, INVALID, +/* [3C] */ INVALID, INVALID, INVALID, INVALID, + +/* [40] */ INVALID, INVALID, INVALID, INVALID, +/* [44] */ INVALID, INVALID, INVALID, INVALID, +/* [48] */ INVALID, INVALID, INVALID, INVALID, +/* [4C] */ INVALID, INVALID, INVALID, INVALID, + +/* [50] */ TNS("vmovmskpd",VEX_MR), TNSZ("vsqrtpd",VEX_MX,16), INVALID, INVALID, +/* [54] */ TNSZ("vandpd",VEX_RMrX,16), TNSZ("vandnpd",VEX_RMrX,16), TNSZ("vorpd",VEX_RMrX,16), TNSZ("vxorpd",VEX_RMrX,16), +/* [58] */ TNSZ("vaddpd",VEX_RMrX,16), TNSZ("vmulpd",VEX_RMrX,16), TNSZ("vcvtpd2ps",VEX_MX,16),TNSZ("vcvtps2dq",VEX_MX,16), +/* [5C] */ TNSZ("vsubpd",VEX_RMrX,16), TNSZ("vminpd",VEX_RMrX,16), TNSZ("vdivpd",VEX_RMrX,16), TNSZ("vmaxpd",VEX_RMrX,16), + +/* [60] */ TNSZ("vpunpcklbw",VEX_RMrX,16),TNSZ("vpunpcklwd",VEX_RMrX,16),TNSZ("vpunpckldq",VEX_RMrX,16),TNSZ("vpacksswb",VEX_RMrX,16), +/* [64] */ TNSZ("vpcmpgtb",VEX_RMrX,16), TNSZ("vpcmpgtw",VEX_RMrX,16), TNSZ("vpcmpgtd",VEX_RMrX,16), TNSZ("vpackuswb",VEX_RMrX,16), +/* [68] */ TNSZ("vpunpckhbw",VEX_RMrX,16),TNSZ("vpunpckhwd",VEX_RMrX,16),TNSZ("vpunpckhdq",VEX_RMrX,16),TNSZ("vpackssdw",VEX_RMrX,16), +/* [6C] */ TNSZ("vpunpcklqdq",VEX_RMrX,16),TNSZ("vpunpckhqdq",VEX_RMrX,16),TNSZ("vmovd",VEX_MX,4),TNSZ("vmovdqa",VEX_MX,16), + +/* [70] */ TNSZ("vpshufd",VEX_MXI,16), TNSZ("vgrp71",VEX_XXI,16), TNSZ("vgrp72",VEX_XXI,16), TNSZ("vgrp73",VEX_XXI,16), +/* [74] */ TNSZ("vpcmpeqb",VEX_RMrX,16), TNSZ("vpcmpeqw",VEX_RMrX,16), TNSZ("vpcmpeqd",VEX_RMrX,16), INVALID, +/* [78] */ INVALID, INVALID, INVALID, INVALID, +/* [7C] */ TNSZ("vhaddpd",VEX_RMrX,16), TNSZ("vhsubpd",VEX_RMrX,16), TNSZ("vmovd",VEX_RR,4), TNSZ("vmovdqa",VEX_RX,16), + +/* [80] */ INVALID, INVALID, INVALID, INVALID, +/* [84] */ INVALID, INVALID, INVALID, INVALID, +/* [88] */ INVALID, INVALID, INVALID, INVALID, +/* [8C] */ INVALID, INVALID, INVALID, INVALID, + +/* [90] */ INVALID, INVALID, INVALID, INVALID, +/* [94] */ INVALID, INVALID, INVALID, INVALID, +/* [98] */ INVALID, INVALID, INVALID, INVALID, +/* [9C] */ INVALID, INVALID, INVALID, INVALID, + +/* [A0] */ INVALID, INVALID, INVALID, INVALID, +/* [A4] */ INVALID, INVALID, INVALID, INVALID, +/* [A8] */ INVALID, INVALID, INVALID, INVALID, +/* [AC] */ INVALID, INVALID, INVALID, INVALID, + +/* [B0] */ INVALID, INVALID, INVALID, INVALID, +/* [B4] */ INVALID, INVALID, INVALID, INVALID, +/* [B8] */ INVALID, INVALID, INVALID, INVALID, +/* [BC] */ INVALID, INVALID, INVALID, INVALID, + +/* [C0] */ INVALID, INVALID, TNSZ("vcmppd",VEX_RMRX,16), INVALID, +/* [C4] */ TNSZ("vpinsrw",VEX_RMRX,2),TNS("vpextrw",VEX_MR), TNSZ("vshufpd",VEX_RMRX,16), INVALID, +/* [C8] */ INVALID, INVALID, INVALID, INVALID, +/* [CC] */ INVALID, INVALID, INVALID, INVALID, + +/* [D0] */ TNSZ("vaddsubpd",VEX_RMrX,16),TNSZ("vpsrlw",VEX_RMrX,16), TNSZ("vpsrld",VEX_RMrX,16), TNSZ("vpsrlq",VEX_RMrX,16), +/* [D4] */ TNSZ("vpaddq",VEX_RMrX,16), TNSZ("vpmullw",VEX_RMrX,16), TNSZ("vmovq",VEX_RX,8), TNS("vpmovmskb",VEX_MR), +/* [D8] */ TNSZ("vpsubusb",VEX_RMrX,16), TNSZ("vpsubusw",VEX_RMrX,16), TNSZ("vpminub",VEX_RMrX,16), TNSZ("vpand",VEX_RMrX,16), +/* [DC] */ TNSZ("vpaddusb",VEX_RMrX,16), TNSZ("vpaddusw",VEX_RMrX,16), TNSZ("vpmaxub",VEX_RMrX,16), TNSZ("vpandn",VEX_RMrX,16), + +/* [E0] */ TNSZ("vpavgb",VEX_RMrX,16), TNSZ("vpsraw",VEX_RMrX,16), TNSZ("vpsrad",VEX_RMrX,16), TNSZ("vpavgw",VEX_RMrX,16), +/* [E4] */ TNSZ("vpmulhuw",VEX_RMrX,16), TNSZ("vpmulhw",VEX_RMrX,16), TNSZ("vcvttpd2dq",VEX_MX,16),TNSZ("vmovntdq",VEX_RM,16), +/* [E8] */ TNSZ("vpsubsb",VEX_RMrX,16), TNSZ("vpsubsw",VEX_RMrX,16), TNSZ("vpminsw",VEX_RMrX,16), TNSZ("vpor",VEX_RMrX,16), +/* [EC] */ TNSZ("vpaddsb",VEX_RMrX,16), TNSZ("vpaddsw",VEX_RMrX,16), TNSZ("vpmaxsw",VEX_RMrX,16), TNSZ("vpxor",VEX_RMrX,16), + +/* [F0] */ INVALID, TNSZ("vpsllw",VEX_RMrX,16), TNSZ("vpslld",VEX_RMrX,16), TNSZ("vpsllq",VEX_RMrX,16), +/* [F4] */ TNSZ("vpmuludq",VEX_RMrX,16), TNSZ("vpmaddwd",VEX_RMrX,16), TNSZ("vpsadbw",VEX_RMrX,16), TNS("vmaskmovdqu",VEX_MX), +/* [F8] */ TNSZ("vpsubb",VEX_RMrX,16), TNSZ("vpsubw",VEX_RMrX,16), TNSZ("vpsubd",VEX_RMrX,16), TNSZ("vpsubq",VEX_RMrX,16), +/* [FC] */ TNSZ("vpaddb",VEX_RMrX,16), TNSZ("vpaddw",VEX_RMrX,16), TNSZ("vpaddd",VEX_RMrX,16), INVALID, +}; + /* * Decode table for SIMD instructions with the repnz (0xf2) prefix. */ @@ -647,7 +775,7 @@ const instable_t dis_opSIMDrepnz[256] = { /* [20] */ INVALID, INVALID, INVALID, INVALID, /* [24] */ INVALID, INVALID, INVALID, INVALID, -/* [28] */ INVALID, INVALID, TNSZ("cvtsi2sd",XMM3MX,4),INVALID, +/* [28] */ INVALID, INVALID, TNSZ("cvtsi2sd",XMM3MX,4),TNSZ("movntsd",XMMMS,8), /* [2C] */ TNSZ("cvttsd2si",XMMXM3,8),TNSZ("cvtsd2si",XMMXM3,8),INVALID, INVALID, /* [30] */ INVALID, INVALID, INVALID, INVALID, @@ -672,7 +800,7 @@ const instable_t dis_opSIMDrepnz[256] = { /* [70] */ TNSZ("pshuflw",XMMP,16),INVALID, INVALID, INVALID, /* [74] */ INVALID, INVALID, INVALID, INVALID, -/* [78] */ INVALID, INVALID, INVALID, INVALID, +/* [78] */ TNSZ("insertq",XMMX2I,16),TNSZ("insertq",XMM,8),INVALID, INVALID, /* [7C] */ INVALID, INVALID, INVALID, INVALID, /* [80] */ INVALID, INVALID, INVALID, INVALID, @@ -716,6 +844,88 @@ const instable_t dis_opSIMDrepnz[256] = { /* [FC] */ INVALID, INVALID, INVALID, INVALID, }; +const instable_t dis_opAVXF20F[256] = { +/* [00] */ INVALID, INVALID, INVALID, INVALID, +/* [04] */ INVALID, INVALID, INVALID, INVALID, +/* [08] */ INVALID, INVALID, INVALID, INVALID, +/* [0C] */ INVALID, INVALID, INVALID, INVALID, + +/* [10] */ TNSZ("vmovsd",VEX_RMrX,8), TNSZ("vmovsd",VEX_RRX,8), TNSZ("vmovddup",VEX_MX,8), INVALID, +/* [14] */ INVALID, INVALID, INVALID, INVALID, +/* [18] */ INVALID, INVALID, INVALID, INVALID, +/* [1C] */ INVALID, INVALID, INVALID, INVALID, + +/* [20] */ INVALID, INVALID, INVALID, INVALID, +/* [24] */ INVALID, INVALID, INVALID, INVALID, +/* [28] */ INVALID, INVALID, TNSZ("vcvtsi2sd",VEX_RMrX,4),INVALID, +/* [2C] */ TNSZ("vcvttsd2si",VEX_MR,8),TNSZ("vcvtsd2si",VEX_MR,8),INVALID, INVALID, + +/* [30] */ INVALID, INVALID, INVALID, INVALID, +/* [34] */ INVALID, INVALID, INVALID, INVALID, +/* [38] */ INVALID, INVALID, INVALID, INVALID, +/* [3C] */ INVALID, INVALID, INVALID, INVALID, + +/* [40] */ INVALID, INVALID, INVALID, INVALID, +/* [44] */ INVALID, INVALID, INVALID, INVALID, +/* [48] */ INVALID, INVALID, INVALID, INVALID, +/* [4C] */ INVALID, INVALID, INVALID, INVALID, + +/* [50] */ INVALID, TNSZ("vsqrtsd",VEX_RMrX,8), INVALID, INVALID, +/* [54] */ INVALID, INVALID, INVALID, INVALID, +/* [58] */ TNSZ("vaddsd",VEX_RMrX,8), TNSZ("vmulsd",VEX_RMrX,8), TNSZ("vcvtsd2ss",VEX_RMrX,8), INVALID, +/* [5C] */ TNSZ("vsubsd",VEX_RMrX,8), TNSZ("vminsd",VEX_RMrX,8), TNSZ("vdivsd",VEX_RMrX,8), TNSZ("vmaxsd",VEX_RMrX,8), + +/* [60] */ INVALID, INVALID, INVALID, INVALID, +/* [64] */ INVALID, INVALID, INVALID, INVALID, +/* [68] */ INVALID, INVALID, INVALID, INVALID, +/* [6C] */ INVALID, INVALID, INVALID, INVALID, + +/* [70] */ TNSZ("vpshuflw",VEX_MXI,16),INVALID, INVALID, INVALID, +/* [74] */ INVALID, INVALID, INVALID, INVALID, +/* [78] */ INVALID, INVALID, INVALID, INVALID, +/* [7C] */ TNSZ("vhaddps",VEX_RMrX,8), TNSZ("vhsubps",VEX_RMrX,8), INVALID, INVALID, + +/* [80] */ INVALID, INVALID, INVALID, INVALID, +/* [84] */ INVALID, INVALID, INVALID, INVALID, +/* [88] */ INVALID, INVALID, INVALID, INVALID, +/* [0C] */ INVALID, INVALID, INVALID, INVALID, + +/* [90] */ INVALID, INVALID, INVALID, INVALID, +/* [94] */ INVALID, INVALID, INVALID, INVALID, +/* [98] */ INVALID, INVALID, INVALID, INVALID, +/* [9C] */ INVALID, INVALID, INVALID, INVALID, + +/* [A0] */ INVALID, INVALID, INVALID, INVALID, +/* [A4] */ INVALID, INVALID, INVALID, INVALID, +/* [A8] */ INVALID, INVALID, INVALID, INVALID, +/* [AC] */ INVALID, INVALID, INVALID, INVALID, + +/* [B0] */ INVALID, INVALID, INVALID, INVALID, +/* [B4] */ INVALID, INVALID, INVALID, INVALID, +/* [B8] */ INVALID, INVALID, INVALID, INVALID, +/* [BC] */ INVALID, INVALID, INVALID, INVALID, + +/* [C0] */ INVALID, INVALID, TNSZ("vcmpsd",VEX_RMRX,8), INVALID, +/* [C4] */ INVALID, INVALID, INVALID, INVALID, +/* [C8] */ INVALID, INVALID, INVALID, INVALID, +/* [CC] */ INVALID, INVALID, INVALID, INVALID, + +/* [D0] */ TNSZ("vaddsubps",VEX_RMrX,8), INVALID, INVALID, INVALID, +/* [D4] */ INVALID, INVALID, INVALID, INVALID, +/* [D8] */ INVALID, INVALID, INVALID, INVALID, +/* [DC] */ INVALID, INVALID, INVALID, INVALID, + +/* [E0] */ INVALID, INVALID, INVALID, INVALID, +/* [E4] */ INVALID, INVALID, TNSZ("vcvtpd2dq",VEX_MX,16),INVALID, +/* [E8] */ INVALID, INVALID, INVALID, INVALID, +/* [EC] */ INVALID, INVALID, INVALID, INVALID, + +/* [F0] */ TNSZ("vlddqu",VEX_MX,16), INVALID, INVALID, INVALID, +/* [F4] */ INVALID, INVALID, INVALID, INVALID, +/* [F8] */ INVALID, INVALID, INVALID, INVALID, +/* [FC] */ INVALID, INVALID, INVALID, INVALID, +}; + /* * Decode table for SIMD instructions with the repz (0xf3) prefix. */ @@ -732,7 +942,7 @@ const instable_t dis_opSIMDrepz[256] = { /* [20] */ INVALID, INVALID, INVALID, INVALID, /* [24] */ INVALID, INVALID, INVALID, INVALID, -/* [28] */ INVALID, INVALID, TNSZ("cvtsi2ss",XMM3MX,4),INVALID, +/* [28] */ INVALID, INVALID, TNSZ("cvtsi2ss",XMM3MX,4),TNSZ("movntss",XMMMS,4), /* [2C] */ TNSZ("cvttss2si",XMMXM3,4),TNSZ("cvtss2si",XMMXM3,4),INVALID, INVALID, /* [30] */ INVALID, INVALID, INVALID, INVALID, @@ -777,8 +987,8 @@ const instable_t dis_opSIMDrepz[256] = { /* [B0] */ INVALID, INVALID, INVALID, INVALID, /* [B4] */ INVALID, INVALID, INVALID, INVALID, -/* [B8] */ INVALID, INVALID, INVALID, INVALID, -/* [BC] */ INVALID, INVALID, INVALID, INVALID, +/* [B8] */ TS("popcnt",MRw), INVALID, INVALID, INVALID, +/* [BC] */ INVALID, TS("lzcnt",MRw), INVALID, INVALID, /* [C0] */ INVALID, INVALID, TNSZ("cmpss",XMMP,4), INVALID, /* [C4] */ INVALID, INVALID, INVALID, INVALID, @@ -801,6 +1011,427 @@ const instable_t dis_opSIMDrepz[256] = { /* [FC] */ INVALID, INVALID, INVALID, INVALID, }; +const instable_t dis_opAVXF30F[256] = { +/* [00] */ INVALID, INVALID, INVALID, INVALID, +/* [04] */ INVALID, INVALID, INVALID, INVALID, +/* [08] */ INVALID, INVALID, INVALID, INVALID, +/* [0C] */ INVALID, INVALID, INVALID, INVALID, + +/* [10] */ TNSZ("vmovss",VEX_RMrX,4), TNSZ("vmovss",VEX_RRX,4), TNSZ("vmovsldup",VEX_MX,4), INVALID, +/* [14] */ INVALID, INVALID, TNSZ("vmovshdup",VEX_MX,4), INVALID, +/* [18] */ INVALID, INVALID, INVALID, INVALID, +/* [1C] */ INVALID, INVALID, INVALID, INVALID, + +/* [20] */ INVALID, INVALID, INVALID, INVALID, +/* [24] */ INVALID, INVALID, INVALID, INVALID, +/* [28] */ INVALID, INVALID, TNSZ("vcvtsi2ss",VEX_RMrX,4),INVALID, +/* [2C] */ TNSZ("vcvttss2si",VEX_MR,4),TNSZ("vcvtss2si",VEX_MR,4),INVALID, INVALID, + +/* [30] */ INVALID, INVALID, INVALID, INVALID, +/* [34] */ INVALID, INVALID, INVALID, INVALID, +/* [38] */ INVALID, INVALID, INVALID, INVALID, +/* [3C] */ INVALID, INVALID, INVALID, INVALID, + +/* [40] */ INVALID, INVALID, INVALID, INVALID, +/* [44] */ INVALID, INVALID, INVALID, INVALID, +/* [48] */ INVALID, INVALID, INVALID, INVALID, +/* [4C] */ INVALID, INVALID, INVALID, INVALID, + +/* [50] */ INVALID, TNSZ("vsqrtss",VEX_RMrX,4), TNSZ("vrsqrtss",VEX_RMrX,4), TNSZ("vrcpss",VEX_RMrX,4), +/* [54] */ INVALID, INVALID, INVALID, INVALID, +/* [58] */ TNSZ("vaddss",VEX_RMrX,4), TNSZ("vmulss",VEX_RMrX,4), TNSZ("vcvtss2sd",VEX_RMrX,4), TNSZ("vcvttps2dq",VEX_MX,16), +/* [5C] */ TNSZ("vsubss",VEX_RMrX,4), TNSZ("vminss",VEX_RMrX,4), TNSZ("vdivss",VEX_RMrX,4), TNSZ("vmaxss",VEX_RMrX,4), + +/* [60] */ INVALID, INVALID, INVALID, INVALID, +/* [64] */ INVALID, INVALID, INVALID, INVALID, +/* [68] */ INVALID, INVALID, INVALID, INVALID, +/* [6C] */ INVALID, INVALID, INVALID, TNSZ("vmovdqu",VEX_MX,16), + +/* [70] */ TNSZ("vpshufhw",VEX_MXI,16),INVALID, INVALID, INVALID, +/* [74] */ INVALID, INVALID, INVALID, INVALID, +/* [78] */ INVALID, INVALID, INVALID, INVALID, +/* [7C] */ INVALID, INVALID, TNSZ("vmovq",VEX_MX,8), TNSZ("vmovdqu",VEX_RX,16), + +/* [80] */ INVALID, INVALID, INVALID, INVALID, +/* [84] */ INVALID, INVALID, INVALID, INVALID, +/* [88] */ INVALID, INVALID, INVALID, INVALID, +/* [0C] */ INVALID, INVALID, INVALID, INVALID, + +/* [90] */ INVALID, INVALID, INVALID, INVALID, +/* [94] */ INVALID, INVALID, INVALID, INVALID, +/* [98] */ INVALID, INVALID, INVALID, INVALID, +/* [9C] */ INVALID, INVALID, INVALID, INVALID, + +/* [A0] */ INVALID, INVALID, INVALID, INVALID, +/* [A4] */ INVALID, INVALID, INVALID, INVALID, +/* [A8] */ INVALID, INVALID, INVALID, INVALID, +/* [AC] */ INVALID, INVALID, INVALID, INVALID, + +/* [B0] */ INVALID, INVALID, INVALID, INVALID, +/* [B4] */ INVALID, INVALID, INVALID, INVALID, +/* [B8] */ INVALID, INVALID, INVALID, INVALID, +/* [BC] */ INVALID, INVALID, INVALID, INVALID, + +/* [C0] */ INVALID, INVALID, TNSZ("vcmpss",VEX_RMRX,4), INVALID, +/* [C4] */ INVALID, INVALID, INVALID, INVALID, +/* [C8] */ INVALID, INVALID, INVALID, INVALID, +/* [CC] */ INVALID, INVALID, INVALID, INVALID, + +/* [D0] */ INVALID, INVALID, INVALID, INVALID, +/* [D4] */ INVALID, INVALID, INVALID, INVALID, +/* [D8] */ INVALID, INVALID, INVALID, INVALID, +/* [DC] */ INVALID, INVALID, INVALID, INVALID, + +/* [E0] */ INVALID, INVALID, INVALID, INVALID, +/* [E4] */ INVALID, INVALID, TNSZ("vcvtdq2pd",VEX_MX,8), INVALID, +/* [E8] */ INVALID, INVALID, INVALID, INVALID, +/* [EC] */ INVALID, INVALID, INVALID, INVALID, + +/* [F0] */ INVALID, INVALID, INVALID, INVALID, +/* [F4] */ INVALID, INVALID, INVALID, INVALID, +/* [F8] */ INVALID, INVALID, INVALID, INVALID, +/* [FC] */ INVALID, INVALID, INVALID, INVALID, +}; +/* + * The following two tables are used to encode crc32 and movbe + * since they share the same opcodes. + */ +const instable_t dis_op0F38F0[2] = { +/* [00] */ TNS("crc32b",CRC32), + TS("movbe",MOVBE), +}; + +const instable_t dis_op0F38F1[2] = { +/* [00] */ TS("crc32",CRC32), + TS("movbe",MOVBE), +}; + +const instable_t dis_op0F38[256] = { +/* [00] */ TNSZ("pshufb",XMM_66o,16),TNSZ("phaddw",XMM_66o,16),TNSZ("phaddd",XMM_66o,16),TNSZ("phaddsw",XMM_66o,16), +/* [04] */ TNSZ("pmaddubsw",XMM_66o,16),TNSZ("phsubw",XMM_66o,16), TNSZ("phsubd",XMM_66o,16),TNSZ("phsubsw",XMM_66o,16), +/* [08] */ TNSZ("psignb",XMM_66o,16),TNSZ("psignw",XMM_66o,16),TNSZ("psignd",XMM_66o,16),TNSZ("pmulhrsw",XMM_66o,16), +/* [0C] */ INVALID, INVALID, INVALID, INVALID, + +/* [10] */ TNSZ("pblendvb",XMM_66r,16),INVALID, INVALID, INVALID, +/* [14] */ TNSZ("blendvps",XMM_66r,16),TNSZ("blendvpd",XMM_66r,16),INVALID, TNSZ("ptest",XMM_66r,16), +/* [18] */ INVALID, INVALID, INVALID, INVALID, +/* [1C] */ TNSZ("pabsb",XMM_66o,16),TNSZ("pabsw",XMM_66o,16),TNSZ("pabsd",XMM_66o,16),INVALID, + +/* [20] */ TNSZ("pmovsxbw",XMM_66r,16),TNSZ("pmovsxbd",XMM_66r,16),TNSZ("pmovsxbq",XMM_66r,16),TNSZ("pmovsxwd",XMM_66r,16), +/* [24] */ TNSZ("pmovsxwq",XMM_66r,16),TNSZ("pmovsxdq",XMM_66r,16),INVALID, INVALID, +/* [28] */ TNSZ("pmuldq",XMM_66r,16),TNSZ("pcmpeqq",XMM_66r,16),TNSZ("movntdqa",XMMM_66r,16),TNSZ("packusdw",XMM_66r,16), +/* [2C] */ INVALID, INVALID, INVALID, INVALID, + +/* [30] */ TNSZ("pmovzxbw",XMM_66r,16),TNSZ("pmovzxbd",XMM_66r,16),TNSZ("pmovzxbq",XMM_66r,16),TNSZ("pmovzxwd",XMM_66r,16), +/* [34] */ TNSZ("pmovzxwq",XMM_66r,16),TNSZ("pmovzxdq",XMM_66r,16),INVALID, TNSZ("pcmpgtq",XMM_66r,16), +/* [38] */ TNSZ("pminsb",XMM_66r,16),TNSZ("pminsd",XMM_66r,16),TNSZ("pminuw",XMM_66r,16),TNSZ("pminud",XMM_66r,16), +/* [3C] */ TNSZ("pmaxsb",XMM_66r,16),TNSZ("pmaxsd",XMM_66r,16),TNSZ("pmaxuw",XMM_66r,16),TNSZ("pmaxud",XMM_66r,16), + +/* [40] */ TNSZ("pmulld",XMM_66r,16),TNSZ("phminposuw",XMM_66r,16),INVALID, INVALID, +/* [44] */ INVALID, INVALID, INVALID, INVALID, +/* [48] */ INVALID, INVALID, INVALID, INVALID, +/* [4C] */ INVALID, INVALID, INVALID, INVALID, + +/* [50] */ INVALID, INVALID, INVALID, INVALID, +/* [54] */ INVALID, INVALID, INVALID, INVALID, +/* [58] */ INVALID, INVALID, INVALID, INVALID, +/* [5C] */ INVALID, INVALID, INVALID, INVALID, + +/* [60] */ INVALID, INVALID, INVALID, INVALID, +/* [64] */ INVALID, INVALID, INVALID, INVALID, +/* [68] */ INVALID, INVALID, INVALID, INVALID, +/* [6C] */ INVALID, INVALID, INVALID, INVALID, + +/* [70] */ INVALID, INVALID, INVALID, INVALID, +/* [74] */ INVALID, INVALID, INVALID, INVALID, +/* [78] */ INVALID, INVALID, INVALID, INVALID, +/* [7C] */ INVALID, INVALID, INVALID, INVALID, + +/* [80] */ INVALID, INVALID, INVALID, INVALID, +/* [84] */ INVALID, INVALID, INVALID, INVALID, +/* [88] */ INVALID, INVALID, INVALID, INVALID, +/* [8C] */ INVALID, INVALID, INVALID, INVALID, + +/* [90] */ INVALID, INVALID, INVALID, INVALID, +/* [94] */ INVALID, INVALID, INVALID, INVALID, +/* [98] */ INVALID, INVALID, INVALID, INVALID, +/* [9C] */ INVALID, INVALID, INVALID, INVALID, + +/* [A0] */ INVALID, INVALID, INVALID, INVALID, +/* [A4] */ INVALID, INVALID, INVALID, INVALID, +/* [A8] */ INVALID, INVALID, INVALID, INVALID, +/* [AC] */ INVALID, INVALID, INVALID, INVALID, + +/* [B0] */ INVALID, INVALID, INVALID, INVALID, +/* [B4] */ INVALID, INVALID, INVALID, INVALID, +/* [B8] */ INVALID, INVALID, INVALID, INVALID, +/* [BC] */ INVALID, INVALID, INVALID, INVALID, + +/* [C0] */ INVALID, INVALID, INVALID, INVALID, +/* [C4] */ INVALID, INVALID, INVALID, INVALID, +/* [C8] */ INVALID, INVALID, INVALID, INVALID, +/* [CC] */ INVALID, INVALID, INVALID, INVALID, + +/* [D0] */ INVALID, INVALID, INVALID, INVALID, +/* [D4] */ INVALID, INVALID, INVALID, INVALID, +/* [D8] */ INVALID, INVALID, INVALID, TNSZ("aesimc",XMM_66r,16), +/* [DC] */ TNSZ("aesenc",XMM_66r,16),TNSZ("aesenclast",XMM_66r,16),TNSZ("aesdec",XMM_66r,16),TNSZ("aesdeclast",XMM_66r,16), + +/* [E0] */ INVALID, INVALID, INVALID, INVALID, +/* [E4] */ INVALID, INVALID, INVALID, INVALID, +/* [E8] */ INVALID, INVALID, INVALID, INVALID, +/* [EC] */ INVALID, INVALID, INVALID, INVALID, +/* [F0] */ IND(dis_op0F38F0), IND(dis_op0F38F1), INVALID, INVALID, +/* [F4] */ INVALID, INVALID, INVALID, INVALID, +/* [F8] */ INVALID, INVALID, INVALID, INVALID, +/* [FC] */ INVALID, INVALID, INVALID, INVALID, +}; + +const instable_t dis_opAVX660F38[256] = { +/* [00] */ TNSZ("vpshufb",VEX_RMrX,16),TNSZ("vphaddw",VEX_RMrX,16),TNSZ("vphaddd",VEX_RMrX,16),TNSZ("vphaddsw",VEX_RMrX,16), +/* [04] */ TNSZ("vpmaddubsw",VEX_RMrX,16),TNSZ("vphsubw",VEX_RMrX,16), TNSZ("vphsubd",VEX_RMrX,16),TNSZ("vphsubsw",VEX_RMrX,16), +/* [08] */ TNSZ("vpsignb",VEX_RMrX,16),TNSZ("vpsignw",VEX_RMrX,16),TNSZ("vpsignd",VEX_RMrX,16),TNSZ("vpmulhrsw",VEX_RMrX,16), +/* [0C] */ TNSZ("vpermilps",VEX_RMrX,8),TNSZ("vpermilpd",VEX_RMrX,16),TNSZ("vtestps",VEX_RRI,8), TNSZ("vtestpd",VEX_RRI,16), + +/* [10] */ INVALID, INVALID, INVALID, INVALID, +/* [14] */ INVALID, INVALID, INVALID, TNSZ("vptest",VEX_RRI,16), +/* [18] */ TNSZ("vbroadcastss",VEX_MX,4),TNSZ("vbroadcastsd",VEX_MX,8),TNSZ("vbroadcastf128",VEX_MX,16),INVALID, +/* [1C] */ TNSZ("vpabsb",VEX_MX,16),TNSZ("vpabsw",VEX_MX,16),TNSZ("vpabsd",VEX_MX,16),INVALID, + +/* [20] */ TNSZ("vpmovsxbw",VEX_MX,16),TNSZ("vpmovsxbd",VEX_MX,16),TNSZ("vpmovsxbq",VEX_MX,16),TNSZ("vpmovsxwd",VEX_MX,16), +/* [24] */ TNSZ("vpmovsxwq",VEX_MX,16),TNSZ("vpmovsxdq",VEX_MX,16),INVALID, INVALID, +/* [28] */ TNSZ("vpmuldq",VEX_RMrX,16),TNSZ("vpcmpeqq",VEX_RMrX,16),TNSZ("vmovntdqa",VEX_MX,16),TNSZ("vpackusdw",VEX_RMrX,16), +/* [2C] */ TNSZ("vmaskmovps",VEX_RMrX,8),TNSZ("vmaskmovpd",VEX_RMrX,16),TNSZ("vmaskmovps",VEX_RRM,8),TNSZ("vmaskmovpd",VEX_RRM,16), + +/* [30] */ TNSZ("vpmovzxbw",VEX_MX,16),TNSZ("vpmovzxbd",VEX_MX,16),TNSZ("vpmovzxbq",VEX_MX,16),TNSZ("vpmovzxwd",VEX_MX,16), +/* [34] */ TNSZ("vpmovzxwq",VEX_MX,16),TNSZ("vpmovzxdq",VEX_MX,16),INVALID, TNSZ("vpcmpgtq",VEX_RMrX,16), +/* [38] */ TNSZ("vpminsb",VEX_RMrX,16),TNSZ("vpminsd",VEX_RMrX,16),TNSZ("vpminuw",VEX_RMrX,16),TNSZ("vpminud",VEX_RMrX,16), +/* [3C] */ TNSZ("vpmaxsb",VEX_RMrX,16),TNSZ("vpmaxsd",VEX_RMrX,16),TNSZ("vpmaxuw",VEX_RMrX,16),TNSZ("vpmaxud",VEX_RMrX,16), + +/* [40] */ TNSZ("vpmulld",VEX_RMrX,16),TNSZ("vphminposuw",VEX_MX,16),INVALID, INVALID, +/* [44] */ INVALID, INVALID, INVALID, INVALID, +/* [48] */ INVALID, INVALID, INVALID, INVALID, +/* [4C] */ INVALID, INVALID, INVALID, INVALID, + +/* [50] */ INVALID, INVALID, INVALID, INVALID, +/* [54] */ INVALID, INVALID, INVALID, INVALID, +/* [58] */ INVALID, INVALID, INVALID, INVALID, +/* [5C] */ INVALID, INVALID, INVALID, INVALID, + +/* [60] */ INVALID, INVALID, INVALID, INVALID, +/* [64] */ INVALID, INVALID, INVALID, INVALID, +/* [68] */ INVALID, INVALID, INVALID, INVALID, +/* [6C] */ INVALID, INVALID, INVALID, INVALID, + +/* [70] */ INVALID, INVALID, INVALID, INVALID, +/* [74] */ INVALID, INVALID, INVALID, INVALID, +/* [78] */ INVALID, INVALID, INVALID, INVALID, +/* [7C] */ INVALID, INVALID, INVALID, INVALID, + +/* [80] */ INVALID, INVALID, INVALID, INVALID, +/* [84] */ INVALID, INVALID, INVALID, INVALID, +/* [88] */ INVALID, INVALID, INVALID, INVALID, +/* [8C] */ INVALID, INVALID, INVALID, INVALID, + +/* [90] */ INVALID, INVALID, INVALID, INVALID, +/* [94] */ INVALID, INVALID, INVALID, INVALID, +/* [98] */ INVALID, INVALID, INVALID, INVALID, +/* [9C] */ INVALID, INVALID, INVALID, INVALID, + +/* [A0] */ INVALID, INVALID, INVALID, INVALID, +/* [A4] */ INVALID, INVALID, INVALID, INVALID, +/* [A8] */ INVALID, INVALID, INVALID, INVALID, +/* [AC] */ INVALID, INVALID, INVALID, INVALID, + +/* [B0] */ INVALID, INVALID, INVALID, INVALID, +/* [B4] */ INVALID, INVALID, INVALID, INVALID, +/* [B8] */ INVALID, INVALID, INVALID, INVALID, +/* [BC] */ INVALID, INVALID, INVALID, INVALID, + +/* [C0] */ INVALID, INVALID, INVALID, INVALID, +/* [C4] */ INVALID, INVALID, INVALID, INVALID, +/* [C8] */ INVALID, INVALID, INVALID, INVALID, +/* [CC] */ INVALID, INVALID, INVALID, INVALID, + +/* [D0] */ INVALID, INVALID, INVALID, INVALID, +/* [D4] */ INVALID, INVALID, INVALID, INVALID, +/* [D8] */ INVALID, INVALID, INVALID, TNSZ("vaesimc",VEX_MX,16), +/* [DC] */ TNSZ("vaesenc",VEX_RMrX,16),TNSZ("vaesenclast",VEX_RMrX,16),TNSZ("vaesdec",VEX_RMrX,16),TNSZ("vaesdeclast",VEX_RMrX,16), + +/* [E0] */ INVALID, INVALID, INVALID, INVALID, +/* [E4] */ INVALID, INVALID, INVALID, INVALID, +/* [E8] */ INVALID, INVALID, INVALID, INVALID, +/* [EC] */ INVALID, INVALID, INVALID, INVALID, +/* [F0] */ IND(dis_op0F38F0), IND(dis_op0F38F1), INVALID, INVALID, +/* [F4] */ INVALID, INVALID, INVALID, INVALID, +/* [F8] */ INVALID, INVALID, INVALID, INVALID, +/* [FC] */ INVALID, INVALID, INVALID, INVALID, +}; + +const instable_t dis_op0F3A[256] = { +/* [00] */ INVALID, INVALID, INVALID, INVALID, +/* [04] */ INVALID, INVALID, INVALID, INVALID, +/* [08] */ TNSZ("roundps",XMMP_66r,16),TNSZ("roundpd",XMMP_66r,16),TNSZ("roundss",XMMP_66r,16),TNSZ("roundsd",XMMP_66r,16), +/* [0C] */ TNSZ("blendps",XMMP_66r,16),TNSZ("blendpd",XMMP_66r,16),TNSZ("pblendw",XMMP_66r,16),TNSZ("palignr",XMMP_66o,16), + +/* [10] */ INVALID, INVALID, INVALID, INVALID, +/* [14] */ TNSZ("pextrb",XMM3PM_66r,8),TNSZ("pextrw",XMM3PM_66r,16),TSZ("pextr",XMM3PM_66r,16),TNSZ("extractps",XMM3PM_66r,16), +/* [18] */ INVALID, INVALID, INVALID, INVALID, +/* [1C] */ INVALID, INVALID, INVALID, INVALID, + +/* [20] */ TNSZ("pinsrb",XMMPRM_66r,8),TNSZ("insertps",XMMP_66r,16),TSZ("pinsr",XMMPRM_66r,16),INVALID, +/* [24] */ INVALID, INVALID, INVALID, INVALID, +/* [28] */ INVALID, INVALID, INVALID, INVALID, +/* [2C] */ INVALID, INVALID, INVALID, INVALID, + +/* [30] */ INVALID, INVALID, INVALID, INVALID, +/* [34] */ INVALID, INVALID, INVALID, INVALID, +/* [38] */ INVALID, INVALID, INVALID, INVALID, +/* [3C] */ INVALID, INVALID, INVALID, INVALID, + +/* [40] */ TNSZ("dpps",XMMP_66r,16),TNSZ("dppd",XMMP_66r,16),TNSZ("mpsadbw",XMMP_66r,16),INVALID, +/* [44] */ TNSZ("pclmulqdq",XMMP_66r,16),INVALID, INVALID, INVALID, +/* [48] */ INVALID, INVALID, INVALID, INVALID, +/* [4C] */ INVALID, INVALID, INVALID, INVALID, + +/* [50] */ INVALID, INVALID, INVALID, INVALID, +/* [54] */ INVALID, INVALID, INVALID, INVALID, +/* [58] */ INVALID, INVALID, INVALID, INVALID, +/* [5C] */ INVALID, INVALID, INVALID, INVALID, + +/* [60] */ TNSZ("pcmpestrm",XMMP_66r,16),TNSZ("pcmpestri",XMMP_66r,16),TNSZ("pcmpistrm",XMMP_66r,16),TNSZ("pcmpistri",XMMP_66r,16), +/* [64] */ INVALID, INVALID, INVALID, INVALID, +/* [68] */ INVALID, INVALID, INVALID, INVALID, +/* [6C] */ INVALID, INVALID, INVALID, INVALID, + +/* [70] */ INVALID, INVALID, INVALID, INVALID, +/* [74] */ INVALID, INVALID, INVALID, INVALID, +/* [78] */ INVALID, INVALID, INVALID, INVALID, +/* [7C] */ INVALID, INVALID, INVALID, INVALID, + +/* [80] */ INVALID, INVALID, INVALID, INVALID, +/* [84] */ INVALID, INVALID, INVALID, INVALID, +/* [88] */ INVALID, INVALID, INVALID, INVALID, +/* [8C] */ INVALID, INVALID, INVALID, INVALID, + +/* [90] */ INVALID, INVALID, INVALID, INVALID, +/* [94] */ INVALID, INVALID, INVALID, INVALID, +/* [98] */ INVALID, INVALID, INVALID, INVALID, +/* [9C] */ INVALID, INVALID, INVALID, INVALID, + +/* [A0] */ INVALID, INVALID, INVALID, INVALID, +/* [A4] */ INVALID, INVALID, INVALID, INVALID, +/* [A8] */ INVALID, INVALID, INVALID, INVALID, +/* [AC] */ INVALID, INVALID, INVALID, INVALID, + +/* [B0] */ INVALID, INVALID, INVALID, INVALID, +/* [B4] */ INVALID, INVALID, INVALID, INVALID, +/* [B8] */ INVALID, INVALID, INVALID, INVALID, +/* [BC] */ INVALID, INVALID, INVALID, INVALID, + +/* [C0] */ INVALID, INVALID, INVALID, INVALID, +/* [C4] */ INVALID, INVALID, INVALID, INVALID, +/* [C8] */ INVALID, INVALID, INVALID, INVALID, +/* [CC] */ INVALID, INVALID, INVALID, INVALID, + +/* [D0] */ INVALID, INVALID, INVALID, INVALID, +/* [D4] */ INVALID, INVALID, INVALID, INVALID, +/* [D8] */ INVALID, INVALID, INVALID, INVALID, +/* [DC] */ INVALID, INVALID, INVALID, TNSZ("aeskeygenassist",XMMP_66r,16), + +/* [E0] */ INVALID, INVALID, INVALID, INVALID, +/* [E4] */ INVALID, INVALID, INVALID, INVALID, +/* [E8] */ INVALID, INVALID, INVALID, INVALID, +/* [EC] */ INVALID, INVALID, INVALID, INVALID, + +/* [F0] */ INVALID, INVALID, INVALID, INVALID, +/* [F4] */ INVALID, INVALID, INVALID, INVALID, +/* [F8] */ INVALID, INVALID, INVALID, INVALID, +/* [FC] */ INVALID, INVALID, INVALID, INVALID, +}; + +const instable_t dis_opAVX660F3A[256] = { +/* [00] */ INVALID, INVALID, INVALID, INVALID, +/* [04] */ TNSZ("vpermilps",VEX_MXI,8),TNSZ("vpermilpd",VEX_MXI,16),TNSZ("vperm2f128",VEX_RMRX,16),INVALID, +/* [08] */ TNSZ("vroundps",VEX_MXI,16),TNSZ("vroundpd",VEX_MXI,16),TNSZ("vroundss",VEX_RMRX,16),TNSZ("vroundsd",VEX_RMRX,16), +/* [0C] */ TNSZ("vblendps",VEX_RMRX,16),TNSZ("vblendpd",VEX_RMRX,16),TNSZ("vpblendw",VEX_RMRX,16),TNSZ("vpalignr",VEX_RMRX,16), + +/* [10] */ INVALID, INVALID, INVALID, INVALID, +/* [14] */ TNSZ("vpextrb",VEX_RRi,8),TNSZ("vpextrw",VEX_RRi,16),TNSZ("vpextrd",VEX_RRi,16),TNSZ("vextractps",VEX_RM,16), +/* [18] */ TNSZ("vinsertf128",VEX_RMRX,16),TNSZ("vextractf128",VEX_RX,16),INVALID, INVALID, +/* [1C] */ INVALID, INVALID, INVALID, INVALID, + +/* [20] */ TNSZ("vpinsrb",VEX_RMRX,8),TNSZ("vinsertps",VEX_RMRX,16),TNSZ("vpinsrd",VEX_RMRX,16),INVALID, +/* [24] */ INVALID, INVALID, INVALID, INVALID, +/* [28] */ INVALID, INVALID, INVALID, INVALID, +/* [2C] */ INVALID, INVALID, INVALID, INVALID, + +/* [30] */ INVALID, INVALID, INVALID, INVALID, +/* [34] */ INVALID, INVALID, INVALID, INVALID, +/* [38] */ INVALID, INVALID, INVALID, INVALID, +/* [3C] */ INVALID, INVALID, INVALID, INVALID, + +/* [40] */ TNSZ("vdpps",VEX_RMRX,16),TNSZ("vdppd",VEX_RMRX,16),TNSZ("vmpsadbw",VEX_RMRX,16),INVALID, +/* [44] */ TNSZ("vpclmulqdq",VEX_RMRX,16),INVALID, INVALID, INVALID, +/* [48] */ INVALID, INVALID, TNSZ("vblendvps",VEX_RMRX,8), TNSZ("vblendvpd",VEX_RMRX,16), +/* [4C] */ TNSZ("vpblendvb",VEX_RMRX,16),INVALID, INVALID, INVALID, + +/* [50] */ INVALID, INVALID, INVALID, INVALID, +/* [54] */ INVALID, INVALID, INVALID, INVALID, +/* [58] */ INVALID, INVALID, INVALID, INVALID, +/* [5C] */ INVALID, INVALID, INVALID, INVALID, + +/* [60] */ TNSZ("vpcmpestrm",VEX_MXI,16),TNSZ("vpcmpestri",VEX_MXI,16),TNSZ("vpcmpistrm",VEX_MXI,16),TNSZ("vpcmpistri",VEX_MXI,16), +/* [64] */ INVALID, INVALID, INVALID, INVALID, +/* [68] */ INVALID, INVALID, INVALID, INVALID, +/* [6C] */ INVALID, INVALID, INVALID, INVALID, + +/* [70] */ INVALID, INVALID, INVALID, INVALID, +/* [74] */ INVALID, INVALID, INVALID, INVALID, +/* [78] */ INVALID, INVALID, INVALID, INVALID, +/* [7C] */ INVALID, INVALID, INVALID, INVALID, + +/* [80] */ INVALID, INVALID, INVALID, INVALID, +/* [84] */ INVALID, INVALID, INVALID, INVALID, +/* [88] */ INVALID, INVALID, INVALID, INVALID, +/* [8C] */ INVALID, INVALID, INVALID, INVALID, + +/* [90] */ INVALID, INVALID, INVALID, INVALID, +/* [94] */ INVALID, INVALID, INVALID, INVALID, +/* [98] */ INVALID, INVALID, INVALID, INVALID, +/* [9C] */ INVALID, INVALID, INVALID, INVALID, + +/* [A0] */ INVALID, INVALID, INVALID, INVALID, +/* [A4] */ INVALID, INVALID, INVALID, INVALID, +/* [A8] */ INVALID, INVALID, INVALID, INVALID, +/* [AC] */ INVALID, INVALID, INVALID, INVALID, + +/* [B0] */ INVALID, INVALID, INVALID, INVALID, +/* [B4] */ INVALID, INVALID, INVALID, INVALID, +/* [B8] */ INVALID, INVALID, INVALID, INVALID, +/* [BC] */ INVALID, INVALID, INVALID, INVALID, + +/* [C0] */ INVALID, INVALID, INVALID, INVALID, +/* [C4] */ INVALID, INVALID, INVALID, INVALID, +/* [C8] */ INVALID, INVALID, INVALID, INVALID, +/* [CC] */ INVALID, INVALID, INVALID, INVALID, + +/* [D0] */ INVALID, INVALID, INVALID, INVALID, +/* [D4] */ INVALID, INVALID, INVALID, INVALID, +/* [D8] */ INVALID, INVALID, INVALID, INVALID, +/* [DC] */ INVALID, INVALID, INVALID, TNSZ("vaeskeygenassist",VEX_MXI,16), + +/* [E0] */ INVALID, INVALID, INVALID, INVALID, +/* [E4] */ INVALID, INVALID, INVALID, INVALID, +/* [E8] */ INVALID, INVALID, INVALID, INVALID, +/* [EC] */ INVALID, INVALID, INVALID, INVALID, + +/* [F0] */ INVALID, INVALID, INVALID, INVALID, +/* [F4] */ INVALID, INVALID, INVALID, INVALID, +/* [F8] */ INVALID, INVALID, INVALID, INVALID, +/* [FC] */ INVALID, INVALID, INVALID, INVALID, +}; + /* * Decode table for 0x0F opcodes */ @@ -844,7 +1475,7 @@ const instable_t dis_op0F[16][16] = { }, { /* [70] */ TNSZ("pshufw",MMOPM,8), TNS("psrXXX",MR), TNS("psrXXX",MR), TNS("psrXXX",MR), /* [74] */ TNSZ("pcmpeqb",MMO,8), TNSZ("pcmpeqw",MMO,8), TNSZ("pcmpeqd",MMO,8), TNS("emms",NORM), -/* [78] */ INVALID, INVALID, INVALID, INVALID, +/* [78] */ TNS("INVALID",XMMO), TNS("INVALID",XMMO), INVALID, INVALID, /* [7C] */ INVALID, INVALID, TNSZ("movd",MMOS,4), TNSZ("movq",MMOS,8), }, { /* [80] */ TNS("jo",D), TNS("jno",D), TNS("jb",D), TNS("jae",D), @@ -864,7 +1495,7 @@ const instable_t dis_op0F[16][16] = { }, { /* [B0] */ TNS("cmpxchgb",RMw), TS("cmpxchg",RMw), TS("lss",MR), TS("btr",RMw), /* [B4] */ TS("lfs",MR), TS("lgs",MR), TS("movzb",MOVZ), TNS("movzwl",MOVZ), -/* [B8] */ INVALID, INVALID, IND(dis_op0FBA), TS("btc",RMw), +/* [B8] */ TNS("INVALID",MRw), INVALID, IND(dis_op0FBA), TS("btc",RMw), /* [BC] */ TS("bsf",MRw), TS("bsr",MRw), TS("movsb",MOVZ), TNS("movswl",MOVZ), }, { /* [C0] */ TNS("xaddb",XADDB), TS("xadd",RMw), TNSZ("cmpps",XMMOPM,16),TNS("movnti",RM), @@ -888,6 +1519,88 @@ const instable_t dis_op0F[16][16] = { /* [FC] */ TNSZ("paddb",MMO,8), TNSZ("paddw",MMO,8), TNSZ("paddd",MMO,8), INVALID, } }; +const instable_t dis_opAVX0F[16][16] = { +{ +/* [00] */ INVALID, INVALID, INVALID, INVALID, +/* [04] */ INVALID, INVALID, INVALID, INVALID, +/* [08] */ INVALID, INVALID, INVALID, INVALID, +/* [0C] */ INVALID, INVALID, INVALID, INVALID, +}, { +/* [10] */ TNSZ("vmovups",VEX_MX,16), TNSZ("vmovups",VEX_RM,16),TNSZ("vmovlps",VEX_RMrX,8), TNSZ("vmovlps",VEX_RM,8), +/* [14] */ TNSZ("vunpcklps",VEX_RMrX,16),TNSZ("vunpckhps",VEX_RMrX,16),TNSZ("vmovhps",VEX_RMrX,8),TNSZ("vmovhps",VEX_RM,8), +/* [18] */ INVALID, INVALID, INVALID, INVALID, +/* [1C] */ INVALID, INVALID, INVALID, INVALID, +}, { +/* [20] */ INVALID, INVALID, INVALID, INVALID, +/* [24] */ INVALID, INVALID, INVALID, INVALID, +/* [28] */ TNSZ("vmovaps",VEX_MX,16), TNSZ("vmovaps",VEX_RX,16),INVALID, TNSZ("vmovntps",VEX_RM,16), +/* [2C] */ INVALID, INVALID, TNSZ("vucomiss",VEX_MX,4),TNSZ("vcomiss",VEX_MX,4), +}, { +/* [30] */ INVALID, INVALID, INVALID, INVALID, +/* [34] */ INVALID, INVALID, INVALID, INVALID, +/* [38] */ INVALID, INVALID, INVALID, INVALID, +/* [3C] */ INVALID, INVALID, INVALID, INVALID, +}, { +/* [40] */ INVALID, INVALID, INVALID, INVALID, +/* [44] */ INVALID, INVALID, INVALID, INVALID, +/* [48] */ INVALID, INVALID, INVALID, INVALID, +/* [4C] */ INVALID, INVALID, INVALID, INVALID, +}, { +/* [50] */ TNS("vmovmskps",VEX_MR), TNSZ("vsqrtps",VEX_MX,16), TNSZ("vrsqrtps",VEX_MX,16),TNSZ("vrcpps",VEX_MX,16), +/* [54] */ TNSZ("vandps",VEX_RMrX,16), TNSZ("vandnps",VEX_RMrX,16), TNSZ("vorps",VEX_RMrX,16), TNSZ("vxorps",VEX_RMrX,16), +/* [58] */ TNSZ("vaddps",VEX_RMrX,16), TNSZ("vmulps",VEX_RMrX,16), TNSZ("vcvtps2pd",VEX_MX,8),TNSZ("vcvtdq2ps",VEX_MX,16), +/* [5C] */ TNSZ("vsubps",VEX_RMrX,16), TNSZ("vminps",VEX_RMrX,16), TNSZ("vdivps",VEX_RMrX,16), TNSZ("vmaxps",VEX_RMrX,16), +}, { +/* [60] */ INVALID, INVALID, INVALID, INVALID, +/* [64] */ INVALID, INVALID, INVALID, INVALID, +/* [68] */ INVALID, INVALID, INVALID, INVALID, +/* [6C] */ INVALID, INVALID, INVALID, INVALID, +}, { +/* [70] */ INVALID, INVALID, INVALID, INVALID, +/* [74] */ INVALID, INVALID, INVALID, TNS("vzeroupper", VEX_NONE), +/* [78] */ INVALID, INVALID, INVALID, INVALID, +/* [7C] */ INVALID, INVALID, INVALID, INVALID, +}, { +/* [80] */ INVALID, INVALID, INVALID, INVALID, +/* [84] */ INVALID, INVALID, INVALID, INVALID, +/* [88] */ INVALID, INVALID, INVALID, INVALID, +/* [8C] */ INVALID, INVALID, INVALID, INVALID, +}, { +/* [90] */ INVALID, INVALID, INVALID, INVALID, +/* [94] */ INVALID, INVALID, INVALID, INVALID, +/* [98] */ INVALID, INVALID, INVALID, INVALID, +/* [9C] */ INVALID, INVALID, INVALID, INVALID, +}, { +/* [A0] */ INVALID, INVALID, INVALID, INVALID, +/* [A4] */ INVALID, INVALID, INVALID, INVALID, +/* [A8] */ INVALID, INVALID, INVALID, INVALID, +/* [AC] */ INVALID, INVALID, TNSZ("vldmxcsr",VEX_MO,2), INVALID, +}, { +/* [B0] */ INVALID, INVALID, INVALID, INVALID, +/* [B4] */ INVALID, INVALID, INVALID, INVALID, +/* [B8] */ INVALID, INVALID, INVALID, INVALID, +/* [BC] */ INVALID, INVALID, INVALID, INVALID, +}, { +/* [C0] */ INVALID, INVALID, TNSZ("vcmpps",VEX_RMRX,16),INVALID, +/* [C4] */ INVALID, INVALID, TNSZ("vshufps",VEX_RMRX,16),INVALID, +/* [C8] */ INVALID, INVALID, INVALID, INVALID, +/* [CC] */ INVALID, INVALID, INVALID, INVALID, +}, { +/* [D0] */ INVALID, INVALID, INVALID, INVALID, +/* [D4] */ INVALID, INVALID, INVALID, INVALID, +/* [D8] */ INVALID, INVALID, INVALID, INVALID, +/* [DC] */ INVALID, INVALID, INVALID, INVALID, +}, { +/* [E0] */ INVALID, INVALID, INVALID, INVALID, +/* [E4] */ INVALID, INVALID, INVALID, INVALID, +/* [E8] */ INVALID, INVALID, INVALID, INVALID, +/* [EC] */ INVALID, INVALID, INVALID, INVALID, +}, { +/* [F0] */ INVALID, INVALID, INVALID, INVALID, +/* [F4] */ INVALID, INVALID, INVALID, INVALID, +/* [F8] */ INVALID, INVALID, INVALID, INVALID, +/* [FC] */ INVALID, INVALID, INVALID, INVALID, +} }; /* * Decode table for 0x80 opcodes @@ -1087,7 +1800,7 @@ const instable_t dis_opFP3[8][8] = { /* [6,0] */ TNS("faddp",FF), TNS("fmulp",FF), TNS("fcomp",F), TNS("fcompp",NORM), /* [6,4] */ TNS("fsubp",FF), TNS("fsubrp",FF), TNS("fdivp",FF), TNS("fdivrp",FF), }, { -/* [7,0] */ TNS("ffree",F), TNS("fxch",F), TNS("fstp",F), TNS("fstp",F), +/* [7,0] */ TNS("ffreep",F), TNS("fxch",F), TNS("fstp",F), TNS("fstp",F), /* [7,4] */ TNS("fnstsw",M), TNS("fucomip",FFC), TNS("fcomip",FFC), INVALID, } }; @@ -1138,7 +1851,7 @@ const instable_t dis_distable[16][16] = { /* [0,0] */ TNS("addb",RMw), TS("add",RMw), TNS("addb",MRw), TS("add",MRw), /* [0,4] */ TNS("addb",IA), TS("add",IA), TSx("push",SEG), TSx("pop",SEG), /* [0,8] */ TNS("orb",RMw), TS("or",RMw), TNS("orb",MRw), TS("or",MRw), -/* [0,C] */ TNS("orb",IA), TS("or",IA), TSx("push",SEG), IND(&dis_op0F[0][0]), +/* [0,C] */ TNS("orb",IA), TS("or",IA), TSx("push",SEG), IND(dis_op0F), }, { /* [1,0] */ TNS("adcb",RMw), TS("adc",RMw), TNS("adcb",MRw), TS("adc",MRw), /* [1,4] */ TNS("adcb",IA), TS("adc",IA), TSx("push",SEG), TSx("pop",SEG), @@ -1208,8 +1921,8 @@ const instable_t dis_distable[16][16] = { /* the case since the opFP arrays are not partitioned according to key1 */ /* and key2. opFP1n2 is given only to indicate that we haven't */ /* finished decoding the instruction. */ -/* [D,8] */ IND(&dis_opFP1n2[0][0]), IND(&dis_opFP1n2[0][0]), IND(&dis_opFP1n2[0][0]), IND(&dis_opFP1n2[0][0]), -/* [D,C] */ IND(&dis_opFP1n2[0][0]), IND(&dis_opFP1n2[0][0]), IND(&dis_opFP1n2[0][0]), IND(&dis_opFP1n2[0][0]), +/* [D,8] */ IND(dis_opFP1n2), IND(dis_opFP1n2), IND(dis_opFP1n2), IND(dis_opFP1n2), +/* [D,C] */ IND(dis_opFP1n2), IND(dis_opFP1n2), IND(dis_opFP1n2), IND(dis_opFP1n2), }, { /* [E,0] */ TNSy("loopnz",BD), TNSy("loopz",BD), TNSy("loop",BD), TNSy("jcxz",BD), /* [E,4] */ TNS("inb",P), TS("in",P), TNS("outb",P), TS("out",P), @@ -1239,8 +1952,28 @@ const instable_t dis_distable[16][16] = { #define REX_X 0x02 /* high order bit extension of SIB index field */ #define REX_B 0x01 /* extends ModRM r_m, SIB base, or opcode reg */ -static uint_t opnd_size; /* SIZE16, SIZE32 or SIZE64 */ -static uint_t addr_size; /* SIZE16, SIZE32 or SIZE64 */ +/* + * These are the individual fields of a VEX prefix. + */ +#define VEX_R 0x08 /* REX.R in 1's complement form */ +#define VEX_X 0x04 /* REX.X in 1's complement form */ +#define VEX_B 0x02 /* REX.B in 1's complement form */ +/* Vector Length, 0: scalar or 128-bit vector, 1: 256-bit vector */ +#define VEX_L 0x04 +#define VEX_W 0x08 /* opcode specific, use like REX.W */ +#define VEX_m 0x1F /* VEX m-mmmm field */ +#define VEX_v 0x78 /* VEX register specifier */ +#define VEX_p 0x03 /* VEX pp field, opcode extension */ + +/* VEX m-mmmm field, only used by three bytes prefix */ +#define VEX_m_0F 0x01 /* implied 0F leading opcode byte */ +#define VEX_m_0F38 0x02 /* implied 0F 38 leading opcode byte */ +#define VEX_m_0F3A 0x03 /* implied 0F 3A leading opcode byte */ + +/* VEX pp field, providing equivalent functionality of a SIMD prefix */ +#define VEX_p_66 0x01 +#define VEX_p_F3 0x02 +#define VEX_p_F2 0x03 /* * Even in 64 bit mode, usually only 4 byte immediate operands are supported. @@ -1268,6 +2001,7 @@ static int isize64[] = {1, 2, 4, 8}; #define DEBUG_OPND 6 /* "value" used to indicate a debug reg */ #define TEST_OPND 7 /* "value" used to indicate a test reg */ #define WORD_OPND 8 /* w-bit value indicating word size reg */ +#define YMM_OPND 9 /* "value" used to indicate a ymm reg */ /* * Get the next byte and separate the op code into the high and low nibbles. @@ -1352,6 +2086,25 @@ dtrace_rex_adjust(uint_t rex_prefix, uint_t mode, uint_t *reg, uint_t *r_m) } /* + * Adjust register selection based on any VEX prefix bits present. + * Notes: VEX.R, VEX.X and VEX.B use the inverted form compared with REX prefix + */ +/*ARGSUSED*/ +static void +dtrace_vex_adjust(uint_t vex_byte1, uint_t mode, uint_t *reg, uint_t *r_m) +{ + if (reg != NULL && r_m == NULL) { + if (!(vex_byte1 & VEX_B)) + *reg += 8; + } else { + if (reg != NULL && ((VEX_R & vex_byte1) == 0)) + *reg += 8; + if (r_m != NULL && ((VEX_B & vex_byte1) == 0)) + *r_m += 8; + } +} + +/* * Get an immediate operand of the given size, with sign extension. */ static void @@ -1359,7 +2112,7 @@ dtrace_imm_opnd(dis86_t *x, int wbit, int size, int opindex) { int i; int byte; - int valsize = 0; + int valsize; if (x->d86_numopnds < opindex + 1) x->d86_numopnds = opindex + 1; @@ -1378,6 +2131,7 @@ dtrace_imm_opnd(dis86_t *x, int wbit, int size, int opindex) break; case MM_OPND: case XMM_OPND: + case YMM_OPND: case SEG_OPND: case CONTROL_OPND: case DEBUG_OPND: @@ -1405,9 +2159,9 @@ dtrace_imm_opnd(dis86_t *x, int wbit, int size, int opindex) } /* Do sign extension */ if (x->d86_bytes[x->d86_len - 1] & 0x80) { - for (; i < valsize; i++) + for (; i < sizeof (uint64_t); i++) x->d86_opnd[opindex].d86_value |= - (uint64_t)0xff << (i* 8); + (uint64_t)0xff << (i * 8); } #ifdef DIS_TEXT x->d86_opnd[opindex].d86_mode = MODE_SIGNED; @@ -1488,6 +2242,9 @@ dtrace_get_operand(dis86_t *x, uint_t mode, uint_t r_m, int wbit, int opindex) case XMM_OPND: (void) strlcat(opnd, dis_XMMREG[r_m], OPLEN); break; + case YMM_OPND: + (void) strlcat(opnd, dis_YMMREG[r_m], OPLEN); + break; case SEG_OPND: (void) strlcat(opnd, dis_SEGREG[r_m], OPLEN); break; @@ -1602,12 +2359,17 @@ dtrace_get_operand(dis86_t *x, uint_t mode, uint_t r_m, int wbit, int opindex) (void) strlcat(opnd, dis_addr32_mode12[r_m], OPLEN); } else { - if (mode == 0) + if (mode == 0) { (void) strlcat(opnd, dis_addr64_mode0[r_m], OPLEN); - else + if (r_m == 5) { + x->d86_opnd[opindex].d86_mode = + MODE_RIPREL; + } + } else { (void) strlcat(opnd, dis_addr64_mode12[r_m], OPLEN); + } } } else { uint_t need_paren = 0; @@ -1673,12 +2435,38 @@ dtrace_get_operand(dis86_t *x, uint_t mode, uint_t r_m, int wbit, int opindex) /* * Similar, but for 2 operands plus an immediate. + * vbit indicates direction + * 0 for "opcode imm, r, r_m" or + * 1 for "opcode imm, r_m, r" + */ +#define THREEOPERAND(x, mode, reg, r_m, rex_prefix, wbit, w2, immsize, vbit) { \ + dtrace_get_modrm(x, &mode, ®, &r_m); \ + dtrace_rex_adjust(rex_prefix, mode, ®, &r_m); \ + dtrace_get_operand(x, mode, r_m, wbit, 2-vbit); \ + dtrace_get_operand(x, REG_ONLY, reg, w2, 1+vbit); \ + dtrace_imm_opnd(x, wbit, immsize, 0); \ +} + +/* + * Similar, but for 2 operands plus two immediates. + */ +#define FOUROPERAND(x, mode, reg, r_m, rex_prefix, wbit, w2, immsize) { \ + dtrace_get_modrm(x, &mode, ®, &r_m); \ + dtrace_rex_adjust(rex_prefix, mode, ®, &r_m); \ + dtrace_get_operand(x, mode, r_m, wbit, 2); \ + dtrace_get_operand(x, REG_ONLY, reg, w2, 3); \ + dtrace_imm_opnd(x, wbit, immsize, 1); \ + dtrace_imm_opnd(x, wbit, immsize, 0); \ +} + +/* + * 1 operands plus two immediates. */ -#define THREEOPERAND(x, mode, reg, r_m, rex_prefix, wbit, w2, immsize) { \ +#define ONEOPERAND_TWOIMM(x, mode, reg, r_m, rex_prefix, wbit, immsize) { \ dtrace_get_modrm(x, &mode, ®, &r_m); \ dtrace_rex_adjust(rex_prefix, mode, ®, &r_m); \ - dtrace_get_operand(x, mode, r_m, wbit, 1); \ - dtrace_get_operand(x, REG_ONLY, reg, w2, 2); \ + dtrace_get_operand(x, mode, r_m, wbit, 2); \ + dtrace_imm_opnd(x, wbit, immsize, 1); \ dtrace_imm_opnd(x, wbit, immsize, 0); \ } @@ -1693,7 +2481,7 @@ dtrace_get_operand(dis86_t *x, uint_t mode, uint_t r_m, int wbit, int opindex) int dtrace_disx86(dis86_t *x, uint_t cpu_mode) { - const instable_t *dp = NULL; /* decode table being used */ + instable_t *dp; /* decode table being used */ #ifdef DIS_TEXT uint_t i; #endif @@ -1703,7 +2491,9 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mode) #else #define NOMEM /* nothing */ #endif - uint_t wbit = 0; /* opcode wbit, 0 is 8 bit, !0 for opnd_size */ + uint_t opnd_size; /* SIZE16, SIZE32 or SIZE64 */ + uint_t addr_size; /* SIZE16, SIZE32 or SIZE64 */ + uint_t wbit; /* opcode wbit, 0 is 8 bit, !0 for opnd_size */ uint_t w2; /* wbit value for second operand */ uint_t vbit; uint_t mode = 0; /* mode value from ModRM byte */ @@ -1714,7 +2504,7 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mode) uint_t opcode2; /* low nibble of 1st byte */ uint_t opcode3; /* extra opcode bits usually from ModRM byte */ uint_t opcode4; /* high nibble of 2nd byte */ - uint_t opcode5; /* low nibble of 2ne byte */ + uint_t opcode5; /* low nibble of 2nd byte */ uint_t opcode6; /* high nibble of 3rd byte */ uint_t opcode7; /* low nibble of 3rd byte */ uint_t opcode_bytes = 1; @@ -1728,16 +2518,48 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mode) uint_t lock_prefix = 0; uint_t rep_prefix = 0; uint_t rex_prefix = 0; /* amd64 register extension prefix */ + + /* + * Intel VEX instruction encoding prefix and fields + */ + + /* 0xC4 means 3 bytes prefix, 0xC5 means 2 bytes prefix */ + uint_t vex_prefix = 0; + + /* + * VEX prefix byte 1, includes vex.r, vex.x and vex.b + * (for 3 bytes prefix) + */ + uint_t vex_byte1 = 0; + + /* + * For 32-bit mode, it should prefetch the next byte to + * distinguish between AVX and les/lds + */ + uint_t vex_prefetch = 0; + + uint_t vex_m = 0; + uint_t vex_v = 0; + uint_t vex_p = 0; + uint_t vex_R = 1; + uint_t vex_X = 1; + uint_t vex_B = 1; + uint_t vex_W = 0; + uint_t vex_L; + + size_t off; + instable_t dp_mmx; + x->d86_len = 0; x->d86_rmindex = -1; x->d86_error = 0; #ifdef DIS_TEXT x->d86_numopnds = 0; x->d86_seg_prefix = NULL; - x->d86_mneu[0] = 0; - for (i = 0; i < 3; ++i) { + x->d86_mnem[0] = 0; + for (i = 0; i < 4; ++i) { x->d86_opnd[i].d86_opnd[0] = 0; x->d86_opnd[i].d86_prefix[0] = 0; x->d86_opnd[i].d86_value_size = 0; @@ -1745,7 +2567,8 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mode) x->d86_opnd[i].d86_mode = MODE_NONE; } #endif - x->d86_error = 0; + x->d86_rex_prefix = 0; + x->d86_got_modrm = 0; x->d86_memsize = 0; if (cpu_mode == SIZE16) { @@ -1769,7 +2592,7 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mode) if (opcode1 == 0 && opcode2 == 0 && x->d86_check_func != NULL && x->d86_check_func(x->d86_data)) { #ifdef DIS_TEXT - (void) strncpy(x->d86_mneu, ".byte\t0", OPLEN); + (void) strncpy(x->d86_mnem, ".byte\t0", OPLEN); #endif goto done; } @@ -1780,7 +2603,7 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mode) for (;;) { uint_t *which_prefix = NULL; - dp = &dis_distable[opcode1][opcode2]; + dp = (instable_t *)&dis_distable[opcode1][opcode2]; switch (dp->it_adrmode) { case PREFIX: @@ -1824,9 +2647,151 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mode) rex_prefix = (opcode1 << 4) | opcode2; if (dtrace_get_opcode(x, &opcode1, &opcode2) != 0) goto error; - dp = &dis_distable[opcode1][opcode2]; + dp = (instable_t *)&dis_distable[opcode1][opcode2]; + } else if (opcode1 == 0xC && + (opcode2 == 0x4 || opcode2 == 0x5)) { + /* AVX instructions */ + vex_prefix = (opcode1 << 4) | opcode2; + x->d86_rex_prefix = 0x40; + } + } else if (opcode1 == 0xC && (opcode2 == 0x4 || opcode2 == 0x5)) { + /* LDS, LES or AVX */ + dtrace_get_modrm(x, &mode, ®, &r_m); + vex_prefetch = 1; + + if (mode == REG_ONLY) { + /* AVX */ + vex_prefix = (opcode1 << 4) | opcode2; + x->d86_rex_prefix = 0x40; + opcode3 = (((mode << 3) | reg)>>1) & 0x0F; + opcode4 = ((reg << 3) | r_m) & 0x0F; + } + } + + if (vex_prefix == VEX_2bytes) { + if (!vex_prefetch) { + if (dtrace_get_opcode(x, &opcode3, &opcode4) != 0) + goto error; + } + vex_R = ((opcode3 & VEX_R) & 0x0F) >> 3; + vex_L = ((opcode4 & VEX_L) & 0x0F) >> 2; + vex_v = (((opcode3 << 4) | opcode4) & VEX_v) >> 3; + vex_p = opcode4 & VEX_p; + /* + * The vex.x and vex.b bits are not defined in two bytes + * mode vex prefix, their default values are 1 + */ + vex_byte1 = (opcode3 & VEX_R) | VEX_X | VEX_B; + + if (vex_R == 0) + x->d86_rex_prefix |= REX_R; + + if (dtrace_get_opcode(x, &opcode1, &opcode2) != 0) + goto error; + + switch (vex_p) { + case VEX_p_66: + dp = (instable_t *) + &dis_opAVX660F[(opcode1 << 4) | opcode2]; + break; + case VEX_p_F3: + dp = (instable_t *) + &dis_opAVXF30F[(opcode1 << 4) | opcode2]; + break; + case VEX_p_F2: + dp = (instable_t *) + &dis_opAVXF20F [(opcode1 << 4) | opcode2]; + break; + default: + dp = (instable_t *) + &dis_opAVX0F[opcode1][opcode2]; + + } + + } else if (vex_prefix == VEX_3bytes) { + if (!vex_prefetch) { + if (dtrace_get_opcode(x, &opcode3, &opcode4) != 0) + goto error; + } + vex_R = (opcode3 & VEX_R) >> 3; + vex_X = (opcode3 & VEX_X) >> 2; + vex_B = (opcode3 & VEX_B) >> 1; + vex_m = (((opcode3 << 4) | opcode4) & VEX_m); + vex_byte1 = opcode3 & (VEX_R | VEX_X | VEX_B); + + if (vex_R == 0) + x->d86_rex_prefix |= REX_R; + if (vex_X == 0) + x->d86_rex_prefix |= REX_X; + if (vex_B == 0) + x->d86_rex_prefix |= REX_B; + + if (dtrace_get_opcode(x, &opcode5, &opcode6) != 0) + goto error; + vex_W = (opcode5 & VEX_W) >> 3; + vex_L = (opcode6 & VEX_L) >> 2; + vex_v = (((opcode5 << 4) | opcode6) & VEX_v) >> 3; + vex_p = opcode6 & VEX_p; + + if (vex_W) + x->d86_rex_prefix |= REX_W; + + /* Only these three vex_m values valid; others are reserved */ + if ((vex_m != VEX_m_0F) && (vex_m != VEX_m_0F38) && + (vex_m != VEX_m_0F3A)) + goto error; + + if (dtrace_get_opcode(x, &opcode1, &opcode2) != 0) + goto error; + + switch (vex_p) { + case VEX_p_66: + if (vex_m == VEX_m_0F) { + dp = (instable_t *) + &dis_opAVX660F + [(opcode1 << 4) | opcode2]; + } else if (vex_m == VEX_m_0F38) { + dp = (instable_t *) + &dis_opAVX660F38 + [(opcode1 << 4) | opcode2]; + } else if (vex_m == VEX_m_0F3A) { + dp = (instable_t *) + &dis_opAVX660F3A + [(opcode1 << 4) | opcode2]; + } else { + goto error; + } + break; + case VEX_p_F3: + if (vex_m == VEX_m_0F) { + dp = (instable_t *) + &dis_opAVXF30F + [(opcode1 << 4) | opcode2]; + } else { + goto error; + } + break; + case VEX_p_F2: + if (vex_m == VEX_m_0F) { + dp = (instable_t *) + &dis_opAVXF20F + [(opcode1 << 4) | opcode2]; + } else { + goto error; + } + break; + default: + dp = (instable_t *) + &dis_opAVX0F[opcode1][opcode2]; + } } + if (vex_prefix) { + if (vex_L) + wbit = YMM_OPND; + else + wbit = XMM_OPND; + } /* * Deal with selection of operand and address size now. @@ -1834,7 +2799,7 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mode) * ignored. */ if (cpu_mode == SIZE64) { - if (rex_prefix & 0x08) + if ((rex_prefix & REX_W) || vex_W) opnd_size = SIZE64; else if (opnd_size_prefix) opnd_size = SIZE16; @@ -1852,7 +2817,6 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mode) if (addr_size_prefix) addr_size = SIZE32; } - /* * The pause instruction - a repz'd nop. This doesn't fit * with any of the other prefix goop added for SSE, so we'll @@ -1860,14 +2824,14 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mode) */ if (rep_prefix == 0xf3 && opcode1 == 0x9 && opcode2 == 0x0) { rep_prefix = 0; - dp = &dis_opPause; + dp = (instable_t *)&dis_opPause; } /* * Some 386 instructions have 2 bytes of opcode before the mod_r/m * byte so we may need to perform a table indirection. */ - if (dp->it_indirect == dis_op0F[0]) { + if (dp->it_indirect == (instable_t *)dis_op0F) { if (dtrace_get_opcode(x, &opcode4, &opcode5) != 0) goto error; opcode_bytes = 2; @@ -1879,11 +2843,101 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mode) opcode_bytes = 3; subcode = ((opcode6 & 0x3) << 1) | ((opcode7 & 0x8) >> 3); - dp = &dis_op0F7123[opcode5][subcode]; + dp = (instable_t *)&dis_op0F7123[opcode5][subcode]; } else if ((opcode4 == 0xc) && (opcode5 >= 0x8)) { - dp = &dis_op0FC8[0]; + dp = (instable_t *)&dis_op0FC8[0]; + } else if ((opcode4 == 0x3) && (opcode5 == 0xA)) { + opcode_bytes = 3; + if (dtrace_get_opcode(x, &opcode6, &opcode7) != 0) + goto error; + if (opnd_size == SIZE16) + opnd_size = SIZE32; + + dp = (instable_t *)&dis_op0F3A[(opcode6<<4)|opcode7]; +#ifdef DIS_TEXT + if (strcmp(dp->it_name, "INVALID") == 0) + goto error; +#endif + switch (dp->it_adrmode) { + case XMMP_66r: + case XMMPRM_66r: + case XMM3PM_66r: + if (opnd_size_prefix == 0) { + goto error; + } + break; + case XMMP_66o: + if (opnd_size_prefix == 0) { + /* SSSE3 MMX instructions */ + dp_mmx = *dp; + dp = &dp_mmx; + dp->it_adrmode = MMOPM_66o; +#ifdef DIS_MEM + dp->it_size = 8; +#endif + } + break; + default: + goto error; + } + } else if ((opcode4 == 0x3) && (opcode5 == 0x8)) { + opcode_bytes = 3; + if (dtrace_get_opcode(x, &opcode6, &opcode7) != 0) + goto error; + dp = (instable_t *)&dis_op0F38[(opcode6<<4)|opcode7]; + + /* + * Both crc32 and movbe have the same 3rd opcode + * byte of either 0xF0 or 0xF1, so we use another + * indirection to distinguish between the two. + */ + if (dp->it_indirect == (instable_t *)dis_op0F38F0 || + dp->it_indirect == (instable_t *)dis_op0F38F1) { + + dp = dp->it_indirect; + if (rep_prefix != 0xF2) { + /* It is movbe */ + dp++; + } + } +#ifdef DIS_TEXT + if (strcmp(dp->it_name, "INVALID") == 0) + goto error; +#endif + switch (dp->it_adrmode) { + case XMM_66r: + case XMMM_66r: + if (opnd_size_prefix == 0) { + goto error; + } + break; + case XMM_66o: + if (opnd_size_prefix == 0) { + /* SSSE3 MMX instructions */ + dp_mmx = *dp; + dp = &dp_mmx; + dp->it_adrmode = MM; +#ifdef DIS_MEM + dp->it_size = 8; +#endif + } + break; + case CRC32: + if (rep_prefix != 0xF2) { + goto error; + } + rep_prefix = 0; + break; + case MOVBE: + if (rep_prefix != 0x0) { + goto error; + } + break; + default: + goto error; + } } else { - dp = &dis_op0F[opcode4][opcode5]; + dp = (instable_t *)&dis_op0F[opcode4][opcode5]; } } @@ -1903,19 +2957,21 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mode) */ if (opcode1 == 0xD && opcode2 >= 0x8) { if (opcode2 == 0xB && mode == 0x3 && opcode3 == 4) - dp = &dis_opFP5[r_m]; + dp = (instable_t *)&dis_opFP5[r_m]; else if (opcode2 == 0xA && mode == 0x3 && opcode3 < 4) - dp = &dis_opFP7[opcode3]; + dp = (instable_t *)&dis_opFP7[opcode3]; else if (opcode2 == 0xB && mode == 0x3) - dp = &dis_opFP6[opcode3]; + dp = (instable_t *)&dis_opFP6[opcode3]; else if (opcode2 == 0x9 && mode == 0x3 && opcode3 >= 4) - dp = &dis_opFP4[opcode3 - 4][r_m]; + dp = (instable_t *)&dis_opFP4[opcode3 - 4][r_m]; else if (mode == 0x3) - dp = &dis_opFP3[opcode2 - 8][opcode3]; + dp = (instable_t *) + &dis_opFP3[opcode2 - 8][opcode3]; else - dp = &dis_opFP1n2[opcode2 - 8][opcode3]; + dp = (instable_t *) + &dis_opFP1n2[opcode2 - 8][opcode3]; } else { - dp = dp->it_indirect + opcode3; + dp = (instable_t *)dp->it_indirect + opcode3; } } @@ -1923,14 +2979,15 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mode) * In amd64 bit mode, ARPL opcode is changed to MOVSXD * (sign extend 32bit to 64 bit) */ - if (cpu_mode == SIZE64 && opcode1 == 0x6 && opcode2 == 0x3) - dp = &dis_opMOVSLD; + if ((vex_prefix == 0) && cpu_mode == SIZE64 && + opcode1 == 0x6 && opcode2 == 0x3) + dp = (instable_t *)&dis_opMOVSLD; /* * at this point we should have a correct (or invalid) opcode */ - if ((cpu_mode == SIZE64 && dp->it_invalid64) || - (cpu_mode != SIZE64 && dp->it_invalid32)) + if (cpu_mode == SIZE64 && dp->it_invalid64 || + cpu_mode != SIZE64 && dp->it_invalid32) goto error; if (dp->it_indirect != TERM) goto error; @@ -1985,12 +3042,12 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mode) */ if (rep_prefix) { if (rep_prefix == 0xf2) - dp = &dis_opSIMDrepnz[off]; + dp = (instable_t *)&dis_opSIMDrepnz[off]; else - dp = &dis_opSIMDrepz[off]; + dp = (instable_t *)&dis_opSIMDrepz[off]; rep_prefix = 0; } else if (opnd_size_prefix) { - dp = &dis_opSIMDdata16[off]; + dp = (instable_t *)&dis_opSIMDdata16[off]; opnd_size_prefix = 0; if (opnd_size == SIZE16) opnd_size = SIZE32; @@ -2016,12 +3073,33 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mode) if (opnd_size_prefix) { off = ((uintptr_t)dp - (uintptr_t)dis_op0F7123) / sizeof (instable_t); - dp = &dis_opSIMD7123[off]; + dp = (instable_t *)&dis_opSIMD7123[off]; opnd_size_prefix = 0; if (opnd_size == SIZE16) opnd_size = SIZE32; } break; + case MRw: + if (rep_prefix) { + if (rep_prefix == 0xf3) { + + /* + * Calculate our offset in dis_op0F + */ + if ((uintptr_t)dp - (uintptr_t)dis_op0F + > sizeof (dis_op0F)) + goto error; + + off = ((uintptr_t)dp - (uintptr_t)dis_op0F) / + sizeof (instable_t); + + dp = (instable_t *)&dis_opSIMDrepz[off]; + rep_prefix = 0; + } else { + goto error; + } + } + break; } /* @@ -2037,33 +3115,40 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mode) * including the prefixes. */ if (lock_prefix) - (void) strlcat(x->d86_mneu, "lock ", OPLEN); + (void) strlcat(x->d86_mnem, "lock ", OPLEN); if (rep_prefix == 0xf2) - (void) strlcat(x->d86_mneu, "repnz ", OPLEN); + (void) strlcat(x->d86_mnem, "repnz ", OPLEN); else if (rep_prefix == 0xf3) - (void) strlcat(x->d86_mneu, "repz ", OPLEN); + (void) strlcat(x->d86_mnem, "repz ", OPLEN); if (cpu_mode == SIZE64 && addr_size_prefix) - (void) strlcat(x->d86_mneu, "addr32 ", OPLEN); + (void) strlcat(x->d86_mnem, "addr32 ", OPLEN); if (dp->it_adrmode != CBW && dp->it_adrmode != CWD && dp->it_adrmode != XMMSFNC) { if (strcmp(dp->it_name, "INVALID") == 0) goto error; - (void) strlcat(x->d86_mneu, dp->it_name, OPLEN); + (void) strlcat(x->d86_mnem, dp->it_name, OPLEN); if (dp->it_suffix) { char *types[] = {"", "w", "l", "q"}; if (opcode_bytes == 2 && opcode4 == 4) { /* It's a cmovx.yy. Replace the suffix x */ for (i = 5; i < OPLEN; i++) { - if (x->d86_mneu[i] == '.') + if (x->d86_mnem[i] == '.') break; } - x->d86_mneu[i - 1] = *types[opnd_size]; + x->d86_mnem[i - 1] = *types[opnd_size]; + } else if ((opnd_size == 2) && (opcode_bytes == 3) && + ((opcode6 == 1 && opcode7 == 6) || + (opcode6 == 2 && opcode7 == 2))) { + /* + * To handle PINSRD and PEXTRD + */ + (void) strlcat(x->d86_mnem, "d", OPLEN); } else { - (void) strlcat(x->d86_mneu, types[opnd_size], + (void) strlcat(x->d86_mnem, types[opnd_size], OPLEN); } } @@ -2074,7 +3159,11 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mode) * Process operands based on the addressing modes. */ x->d86_mode = cpu_mode; - x->d86_rex_prefix = rex_prefix; + /* + * In vex mode the rex_prefix has no meaning + */ + if (!vex_prefix) + x->d86_rex_prefix = rex_prefix; x->d86_opnd_size = opnd_size; x->d86_addr_size = addr_size; vbit = 0; /* initialize for mem/reg -> reg */ @@ -2086,7 +3175,7 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mode) case MOVSXZ: #ifdef DIS_TEXT if (rex_prefix == 0) - (void) strncpy(x->d86_mneu, "movzld", OPLEN); + (void) strncpy(x->d86_mnem, "movzld", OPLEN); #endif dtrace_get_modrm(x, &mode, ®, &r_m); dtrace_rex_adjust(rex_prefix, mode, ®, &r_m); @@ -2099,14 +3188,14 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mode) /* * movsbl movsbw movsbq (0x0FBE) or movswl movswq (0x0FBF) - * movzbl movzbw movzbq (0x0FB6) or mobzwl movzwq (0x0FB7) + * movzbl movzbw movzbq (0x0FB6) or movzwl movzwq (0x0FB7) * wbit lives in 2nd byte, note that operands * are different sized */ case MOVZ: if (rex_prefix & REX_W) { /* target register size = 64 bit */ - x->d86_mneu[5] = 'q'; + x->d86_mnem[5] = 'q'; } dtrace_get_modrm(x, &mode, ®, &r_m); dtrace_rex_adjust(rex_prefix, mode, ®, &r_m); @@ -2115,6 +3204,41 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mode) wbit = WBIT(opcode5); dtrace_get_operand(x, mode, r_m, wbit, 0); break; + case CRC32: + opnd_size = SIZE32; + if (rex_prefix & REX_W) + opnd_size = SIZE64; + x->d86_opnd_size = opnd_size; + + dtrace_get_modrm(x, &mode, ®, &r_m); + dtrace_rex_adjust(rex_prefix, mode, ®, &r_m); + dtrace_get_operand(x, REG_ONLY, reg, LONG_OPND, 1); + wbit = WBIT(opcode7); + if (opnd_size_prefix) + x->d86_opnd_size = opnd_size = SIZE16; + dtrace_get_operand(x, mode, r_m, wbit, 0); + break; + case MOVBE: + opnd_size = SIZE32; + if (rex_prefix & REX_W) + opnd_size = SIZE64; + x->d86_opnd_size = opnd_size; + + dtrace_get_modrm(x, &mode, ®, &r_m); + dtrace_rex_adjust(rex_prefix, mode, ®, &r_m); + wbit = WBIT(opcode7); + if (opnd_size_prefix) + x->d86_opnd_size = opnd_size = SIZE16; + if (wbit) { + /* reg -> mem */ + dtrace_get_operand(x, REG_ONLY, reg, LONG_OPND, 0); + dtrace_get_operand(x, mode, r_m, wbit, 1); + } else { + /* mem -> reg */ + dtrace_get_operand(x, REG_ONLY, reg, LONG_OPND, 1); + dtrace_get_operand(x, mode, r_m, wbit, 0); + } + break; /* * imul instruction, with either 8-bit or longer immediate @@ -2123,7 +3247,7 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mode) case IMUL: wbit = LONG_OPND; THREEOPERAND(x, mode, reg, r_m, rex_prefix, wbit, LONG_OPND, - OPSIZE(opnd_size, opcode2 == 0x9)); + OPSIZE(opnd_size, opcode2 == 0x9), 1); break; /* memory or register operand to register, with 'w' bit */ @@ -2313,7 +3437,7 @@ just_mem: case SWAPGS: if (cpu_mode == SIZE64 && mode == 3 && r_m == 0) { #ifdef DIS_TEXT - (void) strncpy(x->d86_mneu, "swapgs", OPLEN); + (void) strncpy(x->d86_mnem, "swapgs", OPLEN); #endif NOMEM; break; @@ -2335,6 +3459,45 @@ just_mem: wbit = BYTE_OPND; goto just_mem; + case MONITOR_MWAIT: + if (mode == 3) { + if (r_m == 0) { +#ifdef DIS_TEXT + (void) strncpy(x->d86_mnem, "monitor", OPLEN); +#endif + NOMEM; + break; + } else if (r_m == 1) { +#ifdef DIS_TEXT + (void) strncpy(x->d86_mnem, "mwait", OPLEN); +#endif + NOMEM; + break; + } else { + goto error; + } + } + /*FALLTHROUGH*/ + case XGETBV_XSETBV: + if (mode == 3) { + if (r_m == 0) { +#ifdef DIS_TEXT + (void) strncpy(x->d86_mnem, "xgetbv", OPLEN); +#endif + NOMEM; + break; + } else if (r_m == 1) { +#ifdef DIS_TEXT + (void) strncpy(x->d86_mnem, "xsetbv", OPLEN); +#endif + NOMEM; + break; + } else { + goto error; + } + + } + /*FALLTHROUGH*/ case MO: /* Similar to M, but only memory (no direct registers) */ wbit = LONG_OPND; @@ -2427,6 +3590,8 @@ just_mem: /* memory or register operand to register */ case MR: + if (vex_prefetch) + x->d86_got_modrm = 1; wbit = LONG_OPND; STANDARD_MODRM(x, mode, reg, r_m, rex_prefix, wbit, 0); break; @@ -2474,24 +3639,32 @@ xmm3p: if (mode != REG_ONLY) goto error; - THREEOPERAND(x, mode, reg, r_m, rex_prefix, wbit, LONG_OPND, 1); + THREEOPERAND(x, mode, reg, r_m, rex_prefix, wbit, LONG_OPND, 1, + 1); NOMEM; break; + case XMM3PM_66r: + THREEOPERAND(x, mode, reg, r_m, rex_prefix, LONG_OPND, XMM_OPND, + 1, 0); + break; + /* MMX/SIMD-Int predicated r32/mem to mm reg */ case MMOPRM: wbit = LONG_OPND; w2 = MM_OPND; goto xmmprm; case XMMPRM: + case XMMPRM_66r: wbit = LONG_OPND; w2 = XMM_OPND; xmmprm: - THREEOPERAND(x, mode, reg, r_m, rex_prefix, wbit, w2, 1); + THREEOPERAND(x, mode, reg, r_m, rex_prefix, wbit, w2, 1, 1); break; /* MMX/SIMD-Int predicated mm/mem to mm reg */ case MMOPM: + case MMOPM_66o: wbit = w2 = MM_OPND; goto xmmprm; @@ -2507,6 +3680,8 @@ xmmprm: /* SIMD memory or xmm reg operand to xmm reg */ case XMM: + case XMM_66o: + case XMM_66r: case XMMO: case XMMXIMPL: wbit = XMM_OPND; @@ -2523,9 +3698,9 @@ xmmprm: */ if (mode == REG_ONLY) { if (strcmp(dp->it_name, "movlps") == 0) - (void) strncpy(x->d86_mneu, "movhlps", OPLEN); + (void) strncpy(x->d86_mnem, "movhlps", OPLEN); else if (strcmp(dp->it_name, "movhps") == 0) - (void) strncpy(x->d86_mneu, "movlhps", OPLEN); + (void) strncpy(x->d86_mnem, "movlhps", OPLEN); } #endif if (dp->it_adrmode == XMMXIMPL) @@ -2551,13 +3726,14 @@ xmmprm: /* SIMD memory to xmm reg */ case XMMM: + case XMMM_66r: case XMMOM: wbit = XMM_OPND; dtrace_get_modrm(x, &mode, ®, &r_m); #ifdef DIS_TEXT if (mode == REG_ONLY) { if (strcmp(dp->it_name, "movhps") == 0) - (void) strncpy(x->d86_mneu, "movlhps", OPLEN); + (void) strncpy(x->d86_mnem, "movlhps", OPLEN); else goto error; } @@ -2613,9 +3789,12 @@ xmmprm: /* SIMD predicated memory or xmm reg with/to xmm reg */ case XMMP: + case XMMP_66r: + case XMMP_66o: case XMMOPM: wbit = XMM_OPND; - THREEOPERAND(x, mode, reg, r_m, rex_prefix, wbit, XMM_OPND, 1); + THREEOPERAND(x, mode, reg, r_m, rex_prefix, wbit, XMM_OPND, 1, + 1); #ifdef DIS_TEXT /* @@ -2633,10 +3812,10 @@ xmmprm: if (pred >= (sizeof (dis_PREDSUFFIX) / sizeof (char *))) goto error; - (void) strncpy(x->d86_mneu, "cmp", OPLEN); - (void) strlcat(x->d86_mneu, dis_PREDSUFFIX[pred], + (void) strncpy(x->d86_mnem, "cmp", OPLEN); + (void) strlcat(x->d86_mnem, dis_PREDSUFFIX[pred], OPLEN); - (void) strlcat(x->d86_mneu, + (void) strlcat(x->d86_mnem, dp->it_name + strlen(dp->it_name) - 2, OPLEN); x->d86_opnd[0] = x->d86_opnd[1]; @@ -2646,6 +3825,17 @@ xmmprm: #endif break; + case XMMX2I: + FOUROPERAND(x, mode, reg, r_m, rex_prefix, XMM_OPND, XMM_OPND, + 1); + NOMEM; + break; + + case XMM2I: + ONEOPERAND_TWOIMM(x, mode, reg, r_m, rex_prefix, XMM_OPND, 1); + NOMEM; + break; + /* immediate operand to accumulator */ case IA: wbit = WBIT(opcode2); @@ -2857,11 +4047,11 @@ xmmprm: case CBW: #ifdef DIS_TEXT if (opnd_size == SIZE16) - (void) strlcat(x->d86_mneu, "cbtw", OPLEN); + (void) strlcat(x->d86_mnem, "cbtw", OPLEN); else if (opnd_size == SIZE32) - (void) strlcat(x->d86_mneu, "cwtl", OPLEN); + (void) strlcat(x->d86_mnem, "cwtl", OPLEN); else - (void) strlcat(x->d86_mneu, "cltq", OPLEN); + (void) strlcat(x->d86_mnem, "cltq", OPLEN); #endif wbit = LONG_OPND; NOMEM; @@ -2870,11 +4060,11 @@ xmmprm: case CWD: #ifdef DIS_TEXT if (opnd_size == SIZE16) - (void) strlcat(x->d86_mneu, "cwtd", OPLEN); + (void) strlcat(x->d86_mnem, "cwtd", OPLEN); else if (opnd_size == SIZE32) - (void) strlcat(x->d86_mneu, "cltd", OPLEN); + (void) strlcat(x->d86_mnem, "cltd", OPLEN); else - (void) strlcat(x->d86_mneu, "cqtd", OPLEN); + (void) strlcat(x->d86_mnem, "cqtd", OPLEN); #endif wbit = LONG_OPND; NOMEM; @@ -2890,9 +4080,9 @@ xmmprm: /* sfence doesn't take operands */ #ifdef DIS_TEXT if (mode == REG_ONLY) { - (void) strlcat(x->d86_mneu, "sfence", OPLEN); + (void) strlcat(x->d86_mnem, "sfence", OPLEN); } else { - (void) strlcat(x->d86_mneu, "clflush", OPLEN); + (void) strlcat(x->d86_mnem, "clflush", OPLEN); dtrace_rex_adjust(rex_prefix, mode, ®, &r_m); dtrace_get_operand(x, mode, r_m, BYTE_OPND, 0); NOMEM; @@ -2900,7 +4090,7 @@ xmmprm: #else if (mode != REG_ONLY) { dtrace_rex_adjust(rex_prefix, mode, ®, &r_m); - dtrace_get_operand(x, mode, r_m, BYTE_OPND, 0); + dtrace_get_operand(x, mode, r_m, LONG_OPND, 0); NOMEM; } #endif @@ -2919,18 +4109,29 @@ xmmprm: case XMMFENCE: /* - * Only the following exact byte sequences are allowed: - * - * 0f ae e8 lfence - * 0f ae f0 mfence + * XRSTOR and LFENCE share the same opcode but differ in mode */ - if ((uint8_t)x->d86_bytes[x->d86_len - 1] != 0xe8 && - (uint8_t)x->d86_bytes[x->d86_len - 1] != 0xf0) - goto error; + dtrace_get_modrm(x, &mode, ®, &r_m); + if (mode == REG_ONLY) { + /* + * Only the following exact byte sequences are allowed: + * + * 0f ae e8 lfence + * 0f ae f0 mfence + */ + if ((uint8_t)x->d86_bytes[x->d86_len - 1] != 0xe8 && + (uint8_t)x->d86_bytes[x->d86_len - 1] != 0xf0) + goto error; + } else { +#ifdef DIS_TEXT + (void) strncpy(x->d86_mnem, "xrstor", OPLEN); +#endif + dtrace_rex_adjust(rex_prefix, mode, ®, &r_m); + dtrace_get_operand(x, mode, r_m, BYTE_OPND, 0); + } break; - /* float reg */ case F: #ifdef DIS_TEXT @@ -2955,6 +4156,352 @@ xmmprm: NOMEM; break; + /* AVX instructions */ + case VEX_MO: + /* op(ModR/M.r/m) */ + x->d86_numopnds = 1; + dtrace_get_modrm(x, &mode, ®, &r_m); +#ifdef DIS_TEXT + if ((dp == &dis_opAVX0F[0xA][0xE]) && (reg == 3)) + (void) strncpy(x->d86_mnem, "vstmxcsr", OPLEN); +#endif + dtrace_vex_adjust(vex_byte1, mode, ®, &r_m); + dtrace_get_operand(x, mode, r_m, wbit, 0); + break; + case VEX_RMrX: + /* ModR/M.reg := op(VEX.vvvv, ModR/M.r/m) */ + x->d86_numopnds = 3; + dtrace_get_modrm(x, &mode, ®, &r_m); + dtrace_vex_adjust(vex_byte1, mode, ®, &r_m); + + if (mode != REG_ONLY) { + if ((dp == &dis_opAVXF20F[0x10]) || + (dp == &dis_opAVXF30F[0x10])) { + /* vmovsd <m64>, <xmm> */ + /* or vmovss <m64>, <xmm> */ + x->d86_numopnds = 2; + goto L_VEX_MX; + } + } + + dtrace_get_operand(x, REG_ONLY, reg, wbit, 2); + /* + * VEX prefix uses the 1's complement form to encode the + * XMM/YMM regs + */ + dtrace_get_operand(x, REG_ONLY, (0xF - vex_v), wbit, 1); + + if ((dp == &dis_opAVXF20F[0x2A]) || + (dp == &dis_opAVXF30F[0x2A])) { + /* + * vcvtsi2si </r,m>, <xmm>, <xmm> or vcvtsi2ss </r,m>, + * <xmm>, <xmm> + */ + wbit = LONG_OPND; + } +#ifdef DIS_TEXT + else if ((mode == REG_ONLY) && + (dp == &dis_opAVX0F[0x1][0x6])) { /* vmovlhps */ + (void) strncpy(x->d86_mnem, "vmovlhps", OPLEN); + } else if ((mode == REG_ONLY) && + (dp == &dis_opAVX0F[0x1][0x2])) { /* vmovhlps */ + (void) strncpy(x->d86_mnem, "vmovhlps", OPLEN); + } +#endif + dtrace_get_operand(x, mode, r_m, wbit, 0); + + break; + + case VEX_RRX: + /* ModR/M.rm := op(VEX.vvvv, ModR/M.reg) */ + x->d86_numopnds = 3; + + dtrace_get_modrm(x, &mode, ®, &r_m); + dtrace_vex_adjust(vex_byte1, mode, ®, &r_m); + + if (mode != REG_ONLY) { + if ((dp == &dis_opAVXF20F[0x11]) || + (dp == &dis_opAVXF30F[0x11])) { + /* vmovsd <xmm>, <m64> */ + /* or vmovss <xmm>, <m64> */ + x->d86_numopnds = 2; + goto L_VEX_RM; + } + } + + dtrace_get_operand(x, mode, r_m, wbit, 2); + dtrace_get_operand(x, REG_ONLY, (0xF - vex_v), wbit, 1); + dtrace_get_operand(x, REG_ONLY, reg, wbit, 0); + break; + + case VEX_RMRX: + /* ModR/M.reg := op(VEX.vvvv, ModR/M.r_m, imm8[7:4]) */ + x->d86_numopnds = 4; + + dtrace_get_modrm(x, &mode, ®, &r_m); + dtrace_vex_adjust(vex_byte1, mode, ®, &r_m); + dtrace_get_operand(x, REG_ONLY, reg, wbit, 3); + dtrace_get_operand(x, REG_ONLY, (0xF - vex_v), wbit, 2); + if (dp == &dis_opAVX660F3A[0x18]) { + /* vinsertf128 <imm8>, <xmm>, <ymm>, <ymm> */ + dtrace_get_operand(x, mode, r_m, XMM_OPND, 1); + } else if ((dp == &dis_opAVX660F3A[0x20]) || + (dp == & dis_opAVX660F[0xC4])) { + /* vpinsrb <imm8>, <reg/mm>, <xmm>, <xmm> */ + /* or vpinsrw <imm8>, <reg/mm>, <xmm>, <xmm> */ + dtrace_get_operand(x, mode, r_m, LONG_OPND, 1); + } else if (dp == &dis_opAVX660F3A[0x22]) { + /* vpinsrd/q <imm8>, <reg/mm>, <xmm>, <xmm> */ +#ifdef DIS_TEXT + if (vex_W) + x->d86_mnem[6] = 'q'; +#endif + dtrace_get_operand(x, mode, r_m, LONG_OPND, 1); + } else { + dtrace_get_operand(x, mode, r_m, wbit, 1); + } + + /* one byte immediate number */ + dtrace_imm_opnd(x, wbit, 1, 0); + + /* vblendvpd, vblendvps, vblendvb use the imm encode the regs */ + if ((dp == &dis_opAVX660F3A[0x4A]) || + (dp == &dis_opAVX660F3A[0x4B]) || + (dp == &dis_opAVX660F3A[0x4C])) { +#ifdef DIS_TEXT + int regnum = (x->d86_opnd[0].d86_value & 0xF0) >> 4; +#endif + x->d86_opnd[0].d86_mode = MODE_NONE; +#ifdef DIS_TEXT + if (vex_L) + (void) strncpy(x->d86_opnd[0].d86_opnd, + dis_YMMREG[regnum], OPLEN); + else + (void) strncpy(x->d86_opnd[0].d86_opnd, + dis_XMMREG[regnum], OPLEN); +#endif + } + break; + + case VEX_MX: + /* ModR/M.reg := op(ModR/M.rm) */ + x->d86_numopnds = 2; + + dtrace_get_modrm(x, &mode, ®, &r_m); + dtrace_vex_adjust(vex_byte1, mode, ®, &r_m); +L_VEX_MX: + + if ((dp == &dis_opAVXF20F[0xE6]) || + (dp == &dis_opAVX660F[0x5A]) || + (dp == &dis_opAVX660F[0xE6])) { + /* vcvtpd2dq <ymm>, <xmm> */ + /* or vcvtpd2ps <ymm>, <xmm> */ + /* or vcvttpd2dq <ymm>, <xmm> */ + dtrace_get_operand(x, REG_ONLY, reg, XMM_OPND, 1); + dtrace_get_operand(x, mode, r_m, wbit, 0); + } else if ((dp == &dis_opAVXF30F[0xE6]) || + (dp == &dis_opAVX0F[0x5][0xA])) { + /* vcvtdq2pd <xmm>, <ymm> */ + /* or vcvtps2pd <xmm>, <ymm> */ + dtrace_get_operand(x, REG_ONLY, reg, wbit, 1); + dtrace_get_operand(x, mode, r_m, XMM_OPND, 0); + } else if (dp == &dis_opAVX660F[0x6E]) { + /* vmovd/q <reg/mem 32/64>, <xmm> */ +#ifdef DIS_TEXT + if (vex_W) + x->d86_mnem[4] = 'q'; +#endif + dtrace_get_operand(x, REG_ONLY, reg, wbit, 1); + dtrace_get_operand(x, mode, r_m, LONG_OPND, 0); + } else { + dtrace_get_operand(x, REG_ONLY, reg, wbit, 1); + dtrace_get_operand(x, mode, r_m, wbit, 0); + } + + break; + + case VEX_MXI: + /* ModR/M.reg := op(ModR/M.rm, imm8) */ + x->d86_numopnds = 3; + + dtrace_get_modrm(x, &mode, ®, &r_m); + dtrace_vex_adjust(vex_byte1, mode, ®, &r_m); + + dtrace_get_operand(x, REG_ONLY, reg, wbit, 2); + dtrace_get_operand(x, mode, r_m, wbit, 1); + + /* one byte immediate number */ + dtrace_imm_opnd(x, wbit, 1, 0); + break; + + case VEX_XXI: + /* VEX.vvvv := op(ModR/M.rm, imm8) */ + x->d86_numopnds = 3; + + dtrace_get_modrm(x, &mode, ®, &r_m); +#ifdef DIS_TEXT + (void) strncpy(x->d86_mnem, dis_AVXvgrp7[opcode2 - 1][reg], + OPLEN); +#endif + dtrace_vex_adjust(vex_byte1, mode, ®, &r_m); + + dtrace_get_operand(x, REG_ONLY, (0xF - vex_v), wbit, 2); + dtrace_get_operand(x, REG_ONLY, r_m, wbit, 1); + + /* one byte immediate number */ + dtrace_imm_opnd(x, wbit, 1, 0); + break; + + case VEX_MR: + /* ModR/M.reg (reg32/64) := op(ModR/M.rm) */ + if (dp == &dis_opAVX660F[0xC5]) { + /* vpextrw <imm8>, <xmm>, <reg> */ + x->d86_numopnds = 2; + vbit = 2; + } else { + x->d86_numopnds = 2; + vbit = 1; + } + + dtrace_get_modrm(x, &mode, ®, &r_m); + dtrace_vex_adjust(vex_byte1, mode, ®, &r_m); + dtrace_get_operand(x, REG_ONLY, reg, LONG_OPND, vbit); + dtrace_get_operand(x, mode, r_m, wbit, vbit - 1); + + if (vbit == 2) + dtrace_imm_opnd(x, wbit, 1, 0); + + break; + + case VEX_RRI: + /* implicit(eflags/r32) := op(ModR/M.reg, ModR/M.rm) */ + x->d86_numopnds = 2; + + dtrace_get_modrm(x, &mode, ®, &r_m); + dtrace_vex_adjust(vex_byte1, mode, ®, &r_m); + dtrace_get_operand(x, REG_ONLY, reg, wbit, 1); + dtrace_get_operand(x, mode, r_m, wbit, 0); + break; + + case VEX_RX: + /* ModR/M.rm := op(ModR/M.reg) */ + if (dp == &dis_opAVX660F3A[0x19]) { /* vextractf128 */ + x->d86_numopnds = 3; + + dtrace_get_modrm(x, &mode, ®, &r_m); + dtrace_vex_adjust(vex_byte1, mode, ®, &r_m); + + dtrace_get_operand(x, mode, r_m, XMM_OPND, 2); + dtrace_get_operand(x, REG_ONLY, reg, wbit, 1); + + /* one byte immediate number */ + dtrace_imm_opnd(x, wbit, 1, 0); + break; + } + + x->d86_numopnds = 2; + + dtrace_get_modrm(x, &mode, ®, &r_m); + dtrace_vex_adjust(vex_byte1, mode, ®, &r_m); + dtrace_get_operand(x, mode, r_m, wbit, 1); + dtrace_get_operand(x, REG_ONLY, reg, wbit, 0); + break; + + case VEX_RR: + /* ModR/M.rm := op(ModR/M.reg) */ + x->d86_numopnds = 2; + + dtrace_get_modrm(x, &mode, ®, &r_m); + dtrace_vex_adjust(vex_byte1, mode, ®, &r_m); + + if (dp == &dis_opAVX660F[0x7E]) { + /* vmovd/q <reg/mem 32/64>, <xmm> */ +#ifdef DIS_TEXT + if (vex_W) + x->d86_mnem[4] = 'q'; +#endif + dtrace_get_operand(x, mode, r_m, LONG_OPND, 1); + } else + dtrace_get_operand(x, mode, r_m, wbit, 1); + + dtrace_get_operand(x, REG_ONLY, reg, wbit, 0); + break; + + case VEX_RRi: + /* ModR/M.rm := op(ModR/M.reg, imm) */ + x->d86_numopnds = 3; + + dtrace_get_modrm(x, &mode, ®, &r_m); + dtrace_vex_adjust(vex_byte1, mode, ®, &r_m); + +#ifdef DIS_TEXT + if (dp == &dis_opAVX660F3A[0x16]) { + /* vpextrd/q <imm>, <xmm>, <reg/mem 32/64> */ + if (vex_W) + x->d86_mnem[6] = 'q'; + } +#endif + dtrace_get_operand(x, mode, r_m, LONG_OPND, 2); + dtrace_get_operand(x, REG_ONLY, reg, wbit, 1); + + /* one byte immediate number */ + dtrace_imm_opnd(x, wbit, 1, 0); + break; + + case VEX_RM: + /* ModR/M.rm := op(ModR/M.reg) */ + if (dp == &dis_opAVX660F3A[0x17]) { /* vextractps */ + x->d86_numopnds = 3; + + dtrace_get_modrm(x, &mode, ®, &r_m); + dtrace_vex_adjust(vex_byte1, mode, ®, &r_m); + + dtrace_get_operand(x, mode, r_m, LONG_OPND, 2); + dtrace_get_operand(x, REG_ONLY, reg, wbit, 1); + /* one byte immediate number */ + dtrace_imm_opnd(x, wbit, 1, 0); + break; + } + x->d86_numopnds = 2; + + dtrace_get_modrm(x, &mode, ®, &r_m); + dtrace_vex_adjust(vex_byte1, mode, ®, &r_m); +L_VEX_RM: + vbit = 1; + dtrace_get_operand(x, mode, r_m, wbit, vbit); + dtrace_get_operand(x, REG_ONLY, reg, wbit, vbit - 1); + + break; + + case VEX_RRM: + /* ModR/M.rm := op(VEX.vvvv, ModR/M.reg) */ + x->d86_numopnds = 3; + + dtrace_get_modrm(x, &mode, ®, &r_m); + dtrace_vex_adjust(vex_byte1, mode, ®, &r_m); + dtrace_get_operand(x, mode, r_m, wbit, 2); + /* VEX use the 1's complement form encode the XMM/YMM regs */ + dtrace_get_operand(x, REG_ONLY, (0xF - vex_v), wbit, 1); + dtrace_get_operand(x, REG_ONLY, reg, wbit, 0); + break; + + case VEX_RMX: + /* ModR/M.reg := op(VEX.vvvv, ModR/M.rm) */ + x->d86_numopnds = 3; + + dtrace_get_modrm(x, &mode, ®, &r_m); + dtrace_vex_adjust(vex_byte1, mode, ®, &r_m); + dtrace_get_operand(x, REG_ONLY, reg, wbit, 2); + dtrace_get_operand(x, REG_ONLY, (0xF - vex_v), wbit, 1); + dtrace_get_operand(x, REG_ONLY, r_m, wbit, 0); + break; + + case VEX_NONE: +#ifdef DIS_TEXT + if (vex_L) + (void) strncpy(x->d86_mnem, "vzeroall", OPLEN); +#endif + break; /* an invalid op code */ case AM: case DM: @@ -3025,7 +4572,7 @@ done: error: #ifdef DIS_TEXT - (void) strlcat(x->d86_mneu, "undef", OPLEN); + (void) strlcat(x->d86_mnem, "undef", OPLEN); #endif return (1); } @@ -3042,6 +4589,7 @@ static char *unsigned_ops[] = { 0 }; + static int isunsigned_op(char *opcode) { @@ -3069,14 +4617,81 @@ isunsigned_op(char *opcode) return (is_unsigned); } +/* + * Print a numeric immediate into end of buf, maximum length buflen. + * The immediate may be an address or a displacement. Mask is set + * for address size. If the immediate is a "small negative", or + * if it's a negative displacement of any magnitude, print as -<absval>. + * Respect the "octal" flag. "Small negative" is defined as "in the + * interval [NEG_LIMIT, 0)". + * + * Also, "isunsigned_op()" instructions never print negatives. + * + * Return whether we decided to print a negative value or not. + */ + +#define NEG_LIMIT -255 +enum {IMM, DISP}; +enum {POS, TRY_NEG}; + +static int +print_imm(dis86_t *dis, uint64_t usv, uint64_t mask, char *buf, + size_t buflen, int disp, int try_neg) +{ + int curlen; + int64_t sv = (int64_t)usv; + int octal = dis->d86_flags & DIS_F_OCTAL; + + curlen = strlen(buf); + + if (try_neg == TRY_NEG && sv < 0 && + (disp || sv >= NEG_LIMIT) && + !isunsigned_op(dis->d86_mnem)) { + dis->d86_sprintf_func(buf + curlen, buflen - curlen, + octal ? "-0%llo" : "-0x%llx", (-sv) & mask); + return (1); + } else { + if (disp == DISP) + dis->d86_sprintf_func(buf + curlen, buflen - curlen, + octal ? "+0%llo" : "+0x%llx", usv & mask); + else + dis->d86_sprintf_func(buf + curlen, buflen - curlen, + octal ? "0%llo" : "0x%llx", usv & mask); + return (0); + + } +} + + +static int +log2(int size) +{ + switch (size) { + case 1: return (0); + case 2: return (1); + case 4: return (2); + case 8: return (3); + } + return (0); +} + /* ARGSUSED */ void -dtrace_disx86_str(dis86_t *dis, uint_t mode, uintptr_t pc, char *buf, +dtrace_disx86_str(dis86_t *dis, uint_t mode, uint64_t pc, char *buf, size_t buflen) { + uint64_t reltgt = 0; + uint64_t tgt = 0; + int curlen; + int (*lookup)(void *, uint64_t, char *, size_t); int i; + int64_t sv; + uint64_t usv, mask, save_mask, save_usv; + static uint64_t masks[] = + {0xffU, 0xffffU, 0xffffffffU, 0xffffffffffffffffULL}; + save_usv = 0; - dis->d86_sprintf_func(buf, buflen, "%-6s ", dis->d86_mneu); + dis->d86_sprintf_func(buf, buflen, "%-6s ", dis->d86_mnem); /* * For PC-relative jumps, the pc is really the next pc after executing @@ -3086,15 +4701,37 @@ dtrace_disx86_str(dis86_t *dis, uint_t mode, uintptr_t pc, char *buf, for (i = 0; i < dis->d86_numopnds; i++) { d86opnd_t *op = &dis->d86_opnd[i]; - int64_t sv; - uint64_t mask; if (i != 0) (void) strlcat(buf, ",", buflen); (void) strlcat(buf, op->d86_prefix, buflen); - sv = op->d86_value; + /* + * sv is for the signed, possibly-truncated immediate or + * displacement; usv retains the original size and + * unsignedness for symbol lookup. + */ + + sv = usv = op->d86_value; + + /* + * About masks: for immediates that represent + * addresses, the appropriate display size is + * the effective address size of the instruction. + * This includes MODE_OFFSET, MODE_IPREL, and + * MODE_RIPREL. Immediates that are simply + * immediate values should display in the operand's + * size, however, since they don't represent addresses. + */ + + /* d86_addr_size is SIZEnn, which is log2(real size) */ + mask = masks[dis->d86_addr_size]; + + /* d86_value_size and d86_imm_bytes are in bytes */ + if (op->d86_mode == MODE_SIGNED || + op->d86_mode == MODE_IMPLIED) + mask = masks[log2(op->d86_value_size)]; switch (op->d86_mode) { @@ -3107,87 +4744,98 @@ dtrace_disx86_str(dis86_t *dis, uint_t mode, uintptr_t pc, char *buf, case MODE_IMPLIED: case MODE_OFFSET: + tgt = usv; + if (dis->d86_seg_prefix) (void) strlcat(buf, dis->d86_seg_prefix, buflen); - switch (op->d86_value_size) { - case 1: - sv = (int8_t)sv; - mask = 0xff; - break; - case 2: - sv = (int16_t)sv; - mask = 0xffff; - break; - case 4: - sv = (int32_t)sv; - mask = 0xffffffff; - break; - case 8: - mask = 0xffffffffffffffffULL; - break; - } - if (op->d86_mode == MODE_SIGNED || - op->d86_mode == MODE_IMPLIED) + op->d86_mode == MODE_IMPLIED) { (void) strlcat(buf, "$", buflen); + } - if (sv < 0 && sv > -0xffff && - !isunsigned_op(dis->d86_mneu)) { - dis->d86_sprintf_func(buf + strlen(buf), - buflen - strlen(buf), - (dis->d86_flags & DIS_OP_OCTAL) ? - "-0%llo" : "-0x%llx", -sv & mask); - } else { - dis->d86_sprintf_func(buf + strlen(buf), - buflen - strlen(buf), - (dis->d86_flags & DIS_OP_OCTAL) ? - "0%llo" : "0x%llx", sv & mask); + if (print_imm(dis, usv, mask, buf, buflen, + IMM, TRY_NEG) && + (op->d86_mode == MODE_SIGNED || + op->d86_mode == MODE_IMPLIED)) { + + /* + * We printed a negative value for an + * immediate that wasn't a + * displacement. Note that fact so we can + * print the positive value as an + * annotation. + */ + + save_usv = usv; + save_mask = mask; } (void) strlcat(buf, op->d86_opnd, buflen); + break; case MODE_IPREL: + case MODE_RIPREL: - switch (op->d86_value_size) { - case 1: - sv = (int8_t)sv; - break; - case 2: - sv = (int16_t)sv; + reltgt = pc + sv; + + switch (mode) { + case SIZE16: + reltgt = (uint16_t)reltgt; break; - case 4: - sv = (int32_t)sv; + case SIZE32: + reltgt = (uint32_t)reltgt; break; } - if (sv < 0) - dis->d86_sprintf_func(buf + strlen(buf), - buflen - strlen(buf), - (dis->d86_flags & DIS_OP_OCTAL) ? - "-0%llo" : "-0x%llx", -sv - dis->d86_len); - else - dis->d86_sprintf_func(buf + strlen(buf), - buflen - strlen(buf), - (dis->d86_flags & DIS_OP_OCTAL) ? - "+0%llo" : "+0x%llx", sv + dis->d86_len); + (void) print_imm(dis, usv, mask, buf, buflen, + DISP, TRY_NEG); - (void) strlcat(buf, "\t<", buflen); + if (op->d86_mode == MODE_RIPREL) + (void) strlcat(buf, "(%rip)", buflen); + break; + } + } - if (dis->d86_sym_lookup == NULL || - dis->d86_sym_lookup(dis->d86_data, pc + sv, - buf + strlen(buf), buflen - strlen(buf)) != 0) - dis->d86_sprintf_func(buf + strlen(buf), - buflen - strlen(buf), - (dis->d86_flags & DIS_OP_OCTAL) ? - "0%llo" : "0x%llx", pc + sv); + /* + * The symbol lookups may result in false positives, + * particularly on object files, where small numbers may match + * the 0-relative non-relocated addresses of symbols. + */ + lookup = dis->d86_sym_lookup; + if (tgt != 0) { + if ((dis->d86_flags & DIS_F_NOIMMSYM) == 0 && + lookup(dis->d86_data, tgt, NULL, 0) == 0) { + (void) strlcat(buf, "\t<", buflen); + curlen = strlen(buf); + lookup(dis->d86_data, tgt, buf + curlen, + buflen - curlen); (void) strlcat(buf, ">", buflen); + } - break; + /* + * If we printed a negative immediate above, print the + * positive in case our heuristic was unhelpful + */ + if (save_usv) { + (void) strlcat(buf, "\t<", buflen); + (void) print_imm(dis, save_usv, save_mask, buf, buflen, + IMM, POS); + (void) strlcat(buf, ">", buflen); } } + + if (reltgt != 0) { + /* Print symbol or effective address for reltgt */ + + (void) strlcat(buf, "\t<", buflen); + curlen = strlen(buf); + lookup(dis->d86_data, reltgt, buf + curlen, + buflen - curlen); + (void) strlcat(buf, ">", buflen); + } } #endif /* DIS_TEXT */ diff --git a/sys/cddl/dev/dtrace/amd64/dis_tables.h b/sys/cddl/dev/dtrace/amd64/dis_tables.h index b45a8c50e738..758fc40bac18 100644 --- a/sys/cddl/dev/dtrace/amd64/dis_tables.h +++ b/sys/cddl/dev/dtrace/amd64/dis_tables.h @@ -17,25 +17,22 @@ * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END - * - * $FreeBSD$ */ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ /* Copyright (c) 1988 AT&T */ /* All Rights Reserved */ +/* + * $FreeBSD$ + */ #ifndef _DIS_TABLES_H #define _DIS_TABLES_H -#if defined(sun) -#pragma ident "@(#)dis_tables.h 1.7 06/03/02 SMI" -#endif - /* * Constants and prototypes for the IA32 disassembler backend. See dis_tables.c * for usage information and documentation. @@ -57,7 +54,7 @@ extern "C" { #define OPLEN 256 #define PFIXLEN 8 -#define NCPS 12 /* number of chars per symbol */ +#define NCPS 20 /* number of chars per symbol */ /* * data structures that must be provided to dtrace_dis86() @@ -77,14 +74,14 @@ typedef struct dis86 { int d86_rmindex; /* index of modrm byte or -1 */ uint_t d86_memsize; /* size of memory referenced */ char d86_bytes[16]; /* bytes of instruction */ - char d86_mneu[OPLEN]; + char d86_mnem[OPLEN]; uint_t d86_numopnds; uint_t d86_rex_prefix; /* value of REX prefix if !0 */ char *d86_seg_prefix; /* segment prefix, if any */ uint_t d86_opnd_size; uint_t d86_addr_size; uint_t d86_got_modrm; - struct d86opnd d86_opnd[3]; /* up to 3 operands */ + struct d86opnd d86_opnd[4]; /* up to 4 operands */ int (*d86_check_func)(void *); int (*d86_get_byte)(void *); #ifdef DIS_TEXT @@ -98,10 +95,11 @@ typedef struct dis86 { extern int dtrace_disx86(dis86_t *x, uint_t cpu_mode); -#define DIS_OP_OCTAL 0x1 /* Print all numbers in octal */ +#define DIS_F_OCTAL 0x1 /* Print all numbers in octal */ +#define DIS_F_NOIMMSYM 0x2 /* Don't print symbols for immediates (.o) */ #ifdef DIS_TEXT -extern void dtrace_disx86_str(dis86_t *x, uint_t cpu_mode, uintptr_t pc, +extern void dtrace_disx86_str(dis86_t *x, uint_t cpu_mode, uint64_t pc, char *buf, size_t len); #endif diff --git a/sys/cddl/dev/dtrace/i386/dis_tables.c b/sys/cddl/dev/dtrace/i386/dis_tables.c index 44b935fccc22..72fa4bffcfcb 100644 --- a/sys/cddl/dev/dtrace/i386/dis_tables.c +++ b/sys/cddl/dev/dtrace/i386/dis_tables.c @@ -1,4 +1,5 @@ /* + * * CDDL HEADER START * * The contents of this file are subject to the terms of the @@ -17,21 +18,22 @@ * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END - * - * $FreeBSD$ */ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + */ + +/* + * Copyright (c) 2010, Intel Corporation. + * All rights reserved. */ /* Copyright (c) 1988 AT&T */ /* All Rights Reserved */ - -#if defined(sun) -#pragma ident "@(#)dis_tables.c 1.11 06/03/02 SMI" -#endif +/* + * $FreeBSD$ + */ #include "dis_tables.h" @@ -66,16 +68,16 @@ extern size_t strlcat(char *, const char *, size_t); #endif -#define TERM NULL /* used to indicate that the 'indirect' */ +#define TERM 0 /* used to indicate that the 'indirect' */ /* field terminates - no pointer. */ /* Used to decode instructions. */ typedef struct instable { - const struct instable *it_indirect; /* for decode op codes */ + struct instable *it_indirect; /* for decode op codes */ uchar_t it_adrmode; #ifdef DIS_TEXT char it_name[NCPS]; - uint_t it_suffix:1; /* mneu + "w", "l", or "d" */ + uint_t it_suffix:1; /* mnem + "w", "l", or "d" */ #endif #ifdef DIS_MEM uint_t it_size:16; @@ -106,6 +108,7 @@ enum { MO, /* memory only (no registers) */ PREF, SWAPGS, + MONITOR_MWAIT, R, RA, SEG, @@ -152,8 +155,10 @@ enum { CWD, /* so data16 can be evaluated for cwd and variants */ RET, /* single immediate 16-bit operand */ MOVZ, /* for movs and movz, with different size operands */ + CRC32, /* for crc32, with different size operands */ XADDB, /* for xaddb */ MOVSXZ, /* AMD64 mov sign extend 32 to 64 bit instruction */ + MOVBE, /* movbe instruction */ /* * MMX/SIMD addressing modes. @@ -166,6 +171,7 @@ enum { MMOS, /* Prefixable MMX/SIMD-Int mm -> mm/mem */ MMOMS, /* Prefixable MMX/SIMD-Int mm -> mem */ MMOPM, /* MMX/SIMD-Int mm/mem -> mm,imm8 */ + MMOPM_66o, /* MMX/SIMD-Int 0x66 optional mm/mem -> mm,imm8 */ MMOPRM, /* Prefixable MMX/SIMD-Int r32/mem -> mm,imm8 */ MMOSH, /* Prefixable MMX mm,imm8 */ MM, /* MMX/SIMD-Int mm/mem -> mm */ @@ -180,12 +186,19 @@ enum { XMMOM, /* Prefixable SIMD xmm -> mem */ XMMOMS, /* Prefixable SIMD mem -> xmm */ XMM, /* SIMD xmm/mem -> xmm */ + XMM_66r, /* SIMD 0x66 prefix required xmm/mem -> xmm */ + XMM_66o, /* SIMD 0x66 prefix optional xmm/mem -> xmm */ XMMXIMPL, /* SIMD xmm -> xmm (mem) */ XMM3P, /* SIMD xmm -> r32,imm8 */ + XMM3PM_66r, /* SIMD 0x66 prefix required xmm -> r32/mem,imm8 */ XMMP, /* SIMD xmm/mem w/to xmm,imm8 */ + XMMP_66o, /* SIMD 0x66 prefix optional xmm/mem w/to xmm,imm8 */ + XMMP_66r, /* SIMD 0x66 prefix required xmm/mem w/to xmm,imm8 */ XMMPRM, /* SIMD r32/mem -> xmm,imm8 */ + XMMPRM_66r, /* SIMD 0x66 prefix required r32/mem -> xmm,imm8 */ XMMS, /* SIMD xmm -> xmm/mem */ XMMM, /* SIMD mem -> xmm */ + XMMM_66r, /* SIMD 0x66 prefix required mem -> xmm */ XMMMS, /* SIMD xmm -> mem */ XMM3MX, /* SIMD r32/mem -> xmm */ XMM3MXS, /* SIMD xmm -> r32/mem */ @@ -195,10 +208,35 @@ enum { XMMXMM, /* SIMD xmm/mem -> mm */ XMMMX, /* SIMD mm -> xmm */ XMMXM, /* SIMD xmm -> mm */ + XMMX2I, /* SIMD xmm -> xmm, imm, imm */ + XMM2I, /* SIMD xmm, imm, imm */ XMMFENCE, /* SIMD lfence or mfence */ - XMMSFNC /* SIMD sfence (none or mem) */ + XMMSFNC, /* SIMD sfence (none or mem) */ + XGETBV_XSETBV, + VEX_NONE, /* VEX no operand */ + VEX_MO, /* VEX mod_rm -> implicit reg */ + VEX_RMrX, /* VEX VEX.vvvv, mod_rm -> mod_reg */ + VEX_RRX, /* VEX VEX.vvvv, mod_reg -> mod_rm */ + VEX_RMRX, /* VEX VEX.vvvv, mod_rm, imm8[7:4] -> mod_reg */ + VEX_MX, /* VEX mod_rm -> mod_reg */ + VEX_MXI, /* VEX mod_rm, imm8 -> mod_reg */ + VEX_XXI, /* VEX mod_rm, imm8 -> VEX.vvvv */ + VEX_MR, /* VEX mod_rm -> mod_reg */ + VEX_RRI, /* VEX mod_reg, mod_rm -> implicit(eflags/r32) */ + VEX_RX, /* VEX mod_reg -> mod_rm */ + VEX_RR, /* VEX mod_rm -> mod_reg */ + VEX_RRi, /* VEX mod_rm, imm8 -> mod_reg */ + VEX_RM, /* VEX mod_reg -> mod_rm */ + VEX_RRM, /* VEX VEX.vvvv, mod_reg -> mod_rm */ + VEX_RMX /* VEX VEX.vvvv, mod_rm -> mod_reg */ }; +/* + * VEX prefixes + */ +#define VEX_2bytes 0xC5 /* the first byte of two-byte form */ +#define VEX_3bytes 0xC4 /* the first byte of three-byte form */ + #define FILL 0x90 /* Fill byte used for alignment (nop) */ /* @@ -221,6 +259,7 @@ enum { #define MODE_SIGNED 2 /* sign extended immediate */ #define MODE_IMPLIED 3 /* constant value implied from opcode */ #define MODE_OFFSET 4 /* offset part of an address */ +#define MODE_RIPREL 5 /* like IPREL, but from %rip (amd64) */ /* * The letters used in these macros are: @@ -236,8 +275,8 @@ enum { */ #if defined(DIS_TEXT) && defined(DIS_MEM) -#define IND(table) {table, 0, "", 0, 0, 0, 0, 0, 0} -#define INDx(table) {table, 0, "", 0, 0, 1, 0, 0, 0} +#define IND(table) {(instable_t *)table, 0, "", 0, 0, 0, 0, 0, 0} +#define INDx(table) {(instable_t *)table, 0, "", 0, 0, 1, 0, 0, 0} #define TNS(name, amode) {TERM, amode, name, 0, 0, 0, 0, 0, 0} #define TNSu(name, amode) {TERM, amode, name, 0, 0, 0, 0, 1, 0} #define TNSx(name, amode) {TERM, amode, name, 0, 0, 1, 0, 0, 0} @@ -254,8 +293,8 @@ enum { #define TSZy(name, amode, sz) {TERM, amode, name, 1, sz, 0, 1, 0, 0} #define INVALID {TERM, UNKNOWN, "", 0, 0, 0, 0, 0} #elif defined(DIS_TEXT) -#define IND(table) {table, 0, "", 0, 0, 0, 0, 0} -#define INDx(table) {table, 0, "", 0, 1, 0, 0, 0} +#define IND(table) {(instable_t *)table, 0, "", 0, 0, 0, 0, 0} +#define INDx(table) {(instable_t *)table, 0, "", 0, 1, 0, 0, 0} #define TNS(name, amode) {TERM, amode, name, 0, 0, 0, 0, 0} #define TNSu(name, amode) {TERM, amode, name, 0, 0, 0, 1, 0} #define TNSx(name, amode) {TERM, amode, name, 0, 1, 0, 0, 0} @@ -272,8 +311,8 @@ enum { #define TSZy(name, amode, sz) {TERM, amode, name, 1, 0, 1, 0, 0} #define INVALID {TERM, UNKNOWN, "", 0, 0, 0, 0, 0} #elif defined(DIS_MEM) -#define IND(table) {table, 0, 0, 0, 0, 0, 0} -#define INDx(table) {table, 0, 0, 1, 0, 0, 0} +#define IND(table) {(instable_t *)table, 0, 0, 0, 0, 0, 0} +#define INDx(table) {(instable_t *)table, 0, 0, 1, 0, 0, 0} #define TNS(name, amode) {TERM, amode, 0, 0, 0, 0, 0} #define TNSu(name, amode) {TERM, amode, 0, 0, 0, 1, 0} #define TNSy(name, amode) {TERM, amode, 0, 0, 1, 0, 0} @@ -290,8 +329,8 @@ enum { #define TSZy(name, amode, sz) {TERM, amode, sz, 0, 1, 0, 0} #define INVALID {TERM, UNKNOWN, 0, 0, 0, 0, 0} #else -#define IND(table) {table[0], 0, 0, 0, 0, 0} -#define INDx(table) {table[0], 0, 1, 0, 0, 0} +#define IND(table) {(instable_t *)table, 0, 0, 0, 0, 0} +#define INDx(table) {(instable_t *)table, 0, 1, 0, 0, 0} #define TNS(name, amode) {TERM, amode, 0, 0, 0, 0} #define TNSu(name, amode) {TERM, amode, 0, 0, 1, 0} #define TNSy(name, amode) {TERM, amode, 0, 1, 0, 0} @@ -406,6 +445,11 @@ const char *const dis_XMMREG[16] = { "%xmm8", "%xmm9", "%xmm10", "%xmm11", "%xmm12", "%xmm13", "%xmm14", "%xmm15" }; +const char *const dis_YMMREG[16] = { + "%ymm0", "%ymm1", "%ymm2", "%ymm3", "%ymm4", "%ymm5", "%ymm6", "%ymm7", + "%ymm8", "%ymm9", "%ymm10", "%ymm11", "%ymm12", "%ymm13", "%ymm14", "%ymm15" +}; + const char *const dis_SEGREG[16] = { "%es", "%cs", "%ss", "%ds", "%fs", "%gs", "<reserved>", "<reserved>", "%es", "%cs", "%ss", "%ds", "%fs", "%gs", "<reserved>", "<reserved>" @@ -418,13 +462,15 @@ const char *const dis_PREDSUFFIX[8] = { "eq", "lt", "le", "unord", "neq", "nlt", "nle", "ord" }; - +const char *const dis_AVXvgrp7[3][8] = { + /*0 1 2 3 4 5 6 7*/ +/*71*/ {"", "", "vpsrlw", "", "vpsraw", "", "vpsllw", ""}, +/*72*/ {"", "", "vpsrld", "", "vpsrad", "", "vpslld", ""}, +/*73*/ {"", "", "vpsrlq", "vpsrldq", "", "", "vpsllq", "vpslldq"} +}; #endif /* DIS_TEXT */ - - - /* * "decode table" for 64 bit mode MOVSXD instruction (opcode 0x63) */ @@ -450,7 +496,7 @@ const instable_t dis_op0F00[8] = { */ const instable_t dis_op0F01[8] = { -/* [0] */ TNSZ("sgdt",MO,6), TNSZ("sidt",MO,6), TNSZ("lgdt",MO,6), TNSZ("lidt",MO,6), +/* [0] */ TNSZ("sgdt",MO,6), TNSZ("sidt",MONITOR_MWAIT,6), TNSZ("lgdt",XGETBV_XSETBV,6), TNSZ("lidt",MO,6), /* [4] */ TNSZ("smsw",M,2), INVALID, TNSZ("lmsw",M,2), TNS("invlpg",SWAPGS), }; @@ -468,7 +514,7 @@ const instable_t dis_op0F18[8] = { */ const instable_t dis_op0FAE[8] = { /* [0] */ TNSZ("fxsave",M,512), TNSZ("fxrstor",M,512), TNS("ldmxcsr",M), TNS("stmxcsr",M), -/* [4] */ INVALID, TNS("lfence",XMMFENCE), TNS("mfence",XMMFENCE), TNS("sfence",XMMSFNC), +/* [4] */ TNSZ("xsave",M,512), TNS("lfence",XMMFENCE), TNS("mfence",XMMFENCE), TNS("sfence",XMMSFNC), }; /* @@ -587,7 +633,7 @@ const instable_t dis_opSIMDdata16[256] = { /* [70] */ TNSZ("pshufd",XMMP,16), INVALID, INVALID, INVALID, /* [74] */ TNSZ("pcmpeqb",XMM,16), TNSZ("pcmpeqw",XMM,16), TNSZ("pcmpeqd",XMM,16), INVALID, -/* [78] */ INVALID, INVALID, INVALID, INVALID, +/* [78] */ TNSZ("extrq",XMM2I,16), TNSZ("extrq",XMM,16), INVALID, INVALID, /* [7C] */ INVALID, INVALID, TNSZ("movd",XMM3MXS,4), TNSZ("movdqa",XMMS,16), /* [80] */ INVALID, INVALID, INVALID, INVALID, @@ -631,6 +677,88 @@ const instable_t dis_opSIMDdata16[256] = { /* [FC] */ TNSZ("paddb",XMM,16), TNSZ("paddw",XMM,16), TNSZ("paddd",XMM,16), INVALID, }; +const instable_t dis_opAVX660F[256] = { +/* [00] */ INVALID, INVALID, INVALID, INVALID, +/* [04] */ INVALID, INVALID, INVALID, INVALID, +/* [08] */ INVALID, INVALID, INVALID, INVALID, +/* [0C] */ INVALID, INVALID, INVALID, INVALID, + +/* [10] */ TNSZ("vmovupd",VEX_MX,16), TNSZ("vmovupd",VEX_RX,16), TNSZ("vmovlpd",VEX_RMrX,8), TNSZ("vmovlpd",VEX_RM,8), +/* [14] */ TNSZ("vunpcklpd",VEX_RMrX,16),TNSZ("vunpckhpd",VEX_RMrX,16),TNSZ("vmovhpd",VEX_RMrX,8), TNSZ("vmovhpd",VEX_RM,8), +/* [18] */ INVALID, INVALID, INVALID, INVALID, +/* [1C] */ INVALID, INVALID, INVALID, INVALID, + +/* [20] */ INVALID, INVALID, INVALID, INVALID, +/* [24] */ INVALID, INVALID, INVALID, INVALID, +/* [28] */ TNSZ("vmovapd",VEX_MX,16), TNSZ("vmovapd",VEX_RX,16), INVALID, TNSZ("vmovntpd",VEX_RM,16), +/* [2C] */ INVALID, INVALID, TNSZ("vucomisd",VEX_MX,8),TNSZ("vcomisd",VEX_MX,8), + +/* [30] */ INVALID, INVALID, INVALID, INVALID, +/* [34] */ INVALID, INVALID, INVALID, INVALID, +/* [38] */ INVALID, INVALID, INVALID, INVALID, +/* [3C] */ INVALID, INVALID, INVALID, INVALID, + +/* [40] */ INVALID, INVALID, INVALID, INVALID, +/* [44] */ INVALID, INVALID, INVALID, INVALID, +/* [48] */ INVALID, INVALID, INVALID, INVALID, +/* [4C] */ INVALID, INVALID, INVALID, INVALID, + +/* [50] */ TNS("vmovmskpd",VEX_MR), TNSZ("vsqrtpd",VEX_MX,16), INVALID, INVALID, +/* [54] */ TNSZ("vandpd",VEX_RMrX,16), TNSZ("vandnpd",VEX_RMrX,16), TNSZ("vorpd",VEX_RMrX,16), TNSZ("vxorpd",VEX_RMrX,16), +/* [58] */ TNSZ("vaddpd",VEX_RMrX,16), TNSZ("vmulpd",VEX_RMrX,16), TNSZ("vcvtpd2ps",VEX_MX,16),TNSZ("vcvtps2dq",VEX_MX,16), +/* [5C] */ TNSZ("vsubpd",VEX_RMrX,16), TNSZ("vminpd",VEX_RMrX,16), TNSZ("vdivpd",VEX_RMrX,16), TNSZ("vmaxpd",VEX_RMrX,16), + +/* [60] */ TNSZ("vpunpcklbw",VEX_RMrX,16),TNSZ("vpunpcklwd",VEX_RMrX,16),TNSZ("vpunpckldq",VEX_RMrX,16),TNSZ("vpacksswb",VEX_RMrX,16), +/* [64] */ TNSZ("vpcmpgtb",VEX_RMrX,16), TNSZ("vpcmpgtw",VEX_RMrX,16), TNSZ("vpcmpgtd",VEX_RMrX,16), TNSZ("vpackuswb",VEX_RMrX,16), +/* [68] */ TNSZ("vpunpckhbw",VEX_RMrX,16),TNSZ("vpunpckhwd",VEX_RMrX,16),TNSZ("vpunpckhdq",VEX_RMrX,16),TNSZ("vpackssdw",VEX_RMrX,16), +/* [6C] */ TNSZ("vpunpcklqdq",VEX_RMrX,16),TNSZ("vpunpckhqdq",VEX_RMrX,16),TNSZ("vmovd",VEX_MX,4),TNSZ("vmovdqa",VEX_MX,16), + +/* [70] */ TNSZ("vpshufd",VEX_MXI,16), TNSZ("vgrp71",VEX_XXI,16), TNSZ("vgrp72",VEX_XXI,16), TNSZ("vgrp73",VEX_XXI,16), +/* [74] */ TNSZ("vpcmpeqb",VEX_RMrX,16), TNSZ("vpcmpeqw",VEX_RMrX,16), TNSZ("vpcmpeqd",VEX_RMrX,16), INVALID, +/* [78] */ INVALID, INVALID, INVALID, INVALID, +/* [7C] */ TNSZ("vhaddpd",VEX_RMrX,16), TNSZ("vhsubpd",VEX_RMrX,16), TNSZ("vmovd",VEX_RR,4), TNSZ("vmovdqa",VEX_RX,16), + +/* [80] */ INVALID, INVALID, INVALID, INVALID, +/* [84] */ INVALID, INVALID, INVALID, INVALID, +/* [88] */ INVALID, INVALID, INVALID, INVALID, +/* [8C] */ INVALID, INVALID, INVALID, INVALID, + +/* [90] */ INVALID, INVALID, INVALID, INVALID, +/* [94] */ INVALID, INVALID, INVALID, INVALID, +/* [98] */ INVALID, INVALID, INVALID, INVALID, +/* [9C] */ INVALID, INVALID, INVALID, INVALID, + +/* [A0] */ INVALID, INVALID, INVALID, INVALID, +/* [A4] */ INVALID, INVALID, INVALID, INVALID, +/* [A8] */ INVALID, INVALID, INVALID, INVALID, +/* [AC] */ INVALID, INVALID, INVALID, INVALID, + +/* [B0] */ INVALID, INVALID, INVALID, INVALID, +/* [B4] */ INVALID, INVALID, INVALID, INVALID, +/* [B8] */ INVALID, INVALID, INVALID, INVALID, +/* [BC] */ INVALID, INVALID, INVALID, INVALID, + +/* [C0] */ INVALID, INVALID, TNSZ("vcmppd",VEX_RMRX,16), INVALID, +/* [C4] */ TNSZ("vpinsrw",VEX_RMRX,2),TNS("vpextrw",VEX_MR), TNSZ("vshufpd",VEX_RMRX,16), INVALID, +/* [C8] */ INVALID, INVALID, INVALID, INVALID, +/* [CC] */ INVALID, INVALID, INVALID, INVALID, + +/* [D0] */ TNSZ("vaddsubpd",VEX_RMrX,16),TNSZ("vpsrlw",VEX_RMrX,16), TNSZ("vpsrld",VEX_RMrX,16), TNSZ("vpsrlq",VEX_RMrX,16), +/* [D4] */ TNSZ("vpaddq",VEX_RMrX,16), TNSZ("vpmullw",VEX_RMrX,16), TNSZ("vmovq",VEX_RX,8), TNS("vpmovmskb",VEX_MR), +/* [D8] */ TNSZ("vpsubusb",VEX_RMrX,16), TNSZ("vpsubusw",VEX_RMrX,16), TNSZ("vpminub",VEX_RMrX,16), TNSZ("vpand",VEX_RMrX,16), +/* [DC] */ TNSZ("vpaddusb",VEX_RMrX,16), TNSZ("vpaddusw",VEX_RMrX,16), TNSZ("vpmaxub",VEX_RMrX,16), TNSZ("vpandn",VEX_RMrX,16), + +/* [E0] */ TNSZ("vpavgb",VEX_RMrX,16), TNSZ("vpsraw",VEX_RMrX,16), TNSZ("vpsrad",VEX_RMrX,16), TNSZ("vpavgw",VEX_RMrX,16), +/* [E4] */ TNSZ("vpmulhuw",VEX_RMrX,16), TNSZ("vpmulhw",VEX_RMrX,16), TNSZ("vcvttpd2dq",VEX_MX,16),TNSZ("vmovntdq",VEX_RM,16), +/* [E8] */ TNSZ("vpsubsb",VEX_RMrX,16), TNSZ("vpsubsw",VEX_RMrX,16), TNSZ("vpminsw",VEX_RMrX,16), TNSZ("vpor",VEX_RMrX,16), +/* [EC] */ TNSZ("vpaddsb",VEX_RMrX,16), TNSZ("vpaddsw",VEX_RMrX,16), TNSZ("vpmaxsw",VEX_RMrX,16), TNSZ("vpxor",VEX_RMrX,16), + +/* [F0] */ INVALID, TNSZ("vpsllw",VEX_RMrX,16), TNSZ("vpslld",VEX_RMrX,16), TNSZ("vpsllq",VEX_RMrX,16), +/* [F4] */ TNSZ("vpmuludq",VEX_RMrX,16), TNSZ("vpmaddwd",VEX_RMrX,16), TNSZ("vpsadbw",VEX_RMrX,16), TNS("vmaskmovdqu",VEX_MX), +/* [F8] */ TNSZ("vpsubb",VEX_RMrX,16), TNSZ("vpsubw",VEX_RMrX,16), TNSZ("vpsubd",VEX_RMrX,16), TNSZ("vpsubq",VEX_RMrX,16), +/* [FC] */ TNSZ("vpaddb",VEX_RMrX,16), TNSZ("vpaddw",VEX_RMrX,16), TNSZ("vpaddd",VEX_RMrX,16), INVALID, +}; + /* * Decode table for SIMD instructions with the repnz (0xf2) prefix. */ @@ -647,7 +775,7 @@ const instable_t dis_opSIMDrepnz[256] = { /* [20] */ INVALID, INVALID, INVALID, INVALID, /* [24] */ INVALID, INVALID, INVALID, INVALID, -/* [28] */ INVALID, INVALID, TNSZ("cvtsi2sd",XMM3MX,4),INVALID, +/* [28] */ INVALID, INVALID, TNSZ("cvtsi2sd",XMM3MX,4),TNSZ("movntsd",XMMMS,8), /* [2C] */ TNSZ("cvttsd2si",XMMXM3,8),TNSZ("cvtsd2si",XMMXM3,8),INVALID, INVALID, /* [30] */ INVALID, INVALID, INVALID, INVALID, @@ -672,7 +800,7 @@ const instable_t dis_opSIMDrepnz[256] = { /* [70] */ TNSZ("pshuflw",XMMP,16),INVALID, INVALID, INVALID, /* [74] */ INVALID, INVALID, INVALID, INVALID, -/* [78] */ INVALID, INVALID, INVALID, INVALID, +/* [78] */ TNSZ("insertq",XMMX2I,16),TNSZ("insertq",XMM,8),INVALID, INVALID, /* [7C] */ INVALID, INVALID, INVALID, INVALID, /* [80] */ INVALID, INVALID, INVALID, INVALID, @@ -716,6 +844,88 @@ const instable_t dis_opSIMDrepnz[256] = { /* [FC] */ INVALID, INVALID, INVALID, INVALID, }; +const instable_t dis_opAVXF20F[256] = { +/* [00] */ INVALID, INVALID, INVALID, INVALID, +/* [04] */ INVALID, INVALID, INVALID, INVALID, +/* [08] */ INVALID, INVALID, INVALID, INVALID, +/* [0C] */ INVALID, INVALID, INVALID, INVALID, + +/* [10] */ TNSZ("vmovsd",VEX_RMrX,8), TNSZ("vmovsd",VEX_RRX,8), TNSZ("vmovddup",VEX_MX,8), INVALID, +/* [14] */ INVALID, INVALID, INVALID, INVALID, +/* [18] */ INVALID, INVALID, INVALID, INVALID, +/* [1C] */ INVALID, INVALID, INVALID, INVALID, + +/* [20] */ INVALID, INVALID, INVALID, INVALID, +/* [24] */ INVALID, INVALID, INVALID, INVALID, +/* [28] */ INVALID, INVALID, TNSZ("vcvtsi2sd",VEX_RMrX,4),INVALID, +/* [2C] */ TNSZ("vcvttsd2si",VEX_MR,8),TNSZ("vcvtsd2si",VEX_MR,8),INVALID, INVALID, + +/* [30] */ INVALID, INVALID, INVALID, INVALID, +/* [34] */ INVALID, INVALID, INVALID, INVALID, +/* [38] */ INVALID, INVALID, INVALID, INVALID, +/* [3C] */ INVALID, INVALID, INVALID, INVALID, + +/* [40] */ INVALID, INVALID, INVALID, INVALID, +/* [44] */ INVALID, INVALID, INVALID, INVALID, +/* [48] */ INVALID, INVALID, INVALID, INVALID, +/* [4C] */ INVALID, INVALID, INVALID, INVALID, + +/* [50] */ INVALID, TNSZ("vsqrtsd",VEX_RMrX,8), INVALID, INVALID, +/* [54] */ INVALID, INVALID, INVALID, INVALID, +/* [58] */ TNSZ("vaddsd",VEX_RMrX,8), TNSZ("vmulsd",VEX_RMrX,8), TNSZ("vcvtsd2ss",VEX_RMrX,8), INVALID, +/* [5C] */ TNSZ("vsubsd",VEX_RMrX,8), TNSZ("vminsd",VEX_RMrX,8), TNSZ("vdivsd",VEX_RMrX,8), TNSZ("vmaxsd",VEX_RMrX,8), + +/* [60] */ INVALID, INVALID, INVALID, INVALID, +/* [64] */ INVALID, INVALID, INVALID, INVALID, +/* [68] */ INVALID, INVALID, INVALID, INVALID, +/* [6C] */ INVALID, INVALID, INVALID, INVALID, + +/* [70] */ TNSZ("vpshuflw",VEX_MXI,16),INVALID, INVALID, INVALID, +/* [74] */ INVALID, INVALID, INVALID, INVALID, +/* [78] */ INVALID, INVALID, INVALID, INVALID, +/* [7C] */ TNSZ("vhaddps",VEX_RMrX,8), TNSZ("vhsubps",VEX_RMrX,8), INVALID, INVALID, + +/* [80] */ INVALID, INVALID, INVALID, INVALID, +/* [84] */ INVALID, INVALID, INVALID, INVALID, +/* [88] */ INVALID, INVALID, INVALID, INVALID, +/* [0C] */ INVALID, INVALID, INVALID, INVALID, + +/* [90] */ INVALID, INVALID, INVALID, INVALID, +/* [94] */ INVALID, INVALID, INVALID, INVALID, +/* [98] */ INVALID, INVALID, INVALID, INVALID, +/* [9C] */ INVALID, INVALID, INVALID, INVALID, + +/* [A0] */ INVALID, INVALID, INVALID, INVALID, +/* [A4] */ INVALID, INVALID, INVALID, INVALID, +/* [A8] */ INVALID, INVALID, INVALID, INVALID, +/* [AC] */ INVALID, INVALID, INVALID, INVALID, + +/* [B0] */ INVALID, INVALID, INVALID, INVALID, +/* [B4] */ INVALID, INVALID, INVALID, INVALID, +/* [B8] */ INVALID, INVALID, INVALID, INVALID, +/* [BC] */ INVALID, INVALID, INVALID, INVALID, + +/* [C0] */ INVALID, INVALID, TNSZ("vcmpsd",VEX_RMRX,8), INVALID, +/* [C4] */ INVALID, INVALID, INVALID, INVALID, +/* [C8] */ INVALID, INVALID, INVALID, INVALID, +/* [CC] */ INVALID, INVALID, INVALID, INVALID, + +/* [D0] */ TNSZ("vaddsubps",VEX_RMrX,8), INVALID, INVALID, INVALID, +/* [D4] */ INVALID, INVALID, INVALID, INVALID, +/* [D8] */ INVALID, INVALID, INVALID, INVALID, +/* [DC] */ INVALID, INVALID, INVALID, INVALID, + +/* [E0] */ INVALID, INVALID, INVALID, INVALID, +/* [E4] */ INVALID, INVALID, TNSZ("vcvtpd2dq",VEX_MX,16),INVALID, +/* [E8] */ INVALID, INVALID, INVALID, INVALID, +/* [EC] */ INVALID, INVALID, INVALID, INVALID, + +/* [F0] */ TNSZ("vlddqu",VEX_MX,16), INVALID, INVALID, INVALID, +/* [F4] */ INVALID, INVALID, INVALID, INVALID, +/* [F8] */ INVALID, INVALID, INVALID, INVALID, +/* [FC] */ INVALID, INVALID, INVALID, INVALID, +}; + /* * Decode table for SIMD instructions with the repz (0xf3) prefix. */ @@ -732,7 +942,7 @@ const instable_t dis_opSIMDrepz[256] = { /* [20] */ INVALID, INVALID, INVALID, INVALID, /* [24] */ INVALID, INVALID, INVALID, INVALID, -/* [28] */ INVALID, INVALID, TNSZ("cvtsi2ss",XMM3MX,4),INVALID, +/* [28] */ INVALID, INVALID, TNSZ("cvtsi2ss",XMM3MX,4),TNSZ("movntss",XMMMS,4), /* [2C] */ TNSZ("cvttss2si",XMMXM3,4),TNSZ("cvtss2si",XMMXM3,4),INVALID, INVALID, /* [30] */ INVALID, INVALID, INVALID, INVALID, @@ -777,8 +987,8 @@ const instable_t dis_opSIMDrepz[256] = { /* [B0] */ INVALID, INVALID, INVALID, INVALID, /* [B4] */ INVALID, INVALID, INVALID, INVALID, -/* [B8] */ INVALID, INVALID, INVALID, INVALID, -/* [BC] */ INVALID, INVALID, INVALID, INVALID, +/* [B8] */ TS("popcnt",MRw), INVALID, INVALID, INVALID, +/* [BC] */ INVALID, TS("lzcnt",MRw), INVALID, INVALID, /* [C0] */ INVALID, INVALID, TNSZ("cmpss",XMMP,4), INVALID, /* [C4] */ INVALID, INVALID, INVALID, INVALID, @@ -801,6 +1011,427 @@ const instable_t dis_opSIMDrepz[256] = { /* [FC] */ INVALID, INVALID, INVALID, INVALID, }; +const instable_t dis_opAVXF30F[256] = { +/* [00] */ INVALID, INVALID, INVALID, INVALID, +/* [04] */ INVALID, INVALID, INVALID, INVALID, +/* [08] */ INVALID, INVALID, INVALID, INVALID, +/* [0C] */ INVALID, INVALID, INVALID, INVALID, + +/* [10] */ TNSZ("vmovss",VEX_RMrX,4), TNSZ("vmovss",VEX_RRX,4), TNSZ("vmovsldup",VEX_MX,4), INVALID, +/* [14] */ INVALID, INVALID, TNSZ("vmovshdup",VEX_MX,4), INVALID, +/* [18] */ INVALID, INVALID, INVALID, INVALID, +/* [1C] */ INVALID, INVALID, INVALID, INVALID, + +/* [20] */ INVALID, INVALID, INVALID, INVALID, +/* [24] */ INVALID, INVALID, INVALID, INVALID, +/* [28] */ INVALID, INVALID, TNSZ("vcvtsi2ss",VEX_RMrX,4),INVALID, +/* [2C] */ TNSZ("vcvttss2si",VEX_MR,4),TNSZ("vcvtss2si",VEX_MR,4),INVALID, INVALID, + +/* [30] */ INVALID, INVALID, INVALID, INVALID, +/* [34] */ INVALID, INVALID, INVALID, INVALID, +/* [38] */ INVALID, INVALID, INVALID, INVALID, +/* [3C] */ INVALID, INVALID, INVALID, INVALID, + +/* [40] */ INVALID, INVALID, INVALID, INVALID, +/* [44] */ INVALID, INVALID, INVALID, INVALID, +/* [48] */ INVALID, INVALID, INVALID, INVALID, +/* [4C] */ INVALID, INVALID, INVALID, INVALID, + +/* [50] */ INVALID, TNSZ("vsqrtss",VEX_RMrX,4), TNSZ("vrsqrtss",VEX_RMrX,4), TNSZ("vrcpss",VEX_RMrX,4), +/* [54] */ INVALID, INVALID, INVALID, INVALID, +/* [58] */ TNSZ("vaddss",VEX_RMrX,4), TNSZ("vmulss",VEX_RMrX,4), TNSZ("vcvtss2sd",VEX_RMrX,4), TNSZ("vcvttps2dq",VEX_MX,16), +/* [5C] */ TNSZ("vsubss",VEX_RMrX,4), TNSZ("vminss",VEX_RMrX,4), TNSZ("vdivss",VEX_RMrX,4), TNSZ("vmaxss",VEX_RMrX,4), + +/* [60] */ INVALID, INVALID, INVALID, INVALID, +/* [64] */ INVALID, INVALID, INVALID, INVALID, +/* [68] */ INVALID, INVALID, INVALID, INVALID, +/* [6C] */ INVALID, INVALID, INVALID, TNSZ("vmovdqu",VEX_MX,16), + +/* [70] */ TNSZ("vpshufhw",VEX_MXI,16),INVALID, INVALID, INVALID, +/* [74] */ INVALID, INVALID, INVALID, INVALID, +/* [78] */ INVALID, INVALID, INVALID, INVALID, +/* [7C] */ INVALID, INVALID, TNSZ("vmovq",VEX_MX,8), TNSZ("vmovdqu",VEX_RX,16), + +/* [80] */ INVALID, INVALID, INVALID, INVALID, +/* [84] */ INVALID, INVALID, INVALID, INVALID, +/* [88] */ INVALID, INVALID, INVALID, INVALID, +/* [0C] */ INVALID, INVALID, INVALID, INVALID, + +/* [90] */ INVALID, INVALID, INVALID, INVALID, +/* [94] */ INVALID, INVALID, INVALID, INVALID, +/* [98] */ INVALID, INVALID, INVALID, INVALID, +/* [9C] */ INVALID, INVALID, INVALID, INVALID, + +/* [A0] */ INVALID, INVALID, INVALID, INVALID, +/* [A4] */ INVALID, INVALID, INVALID, INVALID, +/* [A8] */ INVALID, INVALID, INVALID, INVALID, +/* [AC] */ INVALID, INVALID, INVALID, INVALID, + +/* [B0] */ INVALID, INVALID, INVALID, INVALID, +/* [B4] */ INVALID, INVALID, INVALID, INVALID, +/* [B8] */ INVALID, INVALID, INVALID, INVALID, +/* [BC] */ INVALID, INVALID, INVALID, INVALID, + +/* [C0] */ INVALID, INVALID, TNSZ("vcmpss",VEX_RMRX,4), INVALID, +/* [C4] */ INVALID, INVALID, INVALID, INVALID, +/* [C8] */ INVALID, INVALID, INVALID, INVALID, +/* [CC] */ INVALID, INVALID, INVALID, INVALID, + +/* [D0] */ INVALID, INVALID, INVALID, INVALID, +/* [D4] */ INVALID, INVALID, INVALID, INVALID, +/* [D8] */ INVALID, INVALID, INVALID, INVALID, +/* [DC] */ INVALID, INVALID, INVALID, INVALID, + +/* [E0] */ INVALID, INVALID, INVALID, INVALID, +/* [E4] */ INVALID, INVALID, TNSZ("vcvtdq2pd",VEX_MX,8), INVALID, +/* [E8] */ INVALID, INVALID, INVALID, INVALID, +/* [EC] */ INVALID, INVALID, INVALID, INVALID, + +/* [F0] */ INVALID, INVALID, INVALID, INVALID, +/* [F4] */ INVALID, INVALID, INVALID, INVALID, +/* [F8] */ INVALID, INVALID, INVALID, INVALID, +/* [FC] */ INVALID, INVALID, INVALID, INVALID, +}; +/* + * The following two tables are used to encode crc32 and movbe + * since they share the same opcodes. + */ +const instable_t dis_op0F38F0[2] = { +/* [00] */ TNS("crc32b",CRC32), + TS("movbe",MOVBE), +}; + +const instable_t dis_op0F38F1[2] = { +/* [00] */ TS("crc32",CRC32), + TS("movbe",MOVBE), +}; + +const instable_t dis_op0F38[256] = { +/* [00] */ TNSZ("pshufb",XMM_66o,16),TNSZ("phaddw",XMM_66o,16),TNSZ("phaddd",XMM_66o,16),TNSZ("phaddsw",XMM_66o,16), +/* [04] */ TNSZ("pmaddubsw",XMM_66o,16),TNSZ("phsubw",XMM_66o,16), TNSZ("phsubd",XMM_66o,16),TNSZ("phsubsw",XMM_66o,16), +/* [08] */ TNSZ("psignb",XMM_66o,16),TNSZ("psignw",XMM_66o,16),TNSZ("psignd",XMM_66o,16),TNSZ("pmulhrsw",XMM_66o,16), +/* [0C] */ INVALID, INVALID, INVALID, INVALID, + +/* [10] */ TNSZ("pblendvb",XMM_66r,16),INVALID, INVALID, INVALID, +/* [14] */ TNSZ("blendvps",XMM_66r,16),TNSZ("blendvpd",XMM_66r,16),INVALID, TNSZ("ptest",XMM_66r,16), +/* [18] */ INVALID, INVALID, INVALID, INVALID, +/* [1C] */ TNSZ("pabsb",XMM_66o,16),TNSZ("pabsw",XMM_66o,16),TNSZ("pabsd",XMM_66o,16),INVALID, + +/* [20] */ TNSZ("pmovsxbw",XMM_66r,16),TNSZ("pmovsxbd",XMM_66r,16),TNSZ("pmovsxbq",XMM_66r,16),TNSZ("pmovsxwd",XMM_66r,16), +/* [24] */ TNSZ("pmovsxwq",XMM_66r,16),TNSZ("pmovsxdq",XMM_66r,16),INVALID, INVALID, +/* [28] */ TNSZ("pmuldq",XMM_66r,16),TNSZ("pcmpeqq",XMM_66r,16),TNSZ("movntdqa",XMMM_66r,16),TNSZ("packusdw",XMM_66r,16), +/* [2C] */ INVALID, INVALID, INVALID, INVALID, + +/* [30] */ TNSZ("pmovzxbw",XMM_66r,16),TNSZ("pmovzxbd",XMM_66r,16),TNSZ("pmovzxbq",XMM_66r,16),TNSZ("pmovzxwd",XMM_66r,16), +/* [34] */ TNSZ("pmovzxwq",XMM_66r,16),TNSZ("pmovzxdq",XMM_66r,16),INVALID, TNSZ("pcmpgtq",XMM_66r,16), +/* [38] */ TNSZ("pminsb",XMM_66r,16),TNSZ("pminsd",XMM_66r,16),TNSZ("pminuw",XMM_66r,16),TNSZ("pminud",XMM_66r,16), +/* [3C] */ TNSZ("pmaxsb",XMM_66r,16),TNSZ("pmaxsd",XMM_66r,16),TNSZ("pmaxuw",XMM_66r,16),TNSZ("pmaxud",XMM_66r,16), + +/* [40] */ TNSZ("pmulld",XMM_66r,16),TNSZ("phminposuw",XMM_66r,16),INVALID, INVALID, +/* [44] */ INVALID, INVALID, INVALID, INVALID, +/* [48] */ INVALID, INVALID, INVALID, INVALID, +/* [4C] */ INVALID, INVALID, INVALID, INVALID, + +/* [50] */ INVALID, INVALID, INVALID, INVALID, +/* [54] */ INVALID, INVALID, INVALID, INVALID, +/* [58] */ INVALID, INVALID, INVALID, INVALID, +/* [5C] */ INVALID, INVALID, INVALID, INVALID, + +/* [60] */ INVALID, INVALID, INVALID, INVALID, +/* [64] */ INVALID, INVALID, INVALID, INVALID, +/* [68] */ INVALID, INVALID, INVALID, INVALID, +/* [6C] */ INVALID, INVALID, INVALID, INVALID, + +/* [70] */ INVALID, INVALID, INVALID, INVALID, +/* [74] */ INVALID, INVALID, INVALID, INVALID, +/* [78] */ INVALID, INVALID, INVALID, INVALID, +/* [7C] */ INVALID, INVALID, INVALID, INVALID, + +/* [80] */ INVALID, INVALID, INVALID, INVALID, +/* [84] */ INVALID, INVALID, INVALID, INVALID, +/* [88] */ INVALID, INVALID, INVALID, INVALID, +/* [8C] */ INVALID, INVALID, INVALID, INVALID, + +/* [90] */ INVALID, INVALID, INVALID, INVALID, +/* [94] */ INVALID, INVALID, INVALID, INVALID, +/* [98] */ INVALID, INVALID, INVALID, INVALID, +/* [9C] */ INVALID, INVALID, INVALID, INVALID, + +/* [A0] */ INVALID, INVALID, INVALID, INVALID, +/* [A4] */ INVALID, INVALID, INVALID, INVALID, +/* [A8] */ INVALID, INVALID, INVALID, INVALID, +/* [AC] */ INVALID, INVALID, INVALID, INVALID, + +/* [B0] */ INVALID, INVALID, INVALID, INVALID, +/* [B4] */ INVALID, INVALID, INVALID, INVALID, +/* [B8] */ INVALID, INVALID, INVALID, INVALID, +/* [BC] */ INVALID, INVALID, INVALID, INVALID, + +/* [C0] */ INVALID, INVALID, INVALID, INVALID, +/* [C4] */ INVALID, INVALID, INVALID, INVALID, +/* [C8] */ INVALID, INVALID, INVALID, INVALID, +/* [CC] */ INVALID, INVALID, INVALID, INVALID, + +/* [D0] */ INVALID, INVALID, INVALID, INVALID, +/* [D4] */ INVALID, INVALID, INVALID, INVALID, +/* [D8] */ INVALID, INVALID, INVALID, TNSZ("aesimc",XMM_66r,16), +/* [DC] */ TNSZ("aesenc",XMM_66r,16),TNSZ("aesenclast",XMM_66r,16),TNSZ("aesdec",XMM_66r,16),TNSZ("aesdeclast",XMM_66r,16), + +/* [E0] */ INVALID, INVALID, INVALID, INVALID, +/* [E4] */ INVALID, INVALID, INVALID, INVALID, +/* [E8] */ INVALID, INVALID, INVALID, INVALID, +/* [EC] */ INVALID, INVALID, INVALID, INVALID, +/* [F0] */ IND(dis_op0F38F0), IND(dis_op0F38F1), INVALID, INVALID, +/* [F4] */ INVALID, INVALID, INVALID, INVALID, +/* [F8] */ INVALID, INVALID, INVALID, INVALID, +/* [FC] */ INVALID, INVALID, INVALID, INVALID, +}; + +const instable_t dis_opAVX660F38[256] = { +/* [00] */ TNSZ("vpshufb",VEX_RMrX,16),TNSZ("vphaddw",VEX_RMrX,16),TNSZ("vphaddd",VEX_RMrX,16),TNSZ("vphaddsw",VEX_RMrX,16), +/* [04] */ TNSZ("vpmaddubsw",VEX_RMrX,16),TNSZ("vphsubw",VEX_RMrX,16), TNSZ("vphsubd",VEX_RMrX,16),TNSZ("vphsubsw",VEX_RMrX,16), +/* [08] */ TNSZ("vpsignb",VEX_RMrX,16),TNSZ("vpsignw",VEX_RMrX,16),TNSZ("vpsignd",VEX_RMrX,16),TNSZ("vpmulhrsw",VEX_RMrX,16), +/* [0C] */ TNSZ("vpermilps",VEX_RMrX,8),TNSZ("vpermilpd",VEX_RMrX,16),TNSZ("vtestps",VEX_RRI,8), TNSZ("vtestpd",VEX_RRI,16), + +/* [10] */ INVALID, INVALID, INVALID, INVALID, +/* [14] */ INVALID, INVALID, INVALID, TNSZ("vptest",VEX_RRI,16), +/* [18] */ TNSZ("vbroadcastss",VEX_MX,4),TNSZ("vbroadcastsd",VEX_MX,8),TNSZ("vbroadcastf128",VEX_MX,16),INVALID, +/* [1C] */ TNSZ("vpabsb",VEX_MX,16),TNSZ("vpabsw",VEX_MX,16),TNSZ("vpabsd",VEX_MX,16),INVALID, + +/* [20] */ TNSZ("vpmovsxbw",VEX_MX,16),TNSZ("vpmovsxbd",VEX_MX,16),TNSZ("vpmovsxbq",VEX_MX,16),TNSZ("vpmovsxwd",VEX_MX,16), +/* [24] */ TNSZ("vpmovsxwq",VEX_MX,16),TNSZ("vpmovsxdq",VEX_MX,16),INVALID, INVALID, +/* [28] */ TNSZ("vpmuldq",VEX_RMrX,16),TNSZ("vpcmpeqq",VEX_RMrX,16),TNSZ("vmovntdqa",VEX_MX,16),TNSZ("vpackusdw",VEX_RMrX,16), +/* [2C] */ TNSZ("vmaskmovps",VEX_RMrX,8),TNSZ("vmaskmovpd",VEX_RMrX,16),TNSZ("vmaskmovps",VEX_RRM,8),TNSZ("vmaskmovpd",VEX_RRM,16), + +/* [30] */ TNSZ("vpmovzxbw",VEX_MX,16),TNSZ("vpmovzxbd",VEX_MX,16),TNSZ("vpmovzxbq",VEX_MX,16),TNSZ("vpmovzxwd",VEX_MX,16), +/* [34] */ TNSZ("vpmovzxwq",VEX_MX,16),TNSZ("vpmovzxdq",VEX_MX,16),INVALID, TNSZ("vpcmpgtq",VEX_RMrX,16), +/* [38] */ TNSZ("vpminsb",VEX_RMrX,16),TNSZ("vpminsd",VEX_RMrX,16),TNSZ("vpminuw",VEX_RMrX,16),TNSZ("vpminud",VEX_RMrX,16), +/* [3C] */ TNSZ("vpmaxsb",VEX_RMrX,16),TNSZ("vpmaxsd",VEX_RMrX,16),TNSZ("vpmaxuw",VEX_RMrX,16),TNSZ("vpmaxud",VEX_RMrX,16), + +/* [40] */ TNSZ("vpmulld",VEX_RMrX,16),TNSZ("vphminposuw",VEX_MX,16),INVALID, INVALID, +/* [44] */ INVALID, INVALID, INVALID, INVALID, +/* [48] */ INVALID, INVALID, INVALID, INVALID, +/* [4C] */ INVALID, INVALID, INVALID, INVALID, + +/* [50] */ INVALID, INVALID, INVALID, INVALID, +/* [54] */ INVALID, INVALID, INVALID, INVALID, +/* [58] */ INVALID, INVALID, INVALID, INVALID, +/* [5C] */ INVALID, INVALID, INVALID, INVALID, + +/* [60] */ INVALID, INVALID, INVALID, INVALID, +/* [64] */ INVALID, INVALID, INVALID, INVALID, +/* [68] */ INVALID, INVALID, INVALID, INVALID, +/* [6C] */ INVALID, INVALID, INVALID, INVALID, + +/* [70] */ INVALID, INVALID, INVALID, INVALID, +/* [74] */ INVALID, INVALID, INVALID, INVALID, +/* [78] */ INVALID, INVALID, INVALID, INVALID, +/* [7C] */ INVALID, INVALID, INVALID, INVALID, + +/* [80] */ INVALID, INVALID, INVALID, INVALID, +/* [84] */ INVALID, INVALID, INVALID, INVALID, +/* [88] */ INVALID, INVALID, INVALID, INVALID, +/* [8C] */ INVALID, INVALID, INVALID, INVALID, + +/* [90] */ INVALID, INVALID, INVALID, INVALID, +/* [94] */ INVALID, INVALID, INVALID, INVALID, +/* [98] */ INVALID, INVALID, INVALID, INVALID, +/* [9C] */ INVALID, INVALID, INVALID, INVALID, + +/* [A0] */ INVALID, INVALID, INVALID, INVALID, +/* [A4] */ INVALID, INVALID, INVALID, INVALID, +/* [A8] */ INVALID, INVALID, INVALID, INVALID, +/* [AC] */ INVALID, INVALID, INVALID, INVALID, + +/* [B0] */ INVALID, INVALID, INVALID, INVALID, +/* [B4] */ INVALID, INVALID, INVALID, INVALID, +/* [B8] */ INVALID, INVALID, INVALID, INVALID, +/* [BC] */ INVALID, INVALID, INVALID, INVALID, + +/* [C0] */ INVALID, INVALID, INVALID, INVALID, +/* [C4] */ INVALID, INVALID, INVALID, INVALID, +/* [C8] */ INVALID, INVALID, INVALID, INVALID, +/* [CC] */ INVALID, INVALID, INVALID, INVALID, + +/* [D0] */ INVALID, INVALID, INVALID, INVALID, +/* [D4] */ INVALID, INVALID, INVALID, INVALID, +/* [D8] */ INVALID, INVALID, INVALID, TNSZ("vaesimc",VEX_MX,16), +/* [DC] */ TNSZ("vaesenc",VEX_RMrX,16),TNSZ("vaesenclast",VEX_RMrX,16),TNSZ("vaesdec",VEX_RMrX,16),TNSZ("vaesdeclast",VEX_RMrX,16), + +/* [E0] */ INVALID, INVALID, INVALID, INVALID, +/* [E4] */ INVALID, INVALID, INVALID, INVALID, +/* [E8] */ INVALID, INVALID, INVALID, INVALID, +/* [EC] */ INVALID, INVALID, INVALID, INVALID, +/* [F0] */ IND(dis_op0F38F0), IND(dis_op0F38F1), INVALID, INVALID, +/* [F4] */ INVALID, INVALID, INVALID, INVALID, +/* [F8] */ INVALID, INVALID, INVALID, INVALID, +/* [FC] */ INVALID, INVALID, INVALID, INVALID, +}; + +const instable_t dis_op0F3A[256] = { +/* [00] */ INVALID, INVALID, INVALID, INVALID, +/* [04] */ INVALID, INVALID, INVALID, INVALID, +/* [08] */ TNSZ("roundps",XMMP_66r,16),TNSZ("roundpd",XMMP_66r,16),TNSZ("roundss",XMMP_66r,16),TNSZ("roundsd",XMMP_66r,16), +/* [0C] */ TNSZ("blendps",XMMP_66r,16),TNSZ("blendpd",XMMP_66r,16),TNSZ("pblendw",XMMP_66r,16),TNSZ("palignr",XMMP_66o,16), + +/* [10] */ INVALID, INVALID, INVALID, INVALID, +/* [14] */ TNSZ("pextrb",XMM3PM_66r,8),TNSZ("pextrw",XMM3PM_66r,16),TSZ("pextr",XMM3PM_66r,16),TNSZ("extractps",XMM3PM_66r,16), +/* [18] */ INVALID, INVALID, INVALID, INVALID, +/* [1C] */ INVALID, INVALID, INVALID, INVALID, + +/* [20] */ TNSZ("pinsrb",XMMPRM_66r,8),TNSZ("insertps",XMMP_66r,16),TSZ("pinsr",XMMPRM_66r,16),INVALID, +/* [24] */ INVALID, INVALID, INVALID, INVALID, +/* [28] */ INVALID, INVALID, INVALID, INVALID, +/* [2C] */ INVALID, INVALID, INVALID, INVALID, + +/* [30] */ INVALID, INVALID, INVALID, INVALID, +/* [34] */ INVALID, INVALID, INVALID, INVALID, +/* [38] */ INVALID, INVALID, INVALID, INVALID, +/* [3C] */ INVALID, INVALID, INVALID, INVALID, + +/* [40] */ TNSZ("dpps",XMMP_66r,16),TNSZ("dppd",XMMP_66r,16),TNSZ("mpsadbw",XMMP_66r,16),INVALID, +/* [44] */ TNSZ("pclmulqdq",XMMP_66r,16),INVALID, INVALID, INVALID, +/* [48] */ INVALID, INVALID, INVALID, INVALID, +/* [4C] */ INVALID, INVALID, INVALID, INVALID, + +/* [50] */ INVALID, INVALID, INVALID, INVALID, +/* [54] */ INVALID, INVALID, INVALID, INVALID, +/* [58] */ INVALID, INVALID, INVALID, INVALID, +/* [5C] */ INVALID, INVALID, INVALID, INVALID, + +/* [60] */ TNSZ("pcmpestrm",XMMP_66r,16),TNSZ("pcmpestri",XMMP_66r,16),TNSZ("pcmpistrm",XMMP_66r,16),TNSZ("pcmpistri",XMMP_66r,16), +/* [64] */ INVALID, INVALID, INVALID, INVALID, +/* [68] */ INVALID, INVALID, INVALID, INVALID, +/* [6C] */ INVALID, INVALID, INVALID, INVALID, + +/* [70] */ INVALID, INVALID, INVALID, INVALID, +/* [74] */ INVALID, INVALID, INVALID, INVALID, +/* [78] */ INVALID, INVALID, INVALID, INVALID, +/* [7C] */ INVALID, INVALID, INVALID, INVALID, + +/* [80] */ INVALID, INVALID, INVALID, INVALID, +/* [84] */ INVALID, INVALID, INVALID, INVALID, +/* [88] */ INVALID, INVALID, INVALID, INVALID, +/* [8C] */ INVALID, INVALID, INVALID, INVALID, + +/* [90] */ INVALID, INVALID, INVALID, INVALID, +/* [94] */ INVALID, INVALID, INVALID, INVALID, +/* [98] */ INVALID, INVALID, INVALID, INVALID, +/* [9C] */ INVALID, INVALID, INVALID, INVALID, + +/* [A0] */ INVALID, INVALID, INVALID, INVALID, +/* [A4] */ INVALID, INVALID, INVALID, INVALID, +/* [A8] */ INVALID, INVALID, INVALID, INVALID, +/* [AC] */ INVALID, INVALID, INVALID, INVALID, + +/* [B0] */ INVALID, INVALID, INVALID, INVALID, +/* [B4] */ INVALID, INVALID, INVALID, INVALID, +/* [B8] */ INVALID, INVALID, INVALID, INVALID, +/* [BC] */ INVALID, INVALID, INVALID, INVALID, + +/* [C0] */ INVALID, INVALID, INVALID, INVALID, +/* [C4] */ INVALID, INVALID, INVALID, INVALID, +/* [C8] */ INVALID, INVALID, INVALID, INVALID, +/* [CC] */ INVALID, INVALID, INVALID, INVALID, + +/* [D0] */ INVALID, INVALID, INVALID, INVALID, +/* [D4] */ INVALID, INVALID, INVALID, INVALID, +/* [D8] */ INVALID, INVALID, INVALID, INVALID, +/* [DC] */ INVALID, INVALID, INVALID, TNSZ("aeskeygenassist",XMMP_66r,16), + +/* [E0] */ INVALID, INVALID, INVALID, INVALID, +/* [E4] */ INVALID, INVALID, INVALID, INVALID, +/* [E8] */ INVALID, INVALID, INVALID, INVALID, +/* [EC] */ INVALID, INVALID, INVALID, INVALID, + +/* [F0] */ INVALID, INVALID, INVALID, INVALID, +/* [F4] */ INVALID, INVALID, INVALID, INVALID, +/* [F8] */ INVALID, INVALID, INVALID, INVALID, +/* [FC] */ INVALID, INVALID, INVALID, INVALID, +}; + +const instable_t dis_opAVX660F3A[256] = { +/* [00] */ INVALID, INVALID, INVALID, INVALID, +/* [04] */ TNSZ("vpermilps",VEX_MXI,8),TNSZ("vpermilpd",VEX_MXI,16),TNSZ("vperm2f128",VEX_RMRX,16),INVALID, +/* [08] */ TNSZ("vroundps",VEX_MXI,16),TNSZ("vroundpd",VEX_MXI,16),TNSZ("vroundss",VEX_RMRX,16),TNSZ("vroundsd",VEX_RMRX,16), +/* [0C] */ TNSZ("vblendps",VEX_RMRX,16),TNSZ("vblendpd",VEX_RMRX,16),TNSZ("vpblendw",VEX_RMRX,16),TNSZ("vpalignr",VEX_RMRX,16), + +/* [10] */ INVALID, INVALID, INVALID, INVALID, +/* [14] */ TNSZ("vpextrb",VEX_RRi,8),TNSZ("vpextrw",VEX_RRi,16),TNSZ("vpextrd",VEX_RRi,16),TNSZ("vextractps",VEX_RM,16), +/* [18] */ TNSZ("vinsertf128",VEX_RMRX,16),TNSZ("vextractf128",VEX_RX,16),INVALID, INVALID, +/* [1C] */ INVALID, INVALID, INVALID, INVALID, + +/* [20] */ TNSZ("vpinsrb",VEX_RMRX,8),TNSZ("vinsertps",VEX_RMRX,16),TNSZ("vpinsrd",VEX_RMRX,16),INVALID, +/* [24] */ INVALID, INVALID, INVALID, INVALID, +/* [28] */ INVALID, INVALID, INVALID, INVALID, +/* [2C] */ INVALID, INVALID, INVALID, INVALID, + +/* [30] */ INVALID, INVALID, INVALID, INVALID, +/* [34] */ INVALID, INVALID, INVALID, INVALID, +/* [38] */ INVALID, INVALID, INVALID, INVALID, +/* [3C] */ INVALID, INVALID, INVALID, INVALID, + +/* [40] */ TNSZ("vdpps",VEX_RMRX,16),TNSZ("vdppd",VEX_RMRX,16),TNSZ("vmpsadbw",VEX_RMRX,16),INVALID, +/* [44] */ TNSZ("vpclmulqdq",VEX_RMRX,16),INVALID, INVALID, INVALID, +/* [48] */ INVALID, INVALID, TNSZ("vblendvps",VEX_RMRX,8), TNSZ("vblendvpd",VEX_RMRX,16), +/* [4C] */ TNSZ("vpblendvb",VEX_RMRX,16),INVALID, INVALID, INVALID, + +/* [50] */ INVALID, INVALID, INVALID, INVALID, +/* [54] */ INVALID, INVALID, INVALID, INVALID, +/* [58] */ INVALID, INVALID, INVALID, INVALID, +/* [5C] */ INVALID, INVALID, INVALID, INVALID, + +/* [60] */ TNSZ("vpcmpestrm",VEX_MXI,16),TNSZ("vpcmpestri",VEX_MXI,16),TNSZ("vpcmpistrm",VEX_MXI,16),TNSZ("vpcmpistri",VEX_MXI,16), +/* [64] */ INVALID, INVALID, INVALID, INVALID, +/* [68] */ INVALID, INVALID, INVALID, INVALID, +/* [6C] */ INVALID, INVALID, INVALID, INVALID, + +/* [70] */ INVALID, INVALID, INVALID, INVALID, +/* [74] */ INVALID, INVALID, INVALID, INVALID, +/* [78] */ INVALID, INVALID, INVALID, INVALID, +/* [7C] */ INVALID, INVALID, INVALID, INVALID, + +/* [80] */ INVALID, INVALID, INVALID, INVALID, +/* [84] */ INVALID, INVALID, INVALID, INVALID, +/* [88] */ INVALID, INVALID, INVALID, INVALID, +/* [8C] */ INVALID, INVALID, INVALID, INVALID, + +/* [90] */ INVALID, INVALID, INVALID, INVALID, +/* [94] */ INVALID, INVALID, INVALID, INVALID, +/* [98] */ INVALID, INVALID, INVALID, INVALID, +/* [9C] */ INVALID, INVALID, INVALID, INVALID, + +/* [A0] */ INVALID, INVALID, INVALID, INVALID, +/* [A4] */ INVALID, INVALID, INVALID, INVALID, +/* [A8] */ INVALID, INVALID, INVALID, INVALID, +/* [AC] */ INVALID, INVALID, INVALID, INVALID, + +/* [B0] */ INVALID, INVALID, INVALID, INVALID, +/* [B4] */ INVALID, INVALID, INVALID, INVALID, +/* [B8] */ INVALID, INVALID, INVALID, INVALID, +/* [BC] */ INVALID, INVALID, INVALID, INVALID, + +/* [C0] */ INVALID, INVALID, INVALID, INVALID, +/* [C4] */ INVALID, INVALID, INVALID, INVALID, +/* [C8] */ INVALID, INVALID, INVALID, INVALID, +/* [CC] */ INVALID, INVALID, INVALID, INVALID, + +/* [D0] */ INVALID, INVALID, INVALID, INVALID, +/* [D4] */ INVALID, INVALID, INVALID, INVALID, +/* [D8] */ INVALID, INVALID, INVALID, INVALID, +/* [DC] */ INVALID, INVALID, INVALID, TNSZ("vaeskeygenassist",VEX_MXI,16), + +/* [E0] */ INVALID, INVALID, INVALID, INVALID, +/* [E4] */ INVALID, INVALID, INVALID, INVALID, +/* [E8] */ INVALID, INVALID, INVALID, INVALID, +/* [EC] */ INVALID, INVALID, INVALID, INVALID, + +/* [F0] */ INVALID, INVALID, INVALID, INVALID, +/* [F4] */ INVALID, INVALID, INVALID, INVALID, +/* [F8] */ INVALID, INVALID, INVALID, INVALID, +/* [FC] */ INVALID, INVALID, INVALID, INVALID, +}; + /* * Decode table for 0x0F opcodes */ @@ -844,7 +1475,7 @@ const instable_t dis_op0F[16][16] = { }, { /* [70] */ TNSZ("pshufw",MMOPM,8), TNS("psrXXX",MR), TNS("psrXXX",MR), TNS("psrXXX",MR), /* [74] */ TNSZ("pcmpeqb",MMO,8), TNSZ("pcmpeqw",MMO,8), TNSZ("pcmpeqd",MMO,8), TNS("emms",NORM), -/* [78] */ INVALID, INVALID, INVALID, INVALID, +/* [78] */ TNS("INVALID",XMMO), TNS("INVALID",XMMO), INVALID, INVALID, /* [7C] */ INVALID, INVALID, TNSZ("movd",MMOS,4), TNSZ("movq",MMOS,8), }, { /* [80] */ TNS("jo",D), TNS("jno",D), TNS("jb",D), TNS("jae",D), @@ -864,7 +1495,7 @@ const instable_t dis_op0F[16][16] = { }, { /* [B0] */ TNS("cmpxchgb",RMw), TS("cmpxchg",RMw), TS("lss",MR), TS("btr",RMw), /* [B4] */ TS("lfs",MR), TS("lgs",MR), TS("movzb",MOVZ), TNS("movzwl",MOVZ), -/* [B8] */ INVALID, INVALID, IND(dis_op0FBA), TS("btc",RMw), +/* [B8] */ TNS("INVALID",MRw), INVALID, IND(dis_op0FBA), TS("btc",RMw), /* [BC] */ TS("bsf",MRw), TS("bsr",MRw), TS("movsb",MOVZ), TNS("movswl",MOVZ), }, { /* [C0] */ TNS("xaddb",XADDB), TS("xadd",RMw), TNSZ("cmpps",XMMOPM,16),TNS("movnti",RM), @@ -888,6 +1519,88 @@ const instable_t dis_op0F[16][16] = { /* [FC] */ TNSZ("paddb",MMO,8), TNSZ("paddw",MMO,8), TNSZ("paddd",MMO,8), INVALID, } }; +const instable_t dis_opAVX0F[16][16] = { +{ +/* [00] */ INVALID, INVALID, INVALID, INVALID, +/* [04] */ INVALID, INVALID, INVALID, INVALID, +/* [08] */ INVALID, INVALID, INVALID, INVALID, +/* [0C] */ INVALID, INVALID, INVALID, INVALID, +}, { +/* [10] */ TNSZ("vmovups",VEX_MX,16), TNSZ("vmovups",VEX_RM,16),TNSZ("vmovlps",VEX_RMrX,8), TNSZ("vmovlps",VEX_RM,8), +/* [14] */ TNSZ("vunpcklps",VEX_RMrX,16),TNSZ("vunpckhps",VEX_RMrX,16),TNSZ("vmovhps",VEX_RMrX,8),TNSZ("vmovhps",VEX_RM,8), +/* [18] */ INVALID, INVALID, INVALID, INVALID, +/* [1C] */ INVALID, INVALID, INVALID, INVALID, +}, { +/* [20] */ INVALID, INVALID, INVALID, INVALID, +/* [24] */ INVALID, INVALID, INVALID, INVALID, +/* [28] */ TNSZ("vmovaps",VEX_MX,16), TNSZ("vmovaps",VEX_RX,16),INVALID, TNSZ("vmovntps",VEX_RM,16), +/* [2C] */ INVALID, INVALID, TNSZ("vucomiss",VEX_MX,4),TNSZ("vcomiss",VEX_MX,4), +}, { +/* [30] */ INVALID, INVALID, INVALID, INVALID, +/* [34] */ INVALID, INVALID, INVALID, INVALID, +/* [38] */ INVALID, INVALID, INVALID, INVALID, +/* [3C] */ INVALID, INVALID, INVALID, INVALID, +}, { +/* [40] */ INVALID, INVALID, INVALID, INVALID, +/* [44] */ INVALID, INVALID, INVALID, INVALID, +/* [48] */ INVALID, INVALID, INVALID, INVALID, +/* [4C] */ INVALID, INVALID, INVALID, INVALID, +}, { +/* [50] */ TNS("vmovmskps",VEX_MR), TNSZ("vsqrtps",VEX_MX,16), TNSZ("vrsqrtps",VEX_MX,16),TNSZ("vrcpps",VEX_MX,16), +/* [54] */ TNSZ("vandps",VEX_RMrX,16), TNSZ("vandnps",VEX_RMrX,16), TNSZ("vorps",VEX_RMrX,16), TNSZ("vxorps",VEX_RMrX,16), +/* [58] */ TNSZ("vaddps",VEX_RMrX,16), TNSZ("vmulps",VEX_RMrX,16), TNSZ("vcvtps2pd",VEX_MX,8),TNSZ("vcvtdq2ps",VEX_MX,16), +/* [5C] */ TNSZ("vsubps",VEX_RMrX,16), TNSZ("vminps",VEX_RMrX,16), TNSZ("vdivps",VEX_RMrX,16), TNSZ("vmaxps",VEX_RMrX,16), +}, { +/* [60] */ INVALID, INVALID, INVALID, INVALID, +/* [64] */ INVALID, INVALID, INVALID, INVALID, +/* [68] */ INVALID, INVALID, INVALID, INVALID, +/* [6C] */ INVALID, INVALID, INVALID, INVALID, +}, { +/* [70] */ INVALID, INVALID, INVALID, INVALID, +/* [74] */ INVALID, INVALID, INVALID, TNS("vzeroupper", VEX_NONE), +/* [78] */ INVALID, INVALID, INVALID, INVALID, +/* [7C] */ INVALID, INVALID, INVALID, INVALID, +}, { +/* [80] */ INVALID, INVALID, INVALID, INVALID, +/* [84] */ INVALID, INVALID, INVALID, INVALID, +/* [88] */ INVALID, INVALID, INVALID, INVALID, +/* [8C] */ INVALID, INVALID, INVALID, INVALID, +}, { +/* [90] */ INVALID, INVALID, INVALID, INVALID, +/* [94] */ INVALID, INVALID, INVALID, INVALID, +/* [98] */ INVALID, INVALID, INVALID, INVALID, +/* [9C] */ INVALID, INVALID, INVALID, INVALID, +}, { +/* [A0] */ INVALID, INVALID, INVALID, INVALID, +/* [A4] */ INVALID, INVALID, INVALID, INVALID, +/* [A8] */ INVALID, INVALID, INVALID, INVALID, +/* [AC] */ INVALID, INVALID, TNSZ("vldmxcsr",VEX_MO,2), INVALID, +}, { +/* [B0] */ INVALID, INVALID, INVALID, INVALID, +/* [B4] */ INVALID, INVALID, INVALID, INVALID, +/* [B8] */ INVALID, INVALID, INVALID, INVALID, +/* [BC] */ INVALID, INVALID, INVALID, INVALID, +}, { +/* [C0] */ INVALID, INVALID, TNSZ("vcmpps",VEX_RMRX,16),INVALID, +/* [C4] */ INVALID, INVALID, TNSZ("vshufps",VEX_RMRX,16),INVALID, +/* [C8] */ INVALID, INVALID, INVALID, INVALID, +/* [CC] */ INVALID, INVALID, INVALID, INVALID, +}, { +/* [D0] */ INVALID, INVALID, INVALID, INVALID, +/* [D4] */ INVALID, INVALID, INVALID, INVALID, +/* [D8] */ INVALID, INVALID, INVALID, INVALID, +/* [DC] */ INVALID, INVALID, INVALID, INVALID, +}, { +/* [E0] */ INVALID, INVALID, INVALID, INVALID, +/* [E4] */ INVALID, INVALID, INVALID, INVALID, +/* [E8] */ INVALID, INVALID, INVALID, INVALID, +/* [EC] */ INVALID, INVALID, INVALID, INVALID, +}, { +/* [F0] */ INVALID, INVALID, INVALID, INVALID, +/* [F4] */ INVALID, INVALID, INVALID, INVALID, +/* [F8] */ INVALID, INVALID, INVALID, INVALID, +/* [FC] */ INVALID, INVALID, INVALID, INVALID, +} }; /* * Decode table for 0x80 opcodes @@ -1087,7 +1800,7 @@ const instable_t dis_opFP3[8][8] = { /* [6,0] */ TNS("faddp",FF), TNS("fmulp",FF), TNS("fcomp",F), TNS("fcompp",NORM), /* [6,4] */ TNS("fsubp",FF), TNS("fsubrp",FF), TNS("fdivp",FF), TNS("fdivrp",FF), }, { -/* [7,0] */ TNS("ffree",F), TNS("fxch",F), TNS("fstp",F), TNS("fstp",F), +/* [7,0] */ TNS("ffreep",F), TNS("fxch",F), TNS("fstp",F), TNS("fstp",F), /* [7,4] */ TNS("fnstsw",M), TNS("fucomip",FFC), TNS("fcomip",FFC), INVALID, } }; @@ -1138,7 +1851,7 @@ const instable_t dis_distable[16][16] = { /* [0,0] */ TNS("addb",RMw), TS("add",RMw), TNS("addb",MRw), TS("add",MRw), /* [0,4] */ TNS("addb",IA), TS("add",IA), TSx("push",SEG), TSx("pop",SEG), /* [0,8] */ TNS("orb",RMw), TS("or",RMw), TNS("orb",MRw), TS("or",MRw), -/* [0,C] */ TNS("orb",IA), TS("or",IA), TSx("push",SEG), IND(&dis_op0F[0][0]), +/* [0,C] */ TNS("orb",IA), TS("or",IA), TSx("push",SEG), IND(dis_op0F), }, { /* [1,0] */ TNS("adcb",RMw), TS("adc",RMw), TNS("adcb",MRw), TS("adc",MRw), /* [1,4] */ TNS("adcb",IA), TS("adc",IA), TSx("push",SEG), TSx("pop",SEG), @@ -1208,8 +1921,8 @@ const instable_t dis_distable[16][16] = { /* the case since the opFP arrays are not partitioned according to key1 */ /* and key2. opFP1n2 is given only to indicate that we haven't */ /* finished decoding the instruction. */ -/* [D,8] */ IND(&dis_opFP1n2[0][0]), IND(&dis_opFP1n2[0][0]), IND(&dis_opFP1n2[0][0]), IND(&dis_opFP1n2[0][0]), -/* [D,C] */ IND(&dis_opFP1n2[0][0]), IND(&dis_opFP1n2[0][0]), IND(&dis_opFP1n2[0][0]), IND(&dis_opFP1n2[0][0]), +/* [D,8] */ IND(dis_opFP1n2), IND(dis_opFP1n2), IND(dis_opFP1n2), IND(dis_opFP1n2), +/* [D,C] */ IND(dis_opFP1n2), IND(dis_opFP1n2), IND(dis_opFP1n2), IND(dis_opFP1n2), }, { /* [E,0] */ TNSy("loopnz",BD), TNSy("loopz",BD), TNSy("loop",BD), TNSy("jcxz",BD), /* [E,4] */ TNS("inb",P), TS("in",P), TNS("outb",P), TS("out",P), @@ -1239,8 +1952,28 @@ const instable_t dis_distable[16][16] = { #define REX_X 0x02 /* high order bit extension of SIB index field */ #define REX_B 0x01 /* extends ModRM r_m, SIB base, or opcode reg */ -static uint_t opnd_size; /* SIZE16, SIZE32 or SIZE64 */ -static uint_t addr_size; /* SIZE16, SIZE32 or SIZE64 */ +/* + * These are the individual fields of a VEX prefix. + */ +#define VEX_R 0x08 /* REX.R in 1's complement form */ +#define VEX_X 0x04 /* REX.X in 1's complement form */ +#define VEX_B 0x02 /* REX.B in 1's complement form */ +/* Vector Length, 0: scalar or 128-bit vector, 1: 256-bit vector */ +#define VEX_L 0x04 +#define VEX_W 0x08 /* opcode specific, use like REX.W */ +#define VEX_m 0x1F /* VEX m-mmmm field */ +#define VEX_v 0x78 /* VEX register specifier */ +#define VEX_p 0x03 /* VEX pp field, opcode extension */ + +/* VEX m-mmmm field, only used by three bytes prefix */ +#define VEX_m_0F 0x01 /* implied 0F leading opcode byte */ +#define VEX_m_0F38 0x02 /* implied 0F 38 leading opcode byte */ +#define VEX_m_0F3A 0x03 /* implied 0F 3A leading opcode byte */ + +/* VEX pp field, providing equivalent functionality of a SIMD prefix */ +#define VEX_p_66 0x01 +#define VEX_p_F3 0x02 +#define VEX_p_F2 0x03 /* * Even in 64 bit mode, usually only 4 byte immediate operands are supported. @@ -1268,6 +2001,7 @@ static int isize64[] = {1, 2, 4, 8}; #define DEBUG_OPND 6 /* "value" used to indicate a debug reg */ #define TEST_OPND 7 /* "value" used to indicate a test reg */ #define WORD_OPND 8 /* w-bit value indicating word size reg */ +#define YMM_OPND 9 /* "value" used to indicate a ymm reg */ /* * Get the next byte and separate the op code into the high and low nibbles. @@ -1352,6 +2086,25 @@ dtrace_rex_adjust(uint_t rex_prefix, uint_t mode, uint_t *reg, uint_t *r_m) } /* + * Adjust register selection based on any VEX prefix bits present. + * Notes: VEX.R, VEX.X and VEX.B use the inverted form compared with REX prefix + */ +/*ARGSUSED*/ +static void +dtrace_vex_adjust(uint_t vex_byte1, uint_t mode, uint_t *reg, uint_t *r_m) +{ + if (reg != NULL && r_m == NULL) { + if (!(vex_byte1 & VEX_B)) + *reg += 8; + } else { + if (reg != NULL && ((VEX_R & vex_byte1) == 0)) + *reg += 8; + if (r_m != NULL && ((VEX_B & vex_byte1) == 0)) + *r_m += 8; + } +} + +/* * Get an immediate operand of the given size, with sign extension. */ static void @@ -1359,7 +2112,7 @@ dtrace_imm_opnd(dis86_t *x, int wbit, int size, int opindex) { int i; int byte; - int valsize = 0; + int valsize; if (x->d86_numopnds < opindex + 1) x->d86_numopnds = opindex + 1; @@ -1378,6 +2131,7 @@ dtrace_imm_opnd(dis86_t *x, int wbit, int size, int opindex) break; case MM_OPND: case XMM_OPND: + case YMM_OPND: case SEG_OPND: case CONTROL_OPND: case DEBUG_OPND: @@ -1405,9 +2159,9 @@ dtrace_imm_opnd(dis86_t *x, int wbit, int size, int opindex) } /* Do sign extension */ if (x->d86_bytes[x->d86_len - 1] & 0x80) { - for (; i < valsize; i++) + for (; i < sizeof (uint64_t); i++) x->d86_opnd[opindex].d86_value |= - (uint64_t)0xff << (i* 8); + (uint64_t)0xff << (i * 8); } #ifdef DIS_TEXT x->d86_opnd[opindex].d86_mode = MODE_SIGNED; @@ -1488,6 +2242,9 @@ dtrace_get_operand(dis86_t *x, uint_t mode, uint_t r_m, int wbit, int opindex) case XMM_OPND: (void) strlcat(opnd, dis_XMMREG[r_m], OPLEN); break; + case YMM_OPND: + (void) strlcat(opnd, dis_YMMREG[r_m], OPLEN); + break; case SEG_OPND: (void) strlcat(opnd, dis_SEGREG[r_m], OPLEN); break; @@ -1602,12 +2359,17 @@ dtrace_get_operand(dis86_t *x, uint_t mode, uint_t r_m, int wbit, int opindex) (void) strlcat(opnd, dis_addr32_mode12[r_m], OPLEN); } else { - if (mode == 0) + if (mode == 0) { (void) strlcat(opnd, dis_addr64_mode0[r_m], OPLEN); - else + if (r_m == 5) { + x->d86_opnd[opindex].d86_mode = + MODE_RIPREL; + } + } else { (void) strlcat(opnd, dis_addr64_mode12[r_m], OPLEN); + } } } else { uint_t need_paren = 0; @@ -1673,12 +2435,38 @@ dtrace_get_operand(dis86_t *x, uint_t mode, uint_t r_m, int wbit, int opindex) /* * Similar, but for 2 operands plus an immediate. + * vbit indicates direction + * 0 for "opcode imm, r, r_m" or + * 1 for "opcode imm, r_m, r" + */ +#define THREEOPERAND(x, mode, reg, r_m, rex_prefix, wbit, w2, immsize, vbit) { \ + dtrace_get_modrm(x, &mode, ®, &r_m); \ + dtrace_rex_adjust(rex_prefix, mode, ®, &r_m); \ + dtrace_get_operand(x, mode, r_m, wbit, 2-vbit); \ + dtrace_get_operand(x, REG_ONLY, reg, w2, 1+vbit); \ + dtrace_imm_opnd(x, wbit, immsize, 0); \ +} + +/* + * Similar, but for 2 operands plus two immediates. + */ +#define FOUROPERAND(x, mode, reg, r_m, rex_prefix, wbit, w2, immsize) { \ + dtrace_get_modrm(x, &mode, ®, &r_m); \ + dtrace_rex_adjust(rex_prefix, mode, ®, &r_m); \ + dtrace_get_operand(x, mode, r_m, wbit, 2); \ + dtrace_get_operand(x, REG_ONLY, reg, w2, 3); \ + dtrace_imm_opnd(x, wbit, immsize, 1); \ + dtrace_imm_opnd(x, wbit, immsize, 0); \ +} + +/* + * 1 operands plus two immediates. */ -#define THREEOPERAND(x, mode, reg, r_m, rex_prefix, wbit, w2, immsize) { \ +#define ONEOPERAND_TWOIMM(x, mode, reg, r_m, rex_prefix, wbit, immsize) { \ dtrace_get_modrm(x, &mode, ®, &r_m); \ dtrace_rex_adjust(rex_prefix, mode, ®, &r_m); \ - dtrace_get_operand(x, mode, r_m, wbit, 1); \ - dtrace_get_operand(x, REG_ONLY, reg, w2, 2); \ + dtrace_get_operand(x, mode, r_m, wbit, 2); \ + dtrace_imm_opnd(x, wbit, immsize, 1); \ dtrace_imm_opnd(x, wbit, immsize, 0); \ } @@ -1693,7 +2481,7 @@ dtrace_get_operand(dis86_t *x, uint_t mode, uint_t r_m, int wbit, int opindex) int dtrace_disx86(dis86_t *x, uint_t cpu_mode) { - const instable_t *dp = NULL; /* decode table being used */ + instable_t *dp; /* decode table being used */ #ifdef DIS_TEXT uint_t i; #endif @@ -1703,7 +2491,9 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mode) #else #define NOMEM /* nothing */ #endif - uint_t wbit = 0; /* opcode wbit, 0 is 8 bit, !0 for opnd_size */ + uint_t opnd_size; /* SIZE16, SIZE32 or SIZE64 */ + uint_t addr_size; /* SIZE16, SIZE32 or SIZE64 */ + uint_t wbit; /* opcode wbit, 0 is 8 bit, !0 for opnd_size */ uint_t w2; /* wbit value for second operand */ uint_t vbit; uint_t mode = 0; /* mode value from ModRM byte */ @@ -1714,7 +2504,7 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mode) uint_t opcode2; /* low nibble of 1st byte */ uint_t opcode3; /* extra opcode bits usually from ModRM byte */ uint_t opcode4; /* high nibble of 2nd byte */ - uint_t opcode5; /* low nibble of 2ne byte */ + uint_t opcode5; /* low nibble of 2nd byte */ uint_t opcode6; /* high nibble of 3rd byte */ uint_t opcode7; /* low nibble of 3rd byte */ uint_t opcode_bytes = 1; @@ -1728,16 +2518,48 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mode) uint_t lock_prefix = 0; uint_t rep_prefix = 0; uint_t rex_prefix = 0; /* amd64 register extension prefix */ + + /* + * Intel VEX instruction encoding prefix and fields + */ + + /* 0xC4 means 3 bytes prefix, 0xC5 means 2 bytes prefix */ + uint_t vex_prefix = 0; + + /* + * VEX prefix byte 1, includes vex.r, vex.x and vex.b + * (for 3 bytes prefix) + */ + uint_t vex_byte1 = 0; + + /* + * For 32-bit mode, it should prefetch the next byte to + * distinguish between AVX and les/lds + */ + uint_t vex_prefetch = 0; + + uint_t vex_m = 0; + uint_t vex_v = 0; + uint_t vex_p = 0; + uint_t vex_R = 1; + uint_t vex_X = 1; + uint_t vex_B = 1; + uint_t vex_W = 0; + uint_t vex_L; + + size_t off; + instable_t dp_mmx; + x->d86_len = 0; x->d86_rmindex = -1; x->d86_error = 0; #ifdef DIS_TEXT x->d86_numopnds = 0; x->d86_seg_prefix = NULL; - x->d86_mneu[0] = 0; - for (i = 0; i < 3; ++i) { + x->d86_mnem[0] = 0; + for (i = 0; i < 4; ++i) { x->d86_opnd[i].d86_opnd[0] = 0; x->d86_opnd[i].d86_prefix[0] = 0; x->d86_opnd[i].d86_value_size = 0; @@ -1745,7 +2567,8 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mode) x->d86_opnd[i].d86_mode = MODE_NONE; } #endif - x->d86_error = 0; + x->d86_rex_prefix = 0; + x->d86_got_modrm = 0; x->d86_memsize = 0; if (cpu_mode == SIZE16) { @@ -1769,7 +2592,7 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mode) if (opcode1 == 0 && opcode2 == 0 && x->d86_check_func != NULL && x->d86_check_func(x->d86_data)) { #ifdef DIS_TEXT - (void) strncpy(x->d86_mneu, ".byte\t0", OPLEN); + (void) strncpy(x->d86_mnem, ".byte\t0", OPLEN); #endif goto done; } @@ -1780,7 +2603,7 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mode) for (;;) { uint_t *which_prefix = NULL; - dp = &dis_distable[opcode1][opcode2]; + dp = (instable_t *)&dis_distable[opcode1][opcode2]; switch (dp->it_adrmode) { case PREFIX: @@ -1824,9 +2647,151 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mode) rex_prefix = (opcode1 << 4) | opcode2; if (dtrace_get_opcode(x, &opcode1, &opcode2) != 0) goto error; - dp = &dis_distable[opcode1][opcode2]; + dp = (instable_t *)&dis_distable[opcode1][opcode2]; + } else if (opcode1 == 0xC && + (opcode2 == 0x4 || opcode2 == 0x5)) { + /* AVX instructions */ + vex_prefix = (opcode1 << 4) | opcode2; + x->d86_rex_prefix = 0x40; + } + } else if (opcode1 == 0xC && (opcode2 == 0x4 || opcode2 == 0x5)) { + /* LDS, LES or AVX */ + dtrace_get_modrm(x, &mode, ®, &r_m); + vex_prefetch = 1; + + if (mode == REG_ONLY) { + /* AVX */ + vex_prefix = (opcode1 << 4) | opcode2; + x->d86_rex_prefix = 0x40; + opcode3 = (((mode << 3) | reg)>>1) & 0x0F; + opcode4 = ((reg << 3) | r_m) & 0x0F; + } + } + + if (vex_prefix == VEX_2bytes) { + if (!vex_prefetch) { + if (dtrace_get_opcode(x, &opcode3, &opcode4) != 0) + goto error; + } + vex_R = ((opcode3 & VEX_R) & 0x0F) >> 3; + vex_L = ((opcode4 & VEX_L) & 0x0F) >> 2; + vex_v = (((opcode3 << 4) | opcode4) & VEX_v) >> 3; + vex_p = opcode4 & VEX_p; + /* + * The vex.x and vex.b bits are not defined in two bytes + * mode vex prefix, their default values are 1 + */ + vex_byte1 = (opcode3 & VEX_R) | VEX_X | VEX_B; + + if (vex_R == 0) + x->d86_rex_prefix |= REX_R; + + if (dtrace_get_opcode(x, &opcode1, &opcode2) != 0) + goto error; + + switch (vex_p) { + case VEX_p_66: + dp = (instable_t *) + &dis_opAVX660F[(opcode1 << 4) | opcode2]; + break; + case VEX_p_F3: + dp = (instable_t *) + &dis_opAVXF30F[(opcode1 << 4) | opcode2]; + break; + case VEX_p_F2: + dp = (instable_t *) + &dis_opAVXF20F [(opcode1 << 4) | opcode2]; + break; + default: + dp = (instable_t *) + &dis_opAVX0F[opcode1][opcode2]; + + } + + } else if (vex_prefix == VEX_3bytes) { + if (!vex_prefetch) { + if (dtrace_get_opcode(x, &opcode3, &opcode4) != 0) + goto error; + } + vex_R = (opcode3 & VEX_R) >> 3; + vex_X = (opcode3 & VEX_X) >> 2; + vex_B = (opcode3 & VEX_B) >> 1; + vex_m = (((opcode3 << 4) | opcode4) & VEX_m); + vex_byte1 = opcode3 & (VEX_R | VEX_X | VEX_B); + + if (vex_R == 0) + x->d86_rex_prefix |= REX_R; + if (vex_X == 0) + x->d86_rex_prefix |= REX_X; + if (vex_B == 0) + x->d86_rex_prefix |= REX_B; + + if (dtrace_get_opcode(x, &opcode5, &opcode6) != 0) + goto error; + vex_W = (opcode5 & VEX_W) >> 3; + vex_L = (opcode6 & VEX_L) >> 2; + vex_v = (((opcode5 << 4) | opcode6) & VEX_v) >> 3; + vex_p = opcode6 & VEX_p; + + if (vex_W) + x->d86_rex_prefix |= REX_W; + + /* Only these three vex_m values valid; others are reserved */ + if ((vex_m != VEX_m_0F) && (vex_m != VEX_m_0F38) && + (vex_m != VEX_m_0F3A)) + goto error; + + if (dtrace_get_opcode(x, &opcode1, &opcode2) != 0) + goto error; + + switch (vex_p) { + case VEX_p_66: + if (vex_m == VEX_m_0F) { + dp = (instable_t *) + &dis_opAVX660F + [(opcode1 << 4) | opcode2]; + } else if (vex_m == VEX_m_0F38) { + dp = (instable_t *) + &dis_opAVX660F38 + [(opcode1 << 4) | opcode2]; + } else if (vex_m == VEX_m_0F3A) { + dp = (instable_t *) + &dis_opAVX660F3A + [(opcode1 << 4) | opcode2]; + } else { + goto error; + } + break; + case VEX_p_F3: + if (vex_m == VEX_m_0F) { + dp = (instable_t *) + &dis_opAVXF30F + [(opcode1 << 4) | opcode2]; + } else { + goto error; + } + break; + case VEX_p_F2: + if (vex_m == VEX_m_0F) { + dp = (instable_t *) + &dis_opAVXF20F + [(opcode1 << 4) | opcode2]; + } else { + goto error; + } + break; + default: + dp = (instable_t *) + &dis_opAVX0F[opcode1][opcode2]; + } } + if (vex_prefix) { + if (vex_L) + wbit = YMM_OPND; + else + wbit = XMM_OPND; + } /* * Deal with selection of operand and address size now. @@ -1834,7 +2799,7 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mode) * ignored. */ if (cpu_mode == SIZE64) { - if (rex_prefix & 0x08) + if ((rex_prefix & REX_W) || vex_W) opnd_size = SIZE64; else if (opnd_size_prefix) opnd_size = SIZE16; @@ -1852,7 +2817,6 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mode) if (addr_size_prefix) addr_size = SIZE32; } - /* * The pause instruction - a repz'd nop. This doesn't fit * with any of the other prefix goop added for SSE, so we'll @@ -1860,14 +2824,14 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mode) */ if (rep_prefix == 0xf3 && opcode1 == 0x9 && opcode2 == 0x0) { rep_prefix = 0; - dp = &dis_opPause; + dp = (instable_t *)&dis_opPause; } /* * Some 386 instructions have 2 bytes of opcode before the mod_r/m * byte so we may need to perform a table indirection. */ - if (dp->it_indirect == dis_op0F[0]) { + if (dp->it_indirect == (instable_t *)dis_op0F) { if (dtrace_get_opcode(x, &opcode4, &opcode5) != 0) goto error; opcode_bytes = 2; @@ -1879,11 +2843,101 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mode) opcode_bytes = 3; subcode = ((opcode6 & 0x3) << 1) | ((opcode7 & 0x8) >> 3); - dp = &dis_op0F7123[opcode5][subcode]; + dp = (instable_t *)&dis_op0F7123[opcode5][subcode]; } else if ((opcode4 == 0xc) && (opcode5 >= 0x8)) { - dp = &dis_op0FC8[0]; + dp = (instable_t *)&dis_op0FC8[0]; + } else if ((opcode4 == 0x3) && (opcode5 == 0xA)) { + opcode_bytes = 3; + if (dtrace_get_opcode(x, &opcode6, &opcode7) != 0) + goto error; + if (opnd_size == SIZE16) + opnd_size = SIZE32; + + dp = (instable_t *)&dis_op0F3A[(opcode6<<4)|opcode7]; +#ifdef DIS_TEXT + if (strcmp(dp->it_name, "INVALID") == 0) + goto error; +#endif + switch (dp->it_adrmode) { + case XMMP_66r: + case XMMPRM_66r: + case XMM3PM_66r: + if (opnd_size_prefix == 0) { + goto error; + } + break; + case XMMP_66o: + if (opnd_size_prefix == 0) { + /* SSSE3 MMX instructions */ + dp_mmx = *dp; + dp = &dp_mmx; + dp->it_adrmode = MMOPM_66o; +#ifdef DIS_MEM + dp->it_size = 8; +#endif + } + break; + default: + goto error; + } + } else if ((opcode4 == 0x3) && (opcode5 == 0x8)) { + opcode_bytes = 3; + if (dtrace_get_opcode(x, &opcode6, &opcode7) != 0) + goto error; + dp = (instable_t *)&dis_op0F38[(opcode6<<4)|opcode7]; + + /* + * Both crc32 and movbe have the same 3rd opcode + * byte of either 0xF0 or 0xF1, so we use another + * indirection to distinguish between the two. + */ + if (dp->it_indirect == (instable_t *)dis_op0F38F0 || + dp->it_indirect == (instable_t *)dis_op0F38F1) { + + dp = dp->it_indirect; + if (rep_prefix != 0xF2) { + /* It is movbe */ + dp++; + } + } +#ifdef DIS_TEXT + if (strcmp(dp->it_name, "INVALID") == 0) + goto error; +#endif + switch (dp->it_adrmode) { + case XMM_66r: + case XMMM_66r: + if (opnd_size_prefix == 0) { + goto error; + } + break; + case XMM_66o: + if (opnd_size_prefix == 0) { + /* SSSE3 MMX instructions */ + dp_mmx = *dp; + dp = &dp_mmx; + dp->it_adrmode = MM; +#ifdef DIS_MEM + dp->it_size = 8; +#endif + } + break; + case CRC32: + if (rep_prefix != 0xF2) { + goto error; + } + rep_prefix = 0; + break; + case MOVBE: + if (rep_prefix != 0x0) { + goto error; + } + break; + default: + goto error; + } } else { - dp = &dis_op0F[opcode4][opcode5]; + dp = (instable_t *)&dis_op0F[opcode4][opcode5]; } } @@ -1903,19 +2957,21 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mode) */ if (opcode1 == 0xD && opcode2 >= 0x8) { if (opcode2 == 0xB && mode == 0x3 && opcode3 == 4) - dp = &dis_opFP5[r_m]; + dp = (instable_t *)&dis_opFP5[r_m]; else if (opcode2 == 0xA && mode == 0x3 && opcode3 < 4) - dp = &dis_opFP7[opcode3]; + dp = (instable_t *)&dis_opFP7[opcode3]; else if (opcode2 == 0xB && mode == 0x3) - dp = &dis_opFP6[opcode3]; + dp = (instable_t *)&dis_opFP6[opcode3]; else if (opcode2 == 0x9 && mode == 0x3 && opcode3 >= 4) - dp = &dis_opFP4[opcode3 - 4][r_m]; + dp = (instable_t *)&dis_opFP4[opcode3 - 4][r_m]; else if (mode == 0x3) - dp = &dis_opFP3[opcode2 - 8][opcode3]; + dp = (instable_t *) + &dis_opFP3[opcode2 - 8][opcode3]; else - dp = &dis_opFP1n2[opcode2 - 8][opcode3]; + dp = (instable_t *) + &dis_opFP1n2[opcode2 - 8][opcode3]; } else { - dp = dp->it_indirect + opcode3; + dp = (instable_t *)dp->it_indirect + opcode3; } } @@ -1923,14 +2979,15 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mode) * In amd64 bit mode, ARPL opcode is changed to MOVSXD * (sign extend 32bit to 64 bit) */ - if (cpu_mode == SIZE64 && opcode1 == 0x6 && opcode2 == 0x3) - dp = &dis_opMOVSLD; + if ((vex_prefix == 0) && cpu_mode == SIZE64 && + opcode1 == 0x6 && opcode2 == 0x3) + dp = (instable_t *)&dis_opMOVSLD; /* * at this point we should have a correct (or invalid) opcode */ - if ((cpu_mode == SIZE64 && dp->it_invalid64) || - (cpu_mode != SIZE64 && dp->it_invalid32)) + if (cpu_mode == SIZE64 && dp->it_invalid64 || + cpu_mode != SIZE64 && dp->it_invalid32) goto error; if (dp->it_indirect != TERM) goto error; @@ -1985,12 +3042,12 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mode) */ if (rep_prefix) { if (rep_prefix == 0xf2) - dp = &dis_opSIMDrepnz[off]; + dp = (instable_t *)&dis_opSIMDrepnz[off]; else - dp = &dis_opSIMDrepz[off]; + dp = (instable_t *)&dis_opSIMDrepz[off]; rep_prefix = 0; } else if (opnd_size_prefix) { - dp = &dis_opSIMDdata16[off]; + dp = (instable_t *)&dis_opSIMDdata16[off]; opnd_size_prefix = 0; if (opnd_size == SIZE16) opnd_size = SIZE32; @@ -2016,12 +3073,33 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mode) if (opnd_size_prefix) { off = ((uintptr_t)dp - (uintptr_t)dis_op0F7123) / sizeof (instable_t); - dp = &dis_opSIMD7123[off]; + dp = (instable_t *)&dis_opSIMD7123[off]; opnd_size_prefix = 0; if (opnd_size == SIZE16) opnd_size = SIZE32; } break; + case MRw: + if (rep_prefix) { + if (rep_prefix == 0xf3) { + + /* + * Calculate our offset in dis_op0F + */ + if ((uintptr_t)dp - (uintptr_t)dis_op0F + > sizeof (dis_op0F)) + goto error; + + off = ((uintptr_t)dp - (uintptr_t)dis_op0F) / + sizeof (instable_t); + + dp = (instable_t *)&dis_opSIMDrepz[off]; + rep_prefix = 0; + } else { + goto error; + } + } + break; } /* @@ -2037,33 +3115,40 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mode) * including the prefixes. */ if (lock_prefix) - (void) strlcat(x->d86_mneu, "lock ", OPLEN); + (void) strlcat(x->d86_mnem, "lock ", OPLEN); if (rep_prefix == 0xf2) - (void) strlcat(x->d86_mneu, "repnz ", OPLEN); + (void) strlcat(x->d86_mnem, "repnz ", OPLEN); else if (rep_prefix == 0xf3) - (void) strlcat(x->d86_mneu, "repz ", OPLEN); + (void) strlcat(x->d86_mnem, "repz ", OPLEN); if (cpu_mode == SIZE64 && addr_size_prefix) - (void) strlcat(x->d86_mneu, "addr32 ", OPLEN); + (void) strlcat(x->d86_mnem, "addr32 ", OPLEN); if (dp->it_adrmode != CBW && dp->it_adrmode != CWD && dp->it_adrmode != XMMSFNC) { if (strcmp(dp->it_name, "INVALID") == 0) goto error; - (void) strlcat(x->d86_mneu, dp->it_name, OPLEN); + (void) strlcat(x->d86_mnem, dp->it_name, OPLEN); if (dp->it_suffix) { char *types[] = {"", "w", "l", "q"}; if (opcode_bytes == 2 && opcode4 == 4) { /* It's a cmovx.yy. Replace the suffix x */ for (i = 5; i < OPLEN; i++) { - if (x->d86_mneu[i] == '.') + if (x->d86_mnem[i] == '.') break; } - x->d86_mneu[i - 1] = *types[opnd_size]; + x->d86_mnem[i - 1] = *types[opnd_size]; + } else if ((opnd_size == 2) && (opcode_bytes == 3) && + ((opcode6 == 1 && opcode7 == 6) || + (opcode6 == 2 && opcode7 == 2))) { + /* + * To handle PINSRD and PEXTRD + */ + (void) strlcat(x->d86_mnem, "d", OPLEN); } else { - (void) strlcat(x->d86_mneu, types[opnd_size], + (void) strlcat(x->d86_mnem, types[opnd_size], OPLEN); } } @@ -2074,7 +3159,11 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mode) * Process operands based on the addressing modes. */ x->d86_mode = cpu_mode; - x->d86_rex_prefix = rex_prefix; + /* + * In vex mode the rex_prefix has no meaning + */ + if (!vex_prefix) + x->d86_rex_prefix = rex_prefix; x->d86_opnd_size = opnd_size; x->d86_addr_size = addr_size; vbit = 0; /* initialize for mem/reg -> reg */ @@ -2086,7 +3175,7 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mode) case MOVSXZ: #ifdef DIS_TEXT if (rex_prefix == 0) - (void) strncpy(x->d86_mneu, "movzld", OPLEN); + (void) strncpy(x->d86_mnem, "movzld", OPLEN); #endif dtrace_get_modrm(x, &mode, ®, &r_m); dtrace_rex_adjust(rex_prefix, mode, ®, &r_m); @@ -2099,14 +3188,14 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mode) /* * movsbl movsbw movsbq (0x0FBE) or movswl movswq (0x0FBF) - * movzbl movzbw movzbq (0x0FB6) or mobzwl movzwq (0x0FB7) + * movzbl movzbw movzbq (0x0FB6) or movzwl movzwq (0x0FB7) * wbit lives in 2nd byte, note that operands * are different sized */ case MOVZ: if (rex_prefix & REX_W) { /* target register size = 64 bit */ - x->d86_mneu[5] = 'q'; + x->d86_mnem[5] = 'q'; } dtrace_get_modrm(x, &mode, ®, &r_m); dtrace_rex_adjust(rex_prefix, mode, ®, &r_m); @@ -2115,6 +3204,41 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mode) wbit = WBIT(opcode5); dtrace_get_operand(x, mode, r_m, wbit, 0); break; + case CRC32: + opnd_size = SIZE32; + if (rex_prefix & REX_W) + opnd_size = SIZE64; + x->d86_opnd_size = opnd_size; + + dtrace_get_modrm(x, &mode, ®, &r_m); + dtrace_rex_adjust(rex_prefix, mode, ®, &r_m); + dtrace_get_operand(x, REG_ONLY, reg, LONG_OPND, 1); + wbit = WBIT(opcode7); + if (opnd_size_prefix) + x->d86_opnd_size = opnd_size = SIZE16; + dtrace_get_operand(x, mode, r_m, wbit, 0); + break; + case MOVBE: + opnd_size = SIZE32; + if (rex_prefix & REX_W) + opnd_size = SIZE64; + x->d86_opnd_size = opnd_size; + + dtrace_get_modrm(x, &mode, ®, &r_m); + dtrace_rex_adjust(rex_prefix, mode, ®, &r_m); + wbit = WBIT(opcode7); + if (opnd_size_prefix) + x->d86_opnd_size = opnd_size = SIZE16; + if (wbit) { + /* reg -> mem */ + dtrace_get_operand(x, REG_ONLY, reg, LONG_OPND, 0); + dtrace_get_operand(x, mode, r_m, wbit, 1); + } else { + /* mem -> reg */ + dtrace_get_operand(x, REG_ONLY, reg, LONG_OPND, 1); + dtrace_get_operand(x, mode, r_m, wbit, 0); + } + break; /* * imul instruction, with either 8-bit or longer immediate @@ -2123,7 +3247,7 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mode) case IMUL: wbit = LONG_OPND; THREEOPERAND(x, mode, reg, r_m, rex_prefix, wbit, LONG_OPND, - OPSIZE(opnd_size, opcode2 == 0x9)); + OPSIZE(opnd_size, opcode2 == 0x9), 1); break; /* memory or register operand to register, with 'w' bit */ @@ -2313,7 +3437,7 @@ just_mem: case SWAPGS: if (cpu_mode == SIZE64 && mode == 3 && r_m == 0) { #ifdef DIS_TEXT - (void) strncpy(x->d86_mneu, "swapgs", OPLEN); + (void) strncpy(x->d86_mnem, "swapgs", OPLEN); #endif NOMEM; break; @@ -2335,6 +3459,45 @@ just_mem: wbit = BYTE_OPND; goto just_mem; + case MONITOR_MWAIT: + if (mode == 3) { + if (r_m == 0) { +#ifdef DIS_TEXT + (void) strncpy(x->d86_mnem, "monitor", OPLEN); +#endif + NOMEM; + break; + } else if (r_m == 1) { +#ifdef DIS_TEXT + (void) strncpy(x->d86_mnem, "mwait", OPLEN); +#endif + NOMEM; + break; + } else { + goto error; + } + } + /*FALLTHROUGH*/ + case XGETBV_XSETBV: + if (mode == 3) { + if (r_m == 0) { +#ifdef DIS_TEXT + (void) strncpy(x->d86_mnem, "xgetbv", OPLEN); +#endif + NOMEM; + break; + } else if (r_m == 1) { +#ifdef DIS_TEXT + (void) strncpy(x->d86_mnem, "xsetbv", OPLEN); +#endif + NOMEM; + break; + } else { + goto error; + } + + } + /*FALLTHROUGH*/ case MO: /* Similar to M, but only memory (no direct registers) */ wbit = LONG_OPND; @@ -2427,6 +3590,8 @@ just_mem: /* memory or register operand to register */ case MR: + if (vex_prefetch) + x->d86_got_modrm = 1; wbit = LONG_OPND; STANDARD_MODRM(x, mode, reg, r_m, rex_prefix, wbit, 0); break; @@ -2474,24 +3639,32 @@ xmm3p: if (mode != REG_ONLY) goto error; - THREEOPERAND(x, mode, reg, r_m, rex_prefix, wbit, LONG_OPND, 1); + THREEOPERAND(x, mode, reg, r_m, rex_prefix, wbit, LONG_OPND, 1, + 1); NOMEM; break; + case XMM3PM_66r: + THREEOPERAND(x, mode, reg, r_m, rex_prefix, LONG_OPND, XMM_OPND, + 1, 0); + break; + /* MMX/SIMD-Int predicated r32/mem to mm reg */ case MMOPRM: wbit = LONG_OPND; w2 = MM_OPND; goto xmmprm; case XMMPRM: + case XMMPRM_66r: wbit = LONG_OPND; w2 = XMM_OPND; xmmprm: - THREEOPERAND(x, mode, reg, r_m, rex_prefix, wbit, w2, 1); + THREEOPERAND(x, mode, reg, r_m, rex_prefix, wbit, w2, 1, 1); break; /* MMX/SIMD-Int predicated mm/mem to mm reg */ case MMOPM: + case MMOPM_66o: wbit = w2 = MM_OPND; goto xmmprm; @@ -2507,6 +3680,8 @@ xmmprm: /* SIMD memory or xmm reg operand to xmm reg */ case XMM: + case XMM_66o: + case XMM_66r: case XMMO: case XMMXIMPL: wbit = XMM_OPND; @@ -2523,9 +3698,9 @@ xmmprm: */ if (mode == REG_ONLY) { if (strcmp(dp->it_name, "movlps") == 0) - (void) strncpy(x->d86_mneu, "movhlps", OPLEN); + (void) strncpy(x->d86_mnem, "movhlps", OPLEN); else if (strcmp(dp->it_name, "movhps") == 0) - (void) strncpy(x->d86_mneu, "movlhps", OPLEN); + (void) strncpy(x->d86_mnem, "movlhps", OPLEN); } #endif if (dp->it_adrmode == XMMXIMPL) @@ -2551,13 +3726,14 @@ xmmprm: /* SIMD memory to xmm reg */ case XMMM: + case XMMM_66r: case XMMOM: wbit = XMM_OPND; dtrace_get_modrm(x, &mode, ®, &r_m); #ifdef DIS_TEXT if (mode == REG_ONLY) { if (strcmp(dp->it_name, "movhps") == 0) - (void) strncpy(x->d86_mneu, "movlhps", OPLEN); + (void) strncpy(x->d86_mnem, "movlhps", OPLEN); else goto error; } @@ -2613,9 +3789,12 @@ xmmprm: /* SIMD predicated memory or xmm reg with/to xmm reg */ case XMMP: + case XMMP_66r: + case XMMP_66o: case XMMOPM: wbit = XMM_OPND; - THREEOPERAND(x, mode, reg, r_m, rex_prefix, wbit, XMM_OPND, 1); + THREEOPERAND(x, mode, reg, r_m, rex_prefix, wbit, XMM_OPND, 1, + 1); #ifdef DIS_TEXT /* @@ -2633,10 +3812,10 @@ xmmprm: if (pred >= (sizeof (dis_PREDSUFFIX) / sizeof (char *))) goto error; - (void) strncpy(x->d86_mneu, "cmp", OPLEN); - (void) strlcat(x->d86_mneu, dis_PREDSUFFIX[pred], + (void) strncpy(x->d86_mnem, "cmp", OPLEN); + (void) strlcat(x->d86_mnem, dis_PREDSUFFIX[pred], OPLEN); - (void) strlcat(x->d86_mneu, + (void) strlcat(x->d86_mnem, dp->it_name + strlen(dp->it_name) - 2, OPLEN); x->d86_opnd[0] = x->d86_opnd[1]; @@ -2646,6 +3825,17 @@ xmmprm: #endif break; + case XMMX2I: + FOUROPERAND(x, mode, reg, r_m, rex_prefix, XMM_OPND, XMM_OPND, + 1); + NOMEM; + break; + + case XMM2I: + ONEOPERAND_TWOIMM(x, mode, reg, r_m, rex_prefix, XMM_OPND, 1); + NOMEM; + break; + /* immediate operand to accumulator */ case IA: wbit = WBIT(opcode2); @@ -2857,11 +4047,11 @@ xmmprm: case CBW: #ifdef DIS_TEXT if (opnd_size == SIZE16) - (void) strlcat(x->d86_mneu, "cbtw", OPLEN); + (void) strlcat(x->d86_mnem, "cbtw", OPLEN); else if (opnd_size == SIZE32) - (void) strlcat(x->d86_mneu, "cwtl", OPLEN); + (void) strlcat(x->d86_mnem, "cwtl", OPLEN); else - (void) strlcat(x->d86_mneu, "cltq", OPLEN); + (void) strlcat(x->d86_mnem, "cltq", OPLEN); #endif wbit = LONG_OPND; NOMEM; @@ -2870,11 +4060,11 @@ xmmprm: case CWD: #ifdef DIS_TEXT if (opnd_size == SIZE16) - (void) strlcat(x->d86_mneu, "cwtd", OPLEN); + (void) strlcat(x->d86_mnem, "cwtd", OPLEN); else if (opnd_size == SIZE32) - (void) strlcat(x->d86_mneu, "cltd", OPLEN); + (void) strlcat(x->d86_mnem, "cltd", OPLEN); else - (void) strlcat(x->d86_mneu, "cqtd", OPLEN); + (void) strlcat(x->d86_mnem, "cqtd", OPLEN); #endif wbit = LONG_OPND; NOMEM; @@ -2890,9 +4080,9 @@ xmmprm: /* sfence doesn't take operands */ #ifdef DIS_TEXT if (mode == REG_ONLY) { - (void) strlcat(x->d86_mneu, "sfence", OPLEN); + (void) strlcat(x->d86_mnem, "sfence", OPLEN); } else { - (void) strlcat(x->d86_mneu, "clflush", OPLEN); + (void) strlcat(x->d86_mnem, "clflush", OPLEN); dtrace_rex_adjust(rex_prefix, mode, ®, &r_m); dtrace_get_operand(x, mode, r_m, BYTE_OPND, 0); NOMEM; @@ -2900,7 +4090,7 @@ xmmprm: #else if (mode != REG_ONLY) { dtrace_rex_adjust(rex_prefix, mode, ®, &r_m); - dtrace_get_operand(x, mode, r_m, BYTE_OPND, 0); + dtrace_get_operand(x, mode, r_m, LONG_OPND, 0); NOMEM; } #endif @@ -2919,18 +4109,29 @@ xmmprm: case XMMFENCE: /* - * Only the following exact byte sequences are allowed: - * - * 0f ae e8 lfence - * 0f ae f0 mfence + * XRSTOR and LFENCE share the same opcode but differ in mode */ - if ((uint8_t)x->d86_bytes[x->d86_len - 1] != 0xe8 && - (uint8_t)x->d86_bytes[x->d86_len - 1] != 0xf0) - goto error; + dtrace_get_modrm(x, &mode, ®, &r_m); + if (mode == REG_ONLY) { + /* + * Only the following exact byte sequences are allowed: + * + * 0f ae e8 lfence + * 0f ae f0 mfence + */ + if ((uint8_t)x->d86_bytes[x->d86_len - 1] != 0xe8 && + (uint8_t)x->d86_bytes[x->d86_len - 1] != 0xf0) + goto error; + } else { +#ifdef DIS_TEXT + (void) strncpy(x->d86_mnem, "xrstor", OPLEN); +#endif + dtrace_rex_adjust(rex_prefix, mode, ®, &r_m); + dtrace_get_operand(x, mode, r_m, BYTE_OPND, 0); + } break; - /* float reg */ case F: #ifdef DIS_TEXT @@ -2955,6 +4156,352 @@ xmmprm: NOMEM; break; + /* AVX instructions */ + case VEX_MO: + /* op(ModR/M.r/m) */ + x->d86_numopnds = 1; + dtrace_get_modrm(x, &mode, ®, &r_m); +#ifdef DIS_TEXT + if ((dp == &dis_opAVX0F[0xA][0xE]) && (reg == 3)) + (void) strncpy(x->d86_mnem, "vstmxcsr", OPLEN); +#endif + dtrace_vex_adjust(vex_byte1, mode, ®, &r_m); + dtrace_get_operand(x, mode, r_m, wbit, 0); + break; + case VEX_RMrX: + /* ModR/M.reg := op(VEX.vvvv, ModR/M.r/m) */ + x->d86_numopnds = 3; + dtrace_get_modrm(x, &mode, ®, &r_m); + dtrace_vex_adjust(vex_byte1, mode, ®, &r_m); + + if (mode != REG_ONLY) { + if ((dp == &dis_opAVXF20F[0x10]) || + (dp == &dis_opAVXF30F[0x10])) { + /* vmovsd <m64>, <xmm> */ + /* or vmovss <m64>, <xmm> */ + x->d86_numopnds = 2; + goto L_VEX_MX; + } + } + + dtrace_get_operand(x, REG_ONLY, reg, wbit, 2); + /* + * VEX prefix uses the 1's complement form to encode the + * XMM/YMM regs + */ + dtrace_get_operand(x, REG_ONLY, (0xF - vex_v), wbit, 1); + + if ((dp == &dis_opAVXF20F[0x2A]) || + (dp == &dis_opAVXF30F[0x2A])) { + /* + * vcvtsi2si </r,m>, <xmm>, <xmm> or vcvtsi2ss </r,m>, + * <xmm>, <xmm> + */ + wbit = LONG_OPND; + } +#ifdef DIS_TEXT + else if ((mode == REG_ONLY) && + (dp == &dis_opAVX0F[0x1][0x6])) { /* vmovlhps */ + (void) strncpy(x->d86_mnem, "vmovlhps", OPLEN); + } else if ((mode == REG_ONLY) && + (dp == &dis_opAVX0F[0x1][0x2])) { /* vmovhlps */ + (void) strncpy(x->d86_mnem, "vmovhlps", OPLEN); + } +#endif + dtrace_get_operand(x, mode, r_m, wbit, 0); + + break; + + case VEX_RRX: + /* ModR/M.rm := op(VEX.vvvv, ModR/M.reg) */ + x->d86_numopnds = 3; + + dtrace_get_modrm(x, &mode, ®, &r_m); + dtrace_vex_adjust(vex_byte1, mode, ®, &r_m); + + if (mode != REG_ONLY) { + if ((dp == &dis_opAVXF20F[0x11]) || + (dp == &dis_opAVXF30F[0x11])) { + /* vmovsd <xmm>, <m64> */ + /* or vmovss <xmm>, <m64> */ + x->d86_numopnds = 2; + goto L_VEX_RM; + } + } + + dtrace_get_operand(x, mode, r_m, wbit, 2); + dtrace_get_operand(x, REG_ONLY, (0xF - vex_v), wbit, 1); + dtrace_get_operand(x, REG_ONLY, reg, wbit, 0); + break; + + case VEX_RMRX: + /* ModR/M.reg := op(VEX.vvvv, ModR/M.r_m, imm8[7:4]) */ + x->d86_numopnds = 4; + + dtrace_get_modrm(x, &mode, ®, &r_m); + dtrace_vex_adjust(vex_byte1, mode, ®, &r_m); + dtrace_get_operand(x, REG_ONLY, reg, wbit, 3); + dtrace_get_operand(x, REG_ONLY, (0xF - vex_v), wbit, 2); + if (dp == &dis_opAVX660F3A[0x18]) { + /* vinsertf128 <imm8>, <xmm>, <ymm>, <ymm> */ + dtrace_get_operand(x, mode, r_m, XMM_OPND, 1); + } else if ((dp == &dis_opAVX660F3A[0x20]) || + (dp == & dis_opAVX660F[0xC4])) { + /* vpinsrb <imm8>, <reg/mm>, <xmm>, <xmm> */ + /* or vpinsrw <imm8>, <reg/mm>, <xmm>, <xmm> */ + dtrace_get_operand(x, mode, r_m, LONG_OPND, 1); + } else if (dp == &dis_opAVX660F3A[0x22]) { + /* vpinsrd/q <imm8>, <reg/mm>, <xmm>, <xmm> */ +#ifdef DIS_TEXT + if (vex_W) + x->d86_mnem[6] = 'q'; +#endif + dtrace_get_operand(x, mode, r_m, LONG_OPND, 1); + } else { + dtrace_get_operand(x, mode, r_m, wbit, 1); + } + + /* one byte immediate number */ + dtrace_imm_opnd(x, wbit, 1, 0); + + /* vblendvpd, vblendvps, vblendvb use the imm encode the regs */ + if ((dp == &dis_opAVX660F3A[0x4A]) || + (dp == &dis_opAVX660F3A[0x4B]) || + (dp == &dis_opAVX660F3A[0x4C])) { +#ifdef DIS_TEXT + int regnum = (x->d86_opnd[0].d86_value & 0xF0) >> 4; +#endif + x->d86_opnd[0].d86_mode = MODE_NONE; +#ifdef DIS_TEXT + if (vex_L) + (void) strncpy(x->d86_opnd[0].d86_opnd, + dis_YMMREG[regnum], OPLEN); + else + (void) strncpy(x->d86_opnd[0].d86_opnd, + dis_XMMREG[regnum], OPLEN); +#endif + } + break; + + case VEX_MX: + /* ModR/M.reg := op(ModR/M.rm) */ + x->d86_numopnds = 2; + + dtrace_get_modrm(x, &mode, ®, &r_m); + dtrace_vex_adjust(vex_byte1, mode, ®, &r_m); +L_VEX_MX: + + if ((dp == &dis_opAVXF20F[0xE6]) || + (dp == &dis_opAVX660F[0x5A]) || + (dp == &dis_opAVX660F[0xE6])) { + /* vcvtpd2dq <ymm>, <xmm> */ + /* or vcvtpd2ps <ymm>, <xmm> */ + /* or vcvttpd2dq <ymm>, <xmm> */ + dtrace_get_operand(x, REG_ONLY, reg, XMM_OPND, 1); + dtrace_get_operand(x, mode, r_m, wbit, 0); + } else if ((dp == &dis_opAVXF30F[0xE6]) || + (dp == &dis_opAVX0F[0x5][0xA])) { + /* vcvtdq2pd <xmm>, <ymm> */ + /* or vcvtps2pd <xmm>, <ymm> */ + dtrace_get_operand(x, REG_ONLY, reg, wbit, 1); + dtrace_get_operand(x, mode, r_m, XMM_OPND, 0); + } else if (dp == &dis_opAVX660F[0x6E]) { + /* vmovd/q <reg/mem 32/64>, <xmm> */ +#ifdef DIS_TEXT + if (vex_W) + x->d86_mnem[4] = 'q'; +#endif + dtrace_get_operand(x, REG_ONLY, reg, wbit, 1); + dtrace_get_operand(x, mode, r_m, LONG_OPND, 0); + } else { + dtrace_get_operand(x, REG_ONLY, reg, wbit, 1); + dtrace_get_operand(x, mode, r_m, wbit, 0); + } + + break; + + case VEX_MXI: + /* ModR/M.reg := op(ModR/M.rm, imm8) */ + x->d86_numopnds = 3; + + dtrace_get_modrm(x, &mode, ®, &r_m); + dtrace_vex_adjust(vex_byte1, mode, ®, &r_m); + + dtrace_get_operand(x, REG_ONLY, reg, wbit, 2); + dtrace_get_operand(x, mode, r_m, wbit, 1); + + /* one byte immediate number */ + dtrace_imm_opnd(x, wbit, 1, 0); + break; + + case VEX_XXI: + /* VEX.vvvv := op(ModR/M.rm, imm8) */ + x->d86_numopnds = 3; + + dtrace_get_modrm(x, &mode, ®, &r_m); +#ifdef DIS_TEXT + (void) strncpy(x->d86_mnem, dis_AVXvgrp7[opcode2 - 1][reg], + OPLEN); +#endif + dtrace_vex_adjust(vex_byte1, mode, ®, &r_m); + + dtrace_get_operand(x, REG_ONLY, (0xF - vex_v), wbit, 2); + dtrace_get_operand(x, REG_ONLY, r_m, wbit, 1); + + /* one byte immediate number */ + dtrace_imm_opnd(x, wbit, 1, 0); + break; + + case VEX_MR: + /* ModR/M.reg (reg32/64) := op(ModR/M.rm) */ + if (dp == &dis_opAVX660F[0xC5]) { + /* vpextrw <imm8>, <xmm>, <reg> */ + x->d86_numopnds = 2; + vbit = 2; + } else { + x->d86_numopnds = 2; + vbit = 1; + } + + dtrace_get_modrm(x, &mode, ®, &r_m); + dtrace_vex_adjust(vex_byte1, mode, ®, &r_m); + dtrace_get_operand(x, REG_ONLY, reg, LONG_OPND, vbit); + dtrace_get_operand(x, mode, r_m, wbit, vbit - 1); + + if (vbit == 2) + dtrace_imm_opnd(x, wbit, 1, 0); + + break; + + case VEX_RRI: + /* implicit(eflags/r32) := op(ModR/M.reg, ModR/M.rm) */ + x->d86_numopnds = 2; + + dtrace_get_modrm(x, &mode, ®, &r_m); + dtrace_vex_adjust(vex_byte1, mode, ®, &r_m); + dtrace_get_operand(x, REG_ONLY, reg, wbit, 1); + dtrace_get_operand(x, mode, r_m, wbit, 0); + break; + + case VEX_RX: + /* ModR/M.rm := op(ModR/M.reg) */ + if (dp == &dis_opAVX660F3A[0x19]) { /* vextractf128 */ + x->d86_numopnds = 3; + + dtrace_get_modrm(x, &mode, ®, &r_m); + dtrace_vex_adjust(vex_byte1, mode, ®, &r_m); + + dtrace_get_operand(x, mode, r_m, XMM_OPND, 2); + dtrace_get_operand(x, REG_ONLY, reg, wbit, 1); + + /* one byte immediate number */ + dtrace_imm_opnd(x, wbit, 1, 0); + break; + } + + x->d86_numopnds = 2; + + dtrace_get_modrm(x, &mode, ®, &r_m); + dtrace_vex_adjust(vex_byte1, mode, ®, &r_m); + dtrace_get_operand(x, mode, r_m, wbit, 1); + dtrace_get_operand(x, REG_ONLY, reg, wbit, 0); + break; + + case VEX_RR: + /* ModR/M.rm := op(ModR/M.reg) */ + x->d86_numopnds = 2; + + dtrace_get_modrm(x, &mode, ®, &r_m); + dtrace_vex_adjust(vex_byte1, mode, ®, &r_m); + + if (dp == &dis_opAVX660F[0x7E]) { + /* vmovd/q <reg/mem 32/64>, <xmm> */ +#ifdef DIS_TEXT + if (vex_W) + x->d86_mnem[4] = 'q'; +#endif + dtrace_get_operand(x, mode, r_m, LONG_OPND, 1); + } else + dtrace_get_operand(x, mode, r_m, wbit, 1); + + dtrace_get_operand(x, REG_ONLY, reg, wbit, 0); + break; + + case VEX_RRi: + /* ModR/M.rm := op(ModR/M.reg, imm) */ + x->d86_numopnds = 3; + + dtrace_get_modrm(x, &mode, ®, &r_m); + dtrace_vex_adjust(vex_byte1, mode, ®, &r_m); + +#ifdef DIS_TEXT + if (dp == &dis_opAVX660F3A[0x16]) { + /* vpextrd/q <imm>, <xmm>, <reg/mem 32/64> */ + if (vex_W) + x->d86_mnem[6] = 'q'; + } +#endif + dtrace_get_operand(x, mode, r_m, LONG_OPND, 2); + dtrace_get_operand(x, REG_ONLY, reg, wbit, 1); + + /* one byte immediate number */ + dtrace_imm_opnd(x, wbit, 1, 0); + break; + + case VEX_RM: + /* ModR/M.rm := op(ModR/M.reg) */ + if (dp == &dis_opAVX660F3A[0x17]) { /* vextractps */ + x->d86_numopnds = 3; + + dtrace_get_modrm(x, &mode, ®, &r_m); + dtrace_vex_adjust(vex_byte1, mode, ®, &r_m); + + dtrace_get_operand(x, mode, r_m, LONG_OPND, 2); + dtrace_get_operand(x, REG_ONLY, reg, wbit, 1); + /* one byte immediate number */ + dtrace_imm_opnd(x, wbit, 1, 0); + break; + } + x->d86_numopnds = 2; + + dtrace_get_modrm(x, &mode, ®, &r_m); + dtrace_vex_adjust(vex_byte1, mode, ®, &r_m); +L_VEX_RM: + vbit = 1; + dtrace_get_operand(x, mode, r_m, wbit, vbit); + dtrace_get_operand(x, REG_ONLY, reg, wbit, vbit - 1); + + break; + + case VEX_RRM: + /* ModR/M.rm := op(VEX.vvvv, ModR/M.reg) */ + x->d86_numopnds = 3; + + dtrace_get_modrm(x, &mode, ®, &r_m); + dtrace_vex_adjust(vex_byte1, mode, ®, &r_m); + dtrace_get_operand(x, mode, r_m, wbit, 2); + /* VEX use the 1's complement form encode the XMM/YMM regs */ + dtrace_get_operand(x, REG_ONLY, (0xF - vex_v), wbit, 1); + dtrace_get_operand(x, REG_ONLY, reg, wbit, 0); + break; + + case VEX_RMX: + /* ModR/M.reg := op(VEX.vvvv, ModR/M.rm) */ + x->d86_numopnds = 3; + + dtrace_get_modrm(x, &mode, ®, &r_m); + dtrace_vex_adjust(vex_byte1, mode, ®, &r_m); + dtrace_get_operand(x, REG_ONLY, reg, wbit, 2); + dtrace_get_operand(x, REG_ONLY, (0xF - vex_v), wbit, 1); + dtrace_get_operand(x, REG_ONLY, r_m, wbit, 0); + break; + + case VEX_NONE: +#ifdef DIS_TEXT + if (vex_L) + (void) strncpy(x->d86_mnem, "vzeroall", OPLEN); +#endif + break; /* an invalid op code */ case AM: case DM: @@ -3025,7 +4572,7 @@ done: error: #ifdef DIS_TEXT - (void) strlcat(x->d86_mneu, "undef", OPLEN); + (void) strlcat(x->d86_mnem, "undef", OPLEN); #endif return (1); } @@ -3042,6 +4589,7 @@ static char *unsigned_ops[] = { 0 }; + static int isunsigned_op(char *opcode) { @@ -3069,14 +4617,81 @@ isunsigned_op(char *opcode) return (is_unsigned); } +/* + * Print a numeric immediate into end of buf, maximum length buflen. + * The immediate may be an address or a displacement. Mask is set + * for address size. If the immediate is a "small negative", or + * if it's a negative displacement of any magnitude, print as -<absval>. + * Respect the "octal" flag. "Small negative" is defined as "in the + * interval [NEG_LIMIT, 0)". + * + * Also, "isunsigned_op()" instructions never print negatives. + * + * Return whether we decided to print a negative value or not. + */ + +#define NEG_LIMIT -255 +enum {IMM, DISP}; +enum {POS, TRY_NEG}; + +static int +print_imm(dis86_t *dis, uint64_t usv, uint64_t mask, char *buf, + size_t buflen, int disp, int try_neg) +{ + int curlen; + int64_t sv = (int64_t)usv; + int octal = dis->d86_flags & DIS_F_OCTAL; + + curlen = strlen(buf); + + if (try_neg == TRY_NEG && sv < 0 && + (disp || sv >= NEG_LIMIT) && + !isunsigned_op(dis->d86_mnem)) { + dis->d86_sprintf_func(buf + curlen, buflen - curlen, + octal ? "-0%llo" : "-0x%llx", (-sv) & mask); + return (1); + } else { + if (disp == DISP) + dis->d86_sprintf_func(buf + curlen, buflen - curlen, + octal ? "+0%llo" : "+0x%llx", usv & mask); + else + dis->d86_sprintf_func(buf + curlen, buflen - curlen, + octal ? "0%llo" : "0x%llx", usv & mask); + return (0); + + } +} + + +static int +log2(int size) +{ + switch (size) { + case 1: return (0); + case 2: return (1); + case 4: return (2); + case 8: return (3); + } + return (0); +} + /* ARGSUSED */ void -dtrace_disx86_str(dis86_t *dis, uint_t mode, uintptr_t pc, char *buf, +dtrace_disx86_str(dis86_t *dis, uint_t mode, uint64_t pc, char *buf, size_t buflen) { + uint64_t reltgt = 0; + uint64_t tgt = 0; + int curlen; + int (*lookup)(void *, uint64_t, char *, size_t); int i; + int64_t sv; + uint64_t usv, mask, save_mask, save_usv; + static uint64_t masks[] = + {0xffU, 0xffffU, 0xffffffffU, 0xffffffffffffffffULL}; + save_usv = 0; - dis->d86_sprintf_func(buf, buflen, "%-6s ", dis->d86_mneu); + dis->d86_sprintf_func(buf, buflen, "%-6s ", dis->d86_mnem); /* * For PC-relative jumps, the pc is really the next pc after executing @@ -3086,15 +4701,37 @@ dtrace_disx86_str(dis86_t *dis, uint_t mode, uintptr_t pc, char *buf, for (i = 0; i < dis->d86_numopnds; i++) { d86opnd_t *op = &dis->d86_opnd[i]; - int64_t sv; - uint64_t mask; if (i != 0) (void) strlcat(buf, ",", buflen); (void) strlcat(buf, op->d86_prefix, buflen); - sv = op->d86_value; + /* + * sv is for the signed, possibly-truncated immediate or + * displacement; usv retains the original size and + * unsignedness for symbol lookup. + */ + + sv = usv = op->d86_value; + + /* + * About masks: for immediates that represent + * addresses, the appropriate display size is + * the effective address size of the instruction. + * This includes MODE_OFFSET, MODE_IPREL, and + * MODE_RIPREL. Immediates that are simply + * immediate values should display in the operand's + * size, however, since they don't represent addresses. + */ + + /* d86_addr_size is SIZEnn, which is log2(real size) */ + mask = masks[dis->d86_addr_size]; + + /* d86_value_size and d86_imm_bytes are in bytes */ + if (op->d86_mode == MODE_SIGNED || + op->d86_mode == MODE_IMPLIED) + mask = masks[log2(op->d86_value_size)]; switch (op->d86_mode) { @@ -3107,87 +4744,98 @@ dtrace_disx86_str(dis86_t *dis, uint_t mode, uintptr_t pc, char *buf, case MODE_IMPLIED: case MODE_OFFSET: + tgt = usv; + if (dis->d86_seg_prefix) (void) strlcat(buf, dis->d86_seg_prefix, buflen); - switch (op->d86_value_size) { - case 1: - sv = (int8_t)sv; - mask = 0xff; - break; - case 2: - sv = (int16_t)sv; - mask = 0xffff; - break; - case 4: - sv = (int32_t)sv; - mask = 0xffffffff; - break; - case 8: - mask = 0xffffffffffffffffULL; - break; - } - if (op->d86_mode == MODE_SIGNED || - op->d86_mode == MODE_IMPLIED) + op->d86_mode == MODE_IMPLIED) { (void) strlcat(buf, "$", buflen); + } - if (sv < 0 && sv > -0xffff && - !isunsigned_op(dis->d86_mneu)) { - dis->d86_sprintf_func(buf + strlen(buf), - buflen - strlen(buf), - (dis->d86_flags & DIS_OP_OCTAL) ? - "-0%llo" : "-0x%llx", -sv & mask); - } else { - dis->d86_sprintf_func(buf + strlen(buf), - buflen - strlen(buf), - (dis->d86_flags & DIS_OP_OCTAL) ? - "0%llo" : "0x%llx", sv & mask); + if (print_imm(dis, usv, mask, buf, buflen, + IMM, TRY_NEG) && + (op->d86_mode == MODE_SIGNED || + op->d86_mode == MODE_IMPLIED)) { + + /* + * We printed a negative value for an + * immediate that wasn't a + * displacement. Note that fact so we can + * print the positive value as an + * annotation. + */ + + save_usv = usv; + save_mask = mask; } (void) strlcat(buf, op->d86_opnd, buflen); + break; case MODE_IPREL: + case MODE_RIPREL: - switch (op->d86_value_size) { - case 1: - sv = (int8_t)sv; - break; - case 2: - sv = (int16_t)sv; + reltgt = pc + sv; + + switch (mode) { + case SIZE16: + reltgt = (uint16_t)reltgt; break; - case 4: - sv = (int32_t)sv; + case SIZE32: + reltgt = (uint32_t)reltgt; break; } - if (sv < 0) - dis->d86_sprintf_func(buf + strlen(buf), - buflen - strlen(buf), - (dis->d86_flags & DIS_OP_OCTAL) ? - "-0%llo" : "-0x%llx", -sv - dis->d86_len); - else - dis->d86_sprintf_func(buf + strlen(buf), - buflen - strlen(buf), - (dis->d86_flags & DIS_OP_OCTAL) ? - "+0%llo" : "+0x%llx", sv + dis->d86_len); + (void) print_imm(dis, usv, mask, buf, buflen, + DISP, TRY_NEG); - (void) strlcat(buf, "\t<", buflen); + if (op->d86_mode == MODE_RIPREL) + (void) strlcat(buf, "(%rip)", buflen); + break; + } + } - if (dis->d86_sym_lookup == NULL || - dis->d86_sym_lookup(dis->d86_data, pc + sv, - buf + strlen(buf), buflen - strlen(buf)) != 0) - dis->d86_sprintf_func(buf + strlen(buf), - buflen - strlen(buf), - (dis->d86_flags & DIS_OP_OCTAL) ? - "0%llo" : "0x%llx", pc + sv); + /* + * The symbol lookups may result in false positives, + * particularly on object files, where small numbers may match + * the 0-relative non-relocated addresses of symbols. + */ + lookup = dis->d86_sym_lookup; + if (tgt != 0) { + if ((dis->d86_flags & DIS_F_NOIMMSYM) == 0 && + lookup(dis->d86_data, tgt, NULL, 0) == 0) { + (void) strlcat(buf, "\t<", buflen); + curlen = strlen(buf); + lookup(dis->d86_data, tgt, buf + curlen, + buflen - curlen); (void) strlcat(buf, ">", buflen); + } - break; + /* + * If we printed a negative immediate above, print the + * positive in case our heuristic was unhelpful + */ + if (save_usv) { + (void) strlcat(buf, "\t<", buflen); + (void) print_imm(dis, save_usv, save_mask, buf, buflen, + IMM, POS); + (void) strlcat(buf, ">", buflen); } } + + if (reltgt != 0) { + /* Print symbol or effective address for reltgt */ + + (void) strlcat(buf, "\t<", buflen); + curlen = strlen(buf); + lookup(dis->d86_data, reltgt, buf + curlen, + buflen - curlen); + (void) strlcat(buf, ">", buflen); + } } #endif /* DIS_TEXT */ diff --git a/sys/cddl/dev/dtrace/i386/dis_tables.h b/sys/cddl/dev/dtrace/i386/dis_tables.h index b45a8c50e738..758fc40bac18 100644 --- a/sys/cddl/dev/dtrace/i386/dis_tables.h +++ b/sys/cddl/dev/dtrace/i386/dis_tables.h @@ -17,25 +17,22 @@ * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END - * - * $FreeBSD$ */ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ /* Copyright (c) 1988 AT&T */ /* All Rights Reserved */ +/* + * $FreeBSD$ + */ #ifndef _DIS_TABLES_H #define _DIS_TABLES_H -#if defined(sun) -#pragma ident "@(#)dis_tables.h 1.7 06/03/02 SMI" -#endif - /* * Constants and prototypes for the IA32 disassembler backend. See dis_tables.c * for usage information and documentation. @@ -57,7 +54,7 @@ extern "C" { #define OPLEN 256 #define PFIXLEN 8 -#define NCPS 12 /* number of chars per symbol */ +#define NCPS 20 /* number of chars per symbol */ /* * data structures that must be provided to dtrace_dis86() @@ -77,14 +74,14 @@ typedef struct dis86 { int d86_rmindex; /* index of modrm byte or -1 */ uint_t d86_memsize; /* size of memory referenced */ char d86_bytes[16]; /* bytes of instruction */ - char d86_mneu[OPLEN]; + char d86_mnem[OPLEN]; uint_t d86_numopnds; uint_t d86_rex_prefix; /* value of REX prefix if !0 */ char *d86_seg_prefix; /* segment prefix, if any */ uint_t d86_opnd_size; uint_t d86_addr_size; uint_t d86_got_modrm; - struct d86opnd d86_opnd[3]; /* up to 3 operands */ + struct d86opnd d86_opnd[4]; /* up to 4 operands */ int (*d86_check_func)(void *); int (*d86_get_byte)(void *); #ifdef DIS_TEXT @@ -98,10 +95,11 @@ typedef struct dis86 { extern int dtrace_disx86(dis86_t *x, uint_t cpu_mode); -#define DIS_OP_OCTAL 0x1 /* Print all numbers in octal */ +#define DIS_F_OCTAL 0x1 /* Print all numbers in octal */ +#define DIS_F_NOIMMSYM 0x2 /* Don't print symbols for immediates (.o) */ #ifdef DIS_TEXT -extern void dtrace_disx86_str(dis86_t *x, uint_t cpu_mode, uintptr_t pc, +extern void dtrace_disx86_str(dis86_t *x, uint_t cpu_mode, uint64_t pc, char *buf, size_t len); #endif diff --git a/sys/compat/freebsd32/freebsd32.h b/sys/compat/freebsd32/freebsd32.h index a95b0e53e04a..9b04965e2d9a 100644 --- a/sys/compat/freebsd32/freebsd32.h +++ b/sys/compat/freebsd32/freebsd32.h @@ -69,6 +69,15 @@ struct timespec32 { CP((src).fld,(dst).fld,tv_nsec); \ } while (0) +struct itimerspec32 { + struct timespec32 it_interval; + struct timespec32 it_value; +}; +#define ITS_CP(src, dst) do { \ + TS_CP((src), (dst), it_interval); \ + TS_CP((src), (dst), it_value); \ +} while (0) + struct rusage32 { struct timeval32 ru_utime; struct timeval32 ru_stime; diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c index dd8d4f742cae..4899e038bd4c 100644 --- a/sys/compat/freebsd32/freebsd32_misc.c +++ b/sys/compat/freebsd32/freebsd32_misc.c @@ -2331,6 +2331,84 @@ freebsd32_clock_getres(struct thread *td, return (error); } +int freebsd32_ktimer_create(struct thread *td, + struct freebsd32_ktimer_create_args *uap) +{ + struct sigevent32 ev32; + struct sigevent ev, *evp; + int error, id; + + if (uap->evp == NULL) { + evp = NULL; + } else { + evp = &ev; + error = copyin(uap->evp, &ev32, sizeof(ev32)); + if (error != 0) + return (error); + error = convert_sigevent32(&ev32, &ev); + if (error != 0) + return (error); + } + error = kern_ktimer_create(td, uap->clock_id, evp, &id, -1); + if (error == 0) { + error = copyout(&id, uap->timerid, sizeof(int)); + if (error != 0) + kern_ktimer_delete(td, id); + } + return (error); +} + +int +freebsd32_ktimer_settime(struct thread *td, + struct freebsd32_ktimer_settime_args *uap) +{ + struct itimerspec32 val32, oval32; + struct itimerspec val, oval, *ovalp; + int error; + + error = copyin(uap->value, &val32, sizeof(val32)); + if (error != 0) + return (error); + ITS_CP(val32, val); + ovalp = uap->ovalue != NULL ? &oval : NULL; + error = kern_ktimer_settime(td, uap->timerid, uap->flags, &val, ovalp); + if (error == 0 && uap->ovalue != NULL) { + ITS_CP(oval, oval32); + error = copyout(&oval32, uap->ovalue, sizeof(oval32)); + } + return (error); +} + +int +freebsd32_ktimer_gettime(struct thread *td, + struct freebsd32_ktimer_gettime_args *uap) +{ + struct itimerspec32 val32; + struct itimerspec val; + int error; + + error = kern_ktimer_gettime(td, uap->timerid, &val); + if (error == 0) { + ITS_CP(val, val32); + error = copyout(&val32, uap->value, sizeof(val32)); + } + return (error); +} + +int +freebsd32_clock_getcpuclockid2(struct thread *td, + struct freebsd32_clock_getcpuclockid2_args *uap) +{ + clockid_t clk_id; + int error; + + error = kern_clock_getcpuclockid2(td, PAIR32TO64(id_t, uap->id), + uap->which, &clk_id); + if (error == 0) + error = copyout(&clk_id, uap->clock_id, sizeof(clockid_t)); + return (error); +} + int freebsd32_thr_new(struct thread *td, struct freebsd32_thr_new_args *uap) @@ -2396,7 +2474,7 @@ siginfo_to_siginfo32(const siginfo_t *src, struct siginfo32 *dst) dst->si_uid = src->si_uid; dst->si_status = src->si_status; dst->si_addr = (uintptr_t)src->si_addr; - dst->si_value.sigval_int = src->si_value.sival_int; + dst->si_value.sival_int = src->si_value.sival_int; dst->si_timerid = src->si_timerid; dst->si_overrun = src->si_overrun; } @@ -2898,3 +2976,29 @@ freebsd32_posix_fadvise(struct thread *td, return (kern_posix_fadvise(td, uap->fd, PAIR32TO64(off_t, uap->offset), PAIR32TO64(off_t, uap->len), uap->advice)); } + +int +convert_sigevent32(struct sigevent32 *sig32, struct sigevent *sig) +{ + + CP(*sig32, *sig, sigev_notify); + switch (sig->sigev_notify) { + case SIGEV_NONE: + break; + case SIGEV_THREAD_ID: + CP(*sig32, *sig, sigev_notify_thread_id); + /* FALLTHROUGH */ + case SIGEV_SIGNAL: + CP(*sig32, *sig, sigev_signo); + PTRIN_CP(*sig32, *sig, sigev_value.sival_ptr); + break; + case SIGEV_KEVENT: + CP(*sig32, *sig, sigev_notify_kqueue); + CP(*sig32, *sig, sigev_notify_kevent_flags); + PTRIN_CP(*sig32, *sig, sigev_value.sival_ptr); + break; + default: + return (EINVAL); + } + return (0); +} diff --git a/sys/compat/freebsd32/freebsd32_proto.h b/sys/compat/freebsd32/freebsd32_proto.h index f1f444cf2c18..39cb0fa64f36 100644 --- a/sys/compat/freebsd32/freebsd32_proto.h +++ b/sys/compat/freebsd32/freebsd32_proto.h @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 251526 2013-06-08 13:27:57Z glebius + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 253530 2013-07-21 19:43:52Z kib */ #ifndef _FREEBSD32_SYSPROTO_H_ @@ -208,10 +208,31 @@ struct freebsd32_clock_getres_args { char clock_id_l_[PADL_(clockid_t)]; clockid_t clock_id; char clock_id_r_[PADR_(clockid_t)]; char tp_l_[PADL_(struct timespec32 *)]; struct timespec32 * tp; char tp_r_[PADR_(struct timespec32 *)]; }; +struct freebsd32_ktimer_create_args { + char clock_id_l_[PADL_(clockid_t)]; clockid_t clock_id; char clock_id_r_[PADR_(clockid_t)]; + char evp_l_[PADL_(struct sigevent32 *)]; struct sigevent32 * evp; char evp_r_[PADR_(struct sigevent32 *)]; + char timerid_l_[PADL_(int *)]; int * timerid; char timerid_r_[PADR_(int *)]; +}; +struct freebsd32_ktimer_settime_args { + char timerid_l_[PADL_(int)]; int timerid; char timerid_r_[PADR_(int)]; + char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; + char value_l_[PADL_(const struct itimerspec32 *)]; const struct itimerspec32 * value; char value_r_[PADR_(const struct itimerspec32 *)]; + char ovalue_l_[PADL_(struct itimerspec32 *)]; struct itimerspec32 * ovalue; char ovalue_r_[PADR_(struct itimerspec32 *)]; +}; +struct freebsd32_ktimer_gettime_args { + char timerid_l_[PADL_(int)]; int timerid; char timerid_r_[PADR_(int)]; + char value_l_[PADL_(struct itimerspec32 *)]; struct itimerspec32 * value; char value_r_[PADR_(struct itimerspec32 *)]; +}; struct freebsd32_nanosleep_args { char rqtp_l_[PADL_(const struct timespec32 *)]; const struct timespec32 * rqtp; char rqtp_r_[PADR_(const struct timespec32 *)]; char rmtp_l_[PADL_(struct timespec32 *)]; struct timespec32 * rmtp; char rmtp_r_[PADR_(struct timespec32 *)]; }; +struct freebsd32_clock_getcpuclockid2_args { + char id1_l_[PADL_(uint32_t)]; uint32_t id1; char id1_r_[PADR_(uint32_t)]; + char id2_l_[PADL_(uint32_t)]; uint32_t id2; char id2_r_[PADR_(uint32_t)]; + char which_l_[PADL_(int)]; int which; char which_r_[PADR_(int)]; + char clock_id_l_[PADL_(clockid_t *)]; clockid_t * clock_id; char clock_id_r_[PADR_(clockid_t *)]; +}; struct freebsd32_aio_read_args { char aiocbp_l_[PADL_(struct aiocb32 *)]; struct aiocb32 * aiocbp; char aiocbp_r_[PADR_(struct aiocb32 *)]; }; @@ -222,7 +243,7 @@ struct freebsd32_lio_listio_args { char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)]; char acb_list_l_[PADL_(struct aiocb32 *const *)]; struct aiocb32 *const * acb_list; char acb_list_r_[PADR_(struct aiocb32 *const *)]; char nent_l_[PADL_(int)]; int nent; char nent_r_[PADR_(int)]; - char sig_l_[PADL_(struct sigevent *)]; struct sigevent * sig; char sig_r_[PADR_(struct sigevent *)]; + char sig_l_[PADL_(struct sigevent32 *)]; struct sigevent32 * sig; char sig_r_[PADR_(struct sigevent32 *)]; }; struct freebsd32_lutimes_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; @@ -394,6 +415,10 @@ struct freebsd32_kmq_timedsend_args { char msg_prio_l_[PADL_(unsigned)]; unsigned msg_prio; char msg_prio_r_[PADR_(unsigned)]; char abs_timeout_l_[PADL_(const struct timespec32 *)]; const struct timespec32 * abs_timeout; char abs_timeout_r_[PADR_(const struct timespec32 *)]; }; +struct freebsd32_kmq_notify_args { + char mqd_l_[PADL_(int)]; int mqd; char mqd_r_[PADR_(int)]; + char sigev_l_[PADL_(const struct sigevent32 *)]; const struct sigevent32 * sigev; char sigev_r_[PADR_(const struct sigevent32 *)]; +}; struct freebsd32_aio_fsync_args { char op_l_[PADL_(int)]; int op; char op_r_[PADR_(int)]; char aiocbp_l_[PADL_(struct aiocb32 *)]; struct aiocb32 * aiocbp; char aiocbp_r_[PADR_(struct aiocb32 *)]; @@ -667,7 +692,11 @@ int freebsd32_msgrcv(struct thread *, struct freebsd32_msgrcv_args *); int freebsd32_clock_gettime(struct thread *, struct freebsd32_clock_gettime_args *); int freebsd32_clock_settime(struct thread *, struct freebsd32_clock_settime_args *); int freebsd32_clock_getres(struct thread *, struct freebsd32_clock_getres_args *); +int freebsd32_ktimer_create(struct thread *, struct freebsd32_ktimer_create_args *); +int freebsd32_ktimer_settime(struct thread *, struct freebsd32_ktimer_settime_args *); +int freebsd32_ktimer_gettime(struct thread *, struct freebsd32_ktimer_gettime_args *); int freebsd32_nanosleep(struct thread *, struct freebsd32_nanosleep_args *); +int freebsd32_clock_getcpuclockid2(struct thread *, struct freebsd32_clock_getcpuclockid2_args *); int freebsd32_aio_read(struct thread *, struct freebsd32_aio_read_args *); int freebsd32_aio_write(struct thread *, struct freebsd32_aio_write_args *); int freebsd32_lio_listio(struct thread *, struct freebsd32_lio_listio_args *); @@ -707,6 +736,7 @@ int freebsd32_kmq_open(struct thread *, struct freebsd32_kmq_open_args *); int freebsd32_kmq_setattr(struct thread *, struct freebsd32_kmq_setattr_args *); int freebsd32_kmq_timedreceive(struct thread *, struct freebsd32_kmq_timedreceive_args *); int freebsd32_kmq_timedsend(struct thread *, struct freebsd32_kmq_timedsend_args *); +int freebsd32_kmq_notify(struct thread *, struct freebsd32_kmq_notify_args *); int freebsd32_aio_fsync(struct thread *, struct freebsd32_aio_fsync_args *); #ifdef PAD64_REQUIRED int freebsd32_pread(struct thread *, struct freebsd32_pread_args *); @@ -1065,7 +1095,11 @@ int freebsd7_freebsd32_shmctl(struct thread *, struct freebsd7_freebsd32_shmctl_ #define FREEBSD32_SYS_AUE_freebsd32_clock_gettime AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_clock_settime AUE_CLOCK_SETTIME #define FREEBSD32_SYS_AUE_freebsd32_clock_getres AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_ktimer_create AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_ktimer_settime AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_ktimer_gettime AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_nanosleep AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_clock_getcpuclockid2 AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_aio_read AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_aio_write AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_lio_listio AUE_NULL @@ -1109,6 +1143,7 @@ int freebsd7_freebsd32_shmctl(struct thread *, struct freebsd7_freebsd32_shmctl_ #define FREEBSD32_SYS_AUE_freebsd32_kmq_setattr AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_kmq_timedreceive AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_kmq_timedsend AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_kmq_notify AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_aio_fsync AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_pread AUE_PREAD #define FREEBSD32_SYS_AUE_freebsd32_pwrite AUE_PWRITE diff --git a/sys/compat/freebsd32/freebsd32_signal.h b/sys/compat/freebsd32/freebsd32_signal.h index d31a8ae6b002..18899f8e5daf 100644 --- a/sys/compat/freebsd32/freebsd32_signal.h +++ b/sys/compat/freebsd32/freebsd32_signal.h @@ -97,6 +97,8 @@ struct sigevent32 { } _sigev_un; }; +struct sigevent; +int convert_sigevent32(struct sigevent32 *sig32, struct sigevent *sig); void siginfo_to_siginfo32(const siginfo_t *src, struct siginfo32 *dst); #endif /* !_COMPAT_FREEBSD32_SIGNAL_H_ */ diff --git a/sys/compat/freebsd32/freebsd32_syscall.h b/sys/compat/freebsd32/freebsd32_syscall.h index 8c36fee842cd..53fcd97116f7 100644 --- a/sys/compat/freebsd32/freebsd32_syscall.h +++ b/sys/compat/freebsd32/freebsd32_syscall.h @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 251526 2013-06-08 13:27:57Z glebius + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 253530 2013-07-21 19:43:52Z kib */ #define FREEBSD32_SYS_syscall 0 @@ -206,11 +206,16 @@ #define FREEBSD32_SYS_freebsd32_clock_gettime 232 #define FREEBSD32_SYS_freebsd32_clock_settime 233 #define FREEBSD32_SYS_freebsd32_clock_getres 234 +#define FREEBSD32_SYS_freebsd32_ktimer_create 235 +#define FREEBSD32_SYS_ktimer_delete 236 +#define FREEBSD32_SYS_freebsd32_ktimer_settime 237 +#define FREEBSD32_SYS_freebsd32_ktimer_gettime 238 +#define FREEBSD32_SYS_ktimer_getoverrun 239 #define FREEBSD32_SYS_freebsd32_nanosleep 240 #define FREEBSD32_SYS_ffclock_getcounter 241 #define FREEBSD32_SYS_ffclock_setestimate 242 #define FREEBSD32_SYS_ffclock_getestimate 243 -#define FREEBSD32_SYS_clock_getcpuclockid2 247 +#define FREEBSD32_SYS_freebsd32_clock_getcpuclockid2 247 #define FREEBSD32_SYS_minherit 250 #define FREEBSD32_SYS_rfork 251 #define FREEBSD32_SYS_openbsd_poll 252 @@ -360,7 +365,7 @@ #define FREEBSD32_SYS_freebsd32_kmq_setattr 458 #define FREEBSD32_SYS_freebsd32_kmq_timedreceive 459 #define FREEBSD32_SYS_freebsd32_kmq_timedsend 460 -#define FREEBSD32_SYS_kmq_notify 461 +#define FREEBSD32_SYS_freebsd32_kmq_notify 461 #define FREEBSD32_SYS_kmq_unlink 462 #define FREEBSD32_SYS_abort2 463 #define FREEBSD32_SYS_thr_set_name 464 diff --git a/sys/compat/freebsd32/freebsd32_syscalls.c b/sys/compat/freebsd32/freebsd32_syscalls.c index 9b643f907407..5008edb6e005 100644 --- a/sys/compat/freebsd32/freebsd32_syscalls.c +++ b/sys/compat/freebsd32/freebsd32_syscalls.c @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 251526 2013-06-08 13:27:57Z glebius + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 253530 2013-07-21 19:43:52Z kib */ const char *freebsd32_syscallnames[] = { @@ -245,11 +245,11 @@ const char *freebsd32_syscallnames[] = { "freebsd32_clock_gettime", /* 232 = freebsd32_clock_gettime */ "freebsd32_clock_settime", /* 233 = freebsd32_clock_settime */ "freebsd32_clock_getres", /* 234 = freebsd32_clock_getres */ - "#235", /* 235 = timer_create */ - "#236", /* 236 = timer_delete */ - "#237", /* 237 = timer_settime */ - "#238", /* 238 = timer_gettime */ - "#239", /* 239 = timer_getoverrun */ + "freebsd32_ktimer_create", /* 235 = freebsd32_ktimer_create */ + "ktimer_delete", /* 236 = ktimer_delete */ + "freebsd32_ktimer_settime", /* 237 = freebsd32_ktimer_settime */ + "freebsd32_ktimer_gettime", /* 238 = freebsd32_ktimer_gettime */ + "ktimer_getoverrun", /* 239 = ktimer_getoverrun */ "freebsd32_nanosleep", /* 240 = freebsd32_nanosleep */ "ffclock_getcounter", /* 241 = ffclock_getcounter */ "ffclock_setestimate", /* 242 = ffclock_setestimate */ @@ -257,7 +257,7 @@ const char *freebsd32_syscallnames[] = { "#244", /* 244 = nosys */ "#245", /* 245 = nosys */ "#246", /* 246 = nosys */ - "clock_getcpuclockid2", /* 247 = clock_getcpuclockid2 */ + "freebsd32_clock_getcpuclockid2", /* 247 = freebsd32_clock_getcpuclockid2 */ "#248", /* 248 = ntp_gettime */ "#249", /* 249 = nosys */ "minherit", /* 250 = minherit */ @@ -471,7 +471,7 @@ const char *freebsd32_syscallnames[] = { "freebsd32_kmq_setattr", /* 458 = freebsd32_kmq_setattr */ "freebsd32_kmq_timedreceive", /* 459 = freebsd32_kmq_timedreceive */ "freebsd32_kmq_timedsend", /* 460 = freebsd32_kmq_timedsend */ - "kmq_notify", /* 461 = kmq_notify */ + "freebsd32_kmq_notify", /* 461 = freebsd32_kmq_notify */ "kmq_unlink", /* 462 = kmq_unlink */ "abort2", /* 463 = abort2 */ "thr_set_name", /* 464 = thr_set_name */ diff --git a/sys/compat/freebsd32/freebsd32_sysent.c b/sys/compat/freebsd32/freebsd32_sysent.c index d37e8e9ec46c..363f941a3a91 100644 --- a/sys/compat/freebsd32/freebsd32_sysent.c +++ b/sys/compat/freebsd32/freebsd32_sysent.c @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 251526 2013-06-08 13:27:57Z glebius + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 253530 2013-07-21 19:43:52Z kib */ #include "opt_compat.h" @@ -282,11 +282,11 @@ struct sysent freebsd32_sysent[] = { { AS(freebsd32_clock_gettime_args), (sy_call_t *)freebsd32_clock_gettime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 232 = freebsd32_clock_gettime */ { AS(freebsd32_clock_settime_args), (sy_call_t *)freebsd32_clock_settime, AUE_CLOCK_SETTIME, NULL, 0, 0, 0, SY_THR_STATIC }, /* 233 = freebsd32_clock_settime */ { AS(freebsd32_clock_getres_args), (sy_call_t *)freebsd32_clock_getres, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 234 = freebsd32_clock_getres */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 235 = timer_create */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 236 = timer_delete */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 237 = timer_settime */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 238 = timer_gettime */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 239 = timer_getoverrun */ + { AS(freebsd32_ktimer_create_args), (sy_call_t *)freebsd32_ktimer_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 235 = freebsd32_ktimer_create */ + { AS(ktimer_delete_args), (sy_call_t *)sys_ktimer_delete, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 236 = ktimer_delete */ + { AS(freebsd32_ktimer_settime_args), (sy_call_t *)freebsd32_ktimer_settime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 237 = freebsd32_ktimer_settime */ + { AS(freebsd32_ktimer_gettime_args), (sy_call_t *)freebsd32_ktimer_gettime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 238 = freebsd32_ktimer_gettime */ + { AS(ktimer_getoverrun_args), (sy_call_t *)sys_ktimer_getoverrun, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 239 = ktimer_getoverrun */ { AS(freebsd32_nanosleep_args), (sy_call_t *)freebsd32_nanosleep, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 240 = freebsd32_nanosleep */ { AS(ffclock_getcounter_args), (sy_call_t *)sys_ffclock_getcounter, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 241 = ffclock_getcounter */ { AS(ffclock_setestimate_args), (sy_call_t *)sys_ffclock_setestimate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 242 = ffclock_setestimate */ @@ -294,7 +294,7 @@ struct sysent freebsd32_sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 244 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 245 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 246 = nosys */ - { AS(clock_getcpuclockid2_args), (sy_call_t *)sys_clock_getcpuclockid2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 247 = clock_getcpuclockid2 */ + { AS(freebsd32_clock_getcpuclockid2_args), (sy_call_t *)freebsd32_clock_getcpuclockid2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 247 = freebsd32_clock_getcpuclockid2 */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 248 = ntp_gettime */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 249 = nosys */ { AS(minherit_args), (sy_call_t *)sys_minherit, AUE_MINHERIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 250 = minherit */ @@ -508,7 +508,7 @@ struct sysent freebsd32_sysent[] = { { AS(freebsd32_kmq_setattr_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 458 = freebsd32_kmq_setattr */ { AS(freebsd32_kmq_timedreceive_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 459 = freebsd32_kmq_timedreceive */ { AS(freebsd32_kmq_timedsend_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 460 = freebsd32_kmq_timedsend */ - { AS(kmq_notify_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 461 = kmq_notify */ + { AS(freebsd32_kmq_notify_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 461 = freebsd32_kmq_notify */ { AS(kmq_unlink_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 462 = kmq_unlink */ { AS(abort2_args), (sy_call_t *)sys_abort2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 463 = abort2 */ { AS(thr_set_name_args), (sy_call_t *)sys_thr_set_name, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 464 = thr_set_name */ diff --git a/sys/compat/freebsd32/freebsd32_systrace_args.c b/sys/compat/freebsd32/freebsd32_systrace_args.c index 7417f0e1b1df..be4acd2b7de6 100644 --- a/sys/compat/freebsd32/freebsd32_systrace_args.c +++ b/sys/compat/freebsd32/freebsd32_systrace_args.c @@ -1195,6 +1195,47 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) *n_args = 2; break; } + /* freebsd32_ktimer_create */ + case 235: { + struct freebsd32_ktimer_create_args *p = params; + iarg[0] = p->clock_id; /* clockid_t */ + uarg[1] = (intptr_t) p->evp; /* struct sigevent32 * */ + uarg[2] = (intptr_t) p->timerid; /* int * */ + *n_args = 3; + break; + } + /* ktimer_delete */ + case 236: { + struct ktimer_delete_args *p = params; + iarg[0] = p->timerid; /* int */ + *n_args = 1; + break; + } + /* freebsd32_ktimer_settime */ + case 237: { + struct freebsd32_ktimer_settime_args *p = params; + iarg[0] = p->timerid; /* int */ + iarg[1] = p->flags; /* int */ + uarg[2] = (intptr_t) p->value; /* const struct itimerspec32 * */ + uarg[3] = (intptr_t) p->ovalue; /* struct itimerspec32 * */ + *n_args = 4; + break; + } + /* freebsd32_ktimer_gettime */ + case 238: { + struct freebsd32_ktimer_gettime_args *p = params; + iarg[0] = p->timerid; /* int */ + uarg[1] = (intptr_t) p->value; /* struct itimerspec32 * */ + *n_args = 2; + break; + } + /* ktimer_getoverrun */ + case 239: { + struct ktimer_getoverrun_args *p = params; + iarg[0] = p->timerid; /* int */ + *n_args = 1; + break; + } /* freebsd32_nanosleep */ case 240: { struct freebsd32_nanosleep_args *p = params; @@ -1224,13 +1265,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) *n_args = 1; break; } - /* clock_getcpuclockid2 */ + /* freebsd32_clock_getcpuclockid2 */ case 247: { - struct clock_getcpuclockid2_args *p = params; - iarg[0] = p->id; /* id_t */ - iarg[1] = p->which; /* int */ - uarg[2] = (intptr_t) p->clock_id; /* clockid_t * */ - *n_args = 3; + struct freebsd32_clock_getcpuclockid2_args *p = params; + uarg[0] = p->id1; /* uint32_t */ + uarg[1] = p->id2; /* uint32_t */ + iarg[2] = p->which; /* int */ + uarg[3] = (intptr_t) p->clock_id; /* clockid_t * */ + *n_args = 4; break; } /* minherit */ @@ -1292,7 +1334,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) iarg[0] = p->mode; /* int */ uarg[1] = (intptr_t) p->acb_list; /* struct aiocb32 *const * */ iarg[2] = p->nent; /* int */ - uarg[3] = (intptr_t) p->sig; /* struct sigevent * */ + uarg[3] = (intptr_t) p->sig; /* struct sigevent32 * */ *n_args = 4; break; } @@ -2405,11 +2447,11 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) *n_args = 5; break; } - /* kmq_notify */ + /* freebsd32_kmq_notify */ case 461: { - struct kmq_notify_args *p = params; + struct freebsd32_kmq_notify_args *p = params; iarg[0] = p->mqd; /* int */ - uarg[1] = (intptr_t) p->sigev; /* const struct sigevent * */ + uarg[1] = (intptr_t) p->sigev; /* const struct sigevent32 * */ *n_args = 2; break; } @@ -5109,6 +5151,74 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) break; }; break; + /* freebsd32_ktimer_create */ + case 235: + switch(ndx) { + case 0: + p = "clockid_t"; + break; + case 1: + p = "struct sigevent32 *"; + break; + case 2: + p = "int *"; + break; + default: + break; + }; + break; + /* ktimer_delete */ + case 236: + switch(ndx) { + case 0: + p = "int"; + break; + default: + break; + }; + break; + /* freebsd32_ktimer_settime */ + case 237: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "int"; + break; + case 2: + p = "const struct itimerspec32 *"; + break; + case 3: + p = "struct itimerspec32 *"; + break; + default: + break; + }; + break; + /* freebsd32_ktimer_gettime */ + case 238: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "struct itimerspec32 *"; + break; + default: + break; + }; + break; + /* ktimer_getoverrun */ + case 239: + switch(ndx) { + case 0: + p = "int"; + break; + default: + break; + }; + break; /* freebsd32_nanosleep */ case 240: switch(ndx) { @@ -5152,16 +5262,19 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) break; }; break; - /* clock_getcpuclockid2 */ + /* freebsd32_clock_getcpuclockid2 */ case 247: switch(ndx) { case 0: - p = "id_t"; + p = "uint32_t"; break; case 1: - p = "int"; + p = "uint32_t"; break; case 2: + p = "int"; + break; + case 3: p = "clockid_t *"; break; default: @@ -5262,7 +5375,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "int"; break; case 3: - p = "struct sigevent *"; + p = "struct sigevent32 *"; break; default: break; @@ -7117,14 +7230,14 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) break; }; break; - /* kmq_notify */ + /* freebsd32_kmq_notify */ case 461: switch(ndx) { case 0: p = "int"; break; case 1: - p = "const struct sigevent *"; + p = "const struct sigevent32 *"; break; default: break; @@ -9332,6 +9445,31 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) if (ndx == 0 || ndx == 1) p = "int"; break; + /* freebsd32_ktimer_create */ + case 235: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* ktimer_delete */ + case 236: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* freebsd32_ktimer_settime */ + case 237: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* freebsd32_ktimer_gettime */ + case 238: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* ktimer_getoverrun */ + case 239: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* freebsd32_nanosleep */ case 240: if (ndx == 0 || ndx == 1) @@ -9352,7 +9490,7 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) if (ndx == 0 || ndx == 1) p = "int"; break; - /* clock_getcpuclockid2 */ + /* freebsd32_clock_getcpuclockid2 */ case 247: if (ndx == 0 || ndx == 1) p = "int"; @@ -10052,7 +10190,7 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) if (ndx == 0 || ndx == 1) p = "int"; break; - /* kmq_notify */ + /* freebsd32_kmq_notify */ case 461: if (ndx == 0 || ndx == 1) p = "int"; diff --git a/sys/compat/freebsd32/syscalls.master b/sys/compat/freebsd32/syscalls.master index bcca754b28b6..daee72c41ab4 100644 --- a/sys/compat/freebsd32/syscalls.master +++ b/sys/compat/freebsd32/syscalls.master @@ -441,11 +441,17 @@ const struct timespec32 *tp); } 234 AUE_NULL STD { int freebsd32_clock_getres(clockid_t clock_id, \ struct timespec32 *tp); } -235 AUE_NULL UNIMPL timer_create -236 AUE_NULL UNIMPL timer_delete -237 AUE_NULL UNIMPL timer_settime -238 AUE_NULL UNIMPL timer_gettime -239 AUE_NULL UNIMPL timer_getoverrun +235 AUE_NULL STD { int freebsd32_ktimer_create(\ + clockid_t clock_id, \ + struct sigevent32 *evp, int *timerid); } +236 AUE_NULL NOPROTO { int ktimer_delete(int timerid); } +237 AUE_NULL STD { int freebsd32_ktimer_settime(int timerid,\ + int flags, \ + const struct itimerspec32 *value, \ + struct itimerspec32 *ovalue); } +238 AUE_NULL STD { int freebsd32_ktimer_gettime(int timerid,\ + struct itimerspec32 *value); } +239 AUE_NULL NOPROTO { int ktimer_getoverrun(int timerid); } 240 AUE_NULL STD { int freebsd32_nanosleep( \ const struct timespec32 *rqtp, \ struct timespec32 *rmtp); } @@ -457,8 +463,9 @@ 244 AUE_NULL UNIMPL nosys 245 AUE_NULL UNIMPL nosys 246 AUE_NULL UNIMPL nosys -247 AUE_NULL NOPROTO { int clock_getcpuclockid2(id_t id,\ - int which, clockid_t *clock_id); } +247 AUE_NULL STD { int freebsd32_clock_getcpuclockid2(\ + uint32_t id1, uint32_t id2,\ + int which, clockid_t *clock_id); } 248 AUE_NULL UNIMPL ntp_gettime 249 AUE_NULL UNIMPL nosys ; syscall numbers initially used in OpenBSD @@ -475,7 +482,7 @@ struct aiocb32 *aiocbp); } 257 AUE_NULL NOSTD { int freebsd32_lio_listio(int mode, \ struct aiocb32 * const *acb_list, \ - int nent, struct sigevent *sig); } + int nent, struct sigevent32 *sig); } 258 AUE_NULL UNIMPL nosys 259 AUE_NULL UNIMPL nosys 260 AUE_NULL UNIMPL nosys @@ -824,8 +831,8 @@ const char *msg_ptr, size_t msg_len,\ unsigned msg_prio, \ const struct timespec32 *abs_timeout);} -461 AUE_NULL NOPROTO|NOSTD { int kmq_notify(int mqd, \ - const struct sigevent *sigev); } +461 AUE_NULL NOSTD { int freebsd32_kmq_notify(int mqd, \ + const struct sigevent32 *sigev); } 462 AUE_NULL NOPROTO|NOSTD { int kmq_unlink(const char *path); } 463 AUE_NULL NOPROTO { int abort2(const char *why, int nargs, void **args); } 464 AUE_NULL NOPROTO { int thr_set_name(long id, const char *name); } diff --git a/sys/conf/NOTES b/sys/conf/NOTES index dce216800a32..3f8422266140 100644 --- a/sys/conf/NOTES +++ b/sys/conf/NOTES @@ -2736,6 +2736,8 @@ device mos # HSxPA devices from Option N.V device uhso +# Realtek RTL8188SU/RTL8191SU/RTL8192SU wireless driver +device rsu # # Ralink Technology RT2501USB/RT2601USB wireless driver device rum diff --git a/sys/conf/WITHOUT_SOURCELESS_UCODE b/sys/conf/WITHOUT_SOURCELESS_UCODE index ebf624b784a1..eb567206ef20 100644 --- a/sys/conf/WITHOUT_SOURCELESS_UCODE +++ b/sys/conf/WITHOUT_SOURCELESS_UCODE @@ -35,8 +35,11 @@ nodevice ds1 nodevice maestro3 # usb +nodevice rsu +nodevice rsufw nodevice rum nodevice uath nodevice zyd nodevice kue +nodevice urtwn nodevice urtwnfw diff --git a/sys/conf/files b/sys/conf/files index 8d2c9a453473..a748f082b1ba 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -1155,6 +1155,8 @@ dev/cxgbe/t4_sge.c optional cxgbe pci \ compile-with "${NORMAL_C} -I$S/dev/cxgbe" dev/cxgbe/t4_l2t.c optional cxgbe pci \ compile-with "${NORMAL_C} -I$S/dev/cxgbe" +dev/cxgbe/t4_tracer.c optional cxgbe pci \ + compile-with "${NORMAL_C} -I$S/dev/cxgbe" dev/cxgbe/common/t4_hw.c optional cxgbe pci \ compile-with "${NORMAL_C} -I$S/dev/cxgbe" t4fw_cfg.c optional cxgbe \ @@ -1368,6 +1370,7 @@ dev/etherswitch/arswitch/arswitch_8216.c optional arswitch dev/etherswitch/arswitch/arswitch_8226.c optional arswitch dev/etherswitch/arswitch/arswitch_8316.c optional arswitch dev/etherswitch/arswitch/arswitch_7240.c optional arswitch +dev/etherswitch/arswitch/arswitch_vlans.c optional arswitch dev/etherswitch/etherswitch.c optional etherswitch dev/etherswitch/etherswitch_if.m optional etherswitch dev/etherswitch/ip17x/ip17x.c optional ip17x @@ -2308,6 +2311,21 @@ dev/usb/net/uhso.c optional uhso # # USB WLAN drivers # +dev/usb/wlan/if_rsu.c optional rsu +rsu-rtl8712fw.c optional rsu-rtl8712fw | rsufw \ + compile-with "${AWK} -f $S/tools/fw_stub.awk rsu-rtl8712fw.fw:rsu-rtl8712fw:120 -mrsu-rtl8712fw -c${.TARGET}" \ + no-implicit-rule before-depend local \ + clean "rsu-rtl8712fw.c" +rsu-rtl8712fw.fwo optional rsu-rtl8712fw | rsufw \ + dependency "rsu-rtl8712fw.fw" \ + compile-with "${NORMAL_FWO}" \ + no-implicit-rule \ + clean "rsu-rtl8712fw.fwo" +rsu-rtl8712fw.fw optional rsu-rtl8712.fw | rsufw \ + dependency "$S/contrib/dev/rsu/rsu-rtl8712fw.fw.uu" \ + compile-with "${NORMAL_FW}" \ + no-obj no-implicit-rule \ + clean "rsu-rtl8712fw.fw" dev/usb/wlan/if_rum.c optional rum dev/usb/wlan/if_run.c optional run runfw.c optional runfw \ @@ -2973,6 +2991,7 @@ libkern/arc4random.c standard libkern/bcd.c standard libkern/bsearch.c standard libkern/crc32.c standard +libkern/flsll.c standard libkern/fnmatch.c standard libkern/iconv.c optional libiconv libkern/iconv_converter_if.m optional libiconv diff --git a/sys/conf/files.amd64 b/sys/conf/files.amd64 index 50d504723c2f..8e88bc433e81 100644 --- a/sys/conf/files.amd64 +++ b/sys/conf/files.amd64 @@ -246,6 +246,7 @@ dev/nvme/nvme_ns_cmd.c optional nvme dev/nvme/nvme_qpair.c optional nvme dev/nvme/nvme_sysctl.c optional nvme dev/nvme/nvme_test.c optional nvme +dev/nvme/nvme_util.c optional nvme dev/nvram/nvram.c optional nvram isa dev/random/ivy.c optional random rdrand_rng dev/random/nehemiah.c optional random padlock_rng diff --git a/sys/conf/files.i386 b/sys/conf/files.i386 index f4d792834e41..9a27bdec1c7b 100644 --- a/sys/conf/files.i386 +++ b/sys/conf/files.i386 @@ -243,6 +243,7 @@ dev/nvme/nvme_ns_cmd.c optional nvme dev/nvme/nvme_qpair.c optional nvme dev/nvme/nvme_sysctl.c optional nvme dev/nvme/nvme_test.c optional nvme +dev/nvme/nvme_util.c optional nvme dev/nvram/nvram.c optional nvram isa dev/pcf/pcf_isa.c optional pcf dev/random/ivy.c optional random rdrand_rng diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index b0ca002b1867..94bfef18264f 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -132,7 +132,12 @@ if [ -n "$git_cmd" ] ; then else svn=`$git_cmd log | fgrep 'git-svn-id:' | head -1 | \ sed -n 's/^.*@\([0-9][0-9]*\).*$/\1/p'` - if [ -n $svn ] ; then + if [ -z "$svn" ] ; then + svn=`$git_cmd log --format='format:%N' | \ + grep '^svn ' | head -1 | \ + sed -n 's/^.*revision=\([0-9][0-9]*\).*$/\1/p'` + fi + if [ -n "$svn" ] ; then svn=" r${svn}" git="+${git}" else diff --git a/sys/contrib/dev/acpica/changes.txt b/sys/contrib/dev/acpica/changes.txt index 0eb04f92decc..83c156bde4ca 100644 --- a/sys/contrib/dev/acpica/changes.txt +++ b/sys/contrib/dev/acpica/changes.txt @@ -1,4 +1,76 @@ ---------------------------------------- +25 July 2013. Summary of changes for version 20130725: + +1) ACPICA kernel-resident subsystem: + +Fixed a problem with the DerefOf operator where references to FieldUnits +and BufferFields incorrectly returned the parent object, not the actual +value of the object. After this change, a dereference of a FieldUnit +reference results in a read operation on the field to get the value, and +likewise, the appropriate BufferField value is extracted from the target +buffer. + +Fixed a problem where the _WAK method could cause a fault under these +circumstances: 1) Interpreter slack mode was not enabled, and 2) the _WAK +method returned no value. The problem is rarely seen because most kernels +run ACPICA in slack mode. + +For the DerefOf operator, a fatal error now results if an attempt is made +to dereference a reference (created by the Index operator) to a NULL +package element. Provides compatibility with other ACPI implementations, +and this behavior will be added to a future version of the ACPI +specification. + +The ACPI Power Management Timer (defined in the FADT) is now optional. +This provides compatibility with other ACPI implementations and will +appear in the next version of the ACPI specification. If there is no PM +Timer on the platform, AcpiGetTimer returns AE_SUPPORT. An address of +zero in the FADT indicates no PM timer. + +Implemented a new interface for _OSI support, AcpiUpdateInterfaces. This +allows the host to globally enable/disable all vendor strings, all +feature strings, or both. Intended to be primarily used for debugging +purposes only. Lv Zheng. + +Expose the collected _OSI data to the host via a global variable. This +data tracks the highest level vendor ID that has been invoked by the BIOS +so that the host (and potentially ACPICA itself) can change behaviors +based upon the age of the BIOS. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Current Release: + Non-Debug Version: 96.2K Code, 27.1K Data, 123.3K Total + Debug Version: 184.4K Code, 76.8K Data, 261.2K Total + Previous Release: + Non-Debug Version: 95.9K Code, 26.9K Data, 122.8K Total + Debug Version: 184.1K Code, 76.7K Data, 260.8K Total + + +2) iASL Compiler/Disassembler and Tools: + +iASL: Created the following enhancements for the -so option (create +offset table): +1)Add offsets for the last nameseg in each namepath for every supported +object type +2)Add support for Processor, Device, Thermal Zone, and Scope objects +3)Add the actual AML opcode for the parent object of every supported +object type +4)Add support for the ZERO/ONE/ONES AML opcodes for integer objects + +Disassembler: Emit all unresolved external symbols in a single block. +These are external references to control methods that could not be +resolved, and thus, the disassembler had to make a guess at the number of +arguments to parse. + +iASL: The argument to the -T option (create table template) is now +optional. If not specified, the default table is a DSDT, typically the +most common case. + +---------------------------------------- 26 June 2013. Summary of changes for version 20130626: 1) ACPICA kernel-resident subsystem: @@ -65,12 +137,14 @@ longer executed properly because of a memory block that was not initialized correctly. ACPICA BZ 1016. Tomasz Nowicki <tomasz.nowicki@linaro.org>. -Fixed a possible problem with the new extended sleep registers in the ACPI +Fixed a possible problem with the new extended sleep registers in the +ACPI 5.0 FADT. Do not use these registers (even if populated) unless the HW- reduced bit is set in the FADT (as per the ACPI specification). ACPICA BZ 1020. Lv Zheng. -Implemented return value repair code for _CST predefined objects: Sort the +Implemented return value repair code for _CST predefined objects: Sort +the list and detect/remove invalid entries. ACPICA BZ 890. Lv Zheng. Implemented a debug-only option to disable loading of SSDTs from the @@ -87,7 +161,8 @@ BZ 1013. 4) Clear debug buffer global on termination to prevent possible multiple delete. ACPICA BZ 1010. -Standardized all switch() blocks across the entire source base. After many +Standardized all switch() blocks across the entire source base. After +many years, different formatting for switch() had crept in. This change makes the formatting of every switch block identical. ACPICA BZ 997. Chao Guan. @@ -118,7 +193,8 @@ has a much larger code and data size. 2) iASL Compiler/Disassembler and Tools: New utility: Implemented an easily portable version of the acpidump -utility to extract ACPI tables from the system (or a file) in an ASCII hex +utility to extract ACPI tables from the system (or a file) in an ASCII +hex dump format. The top-level code implements the various command line options, file I/O, and table dump routines. To port to a new host, only three functions need to be implemented to get tables -- since this @@ -152,7 +228,8 @@ iASL: Added control method and package support for the -so option iASL: issue a remark if a non-serialized method creates named objects. If a thread blocks within the method for any reason, and another thread -enters the method, the method will fail because an attempt will be made to +enters the method, the method will fail because an attempt will be made +to create the same (named) object twice. In this case, issue a remark that the method should be marked serialized. NOTE: may become a warning later. ACPICA BZ 909. @@ -165,10 +242,13 @@ ACPICA BZ 909. Fixed a possible buffer overrun during some rare but specific field unit read operations. This overrun can only happen if the DSDT version is 1 -- meaning that all AML integers are 32 bits -- and the field length is -between 33 and 55 bits long. During the read, an internal buffer object is -created for the field unit because the field is larger than an integer (32 +between 33 and 55 bits long. During the read, an internal buffer object +is +created for the field unit because the field is larger than an integer +(32 bits). However, in this case, the buffer will be incorrectly written -beyond the end because the buffer length is less than the internal minimum +beyond the end because the buffer length is less than the internal +minimum of 64 bits (8 bytes) long. The buffer will be either 5, 6, or 7 bytes long, but a full 8 bytes will be written. @@ -220,7 +300,8 @@ has a much larger code and data size. 2) iASL Compiler/Disassembler and Tools: AcpiExec: Added installation of a handler for the SystemCMOS address -space. This prevents control method abort if a method accesses this space. +space. This prevents control method abort if a method accesses this +space. AcpiExec: Added support for multiple EC devices, and now install EC operation region handler(s) at the actual EC device instead of the @@ -235,7 +316,8 @@ AcpiExec installs a handler for every possible address space. Debugger: Enhanced the "handlers" command to display non-root handlers. This change enhances the handlers command to display handlers associated with individual devices throughout the namespace, in addition to the -currently supported display of handlers associated with the root namespace +currently supported display of handlers associated with the root +namespace node. ASL Test Suite: Several test suite errors have been identified and @@ -264,7 +346,8 @@ return from this interface. Handles a possible timeout case if ACPI_WAIT_FOREVER is modified by the host to be a value less than "forever". Jung-uk Kim. -Predefined name support: Add allowed/required argument type information to +Predefined name support: Add allowed/required argument type information +to the master predefined info table. This change adds the infrastructure to enable typechecking on incoming arguments for all predefined methods/objects. It does not actually contain the code that will fully @@ -287,10 +370,12 @@ has a much larger code and data size. 2) iASL Compiler/Disassembler and Tools: -iASL: Implemented a new option to simplify the development of ACPI-related +iASL: Implemented a new option to simplify the development of ACPI- +related BIOS code. Adds support for a new "offset table" output file. The -so option will create a C table containing the AML table offsets of various -named objects in the namespace so that BIOS code can modify them easily at +named objects in the namespace so that BIOS code can modify them easily +at boot time. This can simplify BIOS runtime code by eliminating expensive searches for "magic values", enhancing boot times and adding greater reliability. With assistance from Lee Hamel. @@ -324,11 +409,13 @@ names table (above). Fixed a possible regression on some hosts: Reinstated the safe return macros (return_ACPI_STATUS, etc.) that ensure that the argument is evaluated only once. Although these macros are not needed for the ACPICA -code itself, they are often used by ACPI-related host device drivers where +code itself, they are often used by ACPI-related host device drivers +where the safe feature may be necessary. Fixed several issues related to the ACPI 5.0 reduced hardware support -(SOC): Now ensure that if the platform declares itself as hardware-reduced +(SOC): Now ensure that if the platform declares itself as hardware- +reduced via the FADT, the following functions become NOOPs (and always return AE_OK) because ACPI is always enabled by definition on these machines: AcpiEnable @@ -341,13 +428,15 @@ predefined name return values. Both of these repairs can simplify code in the related device drivers that invoke these methods: 1) For the _STR and _MLS names, automatically repair/convert an ASCII string to a Unicode buffer. -2) For the _CRS, _PRS, and _DMA names, return a resource descriptor with a +2) For the _CRS, _PRS, and _DMA names, return a resource descriptor with +a lone end tag descriptor in the following cases: A Return(0) was executed, a null buffer was returned, or no object at all was returned (non-slack mode only). Adds a new file, nsconvert.c ACPICA BZ 998. Bob Moore, Lv Zheng. -Resource Manager: Added additional code to prevent possible infinite loops +Resource Manager: Added additional code to prevent possible infinite +loops while traversing corrupted or ill-formed resource template buffers. Check for zero-length resource descriptors in all code that loops through resource templates (the length field is used to index through the @@ -388,7 +477,8 @@ iASL: Implemented compile-time validation of package objects returned by predefined names. This new feature validates static package objects returned by the various predefined names defined to return packages. Both object types and package lengths are validated, for both parent packages -and sub-packages, if any. The code is similar in structure and behavior to +and sub-packages, if any. The code is similar in structure and behavior +to the runtime repair mechanism within the AML interpreter and uses the existing predefined name information table. Adds a new file, aslprepkg.c. ACPICA BZ 938. @@ -405,7 +495,8 @@ assumes zero method arguments in these cases (it cannot determine the actual number of arguments without resolution/definition of the method). Debugger: Added support to display all resources with a single command. -Invocation of the resources command with no arguments will now display all +Invocation of the resources command with no arguments will now display +all resources within the current namespace. AcpiHelp: Added descriptive text for each ACPICA exception code displayed @@ -418,8 +509,10 @@ via the -e option. Updated the AcpiGetSleepTypeData interface: Allow the \_Sx methods to return either 1 or 2 integers. Although the ACPI spec defines the \_Sx -objects to return a package containing one integer, most BIOS code returns -two integers and the previous code reflects that. However, we also need to +objects to return a package containing one integer, most BIOS code +returns +two integers and the previous code reflects that. However, we also need +to support BIOS code that actually implements to the ACPI spec, and this change reflects this. @@ -463,12 +556,15 @@ attempt to flush data to the output file(s) as the compiler is aborting. This can cause an infinite loop as the max error count code essentially keeps calling itself. -iASL/Disassembler: Added an option (-in) to ignore NOOP opcodes/operators. +iASL/Disassembler: Added an option (-in) to ignore NOOP +opcodes/operators. Implemented for both the compiler and the disassembler. Often, the NOOP -opcode is used as padding for packages that are changed dynamically by the +opcode is used as padding for packages that are changed dynamically by +the BIOS. When disassembled and recompiled, these NOOPs will cause syntax errors. This option causes the disassembler to ignore all NOOP opcodes -(0xA3), and it also causes the compiler to ignore all ASL source code NOOP +(0xA3), and it also causes the compiler to ignore all ASL source code +NOOP statements as well. Debugger: Enhanced the Sleep command to execute all sleep states. This @@ -499,7 +595,8 @@ the existing share bit. Reported by Aaron Lu. Interpreter: Fix Store() when an implicit conversion is not possible. For example, in the cases such as a store of a string to an existing package object, implement the store as a CopyObject(). This is a small departure -from the ACPI specification which states that the control method should be +from the ACPI specification which states that the control method should +be aborted in this case. However, the ASLTS suite depends on this behavior. Performance improvement for the various FUNCTION_TRACE and DEBUG_PRINT @@ -538,15 +635,18 @@ iASL: Disallow a method call as argument to the ObjectType ASL operator. This change tracks an errata to the ACPI 5.0 document. The AML grammar will not allow the interpreter to differentiate between a method and a method invocation when these are used as an argument to the ObjectType -operator. The ACPI specification change is to disallow a method invocation +operator. The ACPI specification change is to disallow a method +invocation (UserTerm) for the ObjectType operator. Finish support for the TPM2 and CSRT tables in the headers, table compiler, and disassembler. Unix user-space OSL: Fix a problem with WaitSemaphore where the timeout -always expires immediately if the semaphore is not available. The original -code was using a relative-time timeout, but sem_timedwait requires the use +always expires immediately if the semaphore is not available. The +original +code was using a relative-time timeout, but sem_timedwait requires the +use of an absolute time. iASL: Added a remark if the Timer() operator is used within a 32-bit @@ -566,14 +666,18 @@ been updated. Implemented a performance enhancement for ACPI/AML Package objects. This change greatly increases the performance of Package objects within the -interpreter. It changes the processing of reference counts for packages by +interpreter. It changes the processing of reference counts for packages +by optimizing for the most common case where the package sub-objects are -either Integers, Strings, or Buffers. Increases the overall performance of -the ASLTS test suite by 1.5X (Increases the Slack Mode performance by 2X.) +either Integers, Strings, or Buffers. Increases the overall performance +of +the ASLTS test suite by 1.5X (Increases the Slack Mode performance by +2X.) Chao Guan. ACPICA BZ 943. Implemented and deployed common macros to extract flag bits from resource -descriptors. Improves readability and maintainability of the code. Fixes a +descriptors. Improves readability and maintainability of the code. Fixes +a problem with the UART serial bus descriptor for the number of data bits flags (was incorrectly 2 bits, should be 3). @@ -607,14 +711,17 @@ carats (^). ACPICA BZ 984. Debugger: Completed a major update for the Disassemble<method> command. This command was out-of-date and did not properly disassemble control -methods that had any reasonable complexity. This fix brings the command up +methods that had any reasonable complexity. This fix brings the command +up to the same level as the rest of the disassembler. Adds one new file, dmdeferred.c, which is existing code that is now common with the main disassembler and the debugger disassemble command. ACPICA MZ 978. iASL: Moved the parser entry prototype to avoid a duplicate declaration. -Newer versions of Bison emit this prototype, so moved the prototype out of -the iASL header to where it is actually used in order to avoid a duplicate +Newer versions of Bison emit this prototype, so moved the prototype out +of +the iASL header to where it is actually used in order to avoid a +duplicate declaration. iASL/Tools: Standardized use of the stream I/O functions: @@ -622,7 +729,8 @@ iASL/Tools: Standardized use of the stream I/O functions: 2) Ensure proper order of size/count arguments for fread/fwrite 3) Use test of (Actual != Requested) after all fwrite, and most fread 4) Standardize I/O error messages -Improves reliability and maintainability of the code. Bob Moore, Lv Zheng. +Improves reliability and maintainability of the code. Bob Moore, Lv +Zheng. ACPICA BZ 981. Disassembler: Prevent duplicate External() statements. During generation @@ -744,7 +852,8 @@ ACPICA BZ 846. Makefiles: Completely removed the obsolete "Linux" makefiles under -acpica/generate/linux. These makefiles are obsolete and have been replaced +acpica/generate/linux. These makefiles are obsolete and have been +replaced by the generic unix makefiles under acpica/generate/unix. @@ -783,7 +892,8 @@ that is a named object. This change fixes the problem. iASL: Fixed a regression where the AML file is not deleted on errors. The AML -output file should be deleted if there are any errors during the compiler. +output file should be deleted if there are any errors during the +compiler. The only exception is if the -f (force output) option is used. ACPICA BZ 974. @@ -838,7 +948,8 @@ ACPICA BZ 969. Implemented support for complex bit-packed buffers returned from the _PLD (Physical Location of Device) predefined method. Adds a new external -interface, AcpiDecodePldBuffer that parses the buffer into a more usable C +interface, AcpiDecodePldBuffer that parses the buffer into a more usable +C structure. Note: C Bitfields cannot be used for this type of predefined structure since the memory layout of individual bitfields is not defined by @@ -853,7 +964,8 @@ during execution of module-level ASL code (code that is executed at table load time.) Lin Ming. -Added the Windows8/Server2012 string for the _OSI method. This change adds +Added the Windows8/Server2012 string for the _OSI method. This change +adds a new _OSI string, "Windows 2012" for both Windows 8 and Windows Server 2012. @@ -870,14 +982,16 @@ GPE support: Removed an extraneous parameter from the various low-level internal GPE functions. Tang Feng. Removed the linux makefiles from the unix packages. The generate/linux -makefiles are obsolete and have been removed from the unix tarball release +makefiles are obsolete and have been removed from the unix tarball +release packages. The replacement makefiles are under generate/unix, and there is a top-level makefile under the main acpica directory. ACPICA BZ 967, 912. Updates for Unix makefiles: 1) Add -D_FORTIFY_SOURCE=2 for gcc generation. Arjan van de Ven. -2) Update linker flags (move to end of command line) for AcpiExec utility. +2) Update linker flags (move to end of command line) for AcpiExec +utility. Guan Chao. Split ACPICA initialization functions to new file, utxfinit.c. Split from @@ -901,13 +1015,15 @@ much larger code and data size. iASL: Fixed a problem with constant folding for fixed-length constant expressions. The constant-folding code was not being invoked for constant -expressions that allow the use of type 3/4/5 opcodes to generate constants +expressions that allow the use of type 3/4/5 opcodes to generate +constants for expressions such as ByteConstExpr, WordConstExpr, etc. This could result in the generation of invalid AML bytecode. ACPICA BZ 970. iASL: Fixed a generation issue on newer versions of Bison. Newer versions -apparently automatically emit some of the necessary externals. This change +apparently automatically emit some of the necessary externals. This +change handles these versions in order to eliminate generation warnings. Disassembler: Added support to decode the DBG2 and CSRT ACPI tables. @@ -925,7 +1041,8 @@ AE_BAD_PARAMETER was always returned. 1) ACPICA Kernel-resident Subsystem: Fixed a possible fault in the return package object repair code. Fixes a -problem that can occur when a lone package object is wrapped with an outer +problem that can occur when a lone package object is wrapped with an +outer package object in order to force conformance to the ACPI specification. Can affect these predefined names: _ALR, _MLS, _PSS, _TRT, _TSS, _PRT, _HPX, @@ -969,14 +1086,16 @@ table and FADT errors. Additional deployment to be completed as appropriate in the future. The associated conditional macros are ACPI_BIOS_ERROR and -ACPI_BIOS_WARNING. See the ACPICA reference for additional details. ACPICA +ACPI_BIOS_WARNING. See the ACPICA reference for additional details. +ACPICA BZ 843. Implicit notify support: ensure that no memory allocation occurs within a critical region. This fix moves a memory allocation outside of the time that a -spinlock is held. Fixes issues on systems that do not allow this behavior. +spinlock is held. Fixes issues on systems that do not allow this +behavior. Jung-uk Kim. Split exception code utilities and tables into a new file, @@ -1029,7 +1148,8 @@ generates a runtime device notification in the absence of a BIOS-provided GPE control method (_Lxx/_Exx) or a host-installed handler for the GPE. Implicit notify is -provided by ACPICA for Windows compatibility, and is a workaround for BIOS +provided by ACPICA for Windows compatibility, and is a workaround for +BIOS AML code errors. See the description of the AcpiSetupGpeForWake interface in the @@ -1068,9 +1188,11 @@ etc.) AcpiSrc: Fixed several long-standing Linux code translation issues. Argument -descriptions in function headers are now translated properly to lower case +descriptions in function headers are now translated properly to lower +case and -underscores. ACPICA BZ 961. Also fixes translation problems such as these: +underscores. ACPICA BZ 961. Also fixes translation problems such as +these: (old -> new) i_aSL -> iASL 00-7_f -> 00-7F @@ -1112,7 +1234,8 @@ additional information. ACPICA BZ 868. ACPI Tables: Added a new error message for a possible overflow failure during -the conversion of FADT 32-bit legacy register addresses to internal common +the conversion of FADT 32-bit legacy register addresses to internal +common 64- bit GAS structure representation. The GAS has a one-byte "bit length" field, @@ -1149,7 +1272,8 @@ correct External statement. Disassembler: Several additional fixes for the External() statement generation related to some ASL operators. Also, order the External() statements -alphabetically in the disassembler output. Fixes the External() generation +alphabetically in the disassembler output. Fixes the External() +generation for the Create* field, Alias, and Scope operators: 1) Create* buffer field operators - fix type mismatch warning on @@ -1173,7 +1297,8 @@ condition. iASL: Implemented some changes to enhance the IDE support (-vi option.) Error -and Warning messages are now correctly recognized for both the source code +and Warning messages are now correctly recognized for both the source +code browser and the global error and warning counts. ---------------------------------------- @@ -1182,13 +1307,15 @@ browser and the global error and warning counts. 1) ACPICA Core Subsystem: -Implemented support for multiple notify handlers. This change adds support +Implemented support for multiple notify handlers. This change adds +support to allow multiple system and device notify handlers on Device, Thermal Zone, and Processor objects. This can simplify the host OS notification implementation. -Also re-worked and restructured the entire notify support code to simplify +Also re-worked and restructured the entire notify support code to +simplify handler installation, handler removal, notify event queuing, and notify dispatch to handler(s). Note: there can still only be two global notify handlers - one for system notifies and one for device notifies. There are @@ -1229,7 +1356,8 @@ resource tags within resource descriptors appearing after a StartDependent* descriptor. Reported by Petr Vandrovec. ACPICA BZ 949. -iASL and Preprocessor: Implemented full support for the #line directive to +iASL and Preprocessor: Implemented full support for the #line directive +to correctly track original source file line numbers through the .i preprocessor output file - for error and warning messages. @@ -1250,7 +1378,8 @@ ASL Test Suite (ASLTS): Reduce iASL warnings due to use of Switch(). Update for resource descriptor offset fix above. Update/cleanup error output routines. Enable and send iASL errors/warnings to an error logfile -(error.txt). Send all other iASL output to a logfile (compiler.txt). Fixed +(error.txt). Send all other iASL output to a logfile (compiler.txt). +Fixed several extraneous "unrecognized operator" messages. ---------------------------------------- @@ -1260,7 +1389,8 @@ several extraneous "unrecognized operator" messages. 1) ACPICA Core Subsystem: Enhanced the sleep/wake interfaces to optionally execute the _GTS method -(Going To Sleep) and the _BFS method (Back From Sleep). Windows apparently +(Going To Sleep) and the _BFS method (Back From Sleep). Windows +apparently does not execute these methods, and therefore these methods are often untested. It has been seen on some systems where the execution of these methods causes errors and also prevents the machine from entering S5. It @@ -1281,8 +1411,10 @@ early. The local FADT table length cannot be set to the common length until the original length has been examined. There is code that checks the table length -and sets various fields appropriately. This can affect older machines with -early FADT versions. For example, this can cause inadvertent writes to the +and sets various fields appropriately. This can affect older machines +with +early FADT versions. For example, this can cause inadvertent writes to +the CST_CNT register. Julian Anastasov. Fixed a mapping issue related to a physical table override. Use the @@ -1295,10 +1427,12 @@ Thomas Renninger, Bob Moore. Enhanced the automatic return-object repair code: Repair a common problem with -predefined methods that are defined to return a variable-length Package of +predefined methods that are defined to return a variable-length Package +of sub-objects. If there is only one sub-object, some BIOS ASL code mistakenly -simply returns the single object instead of a Package with one sub-object. +simply returns the single object instead of a Package with one sub- +object. This new support will repair this error by wrapping a Package object around the original object, creating the correct and expected Package with one @@ -1393,7 +1527,8 @@ method. Some machines require that the GPEs are enabled before the _WAK method is executed. Thomas Renninger. -c) In AcpiLeaveSleepState, now always clear the WAK_STS (wake status) bit. +c) In AcpiLeaveSleepState, now always clear the WAK_STS (wake status) +bit. Some BIOS code assumes that WAK_STS will be cleared on resume and use it to determine whether the system is rebooting or resuming. Matthew Garrett. @@ -1429,7 +1564,8 @@ build of ACPICA that supports only the ACPI 5.0 reduced hardware (SoC) model. See the ACPICA reference for details. ACPICA BZ 942. This option removes about -10% of the code and 5% of the static data, and the following hardware ACPI +10% of the code and 5% of the static data, and the following hardware +ACPI features become unavailable: PM Event and Control registers SCI interrupt (and handler) @@ -1442,7 +1578,8 @@ features become unavailable: Updated the unix tarball directory structure to match the ACPICA git source tree. This ensures that the generic unix makefiles work properly (in -generate/unix). Also updated the Linux makefiles to match. ACPICA BZ 867. +generate/unix). Also updated the Linux makefiles to match. ACPICA BZ +867. Updated the return value of the _REV predefined method to integer value 5 to @@ -1493,7 +1630,8 @@ the ACPICA reference for additional details. Adds one new file, utilities/utaddress.c. Lin Ming, Bob Moore. -Fixed several issues with the ACPI 5.0 FADT support: Add the sleep Control +Fixed several issues with the ACPI 5.0 FADT support: Add the sleep +Control and Status registers, update the ACPI 5.0 flags, and update internal data structures to handle an FADT larger than 256 bytes. The size of the ACPI @@ -1551,7 +1689,8 @@ summarized below. Reduced Hardware Support: ------------------------- -This support allows for ACPI systems without the usual ACPI hardware. This +This support allows for ACPI systems without the usual ACPI hardware. +This support is enabled by a flag in the revision 5 FADT. If it is set, ACPICA will not attempt to initialize or use any of the usual ACPI hardware. Note, @@ -1571,7 +1710,8 @@ ACPI Tables: ------------ All new tables and updates to existing tables are fully supported in the -ACPICA headers (for use by device drivers), the disassembler, and the iASL +ACPICA headers (for use by device drivers), the disassembler, and the +iASL Data Table Compiler. ACPI 5.0 defines these new tables: BGRT /* Boot Graphics Resource Table */ @@ -1597,7 +1737,8 @@ The new operation region Space IDs are: Resource Descriptors: --------------------- -All new ASL resource descriptors are fully supported by the iASL compiler, +All new ASL resource descriptors are fully supported by the iASL +compiler, the ASL/AML disassembler, and the ACPICA runtime Resource Manager code (including @@ -1615,15 +1756,18 @@ ASL/AML Operators, New and Modified: One new operator is added, the Connection operator, which is used to associate -a GeneralPurposeIo or GenericSerialBus resource descriptor with individual +a GeneralPurposeIo or GenericSerialBus resource descriptor with +individual field objects within an operation region. Several new protocols are associated with the AccessAs operator. All are fully supported by the iASL compiler, disassembler, and runtime ACPICA AML interpreter: - Connection // Declare Field Connection attributes + Connection // Declare Field Connection +attributes AccessAs: AttribBytes (n) // Read/Write N-Bytes Protocol - AccessAs: AttribRawBytes (n) // Raw Read/Write N-Bytes Protocol + AccessAs: AttribRawBytes (n) // Raw Read/Write N-Bytes +Protocol AccessAs: AttribRawProcessBytes (n) // Raw Process Call Protocol RawDataBuffer // Data type for Vendor Data fields @@ -1658,7 +1802,8 @@ drivers and other host OS services: AcpiAcquireMutex and AcpiReleaseMutex: These interfaces allow the host OS to acquire and release AML mutexes that are defined in the DSDT/SSDT tables -provided by the BIOS. They are intended to be used in conjunction with the +provided by the BIOS. They are intended to be used in conjunction with +the ACPI 5.0 _DLM (Device Lock Method) in order to provide transaction-level mutual exclusion with the AML code/interpreter. @@ -1705,7 +1850,8 @@ Non-ACPI 5.0 changes for this release: 1) ACPICA Core Subsystem: -Fix a problem with operation region declarations where a failure can occur +Fix a problem with operation region declarations where a failure can +occur if the region name and an argument that evaluates to an object (such as the region address) are in different namespace scopes. Lin Ming, ACPICA BZ @@ -1757,7 +1903,8 @@ now allowed after every <Term> grammar element. ACPICA BZ 927. iASL: Fixed some possible aliasing warnings during generation. ACPICA BZ 923. -Disassembler: Fix problem with disassembly of the DataTableRegion operator +Disassembler: Fix problem with disassembly of the DataTableRegion +operator where an inadvertent "Unhandled deferred opcode" message could be generated. @@ -1785,15 +1932,18 @@ Support for ACPI 5.0 in ACPICA has been underway for several months and will be released at the same time that ACPI 5.0 is officially released. -The ACPI 5.0 specification is on track for release in the next few months. +The ACPI 5.0 specification is on track for release in the next few +months. 1) ACPICA Core Subsystem: Fixed a problem where the maximum sleep time for the Sleep() operator was -intended to be limited to two seconds, but was inadvertently limited to 20 +intended to be limited to two seconds, but was inadvertently limited to +20 seconds instead. -Linux and Unix makefiles: Added header file dependencies to ensure correct +Linux and Unix makefiles: Added header file dependencies to ensure +correct generation of ACPICA core code and utilities. Also simplified the makefiles considerably through the use of the vpath variable to specify search @@ -1806,8 +1956,10 @@ iASL: Implemented support to check the access length for all fields created to access named Resource Descriptor fields. For example, if a resource field is -defined to be two bits, a warning is issued if a CreateXxxxField() is used -with an incorrect bit length. This is implemented for all current resource +defined to be two bits, a warning is issued if a CreateXxxxField() is +used +with an incorrect bit length. This is implemented for all current +resource descriptor names. ACPICA BZ 930. Disassembler: Fixed a byte ordering problem with the output of 24-bit and @@ -1829,13 +1981,15 @@ AML output). Includes listings, hex files, etc. iASL: Added -G option to the table compiler to allow the compilation of custom -ACPI tables. The only part of a table that is required is the standard 36- +ACPI tables. The only part of a table that is required is the standard +36- byte ACPI header. AcpiXtract: Ported to the standard ACPICA environment (with ACPICA headers), -which also adds correct 64-bit support. Also, now all output filenames are +which also adds correct 64-bit support. Also, now all output filenames +are completely lower case. AcpiExec: Ignore any non-AML tables (tables other than DSDT or SSDT) when @@ -1844,7 +1998,8 @@ exception is an FADT. This also fixes a possible fault when attempting to load non-AML tables. ACPICA BZ 932. -AcpiHelp: Added the AccessAs and Offset operators. Fixed a problem where a +AcpiHelp: Added the AccessAs and Offset operators. Fixed a problem where +a missing table terminator could cause a fault when using the -p option. AcpiSrc: Fixed a possible divide-by-zero fault when generating file @@ -1875,7 +2030,8 @@ Updated the predefined name repair mechanism to not attempt repair of a _TSS return object if a _PSS object is present. We can only sort the _TSS return -package if there is no _PSS within the same scope. This is because if _PSS +package if there is no _PSS within the same scope. This is because if +_PSS is present, the ACPI specification dictates that the _TSS Power Dissipation field @@ -1887,9 +2043,11 @@ is. Reported by, and fixed with assistance from Fenghua Yu. Added an option to globally disable the control method return value validation -and repair. This runtime option can be used to disable return value repair +and repair. This runtime option can be used to disable return value +repair if -this is causing a problem on a particular machine. Also added an option to +this is causing a problem on a particular machine. Also added an option +to AcpiExec (-dr) to set this disable flag. All makefiles and project files: Major changes to improve generation of @@ -1935,11 +2093,13 @@ provides the following functionality: of arguments, and the return value data type. Find/display AML opcode name(s) -- with opcode, arguments, and grammar. - Decode/display AML opcode -- with opcode name, arguments, and grammar. + Decode/display AML opcode -- with opcode name, arguments, and +grammar. Service Layers: Make multi-thread support configurable. Conditionally compile -the multi-thread support so that threading libraries will not be linked if +the multi-thread support so that threading libraries will not be linked +if not necessary. The only tool that requires multi-thread support is AcpiExec. @@ -1972,7 +2132,8 @@ signature. Now, only allow SSDT, OEMx, and a null signature. History: interpreter errors and kernel faults. So now, we once again allow only SSDT, OEMx, and now, also a null signature. (05/2011). -Added the missing _TDL predefined name to the global name list in order to +Added the missing _TDL predefined name to the global name list in order +to enable validation. Affects both the core ACPICA code and the iASL compiler. @@ -2039,11 +2200,14 @@ device even if there is no corresponding operation region of type EmbeddedControl. Fixes a problem seen on some machines and apparently is compatible with Windows behavior. ACPICA BZ 875. -Added more predefined methods that are eligible for automatic NULL package -element removal. This change adds another group of predefined names to the +Added more predefined methods that are eligible for automatic NULL +package +element removal. This change adds another group of predefined names to +the list of names that can be repaired by having NULL package elements dynamically -removed. This group are those methods that return a single variable-length +removed. This group are those methods that return a single variable- +length package containing simple data types such as integers, buffers, strings. This includes: _ALx, _BCL, _CID,_ DOD, _EDL, _FIX, _PCL, _PLD, _PMD, _PRx, @@ -2082,7 +2246,8 @@ data size. iASL/DTC: Major update for new grammar features. Allow generic data types in -custom ACPI tables. Field names are now optional. Any line can be split to +custom ACPI tables. Field names are now optional. Any line can be split +to multiple lines using the continuation char (\). Large buffers now use line- continuation character(s) and no colon on the continuation lines. See the @@ -2108,7 +2273,8 @@ region declaration in the same scope. If not, the _REG method is not very useful since it probably won't be executed. ACPICA BZ 915. -iASL/DTC: Finish support for expression evaluation. Added a new expression +iASL/DTC: Finish support for expression evaluation. Added a new +expression parser that implements c-style operator precedence and parenthesization. ACPICA bugzilla @@ -2129,10 +2295,12 @@ AcpiXtract: Fix for RSDP and dynamic SSDT extraction. These tables have "unusual" headers in the acpidump file. Update the header validation to support these -tables. Problem introduced in previous AcpiXtract version in the change to +tables. Problem introduced in previous AcpiXtract version in the change +to support "wrong checksum" error messages emitted by acpidump utility. -iASL: Add a * option to generate all template files (as a synonym for ALL) +iASL: Add a * option to generate all template files (as a synonym for +ALL) as in "iasl -T *" or "iasl -T ALL". @@ -2158,7 +2326,8 @@ root object was passed to the AcpiSetupGpeForWake interface. Lin Ming. Implemented support for "spurious" Global Lock interrupts. On some systems, a -global lock interrupt can occur without the pending flag being set. Upon a +global lock interrupt can occur without the pending flag being set. Upon +a GL interrupt, we now ensure that a thread is actually waiting for the lock before @@ -2188,7 +2357,8 @@ header files, disassembler, table compiler, and template generator. Bob Moore, Lin Ming. -AcpiXtract: Correctly handle embedded comments and messages from AcpiDump. +AcpiXtract: Correctly handle embedded comments and messages from +AcpiDump. Apparently some or all versions of acpidump will occasionally emit a comment like @@ -2209,8 +2379,10 @@ for a user-defined address space. This is used by the ASL test suite 1) ACPI CA Core Subsystem: -Added a mechanism to defer _REG methods for some early-installed handlers. -Most user handlers should be installed before call to AcpiEnableSubsystem. +Added a mechanism to defer _REG methods for some early-installed +handlers. +Most user handlers should be installed before call to +AcpiEnableSubsystem. However, Event handlers and region handlers should be installed after AcpiInitializeObjects. Override handlers for the "default" regions should be @@ -2222,15 +2394,18 @@ Implemented an optimization for GPE detection. This optimization will simply ignore GPE registers that contain no enabled GPEs -- there is no need to read the register since this information is available internally. This -becomes more important on machines with a large GPE space. ACPICA bugzilla +becomes more important on machines with a large GPE space. ACPICA +bugzilla 884. Lin Ming. Suggestion from Joe Liu. -Removed all use of the highly unreliable FADT revision field. The revision +Removed all use of the highly unreliable FADT revision field. The +revision number in the FADT has been found to be completely unreliable and cannot be trusted. Only the actual table length can be used to infer the version. This -change updates the ACPICA core and the disassembler so that both no longer +change updates the ACPICA core and the disassembler so that both no +longer even look at the FADT version and instead depend solely upon the FADT length. @@ -2278,7 +2453,8 @@ global handlers. installation status -- and for op regions, whether default or user-installed handler will be used. -iASL: Warn if reserved method incorrectly returns a value. Many predefined +iASL: Warn if reserved method incorrectly returns a value. Many +predefined names are defined such that they do not return a value. If implemented as a method, issue a warning if such a name explicitly returns a value. ACPICA @@ -2311,7 +2487,8 @@ a single screen, instead of help subcommands. ACPICA Bugzilla 897. Fixed a race condition between method execution and namespace walks that can possibly cause a fault. The problem was apparently introduced in version -20100528 as a result of a performance optimization that reduces the number +20100528 as a result of a performance optimization that reduces the +number of namespace walks upon method exit by using the delete_namespace_subtree function instead of the delete_namespace_by_owner function used @@ -2323,7 +2500,8 @@ Fixed several issues and a possible fault with the automatic "serialized" method support. History: This support changes a method to "serialized" on the fly if the method generates an AE_ALREADY_EXISTS error, indicating the -possibility that it cannot handle reentrancy. This fix repairs a couple of +possibility that it cannot handle reentrancy. This fix repairs a couple +of issues seen in the field, especially on machines with many cores: 1) Delete method children only upon the exit of the last thread, @@ -2380,7 +2558,8 @@ much larger code and data size. iASL: Added generic data types to the Data Table compiler. Add "generic" data -types such as UINT32, String, Unicode, etc., to simplify the generation of +types such as UINT32, String, Unicode, etc., to simplify the generation +of platform-defined tables such as UEFI. Lin Ming. iASL: Added listing support for the Data Table Compiler. Adds listing @@ -2407,15 +2586,18 @@ a handful of new interfaces: One new file, evxfgpe.c to consolidate all external GPE interfaces. See the ACPICA Programmer Reference for full details and programming -information. See the new section 4.4 "General Purpose Event (GPE) Support" +information. See the new section 4.4 "General Purpose Event (GPE) +Support" for a full overview, and section 8.7 "ACPI General Purpose Event Management" -for programming details. ACPICA BZ 858,870,877. Matthew Garrett, Lin Ming, +for programming details. ACPICA BZ 858,870,877. Matthew Garrett, Lin +Ming, Bob Moore, Rafael Wysocki. Implemented a new GPE feature for Windows compatibility, the "Implicit Wake -GPE Notify". This feature will automatically issue a Notify(2) on a device +GPE Notify". This feature will automatically issue a Notify(2) on a +device when a Wake GPE is received if there is no corresponding GPE method or handler. ACPICA BZ 870. @@ -2462,13 +2644,15 @@ access, the size is encoded as 1=byte, 2=word, 3=dword, and 4=qword. New: AcpiNames utility - Example namespace dump utility. Shows an example of ACPICA configuration for a minimal namespace dump utility. Uses table and -namespace managers, but no AML interpreter. Does not add any functionality +namespace managers, but no AML interpreter. Does not add any +functionality over AcpiExec, it is a subset of AcpiExec. The purpose is to show how to partition and configure ACPICA. ACPICA BZ 883. AML Debugger: Increased the debugger buffer size for method return objects. -Was 4K, increased to 16K. Also enhanced error messages for debugger method +Was 4K, increased to 16K. Also enhanced error messages for debugger +method execution, including the buffer overflow case. ---------------------------------------- @@ -2483,8 +2667,10 @@ HwClearAcpiStatus. Original change from Colin King. ACPICA BZ 880. Changed the type of the predefined namespace object _TZ from ThermalZone to -Device. This was found to be confusing to the host software that processes -the various thermal zones, since _TZ is not really a ThermalZone. However, +Device. This was found to be confusing to the host software that +processes +the various thermal zones, since _TZ is not really a ThermalZone. +However, a Notify() can still be performed on it. ACPICA BZ 876. Suggestion from Rui Zhang. @@ -2495,7 +2681,8 @@ string is "Windows 2006 SP2". Eliminated duplicate code in AcpiUtExecute* functions. Now that the nsrepair code automatically repairs _HID-related strings, this type of code is no -longer needed in Execute_HID, Execute_CID, and Execute_UID. ACPICA BZ 878. +longer needed in Execute_HID, Execute_CID, and Execute_UID. ACPICA BZ +878. Example Code and Data Size: These are the sizes for the OS-independent acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. The @@ -2512,8 +2699,10 @@ much larger code and data size. 2) iASL Compiler/Disassembler and Tools: -iASL: Implemented additional compile-time validation for _HID strings. The -non-hex prefix (such as "PNP" or "ACPI") must be uppercase, and the length +iASL: Implemented additional compile-time validation for _HID strings. +The +non-hex prefix (such as "PNP" or "ACPI") must be uppercase, and the +length of the string must be exactly seven or eight characters. For both _HID and _CID @@ -2527,8 +2716,10 @@ be filled in at runtime. iASL now allows this as long as there is a tag" (name) associated with the descriptor, which gives the ASL a handle needed to modify the descriptor. ACPICA BZ 873. -Added single-thread support to the generic Unix application OSL. Primarily -for iASL support, this change removes the use of semaphores in the single- +Added single-thread support to the generic Unix application OSL. +Primarily +for iASL support, this change removes the use of semaphores in the +single- threaded ACPICA tools/applications - increasing performance. The _MULTI_THREADED option was replaced by the (reverse) ACPI_SINGLE_THREADED option. ACPICA BZ 879. @@ -2555,7 +2746,8 @@ module, hwpci.c. ACPICA BZ 857. Implemented a dynamic repair for _HID and _CID strings. The following problems are now repaired at runtime: 1) Remove a leading asterisk in the string, and 2) the entire string is uppercased. Both repairs are in -accordance with the ACPI specification and will simplify host driver code. +accordance with the ACPI specification and will simplify host driver +code. ACPICA BZ 871. The ACPI_THREAD_ID type is no longer configurable, internally it is now @@ -2574,7 +2766,8 @@ keyword is not standard across compilers, and this type allows inline to be configured on a per-compiler basis. Lin Ming. -Made the system global AcpiGbl_SystemAwakeAndRunning publically available. +Made the system global AcpiGbl_SystemAwakeAndRunning publically +available. Added an extern for this boolean in acpixf.h. Some hosts utilize this value during suspend/restore operations. ACPICA BZ 869. @@ -2602,10 +2795,12 @@ much larger code and data size. 2) iASL Compiler/Disassembler and Tools: -iASL/Disassembler: Write ACPI errors to stderr instead of the output file. +iASL/Disassembler: Write ACPI errors to stderr instead of the output +file. This keeps the output files free of random error messages that may originate -from within the namespace/interpreter code. Used this opportunity to merge +from within the namespace/interpreter code. Used this opportunity to +merge all ACPI:-style messages into a single new module, utxferror.c. ACPICA BZ 866. Lin Ming, Bob Moore. @@ -2620,7 +2815,8 @@ of size_t on 32-bit versus 64-bit generations. Lin Ming. Designed and implemented a new host interface to the _OSI support code. This -will allow the host to dynamically add or remove multiple _OSI strings, as +will allow the host to dynamically add or remove multiple _OSI strings, +as well as install an optional handler that is called for each _OSI invocation. Also added a new AML debugger command, 'osi' to display and modify the @@ -2680,13 +2876,15 @@ much larger code and data size. 2) iASL Compiler/Disassembler and Tools: -iASL/Disassembler: Added a new option (-da, "disassemble all") to load the +iASL/Disassembler: Added a new option (-da, "disassemble all") to load +the namespace from and disassemble an entire group of AML files. Useful for loading all of the AML tables for a given machine (DSDT, SSDT1...SSDTn) and disassembling with one simple command. ACPICA BZ 865. Lin Ming. -iASL: Allow multiple invocations of -e option. This change allows multiple +iASL: Allow multiple invocations of -e option. This change allows +multiple uses of -e on the command line: "-e ssdt1.dat -e ssdt2.dat". ACPICA BZ 834. Lin Ming. @@ -2715,7 +2913,8 @@ interface. This interface will set or clear individual GPEs for wakeup. interfaces are now used for "runtime" GPEs only. -Changed the behavior of the GPE install/remove handler interfaces. The GPE +Changed the behavior of the GPE install/remove handler interfaces. The +GPE is no longer disabled during this process, as it was found to cause problems on @@ -2727,10 +2926,13 @@ with Index Fields and possibly Bank Fields. It will be reintroduced when these problems have been resolved. -Fixed a problem with references to Alias objects within Package Objects. A +Fixed a problem with references to Alias objects within Package Objects. +A reference to an Alias within the definition of a Package was not always -resolved properly. Aliases to objects like Processors, Thermal zones, etc. -were resolved to the actual object instead of a reference to the object as +resolved properly. Aliases to objects like Processors, Thermal zones, +etc. +were resolved to the actual object instead of a reference to the object +as it should be. Package objects are only allowed to contain integer, string, buffer, package, and reference objects. Redhat bugzilla 608648. @@ -2774,7 +2976,8 @@ object files in the local directory so that there can be no collisions between the shared files between them that are generated with different options. -Added support for Mac OS X in the Unix OSL used for iASL and AcpiExec. Use +Added support for Mac OS X in the Unix OSL used for iASL and AcpiExec. +Use the #define __APPLE__ to enable this support. ---------------------------------------- @@ -2789,8 +2992,10 @@ Undefined ACPI tables: We are looking for the definitions for the following ACPI tables that have been seen in the field: ATKG, IEIT, GSCI. -Implemented support to enable multi-byte transfers for Embedded Controller -(EC) operation regions. Previously, the maximum data size passed to the EC +Implemented support to enable multi-byte transfers for Embedded +Controller +(EC) operation regions. Previously, the maximum data size passed to the +EC operation region handler was a single byte. There are often EC Fields larger than one byte that need to be transferred, and it is useful for the EC @@ -2833,7 +3038,8 @@ Moore. Added support to truncate I/O addresses to 16 bits for Windows compatibility. Some ASL code has been seen in the field that inadvertently has bits set -above bit 15. This feature is optional and is enabled if the BIOS requests +above bit 15. This feature is optional and is enabled if the BIOS +requests any Windows OSI strings. It can also be enabled by the host OS. Matthew Garrett, Bob Moore. @@ -2902,9 +3108,12 @@ Devices. Provides compatibility with other ACPI implementations. Two new files added, evgpeinit.c and evgpeutil.c. ACPICA BZ 833. Lin Ming, Bob Moore. -Fixed a regression introduced in version 20100331 within the table manager -where initial table loading could fail. This was introduced in the fix for -AcpiReallocateRootTable. Also, renamed some of fields in the table manager +Fixed a regression introduced in version 20100331 within the table +manager +where initial table loading could fail. This was introduced in the fix +for +AcpiReallocateRootTable. Also, renamed some of fields in the table +manager data structures to clarify their meaning and use. Fixed a possible allocation overrun during internal object copy in @@ -2934,10 +3143,12 @@ much larger code and data size. 2) iASL Compiler/Disassembler and Tools: iASL: Implemented Min/Max/Len/Gran validation for address resource -descriptors. This change implements validation for the address fields that +descriptors. This change implements validation for the address fields +that are common to all address-type resource descriptors. These checks are implemented: Checks for valid Min/Max, length within the Min/Max window, -valid granularity, Min/Max a multiple of granularity, and _MIF/_MAF as per +valid granularity, Min/Max a multiple of granularity, and _MIF/_MAF as +per table 6-40 in the ACPI 4.0a specification. Also split the large aslrestype1.c and aslrestype2.c files into five new files. ACPICA BZ 840. @@ -2954,10 +3165,12 @@ of the _Lxx, _Exx, _Wxx, and _Qxx names, as well as some other miscellaneous names such as _DIS, _INI, _IRC, _OFF, _ON, and _PSx. ACPICA BZ 850, 856. -iASL: Implemented the -ts option to emit hex AML data in ASL format, as an +iASL: Implemented the -ts option to emit hex AML data in ASL format, as +an ASL Buffer. Allows ACPI tables to be easily included within ASL files, to be -dynamically loaded via the Load() operator. Also cleaned up output for the +dynamically loaded via the Load() operator. Also cleaned up output for +the - ta and -tc options. ACPICA BZ 853. @@ -2979,7 +3192,8 @@ drivers. Several external interfaces have changed. One external interface has been removed. One new external interface was added. Most of the GPE external interfaces now use the GPE spinlock instead of the events mutex (and the -Flags parameter for many GPE interfaces has been removed.) See the updated +Flags parameter for many GPE interfaces has been removed.) See the +updated ACPICA Programmer Reference for details. Matthew Garrett, Bob Moore, Rafael Wysocki. ACPICA BZ 831. @@ -3000,10 +3214,12 @@ read/write, however. Implemented a new subsystem option to force a copy of the DSDT to local -memory. Optionally copy the entire DSDT to local memory (instead of simply +memory. Optionally copy the entire DSDT to local memory (instead of +simply mapping it.) There are some (albeit very rare) BIOSs that corrupt or replace -the original DSDT, creating the need for this option. Default is FALSE, do +the original DSDT, creating the need for this option. Default is FALSE, +do not copy the DSDT. Implemented detection of a corrupted or replaced DSDT. This change adds @@ -3048,12 +3264,14 @@ introduced in version 20100304. An error is incorrectly generated if a predefined name is declared as a static named object with a value defined using the keywords "Zero", "One", or "Ones". Lin Ming. -iASL: Added Windows 7 support for the -g option (get local ACPI tables) by +iASL: Added Windows 7 support for the -g option (get local ACPI tables) +by reducing the requested registry access rights. ACPICA BZ 842. Disassembler: fixed a possible fault when generating External() statements. -Introduced in commit ae7d6fd: Properly handle externals with parent-prefix +Introduced in commit ae7d6fd: Properly handle externals with parent- +prefix (carat). Fixes a string length allocation calculation. Lin Ming. ---------------------------------------- @@ -3076,7 +3294,8 @@ AcpiGbl_EnableAmlDebugObject. This will assist with remote machine debugging. This debug output is now available in the release version of ACPICA instead -of just the debug version. Also, the entire debug output module can now be +of just the debug version. Also, the entire debug output module can now +be configured out of the ACPICA build if desired. One new file added, executer/exdebug.c. Lin Ming, Bob Moore. @@ -3089,7 +3308,8 @@ Standardized output of integer values for ACPICA warnings/errors. Always use 0x prefix for hex output, always use %u for unsigned integer decimal output. -Affects ACPI_INFO, ACPI_ERROR, ACPI_EXCEPTION, and ACPI_WARNING (about 400 +Affects ACPI_INFO, ACPI_ERROR, ACPI_EXCEPTION, and ACPI_WARNING (about +400 invocations.) These invocations were converted from the original ACPI_DEBUG_PRINT invocations and were not consistent. ACPICA BZ 835. @@ -3137,7 +3357,8 @@ which in turn can improve boot times. ACPICA BZ 828. Lin Ming. Implemented an additional repair for predefined method return values. Attempt -to repair unexpected NULL elements within returned Package objects. Create +to repair unexpected NULL elements within returned Package objects. +Create an Integer of value zero, a NULL String, or a zero-length Buffer as appropriate. @@ -3151,16 +3372,19 @@ code was migrated from ACPI 1.0 (with 32-bit AML integers) to ACPI 2.0 the ACPICA code base, replaced by UINT64. The original typedef has been retained -for now for compatibility with existing device driver code. ACPICA BZ 824. +for now for compatibility with existing device driver code. ACPICA BZ +824. -Removed the unused UINT32_STRUCT type, and the obsolete Integer64 field in +Removed the unused UINT32_STRUCT type, and the obsolete Integer64 field +in the parse tree object. Added additional warning options for the gcc-4 generation. Updated the source accordingly. This includes some code restructuring to eliminate unreachable -code, elimination of some gotos, elimination of unused return values, some +code, elimination of some gotos, elimination of unused return values, +some additional casting, and removal of redundant declarations. Example Code and Data Size: These are the sizes for the OS-independent @@ -3185,10 +3409,12 @@ No functional changes for this release. 1) ACPI CA Core Subsystem: -Enhanced automatic data type conversions for predefined name repairs. This +Enhanced automatic data type conversions for predefined name repairs. +This change expands the automatic repairs/conversions for predefined name return -values to make Integers, Strings, and Buffers fully interchangeable. Also, +values to make Integers, Strings, and Buffers fully interchangeable. +Also, a Buffer can be converted to a Package of Integers if necessary. The nsrepair.c @@ -3197,15 +3423,18 @@ module was completely restructured. Lin Ming, Bob Moore. Implemented automatic removal of null package elements during predefined name repairs. This change will automatically remove embedded and trailing NULL -package elements from returned package objects that are defined to contain +package elements from returned package objects that are defined to +contain a variable number of sub-packages. The driver is then presented with a package with no null elements to deal with. ACPICA BZ 819. Implemented a repair for the predefined _FDE and _GTM names. The expected -return value for both names is a Buffer of 5 DWORDs. This repair fixes two -possible problems (both seen in the field), where a package of integers is +return value for both names is a Buffer of 5 DWORDs. This repair fixes +two +possible problems (both seen in the field), where a package of integers +is returned, or a buffer of BYTEs is returned. With assistance from Jung-uk Kim. @@ -3217,20 +3446,25 @@ Device object, etc.). Now executes the code within the current scope instead of the root. ACPICA BZ 762. Lin Ming. -Fixed possible mutex acquisition errors when running _REG methods. Fixes a -problem where mutex errors can occur when running a _REG method that is in -the same scope as a method-defined operation region or an operation region +Fixed possible mutex acquisition errors when running _REG methods. Fixes +a +problem where mutex errors can occur when running a _REG method that is +in +the same scope as a method-defined operation region or an operation +region under a module-level IF block. This type of code is rare, so the problem has not been seen before. ACPICA BZ 826. Lin Ming, Bob Moore. -Fixed a possible memory leak during module-level code execution. An object +Fixed a possible memory leak during module-level code execution. An +object could be leaked for each block of executed module-level code if the interpreter slack mode is enabled This change deletes any implicitly returned object from the module-level code block. Lin Ming. -Removed messages for successful predefined repair(s). The repair mechanism +Removed messages for successful predefined repair(s). The repair +mechanism was considered too wordy. Now, messages are only unconditionally emitted if the return object cannot be repaired. Existing messages for successful @@ -3309,7 +3543,8 @@ Implemented a new internal function to create Integer objects. This function simplifies miscellaneous object creation code. ACPICA BZ 823. -Reduced the severity of predefined repair messages, Warning to Info. Since +Reduced the severity of predefined repair messages, Warning to Info. +Since the object was successfully repaired, a warning is too severe. Reduced to an info message for now. These messages may eventually be changed to debug- @@ -3362,7 +3597,8 @@ Fixed a problem where an Operation Region _REG method could be executed more than once. If a custom address space handler is installed by the host before -the "initialize operation regions" phase of the ACPICA initialization, any +the "initialize operation regions" phase of the ACPICA initialization, +any _REG methods for that address space could be executed twice. This change fixes the problem. ACPICA BZ 427. Lin Ming. @@ -3402,7 +3638,8 @@ much larger code and data size. 2) iASL Compiler/Disassembler and Tools: Disassembler: Fixed a problem where references to external symbols that -contained one or more parent-prefixes (carats) were not handled correctly, +contained one or more parent-prefixes (carats) were not handled +correctly, possibly causing a fault. ACPICA BZ 806. Lin Ming. Disassembler: Restructured the code so that all functions that handle @@ -3425,10 +3662,12 @@ files. For Windows Vista compatibility, added the automatic execution of an _INI method located at the namespace root (\_INI). This method is executed at -table load time. This support is in addition to the automatic execution of +table load time. This support is in addition to the automatic execution +of \_SB._INI. Lin Ming. -Fixed a possible memory leak in the interpreter for AML package objects if +Fixed a possible memory leak in the interpreter for AML package objects +if the package initializer list is longer than the defined size of the package. This apparently can only happen if the BIOS changes the package size on @@ -3443,14 +3682,16 @@ package consists of a number of sub-packages as in the _PSS.) ACPICA BZ 805. Fixed a problem seen when a Buffer or String is stored to itself via ASL. -This has been reported in the field. Previously, ACPICA would zero out the +This has been reported in the field. Previously, ACPICA would zero out +the buffer/string. Now, the operation is treated as a noop. Provides Windows compatibility. ACPICA BZ 803. Lin Ming. Removed an extraneous error message for ASL constructs of the form Store(LocalX,LocalX) when LocalX is uninitialized. These curious statements -are seen in many BIOSs and are once again treated as NOOPs and no error is +are seen in many BIOSs and are once again treated as NOOPs and no error +is emitted when they are encountered. ACPICA BZ 785. Fixed an extraneous warning message if a _DSM reserved method returns a @@ -3479,7 +3720,8 @@ ACPICA BZ 738. iASL: Implemented the -I option to specify additional search directories for include files. Allows multiple additional search paths for include files. -Directories are searched in the order specified on the command line (after +Directories are searched in the order specified on the command line +(after the local directory is searched.) ACPICA BZ 800. iASL: Fixed a problem where the full pathname for include files was not @@ -3489,7 +3731,8 @@ properly. ACPICA BZ 765. iASL: Implemented the -@ option to specify a Windows-style response file containing additional command line options. ACPICA BZ 801. -AcpiExec: Added support to load multiple AML files simultaneously (such as +AcpiExec: Added support to load multiple AML files simultaneously (such +as a DSDT and multiple SSDTs). Also added support for wildcards within the AML pathname. These features allow all machine tables to be easily loaded and @@ -3507,7 +3750,8 @@ The ACPI 4.0 implementation for ACPICA is complete with this release. 1) ACPI CA Core Subsystem: ACPI 4.0: Added header file support for all new and changed ACPI tables. -Completely new tables are: IBFT, IVRS, MSCT, and WAET. Tables that are new +Completely new tables are: IBFT, IVRS, MSCT, and WAET. Tables that are +new for ACPI 4.0, but have previously been supported in ACPICA are: CPEP, BERT, EINJ, ERST, and HEST. Other newly supported tables are: UEFI and WDAT. @@ -3526,8 +3770,10 @@ executable AML code that exists outside of any control method and is intended to be executed at table load time. Although illegal since ACPI 2.0, this type -of code still exists and is apparently still being created. Blocks of this -code are now detected and executed as intended. Currently, the code blocks +of code still exists and is apparently still being created. Blocks of +this +code are now detected and executed as intended. Currently, the code +blocks must exist under either an If, Else, or While construct; these are the typical cases seen in the field. ACPICA BZ 762. Lin Ming. @@ -3540,7 +3786,8 @@ single package with no sub-packages. This code attempts to fix the problem by wrapping a new package object around the existing package. These methods can -be repaired: _ALR, _CSD, _HPX, _MLS, _PRT, _PSS, _TRT, and _TSS. ACPICA BZ +be repaired: _ALR, _CSD, _HPX, _MLS, _PRT, _PSS, _TRT, and _TSS. ACPICA +BZ 790. Fixed a regression introduced in 20090625 for the AcpiGetDevices @@ -3560,7 +3807,8 @@ Fixed a regression related to the recent update of the AcpiRead/Write interfaces. A sleep/suspend could fail if the optional PM2 Control register does not exist during an attempt to write the Bus Master Arbitration bit. -(However, some hosts already delete the code that writes this bit, and the +(However, some hosts already delete the code that writes this bit, and +the code may in fact be obsolete at this date.) ACPICA BZ 799. Fixed a problem where AcpiTerminate could fault if inadvertently called @@ -3601,7 +3849,8 @@ address space handler (to be installed by an IPMI device driver.) ACPICA BZ 773. Lin Ming. -ACPI 4.0: Added changes for existing ACPI tables - FACS and SRAT. Includes +ACPI 4.0: Added changes for existing ACPI tables - FACS and SRAT. +Includes support in both the header files and the disassembler. Completed a major update for the AcpiGetObjectInfo external interface. @@ -3612,7 +3861,8 @@ etc.) - Call the _SxW power methods on behalf of a device object. - Determine if a device is a PCI root bridge. - Change the ACPI_BUFFER parameter to ACPI_DEVICE_INFO. -These changes will require an update to all callers of this interface. See +These changes will require an update to all callers of this interface. +See the updated ACPICA Programmer Reference for details. One new source file has been added - utilities/utids.c. ACPICA BZ 368, 780. @@ -3620,7 +3870,8 @@ been added - utilities/utids.c. ACPICA BZ 368, 780. Updated the AcpiRead and AcpiWrite external interfaces to support 64-bit transfers. The Value parameter has been extended from 32 bits to 64 bits in -order to support new ACPI 4.0 tables. These changes will require an update +order to support new ACPI 4.0 tables. These changes will require an +update to all callers of these interfaces. See the ACPICA Programmer Reference for details. ACPICA BZ 768. @@ -3629,7 +3880,8 @@ Fixed several problems with AcpiAttachData. The handler was not invoked when the host node was deleted. The data sub-object was not automatically deleted -when the host node was deleted. The interface to the handler had an unused +when the host node was deleted. The interface to the handler had an +unused parameter, this was removed. ACPICA BZ 778. Enhanced the function that dumps ACPI table headers. All non-printable @@ -3639,13 +3891,15 @@ OemTableId, and CompilerId.) ACPI tables with non-printable characters in these fields are occasionally seen in the field. ACPICA BZ 788. Fixed a problem with predefined method repair code where the code that -attempts to repair/convert an object of incorrect type is only executed on +attempts to repair/convert an object of incorrect type is only executed +on the first time the predefined method is called. The mechanism that disables warnings on subsequent calls was interfering with the repair mechanism. ACPICA BZ 781. -Fixed a possible memory leak in the predefined validation/repair code when +Fixed a possible memory leak in the predefined validation/repair code +when a buffer is automatically converted to an expected string object. @@ -3681,7 +3935,8 @@ predefined names and control methods (31 total). ACPICA BZ 769. Disabled the preservation of the SCI enable bit in the PM1 control register. -The SCI enable bit (bit 0, SCI_EN) is defined by the ACPI specification to +The SCI enable bit (bit 0, SCI_EN) is defined by the ACPI specification +to be a "preserved" bit - "OSPM always preserves this bit position", section 4.7.3.2.1. However, some machines fail if this bit is in fact preserved @@ -3705,7 +3960,8 @@ examples. Lin Ming, Bob Moore. Fixed several reference count issues with the DdbHandle object that is created from a Load or LoadTable operator. Prevent premature deletion of the -object. Also, mark the object as invalid once the table has been unloaded. +object. Also, mark the object as invalid once the table has been +unloaded. This is needed because the handle itself may not be deleted after the table unload, depending on whether it has been stored in a named object by the @@ -3721,7 +3977,8 @@ and can cause subsequent execution errors. ACPICA BZ 471. Changed the allowable release order for ASL mutex objects. The ACPI 4.0 specification has been changed to make the SyncLevel for mutex objects more -useful. When releasing a mutex, the SyncLevel of the mutex must now be the +useful. When releasing a mutex, the SyncLevel of the mutex must now be +the same as the current sync level. This makes more sense than the previous rule (SyncLevel less than or equal). This change updates the code to match the @@ -3768,7 +4025,8 @@ after an invalid sub-table ID. 1) ACPI CA Core Subsystem: -Fixed a compatibility issue with the recently released I/O port protection +Fixed a compatibility issue with the recently released I/O port +protection mechanism. For windows compatibility, 1) On a port protection violation, simply ignore the request and do not return an exception (allow the control @@ -3812,7 +4070,8 @@ much larger code and data size. 2) iASL Compiler/Disassembler and Tools: -iASL: Fixed a generation warning from Bison 2.3 and fixed several warnings +iASL: Fixed a generation warning from Bison 2.3 and fixed several +warnings on the 64-bit build. @@ -3824,13 +4083,16 @@ iASL: Added a new option for "quiet mode" (-va) that produces only the compilation summary, not individual errors and warnings. Useful for large batch compilations. -AcpiExec: Implemented a new option (-z) to enable a forced semaphore/mutex -timeout that can be used to detect hang conditions during execution of AML +AcpiExec: Implemented a new option (-z) to enable a forced +semaphore/mutex +timeout that can be used to detect hang conditions during execution of +AML code (includes both internal semaphores and AML-defined mutexes and events.) Added new makefiles for the generation of acpica in a generic unix-like -environment. These makefiles are intended to generate the acpica tools and +environment. These makefiles are intended to generate the acpica tools +and utilities from the original acpica git source tree structure. Test Suites: Updated and cleaned up the documentation files. Updated the @@ -3897,12 +4159,14 @@ operation region did not actually access those ports. Validation is now performed on a per-field basis instead of the entire region. Modified the handling of the PM1 Status Register ignored bit (bit 11.) -Ignored bits must be "preserved" according to the ACPI spec. Usually, this +Ignored bits must be "preserved" according to the ACPI spec. Usually, +this means a read/modify/write when writing to the register. However, for status registers, writing a one means clear the event. Writing a zero means preserve -the event (do not clear.) This behavior is clarified in the ACPI 4.0 spec, +the event (do not clear.) This behavior is clarified in the ACPI 4.0 +spec, and the ACPICA code now simply always writes a zero to the ignored bit. Modified the handling of ignored bits for the PM1 A/B Control Registers. @@ -3940,13 +4204,17 @@ aetables.c Optimized the ACPI register locking. Removed locking for reads from the ACPI -bit registers in PM1 Status, Enable, Control, and PM2 Control. The lock is +bit registers in PM1 Status, Enable, Control, and PM2 Control. The lock +is not required when reading the single-bit registers. The -AcpiGetRegisterUnlocked function is no longer needed and has been removed. -This will improve performance for reads on these registers. ACPICA BZ 760. +AcpiGetRegisterUnlocked function is no longer needed and has been +removed. +This will improve performance for reads on these registers. ACPICA BZ +760. Fixed the parameter validation for AcpiRead/Write. Now return -AE_BAD_PARAMETER if the input register pointer is null, and AE_BAD_ADDRESS +AE_BAD_PARAMETER if the input register pointer is null, and +AE_BAD_ADDRESS if the register has an address of zero. Previously, these cases simply returned @@ -3956,14 +4224,17 @@ should check for a valid register address before calling. ACPICA BZ 748. Renamed the external ACPI bit register access functions. Renamed AcpiGetRegister and AcpiSetRegister to clarify the purpose of these -functions. The new names are AcpiReadBitRegister and AcpiWriteBitRegister. +functions. The new names are AcpiReadBitRegister and +AcpiWriteBitRegister. Also, restructured the code for these functions by simplifying the code path and condensing duplicate code to reduce code size. Added new functions to transparently handle the possibly split PM1 A/B -registers. AcpiHwReadMultiple and AcpiHwWriteMultiple. These two functions -now handle the split registers for PM1 Status, Enable, and Control. ACPICA +registers. AcpiHwReadMultiple and AcpiHwWriteMultiple. These two +functions +now handle the split registers for PM1 Status, Enable, and Control. +ACPICA BZ 746. @@ -3973,7 +4244,8 @@ This function writes both of the PM1 control registers (A/B). These registers are different than the PM1 A/B status and enable registers in that different -values can be written to the A/B registers. Most notably, the SLP_TYP bits +values can be written to the A/B registers. Most notably, the SLP_TYP +bits can be different, as per the values returned from the _Sx predefined methods. @@ -3988,7 +4260,8 @@ register. ACPICA BZ 751. Split out the PM1 Status registers from the FADT. Added new globals for these registers (A/B), similar to the way the PM1 Enable registers are handled. -Instead of overloading the FADT Event Register blocks. This makes the code +Instead of overloading the FADT Event Register blocks. This makes the +code clearer and less prone to error. Fixed the warning message for when the platform contains too many ACPI @@ -3998,7 +4271,8 @@ calculation for the truncation value was incorrect. Removed the ACPI_GET_OBJECT_TYPE macro. Removed all instances of this -obsolete macro, since it is now a simple reference to ->common.type. There +obsolete macro, since it is now a simple reference to ->common.type. +There were about 150 invocations of the macro across 41 files. ACPICA BZ 755. Removed the redundant ACPI_BITREG_SLEEP_TYPE_B. This type is the same as @@ -4011,7 +4285,8 @@ included for 32-bit hosts. Debug output: print the input and result for invocations of the _OSI reserved -control method via the ACPI_LV_INFO debug level. Also, reduced some of the +control method via the ACPI_LV_INFO debug level. Also, reduced some of +the verbosity of this debug level. Len Brown. Example Code and Data Size: These are the sizes for the OS-independent @@ -4053,8 +4328,10 @@ a table is dynamically loaded via the AML Load operator. Updated FADT flag definitions, especially the Boot Architecture flags. -Debugger: For the Find command, automatically pad the input ACPI name with -underscores if the name is shorter than 4 characters. This enables a match +Debugger: For the Find command, automatically pad the input ACPI name +with +underscores if the name is shorter than 4 characters. This enables a +match with the actual namespace entry which is itself padded with underscores. Example Code and Data Size: These are the sizes for the OS-independent @@ -4112,7 +4389,8 @@ register lengths within the FADT are now used, and the low level ACPI register access no longer hardcodes the ACPI register lengths. Given that there may be some risk in actually trusting the FADT register lengths, a run- -time option was added to fall back to the default hardcoded lengths if the +time option was added to fall back to the default hardcoded lengths if +the FADT proves to contain incorrect values - UseDefaultRegisterWidths. This option is set to true for now, and a warning is issued if a suspicious FADT @@ -4145,9 +4423,11 @@ much larger code and data size. 2) iASL Compiler/Disassembler and Tools: -iASL: Completed the '-e' option to include additional ACPI tables in order +iASL: Completed the '-e' option to include additional ACPI tables in +order to -aid with disassembly and External statement generation. ACPICA BZ 742. Lin +aid with disassembly and External statement generation. ACPICA BZ 742. +Lin Ming. iASL: Removed the "named object in while loop" error. The compiler cannot @@ -4157,7 +4437,8 @@ Disassembler: Implemented support for FADT revision 2 (MS extension). ACPICA BZ 743. -Disassembler: Updates for several ACPI data tables (HEST, EINJ, and MCFG). +Disassembler: Updates for several ACPI data tables (HEST, EINJ, and +MCFG). ---------------------------------------- 31 October 2008. Summary of changes for version 20081031: @@ -4175,37 +4456,48 @@ Future plans include moving all private headers to a new subdirectory. Implemented an automatic Buffer->String return value conversion for -predefined ACPI methods. For these methods (such as _BIF), added automatic +predefined ACPI methods. For these methods (such as _BIF), added +automatic conversion for return objects that are required to be a String, but a Buffer was found instead. This can happen when reading string battery data from an -operation region, because it used to be difficult to convert the data from -buffer to string from within the ASL. Ensures that the host OS is provided +operation region, because it used to be difficult to convert the data +from +buffer to string from within the ASL. Ensures that the host OS is +provided with a valid null-terminated string. Linux BZ 11822. Updated the FACS waking vector interfaces. Split AcpiSetFirmwareWakingVector into two: one for the 32-bit vector, another for the 64-bit vector. This is -required because the host OS must setup the wake much differently for each -vector (real vs. protected mode, etc.) and the interface itself should not +required because the host OS must setup the wake much differently for +each +vector (real vs. protected mode, etc.) and the interface itself should +not be -deciding which vector to use. Also, eliminated the GetFirmwareWakingVector -interface, as it served no purpose (only the firmware reads the vector, OS +deciding which vector to use. Also, eliminated the +GetFirmwareWakingVector +interface, as it served no purpose (only the firmware reads the vector, +OS only writes the vector.) ACPICA BZ 731. -Implemented a mechanism to escape infinite AML While() loops. Added a loop -counter to force exit from AML While loops if the count becomes too large. +Implemented a mechanism to escape infinite AML While() loops. Added a +loop +counter to force exit from AML While loops if the count becomes too +large. This can occur in poorly written AML when the hardware does not respond -within a while loop and the loop does not implement a timeout. The maximum +within a while loop and the loop does not implement a timeout. The +maximum loop count is configurable. A new exception code is returned when a loop is broken, AE_AML_INFINITE_LOOP. Alexey Starikovskiy, Bob Moore. Optimized the execution of AML While loops. Previously, a control state object was allocated and freed for each execution of the loop. The -optimization is to simply reuse the control state for each iteration. This +optimization is to simply reuse the control state for each iteration. +This speeds up the raw loop execution time by about 5%. Enhanced the implicit return mechanism. For Windows compatibility, return @@ -4219,7 +4511,8 @@ Allow multiple backslashes as root prefixes in namepaths. In a fully qualified namepath, allow multiple backslash prefixes. This can happen (and is seen in the field) because of the use of a double-backslash in strings -(since backslash is the escape character) causing confusion. ACPICA BZ 739 +(since backslash is the escape character) causing confusion. ACPICA BZ +739 Lin Ming. Emit a warning if two different FACS or DSDT tables are discovered in the @@ -4261,13 +4554,15 @@ much larger code and data size. iASL: Improved disassembly of external method calls. Added the -e option to -allow the inclusion of additional ACPI tables to help with the disassembly +allow the inclusion of additional ACPI tables to help with the +disassembly of method invocations and the generation of external declarations during the disassembly. Certain external method invocations cannot be disassembled properly without the actual declaration of the method. Use the -e option to -include the table where the external method(s) are actually declared. Most +include the table where the external method(s) are actually declared. +Most useful for disassembling SSDTs that make method calls back to the master DSDT. Lin Ming. Example: To disassemble an SSDT with calls to DSDT: iasl -d @@ -4298,7 +4593,8 @@ may include actual repair of incorrect return objects where possible. Two new files are nspredef.c and acpredef.h. -Fixed a fault in the AML parser if a memory allocation fails during the Op +Fixed a fault in the AML parser if a memory allocation fails during the +Op completion routine AcpiPsCompleteThisOp. Lin Ming. ACPICA BZ 492. Fixed an issue with implicit return compatibility. This change improves @@ -4315,7 +4611,8 @@ during the ToDecimalString and ToHexString operators, as well as implicit conversions. Fiodor Suietov, ACPICA BZ 585. Fixed two possible memory leaks in the error exit paths of -AcpiUtUpdateObjectReference and AcpiUtWalkPackageTree. These functions are +AcpiUtUpdateObjectReference and AcpiUtWalkPackageTree. These functions +are similar in that they use a stack of state objects in order to eliminate recursion. The stack must be fully unwound and deallocated if an error occurs. Lin Ming. ACPICA BZ 383. @@ -4351,7 +4648,8 @@ much larger code and data size. 1) ACPI CA Core Subsystem: Completed a major cleanup of the internal ACPI_OPERAND_OBJECT of type -Reference. Changes include the elimination of cheating on the Object field +Reference. Changes include the elimination of cheating on the Object +field for the DdbHandle subtype, addition of a reference class field to differentiate the various reference types (instead of an AML opcode), and the @@ -4361,7 +4659,8 @@ Reduce an error to a warning for an incorrect method argument count. Previously aborted with an error if too few arguments were passed to a control method via the external ACPICA interface. Now issue a warning instead -and continue. Handles the case where the method inadvertently declares too +and continue. Handles the case where the method inadvertently declares +too many arguments, but does not actually use the extra ones. Applies mainly to the predefined methods. Lin Ming. Linux BZ 11032. @@ -4415,7 +4714,8 @@ Allow multiple argument counts for the predefined _SCP method. ACPI 3.0 defines _SCP with 3 arguments. Previous versions defined it with only 1 argument. iASL now allows both definitions. -iASL/disassembler: avoid infinite loop on bad ACPI tables. Check for zero- +iASL/disassembler: avoid infinite loop on bad ACPI tables. Check for +zero- length subtables when disassembling ACPI tables. Also fixed a couple of errors where a full 16-bit table type field was not extracted from the input @@ -4447,7 +4747,8 @@ Add a function to dereference returned reference objects. Examines the return object from a call to AcpiEvaluateObject. Any Index or RefOf references are -automatically dereferenced in an attempt to return something useful (these +automatically dereferenced in an attempt to return something useful +(these reference types cannot be converted into an external ACPI_OBJECT.) Provides MS compatibility. Lin Ming, Bob Moore. Linux BZ 11105 @@ -4467,8 +4768,10 @@ to AcpiUtInitializeBuffer. Reported by and initial patch by Ingo Molnar. Return status from the global init function AcpiUtGlobalInitialize. This is -used by both the kernel subsystem and the utilities such as iASL compiler. -The function could possibly fail when the caches are initialized. Yang Yi. +used by both the kernel subsystem and the utilities such as iASL +compiler. +The function could possibly fail when the caches are initialized. Yang +Yi. Add a function to decode reference object types to strings. Created for improved error messages. @@ -4494,8 +4797,10 @@ much larger code and data size. 2) iASL Compiler/Disassembler and Tools: -Debugger: fix a possible hang when evaluating non-methods. Fixes a problem -introduced in version 20080701. If the object being evaluated (via execute +Debugger: fix a possible hang when evaluating non-methods. Fixes a +problem +introduced in version 20080701. If the object being evaluated (via +execute command) is not a method, the debugger can hang while trying to obtain non- existent parameters. @@ -4507,15 +4812,18 @@ manually change these names, issue a remark instead. iASL: error if named object created in while loop. Emit an error if any named -object is created within a While loop. If allowed, this code will generate +object is created within a While loop. If allowed, this code will +generate a -run-time error on the second iteration of the loop when an attempt is made +run-time error on the second iteration of the loop when an attempt is +made to create the same named object twice. ACPICA bugzilla 730. iASL: Support absolute pathnames for include files. Add support for absolute -pathnames within the Include operator. previously, only relative pathnames +pathnames within the Include operator. previously, only relative +pathnames were supported. iASL: Enforce minimum 1 interrupt in interrupt macro and Resource @@ -4576,7 +4884,8 @@ found, this no longer returns an exception. BZ 722 Fixed a problem where the wrong descriptor length was calculated for the -EndTag descriptor in 64-bit mode. The "minimal" descriptors such as EndTag +EndTag descriptor in 64-bit mode. The "minimal" descriptors such as +EndTag are calculated as 12 bytes long, but the actual length in the internal descriptor is 16 because of the round-up to 8 on the 64-bit build. Reported @@ -4637,13 +4946,15 @@ the "result of operation not used" warning when the DDB handle returned from LoadTable is not used. The warning is not needed. BZ 590 -AcpiExec: Add support for dynamic table load/unload. Now calls _CFG method +AcpiExec: Add support for dynamic table load/unload. Now calls _CFG +method to pass address of table to the AML. Added option to disable OpRegion simulation to allow creation of an OpRegion with a real address that was passed to _CFG. -All of this allows testing of the Load and Unload operators from AcpiExec. +All of this allows testing of the Load and Unload operators from +AcpiExec. Debugger: update tables command for unloaded tables. Handle unloaded tables @@ -4676,7 +4987,8 @@ pointer. Fixed a problem where the _SST execution status was incorrectly returned to -the caller of AcpiEnterSleepStatePrep. This was a regression introduced in +the caller of AcpiEnterSleepStatePrep. This was a regression introduced +in 20080514. _SST is optional and a NOT_FOUND exception should never be returned. BZ 716 @@ -4782,7 +5094,8 @@ signatures, ACPICA must be compatible. BZ 10454. Fixed a possible negative array index in AcpiUtValidateException. Added NULL -fields to the exception string arrays to eliminate a -1 subtraction on the +fields to the exception string arrays to eliminate a -1 subtraction on +the SubStatus field. Updated the debug tracking macros to reduce overall code and data size. @@ -4790,7 +5103,8 @@ Changed ACPI_MODULE_NAME and ACPI_FUNCTION_NAME to use arrays of strings instead of pointers to static strings. Jan Beulich and Bob Moore. Implemented argument count checking in control method invocation via -AcpiEvaluateObject. Now emit an error if too few arguments, warning if too +AcpiEvaluateObject. Now emit an error if too few arguments, warning if +too many. This applies only to extern programmatic control method execution, not method-to-method calls within the AML. Lin Ming. @@ -4799,7 +5113,8 @@ Eliminated the ACPI_NATIVE_UINT type across all ACPICA code. This type is no longer needed, especially with the removal of 16-bit support. It was replaced -mostly with UINT32, but also ACPI_SIZE where a type that changes 32/64 bit +mostly with UINT32, but also ACPI_SIZE where a type that changes 32/64 +bit on 32/64-bit platforms is required. @@ -4821,7 +5136,8 @@ much larger code and data size. 2) iASL Compiler/Disassembler and Tools: -Implemented ACPI table revision ID validation in the disassembler. Zero is +Implemented ACPI table revision ID validation in the disassembler. Zero +is always invalid. For DSDTs, the ID controls the interpreter integer width. 1 means 32-bit and this is unusual. 2 or greater is 64-bit. @@ -4832,7 +5148,8 @@ means 32-bit and this is unusual. 2 or greater is 64-bit. 1) ACPI CA Core Subsystem: Implemented an additional change to the GPE support in order to suppress -spurious or stray GPEs. The AcpiEvDisableGpe function will now permanently +spurious or stray GPEs. The AcpiEvDisableGpe function will now +permanently disable incoming GPEs that are neither enabled nor disabled -- meaning that the GPE is unknown to the system. This should prevent future interrupt @@ -4867,7 +5184,8 @@ generated. Implemented several changes for Notify handling. Added support for new Notify values (ACPI 2.0+) and improved the Notify debug output. Notify on -PowerResource objects is no longer allowed, as per the ACPI specification. +PowerResource objects is no longer allowed, as per the ACPI +specification. (Bob Moore, Zhang Rui) All Reference Objects returned via the AcpiEvaluateObject interface are @@ -4877,9 +5195,11 @@ for NULL objects - either NULL package elements or unresolved named references. -Fixed a problem where an extraneous debug message was produced for package +Fixed a problem where an extraneous debug message was produced for +package objects (when debugging enabled). The message "Package List length larger -than NumElements count" is now produced in the correct case, and is now an +than NumElements count" is now produced in the correct case, and is now +an error message rather than a debug message. Added a debug message for the opposite case, where NumElements is larger than the Package List (the package @@ -4889,7 +5209,8 @@ Implemented several improvements for the output of the ASL "Debug" object to clarify and keep all data for a given object on one output line. -Fixed two size calculation issues with the variable-length Start Dependent +Fixed two size calculation issues with the variable-length Start +Dependent resource descriptor. Example Code and Data Size: These are the sizes for the OS-independent @@ -4907,7 +5228,8 @@ a much larger code and data size. 2) iASL Compiler/Disassembler and Tools: -Fixed a problem with the use of the Switch operator where execution of the +Fixed a problem with the use of the Switch operator where execution of +the containing method by multiple concurrent threads could cause an AE_ALREADY_EXISTS exception. This is caused by the fact that there is no actual Switch opcode, it must be simulated with local named temporary @@ -4937,7 +5259,8 @@ AE_AML_INTERNAL exception depending on the order and type of operators executed by the target control method. Fixed a problem where resource descriptor size optimization could cause a -problem when a _CRS resource template is passed to a _SRS method. The _SRS +problem when a _CRS resource template is passed to a _SRS method. The +_SRS resource template must use the same descriptors (with the same size) as returned from _CRS. This change affects the following resource descriptors: @@ -4997,22 +5320,27 @@ Added the 2008 copyright to all module headers and signons. This affects virtually every file in the ACPICA core subsystem, the iASL compiler, and the tools/utilities. -Fixed a problem with the SizeOf operator when used with Package and Buffer -objects. These objects have deferred execution for some arguments, and the +Fixed a problem with the SizeOf operator when used with Package and +Buffer +objects. These objects have deferred execution for some arguments, and +the execution is now completed before the SizeOf is executed. This problem caused unexpected AE_PACKAGE_LIMIT errors on some systems (Lin Ming, Bob Moore) BZ 9558 -Implemented an enhancement to the interpreter "slack mode". In the absence +Implemented an enhancement to the interpreter "slack mode". In the +absence of -an explicit return or an implicitly returned object from the last executed +an explicit return or an implicitly returned object from the last +executed opcode, a control method will now implicitly return an integer of value 0 for Microsoft compatibility. (Lin Ming) BZ 392 -Fixed a problem with the Load operator where an exception was not returned +Fixed a problem with the Load operator where an exception was not +returned in the case where the table is already loaded. (Lin Ming) BZ 463 @@ -5024,7 +5352,8 @@ Implemented support for UserTerm (Method invocation) for the Unload operator as per the ACPI spec. (Lin Ming) BZ 580 -Fixed a problem with the LoadTable operator where the OemId and OemTableId +Fixed a problem with the LoadTable operator where the OemId and +OemTableId input strings could cause unexpected failures if they were shorter than the maximum lengths allowed. (Lin Ming, Bob Moore) BZ 576 @@ -5058,7 +5387,8 @@ binary DSDTs and SSDTs. If incorrect, a message is displayed within the table header dump at the start of the disassembly. -Implemented additional debugging information in the namespace listing file +Implemented additional debugging information in the namespace listing +file created during compilation. In addition to the namespace hierarchy, the full pathname to each namespace object is displayed. @@ -5070,7 +5400,8 @@ faults or infinite loops. Fixed an unexpected parse error when using the optional "parameter types" list in a control method declaration. (Lin Ming) BZ 397 -Fixed a problem where two External declarations with the same name did not +Fixed a problem where two External declarations with the same name did +not cause an error (Lin Ming) BZ 509 Implemented support for full TermArgs (adding Argx, Localx and method @@ -5089,7 +5420,8 @@ operand resolution for the three string arguments. Similar to OperationRegion deferred argument execution.) Lin Ming. BZ 430 -Implemented full argument resolution support for the BankValue argument to +Implemented full argument resolution support for the BankValue argument +to BankField. Previously, only constants were supported, now any TermArg may be used. Lin Ming BZ 387, 393 @@ -5104,15 +5436,18 @@ Zhao. Fixed a problem where "unknown" GPEs could be allowed to fire repeatedly if -the underlying AML code changed the GPE enable registers. Now, any unknown +the underlying AML code changed the GPE enable registers. Now, any +unknown incoming GPE (no _Lxx/_Exx method and not the EC GPE) is immediately disabled instead of simply ignored. Rui Zhang. -Fixed a problem with Index Fields where the Index register was incorrectly +Fixed a problem with Index Fields where the Index register was +incorrectly limited to a maximum of 32 bits. Now any size may be used. -Fixed a couple memory leaks associated with "implicit return" objects when +Fixed a couple memory leaks associated with "implicit return" objects +when the AML Interpreter slack mode is enabled. Lin Ming BZ 349 Example Code and Data Size: These are the sizes for the OS-independent @@ -5144,11 +5479,14 @@ contents of the various event counters. Returns the current values for AcpiSciCount, AcpiGpeCount, the AcpiFixedEventCount array, and AcpiMethodCount. The interface can be expanded in the future if new counters -are added. Device drivers should use this interface rather than access the +are added. Device drivers should use this interface rather than access +the counters directly. -Fixed a problem with the FromBCD and ToBCD operators. With some compilers, -the ShortDivide function worked incorrectly, causing problems with the BCD +Fixed a problem with the FromBCD and ToBCD operators. With some +compilers, +the ShortDivide function worked incorrectly, causing problems with the +BCD functions with large input values. A truncation from 64-bit to 32-bit inadvertently occurred. Internal BZ 435. Lin Ming @@ -5156,7 +5494,8 @@ Fixed a problem with Index references passed as method arguments. References passed as arguments to control methods were dereferenced immediately (before -control was passed to the called method). The references are now correctly +control was passed to the called method). The references are now +correctly passed directly to the called method. BZ 5389. Lin Ming Fixed a problem with CopyObject used in conjunction with the Index @@ -5193,7 +5532,8 @@ PCIBARTarget. Fixed a problem with the 64-bit version of AcpiExec where the extended (64- bit) address fields for the DSDT and FACS within the FADT were not being -used, causing truncation of the upper 32-bits of these addresses. Lin Ming +used, causing truncation of the upper 32-bits of these addresses. Lin +Ming and Bob Moore ---------------------------------------- @@ -5202,7 +5542,8 @@ and Bob Moore 1) ACPI CA Core Subsystem: Fixed a problem with the Alias operator when the target of the alias is a -named ASL operator that opens a new scope -- Scope, Device, PowerResource, +named ASL operator that opens a new scope -- Scope, Device, +PowerResource, Processor, and ThermalZone. In these cases, any children of the original operator could not be accessed via the alias, potentially causing unexpected @@ -5308,12 +5649,14 @@ a much larger code and data size. 2) iASL Compiler/Disassembler: -Implemented support to allow multiple files to be compiled/disassembled in +Implemented support to allow multiple files to be compiled/disassembled +in a single invocation. This includes command line wildcard support for both the Windows and Unix versions of the compiler. This feature simplifies the -disassembly and compilation of multiple ACPI tables in a single directory. +disassembly and compilation of multiple ACPI tables in a single +directory. ---------------------------------------- 08 May 2007. Summary of changes for version 20070508: @@ -5324,8 +5667,10 @@ Implemented a Microsoft compatibility design change for the handling of the Notify AML operator. Previously, notify handlers were dispatched and executed completely asynchronously in a deferred thread. The new design -still executes the notify handlers in a different thread, but the original -thread that executed the Notify() now waits at a synchronization point for +still executes the notify handlers in a different thread, but the +original +thread that executed the Notify() now waits at a synchronization point +for the notify handler to complete. Some machines depend on a synchronous Notify operator in order to operate correctly. @@ -5339,13 +5684,16 @@ until recently. Fixed a problem with the internal FADT conversion where ACPI 1.0 FADTs that contained invalid non-zero values in reserved fields could cause later -failures because these fields have meaning in later revisions of the FADT. +failures because these fields have meaning in later revisions of the +FADT. For incoming ACPI 1.0 FADTs, these fields are now always zeroed. (The fields are: Preferred_PM_Profile, PSTATE_CNT, CST_CNT, and IAPC_BOOT_FLAGS.) -Fixed a problem where the Global Lock handle was not properly updated if a -thread that acquired the Global Lock via executing AML code then attempted +Fixed a problem where the Global Lock handle was not properly updated if +a +thread that acquired the Global Lock via executing AML code then +attempted to acquire the lock via the AcpiAcquireGlobalLock interface. Reported by Joe Liu. @@ -5375,8 +5723,10 @@ a much larger code and data size. Implemented a change to the order of interpretation and evaluation of AML operand objects within the AML interpreter. The interpreter now evaluates operands in the order that they appear in the AML stream (and the -corresponding ASL code), instead of in the reverse order (after the entire -operand list has been parsed). The previous behavior caused several subtle +corresponding ASL code), instead of in the reverse order (after the +entire +operand list has been parsed). The previous behavior caused several +subtle incompatibilities with the Microsoft AML interpreter as well as being somewhat non-intuitive. BZ 7871, local BZ 263. Valery Podrezov. @@ -5388,7 +5738,8 @@ lock as well as the internal use of the global lock to support AML fields -- a control method that is holding the global lock can now simultaneously access -AML fields that require global lock protection. Previously, in both cases, +AML fields that require global lock protection. Previously, in both +cases, this would have resulted in an AE_ALREADY_ACQUIRED exception. The change to AcpiAcquireGlobalLock is of special interest to drivers for the Embedded @@ -5398,7 +5749,8 @@ as this can already be used to acquire a mutex multiple times by the same thread. BZ 8066. With assistance from Alexey Starikovskiy. Fixed a problem where invalid objects could be referenced in the AML -Interpreter after error conditions. During operand evaluation, ensure that +Interpreter after error conditions. During operand evaluation, ensure +that the internal "Return Object" field is cleared on error and only valid pointers are stored there. Caused occasional access to deleted objects that @@ -5417,7 +5769,8 @@ target of a reference (Reference.Opcode). This code was no longer necessary. BZ 7874. Valery Podrezov. -Removed obsolete ACPI_NO_INTEGER64_SUPPORT from two header files. This was +Removed obsolete ACPI_NO_INTEGER64_SUPPORT from two header files. This +was a remnant from the previously discontinued 16-bit support. @@ -5479,7 +5832,8 @@ enable a clean subsystem restart, via the implementation of the AcpiEvRemoveGlobalLockHandler function. (With assistance from Joel Bretz, HP) -Implemented enhancements to the multithreading support within the debugger +Implemented enhancements to the multithreading support within the +debugger to enable improved multithreading debugging and evaluation of the subsystem. (Valery Podrezov) @@ -5514,7 +5868,8 @@ statistics upon subsystem/program termination. (Valery Podrezov) 1) ACPI CA Core Subsystem: -Optimized the Load ASL operator in the case where the source operand is an +Optimized the Load ASL operator in the case where the source operand is +an operation region. Simply map the operation region memory, instead of performing a bytewise read. (Region must be of type SystemMemory, see below.) @@ -5530,7 +5885,8 @@ SystemMemory, as per the ACPI specification. BZ 481 Additional cleanup and optimizations for the new Table Manager code. -AcpiEnable will now fail if all of the required ACPI tables are not loaded +AcpiEnable will now fail if all of the required ACPI tables are not +loaded (FADT, FACS, DSDT). BZ 477 Added #pragma pack(8/4) to acobject.h to ensure that the structures in @@ -5581,22 +5937,26 @@ obtained and also checked for an ID match. Implemented additional support for the PCI _ADR execution: upsearch until a device scope is found before executing _ADR. This allows PCI_Config -operation regions to be declared locally within control methods underneath +operation regions to be declared locally within control methods +underneath PCI device objects. Fixed a problem with a possible race condition between threads executing AcpiWalkNamespace and the AML interpreter. This condition was removed by -modifying AcpiWalkNamespace to (by default) ignore all temporary namespace +modifying AcpiWalkNamespace to (by default) ignore all temporary +namespace entries created during any concurrent control method execution. An additional namespace race condition is known to exist between AcpiWalkNamespace and the Load/Unload ASL operators and is still under investigation. Restructured the AML ParseLoop function, breaking it into several -subfunctions in order to reduce CPU stack use and improve maintainability. +subfunctions in order to reduce CPU stack use and improve +maintainability. (Mikhail Kouzmich) -AcpiGetHandle: Fix for parameter validation to detect invalid combinations +AcpiGetHandle: Fix for parameter validation to detect invalid +combinations of prefix handle and pathname. BZ 478 Example Code and Data Size: These are the sizes for the OS-independent @@ -5629,7 +5989,8 @@ level indication flag is not needed. Fixed a problem with the Global Lock where the lock could appear to be obtained before it is actually obtained. The global lock semaphore was -inadvertently created with one unit instead of zero units. (BZ 464) Fiodor +inadvertently created with one unit instead of zero units. (BZ 464) +Fiodor Suietov. Fixed a possible memory leak and fault in AcpiExResolveObjectToValue @@ -5652,13 +6013,15 @@ a much larger code and data size. 2) iASL Compiler/Disassembler and Tools: -Fixed a compilation problem with the pre-defined Resource Descriptor field +Fixed a compilation problem with the pre-defined Resource Descriptor +field names where an "object does not exist" error could be incorrectly generated if the parent ResourceTemplate pathname places the template within a different namespace scope than the current scope. (BZ 7212) -Fixed a problem where the compiler could hang after syntax errors detected +Fixed a problem where the compiler could hang after syntax errors +detected in an ElseIf construct. (BZ 453) Fixed a problem with the AmlFilename parameter to the DefinitionBlock() @@ -5667,7 +6030,8 @@ was a null string (""). Now, the original input filename is used as the AML output filename, with an ".aml" extension. -Implemented a generic batch command mode for the AcpiExec utility (execute +Implemented a generic batch command mode for the AcpiExec utility +(execute any AML debugger command) (Valery Podrezov). ---------------------------------------- @@ -5699,8 +6063,10 @@ Moved all FADT-related functions to a new file, tbfadt.c. Eliminated the AcpiHwInitialize function - the FADT registers are now validated when the table is loaded. -Added two new warnings during FADT verification - 1) if the FADT is larger -than the largest known FADT version, and 2) if there is a mismatch between +Added two new warnings during FADT verification - 1) if the FADT is +larger +than the largest known FADT version, and 2) if there is a mismatch +between a 32-bit block address and the 64-bit X counterpart (when both are non- zero.) @@ -5721,8 +6087,10 @@ a much larger code and data size. 2) iASL Compiler/Disassembler and Tools: -Fixed a problem with the implementation of the Switch() operator where the -temporary variable was declared too close to the actual Switch, instead of +Fixed a problem with the implementation of the Switch() operator where +the +temporary variable was declared too close to the actual Switch, instead +of at method level. This could cause a problem if the Switch() operator is within a while loop, causing an error on the second iteration. (BZ 460) @@ -5732,7 +6100,8 @@ operator. Now, ignore it and continue. Disassembly of an FADT now verifies the input FADT and reports any errors found. Fix for proper disassembly of full-sized (ACPI 2.0) FADTs. -Disassembly of raw data buffers with byte initialization data now prefixes +Disassembly of raw data buffers with byte initialization data now +prefixes each output line with the current buffer offset. Disassembly of ASF! table now includes all variable-length data fields at @@ -5765,7 +6134,8 @@ now immediately disabled to prevent the waking GPE from firing again and to prevent other wake GPEs from interrupting the wake process. -Added the AcpiGpeCount global that tracks the number of processed GPEs, to +Added the AcpiGpeCount global that tracks the number of processed GPEs, +to be used for debugging systems with a large number of ACPI interrupts. Implemented support for the "DMAR" ACPI table (DMA Redirection Table) in @@ -5817,7 +6187,8 @@ New ACPICA interfaces: used. - AcpiReallocateRootTable: Used to transfer the root table to dynamically allocated memory after it becomes available. -- AcpiGetTableByIndex: Allows the host to easily enumerate all ACPI tables +- AcpiGetTableByIndex: Allows the host to easily enumerate all ACPI +tables in the RSDT/XSDT. Other ACPICA changes: @@ -5836,7 +6207,8 @@ other allocation interfaces. - The interface to AcpiOsGetRootPointer has changed to eliminate unnecessary parameters. -- ACPI_PHYSICAL_ADDRESS is now 32 bits on 32-bit platforms, 64 bits on 64- +- ACPI_PHYSICAL_ADDRESS is now 32 bits on 32-bit platforms, 64 bits on +64- bit platforms. Was previously 64 bits on all platforms. - The interface to the ACPI Global Lock acquire/release macros have changed @@ -5857,7 +6229,8 @@ running to copy the root table to a dynamically allocated array, freeing up the scratch memory specified in the call to AcpiInitializeTables. - AcpiSubsystemInitialize: This existing interface is independent of the -Table Manager, and does not have to be called before the Table Manager can +Table Manager, and does not have to be called before the Table Manager +can be used, it only must be called before the rest of ACPICA can be used. - ACPI Tables: Some changes have been made to the names and structure of the @@ -5902,7 +6275,8 @@ source for the first time. The source is contained in a separate package and consists of over 1100 files that exercise all ASL/AML operators. The package -should appear on the Intel/ACPI web site shortly. (Valery Podrezov, Fiodor +should appear on the Intel/ACPI web site shortly. (Valery Podrezov, +Fiodor Suietov) Completed a new design and implementation for support of the ACPI Global @@ -5920,18 +6294,22 @@ semaphore is signaled directly from the interrupt handler. Implemented support within the AML interpreter for package objects that -contain a larger AML length (package list length) than the package element +contain a larger AML length (package list length) than the package +element count. In this case, the length of the package is truncated to match the package element count. Some BIOS code apparently modifies the package length -on the fly, and this change supports this behavior. Provides compatibility +on the fly, and this change supports this behavior. Provides +compatibility with the MS AML interpreter. (With assistance from Fiodor Suietov) -Implemented a temporary fix for the BankValue parameter of a Bank Field to +Implemented a temporary fix for the BankValue parameter of a Bank Field +to support all constant values, now including the Zero and One opcodes. Evaluation of this parameter must eventually be converted to a full TermArg -evaluation. A not-implemented error is now returned (temporarily) for non- +evaluation. A not-implemented error is now returned (temporarily) for +non- constant values for this parameter. Fixed problem reports (Fiodor Suietov) integrated: @@ -5976,7 +6354,8 @@ operation of AML mutexes and recursive control methods. The DSDT is now the only ACPI table that determines whether the AML interpreter is in 32-bit or 64-bit mode. Not really a functional change, but -the hooks for per-table 32/64 switching have been removed from the code. A +the hooks for per-table 32/64 switching have been removed from the code. +A clarification to the ACPI specification is forthcoming in ACPI 3.0B. Fixed a possible leak of an OwnerID in the error path of @@ -6002,7 +6381,8 @@ Fixed problem reports (Valery Podrezov) integrated: Fixed problem reports (Fiodor Suietov) integrated: - Incomplete cleanup branches in AcpiTbGetTableRsdt (BZ 369) - On Address Space handler deletion, needless deactivation call (BZ 374) -- AcpiRemoveAddressSpaceHandler: validate Device handle parameter (BZ 375) +- AcpiRemoveAddressSpaceHandler: validate Device handle parameter (BZ +375) - Possible memory leak, Notify sub-objects of Processor, Power, ThermalZone (BZ 376) @@ -6043,13 +6423,15 @@ Implemented a new ACPI_SPINLOCK type for the OSL lock interfaces. This allows the type to be customized to the host OS for improved efficiency (since a spinlock is usually a very small object.) -Implemented support for "ignored" bits in the ACPI registers. According to +Implemented support for "ignored" bits in the ACPI registers. According +to the ACPI specification, these bits should be preserved when writing the registers via a read/modify/write cycle. There are 3 bits preserved in this manner: PM1_CONTROL[0] (SCI_EN), PM1_CONTROL[9], and PM1_STATUS[11]. -Implemented the initial deployment of new OSL mutex interfaces. Since some +Implemented the initial deployment of new OSL mutex interfaces. Since +some host operating systems have separate mutex and semaphore objects, this feature was requested. The base code now uses mutexes (and the new mutex interfaces) wherever a binary semaphore was used previously. However, for @@ -6060,14 +6442,17 @@ required at this time. (See acpiosxf.h) Fixed several problems with the support for the control method SyncLevel -parameter. The SyncLevel now works according to the ACPI specification and -in concert with the Mutex SyncLevel parameter, since the current SyncLevel +parameter. The SyncLevel now works according to the ACPI specification +and +in concert with the Mutex SyncLevel parameter, since the current +SyncLevel is a property of the executing thread. Mutual exclusion for control methods is now implemented with a mutex instead of a semaphore. Fixed three instances of the use of the C shift operator in the bitfield -support code (exfldio.c) to avoid the use of a shift value larger than the +support code (exfldio.c) to avoid the use of a shift value larger than +the target data width. The behavior of C compilers is undefined in this case and can cause unpredictable results, and therefore the case must be detected @@ -6075,8 +6460,10 @@ and avoided. (Fiodor Suietov) Added an info message whenever an SSDT or OEM table is loaded dynamically -via the Load() or LoadTable() ASL operators. This should improve debugging -capability since it will show exactly what tables have been loaded (beyond +via the Load() or LoadTable() ASL operators. This should improve +debugging +capability since it will show exactly what tables have been loaded +(beyond the tables present in the RSDT/XSDT.) Example Code and Data Size: These are the sizes for the OS-independent @@ -6102,7 +6489,8 @@ No changes for this release. 1) ACPI CA Core Subsystem: -Converted the locking mutex used for the ACPI hardware to a spinlock. This +Converted the locking mutex used for the ACPI hardware to a spinlock. +This change should eliminate all problems caused by attempting to acquire a semaphore at interrupt level, and it means that all ACPICA external interfaces that directly access the ACPI hardware can be safely called @@ -6165,7 +6553,8 @@ namespace object evaluation - resulting in smaller code, less CPU stack use, and fewer interfaces. (With assistance from Mikhail Kouzmich) -Fixed a problem with the CopyObject operator where the first parameter was +Fixed a problem with the CopyObject operator where the first parameter +was not typed correctly for the parser, interpreter, compiler, and disassembler. Caused various errors and unexpected behavior. @@ -6182,7 +6571,8 @@ Fixed problem reports (Valery Podrezov) integrated: - Allow interpreter to handle nested method declarations (BZ 5361) Fixed problem reports (Fiodor Suietov) integrated: -- AcpiTerminate doesn't free debug memory allocation list objects (BZ 355) +- AcpiTerminate doesn't free debug memory allocation list objects (BZ +355) - After Core Subsystem shutdown, AcpiSubsystemStatus returns AE_OK (BZ 356) - AcpiOsUnmapMemory for RSDP can be invoked inconsistently (BZ 357) @@ -6215,7 +6605,8 @@ a much larger code and data size. Modified the parser to allow the names IO, DMA, and IRQ to be used as namespace identifiers with no collision with existing resource descriptor macro names. This provides compatibility with other ASL compilers and is -most useful for disassembly/recompilation of existing tables without parse +most useful for disassembly/recompilation of existing tables without +parse errors. (With assistance from Thomas Renninger) Disassembler: fixed an incorrect disassembly problem with the @@ -6230,7 +6621,8 @@ disassembly of some Alias operators. Replaced the AcpiOsQueueForExecution interface with a new interface named AcpiOsExecute. The major difference is that the new interface does not have -a Priority parameter, this appeared to be useless and has been replaced by +a Priority parameter, this appeared to be useless and has been replaced +by a Type parameter. The Type tells the host what type of execution is being requested, such as global lock handler, notify handler, GPE handler, etc. @@ -6243,12 +6635,14 @@ deadlock problems such as BZ #5534, and will require changes to all existing OS interface layers. (Alexey Starikovskiy and Bob Moore) -Fixed a possible memory leak associated with the support for the so-called +Fixed a possible memory leak associated with the support for the so- +called "implicit return" ACPI extension. Reported by FreeBSD, BZ #6514. (Fiodor Suietov) Fixed a problem with the Load() operator where a table load from an -operation region could overwrite an internal table buffer by up to 7 bytes +operation region could overwrite an internal table buffer by up to 7 +bytes and cause alignment faults on IPF systems. (With assistance from Luming Yu) @@ -6274,14 +6668,17 @@ namespace and automatically generate ASL External() statements for symbols not defined within the current table being disassembled. This will simplify the -disassembly and recompilation of interdependent tables such as SSDTs since +disassembly and recompilation of interdependent tables such as SSDTs +since these statements will no longer have to be added manually. Disassembler: Implemented experimental support to automatically detect invocations of external control methods and generate appropriate External() -statements. This is problematic because the AML cannot be correctly parsed -until the number of arguments for each control method is known. Currently, +statements. This is problematic because the AML cannot be correctly +parsed +until the number of arguments for each control method is known. +Currently, standalone method invocations and invocations as the source operand of a Store() statement are supported. @@ -6297,7 +6694,8 @@ more readable and likely closer to the original ASL source. Removed a device initialization optimization introduced in 20051216 where the _STA method was not run unless an _INI was also present for the same -device. This optimization could cause problems because it could allow _INI +device. This optimization could cause problems because it could allow +_INI methods to be run within a not-present device subtree. (If a not-present device had no _INI, _STA would not be run, the not-present status would not @@ -6324,7 +6722,8 @@ Defined and deployed a new OSL interface, AcpiOsValidateAddress. This interface is called during the creation of all AML operation regions, and allows the host OS to exert control over what addresses it will allow the AML code to access. Operation Regions whose addresses are disallowed will -cause a runtime exception when they are actually accessed (will not affect +cause a runtime exception when they are actually accessed (will not +affect or abort table loading.) See oswinxf or osunixxf for an example implementation. @@ -6334,11 +6733,13 @@ interface/behavior strings for the _OSI predefined control method as appropriate (with assistance from Bjorn Helgaas.) See oswinxf or osunixxf for an example implementation. -Restructured and corrected various problems in the exception handling code +Restructured and corrected various problems in the exception handling +code paths within DsCallControlMethod and DsTerminateControlMethod in dsmethod (with assistance from Takayoshi Kochi.) -Modified the Linux source converter to ignore quoted string literals while +Modified the Linux source converter to ignore quoted string literals +while converting identifiers from mixed to lower case. This will correct problems with the disassembler and other areas where such strings must not be @@ -6378,12 +6779,16 @@ check for the possible timeout, a warning is issued. 2) Useless operators: If an ASL operator does not specify an optional target operand and it also does not use the function return value from the -operator, a warning is issued since the operator effectively does nothing. +operator, a warning is issued since the operator effectively does +nothing. 3) Unreferenced objects: If a namespace object is created, but never -referenced, a warning is issued. This is a warning level 2 since there are -cases where this is ok, such as when a secondary table is loaded that uses -the unreferenced objects. Even so, care is taken to only flag objects that +referenced, a warning is issued. This is a warning level 2 since there +are +cases where this is ok, such as when a secondary table is loaded that +uses +the unreferenced objects. Even so, care is taken to only flag objects +that don't look like they will ever be used. For example, the reserved methods (starting with an underscore) are usually not referenced because it is expected that the OS will invoke them. @@ -6403,13 +6808,15 @@ are available for use by device drivers and other software. Implemented support to allow tables that contain ACPI names with invalid characters to be loaded. Previously, this would cause the table load to fail, but since there are several known cases of such tables on existing -machines, this change was made to enable ACPI support for them. Also, this +machines, this change was made to enable ACPI support for them. Also, +this matches the behavior of the Microsoft ACPI implementation. Fixed a couple regressions introduced during the memory optimization in the 20060317 release. The namespace node definition required additional -reorganization and an internal datatype that had been changed to 8-bit was +reorganization and an internal datatype that had been changed to 8-bit +was restored to 32-bit. (Valery Podrezov) Fixed a problem where a null pointer passed to AcpiUtDeleteGenericState @@ -6426,7 +6833,8 @@ frequently used control methods. (Dana Meyers) Reorganized the ACPI table header files into two main files: one for the -ACPI tables consumed by the ACPICA core, and another for the miscellaneous +ACPI tables consumed by the ACPICA core, and another for the +miscellaneous ACPI tables that are consumed by the drivers and other software. The various FADT definitions were merged into one common section and three different @@ -6475,21 +6883,25 @@ makefile for the AcpiXtract utility. Implemented the use of a cache object for all internal namespace nodes. Since there are about 1000 static nodes in a typical system, this will -decrease memory use for cache implementations that minimize per-allocation +decrease memory use for cache implementations that minimize per- +allocation overhead (such as a slab allocator.) Removed the reference count mechanism for internal namespace nodes, since it was deemed unnecessary. This reduces the size of each namespace node by -about 5%-10% on all platforms. Nodes are now 20 bytes for the 32-bit case, +about 5%-10% on all platforms. Nodes are now 20 bytes for the 32-bit +case, and 32 bytes for the 64-bit case. -Optimized several internal data structures to reduce object size on 64-bit +Optimized several internal data structures to reduce object size on 64- +bit platforms by packing data within the 64-bit alignment. This includes the frequently used ACPI_OPERAND_OBJECT, of which there can be ~1000 static instances corresponding to the namespace objects. -Added two new strings for the predefined _OSI method: "Windows 2001.1 SP1" +Added two new strings for the predefined _OSI method: "Windows 2001.1 +SP1" and "Windows 2006". Split the allocation tracking mechanism out to a separate file, from @@ -6502,7 +6914,8 @@ associated code. (These macros have been replaced by the ACPI_ERROR and ACPI_WARNING macros.) -Code and Data Size: These are the sizes for the acpica.lib produced by the +Code and Data Size: These are the sizes for the acpica.lib produced by +the Microsoft Visual C++ 6.0 32-bit compiler. The values do not include any ACPI driver or OSPM code. The debug version of the code includes the debug @@ -6521,7 +6934,8 @@ compiler options used during generation. 2) iASL Compiler/Disassembler and Tools: -Implemented an ANSI C version of the acpixtract utility. This version will +Implemented an ANSI C version of the acpixtract utility. This version +will automatically extract the DSDT and all SSDTs from the input acpidump text file and dump the binary output to separate files. It can also display a summary of the input file including the headers for each table found and @@ -6534,11 +6948,13 @@ source/tools/acpixtract) 1) ACPI CA Core Subsystem: Tagged all external interfaces to the subsystem with the new -ACPI_EXPORT_SYMBOL macro. This macro can be defined as necessary to assist +ACPI_EXPORT_SYMBOL macro. This macro can be defined as necessary to +assist kernel integration. For Linux, the macro resolves to the EXPORT_SYMBOL macro. The default definition is NULL. -Added the ACPI_THREAD_ID type for the return value from AcpiOsGetThreadId. +Added the ACPI_THREAD_ID type for the return value from +AcpiOsGetThreadId. This allows the host to define this as necessary to simplify kernel integration. The default definition is ACPI_NATIVE_UINT. @@ -6554,13 +6970,15 @@ with large namespaces (especially 64-bit.) Increased the value from 0x400 to 0x800. -Due to universal disagreement as to the meaning of the 'c' in the calloc() +Due to universal disagreement as to the meaning of the 'c' in the +calloc() function, the ACPI_MEM_CALLOCATE macro has been renamed to ACPI_ALLOCATE_ZEROED so that the purpose of the interface is 'clear'. ACPI_MEM_ALLOCATE and ACPI_MEM_FREE are renamed to ACPI_ALLOCATE and ACPI_FREE. -Code and Data Size: These are the sizes for the acpica.lib produced by the +Code and Data Size: These are the sizes for the acpica.lib produced by +the Microsoft Visual C++ 6.0 32-bit compiler. The values do not include any ACPI driver or OSPM code. The debug version of the code includes the debug @@ -6580,17 +6998,20 @@ compiler options used during generation. 2) iASL Compiler/Disassembler: Disassembler: implemented support for symbolic resource descriptor -references. If a CreateXxxxField operator references a fixed offset within +references. If a CreateXxxxField operator references a fixed offset +within a resource descriptor, a name is assigned to the descriptor and the offset is translated to the appropriate resource tag and pathname. The addition of this support brings the disassembled code very close to the original ASL -source code and helps eliminate run-time errors when the disassembled code +source code and helps eliminate run-time errors when the disassembled +code is modified (and recompiled) in such a way as to invalidate the original fixed offsets. -Implemented support for a Descriptor Name as the last parameter to the ASL +Implemented support for a Descriptor Name as the last parameter to the +ASL Register() macro. This parameter was inadvertently left out of the ACPI specification, and will be added for ACPI 3.0b. @@ -6612,7 +7033,8 @@ Implemented a change to the IndexField support to match the behavior of the Microsoft AML interpreter. The value written to the Index register is now a -byte offset, no longer an index based upon the width of the Data register. +byte offset, no longer an index based upon the width of the Data +register. This should fix IndexField problems seen on some machines where the Data register is not exactly one byte wide. The ACPI specification will be clarified on this point. @@ -6626,7 +7048,8 @@ Fixed a problem where individual resource descriptors were misaligned within the internal buffer, causing alignment faults on IA64 platforms. -Code and Data Size: These are the sizes for the acpica.lib produced by the +Code and Data Size: These are the sizes for the acpica.lib produced by +the Microsoft Visual C++ 6.0 32-bit compiler. The values do not include any ACPI driver or OSPM code. The debug version of the code includes the debug @@ -6675,7 +7098,8 @@ AE_STRING_LIMIT on an out-of-bounds Index() operation. (Valery Podrezov, BZ 5480) -Implemented a memory cleanup at the end of the execution of each iteration +Implemented a memory cleanup at the end of the execution of each +iteration of an AML While() loop, preventing the accumulation of outstanding objects. (Valery Podrezov, BZ 5427) @@ -6686,14 +7110,16 @@ Podrezov, BZ 5336) Fixed several warnings during the 64-bit code generation. -The AcpiSrc source code conversion tool now inserts one line of whitespace +The AcpiSrc source code conversion tool now inserts one line of +whitespace after an if() statement that is followed immediately by a comment, improving readability of the Linux code. Code and Data Size: The current and previous library sizes for the core subsystem are shown below. These are the code and data sizes for the -acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. These +acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. +These values do not include any ACPI driver or OSPM code. The debug version of the code includes the debug output trace mechanism and has a much larger code @@ -6720,7 +7146,8 @@ expression for the BankValue parameter. 1) ACPI CA Core Subsystem: -Implemented support in the Resource Manager to allow unresolved namestring +Implemented support in the Resource Manager to allow unresolved +namestring references within resource package objects for the _PRT method. This support is in addition to the previously implemented unresolved reference support @@ -6736,7 +7163,8 @@ ACPI_WARNING, and ACPI_INFO replace the ACPI_REPORT_* macros. The older macros remain defined to allow ACPI drivers time to migrate to the new macros. -Implemented the ACPI_CPU_FLAGS type to simplify host OS integration of the +Implemented the ACPI_CPU_FLAGS type to simplify host OS integration of +the Acquire/Release Lock OSL interfaces. Fixed a problem where Alias ASL operators are sometimes not correctly @@ -6755,7 +7183,8 @@ interface. (With assistance from Thomas Renninger) Code and Data Size: The current and previous library sizes for the core subsystem are shown below. These are the code and data sizes for the -acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. These +acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. +These values do not include any ACPI driver or OSPM code. The debug version of the code includes the debug output trace mechanism and has a much larger code @@ -6786,15 +7215,18 @@ Added 2006 copyright to all module headers and signons. This affects virtually every file in the ACPICA core subsystem, iASL compiler, and the utilities. -Enhanced the ACPICA error reporting in order to simplify user migration to +Enhanced the ACPICA error reporting in order to simplify user migration +to the non-debug version of ACPICA. Replaced all instances of the -ACPI_DEBUG_PRINT macro invoked at the ACPI_DB_ERROR and ACPI_DB_WARN debug +ACPI_DEBUG_PRINT macro invoked at the ACPI_DB_ERROR and ACPI_DB_WARN +debug levels with the ACPI_REPORT_ERROR and ACPI_REPORT_WARNING macros, respectively. This preserves all error and warning messages in the non- debug version of the ACPICA code (this has been referred to as the "debug lite" option.) Over 200 cases were converted to create a total of over 380 -error/warning messages across the ACPICA code. This increases the code and +error/warning messages across the ACPICA code. This increases the code +and data size of the default non-debug version of the code somewhat (about 13K), but all error/warning reporting may be disabled if desired (and code @@ -6808,7 +7240,8 @@ not properly deleted for every successful invocation of the command. Code and Data Size: The current and previous library sizes for the core subsystem are shown below. These are the code and data sizes for the -acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. These +acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. +These values do not include any ACPI driver or OSPM code. The debug version of the code includes the debug output trace mechanism and has a much larger code @@ -6838,7 +7271,8 @@ www.acpi.info) Implemented optional support to allow unresolved names within ASL Package objects. A null object is inserted in the package when a named reference cannot be located in the current namespace. Enabled via the interpreter -slack flag, this should eliminate AE_NOT_FOUND exceptions seen on machines +slack flag, this should eliminate AE_NOT_FOUND exceptions seen on +machines that contain such code. Implemented an optimization to the initialization sequence that can @@ -6854,7 +7288,8 @@ it is a waste of time to run the _STA method if the _INI does not exist. Implemented use of the C99 uintptr_t for the pointer casting macros if it is -available in the current compiler. Otherwise, the default (void *) cast is +available in the current compiler. Otherwise, the default (void *) cast +is used as before. Fixed some possible memory leaks found within the execution path of the @@ -6868,7 +7303,8 @@ Moved resource descriptor string constants that are used by both the AML disassembler and AML debugger to the common utilities directory so that these components are independent. -Implemented support in the AcpiExec utility (-e switch) to globally ignore +Implemented support in the AcpiExec utility (-e switch) to globally +ignore exceptions during control method execution (method is not aborted.) Added the rsinfo.c source file to the AcpiExec makefile for Linux/Unix @@ -6876,7 +7312,8 @@ generation. Code and Data Size: The current and previous library sizes for the core subsystem are shown below. These are the code and data sizes for the -acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. These +acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. +These values do not include any ACPI driver or OSPM code. The debug version of the code includes the debug output trace mechanism and has a much larger code @@ -6905,12 +7342,15 @@ method call was made from within a Return statement. Modified the parsing of control methods to no longer create namespace objects during the first pass of the parse. Objects are now created only -during the execute phase, at the moment the namespace creation operator is -encountered in the AML (Name, OperationRegion, CreateByteField, etc.) This +during the execute phase, at the moment the namespace creation operator +is +encountered in the AML (Name, OperationRegion, CreateByteField, etc.) +This should eliminate ALREADY_EXISTS exceptions seen on some machines where reentrant control methods are protected by an AML mutex. The mutex will now -correctly block multiple threads from attempting to create the same object +correctly block multiple threads from attempting to create the same +object more than once. Increased the number of available Owner Ids for namespace object tracking @@ -6928,7 +7368,8 @@ namespace object. Code and Data Size: The current and previous library sizes for the core subsystem are shown below. These are the code and data sizes for the -acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. These +acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. +These values do not include any ACPI driver or OSPM code. The debug version of the code includes the debug output trace mechanism and has a much larger code @@ -6948,7 +7389,8 @@ of the compiler and the compiler options used during generation. Fixed a parse error during compilation of certain Switch/Case constructs. To -simplify the parse, the grammar now allows for multiple Default statements +simplify the parse, the grammar now allows for multiple Default +statements and this error is now detected and flagged during the analysis phase. Disassembler: The disassembly now includes the contents of the original @@ -6983,14 +7425,16 @@ buffer overflow could occur for small resource templates. Implemented a new external interface, AcpiGetVendorResource. This interface -will find and return a vendor-defined resource descriptor within a _CRS or +will find and return a vendor-defined resource descriptor within a _CRS +or _PRS method via an ACPI 3.0 UUID match. With assistance from Bjorn Helgaas. Removed the length limit (200) on string objects as per the upcoming ACPI 3.0A specification. This affects the following areas of the interpreter: 1) -any implicit conversion of a Buffer to a String, 2) a String object result +any implicit conversion of a Buffer to a String, 2) a String object +result of the ASL Concatentate operator, 3) the String object result of the ASL ToString operator. @@ -7005,7 +7449,8 @@ the recently added file named "utresrc.c". Code and Data Size: The current and previous library sizes for the core subsystem are shown below. These are the code and data sizes for the -acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. These +acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. +These values do not include any ACPI driver or OSPM code. The debug version of the code includes the debug output trace mechanism and has a much larger code @@ -7043,16 +7488,19 @@ tree. The transformed tree is dumped also. 1) ACPI CA Core Subsystem: -Modified the subsystem initialization sequence to improve GPE support. The +Modified the subsystem initialization sequence to improve GPE support. +The GPE initialization has been split into two parts in order to defer execution -of the _PRW methods (Power Resources for Wake) until after the hardware is +of the _PRW methods (Power Resources for Wake) until after the hardware +is fully initialized and the SCI handler is installed. This allows the _PRW methods to access fields protected by the Global Lock. This will fix systems where a NO_GLOBAL_LOCK exception has been seen during initialization. -Converted the ACPI internal object disassemble and display code within the +Converted the ACPI internal object disassemble and display code within +the AML debugger to fully table-driven operation, reducing code size and increasing maintainability. @@ -7066,12 +7514,14 @@ These local types include RegionFields, BankFields, IndexFields, Alias, and reference objects. -Moved common AML resource handling code into a new file, "utresrc.c". This +Moved common AML resource handling code into a new file, "utresrc.c". +This code is shared by both the Resource Manager and the AML Debugger. Code and Data Size: The current and previous library sizes for the core subsystem are shown below. These are the code and data sizes for the -acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. These +acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. +These values do not include any ACPI driver or OSPM code. The debug version of the code includes the debug output trace mechanism and has a much larger code @@ -7100,7 +7550,8 @@ no longer optional, detecting invalid characters within a source file immediately rather than during the parse phase or later. -Enhanced the ASL grammar definition to force early reductions on all list- +Enhanced the ASL grammar definition to force early reductions on all +list- style grammar elements so that the overall parse stack usage is greatly reduced. This should improve performance and reduce the possibility of parse @@ -7131,8 +7582,10 @@ resource descriptors are fully table-driven, reducing code and data size and improving maintainability. -The OSL interfaces for Acquire and Release Lock now use a 64-bit flag word -on 64-bit processors instead of a fixed 32-bit word. (With assistance from +The OSL interfaces for Acquire and Release Lock now use a 64-bit flag +word +on 64-bit processors instead of a fixed 32-bit word. (With assistance +from Alexey Starikovskiy) Implemented support within the resource conversion code for the Type- @@ -7146,7 +7599,8 @@ TTP flags into two separate fields. Code and Data Size: The current and previous library sizes for the core subsystem are shown below. These are the code and data sizes for the -acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. These +acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. +These values do not include any ACPI driver or OSPM code. The debug version of the code includes the debug output trace mechanism and has a much larger code @@ -7165,7 +7619,8 @@ of the compiler and the compiler options used during generation. 2) iASL Compiler/Disassembler: -Relaxed a compiler restriction that disallowed a ResourceIndex byte if the +Relaxed a compiler restriction that disallowed a ResourceIndex byte if +the corresponding ResourceSource string was not also present in a resource descriptor declaration. This restriction caused problems with existing AML/ASL code that includes the Index byte without the string. When such @@ -7173,7 +7628,8 @@ AML was disassembled, it could not be compiled without modification. Further, the modified code created a resource template with a different size than the -original, breaking code that used fixed offsets into the resource template +original, breaking code that used fixed offsets into the resource +template buffer. Removed a recent feature of the disassembler to ignore a lone @@ -7210,7 +7666,8 @@ single location for clarity and ease of maintenance. One new file was created, named "rsinfo.c". The ACPI return macros (return_ACPI_STATUS, etc.) have been modified to -guarantee that the argument is not evaluated twice, making them less prone +guarantee that the argument is not evaluated twice, making them less +prone to macro side-effects. However, since there exists the possibility of additional stack use if a particular compiler cannot optimize them (such as @@ -7221,7 +7678,8 @@ mismatch warnings; the return_UINT8 and return_UINT32 macros are provided to eliminate these. (From Randy Dunlap) -Implemented a new mechanism to enable debug tracing for individual control +Implemented a new mechanism to enable debug tracing for individual +control methods. A new external interface, AcpiDebugTrace, is provided to enable this mechanism. The intent is to allow the host OS to easily enable and disable tracing for problematic control methods. This interface can be @@ -7234,7 +7692,8 @@ the behavior of AcpiUtAllocate. Code and Data Size: The current and previous library sizes for the core subsystem are shown below. These are the code and data sizes for the -acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. These +acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. +These values do not include any ACPI driver or OSPM code. The debug version of the code includes the debug output trace mechanism and has a much larger code @@ -7279,7 +7738,8 @@ optional ACPI_MUTEX_DEBUG code to fail compilation if specified. Code and Data Size: The current and previous library sizes for the core subsystem are shown below. These are the code and data sizes for the -acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. These +acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. +These values do not include any ACPI driver or OSPM code. The debug version of the code includes the debug output trace mechanism and has a much larger code @@ -7297,7 +7757,8 @@ of the compiler and the compiler options used during generation. 2) iASL Compiler/Disassembler: -Updated the disassembler to automatically insert an EndDependentFn() macro +Updated the disassembler to automatically insert an EndDependentFn() +macro into the ASL stream if this macro is missing in the original AML code, simplifying compilation of the resulting ASL module. @@ -7330,7 +7791,8 @@ flags for a 64-bit address descriptor were handled incorrectly in the type- specific flag byte. -Consolidated duplicate code within the address descriptor resource manager +Consolidated duplicate code within the address descriptor resource +manager code, reducing overall subsystem code size. Fixed a fault when using the AML debugger "disassemble" command to @@ -7344,7 +7806,8 @@ are shown below. These are the code and data sizes for the acpica.lib produced by the Microsoft Visual C++ 6.0 compiler. These values do not include any ACPI driver or OSPM code. The debug version of the code includes -the debug output trace mechanism and has a much larger code and data size. +the debug output trace mechanism and has a much larger code and data +size. Note that these values will vary depending on the efficiency of the compiler and the compiler options used during generation. @@ -7364,7 +7827,8 @@ and dma lists for the following ASL macros: Dma(), Irq(), IrqNoFlags(), and Interrupt(). -Implemented error checking for the Irq() and IrqNoFlags() macros to detect +Implemented error checking for the Irq() and IrqNoFlags() macros to +detect too many values in the interrupt list (16 max) and invalid values in the list (range 0 - 15) @@ -7393,7 +7857,8 @@ specification, but discovered in the field nonetheless. Added the changes.txt logfile to each of the zipped release packages. Code and Data Size: Current and previous core subsystem library sizes are -shown below. These are the code and data sizes for the acpica.lib produced +shown below. These are the code and data sizes for the acpica.lib +produced by the Microsoft Visual C++ 6.0 compiler, and these values do not include any ACPI driver or OSPM code. The debug version of the code includes the debug output trace mechanism and has a much larger code and data size. @@ -7416,7 +7881,8 @@ Fixed a problem where incorrect AML code could be generated for Package objects if optimization is disabled (via the -oa switch). Fixed a problem with where incorrect AML code is generated for variable- -length packages when the package length is not specified and the number of +length packages when the package length is not specified and the number +of initializer values is greater than 255. @@ -7425,7 +7891,8 @@ initializer values is greater than 255. 1) ACPI CA Core Subsystem: -Implemented support to ignore an attempt to install/load a particular ACPI +Implemented support to ignore an attempt to install/load a particular +ACPI table more than once. Apparently there exists BIOS code that repeatedly attempts to load the same SSDT upon certain events. With assistance from Venkatesh Pallipadi. @@ -7437,7 +7904,8 @@ resource and should eliminate the AE_OWNER_ID_LIMIT exceptions seen on some machines. With assistance from Alexey Starikovskiy. -Support for "module level code" has been disabled in this version due to a +Support for "module level code" has been disabled in this version due to +a number of issues that have appeared on various machines. The support can be enabled by defining ACPI_ENABLE_MODULE_LEVEL_CODE during subsystem @@ -7446,7 +7914,8 @@ by default again. Modified the internal functions for debug print support to define the -FunctionName parameter as a (const char *) for compatibility with compiler +FunctionName parameter as a (const char *) for compatibility with +compiler built-in macros such as __FUNCTION__, etc. Linted the entire ACPICA source tree for both 32-bit and 64-bit. @@ -7456,7 +7925,8 @@ Debugger commands Object and Methods. Code and Data Size: Current and previous core subsystem library sizes are -shown below. These are the code and data sizes for the acpica.lib produced +shown below. These are the code and data sizes for the acpica.lib +produced by the Microsoft Visual C++ 6.0 compiler, and these values do not include any ACPI driver or OSPM code. The debug version of the code includes the debug output trace mechanism and has a much larger code and data size. @@ -7510,8 +7980,10 @@ name. Redesigned and reimplemented the "Owner ID" mechanism used to track namespace objects created/deleted by ACPI tables and control method -execution. A bitmap is now used to allocate and free the IDs, thus solving -the wraparound problem present in the previous implementation. The size of +execution. A bitmap is now used to allocate and free the IDs, thus +solving +the wraparound problem present in the previous implementation. The size +of the namespace node descriptor was reduced by 2 bytes as a result (Alexey Starikovskiy). @@ -7533,7 +8005,8 @@ Fixed several possible memory leaks and the inverse - premature object deletion (Alexey Starikovskiy). Code and Data Size: Current and previous core subsystem library sizes are -shown below. These are the code and data sizes for the acpica.lib produced +shown below. These are the code and data sizes for the acpica.lib +produced by the Microsoft Visual C++ 6.0 compiler, and these values do not include any ACPI driver or OSPM code. The debug version of the code includes the debug output trace mechanism and has a much larger code and data size. @@ -7597,7 +8070,8 @@ been updated. interpreter/parser/psloop.c /* Main AML parse loop */ Code and Data Size: Current and previous core subsystem library sizes are -shown below. These are the code and data sizes for the acpica.lib produced +shown below. These are the code and data sizes for the acpica.lib +produced by the Microsoft Visual C++ 6.0 compiler, and these values do not include any ACPI driver or OSPM code. The debug version of the code includes the debug output trace mechanism and has a much larger code and data size. @@ -7629,8 +8103,10 @@ original behavior has been restored (a Match() operator is emitted.) Moved the object cache operations into the OS interface layer (OSL) to allow the host OS to handle these operations if desired (for example, the Linux -OSL will invoke the slab allocator). This support is optional; the compile -time define ACPI_USE_LOCAL_CACHE may be used to utilize the original cache +OSL will invoke the slab allocator). This support is optional; the +compile +time define ACPI_USE_LOCAL_CACHE may be used to utilize the original +cache code in the ACPI CA core. The new OSL interfaces are shown below. See utalloc.c for an example implementation, and acpiosxf.h for the exact interface definitions. With assistance from Alexey Starikovskiy. @@ -7654,7 +8130,8 @@ present if the revision of the RSDP was 2 or greater. According to the ACPI specification, the XSDT is optional in all cases, and the table manager therefore now checks for both an RSDP >=2 and a valid XSDT pointer. -Otherwise, the RSDT pointer is used. Some ACPI 2.0 compliant BIOSs contain +Otherwise, the RSDT pointer is used. Some ACPI 2.0 compliant BIOSs +contain only the RSDT. Fixed an interpreter problem with the Mid() operator in the case of an @@ -7664,7 +8141,8 @@ correctly returns a valid, null terminated string object instead of a string object with a null pointer. -Fixed a problem with the control method argument handling to allow a store +Fixed a problem with the control method argument handling to allow a +store to an Arg object that already contains an object of type Device. The Device object is now correctly overwritten. Previously, an error was returned. @@ -7676,13 +8154,15 @@ found object pathnames. The output format is the same as the dump namespace command. -Enhanced the debugger Set command. It now has the ability to set the value +Enhanced the debugger Set command. It now has the ability to set the +value of any Named integer object in the namespace (Previously, only method locals and args could be set.) Code and Data Size: Current and previous core subsystem library sizes are -shown below. These are the code and data sizes for the acpica.lib produced +shown below. These are the code and data sizes for the acpica.lib +produced by the Microsoft Visual C++ 6.0 compiler, and these values do not include any ACPI driver or OSPM code. The debug version of the code includes the debug output trace mechanism and has a much larger code and data size. @@ -7701,7 +8181,8 @@ the compiler options used during generation. 2) iASL Compiler/Disassembler: -Fixed a regression in the disassembler where if/else/while constructs were +Fixed a regression in the disassembler where if/else/while constructs +were output incorrectly. This problem was introduced in the previous release (20050526). This problem also affected the single-step disassembly in the debugger. @@ -7710,7 +8191,8 @@ Fixed a problem where compiling the reserved _OSI method would randomly (but rarely) produce compile errors. -Enhanced the disassembler to emit compilable code in the face of incorrect +Enhanced the disassembler to emit compilable code in the face of +incorrect AML resource descriptors. If the optional ResourceSourceIndex is present, but the ResourceSource is not, do not emit the ResourceSourceIndex in the disassembly. Otherwise, the resulting code cannot be compiled without @@ -7722,7 +8204,8 @@ errors. 1) ACPI CA Core Subsystem: Implemented support to execute Type 1 and Type 2 AML opcodes appearing at -the module level (not within a control method.) These opcodes are executed +the module level (not within a control method.) These opcodes are +executed exactly once at the time the table is loaded. This type of code was legal up until the release of ACPI 2.0B (2002) and is now supported within ACPI CA @@ -7734,7 +8217,8 @@ that was previously generated upon detection of such code. Fixed a problem in the interpreter where an AE_NOT_FOUND exception could inadvertently be generated during the lookup of namespace objects in the -second pass parse of ACPI tables and control methods. It appears that this +second pass parse of ACPI tables and control methods. It appears that +this problem could occur during the resolution of forward references to namespace objects. @@ -7749,11 +8233,13 @@ Implemented a handful of miscellaneous fixes for possible memory leaks on error conditions and error handling control paths. These fixes were suggested by FreeBSD and the Coverity Prevent source code analysis tool. -Added a check for a null RSDT pointer in AcpiGetFirmwareTable (tbxfroot.c) +Added a check for a null RSDT pointer in AcpiGetFirmwareTable +(tbxfroot.c) to prevent a fault in this error case. Code and Data Size: Current and previous core subsystem library sizes are -shown below. These are the code and data sizes for the acpica.lib produced +shown below. These are the code and data sizes for the acpica.lib +produced by the Microsoft Visual C++ 6.0 compiler, and these values do not include any ACPI driver or OSPM code. The debug version of the code includes the debug output trace mechanism and has a much larger code and data size. @@ -7774,9 +8260,11 @@ the compiler options used during generation. Implemented support to allow Type 1 and Type 2 ASL operators to appear at the module level (not within a control method.) These operators will be -executed once at the time the table is loaded. This type of code was legal +executed once at the time the table is loaded. This type of code was +legal up until the release of ACPI 2.0B (2002) and is now supported by the iASL -compiler in order to provide backwards compatibility with earlier BIOS ASL +compiler in order to provide backwards compatibility with earlier BIOS +ASL code. The ACPI integer width (specified via the table revision ID or the -r @@ -7821,21 +8309,25 @@ to a newly allocated buffer, regardless of whether the source object is static or not. Fixed a problem with the FromBCD operator where an implicit result -conversion was improperly performed while storing the result to the target +conversion was improperly performed while storing the result to the +target operand. Since this is an "explicit conversion" operator, the implicit conversion should never be performed on the output. Fixed a problem with the CopyObject operator where a copy to an existing named object did not always completely overwrite the existing object stored -at name. Specifically, a buffer-to-buffer copy did not delete the existing +at name. Specifically, a buffer-to-buffer copy did not delete the +existing buffer. -Replaced "InterruptLevel" with "InterruptNumber" in all GPE interfaces and +Replaced "InterruptLevel" with "InterruptNumber" in all GPE interfaces +and structs for consistency. Code and Data Size: Current and previous core subsystem library sizes are -shown below. These are the code and data sizes for the acpica.lib produced +shown below. These are the code and data sizes for the acpica.lib +produced by the Microsoft Visual C++ 6.0 compiler, and these values do not include any ACPI driver or OSPM code. The debug version of the code includes the debug output trace mechanism and has a much larger code and data size. @@ -7893,7 +8385,8 @@ the static attribute have been moved from the headers to the owning C file. Implemented an extract option (-e) for the AcpiBin utility (AML binary -utility). This option allows the utility to extract individual ACPI tables +utility). This option allows the utility to extract individual ACPI +tables from the output of AcpiDmp. It provides the same functionality of the acpixtract.pl perl script without the worry of setting the correct perl options. AcpiBin runs on Windows and has not yet been generated/validated @@ -7901,11 +8394,13 @@ in the Linux/Unix environment (but should be soon). Updated and fixed the table dump option for AcpiBin (-d). This option -converts a single ACPI table to a hex/ascii file, similar to the output of +converts a single ACPI table to a hex/ascii file, similar to the output +of AcpiDmp. Code and Data Size: Current and previous core subsystem library sizes are -shown below. These are the code and data sizes for the acpica.lib produced +shown below. These are the code and data sizes for the acpica.lib +produced by the Microsoft Visual C++ 6.0 compiler, and these values do not include any ACPI driver or OSPM code. The debug version of the code includes the debug output trace mechanism and has a much larger code and data size. @@ -7970,7 +8465,8 @@ Two new header files have been added, acopcode.h and acnames.h. Removed several obsolete functions that were no longer used. Code and Data Size: Current and previous core subsystem library sizes are -shown below. These are the code and data sizes for the acpica.lib produced +shown below. These are the code and data sizes for the acpica.lib +produced by the Microsoft Visual C++ 6.0 compiler, and these values do not include any ACPI driver or OSPM code. The debug version of the code includes the debug output trace mechanism and has a much larger code and data size. @@ -8007,23 +8503,28 @@ occurred during the compilation. The string-to-buffer implicit conversion code has been modified again after -a change to the ACPI specification. In order to match the behavior of the +a change to the ACPI specification. In order to match the behavior of +the other major ACPI implementation, the target buffer is no longer truncated if the source string is smaller than an existing target buffer. This change requires an update to the ACPI spec, and should eliminate the recent AE_AML_BUFFER_LIMIT issues. -The "implicit return" support was rewritten to a new algorithm that solves +The "implicit return" support was rewritten to a new algorithm that +solves the general case. Rather than attempt to determine when a method is about to -exit, the result of every ASL operator is saved momentarily until the very +exit, the result of every ASL operator is saved momentarily until the +very next ASL operator is executed. Therefore, no matter how the method exits, there will always be a saved implicit return value. This feature is only -enabled with the AcpiGbl_EnableInterpreterSlack flag, and should eliminate +enabled with the AcpiGbl_EnableInterpreterSlack flag, and should +eliminate AE_AML_NO_RETURN_VALUE errors when enabled. -Implemented implicit conversion support for the predicate (operand) of the +Implemented implicit conversion support for the predicate (operand) of +the If, Else, and While operators. String and Buffer arguments are automatically converted to Integers. @@ -8039,7 +8540,8 @@ first non-hex character terminates the conversion and this is the code that was changed. -Fixed a problem where the ObjectType operator would fail (fault) when used +Fixed a problem where the ObjectType operator would fail (fault) when +used on an Index of a Package which pointed to a null package element. The operator now properly returns zero (Uninitialized) in this case. @@ -8048,16 +8550,19 @@ properly popping the result stack during execution. There was no memory leak after execution, however. (Code provided by Valery Podrezov.) -Fixed a problem where references to control methods within Package objects +Fixed a problem where references to control methods within Package +objects caused the method to be invoked, instead of producing a reference object pointing to the method. -Restructured and simplified the pswalk.c module (AcpiPsDeleteParseTree) to +Restructured and simplified the pswalk.c module (AcpiPsDeleteParseTree) +to improve performance and reduce code size. (Code provided by Alexey Starikovskiy.) Code and Data Size: Current and previous core subsystem library sizes are -shown below. These are the code and data sizes for the acpica.lib produced +shown below. These are the code and data sizes for the acpica.lib +produced by the Microsoft Visual C++ 6.0 compiler, and these values do not include any ACPI driver or OSPM code. The debug version of the code includes the debug output trace mechanism and has a much larger code and data size. @@ -8111,7 +8616,8 @@ operator. The valid range (max 255) is now only checked if the operand is of type Integer. All other operand types cannot be statically checked. -Fixed a problem where control method references within the RefOf, DeRefOf, +Fixed a problem where control method references within the RefOf, +DeRefOf, and ObjectType operators were not treated properly. They are now treated as actual references, not method invocations. @@ -8136,7 +8642,8 @@ Disassembler - Comments in output now use "//" instead of "/*" 1) ACPI CA Core Subsystem: Fixed a problem where the result of an Index() operator (an object -reference) must increment the reference count on the target object for the +reference) must increment the reference count on the target object for +the life of the object reference. Implemented AML Interpreter and Debugger support for the new ACPI 3.0 @@ -8165,7 +8672,8 @@ flag at runtime. Code and Data Size: Current and previous core subsystem library sizes are -shown below. These are the code and data sizes for the acpica.lib produced +shown below. These are the code and data sizes for the acpica.lib +produced by the Microsoft Visual C++ 6.0 compiler, and these values do not include any ACPI driver or OSPM code. The debug version of the code includes the debug output trace mechanism and has a much larger code and data size. @@ -8184,7 +8692,8 @@ the compiler options used during generation. 2) iASL Compiler/Disassembler: -Fixed a problem with the internal 64-bit String-to-integer conversion with +Fixed a problem with the internal 64-bit String-to-integer conversion +with strings less than two characters long. Fixed a problem with constant folding where the result of the Index() @@ -8214,7 +8723,8 @@ an errata change to the ACPI specification as this support was intended for ACPI 3.0, but was inadvertently omitted. -Fixed a problem with the internal implicit "to buffer" conversion. Strings +Fixed a problem with the internal implicit "to buffer" conversion. +Strings that are converted to buffers will cause buffer truncation if the string is smaller than the target buffer. Integers that are converted to buffers @@ -8247,7 +8757,8 @@ Added a fix to aclinux.h to allow generation of AcpiExec on Linux. Updated the AcpiSrc utility to add the FADT_DESCRIPTOR_REV2_MINUS struct. Code and Data Size: Current and previous core subsystem library sizes are -shown below. These are the code and data sizes for the acpica.lib produced +shown below. These are the code and data sizes for the acpica.lib +produced by the Microsoft Visual C++ 6.0 compiler, and these values do not include any ACPI driver or OSPM code. The debug version of the code includes the debug output trace mechanism and has a much larger code and data size. @@ -8285,7 +8796,8 @@ Acquire() operation on _GL. The local object cache is now optional, and is disabled by default. Both AcpiExec and the iASL compiler enable the cache because they run in user -mode and this enhances their performance. #define ACPI_ENABLE_OBJECT_CACHE +mode and this enhances their performance. #define +ACPI_ENABLE_OBJECT_CACHE to enable the local cache. Fixed an issue in the internal function AcpiUtEvaluateObject concerning @@ -8308,8 +8820,10 @@ and explicit conversion via the ToInteger() operator. The internal debug code in AcpiUtAcquireMutex has been commented out. It is -not needed for normal operation and should increase the performance of the -entire subsystem. The code remains in case it is needed for debug purposes +not needed for normal operation and should increase the performance of +the +entire subsystem. The code remains in case it is needed for debug +purposes again. The AcpiExec source and makefile are included in the Unix/Linux package @@ -8317,7 +8831,8 @@ for the first time. Code and Data Size: Current and previous core subsystem library sizes are -shown below. These are the code and data sizes for the acpica.lib produced +shown below. These are the code and data sizes for the acpica.lib +produced by the Microsoft Visual C++ 6.0 compiler, and these values do not include any ACPI driver or OSPM code. The debug version of the code includes the debug output trace mechanism and has a much larger code and data size. @@ -8338,7 +8853,8 @@ the compiler options used during generation. Switch/Case support: A warning is now issued if the type of the Switch value cannot be determined at compile time. For example, Switch(Arg0) will -generate the warning, and the type is assumed to be an integer. As per the +generate the warning, and the type is assumed to be an integer. As per +the ACPI spec, use a construct such as Switch(ToInteger(Arg0)) to eliminate the warning. @@ -8356,7 +8872,8 @@ converted to the type of the switch value, not the other way around. Switch/Case support: Temporary variables are now emitted immediately within -the control method, not at the global level. This means that there are now +the control method, not at the global level. This means that there are +now 36 temps available per-method, not 36 temps per-module as was the case with the earlier implementation (_T_0 through _T_9 and _T_A through _T_Z.) @@ -8370,12 +8887,14 @@ the core subsystem, iASL compiler, and the utilities. 1) ACPI CA Core Subsystem: Fixed an issue with the String-to-Buffer conversion code where the string -null terminator was not included in the buffer after conversion, but there +null terminator was not included in the buffer after conversion, but +there is existing ASL that assumes the string null terminator is included. This is the root of the ACPI_AML_BUFFER_LIMIT regression. This problem was introduced in the previous version when the code was updated to correctly -set the converted buffer size as per the ACPI specification. The ACPI spec +set the converted buffer size as per the ACPI specification. The ACPI +spec is ambiguous and will be updated to specify that the null terminator must be included in the converted buffer. This also affects the ToBuffer() ASL @@ -8420,7 +8939,8 @@ of ACPI, now 3. Implemented batch mode option for the AcpiExec utility (-b). Code and Data Size: Current and previous core subsystem library sizes are -shown below. These are the code and data sizes for the acpica.lib produced +shown below. These are the code and data sizes for the acpica.lib +produced by the Microsoft Visual C++ 6.0 compiler, and these values do not include any ACPI driver or OSPM code. The debug version of the code includes the debug output trace mechanism and has a much larger code and data size. @@ -8444,7 +8964,8 @@ ACPI CA core subsystem. 1) ACPI CA Core Subsystem: -Fixed a problem in the ToDecimalString operator where the resulting string +Fixed a problem in the ToDecimalString operator where the resulting +string length was incorrectly calculated. The length is now calculated exactly, eliminating incorrect AE_STRING_LIMIT exceptions. @@ -8452,12 +8973,14 @@ Fixed a problem in the ToHexString operator to allow a maximum 200 character string to be produced. -Fixed a problem in the internal string-to-buffer and buffer-to-buffer copy +Fixed a problem in the internal string-to-buffer and buffer-to-buffer +copy routine where the length of the resulting buffer was not truncated to the new size (if the target buffer already existed). Code and Data Size: Current and previous core subsystem library sizes are -shown below. These are the code and data sizes for the acpica.lib produced +shown below. These are the code and data sizes for the acpica.lib +produced by the Microsoft Visual C++ 6.0 compiler, and these values do not include any ACPI driver or OSPM code. The debug version of the code includes the debug output trace mechanism and has a much larger code and data size. @@ -8494,7 +9017,8 @@ incorrect AML code was generated if the offset within the resource buffer was 0 or 1. The optimizer shortened the AML code to a single byte opcode but did not update the surrounding package lengths. -Changes to the Dma macro: All channels within the channel list must be in +Changes to the Dma macro: All channels within the channel list must be +in the range 0-7. Maximum 8 channels can be specified. BusMaster operand is optional (default is BusMaster). @@ -8531,7 +9055,8 @@ Fixed a problem in oswinxf (used by AcpiExec and iASL) to allow > 128 semaphores to be allocated. Code and Data Size: Current and previous core subsystem library sizes are -shown below. These are the code and data sizes for the acpica.lib produced +shown below. These are the code and data sizes for the acpica.lib +produced by the Microsoft Visual C++ 6.0 compiler, and these values do not include any ACPI driver or OSPM code. The debug version of the code includes the debug output trace mechanism and has a much larger code and data size. @@ -8590,7 +9115,8 @@ ACPI 2.0 (and above) RSDPs. Note that the search continues until a valid RSDP signature is found with a valid checksum. Code and Data Size: Current and previous core subsystem library sizes are -shown below. These are the code and data sizes for the acpica.lib produced +shown below. These are the code and data sizes for the acpica.lib +produced by the Microsoft Visual C++ 6.0 compiler, and these values do not include any ACPI driver or OSPM code. The debug version of the code includes the debug output trace mechanism and has a much larger code and data size. @@ -8626,8 +9152,10 @@ Integer object with a value of zero. This support is enabled by setting the AcpiGbl_EnableInterpreterSlack flag to TRUE. -Implemented support for Integer objects for the SizeOf operator. Either 4 -or 8 is returned, depending on the current integer size (32-bit or 64-bit, +Implemented support for Integer objects for the SizeOf operator. Either +4 +or 8 is returned, depending on the current integer size (32-bit or 64- +bit, depending on the parent table revision). Fixed a problem in the implementation of the SizeOf and ObjectType @@ -8638,7 +9166,8 @@ return values for some objects. Fixed some possible memory leaks during exceptional conditions. Code and Data Size: Current and previous core subsystem library sizes are -shown below. These are the code and data sizes for the acpica.lib produced +shown below. These are the code and data sizes for the acpica.lib +produced by the Microsoft Visual C++ 6.0 compiler, and these values do not include any ACPI driver or OSPM code. The debug version of the code includes the debug output trace mechanism and has a much larger code and data size. @@ -8703,7 +9232,8 @@ BCD number were truncated during conversion. Fixed a problem in the ToDecimal operator where the length of the resulting -string could be set incorrectly too long if the input operand was a Buffer +string could be set incorrectly too long if the input operand was a +Buffer object. Fixed a problem in the Logical operators (LLess, etc.) where a NULL byte @@ -8715,7 +9245,8 @@ Added a check for string overflow (>200 characters as per the ACPI specification) during the Concatenate operator with two string operands. Code and Data Size: Current and previous core subsystem library sizes are -shown below. These are the code and data sizes for the acpica.lib produced +shown below. These are the code and data sizes for the acpica.lib +produced by the Microsoft Visual C++ 6.0 compiler, and these values do not include any ACPI driver or OSPM code. The debug version of the code includes the debug output trace mechanism and has a much larger code and data size. @@ -8738,10 +9269,12 @@ the compiler options used during generation. Allow the use of the ObjectType operator on uninitialized Locals and Args (returns 0 as per the ACPI specification). -Fixed a problem where the compiler would fault if there was a syntax error +Fixed a problem where the compiler would fault if there was a syntax +error in the FieldName of all of the various CreateXXXField operators. -Disallow the use of lower case letters within the EISAID macro, as per the +Disallow the use of lower case letters within the EISAID macro, as per +the ACPI specification. All EISAID strings must be of the form "UUUNNNN" Where U is an uppercase letter and N is a hex digit. @@ -8758,7 +9291,8 @@ implements a 64-bit timer with 100 nanosecond granularity. Defined a new OSL interface, AcpiOsGetTimer. This interface is used to implement the ACPI 3.0 Timer operator. This allows the host OS to implement -the timer with the best clock available. Also, it keeps the core subsystem +the timer with the best clock available. Also, it keeps the core +subsystem out of the clock handling business, since the host OS (usually) performs this function. @@ -8770,12 +9304,14 @@ are now used to extract the address to a local variable before use. Fixed a problem where the ToInteger operator assumed all input strings were -hexadecimal. The operator now handles both decimal strings and hex strings +hexadecimal. The operator now handles both decimal strings and hex +strings (prefixed with "0x"). Fixed a problem where the string length in the string object created as a result of the internal ConvertToString procedure could be incorrect. This -potentially affected all implicit conversions and also the ToDecimalString +potentially affected all implicit conversions and also the +ToDecimalString and ToHexString operators. Fixed two problems in the ToString operator. If the length parameter was @@ -8791,7 +9327,8 @@ code size and complexity. Code and Data Size: Current and previous core subsystem library sizes are -shown below. These are the code and data sizes for the acpica.lib produced +shown below. These are the code and data sizes for the acpica.lib +produced by the Microsoft Visual C++ 6.0 compiler, and these values do not include any ACPI driver or OSPM code. The debug version of the code includes the debug output trace mechanism and has a much larger code and data size. @@ -8838,7 +9375,8 @@ of (!Arg) which was usually 1. This change affects iASL constant folding for this operator also. -Fixed a problem in AcpiUtInitializeBuffer where an existing buffer was not +Fixed a problem in AcpiUtInitializeBuffer where an existing buffer was +not initialized properly -- Now zero the entire buffer in this case where the buffer already exists. @@ -8857,7 +9395,8 @@ Added support for the DSDT in AcpiTbFindTable. This allows the DataTableRegion() operator to access the local copy of the DSDT. Code and Data Size: Current and previous core subsystem library sizes are -shown below. These are the code and data sizes for the acpica.lib produced +shown below. These are the code and data sizes for the acpica.lib +produced by the Microsoft Visual C++ 6.0 compiler, and these values do not include any ACPI driver or OSPM code. The debug version of the code includes the debug output trace mechanism and has a much larger code and data size. @@ -8877,11 +9416,13 @@ the compiler options used during generation. 2) iASL Compiler/Disassembler: Fixed a problem with constant folding and the LNot operator. LNot was -returning 1 in the TRUE case, not Ones as per the ACPI specification. This +returning 1 in the TRUE case, not Ones as per the ACPI specification. +This could result in the generation of an incorrect folded/reduced constant. End-Of-File is now allowed within a "//"-style comment. A parse error no -longer occurs if such a comment is at the very end of the input ASL source +longer occurs if such a comment is at the very end of the input ASL +source file. Implemented the "-r" option to override the Revision in the table header. @@ -8898,16 +9439,19 @@ either 1) ACPI CA Core Subsystem: - Implemented support for implicit object conversion in the non-numeric -logical operators (LEqual, LGreater, LGreaterEqual, LLess, LLessEqual, and +logical operators (LEqual, LGreater, LGreaterEqual, LLess, LLessEqual, +and LNotEqual.) Any combination of Integers/Strings/Buffers may now be used; -the second operand is implicitly converted on the fly to match the type of +the second operand is implicitly converted on the fly to match the type +of the first operand. For example: LEqual (Source1, Source2) Source1 and Source2 must each evaluate to an integer, a string, or a buffer. -The data type of Source1 dictates the required type of Source2. Source2 is +The data type of Source1 dictates the required type of Source2. Source2 +is implicitly converted if necessary to match the type of Source1. - Updated and corrected the behavior of the string conversion support. @@ -8923,12 +9467,14 @@ ToString - explicit byte-wise conversion of buffer to string. Byte-by- byte copy with no transform except NULL terminated. Any other implicit buffer- to- -string conversion - byte-wise conversion of buffer to string of hex values +string conversion - byte-wise conversion of buffer to string of hex +values (0-FF) separated by spaces. - Fixed typo in definition of AcpiGbl_EnableInterpreterSlack. -- Fixed a problem in AcpiNsGetPathnameLength where the returned length was +- Fixed a problem in AcpiNsGetPathnameLength where the returned length +was one byte too short in the case of a node in the root scope. This could cause a fault during debug output. @@ -8963,10 +9509,12 @@ the compiler options used during generation. 1) ACPI CA Core Subsystem: Designed and implemented support within the AML interpreter for the so- -called "implicit return". This support returns the result of the last ASL +called "implicit return". This support returns the result of the last +ASL operation within a control method, in the absence of an explicit Return() operator. A few machines depend on this behavior, even though it is not -explicitly supported by the ASL language. It is optional support that can +explicitly supported by the ASL language. It is optional support that +can be enabled at runtime via the AcpiGbl_EnableInterpreterSlack flag. Removed support for the PCI_Config address space from the internal low @@ -9017,7 +9565,8 @@ increase flexibility of the interfaces. Implemented a "lexicographical compare" for String and Buffer objects within -the logical operators -- LGreater, LLess, LGreaterEqual, and LLessEqual -- +the logical operators -- LGreater, LLess, LGreaterEqual, and LLessEqual - +- as per further clarification to the ACPI specification. Behavior is similar to C library "strcmp". @@ -9076,7 +9625,8 @@ ACPI 1.0 interpreters. -Fixed a problem where complex terms were not supported properly within the +Fixed a problem where complex terms were not supported properly within +the Switch() operator. Eliminated extraneous warning for compiler-emitted reserved names of the @@ -9161,7 +9711,8 @@ the EBDA by simply scanning from memory location 0 to 0x400. The correct method is to first obtain the EBDA pointer from within the BIOS data area, then -scan 1K of memory starting at the EBDA pointer. There appear to be few if +scan 1K of memory starting at the EBDA pointer. There appear to be few +if any machines that place the RSDP in the EBDA, however. Integrated a fix for a possible fault during evaluation of BufferField @@ -9196,7 +9747,8 @@ the compiler options used during generation. 2) iASL Compiler/Disassembler: -Fixed a generation warning produced by some overly-verbose compilers for a +Fixed a generation warning produced by some overly-verbose compilers for +a 64-bit constant. ---------------------------------------- @@ -9216,7 +9768,8 @@ the new AcpiEv* calls as appropriate. ACPI_OS_NAME was removed from the OS-specific headers. The default name is -now "Microsoft Windows NT" for maximum compatibility. However this can be +now "Microsoft Windows NT" for maximum compatibility. However this can +be changed by modifying the acconfig.h file. Allow a single invocation of AcpiInstallNotifyHandler for a handler that @@ -9263,7 +9816,8 @@ button, or a notebook lid switch. GPEs that have an _Lxx or _Exx method and are not referenced by any _PRW methods are marked for "runtime" and hardware -enabled. Any GPE that is referenced by a _PRW method is marked for "wake" +enabled. Any GPE that is referenced by a _PRW method is marked for +"wake" (and disabled at runtime). However, at sleep time, only those GPEs that have been specifically enabled for wake via the AcpiEnableGpe interface will @@ -9271,13 +9825,15 @@ actually be hardware enabled. A new external interface has been added, AcpiSetGpeType(), that is meant to -be used by device drivers to force a GPE to a particular type. It will be +be used by device drivers to force a GPE to a particular type. It will +be especially useful for the drivers for the button devices mentioned above. Completed restructuring of the ACPI CA initialization sequence so that default operation region handlers are installed before GPEs are initialized -and the _PRW methods are executed. This will prevent errors when the _PRW +and the _PRW methods are executed. This will prevent errors when the +_PRW methods attempt to access system memory or I/O space. GPE enable/disable no longer reads the GPE enable register. We now keep @@ -9295,7 +9851,8 @@ Added new strings for the _OSI method, of the form "Windows 2001 SPx" where x = 0,1,2,3,4. -Fixed a problem where the physical address was incorrectly calculated when +Fixed a problem where the physical address was incorrectly calculated +when the Load() operator was used to directly load from an Operation Region (vs. loading from a Field object.) Also added check for minimum table length @@ -9324,13 +9881,15 @@ Do not exit/reenter when dispatching to a default handler (e.g., default system memory or I/O handlers) -Notes for updating drivers for the new GPE support. The following changes +Notes for updating drivers for the new GPE support. The following +changes must be made to ACPI-related device drivers that are attached to one or more GPEs: (This information will be added to the ACPI CA Programmer Reference.) -1) AcpiInstallGpeHandler no longer automatically enables the GPE, you must +1) AcpiInstallGpeHandler no longer automatically enables the GPE, you +must explicitly call AcpiEnableGpe. 2) There is a new interface called AcpiSetGpeType. This should be called before enabling the GPE. Also, this interface will automatically disable @@ -9353,8 +9912,10 @@ If _PRW exists: /* This is a control-method button */ For all other devices that have _PRWs, we automatically set the GPE type to -ACPI_GPE_TYPE_WAKE, but the GPE is NOT automatically (wake) enabled. This -must be done on a selective basis, usually requiring some kind of user app +ACPI_GPE_TYPE_WAKE, but the GPE is NOT automatically (wake) enabled. +This +must be done on a selective basis, usually requiring some kind of user +app to allow the user to pick the wake devices. @@ -9422,7 +9983,8 @@ the compiler options used during generation. 2) iASL Compiler/Disassembler: -iASL now fully disassembles SSDTs. However, External() statements are not +iASL now fully disassembles SSDTs. However, External() statements are +not generated automatically for unresolved symbols at this time. This is a planned feature for future implementation. @@ -9433,7 +9995,8 @@ incorrectly nested internal namespace to be constructed. Any warnings or errors that are emitted during disassembly are now commented -out automatically so that the resulting file can be recompiled without any +out automatically so that the resulting file can be recompiled without +any hand editing. ---------------------------------------- @@ -9459,14 +10022,16 @@ properly. The proper scope within the namespace was not initialized (transferred to the target of the aliased method) before executing the target method. -Fixed a potential race condition on internal object deletion on the return +Fixed a potential race condition on internal object deletion on the +return object in AcpiEvaluateObject. Integrated a fix for resource descriptors where both _MEM and _MTP were being extracted instead of just _MEM. (i.e. bitmask was incorrectly too wide, 0x0F instead of 0x03.) -Added a special case for ACPI_ROOT_OBJECT in AcpiUtGetNodeName, preventing +Added a special case for ACPI_ROOT_OBJECT in AcpiUtGetNodeName, +preventing a fault in some cases. @@ -9509,8 +10074,10 @@ if the method attempts to create namespace objects. (The root of the AE_ALREADY_EXISTS problem.) Implemented support for the predefined _OSI "internal" control method. -Initial supported strings are "Linux", "Windows 2000", "Windows 2001", and -"Windows 2001.1", and can be easily upgraded for new strings as necessary. +Initial supported strings are "Linux", "Windows 2000", "Windows 2001", +and +"Windows 2001.1", and can be easily upgraded for new strings as +necessary. This feature will allow "other" operating systems to execute the fully tested, "Windows" code path through the ASL code @@ -9532,7 +10099,8 @@ defined on the machine. Implemented two runtime options: One to force all control method execution -to "Serialized" to mimic Windows behavior, another to disable _OSI support +to "Serialized" to mimic Windows behavior, another to disable _OSI +support if it causes problems on a given machine. Code and Data Size: Current and previous core subsystem library sizes are @@ -9609,7 +10177,8 @@ obscure objects (e.g., Reference objects.) Improved the output of the Debug object to display buffer, package, and index objects. -Fixed a problem where constructs of the form "RefOf (ArgX)" did not return +Fixed a problem where constructs of the form "RefOf (ArgX)" did not +return the expected result. Added permanent ACPI_REPORT_ERROR macros for all instances of the @@ -9626,7 +10195,8 @@ functional changes, however. 1) ACPI CA Core Subsystem: -Improved error messages when there is a problem finding one or more of the +Improved error messages when there is a problem finding one or more of +the required base ACPI tables Reintroduced the definition of APIC_HEADER in actbl.h diff --git a/sys/contrib/dev/acpica/common/dmextern.c b/sys/contrib/dev/acpica/common/dmextern.c index 0e41dd38c5a3..3ded428176fb 100644 --- a/sys/contrib/dev/acpica/common/dmextern.c +++ b/sys/contrib/dev/acpica/common/dmextern.c @@ -719,34 +719,54 @@ AcpiDmEmitExternals ( AcpiDmUnresolvedWarning (1); + /* Emit any unresolved method externals in a single text block */ + + NextExternal = AcpiGbl_ExternalList; + while (NextExternal) + { + if ((NextExternal->Type == ACPI_TYPE_METHOD) && + (!NextExternal->Resolved)) + { + AcpiOsPrintf (" External (%s%s", + NextExternal->Path, + AcpiDmGetObjectTypeName (NextExternal->Type)); + + AcpiOsPrintf (") // Warning: Unresolved Method, " + "guessing %u arguments (may be incorrect, see warning above)\n", + NextExternal->Value); + + NextExternal->Emitted = TRUE; + } + + NextExternal = NextExternal->Next; + } + + AcpiOsPrintf ("\n"); + /* * Walk the list of externals (unresolved references) * found during the AML parsing */ while (AcpiGbl_ExternalList) { - AcpiOsPrintf (" External (%s%s", - AcpiGbl_ExternalList->Path, - AcpiDmGetObjectTypeName (AcpiGbl_ExternalList->Type)); - - if (AcpiGbl_ExternalList->Type == ACPI_TYPE_METHOD) + if (!AcpiGbl_ExternalList->Emitted) { - if (AcpiGbl_ExternalList->Resolved) + AcpiOsPrintf (" External (%s%s", + AcpiGbl_ExternalList->Path, + AcpiDmGetObjectTypeName (AcpiGbl_ExternalList->Type)); + + /* For methods, add a comment with the number of arguments */ + + if (AcpiGbl_ExternalList->Type == ACPI_TYPE_METHOD) { AcpiOsPrintf (") // %u Arguments\n", AcpiGbl_ExternalList->Value); } else { - AcpiOsPrintf (") // Warning: unresolved Method, " - "assuming %u arguments (may be incorrect, see warning above)\n", - AcpiGbl_ExternalList->Value); + AcpiOsPrintf (")\n"); } } - else - { - AcpiOsPrintf (")\n"); - } /* Free this external info block and move on to next external */ @@ -931,5 +951,4 @@ AcpiDmUnresolvedWarning ( (AcpiGbl_NumExternalMethods - AcpiGbl_ResolvedExternalMethods)); } } - } diff --git a/sys/contrib/dev/acpica/common/getopt.c b/sys/contrib/dev/acpica/common/getopt.c index a4ad28802579..69f2ed518fdc 100644 --- a/sys/contrib/dev/acpica/common/getopt.c +++ b/sys/contrib/dev/acpica/common/getopt.c @@ -197,6 +197,26 @@ AcpiGetopt( CurrentCharPtr = 1; } + /* Option has an optional argument? */ + + else if (*OptsPtr == '+') + { + if (argv[AcpiGbl_Optind][(int) (CurrentCharPtr+1)] != '\0') + { + AcpiGbl_Optarg = &argv[AcpiGbl_Optind++][(int) (CurrentCharPtr+1)]; + } + else if (++AcpiGbl_Optind >= argc) + { + AcpiGbl_Optarg = NULL; + } + else + { + AcpiGbl_Optarg = argv[AcpiGbl_Optind++]; + } + + CurrentCharPtr = 1; + } + /* Option has optional single-char arguments? */ else if (*OptsPtr == '^') diff --git a/sys/contrib/dev/acpica/compiler/asloffset.c b/sys/contrib/dev/acpica/compiler/asloffset.c index b21cc4b3e0f4..390a118d4661 100644 --- a/sys/contrib/dev/acpica/compiler/asloffset.c +++ b/sys/contrib/dev/acpica/compiler/asloffset.c @@ -57,10 +57,12 @@ static void LsEmitOffsetTableEntry ( UINT32 FileId, ACPI_NAMESPACE_NODE *Node, + UINT32 NamepathOffset, UINT32 Offset, char *OpName, UINT64 Value, - UINT8 AmlOpcode); + UINT8 AmlOpcode, + UINT16 ParentOpcode); /******************************************************************************* @@ -94,7 +96,8 @@ LsAmlOffsetWalk ( UINT32 FileId = (UINT32) ACPI_TO_INTEGER (Context); ACPI_NAMESPACE_NODE *Node; UINT32 Length; - UINT32 OffsetOfOpcode; + UINT32 NamepathOffset; + UINT32 DataOffset; ACPI_PARSE_OBJECT *NextOp; @@ -119,8 +122,9 @@ LsAmlOffsetWalk ( if ((Node->Type == ACPI_TYPE_LOCAL_RESOURCE) && (Op->Asl.CompileFlags & NODE_IS_RESOURCE_DESC)) { - LsEmitOffsetTableEntry (FileId, Node, Gbl_CurrentAmlOffset, - Op->Asl.ParseOpName, 0, Op->Asl.Extra); + LsEmitOffsetTableEntry (FileId, Node, 0, Gbl_CurrentAmlOffset, + Op->Asl.ParseOpName, 0, Op->Asl.Extra, AML_BUFFER_OP); + Gbl_CurrentAmlOffset += Op->Asl.FinalAmlLength; return (AE_OK); } @@ -138,22 +142,25 @@ LsAmlOffsetWalk ( } Length = Op->Asl.FinalAmlLength; + NamepathOffset = Gbl_CurrentAmlOffset + Length; /* Get to the NameSeg/NamePath Op (and length of the name) */ Op = Op->Asl.Child; - OffsetOfOpcode = Length + Op->Asl.FinalAmlLength; + + /* Get offset of last nameseg and the actual data */ + + NamepathOffset = Gbl_CurrentAmlOffset + Length + + (Op->Asl.FinalAmlLength - ACPI_NAME_SIZE); + + DataOffset = Gbl_CurrentAmlOffset + Length + + Op->Asl.FinalAmlLength; /* Get actual value associated with the name */ Op = Op->Asl.Next; switch (Op->Asl.AmlOpcode) { - /* - * We are only interested in integer constants that can be changed - * at boot time. Note, the One/Ones/Zero opcodes are considered - * non-changeable, so we ignore them here. - */ case AML_BYTE_OP: case AML_WORD_OP: case AML_DWORD_OP: @@ -161,22 +168,32 @@ LsAmlOffsetWalk ( /* The +1 is to handle the integer size prefix (opcode) */ - LsEmitOffsetTableEntry (FileId, Node, - (Gbl_CurrentAmlOffset + OffsetOfOpcode + 1), + LsEmitOffsetTableEntry (FileId, Node, NamepathOffset, (DataOffset + 1), Op->Asl.ParseOpName, Op->Asl.Value.Integer, - (UINT8) Op->Asl.AmlOpcode); + (UINT8) Op->Asl.AmlOpcode, AML_NAME_OP); + break; + + case AML_ONE_OP: + case AML_ONES_OP: + case AML_ZERO_OP: + + /* For these, offset will point to the opcode */ + + LsEmitOffsetTableEntry (FileId, Node, NamepathOffset, DataOffset, + Op->Asl.ParseOpName, Op->Asl.Value.Integer, + (UINT8) Op->Asl.AmlOpcode, AML_NAME_OP); break; case AML_PACKAGE_OP: case AML_VAR_PACKAGE_OP: + /* Get the package element count */ + NextOp = Op->Asl.Child; - LsEmitOffsetTableEntry (FileId, Node, - (Gbl_CurrentAmlOffset + OffsetOfOpcode), - Op->Asl.ParseOpName, - NextOp->Asl.Value.Integer, - (UINT8) Op->Asl.AmlOpcode); + LsEmitOffsetTableEntry (FileId, Node, NamepathOffset, DataOffset, + Op->Asl.ParseOpName, NextOp->Asl.Value.Integer, + (UINT8) Op->Asl.AmlOpcode, AML_NAME_OP); break; default: @@ -195,7 +212,14 @@ LsAmlOffsetWalk ( /* Get the name/namepath node */ NextOp = Op->Asl.Child; - OffsetOfOpcode = Length + NextOp->Asl.FinalAmlLength + 1; + + /* Get offset of last nameseg and the actual data */ + + NamepathOffset = Gbl_CurrentAmlOffset + Length + + (NextOp->Asl.FinalAmlLength - ACPI_NAME_SIZE); + + DataOffset = Gbl_CurrentAmlOffset + Length + + (NextOp->Asl.FinalAmlLength + 1); /* Get the SpaceId node, then the Offset (address) node */ @@ -214,10 +238,9 @@ LsAmlOffsetWalk ( case AML_DWORD_OP: case AML_QWORD_OP: - LsEmitOffsetTableEntry (FileId, Node, - (Gbl_CurrentAmlOffset + OffsetOfOpcode + 1), + LsEmitOffsetTableEntry (FileId, Node, NamepathOffset, (DataOffset + 1), Op->Asl.ParseOpName, NextOp->Asl.Value.Integer, - (UINT8) NextOp->Asl.AmlOpcode); + (UINT8) NextOp->Asl.AmlOpcode, AML_REGION_OP); Gbl_CurrentAmlOffset += Length; return (AE_OK); @@ -237,15 +260,62 @@ LsAmlOffsetWalk ( NextOp = Op->Asl.Child; - /* Point to the *last* nameseg in the namepath */ + /* Get offset of last nameseg and the actual data (flags byte) */ - OffsetOfOpcode = NextOp->Asl.FinalAmlLength - ACPI_NAME_SIZE; + NamepathOffset = Gbl_CurrentAmlOffset + Length + + (NextOp->Asl.FinalAmlLength - ACPI_NAME_SIZE); - LsEmitOffsetTableEntry (FileId, Node, - (Gbl_CurrentAmlOffset + OffsetOfOpcode + Length), - Op->Asl.ParseOpName, - *((UINT32 *) &NextOp->Asl.Value.Buffer[OffsetOfOpcode]), - (UINT8) Op->Asl.AmlOpcode); + DataOffset = Gbl_CurrentAmlOffset + Length + + NextOp->Asl.FinalAmlLength; + + /* Get the flags byte Op */ + + NextOp = NextOp->Asl.Next; + + LsEmitOffsetTableEntry (FileId, Node, NamepathOffset, DataOffset, + Op->Asl.ParseOpName, NextOp->Asl.Value.Integer, + (UINT8) Op->Asl.AmlOpcode, AML_METHOD_OP); + break; + + case AML_PROCESSOR_OP: + + /* Processor (Namepath, ProcessorId, Address, Length) */ + + Length = Op->Asl.FinalAmlLength; + NextOp = Op->Asl.Child; /* Get Namepath */ + + /* Get offset of last nameseg and the actual data (PBlock address) */ + + NamepathOffset = Gbl_CurrentAmlOffset + Length + + (NextOp->Asl.FinalAmlLength - ACPI_NAME_SIZE); + + DataOffset = Gbl_CurrentAmlOffset + Length + + (NextOp->Asl.FinalAmlLength + 1); + + NextOp = NextOp->Asl.Next; /* Get ProcessorID (BYTE) */ + NextOp = NextOp->Asl.Next; /* Get Address (DWORD) */ + + LsEmitOffsetTableEntry (FileId, Node, NamepathOffset, DataOffset, + Op->Asl.ParseOpName, NextOp->Asl.Value.Integer, + (UINT8) AML_DWORD_OP, AML_PROCESSOR_OP); + break; + + case AML_DEVICE_OP: + case AML_SCOPE_OP: + case AML_THERMAL_ZONE_OP: + + /* Device/Scope/ThermalZone (Namepath) */ + + Length = Op->Asl.FinalAmlLength; + NextOp = Op->Asl.Child; /* Get Namepath */ + + /* Get offset of last nameseg */ + + NamepathOffset = Gbl_CurrentAmlOffset + Length + + (NextOp->Asl.FinalAmlLength - ACPI_NAME_SIZE); + + LsEmitOffsetTableEntry (FileId, Node, NamepathOffset, 0, + Op->Asl.ParseOpName, 0, (UINT8) 0, Op->Asl.AmlOpcode); break; default: @@ -267,6 +337,7 @@ LsAmlOffsetWalk ( * OpName - Name of the AML opcode * Value - Current value of the AML field * AmlOpcode - Opcode associated with the field + * ObjectType - ACPI object type * * RETURN: None * @@ -278,10 +349,12 @@ static void LsEmitOffsetTableEntry ( UINT32 FileId, ACPI_NAMESPACE_NODE *Node, + UINT32 NamepathOffset, UINT32 Offset, char *OpName, UINT64 Value, - UINT8 AmlOpcode) + UINT8 AmlOpcode, + UINT16 ParentOpcode) { ACPI_BUFFER TargetPath; ACPI_STATUS Status; @@ -308,8 +381,9 @@ LsEmitOffsetTableEntry ( * Max Length for Integers is 8 bytes. */ FlPrintFile (FileId, - " {%-29s 0x%8.8X, 0x%2.2X, 0x%8.8X%8.8X}, /* %s */\n", - MsgBuffer, Offset, AmlOpcode, ACPI_FORMAT_UINT64 (Value), OpName); + " {%-29s 0x%4.4X, 0x%8.8X, 0x%2.2X, 0x%8.8X, 0x%8.8X%8.8X}, /* %s */\n", + MsgBuffer, ParentOpcode, NamepathOffset, AmlOpcode, + Offset, ACPI_FORMAT_UINT64 (Value), OpName); } @@ -335,10 +409,12 @@ LsDoOffsetTableHeader ( "#define __AML_OFFSET_TABLE_H\n\n"); FlPrintFile (FileId, "typedef struct {\n" - " char *Pathname;\n" - " unsigned long Offset;\n" - " unsigned char Opcode;\n" - " unsigned long long Value;\n" + " char *Pathname; /* Full pathname (from root) to the object */\n" + " unsigned short ParentOpcode; /* AML opcode for the parent object */\n" + " unsigned long NamesegOffset; /* Offset of last nameseg in the parent namepath */\n" + " unsigned char Opcode; /* AML opcode for the data */\n" + " unsigned long Offset; /* Offset for the data */\n" + " unsigned long long Value; /* Original value of the data (as applicable) */\n" "} AML_OFFSET_TABLE_ENTRY;\n\n"); FlPrintFile (FileId, @@ -346,29 +422,37 @@ LsDoOffsetTableHeader ( FlPrintFile (FileId, "/*\n" - " * Information about supported object types:\n" + " * Information specific to the supported object types:\n" " *\n" " * Integers:\n" - " * Offset points to the actual integer data\n" " * Opcode is the integer prefix, indicates length of the data\n" + " * (One of: BYTE, WORD, DWORD, QWORD, ZERO, ONE, ONES)\n" + " * Offset points to the actual integer data\n" " * Value is the existing value in the AML\n" " *\n" " * Packages:\n" - " * Offset points to the package opcode\n" " * Opcode is the package or var_package opcode\n" - " * Value is the package element cound\n" + " * Offset points to the package opcode\n" + " * Value is the package element count\n" " *\n" " * Operation Regions:\n" - " * Offset points to the region address data\n" " * Opcode is the address integer prefix, indicates length of the data\n" + " * Offset points to the region address\n" " * Value is the existing address value in the AML\n" " *\n" " * Control Methods:\n" - " * Offset points to the first byte of the namepath\n" + " * Offset points to the method flags byte\n" + " * Value is the existing flags value in the AML\n" + " *\n" + " * Processors:\n" + " * Offset points to the first byte of the PBlock Address\n" " *\n" " * Resource Descriptors:\n" - " * Offset points to the start of the descriptor\n" " * Opcode is the descriptor type\n" + " * Offset points to the start of the descriptor\n" + " *\n" + " * Scopes/Devices/ThermalZones:\n" + " * Nameseg offset only\n" " */\n"); FlPrintFile (FileId, @@ -383,6 +467,6 @@ LsDoOffsetTableFooter ( { FlPrintFile (FileId, - " {0,0,0,0} /* Table terminator */\n};\n\n"); + " {NULL,0,0,0,0,0} /* Table terminator */\n};\n\n"); Gbl_CurrentAmlOffset = 0; } diff --git a/sys/contrib/dev/acpica/compiler/asloperands.c b/sys/contrib/dev/acpica/compiler/asloperands.c index 7567eb7d809f..07bf88fa335f 100644 --- a/sys/contrib/dev/acpica/compiler/asloperands.c +++ b/sys/contrib/dev/acpica/compiler/asloperands.c @@ -971,12 +971,15 @@ OpnDoDefinitionBlock ( Gbl_TableId = AcpiOsAllocate (Length + 1); ACPI_STRCPY (Gbl_TableId, Child->Asl.Value.String); + /* + * Convert anything non-alphanumeric to an underscore. This + * allows us to use the TableID to generate unique C symbols. + */ for (i = 0; i < Length; i++) { - if (Gbl_TableId[i] == ' ') + if (!isalnum ((int) Gbl_TableId[i])) { - Gbl_TableId[i] = 0; - break; + Gbl_TableId[i] = '_'; } } } diff --git a/sys/contrib/dev/acpica/compiler/asloptions.c b/sys/contrib/dev/acpica/compiler/asloptions.c index 3b4f3650f999..877fb68acca0 100644 --- a/sys/contrib/dev/acpica/compiler/asloptions.c +++ b/sys/contrib/dev/acpica/compiler/asloptions.c @@ -68,7 +68,7 @@ AslDoResponseFile ( #define ASL_TOKEN_SEPARATORS " \t\n" -#define ASL_SUPPORTED_OPTIONS "@:b|c|d^D:e:fgh^i|I:l^m:no|p:P^r:s|t|T:G^v^w|x:z" +#define ASL_SUPPORTED_OPTIONS "@:b|c|d^D:e:fgh^i|I:l^m:no|p:P^r:s|t|T+G^v^w|x:z" /******************************************************************************* diff --git a/sys/contrib/dev/acpica/compiler/dttemplate.c b/sys/contrib/dev/acpica/compiler/dttemplate.c index c0ff98b341cd..ca66d16daa1b 100644 --- a/sys/contrib/dev/acpica/compiler/dttemplate.c +++ b/sys/contrib/dev/acpica/compiler/dttemplate.c @@ -117,13 +117,21 @@ DtCreateTemplates ( AslInitializeGlobals (); - AcpiUtStrupr (Signature); - /* Create all known templates if requested */ + /* Default (no signature) is DSDT */ + + if (!Signature) + { + Signature = "DSDT"; + goto GetTemplate; + } - if (!ACPI_STRNCMP (Signature, "ALL", 3) || + AcpiUtStrupr (Signature); + if (!ACPI_STRCMP (Signature, "ALL") || !ACPI_STRCMP (Signature, "*")) { + /* Create all available/known templates */ + Status = DtCreateAllTemplates (); return (Status); } @@ -136,7 +144,9 @@ DtCreateTemplates ( */ if (strlen (Signature) != ACPI_NAME_SIZE) { - fprintf (stderr, "%s, Invalid ACPI table signature\n", Signature); + fprintf (stderr, + "%s: Invalid ACPI table signature (length must be 4 characters)\n", + Signature); return (AE_ERROR); } @@ -153,19 +163,20 @@ DtCreateTemplates ( Signature = "FACP"; } +GetTemplate: TableData = AcpiDmGetTableData (Signature); if (TableData) { if (!TableData->Template) { - fprintf (stderr, "%4.4s, No template available\n", Signature); + fprintf (stderr, "%4.4s: No template available\n", Signature); return (AE_ERROR); } } else if (!AcpiUtIsSpecialTable (Signature)) { fprintf (stderr, - "%4.4s, Unrecognized ACPI table signature\n", Signature); + "%4.4s: Unrecognized ACPI table signature\n", Signature); return (AE_ERROR); } diff --git a/sys/contrib/dev/acpica/components/executer/exoparg1.c b/sys/contrib/dev/acpica/components/executer/exoparg1.c index 44f06a4af2a1..cd917ef5371c 100644 --- a/sys/contrib/dev/acpica/components/executer/exoparg1.c +++ b/sys/contrib/dev/acpica/components/executer/exoparg1.c @@ -1009,10 +1009,17 @@ AcpiExOpcode_1A_0T_1R ( * add another reference to the referenced object, however. */ ReturnDesc = *(Operand[0]->Reference.Where); - if (ReturnDesc) + if (!ReturnDesc) { - AcpiUtAddReference (ReturnDesc); + /* + * Element is NULL, do not allow the dereference. + * This provides compatibility with other ACPI + * implementations. + */ + return_ACPI_STATUS (AE_AML_UNINITIALIZED_ELEMENT); } + + AcpiUtAddReference (ReturnDesc); break; default: @@ -1030,15 +1037,44 @@ AcpiExOpcode_1A_0T_1R ( ReturnDesc = Operand[0]->Reference.Object; if (ACPI_GET_DESCRIPTOR_TYPE (ReturnDesc) == - ACPI_DESC_TYPE_NAMED) + ACPI_DESC_TYPE_NAMED) { ReturnDesc = AcpiNsGetAttachedObject ( - (ACPI_NAMESPACE_NODE *) ReturnDesc); - } + (ACPI_NAMESPACE_NODE *) ReturnDesc); + if (!ReturnDesc) + { + break; + } - /* Add another reference to the object! */ + /* + * June 2013: + * BufferFields/FieldUnits require additional resolution + */ + switch (ReturnDesc->Common.Type) + { + case ACPI_TYPE_BUFFER_FIELD: + case ACPI_TYPE_LOCAL_REGION_FIELD: + case ACPI_TYPE_LOCAL_BANK_FIELD: + case ACPI_TYPE_LOCAL_INDEX_FIELD: - AcpiUtAddReference (ReturnDesc); + Status = AcpiExReadDataFromField (WalkState, + ReturnDesc, &TempDesc); + if (ACPI_FAILURE (Status)) + { + goto Cleanup; + } + + ReturnDesc = TempDesc; + break; + + default: + + /* Add another reference to the object */ + + AcpiUtAddReference (ReturnDesc); + break; + } + } break; default: diff --git a/sys/contrib/dev/acpica/components/hardware/hwtimer.c b/sys/contrib/dev/acpica/components/hardware/hwtimer.c index 1a13f6451101..e1030143020f 100644 --- a/sys/contrib/dev/acpica/components/hardware/hwtimer.c +++ b/sys/contrib/dev/acpica/components/hardware/hwtimer.c @@ -115,8 +115,14 @@ AcpiGetTimer ( return_ACPI_STATUS (AE_BAD_PARAMETER); } - Status = AcpiHwRead (Ticks, &AcpiGbl_FADT.XPmTimerBlock); + /* ACPI 5.0A: PM Timer is optional */ + if (!AcpiGbl_FADT.XPmTimerBlock.Address) + { + return_ACPI_STATUS (AE_SUPPORT); + } + + Status = AcpiHwRead (Ticks, &AcpiGbl_FADT.XPmTimerBlock); return_ACPI_STATUS (Status); } @@ -171,6 +177,13 @@ AcpiGetTimerDuration ( return_ACPI_STATUS (AE_BAD_PARAMETER); } + /* ACPI 5.0A: PM Timer is optional */ + + if (!AcpiGbl_FADT.XPmTimerBlock.Address) + { + return_ACPI_STATUS (AE_SUPPORT); + } + /* * Compute Tick Delta: * Handle (max one) timer rollovers on 24-bit versus 32-bit timers. diff --git a/sys/contrib/dev/acpica/components/namespace/nspredef.c b/sys/contrib/dev/acpica/components/namespace/nspredef.c index 8f0729338ccc..74ed8f7b82e1 100644 --- a/sys/contrib/dev/acpica/components/namespace/nspredef.c +++ b/sys/contrib/dev/acpica/components/namespace/nspredef.c @@ -166,6 +166,16 @@ AcpiNsCheckReturnValue ( } /* + * + * 4) If there is no return value and it is optional, just return + * AE_OK (_WAK). + */ + if (!(*ReturnObjectPtr)) + { + goto Exit; + } + + /* * For returned Package objects, check the type of all sub-objects. * Note: Package may have been newly created by call above. */ @@ -293,7 +303,13 @@ TypeErrorExit: AcpiUtGetExpectedReturnTypes (TypeBuffer, ExpectedBtypes); - if (PackageIndex == ACPI_NOT_PACKAGE_ELEMENT) + if (!ReturnObject) + { + ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags, + "Expected return object of type %s", + TypeBuffer)); + } + else if (PackageIndex == ACPI_NOT_PACKAGE_ELEMENT) { ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags, "Return type mismatch - found %s, expected %s", diff --git a/sys/contrib/dev/acpica/components/namespace/nswalk.c b/sys/contrib/dev/acpica/components/namespace/nswalk.c index 3b42d9181cf5..bba76ce656d9 100644 --- a/sys/contrib/dev/acpica/components/namespace/nswalk.c +++ b/sys/contrib/dev/acpica/components/namespace/nswalk.c @@ -165,9 +165,9 @@ AcpiNsGetNextNodeTyped ( * MaxDepth - Depth to which search is to reach * Flags - Whether to unlock the NS before invoking * the callback routine - * PreOrderVisit - Called during tree pre-order visit + * DescendingCallback - Called during tree descent * when an object of "Type" is found - * PostOrderVisit - Called during tree post-order visit + * AscendingCallback - Called during tree ascent * when an object of "Type" is found * Context - Passed to user function(s) above * ReturnValue - from the UserFunction if terminated @@ -195,8 +195,8 @@ AcpiNsWalkNamespace ( ACPI_HANDLE StartNode, UINT32 MaxDepth, UINT32 Flags, - ACPI_WALK_CALLBACK PreOrderVisit, - ACPI_WALK_CALLBACK PostOrderVisit, + ACPI_WALK_CALLBACK DescendingCallback, + ACPI_WALK_CALLBACK AscendingCallback, void *Context, void **ReturnValue) { @@ -274,22 +274,22 @@ AcpiNsWalkNamespace ( } /* - * Invoke the user function, either pre-order or post-order + * Invoke the user function, either descending, ascending, * or both. */ if (!NodePreviouslyVisited) { - if (PreOrderVisit) + if (DescendingCallback) { - Status = PreOrderVisit (ChildNode, Level, + Status = DescendingCallback (ChildNode, Level, Context, ReturnValue); } } else { - if (PostOrderVisit) + if (AscendingCallback) { - Status = PostOrderVisit (ChildNode, Level, + Status = AscendingCallback (ChildNode, Level, Context, ReturnValue); } } diff --git a/sys/contrib/dev/acpica/components/namespace/nsxfeval.c b/sys/contrib/dev/acpica/components/namespace/nsxfeval.c index 33976c7fad11..2ec641853f2b 100644 --- a/sys/contrib/dev/acpica/components/namespace/nsxfeval.c +++ b/sys/contrib/dev/acpica/components/namespace/nsxfeval.c @@ -574,9 +574,9 @@ AcpiNsResolveReferences ( * PARAMETERS: Type - ACPI_OBJECT_TYPE to search for * StartObject - Handle in namespace where search begins * MaxDepth - Depth to which search is to reach - * PreOrderVisit - Called during tree pre-order visit + * DescendingCallback - Called during tree descent * when an object of "Type" is found - * PostOrderVisit - Called during tree post-order visit + * AscendingCallback - Called during tree ascent * when an object of "Type" is found * Context - Passed to user function(s) above * ReturnValue - Location where return value of @@ -605,8 +605,8 @@ AcpiWalkNamespace ( ACPI_OBJECT_TYPE Type, ACPI_HANDLE StartObject, UINT32 MaxDepth, - ACPI_WALK_CALLBACK PreOrderVisit, - ACPI_WALK_CALLBACK PostOrderVisit, + ACPI_WALK_CALLBACK DescendingCallback, + ACPI_WALK_CALLBACK AscendingCallback, void *Context, void **ReturnValue) { @@ -620,7 +620,7 @@ AcpiWalkNamespace ( if ((Type > ACPI_TYPE_LOCAL_MAX) || (!MaxDepth) || - (!PreOrderVisit && !PostOrderVisit)) + (!DescendingCallback && !AscendingCallback)) { return_ACPI_STATUS (AE_BAD_PARAMETER); } @@ -655,8 +655,8 @@ AcpiWalkNamespace ( } Status = AcpiNsWalkNamespace (Type, StartObject, MaxDepth, - ACPI_NS_WALK_UNLOCK, PreOrderVisit, - PostOrderVisit, Context, ReturnValue); + ACPI_NS_WALK_UNLOCK, DescendingCallback, + AscendingCallback, Context, ReturnValue); (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); diff --git a/sys/contrib/dev/acpica/components/tables/tbfadt.c b/sys/contrib/dev/acpica/components/tables/tbfadt.c index 94fd9bcaf721..4a27520d97ed 100644 --- a/sys/contrib/dev/acpica/components/tables/tbfadt.c +++ b/sys/contrib/dev/acpica/components/tables/tbfadt.c @@ -132,7 +132,7 @@ static ACPI_FADT_INFO FadtInfoTable[] = ACPI_FADT_OFFSET (PmTimerBlock), ACPI_FADT_OFFSET (PmTimerLength), ACPI_PM_TIMER_WIDTH, - ACPI_FADT_REQUIRED}, + ACPI_FADT_SEPARATE_LENGTH}, /* ACPI 5.0A: Timer is optional */ {"Gpe0Block", ACPI_FADT_OFFSET (XGpe0Block), @@ -606,7 +606,7 @@ AcpiTbValidateFadt ( if (FadtInfoTable[i].Type & ACPI_FADT_REQUIRED) { /* - * Field is required (PM1aEvent, PM1aControl, PmTimer). + * Field is required (PM1aEvent, PM1aControl). * Both the address and length must be non-zero. */ if (!Address64->Address || !Length) diff --git a/sys/contrib/dev/acpica/components/tables/tbxfroot.c b/sys/contrib/dev/acpica/components/tables/tbxfroot.c index 3c5900cbac29..c509350a386b 100644 --- a/sys/contrib/dev/acpica/components/tables/tbxfroot.c +++ b/sys/contrib/dev/acpica/components/tables/tbxfroot.c @@ -51,12 +51,6 @@ #define _COMPONENT ACPI_TABLES ACPI_MODULE_NAME ("tbxfroot") -/* Local prototypes */ - -static ACPI_STATUS -AcpiTbValidateRsdp ( - ACPI_TABLE_RSDP *Rsdp); - /******************************************************************************* * @@ -70,7 +64,7 @@ AcpiTbValidateRsdp ( * ******************************************************************************/ -static ACPI_STATUS +ACPI_STATUS AcpiTbValidateRsdp ( ACPI_TABLE_RSDP *Rsdp) { @@ -81,7 +75,7 @@ AcpiTbValidateRsdp ( * Note: Sometimes there exists more than one RSDP in memory; the valid * RSDP has a valid checksum, all others have an invalid checksum. */ - if (ACPI_STRNCMP ((char *) Rsdp, ACPI_SIG_RSDP, + if (ACPI_STRNCMP ((char *) Rsdp->Signature, ACPI_SIG_RSDP, sizeof (ACPI_SIG_RSDP)-1) != 0) { /* Nope, BAD Signature */ diff --git a/sys/contrib/dev/acpica/components/utilities/utglobal.c b/sys/contrib/dev/acpica/components/utilities/utglobal.c index d814aa0caddf..be45950b27da 100644 --- a/sys/contrib/dev/acpica/components/utilities/utglobal.c +++ b/sys/contrib/dev/acpica/components/utilities/utglobal.c @@ -319,7 +319,6 @@ AcpiUtInitGlobals ( AcpiGbl_TraceDbgLayer = 0; AcpiGbl_DebuggerConfiguration = DEBUGGER_THREADING; AcpiGbl_DbOutputFlags = ACPI_DB_CONSOLE_OUTPUT; - AcpiGbl_OsiData = 0; AcpiGbl_OsiMutex = NULL; AcpiGbl_RegMethodsExecuted = FALSE; diff --git a/sys/contrib/dev/acpica/components/utilities/utosi.c b/sys/contrib/dev/acpica/components/utilities/utosi.c index aaa253d3345e..9cf57653cd07 100644 --- a/sys/contrib/dev/acpica/components/utilities/utosi.c +++ b/sys/contrib/dev/acpica/components/utilities/utosi.c @@ -81,21 +81,20 @@ static ACPI_INTERFACE_INFO AcpiDefaultSupportedInterfaces[] = /* Feature Group Strings */ - {"Extended Address Space Descriptor", NULL, 0, 0} + {"Extended Address Space Descriptor", NULL, ACPI_OSI_FEATURE, 0}, /* * All "optional" feature group strings (features that are implemented - * by the host) should be dynamically added by the host via - * AcpiInstallInterface and should not be manually added here. - * - * Examples of optional feature group strings: - * - * "Module Device" - * "Processor Device" - * "3.0 Thermal Model" - * "3.0 _SCP Extensions" - * "Processor Aggregator Device" + * by the host) should be dynamically modified to VALID by the host via + * AcpiInstallInterface or AcpiUpdateInterfaces. Such optional feature + * group strings are set as INVALID by default here. */ + + {"Module Device", NULL, ACPI_OSI_OPTIONAL_FEATURE, 0}, + {"Processor Device", NULL, ACPI_OSI_OPTIONAL_FEATURE, 0}, + {"3.0 Thermal Model", NULL, ACPI_OSI_OPTIONAL_FEATURE, 0}, + {"3.0 _SCP Extensions", NULL, ACPI_OSI_OPTIONAL_FEATURE, 0}, + {"Processor Aggregator Device", NULL, ACPI_OSI_OPTIONAL_FEATURE, 0} }; @@ -172,13 +171,26 @@ AcpiUtInterfaceTerminate ( { AcpiGbl_SupportedInterfaces = NextInterface->Next; - /* Only interfaces added at runtime can be freed */ - if (NextInterface->Flags & ACPI_OSI_DYNAMIC) { + /* Only interfaces added at runtime can be freed */ + ACPI_FREE (NextInterface->Name); ACPI_FREE (NextInterface); } + else + { + /* Interface is in static list. Reset it to invalid or valid. */ + + if (NextInterface->Flags & ACPI_OSI_DEFAULT_INVALID) + { + NextInterface->Flags |= ACPI_OSI_INVALID; + } + else + { + NextInterface->Flags &= ~ACPI_OSI_INVALID; + } + } NextInterface = AcpiGbl_SupportedInterfaces; } @@ -307,6 +319,57 @@ AcpiUtRemoveInterface ( /******************************************************************************* * + * FUNCTION: AcpiUtUpdateInterfaces + * + * PARAMETERS: Action - Actions to be performed during the + * update + * + * RETURN: Status + * + * DESCRIPTION: Update _OSI interface strings, disabling or enabling OS vendor + * strings or/and feature group strings. + * Caller MUST hold AcpiGbl_OsiMutex + * + ******************************************************************************/ + +ACPI_STATUS +AcpiUtUpdateInterfaces ( + UINT8 Action) +{ + ACPI_INTERFACE_INFO *NextInterface; + + + NextInterface = AcpiGbl_SupportedInterfaces; + while (NextInterface) + { + if (((NextInterface->Flags & ACPI_OSI_FEATURE) && + (Action & ACPI_FEATURE_STRINGS)) || + (!(NextInterface->Flags & ACPI_OSI_FEATURE) && + (Action & ACPI_VENDOR_STRINGS))) + { + if (Action & ACPI_DISABLE_INTERFACES) + { + /* Mark the interfaces as invalid */ + + NextInterface->Flags |= ACPI_OSI_INVALID; + } + else + { + /* Mark the interfaces as valid */ + + NextInterface->Flags &= ~ACPI_OSI_INVALID; + } + } + + NextInterface = NextInterface->Next; + } + + return (AE_OK); +} + + +/******************************************************************************* + * * FUNCTION: AcpiUtGetInterface * * PARAMETERS: InterfaceName - The interface to find diff --git a/sys/contrib/dev/acpica/components/utilities/utxface.c b/sys/contrib/dev/acpica/components/utilities/utxface.c index e05f57751227..b6003e6772e7 100644 --- a/sys/contrib/dev/acpica/components/utilities/utxface.c +++ b/sys/contrib/dev/acpica/components/utilities/utxface.c @@ -499,6 +499,40 @@ ACPI_EXPORT_SYMBOL (AcpiInstallInterfaceHandler) /***************************************************************************** * + * FUNCTION: AcpiUpdateInterfaces + * + * PARAMETERS: Action - Actions to be performed during the + * update + * + * RETURN: Status + * + * DESCRIPTION: Update _OSI interface strings, disabling or enabling OS vendor + * string or/and feature group strings. + * + ****************************************************************************/ + +ACPI_STATUS +AcpiUpdateInterfaces ( + UINT8 Action) +{ + ACPI_STATUS Status; + + + Status = AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + Status = AcpiUtUpdateInterfaces (Action); + + AcpiOsReleaseMutex (AcpiGbl_OsiMutex); + return (Status); +} + + +/***************************************************************************** + * * FUNCTION: AcpiCheckAddressRange * * PARAMETERS: SpaceId - Address space ID diff --git a/sys/contrib/dev/acpica/include/acglobal.h b/sys/contrib/dev/acpica/include/acglobal.h index 32ae55f855f9..a4538051ec0f 100644 --- a/sys/contrib/dev/acpica/include/acglobal.h +++ b/sys/contrib/dev/acpica/include/acglobal.h @@ -140,6 +140,12 @@ UINT8 ACPI_INIT_GLOBAL (AcpiGbl_DisableAutoRepair, FALSE); */ UINT8 ACPI_INIT_GLOBAL (AcpiGbl_DisableSsdtTableLoad, FALSE); +/* + * We keep track of the latest version of Windows that has been requested by + * the BIOS. + */ +UINT8 ACPI_INIT_GLOBAL (AcpiGbl_OsiData, 0); + /* AcpiGbl_FADT is a local copy of the FADT, converted to a common format. */ @@ -290,7 +296,6 @@ ACPI_EXTERN UINT8 AcpiGbl_DebuggerConfiguration; ACPI_EXTERN BOOLEAN AcpiGbl_StepToNextCall; ACPI_EXTERN BOOLEAN AcpiGbl_AcpiHardwarePresent; ACPI_EXTERN BOOLEAN AcpiGbl_EventsInitialized; -ACPI_EXTERN UINT8 AcpiGbl_OsiData; ACPI_EXTERN ACPI_INTERFACE_INFO *AcpiGbl_SupportedInterfaces; ACPI_EXTERN ACPI_ADDRESS_RANGE *AcpiGbl_AddressRangeList[ACPI_ADDRESS_RANGE_MAX]; diff --git a/sys/contrib/dev/acpica/include/aclocal.h b/sys/contrib/dev/acpica/include/aclocal.h index 47e743738f49..a3569fb8b7ec 100644 --- a/sys/contrib/dev/acpica/include/aclocal.h +++ b/sys/contrib/dev/acpica/include/aclocal.h @@ -1100,19 +1100,6 @@ typedef struct acpi_bit_register_info /* Structs and definitions for _OSI support and I/O port validation */ -#define ACPI_OSI_WIN_2000 0x01 -#define ACPI_OSI_WIN_XP 0x02 -#define ACPI_OSI_WIN_XP_SP1 0x03 -#define ACPI_OSI_WINSRV_2003 0x04 -#define ACPI_OSI_WIN_XP_SP2 0x05 -#define ACPI_OSI_WINSRV_2003_SP1 0x06 -#define ACPI_OSI_WIN_VISTA 0x07 -#define ACPI_OSI_WINSRV_2008 0x08 -#define ACPI_OSI_WIN_VISTA_SP1 0x09 -#define ACPI_OSI_WIN_VISTA_SP2 0x0A -#define ACPI_OSI_WIN_7 0x0B -#define ACPI_OSI_WIN_8 0x0C - #define ACPI_ALWAYS_ILLEGAL 0x00 typedef struct acpi_interface_info @@ -1126,6 +1113,9 @@ typedef struct acpi_interface_info #define ACPI_OSI_INVALID 0x01 #define ACPI_OSI_DYNAMIC 0x02 +#define ACPI_OSI_FEATURE 0x04 +#define ACPI_OSI_DEFAULT_INVALID 0x08 +#define ACPI_OSI_OPTIONAL_FEATURE (ACPI_OSI_FEATURE | ACPI_OSI_DEFAULT_INVALID | ACPI_OSI_INVALID) typedef struct acpi_port_info { @@ -1221,6 +1211,7 @@ typedef struct acpi_external_list UINT8 Type; UINT8 Flags; BOOLEAN Resolved; + BOOLEAN Emitted; } ACPI_EXTERNAL_LIST; diff --git a/sys/contrib/dev/acpica/include/acnamesp.h b/sys/contrib/dev/acpica/include/acnamesp.h index 1118184ed383..63caba3afa19 100644 --- a/sys/contrib/dev/acpica/include/acnamesp.h +++ b/sys/contrib/dev/acpica/include/acnamesp.h @@ -117,8 +117,8 @@ AcpiNsWalkNamespace ( ACPI_HANDLE StartObject, UINT32 MaxDepth, UINT32 Flags, - ACPI_WALK_CALLBACK PreOrderVisit, - ACPI_WALK_CALLBACK PostOrderVisit, + ACPI_WALK_CALLBACK DescendingCallback, + ACPI_WALK_CALLBACK AscendingCallback, void *Context, void **ReturnValue); diff --git a/sys/contrib/dev/acpica/include/acpixf.h b/sys/contrib/dev/acpica/include/acpixf.h index b3c76e469861..4f4e81a3eab9 100644 --- a/sys/contrib/dev/acpica/include/acpixf.h +++ b/sys/contrib/dev/acpica/include/acpixf.h @@ -47,7 +47,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20130626 +#define ACPI_CA_VERSION 0x20130725 #include <contrib/dev/acpica/include/acconfig.h> #include <contrib/dev/acpica/include/actypes.h> @@ -61,6 +61,7 @@ extern UINT32 AcpiCurrentGpeCount; extern ACPI_TABLE_FADT AcpiGbl_FADT; extern BOOLEAN AcpiGbl_SystemAwakeAndRunning; extern BOOLEAN AcpiGbl_ReducedHardware; /* ACPI 5.0 */ +extern UINT8 AcpiGbl_OsiData; /* Runtime configuration of debug print levels */ @@ -177,6 +178,10 @@ ACPI_STATUS AcpiRemoveInterface ( ACPI_STRING InterfaceName); +ACPI_STATUS +AcpiUpdateInterfaces ( + UINT8 Action); + UINT32 AcpiCheckAddressRange ( ACPI_ADR_SPACE_TYPE SpaceId, @@ -268,8 +273,8 @@ AcpiWalkNamespace ( ACPI_OBJECT_TYPE Type, ACPI_HANDLE StartObject, UINT32 MaxDepth, - ACPI_WALK_CALLBACK PreOrderVisit, - ACPI_WALK_CALLBACK PostOrderVisit, + ACPI_WALK_CALLBACK DescendingCallback, + ACPI_WALK_CALLBACK AscendingCallback, void *Context, void **ReturnValue); diff --git a/sys/contrib/dev/acpica/include/actables.h b/sys/contrib/dev/acpica/include/actables.h index 3452a7b870a6..42958945bca4 100644 --- a/sys/contrib/dev/acpica/include/actables.h +++ b/sys/contrib/dev/acpica/include/actables.h @@ -52,6 +52,10 @@ AcpiAllocateRootTable ( /* * tbxfroot - Root pointer utilities */ +ACPI_STATUS +AcpiTbValidateRsdp ( + ACPI_TABLE_RSDP *Rsdp); + UINT8 * AcpiTbScanMemoryForRsdp ( UINT8 *StartAddress, diff --git a/sys/contrib/dev/acpica/include/actypes.h b/sys/contrib/dev/acpica/include/actypes.h index 09ccfdf08d73..cf98e4bfc6e9 100644 --- a/sys/contrib/dev/acpica/include/actypes.h +++ b/sys/contrib/dev/acpica/include/actypes.h @@ -1244,4 +1244,32 @@ typedef struct acpi_memory_list } ACPI_MEMORY_LIST; +/* Definitions of _OSI support */ + +#define ACPI_VENDOR_STRINGS 0x01 +#define ACPI_FEATURE_STRINGS 0x02 +#define ACPI_ENABLE_INTERFACES 0x00 +#define ACPI_DISABLE_INTERFACES 0x04 + +#define ACPI_DISABLE_ALL_VENDOR_STRINGS (ACPI_DISABLE_INTERFACES | ACPI_VENDOR_STRINGS) +#define ACPI_DISABLE_ALL_FEATURE_STRINGS (ACPI_DISABLE_INTERFACES | ACPI_FEATURE_STRINGS) +#define ACPI_DISABLE_ALL_STRINGS (ACPI_DISABLE_INTERFACES | ACPI_VENDOR_STRINGS | ACPI_FEATURE_STRINGS) +#define ACPI_ENABLE_ALL_VENDOR_STRINGS (ACPI_ENABLE_INTERFACES | ACPI_VENDOR_STRINGS) +#define ACPI_ENABLE_ALL_FEATURE_STRINGS (ACPI_ENABLE_INTERFACES | ACPI_FEATURE_STRINGS) +#define ACPI_ENABLE_ALL_STRINGS (ACPI_ENABLE_INTERFACES | ACPI_VENDOR_STRINGS | ACPI_FEATURE_STRINGS) + +#define ACPI_OSI_WIN_2000 0x01 +#define ACPI_OSI_WIN_XP 0x02 +#define ACPI_OSI_WIN_XP_SP1 0x03 +#define ACPI_OSI_WINSRV_2003 0x04 +#define ACPI_OSI_WIN_XP_SP2 0x05 +#define ACPI_OSI_WINSRV_2003_SP1 0x06 +#define ACPI_OSI_WIN_VISTA 0x07 +#define ACPI_OSI_WINSRV_2008 0x08 +#define ACPI_OSI_WIN_VISTA_SP1 0x09 +#define ACPI_OSI_WIN_VISTA_SP2 0x0A +#define ACPI_OSI_WIN_7 0x0B +#define ACPI_OSI_WIN_8 0x0C + + #endif /* __ACTYPES_H__ */ diff --git a/sys/contrib/dev/acpica/include/acutils.h b/sys/contrib/dev/acpica/include/acutils.h index c0ea53333503..c80dd36ca4f6 100644 --- a/sys/contrib/dev/acpica/include/acutils.h +++ b/sys/contrib/dev/acpica/include/acutils.h @@ -670,6 +670,10 @@ ACPI_STATUS AcpiUtRemoveInterface ( ACPI_STRING InterfaceName); +ACPI_STATUS +AcpiUtUpdateInterfaces ( + UINT8 Action); + ACPI_INTERFACE_INFO * AcpiUtGetInterface ( ACPI_STRING InterfaceName); diff --git a/sys/contrib/dev/rsu/rsu-rtl8712fw.fw.uu b/sys/contrib/dev/rsu/rsu-rtl8712fw.fw.uu new file mode 100644 index 000000000000..7d62e19e1bed --- /dev/null +++ b/sys/contrib/dev/rsu/rsu-rtl8712fw.fw.uu @@ -0,0 +1,2149 @@ +begin-base64 644 rsu-rtl8712fw +EofsETAAAAAI6AAAUPUAADAAAACY8wAA8gAAAAUwFlOHEhIBAAASBgAAAAAABwAAAAAAAAAAAAAB +AQABAQEAAAEAAQAAAAEBAAAAAAAAAAB/AAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB8AABAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJbAaPIAD +WjcAgBs8gAB7NwAAW68lsBo8GANaNwCAGzyAAHs3AABbrwGAGjwk4lonCABAAwAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAoa8IAKKvDACjrxAApK8UAKWvGACmrxwAp68gAKivJACp +rygAqq8sAKuvMACsrzQAra84AK6vPACvrxJAAAAQSAAAAHAKQEAAsK9EALGvSACyr0wAs69QALSv +VAC1r1gAtq9cALevYAC4r2QAua9oALyvbAC9r3AAvq90AL+veACor3wAqa+AAKqvFzgACCEgoAMA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADg/70nFACx +rwCAAjwlsBE8GAMjNgADQiQAAGKsGACyrxAAsK8cAL+vlkAADAAAAABCsAI8AwBHNAAA45ACgAo8 +AoALPP8AcDAANhAAEAACMgM2BgAXAEAQAoASPPxcQo1gG0QmZDeDlAEARSQQAAIksAMpNhwDKDYA +AOKgBwBgEAAAAABoN4KUZDeApGg3gKQAAAMkAAACrQAAIK0QXmKNAQBjJPxcRa0BAEIkEF5irWQ3 +g6QpAMAEQrACPJtAAAwAAAAAQAACMg8AQBRgG0Qm4BuDlNwbhZQcAL+PGACyjxQAsY8QALCPgABj +MEGwAjwlGGUACABCNCAAvScAAEOkCADgA9wbg6RCsAI8QAADJAMAQjQAAEOgJWIADAAAAABgG0Qm +4BuDlNwbhZQcAL+PGACyjxQAsY8QALCPgABjMEGwAjwlGGUACABCNCAAvScAAEOkCADgA9wbg6SA +/wMkAwBCNAAAQ6BEIgB0AAAAAO8AAAgAAAAA/wCEMAsAgiz//+cwEACokxkAQBAhGAAAAoADPIAQ +BACI5mMkIRBDAAAARIwAAAAACACAAAAAAABDsAI8eABENAcA4jAAAIWsBACGrAQAQBgAAAAA+P/i +MAgAQiT//0cwIRDoAACAAzwIAIKsJRBDAAgAgqwBAAMkCADgAyEQYABDsAI8LgEACGwARDRDsAI8 +LgEACGAARDRDsAI8LgEACFQARDRDsAI8LgEACEgARDRDsAI8LgEACDwARDRDsAI8LgEACDAARDRD +sAI8LgEACCQARDRDsAI8LgEACBgARDRDsAI8LgEACAwARDQuAQAIQ7AEPACAAzwlsAI8GANCNGwF +YyQAAEOsAQAFJEOwAjwEKIUAiABENCEQAAABAEIk//9CMAUAQyz9/2AUAQBCJAAAgpQAAAAA//9C +MCQQRQD1/0AcAAAAAAgA4AMAAAAAJbAIPACAAjzI/70nGAMDNcgFQiQAAGKsMAC2rygAtK8kALOv +HACxrzQAv68sALWvIACyrxgAsK8MAPKECAD1jP8AxjAAAQIkIxBGAP//UTDQAwg1/wCWMAAAEq0h +oKAAITDFAAAAFa0hIMACISigAiE4IAIeAQAMEACgryMYUQL//4IyAJQDAAOUEgC0AQAIApoCACiw +AzzAEBMAIRBDAAAARJAlsBA8IBACPP8AkzAAIhMA//9DMgEBRSohoIIAIaixAtADAjYAAREkC4hl +ACEgwAIAAFOsWwEADLADEDYhMIACISDAAiEooAIhOCACHgEADBAAoK8jGFECAJQDAAOUEgAAABKu +4v9AHgAAAAA0AL+PMAC2jywAtY8oALSPJACzjyAAso8cALGPGACwjwgA4AM4AL0nIVCAAAQAjYwM +AEuNCACEjP/gAjwQAEeN//9CNB8AqTEkIIIAAB4JAAIUCwAlQIMAIXigALcA4AQHAEQwAABClQAA +AAD9D0IouQBAEP/fAjwCgA48CABIrWAbwyXGPWKQAAAAAAsAQBTAMAkAxkBikP/fAzz//2M0BxCC +AAEAQjAkGAMBQBcCACVAYgAIAEitwDAJACEQyQCAEAIAIRBJAIAQAgBgG8klIShJAAglo4wBAAwk +AhMDAAEAQjC1AEwQQhgDAIIRCAABAEIwBgBAFAKAAjzA/wIkJBACAQQASDQIAEitAoACPNFcQ5AA +AAAAagBgFCEgyQDUI4OMv/8CJCQQ4gBAAGMwJThDABAAR63UI4OMf/gCJCQQ4gCAB2MwJThDABAA +R63GPSKRAAAAABIAQBRCFwgAAQBEMLEAjBACgAI8YBvEJSEgxADUI4OM//cCJCQQ4gAACGMwJThD +ABAAR63UI4OM/+8CJCQQ4gAAEGMwJThDABAAR61gG8UlITDFANQjxIz9/wI8AgADPP//QjQkIIMA +JBDiACU4RAAQAEetsBujlPv/Ajz//0I0whsDACQQ4gCAHAMAJThDABAAR607QaOQ5/8CPP//QjQD +AGMwJBDiAMAcAwAlOEMAEABHrdQjxIz//QI8AAIDPP//QjQkIIMAJBDiACU4RAAQAEetsBujlP/7 +Ajz//0I0whsDACQQ4gCAHgMAJThDABAAR607QaOQ/+cCPP//QjQDAGMwJBDiAMAeAwAlOEMAEABH +rdQjw4zA/wIkJBDiAD8AYzAlEEMAEABCrdgjxIwUAEON//8CPP9/QjQkGGIAAICEMCUYZAAUAEOt +2iPElOD/Ajz//0I0HwCEMCQYYgAAJAQAJRhkABQAQ60CAEORAhQNAAEAQjAnAEAQITBvAGAbxCXk +HYWUAAAAAAEAoiTkHYKkDABDjQDwAjz/D6Uw//9CNAAkBQAkGGIAJViDAAwAS60WAMKUABkFAGAb +xCUPAEIwJRBDABYAwqQAAEOVQEGCjAAAAAAhEEMACADgA0BBgqwUAEKNAAAAAEISAgA/AEIwDABC +KET/QBD/3wI8//9CNCRAAgEAQAM8JUADAeMBAAgCgA48YBvDJcY9YpAAAAAAHQBAFAAAAADCEwsA +DgBCMCEQQwDUHUWUAAAAAAEAoyTUHUOkDABEjQDwAjz/D6Uw//9CNAAcBQB3AgAIJCCCAH//AiQk +EAIBgABjMCVAQwAIAEitCCWjjP//Ajz/H0I0BwBjMCQQ4gBAGwMAJThDAPEBAAgQAEetAhQLAP8P +RTAWAMKUABkFAGAbxCUPAEIwJRBDABYAwqQAAEOVQEGCjAAAAAAhEEMACADgA0BBgqzOXEOQAAAA +AE7/ZBRgG8QlPEEikf/3AyQkGOMAAQBCMMASAgAlOGIAEABHrT1BIpH/7wMkJBjjAAEAQjAAEwIA +JThDAB8CAAgQAEet2P+9JyAAsq8YALCvJAC/rxwAsa8EAIuMIYCAAAgAhIwOAAeW/+ACPBAACI4f +AGox//9CNCQgggAAHgoAJUiDACGQoAAhYMAAzwAABQcA5zAAAAKWAAAAAP0PQijRAEAQ/98CPAKA +ETwIAAmuYBsjJsY9YpAAAAAACgBAFAAAAADGQGKQ/98DPP//YzQHEOIAAQBCMCQYIwFAFwIAJUhi +AAgACa4cAAKOAAAAAAMBQAQEAAMkwDAKACEQygCAEAIAIRBKAIAQAgBgGycmIShHAAglo4wBAAok +AhMDAAEAQjDnAEoQQhgDAIIRCQABAEIwBgBAFAKAAjzA/wIkJBAiAQQASTQIAAmuAoACPNFcQ5AA +AAAAbABgFCEoxwDUI6SMEAACjr//AyRAAIQwJBBDACVARAAQAAiu1COjjH/4AiQkEAIBgAdjMCVA +QwAQAAiuxj3ikAAAAAAUAEAUYBslJkIXCQABAEQwCAGKEAKAAjxgGyQmISDEANQjg4z/9wIkJBAC +AQAIYzAlQEMAEAAIrtQjg4z/7wIkJBACAQAQYzAlQEMAEAAIrmAbJSYhMMUA1CPEjP3/AjwCAAM8 +//9CNCQggwAkEAIBJUBEABAACK6wG6OU+/8CPP//QjTCGwMAJBACAYAcAwAlQEMAEAAIrjtBo5Dn +/wI8//9CNAMAYzAkEAIBwBwDACVAQwAQAAiu1CPEjP/9AjwAAgM8//9CNCQggwAkEAIBJUBEABAA +CK6wG6OU//sCPP//QjTCGwMAJBACAYAeAwAlQEMAEAAIrjtBo5D/5wI8//9CNAMAYzAkEAIBwB4D +ACVAQwAQAAiu1CPDjMD/AiQkEAIBPwBjMCUQQwAQAAKu2CPEjBQAA47//wI8/39CNCQYYgAAgIQw +JRhkABQAA67aI8SU4P8CPP//QjQfAIQwJBhiAAAkBAAlGGQAFAADrgIAApICJAsAAoADPCEQTAD/ +/0IwAQCEMDYAgBAlMEMAYBskJuQdhZSAAAckAQCiJOQdgqQMAAOOAPACPP8PpTD//0I0ACQFACQY +YgAlGGQADAADrhYAwpQAGQUAAgAEJA8AQjAlEEMAFgDCpCEogAEhMEACAQACJB4BAAwQAKKvJbAC +PLADQjQAAFKsWwEADAIABCRgGyQmAAADlkBBgowkAL+PIACyjxwAsY8YALCPIRBDACgAvScIAOAD +QEGCrBQAAo4AAAAAQhICAD8AQjAMAEIoLP9AEP/fAjz//0I0JEgiAQBAAzwlSCMB/AIACAKAETxg +GyMmxj1ikAAAAABTAEAUgAAHJA4AApYAAAAABwBCMEAQAgAhEEMA1B1FlAAAAAABAKMk1B1DpAwA +BI4A8AI8/w+lMP//QjQAHAUAJCCCACUggwAMAASuFgDClAAZBQACAAQkDwBCMCUQQwAWAMKkISiA +ASEwQAIBAAIkHgEADBAAoq8lsAI8sANCNAAAUqxbAQAMAgAEJGAbJCYAAAOWQEGCjCQAv48gALKP +HACxjxgAsI8hEEMAKAC9JwgA4ANAQYKsf/8CJCQQIgGAAGMwJUhDAAgACa4IJaOMEAAEjv//AjwH +AGMw/x9CNCQgggBAGwMAJUCDAA4DAAgQAAiuHgACkgAAAAAhMFAAAADEkAAAAAD/AIIwAikCAD8A +oxAGAAIk9P6iFAAAAAAaAAKWAAAAADkAwqAeAAOSGgACliEYcAADEgIAOABioAQAC44IAAmOAgMA +CMAwCgAOAAKWAgAEJP8PRTAWAMKUABkFACEogAEPAEIwJRBDABYAwqQhMEACAQACJB4BAAwQAKKv +JbACPLADQjQAAFKsWwEADAIABCRgGyQmAAADlkBBgowkAL+PIACyjxwAsY8YALCPIRBDACgAvScI +AOADQEGCrM5cQ5AAAAAA9/5kFGAbJCY8QeKQ//cDJCQYAwEBAEIwwBICACVAYgAQAAiuPUHikP/v +AyQkGAMBAQBCMAATAgAlQEMAPgMACBAACK4aAAWWDwCEMIAgBAAhGMQAEQBloB4AApIaAAOWIRBQ +ACEQRAADGgMAEABDoAQAC44IAAmOAgMACMAwCgAAgAM8JbACPGQRYyQYA0I0AABDrAgA4AMAAAAA +wP+9JwKAAjwsALWvJbADPGAbVSQAgAI8OAC+r4ARQiSwA340GANjNAAAYqw8AL+vNAC3rzAAtq8o +ALSvJACzryAAsq8cALGvlkAADBgAsK+OBAAIAAAAAAgABK4IOEaOIShgAoAAByQBAAQkAQAUJB4B +AAwQALSvCDhDjgEABCQAAMOuWwEADAAAAAAqHEKSAAAAAF8AQBAqsAI8CQBCNAIAAyQAAFSgAABD +oP8AAyRxACMSAAAAAAQ4oo5wOLOOAQAEJAAAwq8IOKKuAADTr1sBAAwAAAAAcDikjnQ4o44CgAI8 +tOZCJAAAUoyAAIQk/wBiJCsQRAAKGIIAcDijrgKAAzy45mMkcDhCjgAAdowAAAAAAADCrgKAFzz/ +/2IyJYBXAAAA0K4MAAKSISgAAAAAwq4CAASSAAAAACEgkwD//4Qw4GEADCUglwAMABGSIBACPAEA +BCQAGhEAIRhiAP8AAiQhMGAABgAiEoAAByRwOEWOBDhDrqg3UaIeAQAMEACgrwQABI4IAAOO/+AC +PP//QjQfAIQwJBhiAAAmBAD/3wI8JRhkAP//QjQkGGIAAEAEPCUYZADA/wUkghEDACQgZQABAEIw +o/9AEAQAhDQIAAOuCDhGjiEoYAKAAAckAQAEJAEAFCQeAQAMEAC0rwg4Q44BAAQkAADDrlsBAAwA +AAAAKhxCkgAAAACj/0AUKrACPJtAAAwAAAAAKhxUogIAApIAAAAAIRBTAP//QjAlEFcAAgBDlAAA +AAD/AGQwAMCEJCscQ6KjMQAM//+EMJZAAAwAAAAAKrACPAkAQjQCAAMkAABUoAAAQ6D/AAMkkf8j +FgAAAACbQAAMAAAAAAKAAzxgG2Ik0BtDjDwAv484AL6PNAC3jzAAto8sALWPKAC0jyQAs48gALKP +HACxjxgAsI8AOGM0QbAEPEAAvScAAIOsCADgA9AbQ6wAgAM8JbACPEwUYyQYA0I0AABDrAgA4AMA +AAAAwP+9JzQAt688AL+vOAC+rzAAtq8sALWvKAC0ryQAs68gALKvHACxrxgAsK8CgAY8wF3FkACA +AzwlsAI8GANCNGgUYyRAAKQwAABDrCG4AAADAIAQfwCiML8AojABABckwF3CoJZAAAwCgB48JbAC +PGAb0yewA1U0WQUACAKAFjyEN5GiYBvCJ7w3RowoOEWMAwAEJIAAByQeAQAMEACgr2Ab1CfAN4WO +ISAAAtQCAAwhMEACKrAHPA0A4jQEAEMkCxB3AAEABCQCAAMkAABEoAAAQ6AMXcSWJbAGPGYDxTQB +AIQkDF3Epgxdwpb/AAMkAACipC8AIxIAAAAAvDdijig4co4DAAQkAACirsA3Yq4AALKuWwEADAAA +AAAoOGSOLDhjjgKAAjy85kIkAABUjIAAhCT/AGIkKxBEAAoYggAoOGOuKDiCjgAAAAAAAKKuAoAD +PP//QjIlgEMAAACwrgwAApIBAAUkAACirgIABJIAAAAAISCSAP//hDDgYQAMJSCDAAwAEZIgEAI8 +/wADJAAiEQDC/yMSISCCALj/4Ba8N4SuAoACPGAbQiQ7BQAIgDdRoB4A4BJAAOQ0hDeDkkEA5DSw +A8U0AACDoAAAo6yWQAAMAAAAAJtAAAwAAAAAYBvFJ9AbpIwBAAI8PAC/jzgAvo80ALePMAC2jywA +tY8oALSPJACzjyAAso8cALGPGACwjwCAQjQlIIIAQbADPEAAvScAAGSsCADgA9AbpKyAN4OSsAPF +NAAAg6AAAKOslkAADAAAAACbQAAMAAAAAGAbxSfQG6SMAQACPDwAv484AL6PNAC3jzAAto8sALWP +KAC0jyQAs48gALKPHACxjxgAsI8AgEI0JSCCAEGwAzxAAL0nAABkrAgA4APQG6SswP+9JzQAt688 +AL+vOAC+rzAAtq8sALWvKAC0ryQAs68gALKvHACxrxgAsK8CgAY8wF3FkACAAzwlsAI8GANCNAgX +YyQQAKQwAABDrCG4AAADAIAQ3wCiMO8AojABABckwF3CoMBdw5AlsAI8sANCNAAAQ6wCgB48AABD +rCGoQACWQAAMYBvTJwUGAAgCgBY8jDeRomAbwifIN0aMNDhFjAQABCSAAAckHgEADBAAoK9gG9Qn +zDeFjiEgAALUAgAMITBAAiqwBzwVAOI0BABDJAsQdwABAAQkAgADJAAARKAAAEOgDF3EliWwBjxm +A8U0AQCEJAxdxKYMXcKW/wADJAAAoqQvACMSAAAAAMg3Yo40OHKOBAAEJAAAoq7MN2KuAACyrlsB +AAwAAAAANDhkjjg4Y44CgAI8wOZCJAAAVIyAAIQk/wBiJCsQRAAKGIIANDhjrjQ4go4AAAAAAACi +rgKAAzz//0IyJYBDAAAAsK4MAAKSAgAFJAAAoq4CAASSAAAAACEgkgD//4Qw4GEADCUggwAMABGS +IBACPP8AAyQAIhEAwv8jEiEgggC4/+AWyDeErgKAAjxgG0Ik5wUACIg3UaAdAOASQgDkNIw3g5JD +AOQ0sAPFNAAAg6AAAKOslkAADAAAAACbQAAMAAAAAGAbxSfQG6KMPAC/jzgAvo80ALePMAC2jywA +tY8oALSPJACzjyAAso8cALGPGACwjwYAAzwlEEMAQbAEPEAAvScAAIKsCADgA9AboqyIN4OSsAPF +NAAAg6AAAKOslkAADAAAAACbQAAMAAAAAGAbxSfQG6KMPAC/jzgAvo80ALePMAC2jywAtY8oALSP +JACzjyAAso8cALGPGACwjwYAAzwlEEMAQbAEPEAAvScAAIKsCADgA9AboqzA/70nNAC3rzwAv684 +AL6vMAC2rywAta8oALSvJACzryAAsq8cALGvGACwrwKABjzAXcWQAIADPCWwAjwYA0I0sBljJAEA +pDAAAEOsIbgAAAMAgBD3AKIw/gCiMAEAFyTAXcKgwF3DkCWwAjywA0I0AoAePAAAQ6whqEAAlkAA +DGAb0yeuBgAIAoAWPJw3kaJgG8In1DdGjEA4RYwFAAQkgAAHJB4BAAwQAKCvYBvUJ9g3hY4hIAAC +1AIADCEwQAIqsAc8HQDiNAQAQyQLEHcAAQAEJAIAAyQAAESgAABDoAxdxJYlsAY8ZgPFNAEAhCQM +XcSmDF3Clv8AAyQAAKKkLwAjEgAAAADUN2KOQDhyjgUABCQAAKKu2DdirgAAsq5bAQAMAAAAAEA4 +ZI5EOGOOAoACPMTmQiQAAFSMgACEJP8AYiQrEEQAChiCAEA4Y65AOIKOAAAAAAAAoq4CgAM8//9C +MiWAQwAAALCuDAACkggABSQAAKKuAgAEkgAAAAAhIJIA//+EMOBhAAwlIIMADAARkiAQAjz/AAMk +ACIRAML/IxIhIIIAuP/gFtQ3hK4CgAI8YBtCJJAGAAiQN1GgHQDgEkQA5DScN4OSRQDkNLADxTQA +AIOgAACjrJZAAAwAAAAAm0AADAAAAABgG8Un0BuijDwAv484AL6PNAC3jzAAto8sALWPKAC0jyQA +s48gALKPHACxjxgAsI8YAAM8JRBDAEGwBDxAAL0nAACCrAgA4APQG6KskDeDkrADxTQAAIOgAACj +rJZAAAwAAAAAm0AADAAAAABgG8Un0BuijDwAv484AL6PNAC3jzAAto8sALWPKAC0jyQAs48gALKP +HACxjxgAsI8YAAM8JRBDAEGwBDxAAL0nAACCrAgA4APQG6KswP+9JzQAt688AL+vOAC+rzAAtq8s +ALWvKAC0ryQAs68gALKvHACxrxgAsK8CgAY8wF3FkACAAzwlsAI8GANCNFQcYyQCAKQwAABDrCG4 +AAADAIAQ+wCiMP0AojABABckwF3CoMBdw5AlsAI8sANCNAKAHjwAAEOsIahAAJZAAAxgG9MnVwcA +CAKAFjyYN5GiYBvCJ+A3RoxMOEWMBgAEJIAAByQeAQAMEACgr2Ab1CfkN4WOISAAAtQCAAwhMEAC +KrAHPCUA4jQEAEMkCxB3AAEABCQCAAMkAABEoAAAQ6AMXcSWJbAGPGYDxTQBAIQkDF3Epgxdwpb/ +AAMkAACipC8AIxIAAAAA4Ddijkw4co4GAAQkAACiruQ3Yq4AALKuWwEADAAAAABMOGSOUDhjjgKA +AjzI5kIkAABUjIAAhCT/AGIkKxBEAAoYggBMOGOuTDiCjgAAAAAAAKKuAoADPP//QjIlgEMAAACw +rgwAApIEAAUkAACirgIABJIAAAAAISCSAP//hDDgYQAMJSCDAAwAEZIgEAI8/wADJAAiEQDC/yMS +ISCCALj/4BbgN4SuAoACPGAbQiQ5BwAIlDdRoB0A4BJGAOQ0mDeDkkcA5DSwA8U0AACDoAAAo6yW +QAAMAAAAAJtAAAwAAAAAYBvFJ9Aboow8AL+POAC+jzQAt48wALaPLAC1jygAtI8kALOPIACyjxwA +sY8YALCPYAADPCUQQwBBsAQ8QAC9JwAAgqwIAOAD0BuirJQ3g5KwA8U0AACDoAAAo6yWQAAMAAAA +AJtAAAwAAAAAYBvFJ9Aboow8AL+POAC+jzQAt48wALaPLAC1jygAtI8kALOPIACyjxwAsY8YALCP +YAADPCUQQwBBsAQ8QAC9JwAAgqwIAOAD0BuirACAAzwlsAI8+B5jJBgDQjTo/70nAABDrBAAv6+W +QAAMAAAAAJtAAAwAAAAAAoAFPGAbpSTYG6KM0BukjAAIAzwQAL+PJBBDACUgggBBsAM8GAC9JwAA +ZKwIAOAD0BukrMD/vScgALCvAIACPCWwEDwYAwM2WB9CJAAAYqw0ALWvAoAVPDgAv68sALOvKACy +r2AbsyYkALGvlkAADDAAtK/8AAI2AABFjKwbZJbMOGOWxDhmjiMopAAhEKMAI4hGACMgIwKwAxA2 +KxBxAAAAA64AABGuC4iCACEgIAJTIQAMyDhlriGQQABNAEAQGACkJwwAUazEOGiOyDhijggARY4g +vQM8iANjNCsQSABAEBQ8ISAAAP//JzIAAGWsKgBAFAAAAACsG2aWCABClkAQBTwhIAAAITAGASUo +RQAeAQAMEACgr4pAAAwYAKQnAoACPIhUQiQEAEOMAABCrgQAUqwhIAAAAAByrFsBAAwEAEOuYBul +Jsg4poysG6OUJbACPPgAQjQhGMMAAABDrBgApCfEOKaskEAADAAAAACbQAAMAAAAADgAv480ALWP +MAC0jywAs48oALKPJACxjyAAsI8IAOADQAC9J8w4cI4IAEWWrBtmliOACAL//xAyITAGASUotAAh +OAACHgEADBAAoK9bAQAMISAAAAgARZasG2KWIzgwAiUotAAhEAY8ISiwACEwRgD//+cwDQgACCEg +AACKQAAMAAAAAAKAAzzEXWKMGACkJwgAQjQjCAAIxF1irCWwBTwAgAI8wP+9JxgDpDQ4IUIkKrAD +PAAAgqw8AL+vOAC+rzQAt68wALavLAC1rygAtK8kALOvIACyrxwAsa8YALCvLABjNAAAaYz/AAIk +/wAkMUgAghAAgCIxNwBAEAD/AjwAgAI8AABirP8AAiQUAIIQAoADPGAbcCT/ACMxIBACPAAaAwAh +GGIAfDgFjiWwAjz/ACgxfANCNAAASKQhMGAAEDgDrqw3CaIKAAQkAAEHJB4BAAwQAKCvAQADJIQ4 +A6ICgAI8YBtQJIQ4A5IBAAIkMQBiEAKABDxgG5AkhTgCkgAAAAAIAEAQAAQDPNgbAo7QGwSOJBBD +ACUgggBBsAM8AABkrNAbBK48AL+POAC+jzQAt48wALaPLAC1jygAtI8kALOPIACyjxwAsY8YALCP +CADgA0AAvSckECIBy/9AEP8AAiQCgAI8YBtDJKw3YpAgsAM8sAOkNAASAgAhEEMADABJjAAAAAAA +AImsaQgACP8AJDECgAQ8YBuCJIQ4QKACgAI8YBtQJIQ4A5IBAAIk0f9iFAAAAACWQAAMIYgAAiWw +AjwqsAM8LAB+NAKAFzywA1Y0AQATJCGgAAIhqAACfDgwjgoABCQAANCuWwEADAAAAAACgAI8//8I +MiWAAgHCXOOSAgAEkgIAAiQPAGMwUgBiECE4BAIgAAIkVACCFAKAAjxU9UesAgDikIU4hJIDAOOQ +/wBSMAEAAiQhKOAAfwBmMAgA5yRXAIIQAoAJPA4AAiRRAEISNwACJE8AQhIQAAIkTgBCEgKAAjwC +gAI8ONdCJMAYEgAhGGIANNcmoQQAYowCgAM8ISDgAAn4QABM9WKsAwBAEDkAAiQ7AEISAAAAAJtA +AAwAAAAAhTgzopZAAAwAAAAAOQACJAMAQhICAAIkAQDTowEAwqOFOKOSAQACJEIAYhT/AAIkDAAD +kgAAAAD/AGgwPgACEQKAAjysN6OirDciknw4JY4gEAM8ABICACEQQwAAAMiuITBAABA4Iq4KAAQk +AAEHJB4BAAwQAKCvfDgwjgoABCQAANCuWwEADAAAAAACgAI8//8IMiWAAgHCXOOSAgAEkgIAAiQP +AGMwsP9iFCE4BAIAAAKOAAwDPCQQQwCu/0MQAoACPJVYAAwBAAQkejciloU4M6IBAEIk9QgACHo3 +IqabQAAMAAAAAPMIAAiFOCCiAoACPOIIAAglOAIBNNcikQAAAAB/AEIwEwDCECWwBDxqN4KWHgOE +NBAAQjQ7AEMuAACCpJ//YBRqN4Km9ggACDkAAiQCgAI8sF1EjCWwAzywA2M0AABkrJtAAAwAAAAA +hQgACAKABDwCAKWQNNcnkQKABDzM5oQk/wClMBNYAAz/AOcw9ggACDkAAiTA/70nNAC3rwKAAjwh +uKAA//+lMCVAogAgALKvOAC/rzAAtq8sALWvKAC0ryQAs68cALGvGACwrwAAA43//9IwCABFJgDA +AiQEAAaNJBhiAP8/pTDw/wI8JRhlAP//QjQkGGIAAIAFPCUYZQD/AcY0AAADrQQABq0hSIAA///n +MBgABiUYABKlAgDHoBgAA43/fwI8//9CNCQYYgACgBY8GAADrWAbxSZmN6SQAAAAAAEAgiRmN6Kg +GAADjf+AAjz//0I0fwCEMAAmBAAkGGIAJRhkABgAA60CgAI8wlxEkCAAQyb//3IwAgCEMAQAgBAh +GEACHwBCMlwAQBAIAEIm//9jMF0AQxIAAAAABADCjCGQYAAAwAQkAQBCNAQAwqwAAAONAAAAAP8/ +YjAIAEIkJBhkAP8/QjAlGGIAAAADrSWwAjzAAEI0BwBDMgAAUqQDAGAQ+P9TMggAQib4/1MwYBvV +Juw4po7wOLCOIRDTACsQAgIyAEAQ/wA0MSOABgIhKOAC//8HMgEAESQhIIACHgEADBAAsa8jGHAC +//9yMCIQAjwhEEICISCAAlsBAAzsOKKuISjwAiE4QAIhIIACIhAGPB4BAAwQALGvYBvRJuw4I44l +sBA8sAMCNiEggAIAAEOsWwEADAAAAADsOCWO7AACNr0ABDYAAEWsAACDkMIAEDY4AL+PEABjNAAA +g6A0ALePAAAFpjAAto8sALWPKAC0jyQAs48gALKPHACxjxgAsI8BAAIkCADgA0AAvScBAAIkISjg +AiEggAIhOGACHgEADBAAoq/sOKOOAAAAACEYcwDECQAI7Dijrv//QzD//2Mwpf9DFgAAAAAEAMKM +/v8DJCQQQwChCQAIBADCrOD/vScYALCvIYCAABwAv6+KQAAMEACkJxQAA44WAAIkISgAAAoAYhAI +AAYkCAAClgKABDzsVAAMJSBEAAgABY4MAAaWFAAHllEJAAwJAAQkBAADjgAAAo4hIAACAABirAQA +Q6wAABCudCEADAQAEK6QQAAMEACkJxwAv48YALCPCADgAyAAvSfg/70nGACwryGAgAAcAL+vikAA +DBAApCclsAI8vwBCNAAAQ5AAAAAABABjLAUAYBACgAU8kFSjjJBUoiQNAGIQISAAApBUoiQEAEOM +AAACrgQAUKwAAHCsBAADrpBAAAwQAKQnHAC/jxgAsI8IAOADIAC9J/UJAAwAAAAAkEAADBAApCcc +AL+PGACwjwgA4AMgAL0n2P+9JxgAsK8hgIAAAoAEPAjnhCQkAL+vIACyrxNYAAwcALGvAAAElgAA +AAAgAIMkBwBiMGoAQBDCEAMAKACCJMIQAgBTIQAMwCACAGgAQBAhiEAAAoASPAIABpJgG1AmEDgF +jggAxiQKAAQkcgEADCE4QACwGwOWAAAAAAABYjBnAEAUAQBiMAKAAjxL9UOQYBtQJhAApCcCgAI8 +6DkArgQ6AK78QACuvEAArsZAAKKKQAAMxlxDoKNqAAwAAAAAh2sADAAAAACQQAAMEACkJwKAAjzS +XEiQJbAEPC8AAjzQAYU0FzJCNAAAoqxeAAM8EAACPNwBhzTUAYY0F0NjNCBTQjTYAYQ0AADDrAAA +gqxEpAM0AQACJAAA46xSAAIR//cDJPwjAo7/7wQkJBBDACQQRAD8IwKuYBtCjt//AyT7/wQkJBBD +ACQQRAD+/wMkJBBDAFAMBCRgG1AmMFwADGAbQq44PgKiMFwADFgMBCQ5PgKiUAwEJBpcAAwXAAUk +FwAFJBpcAAxYDAQkWwEADAoABCQIACKWAoAFPAKABDwlKEUAdAMGJPRUAAywVYQkdCEADCEgIAKY +OgKOSUsADMQ9AqIkAL+PIACyjxwAsY8YALCPIRAAAAgA4AMoAL0nUyEADMAgAgCa/0AUIYhAAAKA +BDwCgAU8GOeEJBNYAAz85qUkJAC/jyAAso8cALGPGACwjyEQAAAIAOADKAC9JyAAQBQAAAAAh1QA +DAAAAAAlsAU8TACiNAAAQKBIAKU0sBsDlgAApIx7/wI8//9CNCQgggD//mMwsBsDpgAApKxfCgAI +AoACPAKAAjzTXESQAgADJAYAgxD/9wMk/CMCjgAAAAAkEEMAiQoACAAQQjT8IwKO/+8DJAAIQjSJ +CgAIJBBDAAKABDy0VYQkHE8ADAMABSTGCgAIAAAAAOj/vScQAL+vAACEkAKABjwBAAIk/wCDMAwA +YhBgG8UkBAACJBMAYhBgG8Ikxj1FkAKABDwTWAAMJOeEJBAAv48hEAAACADgAxgAvSfGPaSgYBvC +JMY9RZACgAQ8E1gADCTnhCQQAL+PIRAAAAgA4AMYAL0nYBvDJLAbYpTGPWSgAoAEPAQAQjSwG2Kk +YBvCJMY9RZATWAAMJOeEJBAAv48hEAAACADgAxgAvSfQ/70nIACyrwKAEjwkALOvHACxrywAv68o +ALSvGACwr2AbUSawGyKWAAAAAAAwQjAKAEAQIZiAACwAv48oALSPJACzjyAAso8cALGPGACwjyEQ +AAAIAOADMAC9JxAApCeKQAAMAoAUPO5dgpIAAAAADwBCMAQAQiiJAEAUAAAAAJBAAAwQAKQnYBtC +jt//AyT7/wQkJBBDACQQRAD+/wMkJBBDAFAMBCQwXAAMYBtCrjg+IqIwXAAMWAwEJDk+IqJQDAQk +GlwADBcABSQXAAUkGlwADFgMBCSwGyKWAoAEPDTnhCQAEEI0E1gADLAbIqYBAAIkJbADPAQ+Iq5M +AGM0sBsilgAAZpAIAGWOxD0nksU9KJI7QSmS0D0qkv89K5IAgEIwNz4mogw+Ja4QAKQnAABgoDE+ +J6IyPiiiND4ipjY+KaLEPSqixT0rojw+IK5APiCuikAADDM+IKIQAKQnkEAADFJBIKIhIAAAlQ4A +DCEoAAAIAGaOAAAAAD4AwBQMAHAmAABijiEgIAJEPiMmCD4irj8AAiT//0IkAABgoP3/QQQHAGMk +sBuDlAAAAAAAAWIwCQBAEGAbUCYBAGIwBgBAEAAAAADuXYKSDAADJA8AQjA3AEMQAAAAAMQ9BJJ1 +DQAMAAAAAMQ9BJI4DQAMAQAFJCWwBDxIAIQ0AACDjAg+BY57/wI8//9CNCQYYgABAAIkAACDrAwA +ohBgG0MmPAACJJQ5YqwsAL+PKAC0jyQAs48gALKPHACxjxgAsI8hEAAACADgAzAAvSfEPQKSAAAA +AAwAQizx/0AQAAAAABJJAAwAAAAAYBtDJjwAAiSgCwAIlDlirAKABDwhKAAC9FQADHBZhCQCgAQ8 +ROeEJBNYAAwhKAACdwsACAAAAAAEAAQkSy4ADAEABSQ2CwAIAAAAAA5RAAwBAAQkjQsACGAbUCbo +/70nEACwrxQAv68hgIAAAAACkgKABDwhKEAABABCLAYAQBRQ54QkFAC/jxAAsI8hEAAACADgAxgA +vScTWAAMAAAAAAAAA5IUAL+PEACwjwKAAjyEW0OsGAC9JwgA4AMhEAAAAIADPCWwAjzQ/70nGANC +NIAvYyQkALOvKAC/ryAAsq8cALGvGACwrwAAQ6wCgAQ87F2CkAAAAAASAEAQAoATPAKAAjwGXkOQ +AAAAAGMAYBQBAAQkAoACPA9eRKACgAM87V1kkAEABSRLLgAM/wCEMAKAAjyYVEOMmFRCJKIAYhAC +gBM8lkAADAAAAAAqsAI8NgBCNAAAQ5BgG2Ym9DjFjMAYAwAjsAQ88AdjMP8fAjwhGGQA//9CNCQg +YgAjiIUAAAQiJisohQCYOMOMC4hFAOEBIi6UOMOs+DjErJ44wKQUAEAUnTjAoCD+giQgAoMkChhF +ACMQAjz/A0I0KxBDACEoYAAyAEAU9DjDrPg4wowAAAAAKxhFACOIRQADAGAQ4QEiLgAEMSbhASIu +DgBAEGAbcCZgG3Am+DgDjvQ4BI4AAAAAKxCDACwAQBQrEGQAVgBAFCWwAjyAAAMk0ANCNAAAQ6xg +G3Am9DgDliqwAjw1AEI0wogDAAAAUaBzIwB0AAAAAJ44A5YlsAI8sANCNAAAQ6ybQAAMAAAAANAb +Ao6AAAM8QbAEPCUQQwAAAIKsKAC/j9AbAq4kALOPIACyjxwAsY8YALCPCADgAzAAvScA/KUkIwwA +CPQ4xawkLQAMAAAAAKL/QBAAAAAA4iwADAAAAAD9CwAIAoACPJQ4BY4hMIAA//8nMgkABCQeAQAM +EACgr5Q4A46eOAWW9DgCjiEYcQAhKCUCIRBRAAkABCT0OAKulDgDrlsBAAyeOAWmYBtwJvQ4A5Yq +sAI8NQBCNMKIAwAAAFGgcyMAdAAAAACeOAOWJbACPLADQjQAAEOsm0AADAAAAADQGwKOgAADPEGw +BDwlEEMAAACCrCgAv4/QGwKuJACzjyAAso8cALGPGACwjwgA4AMwAL0n/DgCjpQ4BY4hMIAAI4hE +AP//JzIJAAQkHgEADBAAoK+UOAOOnjgClvg4EpYhGHEAIRAiAiMQETyUOAOunjgCphUAQBb0OBGu +CQAEJFsBAAxgG3AmcQwACAAAAAAkLQAMAAAAAFz/QBBgG2MmKhxikAAAAABY/0AQAAAAAEw6ZJQq +HGCgAMCEJKMxAAz//4QwAQwACAAAAABbAQAMCQAEJJQ4BY4JAAQkIxAGPCE4QAIeAQAMEACgr5Q4 +A46eOAKWISBRAiEYcgAhEEIC9DgErgkABCSUOAOungwACJ44AqYIAOADCQACJP8AhjACgAI8QADD +LEr1R5AAAGM4PwACJAowQwABAAIkCA4EJAB/BSQDAOIQMQDDLMFDAAgAAAAAMAACJMFDAAgKMEMA +wP+9JwKAAzw4ALSvNACzrzAAsq8sALGvKACwr6TnYiQ8AL+vCgBKlAIASJQGAEmU/wCEMP8ApTCk +52uUBABMlAgATZQAHAUAABQEAAA+BQAANgQAJTjjACUwwgAARAgAABIFAABMCQAAVAoAABoEACU4 +4gAlQAsBJUgsASVQTQElMMMAAoACPBAAqK8UAKmvGACqryWY5QAlkMQAYBtUJCGAAAAQALEnAgAC +LjIAQBCAEBAAIRBUAPAcQ4wAAAAAIUBzACE4AAB/AAkkwCAHAAQQiQAkEEgABhCCAAEA5ST/AEMw +ITAnAkAAYyz/AKcwAgBgFAQA5Cw/AAIk8/+AFBAAwqAjAKaTIgCikyEApZNAGBAAABQCACEYcQAg +AKeTADYGACUwwgAAKgUAAABklCUwxQB/fwU8JTDHAMFDAAx/f6U0AQACJv8AUDAGAAMu1f9gFAAA +AAA8AL+POAC0jzQAs48wALKPLACxjygAsI8IAOADQAC9JyEQVADwHEOMBw0ACCFAcgDY/70nFACx +ryAAv68cALOvGACyrxAAsK8CgAI8xlxDkAKABzxgG+Ik/wCRMCEgIgIgAGIwEABjMGMdk5AnAGAQ +AAAAAI0dgpB/HYOQAAAAACMQQwAANgIAAzYGAP8AcDBgG+ckIUAnArcdApGwG+OEDwAFPA8AQjAh +EFAADAgEJA8AxjAA/6U0BgBgBP8AUjDFHQKRAAAAAA8AQjAhEFAA/wBQMMFDAAwAAAAAxQwADCEg +YAIhIAACIShAAiEwIAIgAL+PHACzjxgAso8UALGPEACwj9YMAAgoAL0n4P9AEAAAAACpHYKQmx2D +kE0NAAgjEEMA4P+9JxAAsK8CgAI8GAC/rxQAsa/RXEOQAQACJAkAYhD/AJAwITAAAhgAv48UALGP +EACwjxgABCT/AwUkg0UACCAAvScPAAU8//+lNBUABCQKAAMS9KgGNA8ABTwLAAIk//+lNAUAAhL1 ++AY0DwAFPPT4BjQVAAQk//+lNINFAAwPABE8AoACPEj1RpD+AAMkFQAEJOP/wxT//yU2rEUADAAA +AAD/AEYwAP8jNiQQQwABAMYkJTBGAP//JTaDRQAMFQAEJH8NAAghMAAC/ACEMIAAAiQRAIIQBgAD +JIEAgigQAEAQsAACJCAAAiQLAIIQAgADJCEAgigVAEAQQAACJAYAgBAhGAAAAQADJBAAAiQCAIIQ +AAAAAA0AAyQIAOADIRBgAP3/ghAJAAMksQCCKA8AQBDIAAIkkAACJPf/ghAHAAMkCAADJLkNAAig +AAIk8v+CEAQAAyRBAIIoDwBAEAAAAAADAAMkuQ0ACDAAAiTq/4IQDAADJMkAgigEAEAQAAAAAAoA +AyS5DQAIwAACJAsAAyS5DQAI0AACJAUAAyS5DQAIUAACJND/vScsAL+vKAC0ryQAs68gALKvHACx +rxgAsK8IAIOMJbACPLADQjQAAEOsCACQlAKAAjwhkIAAJYACAv8AtDAhIAAC/wDRMCEoAAAIAAYk +7FQADP8A8zAEAAaOCAAFjv/fAjz/4AMk//9CNCQwwwAkKKIAP/8CPBAACI7//0I0ABLGNABAAzwk +MMIABQAHJAQAAiQLOFQAJSijAAEAhDJ//wMkAIACPBQACY4kKKMAwCEEACVAAgEDADEy/+ACPICN +EQAlKKQA//9CNAwASo4lMNEA/4EDJOD/BCQkKKIAPwBzMvv/AjwkSCMBJDDEAAAeBwBAmhMA//9C +NCRAAgElSDMBJSijACUwxwAgAAIkCAAFrgAACqYCAAKiEAAIrhQACa4EAAauikAADBAApCcCgAI8 +mFRCJAQAQ4wAAEKuBABSrAAAcqwEAEOukEAADBAApCcsAL+PKAC0jyQAs48gALKPHACxjxgAsI8I +AOADMAC9J9j/vScYALCv//+QMBAApCcgALKvHACxryQAv6//ALEwikAADP8A0jAAgAI0IAACEiEg +IAJ1DQAMAAAAACWwAzwDAmM0AABikAAIBCQBAAUkBABCNAAAYqA1RQAMITAAAAAJBCQBAAUkNUUA +DCEwAACECAQk//8FJDVFAAxYAAYkGAAEJAAMBSSDRQAMAQAGJJBAAAwQAKQnJAC/jyAAso8cALGP +GACwjwgA4AMoAL0nAQACJAIAQhICACQm/v8kJnUNAAwAAAAAJbAHPAMC5zQAAOOQ+/8CJAAIBCQk +GGIAAADjoAEABSQ1RQAMAQAGJAMAUDIACQQkAQAFJDVFAAwBAAYkQjAQAAAKBCQ1RQAMEAAFJCEw +AAIADQQkNUUADAAMBSSECAQk//8FJDVFAAwYAAYkGAAEJAAMBSSDRQAMITAAAJBAAAwQAKQnJAC/ +jyAAso8cALGPGACwjwgA4AMoAL0n0P+9JyQAs68CgBM8IACyrxgAsK9gG3Im//+QMBAApCccALGv +KAC/r4pAAAz/ALEwsBtClhAApCcAgEIwEQBQECEwIALEPUWSPA4ADCEgAAIAgAI0FAACEgCAAiSw +G0KWO0FRov9/QjCwG0KmYBtiJrAbRZTEPUSQOA0ADAAQpTAQAKQnkEAADAAAAAAoAL+PJACzjyAA +so8cALGPGACwjwgA4AMwAL0nsBtDljtBUaIlGGIAsA4ACLAbQ6bg/70nEACwryGAgAAUALGvGAC/ +r1MhAAwoAAQkAoAEPCGIQAAhKAACBgAGJBUAQBCs6IQkCABElAgAAiQMACKuAoACPAwAAyQlIIIA +FAAjrvRUAAwgAIQkFwoADCEgIAICgAQ8E1gADATphCQhEAAAGAC/jxQAsY8QALCPCADgAyAAvScC +gAU8E1gADOzopSTgDgAI//8CJNj/vSccALOvIZiAACwABCQYALKvFACxryGQoAAgAL+vUyEADBAA +sK8CgAQ8AoAFPCGIQAAo6YQkITBAAhkAQBAQ6aUkBQBlkhNYAAwAAAAACAAwlgKAAjwLAAMkJYAC +AiAAECYMAAIkISAAAgwAIq4UACOuIShgAvRUAAwGAAYkCAASriEgIAIgAL+PHACzjxgAso8UALGP +EACwjxcKAAgoAL0nAoAEPCAAv48cALOPGACyjxQAsY8QALCPrOiEJBNYAAgoAL0n4P+9JxQAsa8Y +AL+vEACwrwKAAjzuXUOQAoARPAQABCQPAGMwBABjKDoAYBQBAAUkQN8jjg8ABTwCgAI8//+lNCQA +BCRgAAYkEgBgFGAbUCSDRQAMAAAAAEhBBZLQBwIkAQADJAoQBQA8OgKuAoACPO1dRJBA3yOuGAC/ +jxQAsY8QALCPAQAFJP8AhDBLLgAIIAC9Jw8ABTz//6U0rEUADCQABCRJQQSS/wBDMAAsAwAKAGQQ +SkECogKAAjxJ9USQAAAAAAAiBAASJwB0JSCkAEpBA5IAAAAASUEDokhBA5IQJwIkQN8grgoQAwA8 +OgKuAoACPO1dRJAYAL+PFACxjxAAsI8BAAUk/wCEMEsuAAggAL0nSy4ADAAAAAAoDwAIAAAAAMj/ +vScYALKvEACwrzQAv68wAL6vLAC3rygAtq8kALWvIAC0rxwAs68UALGvIYCAAEUAoBQhkAAACACC +kAKAEzxgG2MmDwBCMMBAYqwlsAI8CgAQJtABVzQCgBQ82AFeNNwBVTTUAVY0AwARJAAABpJgG2Im +uEBHkA8AwzABAAWSGABnAAMABJICAAKSDwCnMAA6BwACKQUAACIEACUgggAAKwUAQhEGAAAkBAAD +AEkwAjEGAAEAAiQBAMYwEhgAAAoAYyT/AGMwJRhnACUYZQAwACIRJThkAAIAIik+AEAUAgACJDgA +IhEDAAIkQAAiEQAAAAAhKCABZOmEJhNYAAz//zEm2f8hBgQAECYlsAI85wFCNAAAUqA0AL+PMAC+ +jywAt48oALaPJAC1jyAAtI8cALOPGACyjxQAsY8QALCPCADgAzgAvScCgBM8CACDkGAbYibAQESM +DwBjMLv/gxQAAAAANAC/jzAAvo8sALePKAC2jyQAtY8gALSPHACzjxgAso8UALGPEACwjwgA4AM4 +AL0nAACnriEgAAAlsAg8BxCSAAEAQjABAIQkAgBAEAMAhSzQAQet+f+gFAQACCWjDwAIISggAQ0A +wBAAAAAAog8ACAIAUjbH/yAVISggAQ0AwBAAAAAAow8ACAQAUjYGAMAQAAAAAKIPAAgBAFI2AADH +rqMPAAghKCABAADnrqMPAAghKCABAADHr6MPAAghKCABuP+9JyQAsa8hiIAAAAEEJCwAs69EAL+v +QAC+rzwAt684ALavNAC1rzAAtK8oALKvUyEADCAAsK+sAEAQIZhAAAgAUJQCgAI8ISggAiWAAgIk +AAQmIAAApvRUAAwGAAYkAoAFPCoABCZIN6Uk9FQADAYABiQCgAU8tFWlJAYABiT0VAAMMAAEJiAA +A5YCgAI8YBtUJAP/YzBQAGM0IAADpuQdgpYCgAM8sFVjJHQAciT/D0MwABkDAAEAQiQCIgMA5B2C +piAAESYgAAIkFgAjohcAJKIhIEAC+1EADAwAYq5AABEmISAgAiEoQAD0VAAMAgAGJAwAY44hIEAC +QgARJgIAYyQWUgAMDABjriEoQAAhICAC9FQADAIABiQMAGOOAoACPLBVQiQCAGMkDABjrgwARoxE +AAQmDAB2JmAAUCQhKAAAEABHJCVSAAwQALavISAAAhtTAAwhiEAACQBDLAgABiQhICACCzBDACE4 +AAIBAAUkGACjryG4QAAlUgAMEAC2ryEgQAACgAI8sFVCJAMABSQBAAYkSABHJCVSAAwQALavIYhA +AMA6go4MABAkKxACAjoAQBACgAI8JlZeJGgQAAghqIACIRASAgEAQ5DAOqSOIRhwAAIAcCQrIAQC +LwCAEAAAAAAhEBICAABHkAKAFDwtAAMkISgeAmRchCbx/+MUIAAGJPRUAAwAAAAABEGjlgKAAjzG +XEeQvf9jMAKABTwCgAI8DABjNAEA5zBE36UkZ1xEJBAABiQGAOAUBEGjpgKABTwCgAM8VN+lJGdc +ZCQQAAYk9FQADAAAAAAhEBICAQBGkCEgIAJkXIcmLQAFJCVSAAwQALavIYhAACEQEgIBAEOQwDqk +jiEYcAACAHAkKyAEAtT/gBQhEBICGACijwAAAAAgAEAQISBgAkQAv49AAL6PPAC3jzgAto80ALWP +MAC0jywAs48oALKPJACxjyAAsI8BAAUkITAAACE4AADfDQAISAC9JwKABDwCgAU8RAC/j0AAvo88 +ALePOAC2jzQAtY8wALSPLACzjygAso8kALGPIACwj1jphCSs6aUkE1gACEgAvScCgAM8sFVjJCEg +IAL4/+YmaABnJDIABSQlUgAMEAC2ryEgYAJEAL+PQAC+jzwAt484ALaPNAC1jzAAtI8sALOPKACy +jyQAsY8gALCPAQAFJCEwAAAhOAAA3w0ACEgAvSfY/70nHACxrxgAsK8gAL+vAgCCkAKAAzwQN2WU +DwBCMAAAg4zAEAIAISBEAAAQqDACgAI8AAilMLBVUST/P2MwBgCgEBgAkCTo/2ckMACEJCEoAAAH +AAAREACmJyAAv48cALGPGACwjyEQAAAIAOADKAC9J6saAAwAAAAA9/9AEAAAAAACAEQkEACijwAA +AAAGAEAQEAAlJgwAJo4dVQAMAAAAAO3/QBQAAAAAJlMADCEgAALuDwAMISBAAOgQAAgAAAAAoP+9 +J1gAvq9cAL+vVAC3r1AAtq9MALWvSAC0r0QAs69AALKvPACxrzgAsK8AAIKMAAAAAP8/RjDo/8Uk +AQOiLBYAQBQh8IAAAoADPGAbYyRAPmKMAoAEPNDphCQBAEIkQD5irBNYAAwAAAAAXAC/j1gAvo9U +ALePUAC2j0wAtY9IALSPRACzj0AAso88ALGPOACwjwgA4ANgAL0nfADEJFwAxiRTIQAMJACmr3QA +QBAgAKKvIACjjyQApo8hKAAACABilAKAAzwlEEMAIABXJONUAAwhIOACAoADPOjpYiTo6WeQAQBE +kAIAw5MCAEWQAwBGkAKAAjxgG1AkAADCjwAiBAAPAGMwJSCHAAAsBQDAGAMAS0EHkiEYfgAlKKQA +/z9CMAA2BgAlMMUAMACiryIAZCQYAGIkEACmrywApK8oAKKvUwDgFCgAdiQCgAI8AoADPGAbVCSl +WXMkIZAAAAEAFSRkEQAIIYAAAB1VAAwBAFImBwAQJjIAQBBAAEMqDABgEAAAAAAhiBQCRD4ikiEg +EwIhKMAC9P9VEAYABiQhIBMCISjAAvRUAAwGAAYkRD41ojAApI90APQmgADzJlwAgyTo/4IkHACi +rwAA464oAKOPHACijyEggAIYAGUkITBAAPRUAAxwAOKucADnjiEgYAIhKAAA9P/nJKsaAAwcAKYn +DwBAECGAQAACgAQ8YBuRJAw+Jo4AAAAAMgDAGAAAAAAcAKKPAAAAACkAwhACgAQ8wBASACMQUgAh +EFEARD5AoCAApI90IQAMAAAAAFwAv49YAL6PVAC3j1AAto9MALWPSAC0j0QAs49AALKPPACxjzgA +sI8IAOADYAC9JwKABDwCgAU8rOiEJBsRAAi86aUkAoAEPKxchCQhKMACHVUADAYABiSo/0AUAAAA +AIpAAAwYAKQnUkECkhgApCcBAEIkkEAADFJBAqJWEQAIAoACPHBZhCQdVQAMAgAFJtX/QBTAEBIA +AQAGkgAAAABpAMAUEADkJgwA4K4CAMKXAAAAAA8AQjAEAEIoXgBAECEgwAM0AOCuYADxJiEgIAIh +KAAA41QADBAABiRwAOeOISBgAgEABST0/+ckqxoADBwApicGAEAQIZAAABwApo8CAEUk9FQADCEg +IAIcALKPcADnjiEgYAIyAAUk9P/nJKsaAAwcAKYnBQBAECEg8gIcAKaPYACEJPRUAAwCAEUkHACl +jyEgIAJhUwAMISiyACEYQAABAAIkQABiEAMAAiQ4AOKucADnjiEgYAIDAAUk9P/nJKsaAAwcAKYn +SADgrgQAQBA8AOCuAgBCkAAAAABIAOKu+1EADCEggAIhKEAAQADkJvRUAAwCAAYkGFIADCEg4AL/ +/1AwAQACMhoAQBAhKMACAQACJFwA4q4sAKWPBADkJvRUAAwGAAYkEAACMhMAQBABAAIkMADirgKA +AzxEAOCuYBtiJDw+Q4wgAKSPAQBjJDw+Q6wkAKOPCAACJAwAg6wgAKOPFwoADBQAYqwdEQAIAAAA +AAoSAAhcAOCuERIACDAA4K7jFwAMGADFJ8gRAAg0AOKu9FQADAIABSYBAAOSwREACAwA467vEQAI +OADjrgKAAjxgG0Qk/ECDjAAAAAANAGAQAQAFJLZAgpAAAAAACABCLAcAQBAhKAAAxz2DkAEAAiQD +AGIQAAAAAAgA4AMhEKAAAQAFJAgA4AMhEKAAAoAEPGAbgiREQUWMQEFGjCEgQABAGAUAQBAGACsY +ZgArOEUABABgFCEoAAABAAUkAgACJAooRwAhEKAAQEGArAgA4ANEQYCs6P+9JxAAsK8UAL+vQxIA +DAAAAAAhgEAAAoACPM5cQ5AAAAAAEgBgEAAAAAAvEgAMAAAAAAEAAyQNAEMQAoACPBZcRJACgAI8 +1N1CJEAYBAAhGGQAIRhwAIAYAwAhGGIAAABkjCWwAjzYAUI0AABErBQAv48QALCPCADgAxgAvSfo +/70nEACwrxQAv68hgIAAAgCEkAKABTxIN6UkDwCEMMAgBAAhIJAAHACEJB1VAAwGAAYkBgBAFAKA +AjwQN0OUAAAAAAAQYzAGAGAUISAAAhQAv48QALCPIRAAAAgA4AMYAL0nAhEADAAAAAAUAL+PEACw +jyEQAAAIAOADGAC9JwCAAzwlsAI84P+9J1RKYyQYA0I0GACwrxwAv68AAEOsAgCCkAKABTy0VaUk +DwBCMMAQAgAhEEQAKABEJAYABiQdVQAMGABQJAYAQBAhIAACHAC/jxgAsI8hEAAACADgAyAAvSc5 +UwAMAAAAAAKABDxIN4QkIShAAB1VAAwGAAYk8/9AFAAAAAAYAAKSAAAAABAAQjDu/0AQEACkJ4pA +AAwAAAAAAoACPOxdQ5AFAAIk/wBjMAUAYhACgAI8kEAADBAApCepEgAIAAAAABA3Q5QCgAQ8AAFj +MPj/YBABAAUkB16DkPv/AiQkGGIAB16DoAKAAjztXUSQSy4ADP8AhDCQQAAMEACkJ6kSAAgAAAAA +2P+9JygApKMAAQQkGACyryQAv68gALSvHACzrxQAsa8QALCvLAClo1MhAAwwAKanpABAECGQQAAw +AKeXKAClkywAppMCgAQ8E1gADLDqhCQIAFCWAoACPAKAETwlgAICtFUxJiEoIAIkAAQmBgAGJPRU +AAwgAACmAoAFPEg3pSQqAAQm9FQADAYABiQhKCACMAAEJvRUAAwGAAYkIAADlhgAAiQCgBQ8A/9j +MNAAYzQgAAOmYBuTJgwAQq7kHWKWIAAFJgwAUSb/D0MwABkDAAIiAwABAEIk5B1ipigApicWAKOg +FwCkoCE4IAI4AAQmTFIADAEABSQhIEAAAQAFJCwApidMUgAMITggAigAo5MhIEAAAwACJBIAYhAA +AAAAYBuCJrZAQ5AEAAckISBAAgEAYzgLOAMAISgAAN8NAAwhMAAAJAC/jyAAtI8cALOPGACyjxQA +sY8QALCPCADgAygAvScsAKOTAAAAADYAYBQBAAIkxUBjkiGAYAIBAGgk/wACMf3/QBAhGAABAoAG +PCE4IALFQAiiJVzGJExSAAwBAAUkyEAIjjAApJfD/wMkAgAINQ8AhDAkQAMBgCAEAP//Azw/AGM0 +JUAEASRAAwEACAg1AoAGPCE4IALIQAiuKFzGJCEgQABMUgAMAgAFJAKABjwhOCACKlzGJCEgQAAC +AAUkTFIADMpAAKYwAKOXISBAAAKABjwHAGMwQBgDACEYcADUHWKULFzGJCE4IAIAEQIAAgAFJExS +AAzMQAKmIhMACGAbgia1/2IUAoAGPCE4IAIkXMYkTFIADAEABSQhIEAAMACmJyE4IAJMUgAMAgAF +JMhAaI7//wM8PwBjNCRAAwEACAg1AoAGPCE4IAIhIEAAKFzGJAIABSRMUgAMyEBorgKABjwhIEAA +KlzGJCE4IAJMUgAMAgAFJCITAAhgG4ImAoAEPAKABTys6IQkE1gADKDqpSQkAL+PIAC0jxwAs48Y +ALKPFACxjxAAsI8IAOADKAC9J+D/vScYAL+vFACxrxAAsK8AAIKQAoARPCGAgABgGzEmAoAEPAIA +BiQBAAUmKFyEJPRUAAzEQCKiBAADkgMAApIAGgMAJRhiAMpAI6YGAAKSBQADkgASAgAlEEMAzEAi +pgEABZIGAASSBQACkoIoBQAAIgQAJSCCAGpIAAwPAKUwGAC/jxQAsY8QALCPAwAEJAEABSQhMAAA +2RIACCAAvScAgAM8JbACPOD/vScYA0I0/E5jJBQAsa8QALCvHAC/rxgAsq8AAEOsAgCCkAKABTy0 +VaUkDwBCMMAQAgAhiEQAKAAkJgYABiQdVQAMGAAwJggAQBAAAAAAHAC/jxgAso8UALGPEACwjyEQ +AAAIAOADIAC9JzlTAAwhIAACAoAEPEg3hCQhKEAAHVUADAYABiTx/0AUAwACJDAAI5IAAAAA7f9i +FDAAJCYCgAc8YBvlJPxAoowAAAAA5/9AEAEABiQBAIOQAAAAABoAZhACAGIoLgBAFAIAAiTf/2IU +AAAAAAMAg5AAAAAACABiMAoAQBQCEQMAxkCjkAQQRgAnEAIAJBBDAMZAoqAFAIOQBACCkAAaAwAl +kGIAxkClkAKABDzM6oQkE1gADCEwQALVEwAIAAAAAAQAgpAFAIOQAwCEkAASAgCCGAMAJRBEABUA +QBQHAGQwxkCjkAQQhgAlEEMAxkCioGAb4iT4QEOQxkBFkAKABDwhGGIA3OqEJBNYAAzwQGCg1RMA +CAAAAACy/2AUAAAAAJcTAAwyACQm1RMACAAAAADGQKOQBBCGACcQAgAXFAAIJBBDALj/vSc4ALav +//+WMAABBCQ8ALevKACyr0AAv680ALWvMAC0rywAs68kALGvUyEADCAAsK8hkEAAgQBAECG4AAAC +gAQ8E1gADPjqhCQIAFCWAoACPAKAETwlgAICtFUxJiQABCYhKCACIAAApvRUAAwGAAYkAoAFPCoA +BCZIN6Uk9FQADAYABiQwAAQmISggAvRUAAwGAAYkIAADlhgAAiQCgBU8A/9jMLAAYzQgAAOmYBuo +JgwAQq7kHQKVIAAUJgwAUSb/D0MwABkDAAIiAwABAEIk5B0CpRcAhKIWAIOiIEAEjQMAAiQxAIIQ +OAAQJmAbsyYkQGKOISAAAgIABSQBAEI4AQBCLBgApichOCACTFIADBgAoqcgQGOOISBAAAIABSQY +AKYnITggAkxSAAwYAKOnISBAAAIABSQYAKYnITggAkxSAAwYALanIEBjjiGAQAADAAIkKABiEAAA +AABgG6ImtkBDkAQAByQhIEACAQBjOCEw4AILOAMA3w0ADCEoAABAAL+PPAC3jzgAto80ALWPMAC0 +jywAs48oALKPJACxjyAAsI8IAOADSAC9J7AbApUAAAAAQABCMM3/QBBgG7MmLEADjTBAAo0hIAAC +gB8DACUYQwAEAAUkAQBCJBwApichOCACMEACrUxSAAwcAKOvaRQACCGAQACwG2KWAAAAAEAAQjDW +/0AQYBuiJgKABzwhIAAClFvnJBAABSSAAAYkJVIADBAAsa8AAIOWAQAXJABAYzSFFAAIAACDpgKA +BDwCgAU8rOiEJBNYAAzs6qUkQAC/jzwAt484ALaPNAC1jzAAtI8sALOPKACyjyQAsY8gALCPCADg +A0gAvSew/70nOAC0rzQAs68wALKvLACxrygAsK9IAL+vRAC3r0AAtq88ALWvAgCCkAKAEjwhoIAA +DwBCMMAQAgAhgEQAKAARJrRVRSYhICACBgAGJB1VAAwYABMmnwBAECEgYAICgBU8YBuiJktBQ5AA +AAAAggBgEDwABCZgG7AmsBsDlgAAAAAAEGIwbQBAFBAAYjATAEAUEAB2JmAbsCawGwKWAAAAAAAB +QjCPAEAUIRgAAEgAv49EALePQAC2jzwAtY84ALSPNACzjzAAso8sALGPKACwjyEQYAAIAOADUAC9 +JyEgwAK0VUUmHVUADAYABiTp/0AUBwACJLZAAqLoOQCuAACEjgwAEiT/P4Iw6P9CJCoQQgKcAEAQ +IbgAAh8VAAghgHICGQADkv8/gjDo/0IkIRhyAAIAciQqEEICkwBAEGAbsCYhgHICGAADkt0AAiT0 +/2IUGgARJgKABTxk3qUkISAgAh1VAAwDAAYkVQFAEAKABTxg3qUkISAgAh1VAAwDAAYkTwFAEAKA +BTxU3qUkISAgAh1VAAwDAAYkRAFAEAKABTxQ3qUkISAgAh1VAAwDAAYkPgFAEAKABTxM3qUkISAg +Ah1VAAwDAAYkOAFAEAKABTxE3qUkISAgAh1VAAwDAAYkOwFAEAKABTxA3qUkISAgAh1VAAwDAAYk +UwFAEAKABTxI3qUkISAgAh1VAAwDAAYkRwFAEAKABTwhICACNN6lJB1VAAwEAAYkLwFAEAIAAiQA +AISOFhUACAAAAAACEQAMISCAAiEYAABIAL+PRAC3j0AAto88ALWPOAC0jzQAs48wALKPLACxjygA +sI8hEGAACADgA1AAvScAAIeOBwAFJP8/5zDc/+ckqxoADCAApid4/0AQIThAACAApY8AAAAABgCi +KHP/QBT9/6UkBQDkJOVLAAz/AKUwAoAEPKxchCQhKCAC9FQADAYABiTsFAAIYBuwJrkrAAwhKIAC +5hQACAKAFTy0VUUmEABkJh1VAAwGAAYk1P9AFCEYAAAhIIAC4xcADBgAhSYhIEAAjRcADAUABSSw +GwOWAAAAAAEAYjAMAEAUBABiMEsAQBRgG7Amt0ACkgAAAAABAEQk/wCDMBUAAiRdAGIQIRgAAPkU +AAi3QASiikAADCQApCfoHgOO7B4CjiQApCcBAGMkAQBCJOweAq6QQAAM6B4DrpoVAAhgG7AmYBuw +JrZAA5IHAAIkIQBiEAKABTwCgAQ8XOuEJBNYAAwAAAAAAoACPM5cRpABAAMkDwDDEGAbpCbVTgAM +AAAAAEgAv49EALePQAC2jzwAtY84ALSPNACzjzAAso8sALGPKACwjyEQYAAIAOADUAC9J7ZAg5AD +AAIkKgBiEAAAAAA9QYag1U4ADDxBgKC/FQAIAAAAAFzepSQhIMACHVUADAMABiQHAEAQAoAFPCEg +wAJY3qUkHVUADAMABiTV/0AUAAAAAAKABDxw64QkthUACLZAAKIKAHYmH1QADCEgwAIgABAkNwBQ +ECGIQACKQAAMJACkJ0AQEQAhEFEAYBukJgARAgAhEEQA+B1DjCQApCcBAGMkkEAADPgdQ6xgFQAI +IRgAADxBhqDVTgAMPUGAoL8VAAgAAAAAVRIADLdAAKICgAI80lxEkAIAAyRd/4MUIRgAAAAAh44k +AGQmKgAFJP8/5zDc/+ckqxoADCAApidU/0AQIRgAAAIARJAAAAAAAgCCMJUAQBBgG6UmAQCCMJIA +QBQCgAI801xEkAEAAySfAIMQAAAAAPwjAo7/7wMkAAhCNCQQQwD8IwKuYBUACCEYAAD//wQkx1MA +DCEowALG/1AQIYhAAAAAh44kAHcmISDgAv8/5zDc/+ckAQAFJKsaAAwgAKYny/5AECEYAAAgAKaP +AgBFJPRUAAwQAKQnAACHjiEg4AIyAAUk/z/nMNz/5yQgALCPqxoADCAApicIAEAQEACkJyAApo8h +IJAA9FQADAIARSQgAKOPAAAAACGAAwIQAKQnYVMADCEoAAIhKAACEACkJ6ZTAAwPAFMwAACHjiEg +4AItAAUk/z/nMNz/5yQgAKYnqxoADCGQQAARAEAQAIERAAYARJAFAEOQAoACPMZcRZAAGwMAACUE +ACUYZAAQAKUwJZBDAgIAoBQPAAI8/w8CPP//QjQkkEICCABzNgCBEQAlgBMC//8QMgKABDwhKCAC +ITAAAiE4QAITWAAMjOuEJCEgAAJjXgB0IShAAmAboyY6QWKQISDAAiEoIAIBAEIk6g4ADDpBYqDq +FQAIAAAAAAKABDwBAAIkoOuEJLYVAAi2QOKiAoAEPLjrhCS2FQAItkDgogKABDxgG6MmAwACJMzr +hCS2FQAItkBioB4AA5IAAAAACgBiFAKABDwgAAKSAAAAAAEAQjAFAEAQAoACPMjfQ4wAAAAAGgBg +FBEAAyQTWAAM4OuEJAUAAiS4FQAItkDiogKABDxgG6MmAgACJPjrhCS2FQAItkBioAKABDxgG6Mm +BAACJAzshCS2FQAItkBioPwjooz/7wMk//cEJCQQQwAkEEQAIRgAAGAVAAj8I6KsAoAEPAKAAjwg +7IQkE1gADMZcQ6BgG6MmBgACJLgVAAi2QGKg/CMCjv/3AyQkEEMAABBCNB4WAAj8IwKuCADgAwAA +AADo/70nEACwrwKAEDxgGwImFAC/r7AbQ5QhKAAAAAFiMAMAQBABAGQwBgCAFAAQYjAUAL+PEACw +jyEQoAAIAOADGAC9JwgAQBRgGwQmAoACPO5dQ5AMAAIkDwBjMAkAYhAhIAAAYBsEJmDqAzQEOoOs +FAC/jxAAsI8hEKAACADgAxgAvScOUQAMAAAAAGAbBCZg6gM02xYACAQ6g6zY/70nHACxrwKAETwY +ALCvIAC/r2AbMCYEPgKOABADPCQQQwASAEAQAAAAADM+A5IAAAAAAQBjJP8AYjAhEFAA0D1FkAAA +AAD/AKQwGACAEDM+A6L/PQKSxD0FonUNAAzFPQKixD0EkjgNAAwBAAUkCD4DjgEAAiRSAGIQAAAA +AGAbJSYEPqSMABACPDwAAyQmIIIAlDmjrAQ+pKwgAL+PHACxjxgAsI8IAOADKAC9J7AbApYAAAAA +/+9CMAABQzBJAGAUsBsCpjE+BpI3PgOSMj4FkiWwAjxMAEI0AABDoP8AxDDFPQWidQ0ADMQ9BqLE +PQSSOA0ADCEoAACwGwOWAAAAAAABYjAJAEAQAQBiMAgAQBBgGzAmAoACPO5dQ5AMAAIkDwBjMFgA +YhAAAAAAYBswJjQ+BJY2PgWSlQ4ADAAAAAARSAAMAAAAABAApCeKQAAMBD4ArrAbApYAAAAAAAFC +MCoAQBACgAI87F1DkAAAAAAnAGAQAoACPAKAAzzuXWKQAAAAAA8AQjAEAEIoOgBAFAQABCQCgAM8 +Dl5ikAAAAAAhAEAUAAAAAA5eYpAAAAAAAQBCJA5eYqByFwAIYBswJsQ9ApIAAAAADABCLKv/QBAA +AAAAEkkADAAAAAAHFwAIYBslJiWwBTxIAKU0AACjjGAbJI6EAAI8JRhiACUAhDQAAKOsGBcACGAb +JK4CgAI8Dl5AoAKAAzztXWSQAQAFJEsuAAz/AIQwYBswJpBAAAwQAKQnUkECkgAAAACW/0AUAAAA +AIpAAAwQAKQnAoAEPAKABTwsWYQkoN2lJDQABiT0VAAMS0EAopBAAAwQAKQnDRcACAAAAABLLgAM +AQAFJE0XAAgCgAM8DlEADCEgAAAzFwAIYBswJgKACTxgGyglbDcGjf//AjREAMIQITiAACsQxwA0 +AEAQAhkGACEQxwAjEEMAEABGJGw3Bq1wNwKtYBsmJQUAxJD//wI0/wCDMDMAYhAAEQcA/wCEMCsQ +hwAgAEAQAxkEAAMRBAAhGIcAIxhiABAAZCQFAMSgcDfDrMAQBQAhEEUAgBACACEQRQBgGyMlgBAC +ACEoQwD4JKaMACEHAP//wjgKMIIAKxjHAAcAYBAhEMcAAhkGACMQQwAQAEYk+CSmrAgA4AP8JKKs +AhkGACMQQwD4JKKsCADgA/wkoqwhEIcAIxBDAAUAwqCrFwAIcDfCrCEQxwAjEEMAbDcCrXA3Aq1g +GyYlBQDEkP//AjT/AIMwz/9iFAARBwAhIEAAoRcACAUAwqAAMQQAkxcACGw3Bq1jAIIkdwBCLAAA +hSgEAEAQIRgAAGQAgiRkAAMkCxhFAAgA4AMhEGAA6P+9JxAAv68MAIKMAAAAAD8AQjAEAEIoCABA +FCWwAjwAAKSMEAC/jxgAvSc/AIQwQCAEANkXAAiW/4QkJAhCNAAAQ4wAAAAAAAJjMBsAYBQBAAIk +BQCjkAAAAACCMQMAPADCEAIAwihXAEAUAgACJEYAwhADAAIkLgDCED4AYzDZFwAMISDgAAYARSRl +AKQsZAADJAooZADd/6IkCABCLB8AQBDl/6Ik/v+lJBAAv48hEKAACADgAxgAvScFAKOQAAAAAGAA +ZjBCMQYAJQDCEAIAwig2AEAUAgACJC8AwhADAAIk5v/CFB8AYjBAEAIA2P8DJCM4YgDZFwAMISDg +AAYARSRlAKQsZAADJAooZADd/6IkCABCLOP/QBTl/6IkCABCLAYAQBDx/6IkDhgACPr/pSTY/wIk +AxgACCM4QwAMAEIsDABAEPv/oiQOGAAI+P+lJD4AYzD+/wIkAxgACCM4QwAfAGIwQBACAP7/AyQh +GAAIIzhiAAoAQizL/0AQAAAAAA4YAAj8/6UkPgBjMOz/AiQDGAAIIzhDAB8AYjBAEAIA7P8DJCEY +AAgjOGIAs//AFB8AYjBAEAIADgADJCEYAAgjOGIArf/AFD4AYzAOAAIkAxgACCM4QwCY/70nZAC/ +r2AAvq9cALevWAC2r1QAta9QALSvTACzr0gAsq9EALGvQACwrwKAAjyIVEWMAIAEPGhhgySIVEQk +JbACPBgDQjQAAEOsgQCkEAKAAjzo7EIkAABejAKAAzzs7GMkAAB1jCg51o8huAAACADCjgAAAAAA +AKKuCADDlgKAAjyeGAAIJaBiABcAJZIWACaSyD3Cl/8AozAAGgMA/wDEMCUYZAAUAEMQ/wCiMP8A +wzAAEgIAJRBDAMg9wqcBACSSGABCkgAiBACoDQAMJSCCAEAYAgAhGGIAAoAEPJjegiSAGAMAIRhi +AAgAYowAAAAACfhAACEgYAIMAMKOAAAAACsQ4gJBAEAQAAAAAAAAgo4CgAM8SDdkJEIbAgB4AGMw +Ai4CAP8/QjAhEEMAAwClMCEQRQAYAEIk//9QMH8AAjIhmIACBgAGJIAAAyYAALCuAgBAEID/BTKA +/2UwAAClrgIAYpYhGOUC//93MA8AQjAAAKKuAABjjiGghQJCEwMAeABCMAIeAwADAGMwIRBTACGQ +QwAcAFAmGABRJiEoAAIAALGuHVUADAAAAAACgAM8ISgAAgYABiQLAEAUkN5kJAEAIpIAAAAAABIC +AAAIQjCt/0AUAAAAABYAJpIXACWShhgACP8AojAdVQAMAAAAAPP/QBAAAAAADADCjgAAAAArEOIC +wf9AFAAAAACKQAAMOACkJwQAw44AAMKOISDAAgAAYqwEAEOsAADWrnQhAAwEANaukEAADDgApCcC +gAI8iFRDjIhUQiSG/2IUAAAAAAKAAzzo7GMkAABxjCWwEDwEAQI2AABDjNw4J44AAAAAdwDjEOA4 +I64rEGcAgQBAFCsQ4wCpAEAUAoACPGAbRCSwOIOUAoACPCGAAAA0AOAaJZBiACGIgAAhGAAAAQAU +JADAFTwOGQAIAwAeJIAYEAAqEHcAKgBAEAAAAAAhmHIAAABijkRBI444AKQn/z9CMCEYYgCKQAAM +REEjrugeIo7wHiOOOACkJwEAQiQBAGMk6B4irpBAAAzwHiOu7CwADCEgYAIAAGOOAAAAAAIAYBQG +AAImAQACJv//UDCCFgMAAQBCMOH/VBQCgAQ8YBuCjAAAAABCEQIAAQBCMAwAVBDCEwMAHgBCMCEQ +UAD//1AwgBgQACoQdwDY/0AUAAAAAHQhAAwhIMACdRkACAKAAzwBACKSAAAAABkAQBQAAAAABABj +jgAAAAACFAMADwBCMBEAQBQCFwMAAwBEMAcAgBAkEHUADABAFAAAAAAKAJ4QAAAAAAgAgBAAAAAA +gCgQACEosgDjFwAMISBgAiEgQACNFwAMISgAAAEAIpIAAAAAewBUEAAAAAABACOSAgACJGMAYhAA +AAAAJbACPEwAQjQAAEOQAAAAAAMAYzAIAHQQ0AICJAAAY44AAAAAwhMDAB4AQjAhEFAAMxkACP// +UDBsNyKuAABjjmcZAAjCEwMAAAECNgAAR6wCgAI8YBtCJNw4R6wCgAM8CARkJCEoAAAhMAAAdjkA +DCE4AABmGAAIAoACPOQ4Io7//3MwIxBHAP//UjAhGFMC//93MFMhAAwhIOAC7/9AECGwQAAIAEKM +3DgmjiE4QAIhGFcArDgjriEoQAAIAAQksDgirh4BAAwQAKCvWwEADAgABCSwOCWOJBACPAABEDYA +AAKuIThgAiEosgAIAAQkJBAGPNw4Iq4eAQAMEACgr+A4I44IAAQkWwEADNw4I67cOCKOAAAAAAAA +Aq7+GAAIAoACPCMQZwD//1cwUyEADCEg4AJEAEAQIbBAAAgAQozcOCaOCAAEJCEYVwCsOCOuIShA +ACE44AKwOCKuHgEADBAAoK/gOCOOCAAEJFsBAAzcOCOu3DgjjgABAjYAAEOs/hgACAKAAjwEAGOO +AAAAAAIUAwAPAEIwCABCKJn/QBAlsAI8AhcDAAMAQjCU/0AUAAAAAIAoEAAhKLIA4xcADCEgYAIh +IEAAjRcADCEoAABeGQAIJbACPAQAY44AAAAAAhQDAA8AQjAIAEIoBgBAECQQdQACFwMAAwBCMAoA +QBCAKBAAJBB1AHn/QBQCFwMAAwBCMHb/XhAAAAAAdP9AEAAAAACAKBAAISiyAOMXAAwhIGACISBA +AI0XAAwFAAUkWRkACAAAAADgOCOOAAECNgAAQ6x0GQAI3Dgjrrj/vSclsAM8RAC/r0AAvq88ALev +OAC2rzQAta8wALSvLACzrygAsq8kALGvIACwr0QAYzQAAGKQAAAAAAAWAgADFgIADgBABBwAoK8h +IGAAIRAAAAEAQiT//0IwZABDLP3/YBQBAEIkAACCkAAAAAAAFgIAAxYCAPb/QQQhEAAAAoACPJhU +Q4wAgAY80GfCJCWwBTwCgAY8GAOkNJhU0SQAAIKsSwBxEAEAFSQREQI8KrADPCIiVzQCgAI8IbCA +AAYAfjQFAHM0YBtUJAEAEiQAANeuBQCgEgKAAzzsXWKQAAAAAEwAQBQhqAAAAADClzg5kI4lsAM8 +sANjNAD/QjAAAHCsDwBAGAKABjwCgAI88OzGJPTsQiQAAMWMAABEjAKABjz47MYkAADDjAAApKwA +AGKUAAAAAAD/QjD7/0AcAAAAAAwAA44AAAAABwBiMGAAQBQIAGIkwhADAAgABY74N4aOwBACACAA +QiT//0cwAQAEJB4BAAwQALKvWwEADAEABCQCAAIkGACkJwAAcqIAAGKiikAADAAAAAAAAAKOBAAD +jiEgAAIAAGKsBABDrAAAEK50IQAMBAAQrpBAAAwYAKQnAAAijgAAAADA/1EUAAAAABwAoo8AAAAA +BwBAEAKAAjwCgAM87F1ikAAAAAAtAEAUHACgrwKAAjwICEQkISgAACEwAAB2OQAMITgAABUaAAgC +gAI8m0AADAAAAAACgAY87l3CkAEAAyQPAEIwBABCKA8AQBQcAKOvAoAGPMZcwpAAAAAAAgBCMBIA +QBQAAAAAAAgEJAACBTzBQwAMAQAGJJZAAAwAAAAALxoACAAAAAAEAAQkSy4ADAEABSQCgAY8xlzC +kAAAAAACAEIw8P9AEAAAAACoLQAMAQAEJIoaAAgACAQkm0AADAAAAAACgAY87V3EkAEABSRLLgAM +/wCEMJZAAAwAAAAAcxoACAKAAjxLGgAIwhACABAA4BghGAAAAADArCFAAAAAAIKQAAAAAAwARRAh +GIAAAQCCkAAAAAAhGEgAAgBoJCEQggArGAcB9f9gFAIARCQhGAAACADgAyEQYAABAIKQAAAAAAAA +wqwIAOADIRBgAAKABzxgG+UkzkCjkP8AhDCAEAQADABgFCEwRQDIAAIkIDqirAEAAyRgG+IkBBiD +APhApKDOQESQAAAAACUYZAAIAOADzkBDoCA6o4zIAAIkIxBDANBAwqwBAAMkYBviJAQYgwDOQESQ +AAAAACUYZAAIAOADzkBDoOD/vScUALGvAoARPBAAsK8YAL+vYBslJvhAppABAAIkBBDCAAYAQBTJ +ABAkxkCikAAAAAABAEIwIwBAFCEgxQACgAI8YBtGJCEgAADQQMUkAACijAQApSQFAEAQKxhQAAMA +YBAAAAAAIYBAAPhAxKABAIQkCACCLPX/QBTJAAIkIQACEgKAAjxgG0UkBwAEJNBAooz//4QkAgBA +ECMYUADQQKOs+v+BBAQApSRgGyImIDpQrBgAv48UALGPEACwjwgA4AMgAL0n8ECDkAAAAAABAGMk +/wBiMAMAQizY/0AQ8ECDoIAYBgAhGGUAyAACJAMABCQhKAAA2RIADNBAYqzyGgAIAoACPGAbIiYY +AL+PFACxjxAAsI8gAL0nzkBAoAgA4AMgOkCsuP+9JwKACDwCgAs8AoAMPEAAv688ALWvOAC0rzQA +s68wALKvLACxrygAsK/k7mMl4O4CJejuhCUBAEWQAQBmkAEAh5Dg7g+RAgBKkOTubpECAGmQ6O6N +kQIAiJADAEuQAwBskAMAgpAAKgUAADIGAAA6BwAlKK8AJTDOACU47QAAVAoAAEwJAABECAAlUEUB +JUgmASVABwEAXgsAAGYMAAAWAgACgAQ8JVhqASVgiQElEEgAsFWEJBAAq68YAKyvGFIADCAAoq8Q +AEIwKQBAECEYAAACgBM8YBtjJsA6YowMABAkKxACAiwAQBACgAI8AoADPCRWUSQuVnIkAoACPAKA +AzwmVlQkfBsACDJWdSTdAAIkISAUAisAYhAQAKUnIRARAgEAQ5BgG2QmwDqCjCEYcAACAHAkKxAC +AhcAQBAAAAAAIRARAgAAQ5AwAAIkISASAiAApSft/2IUBAAGJB1VAAwAAAAA7v9AFCEQEQIBAAMk +QAC/jzwAtY84ALSPNACzjzAAso8sALGPKACwjyEQYAAIAOADSAC9J0AAv488ALWPOAC0jzQAs48w +ALKPLACxjygAsI8hGAAAIRBgAAgA4ANIAL0nHVUADAAAAAAhIBUCGAClJ9H/QBQEAAYkHVUADAAA +AADO/0AUIRARAogbAAgBAAMkAoADPGAbZSSwG6KUAAAAAAABQjQIAEAQcBcEJLZAopAAAAAA+/9C +JP8AQjACAEIsCgBAFAAAAAC0QKOUAAAAAIAYAwBwF2IoBABAFHAXBCQhTmIoIE4EJAsgYgAIAOAD +IRCAACE4gAAIAMAQ///DJP//BiQAAKKM//9jJAQApSQAAOKs+/9mFAQA5yQIAOADIRCAAMn3G2pL +6kAyQDIQ8ABrAPRgMwDzGEot9xlL+WNg2gBqDGIL0QrQB9LJ9xtqS+pAMSAxEPAAagD0QDIQ82hB +LfcZSkDbEPACawD0YDNj8wBLZvdIqwFKZvdIywAcm0AAZcDwRkFAqhFaEmEQ8AJsAPSANBDwAm0A +9KA1q/VQnMv1aJ1t6qv1UNwAasv1SN0AHJZAAGVw82BB4JsGJweS//cfbAFKjOoH0v9tAU2gNsAw +T0Dj6g1lgPAeYP9qAUpL6kA1oDXw8E9FYmcqZQDzAGpL6kA0gDRHROzrEUpK64DwF2Bj6qDwBGEB +9gBqS+pANaA1QUVK68DwBGBj6gDxCWEC8ABqS+pANIA0Q0RK60DxF2Bj6sDxGGGK6wDzEmBj7IDz +CGEE8ABqS+pAMkAyburg8xIiyfcbakvqQDJAMgBrYPMQSmDaB9PJ9xtoC+gAMAAwEPAAagD0QDIQ +82hALvAZSkDbEPACaAD0ADAAHJtA/2lj8wBIEBDJ9xttq+2gNaA1f01ATUClLOoEWg9gJ/GQmAAc +9QkAZRDwAmwA9IA0ivQQTAAcalgAZeYiEPACawD0YDPr9U6jD2v/bGzqAnILYRDwAm0A9KA16/VN +pYzqbOoBckD0AGAAHJZAAGUAbRDwAmwA9IA0AvAITMVnABx2OeVnGRcHlArwAFylYQBqQNsH0gFq +cPNkQUvqQNucFxDwAm0A9KA1DPAAamPzAE1L6mKdQDJAMv9KTOti3YIXoPBMRErrAPQXYGPqOWGg +8EJESusg9A1gY+rg8AJhR0QhSkrrQPQRYGPqwPEdYUdEEkpu6n/3BirJ9xtqS+pAMkAyAGtg8xBK +YNoAGBInh2dZF3DzREHgmgLwAGpAMkAy/0pM7+PuX/cNYArwAGpL6kAyQDJN73DzSEHAmsDfQhcA +8gBqS+pANsA2R0YLSkrrwPMXYGPqwPABYaDwT0RK6yD0FWBj6mDxGGGg8E1Ebupg9AkioPBORG7q +P/cDKh/3AGriNEzsTO+CNAAYO13iNcn3G2tr62AzYDNg8xRLQMMRFwHwAGpL6kA1oDVHRQ9KSuvA +8xpgY+qg8BlhAfQAakvqQDJAMkrrAPQGYGPq4PETYQH1AGpL6kAyQDJu6v/2ESof9wBq7OpCMAH3 +AGviMhDwAm0A9KA1bOpj8wBNQjYo8dvFIPMGJqPzUK0Q8ABra+sQ8ABsbeqj81DNHvAAakAyTO// +akzoAPXiMUzuABw8DrBnkGcAHDgNsWfJ9xtqS+pAMkAyYPMQSgBrYNq6Fh/3AGviMmzqQjLs6wbS +YjeA8wgiAXIBbAFgAGwAHPBCCdfJ9xtqS+pAMkAyCZdw8yRCwJkC8ABoADCHZ69AAByDRQnXCZev +QAAcrEWHZ0DZkRag8EVESutg8wZgY+oA8Q1hoPBDRG7qQPECIqDwRERu6n/2HyoQ8AJrAPRgM2Pz +AEv/9x9qJ/FE23QWR0YTSkrrgPAWYGPqAPEbYUdGEUpu6uDzBSJHRhJKbup/9gIqABybQABlyfcb +ahDwAmsA9GAzS+pj8wBLQDIj9GqjQDJg8xRKYNoAHJZAAGVLFkdESuuA8wNgY+oA8QxhR0UQSm7q +wPMRIkdFEUpu6j/2GioAHCsgAGU2FgH3AGpL6kA2wDZCRkrrP/YNYGPqgPEEYUdEAUpu6uDxASJD +Z87qP/YBKv9qAUpAMkAygEqASkzvEPACbAD0gDTiM2PzAEyj83rMyfcbbIvsgDSANJDwRERgypDw +qkQA9ABqQM2Q8KhEoGpAzcn3Gm2r7aA1BG6Q8EZEoDXAykdFc0rAwv/3H2pM63QzyEPITrDzQETA +2mDw3M1A8GSsAPIBakvqbOpA8ETMQPBkrADyAGpt6kDwRMzZFQ/3QEBM7+I3h2f/9x9trOwBdAbU +oPAYYAJUIPMTYQaSA3Lg8RlgyfcbahDwAmsA9GAzS+pj8wBLQDIj9GSrQDJg8xRKYNq1FUdGCUpu +6uDyFiJHRgpKbuq/9QsqABybQAnXEPACawD0YDMAamPzAEsj9ErD/2oBSkAyQDIJl4BKgEpM7+A0 +gjQAHKMxgjQAHJZAAGWOFaDwQERu6oDwGyKg8EFEbuqf9QQq4jQf9wBqTOwAGBEigjR8FaDwRkRu +6sDyGyKg8EdEbup/9RIqH/cAauIzTO/iNkzrAXZiNaDxF2GsMqniSDIQ8AJsAPSANKniyfcba2Pz +AExIMmvrieJgMwT1QJpgM2DzFEtA21EVR0UISm7qcSJHRQlKbupf9QgqH/cAakzvSu/f9gNgEPAC +awD0YDNj8wBLAGon8UTbOBVHRA1KbuppIkdEEEpu6j/1DyrJ9xtsi+yANIA0YPOoRGCd//cfamDz +BExM6x/3AGpM7+AybepA3WCk/2ps6kBrbepAxBUVEPACagD0QDJj8wBKI/RCqv/3H21w82RBrOpA +2wYVAUpu6qDwDSJHRQ5Kbur/9B0qAByuHwBl+RQP90BA7OpCNy3nwJtw80RBwNrAm+4UAfcAakzv +4jIBcgFsB2ACcgJsBGADcgNsAWAAbAAYkl0AZdwUyfcbakvqQDJAMkDxFkr/a2DKAWoQ8AJrAPRg +M+v0UMPLFA/3QEDs6t/0BiIQ8AJrAPRgM2PzAEsA80SbqWeIZ6zqjeoA80TbH/cAbOIyjOpCMgDz +XMOM7/tKAPNdw+IyAPNew/tKAPNfw6YUREZu6m0iQ2eu6p/0HyrJ9xtqS+pAM2AzcPNEQ+CaAvAA +akAyQDL/Skzv/2oBSkAy4+qf9AtgCvAAakvqQDJAMk3vwJ9w80hDwNqAFEFEbupeIkJEbup/9Bkq +H/cAa+IybOpCMuzrBtJiNyDyDCIBcgFsAWAAbAAc8EIJ1wmXAvAAaAAwr0AAHKxFh2f/SEzoyfcb +akvqQDJAMmDzFEoA2lUUyfcbahDwAmsA9GAzS+pj8wBLQDLE93yrQDJg8xRKYNpEFB/3AGrs6kI3 +h2cEJwF3AWwBYABsABzwQgBlNhQf9wBrR2ds6kIyBtLiMmzqQjYHXj/0CmAQ8AJrAPRgM8gyHfcU +S2niQJoA6gBlD/dAQOzqQjfJ9xtqS+pAMkAycPNkQsCbSefA2sCawNsOFB/3AGrs6kIy/3JxYcn3 +G2pL6kAyQDJg8wRKYKqIZ23sgMoQ8AJsAPSANAbwAGpj8wBMS+rg8mScQDJAMv9KTOvg8mTcH/cA +akzvGfQAd//zBWEQ8AJsAPSANAbwAGpj8wBMS+rg8mScQDJAMv9KTOsC8ABqQDJAMk3r4PJk3N/z +DRAQ8AJrAPRgM8n3G2pj8wBLS+oj9GarQDJAMv/3H2xg8xRKjOtg2r/zGBCj81Ct7/cfa4ZnbOrb +FAJ2J2GsMqniSDIQ8AJsAPSANKniyfcba2PzAExIMmvrieJgMwT1RJpgM2DzFEtA25/zFxCqKsn3 +G2tr62AzYDNg8wRLgKv/agJKS+qM6kDLixcDdp/zBWGsMqniSDKp4hDwAmsA9GAzyfcbbEgyaPAI +S4vsaeKANECagDRg8xRMQNx/8w4Q6/VNpQFtABxLLkzsv/MYEAAYhFyHZ3/zARAAHJtACdcJlw/3 +QED/9x9tTO/iMhDwAmsA9GAzrOpj8wBLI/RLwwAclkAAZV/zCRAP90BATO/iN4dn//cfbazsBtRw +8wRBoJgAGGNeAGXAmAaVEPACbAD0gDQ99xBMABwTWABlP/MNEAAc+h8AZT/zCBAGlHoU4jQf9wBq +TOwAGI9egjQf8x0QAvAAaAAwYG6vQAAcg0UkbODzCGwAHCwfAGUAHJtAAGUkbAAcrEWvQB9uTO4A +HJZACNYAHFsfZGwIlnDzREHAwv/yGxAAGHVdAGX/8hYQD/dAQEzv4jIBa6JnbO0Q8AJsAPSANEY2 +bO7b96jcSjcQ8AJsAPSANE4ybOps78v02cQQ8AJrAPRgMxDwAmwA9IA02/fk3GPzAEsQ8AJsAPSA +NMf1R8Nd9wxMABwTWATS3/IEEAAY7WCHZ7/yHxAAGJJch2e/8hoQABybQAnXEPACawD0YDNj8wBL +I/RKowmXX/QdKgFqI/RKww/3QEBM7+AyQjJCMiP0S8OCZwAcozEG0goVABiUXgBln/IXEN/0DywQ +8AJrAPRgM8n3G2pj8wBLS+oj9GCrQDJAMv/3H2xg8xRKjOvHFgAcm0AAZcn3G2oQ8AJrAPRgM0vq +Y/MAS0AyI/Rro0AyYPMUSmDaHxQAHFwgAGV/8gkQBpUQ8AJrAPRgM8n3G2ywMmPzAEuL7GnigDQg +81WigDRg8xRM5RYGk8n3G2yL7HAyEPACawD0YDNj8wBLaeKANCDzVKKANGDzFEzSFgaU1hUGk8n3 +G2yL7HAyEPACawD0YDNj8wBLaeKANCDzVqqANGDzFEy9FgaVEPACawD0YDPJ9xtssDJj8wBLi+xp +4oA0IPNSqoA0YPMUTKoWBpPJ9xtsi+xwMhDwAmsA9GAzY/MAS2nigDQg81CqgDRg8xRMlxYGlRDw +AmsA9GAzY/MAS7AyyfcbbGnii+wg80yagDSANGDzFExA9kIyghYGk8n3G2yL7HAyEPACawD0YDNj +8wBLaeIg80+igDSANAFrYPMUTGzqbRYAgAM8JbACPBgDQjSwfGMkAABDrAKABTzMXaWMBAACJB4A +ohAFAKIsEABAEAUAAiQDAAIkCACiEAAZBACAEAQAIRBEAMAQAgAjEEQAABECACEQRABAGQIA//9j +JP7/YBQAAAAACADgAwAAAADz/6IQBgACJPL/ohSAEAQAQBEEACMQRACAEAIAIRBEAAAZAgAjGGIA +Qh8ACAAZAwCAEAQAIRBEAMAQAgAjEEQAABECACEQRABCHwAIABkCAACAAzwlsAI8bH1jJBgDQjQA +AEOsAoAFPMxdo4wFAAIkBgBiEAYAYiwMAEAQBgACJAQAAiQOAGIQgBAEAIAQBAAhEEQAgBACAP// +QiT+/0AUAAAAAAgA4AMAAAAA9/9iFAARBAAjEEQAbR8ACEAQAgAhEEQAbR8ACEAQAgD//4UwITAA +ACWwAzwqsAQ8tABjNAEAoiQxAIQ0AABloAAAhaD//0UwEgCgEAEAAyQosAc8jx8ACP//CCQAAIOg +AQBjJP//YzArEKMACQBAFAgAxiT5/2UUISDHAAEAYyT//2MwKxCjAAAAiKD5/0AQCADGJAABoiwT +AEAQIRigAP8ACCQosAc8ox8ACP//CST//0MwAACioAABYiwKAEAQCADGJAEAYiT5/2gUISjHAAAB +AiT//0MwAAFiLAAAqaD4/0AUCADGJAgA4AMAAAAA0P+9JxgAsq8lsBI8//8CJCgAtq8cALOvQgBW +NhQAsa/8dxMkQABRNgAAwqIQALCvAAAzpvxXECQyAAQkLAC/ryQAta9bHwAMIAC0rwAAMKZbHwAM +MgAEJPw3AiQAACKmWx8ADDIABCQAADOmWx8ADDIABCQAADCmWx8ADDIABCQAEAIkAAAiptgARTYA +AKKQoABUNqQAVTZ/AEIwAACioKgAUzYAgAI8/BcDJAAAgK4AAKCuAABirgAAI6YAAKOQAoAQPGAb +ECaqGwSSgP8CJCUYYgBWAVI2/w8CJAAAo6AAAEKmeh8ADAAAAAAcHASOFBwCjhgcA44sAL+PAACC +rhgAso8AAKOuIAC0jwAAZK4kALWPAADAohwAs48oALaPFACxjxAAsI8IAOADMAC9J8j/vScYALCv +EACkJyWwEDw0AL+vMAC2rywAta8oALSvJACzryAAsq+KQAAMHACxr0AABTYAAKKUJPoDJKgAEzYk +EEMAAACipKAAEjakABA2AABVjgAAFo4AAHGOAIAUPPw3AiQAAECuIYg0AgAAAK79AAQkAAB0rgAA +oqR6HwAMAAAAAAAAVa4QAKQnAAAWrgAAca6QQAAMAAAAADQAv48wALaPLAC1jygAtI8kALOPIACy +jxwAsY8YALCPCADgAzgAvSfI/70nGACwrxAApCclsBA8NAC/rzAAtq8sALWvKAC0ryQAs68gALKv +ikAADBwAsa9AAAU2AACilK//AySoABM2JBBDAAAAoqSgABI2pAAQNgAAVY4AABaOAABxjgCAFDz8 +NwIkAABAriGINAIAAACu/QAEJAAAdK4AAKKkeh8ADAAAAAAAAFWuEACkJwAAFq4AAHGukEAADAAA +AAA0AL+PMAC2jywAtY8oALSPJACzjyAAso8cALGPGACwjwgA4AM4AL0n4P+9JxgAv6+KQAAMEACk +JyWwBTxAAKU0AACilNj9AyQQAKQnJBBDAPw3AyQAAKKkAACjpJBAAAwAAAAAGAC/jwAAAAAIAOAD +IAC9J9D/vSf/AIIwEACkJyQAs68gALKvHACxrxgAsK8hiMAAIYDgAMCQAgAoAL+vikAADP//szAl +sAI8QAJJNPj/ECYhMAAAAQAKJEQCSDSZIAAIAYAHPC4AyhAAAAAAAQACkgAABJICAAOSAwAFkgAS +AgAlIIIAABwDACUggwAhEEYCAC4FAAEAxiQlIIUAJRBHAAYAwywAAAStBAAQJgAAIq0SAGAQAAAA +AOr/wBQAAAAAAAAikgEAI5IEABAmABQCACUQYgIAHgMAJSBDACEQRgIBAMYkJRBHAAYAwywAAASt +AAAirfD/YBQAAAAAkEAADBAApCcoAL+PJACzjyAAso8cALGPGACwjwgA4AMwAL0nAwAikgIAJJIE +ACOSBQAlkosgAAgAEgIA//+EMEKwCDyAEAQAIRBIAAQARqwAAAeRQBgEAAMABiT/AOcwBDBmAAEA +AiQEEGIAJTDHAP//pTAlEEcAAgCgFP8AxzD/AEcwQrACPAAAR6AIAOADAAAAABQAg5ABAAIkCACG +rBgAhawAAISsAwBiEAQAhKxfXAAIDACArAwAgoxfXAAIEACCrMj/vScoALavJbACPAKAFjwsALev +JAC1ryAAtK8cALOvGACyrzAAv68UALGvEACwrxgDVTQBgBc8AoATPAKAFDzQ39ImbIPiJgAAoq7Q +39COm0AADAAAAAD8XHGOAAAAACMAIBIAAAAAlkAADPxcYK4iABISCAyEJhQAA5IBAAIkKgBiEAAA +AAAKAGAUAgACJAwAA44AAAAAKxAjAh0AQBAjEHEADAACrgAAEI73IAAIAAAAAPz/YhQAAAAADAAD +jgAAAAD4/2AQKxAjAvX/QBQjEHEACAACjhgABI4J+EAADAAArgAAEI73IAAIAAAAAJZAAAwAAAAA +CAyEJiEoAAAhMAAAdjkADCE4AADtIAAIbIPiJggAAo4YAASOCfhAAAAAAAAFIQAIDAACrgwAA44A +AAAAKxAjAtr/QBQjEHEACAACjhgABI4J+EAAAAAAABAAA44AAAAADAADrgAAEI73IAAIAAAAANj/ +vScCgAI8wFRCJBgAsK/AgAQAIYACAhwAsa8gAL+vikAADBAApCcAAAKOEACkJwkAUBAhiAAABABD +jCGIQAAAAEKMAAAAAAAAYqwEAEOsAAAxrgQAMa6QQAAMAAAAACEQIAIgAL+PHACxjxgAsI8IAOAD +KAC9J+j/vScBAYIsEACwrxQAv68hgIAAIRgAABAAQBQBAAQkAQICLg0AQBQCAAQkAQgCLgoAQBQD +AAQkARACLgYAQBQAAAAAFAC/jxAAsI8hEGAACADgAxgAvScEAAQkNSEADAAAAAD3/0AQIRhAAAwA +UKwUAL+PEACwjyEQYAAIAOADGAC9J+D/vScYALCvIYCAABwAv6+KQAAMEACkJxAAA44CgAI8wFRC +JMAYAwAhGGIAAABkjAKABjwCgAc8AAAErgQAkKwEAAOuxF3FjBAApCcFAKAQAABwrLBd4ozEXcCs +JRBFALBd4qyQQAAMAAAAABwAv48YALCPCADgAyAAvSfJ9xtra+tgM/9qYDNM7GDxAEus6mnigMIg +6ABl/2qM6hVaDmABa4NnhOoC8ABqQDLu8BBKjOoFKg9qjOoCawEqAGsg6ENnAAD/YwDQEPACagD0 +QDKMMAplieBIMoniaGdj8wBLSDJp4gHRAGsE9WrCBPVrwgT1ZJocbSJnAW//bgIQ/03M7UdnRO1s +6voiBPWqwQBtHV0TYIngSDJoZ4niY/MAS0gyeeIE9USeAWtk7WzqCSoBTf9qTO0dXe1hAZEAkCDo +AWMBkQCQBPWrxiDoAWMAAPtjB9EQ8AJpAPQgMQBqY/MASQhiBtAE0jQQA1RiYAF0bmAE9YiZB2r/ +a4I0hjRM7ARYbOwSYAAYoVywZ8n3G2wE9WCZi+yANIA0TOuA8QRMCDKJ4gT1ZNlg2gAYpSEElMn3 +G2yL7ASTgDSANGDxAEyJ40CiBJJ/SRVJAUogWgTSSGAE9aiZAWuiNJIybOr/a2zq8CLk9HiZ/2qG +NHIzTOt/akzrB2pM7P9qTOwHaKzoAnRM6LJhOFsKYQH2AWpL6qzqAPIAa23qBPVI2aoXFFuoYAH2 +AWpL6qzqAPYAa23q8xcDdJ5hGlucYQH2AWpL6qzqAPQAbI3qBPVI2ZIXMluQYAH2AWpL6qzqAPQA +a23q2xcIlweRBpAAagDvBWMAACDoAGWkZ8n3G2z8Y4vsBtCANKwwoeCANAdigPFARAgwQKKh4BDw +AmoA9EAyY/MASggwQeAE9UiYB2uA8QRMbOpIMoniBPVgmECahWds6gT1RNgAGKUhBNUElQT1iqD/ +agAYkyFM7QeXBpAA7wRjAAD/9x9rjOsA8gBqC2xs6mzsB2sOKgxcC2AQ8AJrAPRgM4gyffcIS2ni +QJoA6gBlB2sg6ENnBmsg6ENnBWsg6ENnBGsg6ENnA2sg6ENnAmsg6ENnAWsg6ENnAGsg6ENnAAAQ +8AJrAPRgM/djY/MASwBqD9EjZxBiDtAE0gXTBtMH0wjSCdIK0gvSDNLk9AhJSJkBa/9sQjJSMmzq +jOqA8BEiyfcbakvqQDIElkAyYPEASknmQKL/a0zsBZIMZVHkwPRKpGzqYZlY6+D0R6T/a2zqYpkS +7QBlAGVY6xLqVeX/90yZo+pA8Q9hq+L/90zZYZlCmchn//fsmVXj//dwmf/3VJlR4//3fJlAmUHj +BZNp5iD1XqL/bszqxWcPJaPq2GcNLkhnB1oEYQxyAmANcgVhrDKr4k4yg+oQYXkmBZJoZ2g0UeQG +kmniRPVmov9qTOtg9UCcROvj6mpgAWhfmXBniGdk7GzqAPEcIgaWleZE9WalBPXspf9uRmfM6wps +7OqE64LqAPENYEFHBPVMxczqjuoCKiT1CcUFlGhnaDKJ4sD1lJpg9UCahDON42niSjf/9+zZBZYn +8USe//cfcsDwG2EAa2HZYtn/93DZ//d02f/3eNn/93zZYNkElAyWC5IBTAqTBNQJlH9Of0p/SxVO +FUoVS39MFUwM1gvSCJYHkgrTBpMJ1ASUf05/Sn9LFU4VShVLf0kgVAjWB9IG0xVJP/cVYRCXD5EO +kADvCWOg8A4loPAOLqQyqeJKMgPqwWAGlkhnAGtR5gT1bMQBa2TqX5lv62zqX9kk9Umk/2yM6gFy +EGAJlhDwAmoA9EAyAG1j8wBKTeaFZ6njAU0dVUT1hsL6YQaTiGcAbonjJPXJwhDwAmoA9EAynfcY +SgCaEPACbwD04DcQ8AJuAPTANgBtXPQAT9zzDE6oMu3iYJsR4sniwPV03ECaAU0dVWD1QNzzYWhn +ICMHlKhn/00E9Uuk/2hC7RhhCJYQ8AJrAPRgM2PzAEtp5gT1i6IE9cSaAW8M7GdnZO1GZ2zqbuoA +8QMi/02C7fZgiGcQ8AJuAPTANogyY/MATsniwPWUmmD1QJqEM43jaeJKNxDwAmoA9EAyy/RGov9r +bOoicsDwF2GIZxN0P/cNYAeWAWtk7GT1RJ7/9+zZbepk9UTeBZYn8USe//cfcj/3BWAElf9qiGcA +GJMhTO0eFwBr//ds2bAWH/cYJgWUaGdoMoniwPVUmkPvThdIZxxa//YXYAaUTeQk9Umj/2wBclNg +DJYQ8AJqAPRAMgBtY/MASk3mhWep4wFNHVVE9YbC+mEGk4hnAG6J4wFsBPXMwiT1ycJkZ0hnZOpf +mW/rbOpoZ1/ZTiMg8EKhqGcBTaLq/2gXYQqTEPACbAD0gDRj8wBMieME9YqiBPXEmgFvDOxnZ2Tt +Rmds6m7qbyIBTaLs92AQ8AJqAPRAMsv0RqIicr/2B2FIZ+5K/2ts6gJav/YAYBhuDmWdFshnGF4/ +YUT1RqNM7AVcA2ABSkT1RsMGk4hnAG6J4wFsBPXMwiT1ycJkZ0hnZOpfmW/rbOpoZ1/Zsisg8EKh +pGf/aK0iC5QQ8AJuAPTANmPzAE7J5AT1iqLlZwT1xJoM7GdnZO1GZ2zqbuoJIgFNouyWYWdnZO1G +Z2zqbur3KgztDWWNF0hnBVoFYET1RqNM7ANcvRdE9UajTOwEXLgXB5RIZwFrZOpk9UScbepk9UTc +UBYM7Q1lkRcM7Q1l/Rb8YxDwAmwA9IA0BdEGYgTQY/MATIfwWJyH8H2kZeKH8FScQ+ng8ARgBGcM +EBDwAmgA9AAwY/MASIfwVJgQSUPpwPAWYIfwXaD/9x9tLO0QSofwXcDv9x5qS+pAMkAyEPACbAD0 +gDSq8hRMTe0AHPRUEG5G97iYH2tA9KI0bOyMMoniSDKJ4kgyGeIE9UieAWtCMlIybOr/a2zqyCLJ +9xtra+tgM2AzYPEAS2nkQKL/a/9vTOsLZUb3dJg/aID1YjIM6gVSTO8BYQRvwPdiMg4q5PRUngRv +AUrk9FTeEPACagD0QDJj8wBKRve4mqIyUjIfa2zqCFJSYBDwAm0A9KA1Y/MATUb3VJ0M6ghnDupG +KnQnAXcFYcT0XJ4BSsT0XN4CdwVh5PRAngFK5PRA3gN3BWHk9ESeAUrk9ETeBHcFYeT0SJ4BSuT0 +SN4Q8AJoAPQAMKhnY/MASAnl5PR4ngD1RKL/bXIzrOpD601h5PRMnghnEPACawD0YDMBSuT0TN4I +MmPzAEsJ4mni6eKg82iirOvE9FSeaeLE9FTeEPACawD0YDNj8wBLCPBUmz/3HiIFdD/3G2FG91Sb +wPdCMj/3FSIAahDwAmwA9IA0EPACaAD0ADAI8FTbnfccTGPzAEgAHBNYEEmH8FSYQ+k/9wphBpcF +kQSQAO8EY8T0WJ4BSsT0WN6GF+T0UJ6oZxDwAmgA9AAwAUrk9FDeqDKp4mPzAEgJ4uniIPR5ov9q +TOuxF+BjAGo+Yj3RPND8Yx3SYmcdlAQFB2iUMqniHtBg2h6UBEr/TABUHtT5YB2VAU0DXR3V7mHJ +9xtqS+pAMSAxwPJEQR3TYNpBmQH3AGsB9IRBQjJs6kIyABz6WzPSAfSIQQAc+lsx0p1ncEwAHIpA +MtIdlBBtpO0AHKxF/02dZ3BMAByQQB/SABxbH2RsABzwQgFsnWcAHIpAcEwdlBBtpO0AHKxF/02d +Z3BMAByQQCDSABxbH2RsABzwQh2U4faAQQAc+lsAZdH2jEEAHPpbIdJx9oBBABz6WyLScfaEQQAc ++lsj0nH2iEEAHPpbJNJx9oxBABz6WyXSgfaAQQAc+lsm0oH2hEEAHPpbJ9KB9ohBABz6WyjSgfaM +QQAc+lsp0tH2gEEAHPpbKtLR9oRBABz6WyvS0faIQQAc+lss0i3S5/cOakAyQDKiZ+H2gEHy8htN +ABzdWzbSNpXR9oxB8vIbTQAc3VsAZTaVcfaAQfLyG00AHN1bAGU2lXH2hEHy8htNABzdWwBlNpVx +9ohB8vIbTQAc3VsAZTaVcfaMQfLyG00AHN1bAGU2lYH2gEHy8htNABzdWwBlNpWB9oRB8vIbTQAc +3VsAZTaVgfaIQfLyG00AHN1bAGU2lYH2jEHy8htNABzdWwBlNpXR9oBB8vIbTQAc3VsAZTaV0faE +QfLyG00AHN1bAGU2ldH2iEHy8htNABzdWwBlM5MBah2QTutD61hnOdIP9wBqS+pAMhDwAEpD0gD1 +AGpL6kAyQDIe0DfSEWcB8ABqS+pAMgBrQDId0zjSM5Rg8RMkOZXg8QwtofaMQAAc+lsAZQXwAGtr +62AzYDNM6wFbWGeR9oRAABz6WzXS4PMfa2AzYDNs6kIyQjKx9oRAPdMAHPpbLtI9lIzqQjJCMpH2 +jEAAHPpbL9I9lbH2jECs6kIyQjIAHPpbMNI9ky6UTOtiMiDxAHRCMqDyFWAvlSDxAHWg8hBgMJMg +c6DyDGAgcgFroPIIYC6UgHSg8gJgL5WAdYDyHmAwlODzAHSA8hlg4PMAcgFqgPIUYDWVAyUCIyD0 +GSodlQFNCl0d1ZdhHpIBSgNaHtKKYQSQIPQJKAyRAykUkv9sKyKQZwAYoV6xZwNaB2AFlAAYoV4N +lQNaAGweYRSTkGejZwAYoV5A0wNaB2AFlAAYoV4VlQNaAGwPYUCVABihXpFnA1pA8h5gDZQAGKFe +FZUDWgFsQPIWYP90QPIXYAQFlDQQ8AJpAPQgMbHkY/MASWCcQ5kA9ABo4PMfbwvo7OsM6m3qYZwC +8ABuy+7s68A24PMfTmAzaDPM6uf3EG1t6qvtYpygNaA1/03s6wD1YDOs6m3qQ9ljnESZ7OsM6m3q +ZJzM6uzrYDNoM23qZZys6uzrAPVgM23qRNlGnBDwAmsA9GAzY/MAS0rJR5xLyUSbgPdCMgFywPIe +Ycn3G2pL6kAxIDHh9oBBABzdWyGV0faMQQAc3VsilXH2gEEAHN1bI5Vx9oRBABzdWySVcfaIQQAc +3VsllXH2jEEAHN1bJpWB9oBBABzdWyeVgfaEQQAc3VsolYH2iEEAHN1bKZWB9oxBABzdWyqV0faA +QQAc3VsrldH2hEEAHN1bLJWB9ohBABzdWy2VH5YQbaTt/00AHINFAGwAHFsfZGwAHPBCAWwglhBt +pO3/TQAcg0UAbAAcWx9kbAAc8EIAbBBtpO0ebAAcrEX/TQFuImdN7hBtA2pL6qTtTO7/TQAcg0Ue +bAAcLB8DbBBtA2rRZ6TtHmz/TQAcg0VN7gRjPpc9kTyQAO8gY6BtoDWgNQH0hEAq9BBNABzdWwBl +CG2gNaA1f00B9IhAABzdW2VNj/cAbavtoDUh9ohAABzdW6A1APIUbaA1oDVB9oBAQPEITQAc3VsA +ZQ3wFm2gNaA1QfaEQKD0Ak0AHN1bAGVB9oxAxfARbQAc3VsAZQDyFG2gNaA1YfaAQEDxDU0AHN1b +AGUF8BZtoDWgNWH2hECh8BpNABzdWwBlYfaMQMXwEW0AHN1bAGU3lUH2iEAAHN1bAU04lUH2iEAA +HN1bAU0AHCwfA2ygbaA1oDUB9IRAKvQTTQAc3VsAZQH0iEAAHN1b5G0h9ohAABzdWzOVOZUf9hQl +IfCAQQAc+lsAZf9tAU2s6kIyNNICIgFqNNKgNaA1IfCAQTrVAPEATQAc3VsAZTqVIfCIQQDxAE0A +HN1bAGWgbaA1oDUB9IRBKvQQTQAc3VsAZQhtoDWgNX9NAfSIQQAc3VtlTUOTIfaIQQAc3VtgNTqV +MfaAQQ/0AE0AHN1bAGU6lTH2hEEJ8ABNABzdWwBlAvABbaA1oDUx9ohBO9Ub9B9NABzdWwBlO5Ux +9oxBEfQfTQAc3VsAZQDyFG2gNaA1QfaAQQDxAk0AHN1bAGUN8BZtoDWgNUH2hEHA9AdNABzdWwBl +QfaMQcXwEW0AHN1bAGVh9oxBxfARbQAc3VsAZTqVUfaAQQ/0AE0AHN1bAGU6lVH2hEEJ8ABNABzd +WwBlO5VR9ohBO/QDTQAc3VsAZTuVUfaMQTH0A00AHN1bAGUA8hRtoDWgNWH2gEEA8QJNABzdWwBl +BfAWbaA1oDVh9oRBAfUHTQAc3VsAZUH2iEEAHN1bN5VB9ohBABzdWziVABwsHwNsAPIAakAyQDKi +Z0H2jEHF8BFNABzdWzzSPJVh9oxBxfARTQAc3VsAZUH2iEEAHN1bN5VB9ohBABzdWziVABwsHwNs +AfSEQQAc3VsxlQH0iEEAHN1bMpUh9ohBABzdWwBtNJMf9R4rIfCAQQAc3Vs6lSHwiEEAHN1bOpUT +FQBqahUAa1YV/2z/dL/1CWHJ9xtsi+yANIA0QdSB9hRMABz6WwBl4PMfa2AxIDEs6kIyEPACbAD0 +gDRj8wBMQjJs6mOcAPQAbavtrOtN62PcQZTg8x9ogfYcTAAc+lsAZSzqEPACbAD0gDQQbWPzAExC +MqvtY5xCMqA1DOqgNeDzH01AMqzrSDJN62PcQZSh9gRMABz6WwBlLOpCMkIyDOrn9xBsEPACaAD0 +ADBj8wBIi+xjmIA0gDT/TAD1QDKM603rY9hBlKH2DEwAHPpbAGUs6mSYQjIA9ABo4PMfbQvoQjKs +6gzrTesQ8AJqAPRAMmPzAEpk2kGU4PMfaKH2FEwAHPpbAGUs6kIyEPACbAD0gDQQbWPzAEzg8x9r +QjKr7WzqoDVknKA14PMfTUAyrOtIMk3rZNxBlKH2HEwAHPpbAGUQ8AJsAPSANOf3EG1j8wBMLOqr +7WScQjKgNUIyoDX/TQzqrOsA9UAyTetk3EGUEPACaAD0ADBj8wBIwfYETAAc+lsAZSzqQjJCMkrI +QZTB9gxMABz6WwBlTOkiMhDwAmsA9GAzQjJj8wBLS8hEm4D3QjIBcj/1AmDJ9xtqS+pAMSAxgfSA +QQAc+lsAZYJnEPACaAD0ADBAakvqY/MASEAyw5hAMozq4PMfa4D1QjXM6wDyAGps6gQiAPQAakvq +Teu46+DzH2gS6kIzDOvCMODzH2oKMEzoAPIAagzqBCIA9ABqS+pN6Ljo4PMfbRLqQjA/akvqrOhA +Mj9tQtVAMgztH/QASqA1TOygNY3tgfSAQQAc3Vtt7ZH0hEEAHPpbAGUC8ABrYDNgM/9LwPMAbGzq +jOiA9QAzomeR9IRBABzdW23tgfSIQQAc+lsAZRDwAm0A9KA1vfcQTYJnQJ2M6oD1QjUQ8AJqAPRA +MmPzAEoEmuDzH2oCM2ozTOsA8gBqbOoEIgD0AGpL6k3ruOsA9QIwEupCM+DzH2pM6EzrAPIAagzq +BCIA9ABqS+pN6Ljo4PMfbRLqQjCs6D9qQpVL6kAyDO1AMh/0AEpC1aA1TOygNY3tgfSIQQAc3Vtt +7ZH0jEEAHPpbAGUQ8AJrAPRgM733FEugm8DzAGyM6EztgPUAMpH0jEEAHN1bTe1YFAyR3/MZEB6T +BAR0MpHiPtSR9oRAABz6WwBl4PMfa2AzYDM+lWzqQjJCMj/TkfaMQAAc+ltA3T+TPpRs6kIyQjJB +3KH2hEAAHPpbAGU/lT6TofaMQKzqQjJCMgAc+ltC2z+UPpWM6kIyQjKx9oRAABz6W0PdP5M+lGzq +QjJCMkTcsfaMQAAc+lsAZT+VPpPB9oRArOpCMkIyABz6W0XbP5Q+lYzqQjJCMsH2jEAAHPpbRt0/ +kz6UTOtiMkIyR9x/8w4QAAD7YwfRDPAAahDwAmkA9CAxY/MASQhiCtQG0EvqYplAMkAy/0pM68n3 +G2wE8ABqQDKL7EAygDRN64A0YtkE1IH2FEwAHPpbAGXg8x9rYDAAMAzqQjJCMmzqY5kA9ABsi+yM +603rY9kElIH2HEwAHPpbAGUM6kIyEGzg8x9rQjKL7GzqgDRjmYA04PMfTEAySDKM603rY9kElKH2 +BEwAHPpbAGUM6kIy5/cQbODzH2tCMovsbOqANGOZgDT/TAD1QDKM603rY9kElKH2DEwAHPpbAGUM +6kIy4PMfa0IybOpkmQD0AGyL7IzrTetk2QSUofYUTAAc+lsAZQzqQjIQbODzH2tCMovsbOqANGSZ +gDTg8x9MQDJIMozrTetk2QSUofYcTAAc+lsAZQzqQjLn9xBs4PMfa0Iyi+xs6oA0ZJmANP9MAPVA +MozrTetk2QSUwfYETAAc+lsAZQzqQjJCMkrJBJTB9gxMABz6WwBlTOj/agFKQDJAMgqTgEoCMIBK +AjBs6gvJFCIf9wBqCpRM62IzwPJjwYIzTOtiM8DyZ8EAGApfAGUIlweRBpAA7wVjEmrA8kPBwPJH +wQAYCl8AZQiXB5EGkADvBWPJ9xtq+2NL6gbQQDAH0QhiADBA8EygA2lM6RDwAmoA9EAyYmcE0mPz +AEvD80GjLuoaIgUp4PJmo/9qTOsaIwSSyfcXbIvsY/MASgTSw/Mhwsn3G2pL6kAyQDJ2moA0gDRg +3FeaQdwIlweRBpAAagDvBWNR9IBAABzwWxxtUfSIQAAc8FscbdsX+WMK0Mn3G2gL6AAwADAQ8AJq +APRAMgvRofWCQCJnY/MASQxiABz9WwbSwPJYyaH1hEAAHP1bAGXA8lrJofWGQAAc/VsAZcDyXMmh +9YhAABz9WwBlgmfA8nqpwPJeycDyWKlp4sDyfKlp4lHkBNQh8o1AABwAXABlAPZANQD2ozVAav9r +Te1s7SHyjUAAHPBbBdNR8otAABwAXABlQDJR8oxA4PJEyQAcAFwAZeDyZKlh9IRAdeIEk//3H2rg +8qTJTO1p5eDyQNn/9x9qABzmW0ztQ6n/9x9rbOoQUgVg4PJAmR9aoPAeYQBqwPJUwcDyVaEFkwFK +TOsDU6DwC2DA8lXBBpQAahFrY/MATEPM4PJEzECcbOoBcoDwE2Hg8kScA2sA90IybOqA8Asqyfcb +akvqQDJAMkDwTKJM6wFzoPAEYAaUY/MATODyRqSg8AsqQJwBa1YybOqg8AUiPmrA8lDEHGrA8lHE +yfcbakvqQDJAMkDwbKL/amzqA2ts6mEiZvdMnP/3H3JcYODyQJzg8wlaAPEDYcDycqQA9mAyAPZD +Mv5K//ccUgRqS+oBYU5DwPJSxAaWf2tj8wBOZvdMnsDyjqZSMmzqp0LA8lKmA03/a0vlAPZANUNn +APajNYzqourg8AxgAPaANQD2ozUGkmPzAEoG0uDyQJoE9xFawPABYTJVoPAeYDJtyfcbakvqQDJA +MiH0EEpEa8n3G2gL6GDCADD/aqzqADCiZ1H0gEAAHPBbCNIIklH0iEAAHPBbomcAGAhhAGUMlwuR +CpAAagDvB2MDasDyVcFAmQhrbepA2U8XAGrA8lXBwPJUoQWTAUpM6wNTFGEDasDyVMFAmQlra+ts +6kDZPBfg8mak/2pM61/3FisBakvq4PJGxFEXwPJUwS4XBpD/bWPzAEjg8kagqurGYcn3G2yL7IA0 +gDRB9BBMABwAXAnVCZUA9kAxAPYjMX9qrOlM6eDyYJjA8kio//cfbEPrOGHA8kqojOpD6wdhwPJM +qIzqQ+tpYAFJrOkGk2PzAEvA8lCjI+oyYCJnBpNj8wBLBtPg8kCbBPcRWh1hMmnJ9xtqS+pAMkAy +IfQQSkRryfcbaAvoADAAMFH0gECxZ2DCABzwWwBlUfSIQAAc8FuxZ3QX/0nRFzpZ4mHJ9xtqS+pA +MkAyIfQQSkhr4RfA8nGj/2pM62PpyWAjZ8cXOlVf9wBhyfcbakvqQDJAMiH0EEpIaz8XgPEQWh/3 +CGDA8nKkAPZgMgD2QzICSg1SDGr/9htgQkP5FsDyT6ZM62LtH/cSYAD2QDUNFwJJlhf7YwbQAvAA +aAAwr0D/8BBuFWwIYgAcg0UH0QAcWx9kbBpsRvAWbgAcg0WvQAAcWx9kbBDwAmoA9EAyBNJj80Ca +AWtOMmzqCiIQ8AJrAPRgM2PzAEsA80ejAXIcYQSSY/MgmgFqLjFM6QkpEPACawD0YDNj8wBLAPNH +o1oqBJMIlweRBpBj8wBLBNMEagDzRMMA7wVjyfcbbIvsgDEk8gJoIDEAMAH2iEEk8gJtABzdWwAw +AfaAQSTyokAAHN1bAGUB9oRBJPKiQAAc3VsAZRH2gEEk8qJAABzdWwBlEfaEQSTyokAAHN1bAGUR +9ohBJPKiQAAc3VsAZRH2jEEk8qJAABzdWwBlEPACagD0QDIBa2PzAEoA82fCBJMIlweRBpBj8wBL +BNMEagDzRMMA7wVjyfcbaAvoAPO0mwAwADAB9oBAABzdWwBlEPACagD0QDJj8wBKAPO0mgH2hEAA +HN1bAGUQ8AJrAPRgM2PzAEsA87ibAfaIQAAc3VsAZRDwAmoA9EAyY/MASgDztJoR9oBAABzdWwBl +EPACawD0YDNj8wBLAPO0mxH2hEAAHN1bAGUQ8AJqAPRAMmPzAEoA87SaEfaIQAAc3VsAZRDwAmsA +9GAzY/MASwDztJsR9oxAABzdWwBlEPACagD0QDJj8wBKAPMnwgSTCJcHkQaQY/MASwTTBGoA80TD +AO8FY/tjBtAC8ABoADCvQP/wEG4VbAhiAByDRQfRABxbH2RsGmxG8BZuAByDRa9AABxbH2RsEPAC +agD0QDIF0mPzQJoBa04ybOoKIhDwAmsA9GAzY/MASwDzR6MBch1hBZJj8yCaAWouMUzpCSkQ8AJr +APRgM2PzAEsA80ejXCoFkgiXB5Fj8wBKBdIFkwaQAWoA80TDAO8FY8n3G2yL7IAxJPICaCAxADAB +9ohBJPICbQAc3VsAMAH2gEEk8qJAABzdWwBlAfaEQSTyokAAHN1bAGUR9oBBJPKiQAAc3VsAZRH2 +hEEk8qJAABzdWwBlEfaIQSTyokAAHN1bAGUR9oxBJPKiQAAc3VsAZRDwAmoA9EAyAWtj8wBKAPNn +wgWSCJcHkWPzAEoF0gWTBpABagDzRMMA7wVjyfcbaALwEGoL6EAyQDIAMKJnADAB9oBAAvAQTQAc +3VsE0gSVAfaEQALwEE0AHN1bAGUB9ohAAvAQbQAc3VsAZQSVEfaAQALwEE0AHN1bAGUElRH2hEAC +8BBNABzdWwBlBJUR9ohAAvAQTQAc3VsAZQSVEfaMQALwEE0AHN1bAGUQ8AJrAPRgM2PzAEsA8yfD +BZIIlweRY/MASgXSBZMGkAFqAPNEwwDvBWMAAPxjBdEQ8AJpAPQgMQZiBNBj8wBJAPPMmQLwAGgA +MK9AAByDRRVsABxbH2RsAPPQmRpsAByDRa9AABxbH2RsAPNEoQ4qyfcbbIvsgDSANAH2AEwAHPpb +AGXg8myZbuo2Isn3G2gL6ODyqJkAMAAwAfaIQAAc3VsAZeDyrJkB9oBAABzdWwBl4PKwmQH2hEAA +HN1bAGXg8rSZEfaAQAAc3VsAZeDyuJkR9oRAABzdWwBl4PK8mRH2iEAAHN1bAGUA86CZEfaMQAAc +3VsAZRDwAmoA9EAyBpcFkQSQY/MASgBrAPNkwgJrAPNnwgDvBGMAAPxjBdEQ8AJpAPQgMQZiBNBj +8wBJAPPMmQLwAGgAMK9AAByDRRVsABxbH2RsAPPQmRpsAByDRa9AABxbH2RsAPNEoQNyW2Dg8qyZ +yfcbakvqQDAAMAH2gEAAHN1bAGXg8rCZAfaEQAAc3VsAZeDytJkR9oBAABzdWwBl4PK4mRH2hEAA +HN1bAGXg8ryZEfaIQAAc3VsAZQDzoJkR9oxAABzdWwBlAPNImeDyaJlV4x/3AGqs6gf3AVoWYAH2 +iEAAHN1bAGUQ8AJqAPRAMgaXBZEEkGPzAEoDawDzZMICawDzZ8IA7wRj/2oBSkvqQDLg8B9KTO0H +9wBqTe3fF8n3G2yL7IA0gDQB9gBMABz6WwBl4PKsmarqmWEQ8AJqAPRAMgaXBZEEkGPzAEoDawDz +ZMICawDzZ8IA7wRjAAAQ8AJrAPRgM2PzQJsQa/tjbeoQ8AJrAPRgM2PzQNvJ9xtqS+oH0UAxIDFR +9IBBCGIAHABcBtAA9kAyAPZDMlH0gEEabQAc8FsE0vHwiEEAHABcAGUEkwD2QDIA9kMySeMIQppI +v/cbUAlhEPACawD0YDNj8wBLQ6sBSkPLBJX/alH0gEEAHPBbTO0Q8AJrAPRgM2PzQJsRa2vrbOoQ +8AJrAPRgM2PzQNsL7f9qkfSCQQAc8FtM7QiXB5EGkABqAO8FYwAA+WMQ8AJrAPRgM2PzAEsMYgvR +CtBm90ybUjIF0gWUf2pM7AXUAPNEowbSQJuEa2zqgHIqYQaTAXMCYARzG2EC8ABoAPIAbgAwwDav +QPPwFE4AHINFFWwAHFsfZGz/bgFOwDYabEbwFk4AHINFr0AAHFsfZGwQ8AJrAPRgM2PzAEsBakvq +APNEw8n3G2pL6kAwADBA8GygA2ps6goiEPACbAD0gDRj80CcAWteMmzqfCIQ8AJsAPSANGPzAEwA +80Sc//cfa0IybOoWKsn3G2pL6kAyQDKA8QRKQJoNclhhRmoA81zEQWoA813EQGoA817EO2oA81/E +EPACaQD0IDFj8wBJ5PS4mcn3G2pL6kAw/26yNQAwzO1h9IBAABzwWwjWYJmEagiWbOqEcith5PRY +mf/3H3ImYHYyAWts6iIiQPBMoANrzOps6hwiBpJq6qDwE2AEUqDwG2DA8BgiAXIRYQDzXKEFk8zq +Q+vA8AtgAPNfoQWUzOqD6qDwGmEAGJYpAGUMlwuRCpAAagDvB2NKagDzXMRFagDzXcRGagDzXsRA +agDzX8SnFwH2gEAAHPpbAGUOKhH2gEAAHPpbAGUn9x9rYDNgMyf3H0tu6n/3ECKdZwAcikAQTBDw +AmkA9CAxAfaIQGPzAEkAHPpbAGXg8kjZAfaAQAAc+lsAZeDyTNkB9oRAABz6WwBl4PJQ2RH2gEAA +HPpbAGXg8lTZEfaEQAAc+lsAZeDyWNkR9ohAABz6WwBl4PJc2RH2jEAAHPpbAGUA80DZEPACagD0 +QDLL9Eai/2ts6iJyAmCSchphAfCNQAAcAFwAZQ9rTOsPam7q/2yM6ghboUIMYaA0gDMA9qAybeqN +6q3qrewA81TZAPOY2Z1nAByQQBBMEPACawD0YDNj80CbgGsQ8AJsAPSANG3qY/NA3PwWIPNAoQWT +zOpD61/3G2AAGNIpAGVaFwaTBHMSYP9zX/cUYQDzXqEFlMzqQ+wkYQDzXKHM6kPsCmAAGB4pAGVF +FwDzXaEFlMzqg+r2YAAYmygAZTsXAPNeoQWTzOpD6+xgIPNBoQWUzOqD6j/3C2EAGNIpAGUqFyDz +QaEFk8zqY+r2YCAX+2MQ8AJuAPTANgfRJmcG0AhiY/MASWb3jJl/apIwTOjg8kahDyrJ9xtqS+pA +NaA1QPBMpf9rbOoDa2zqAyL/9x90BmEIlweRBpAAagDvBWMB8IBFBNUAHABcBdYBa2zqBJUFliwi +S1gGYcDyU6H/bIzqaup0YUhA4Er/a2zqHloHYIZnY/MATMDyU6Rs6kMqI1jYYGZnY/MAS8DyU6MC +ctFgyfcbbIvsgDQCaoA0wPJTw4H0B0wAHPBbAG3DF0tYBmHA8lOh/2yM6gFyQGFIQOBK/2ts6h5a +B2CGZ2PzAEzA8lOkbOolKiNYrGBmZ2PzAEvA8lOjAnKlYMn3G2yL7IA0AmqANMDyU8Mh9BBMABzw +W0JtlxcAasDyU8TJ9xtsi+yANIA0gfQHTAAc8FsgbYkXAGrA8lPEyfcbbIvsgDSANCH0EEwAHPBb +RG17FzH0gEXA8nPBABzwW0NtcxeB9IdFwPJzwQAc8FsQbWsXAGXo/70nEAC/ryRjAAwhOAAAEAC/ +jwAAAAAIAOADGAC9J9j/vScYALCvAYACPCWwEDwUrkIkHACxrxgDETYQAKQnAAAiriAAv6+KQAAM +MAMQNiCAAjwlsAU8AAACrgGAAjwVrkQkMwOjNAAAJK4AAGKQAAAAAEAAQjD7/0AQMAOiNAAARowP +AAM8//9jNCQwwwBAEQYAIxBGAIAQAgAhEEYArw8FPMAQAgAAoKU0GwCiAAIAQBQAAAAADQAHAAKA +AzxgG2MkwjAGABAApCdUQWasEigAAJBAAAxYQWWsIAC/jxwAsY8YALCPCADgAygAvSfA/70nLAC1 +ryAAsq8hqIAAAoASPBAApCc4AL6vMAC2rzwAv680ALevKAC0ryQAs68cALGvGACwr4pAAAxEAKWv +7F1CkiHwAADFAEAQIbAAAAKAAjxgG0MksBtilAAAAAAAAUIwvgBAEAAAAAAEPmKMAAAAALoAQBQC +gBc8Dl7ikgAAAAAGAEAQAoACPA5e4pIAAAAA//9CJA5e4qICgAI8AoADPPJdQKAUXmCsAoADPAde +YpD9/wMkQrATPCQQQwACgAM8B15ioAAAY5Lv/wIkAwBkNiQYYgBAAAIkAABjogAAgqACgAQ89F2C +lCAAo5b//0IwCgBDEAKAFDwlsAI8lABCNPRdg6QAAEOk9F2DlAAAAAD//2MwgBoDAPhdg64lsAQ8 +hACCNAAAUIyAAIQ0AACCjCEYAAD4XYaOAIgQACGAAAAlgAICJYgjAiEgAAJ9KwAMISggAvhdiI4C +gAo8/F1DlSNIAgEhIDABISgAACsQkAD//2MwISixAIAaAwAhKKIAITgAACtAgwAjKKcAIyCDACMo +qAACgAM8GF5krBxeZaz8XUKVAAAAAP//QjCAEgIAKxBJAJcAQBAAAAAA/F1ClQAAZJL7/wMk//9C +MIASAgAkIIMAI0giAQAAZKIBAAYkBAAgEQEABCSAEAkAIRBJAIAwAgC5IAAMISgAAEKwAjwiAAMk +AwBCNAAAQ6BEAKKPBQAFJCQApCYAAEeMFACmJ/8/5zCrGgAM3P/nJCwAQBAhKEAA7F1CkgIAAyT/ +AEIwgwBDEAKABDwCAKKQAAAAAAgAQBQAAAAABACjkAAAAAABAGIwBABAEAKAAjwBABYkC15WoAQA +o5AUAKePAAAAAAQA4igWAEAU/gBmMAKAAjxgG0MkTDpklMAQBgAqEIIAEABAFAKAAzwhEMcA/f9C +JMAQAgAqEEQACgBAFMIQBAAjMEYAIRimAAUAYpAHAIQwAQADJAcQggABAEIwC/BiAAKAAzwHXmKQ +7/8DJCEgwAIkEEMAAoADPAdeYqDsXUOSAoACPODkQiT/AGMwgBgDACEYYgAAAGaMAAAAAAn4wAAh +KMADkEAADBAApCc8AL+POAC+jzQAt48wALaPLAC1jygAtI8kALOPIACyjxwAsY8YALCPCADgA0AA +vSfsXUKSAAAAAO//QBQCgAM8YBtwJLAbApYAAAAAAAFCMOn/QBAFAAUkRACijyQApCYAAEeMFACm +J/8/5zCrGgAM3P/nJOD/QBAhKEAAFACnjwQAQpAEAOMo2/9gFP4ARjBMOgSWwBAGACoQggDW/0AU +IRDHAP3/QiTAEAIAKhBEANH/QBTCEAQAIzBGACEYpgAFAGKQBwCEMAcQggABAEIwyf9AEAAAAAAO +UQAMISAAAIMsAAgAAAAADl7ikgAAAAAFAEAUAAAAAA5e4pIAAAAAAQBCJA5e4qIAAGKS+/8DJAEA +BiQkEEMAAABiojIsAAgAAAAAAwCikAKABzwJXuKgAgCjkCEwgAAKXoOgCl6CkAAAAAAGAEAUAAAA +AAle4pAAAAAACl7CoEwsAAgAAAAACl6CkAAAAAAKXsKgTCwACAAAAAABAAMkAoACPA1eQ6DQBwQk +AoACPAKAAzzcXUSsDF5goAgA4AMAAAAA2P+9JxwAsa8YALCvIAC/rwQAgowCAAMkIYCAAAIXAgAD +AEIwBgBDEAKAETwgAL+PHACxjxgAsI8IAOADKAC9J+xdIpIAAAAA+P9AEBAApCeKQAAMAAAAAOxd +I5ICgAI8tORCJP8AYzCAGAMAIRhiAAAAZowAAASOBAAFjgn4wAAAAAAAAoACPO5dQ5AMAAIk/wBj +MAUAYhAQAKQnkEAADAAAAAD3LAAIAAAAAAKAAjwGXkOQAAAAAPj/YBACgAU8DF6ikAAAAAABAEIk +DF6ioJBAAAwAAAAA9ywACAAAAAAqsAQ8KACFNAIAgpQEAIQkBQBAFCsYpAD7/2AQAQACJAgA4AMA +AAAACADgAyEQAAAlsAM8vgBjNAAAYpQIAOADAQBCLOj/vScQAL+vJC0ADAAAAAACgAM8GQBAEJhU +ZCSYVGKMAAAAABUARBQCgAI8DV5DkAEAAiT/AGMwEABiEAKAAzztXWKQAAAAAA8AQjAFAEIoCgBA +EAEABCQCgAI8ZFlDjAAAAAAFAGAUIRCAABAAv48AAAAACADgAxgAvScQAL+PISAAACEQgAAIAOAD +GAC9J+j/vScQAL+vJC0ADAAAAAAsAEAQAoACPJhUQ4yYVEIkKABiFAKAAzwFXmKQAQAEJP8AQjAj +AEQQAoADPO1dYpAAAAAADwBCMAMAQigdAEAQAoADPAdeYpAAAAAABABCMBgAQBQAAAAAB15ikAAA +AAAQAEIwEwBAFAKAAzwNXmKQAAAAAP8AQjAOAEQQAoACPA5eQ5AAAAAACgBgFAKAAjxgG0IkBD5D +jAAAAAAGAGAUIRgAADw6QowAAAAAAgBAFAEAAyQhGAAAEAC/jyEQYAAIAOADGAC9J+j/vScQAL+v +MC0ADAAAAAACgAM8DgBAEJBUZSSQVGKMAoAEPIhUhiQJAEUUAQADJIhUgowAAAAABQBGFCEQYAAQ +AL+PAAAAAAgA4AMYAL0nEAC/jyEYAAAhEGAACADgAxgAvSfY/70nGACwr/8AkDAQAKQnIACyryQA +v68cALGvikAADAKAEjwPAAASAAAAADxeQ5IBAAIkBAwEJP8AYzAqAGIQgAEQPJBAAAwQAKQnJAC/ +jyAAso8cALGPGACwjwgA4AMoAL0nPF5DkgIAAiQhKAAA/wBjMPP/YhRECAQkA1wADH/+EDwwXAAM +BAwEJP0ARTAaXAAMBAwEJDBcAAwEDQQk/QBFMBpcAAwEDQQkJlwADHAOBCT//xA2JChQAANcAAxw +DgQkJlwADIwOBCQkKFAAA1wADIwOBCQBAAIkPF5CorktAAgAAAAAMFwADAAAAAACAEI0/wBFMBpc +AAwEDAQkMFwADAQNBCQCAEI0/wBFMBpcAAwEDQQkJlwADHAOBCQlKFAAA1wADHAOBCQmXAAMjA4E +JCUoUAADXAAMjA4EJAMABTxZAaU0A1wADEQIBCQCAAIkPF5CorktAAgAAAAAJbACPEIARjT8NwMk +QABCNAAAQ6QDCAQkAwAFJAAAwKAaXAAIAAAAAOD/vScYALKvFACxrxwAv68QALCvAoACPOxdQ5D8 +VxIkCwBgEPx3ESQCgAI8xlxDkAAAAAACAGMwKgBgFCEgAAAhMAAAAAIFPMFDAAwACAQkJbADPCEA +ZTQAAKKQGABmNEAAcDQBAEI0QgBjNAAAoqD//wIkAADAoGQABCQAAGKgAAASplsfAAwAAAAAAAAR +plsfAAwKAAQkISgAABpcAAwDCAQkWx8ADAoABCT8NwIkAAACplsfAAwKAAQkAAARplsfAAwKAAQk +AAASphwAv48YALKPFACxjxAAsI8IAOADIAC9J6gtAAwAAAAAITAAAAACBTzBQwAMAAgEJB8uAAgl +sAM8uP+9JywAs68gALCvAoATPP8AkDAYAKQnMAC0rygAsq8kALGvQAC/rzwAt684ALavNAC1r4pA +AAz/ALIw7l1ikg8AETIPAEIwEwBRECGgAAAEAAIyQABAFAAAAADuXWKSDAADJA8AQjCPAEMQCAAC +Mu5dYpIEAAMkDwBCMNIBQxAAAAAA7l1ikgIAAyQPAEIwmwBDEAYAAjICgBA87V0Dku5dYpIPAGMw +DwBCMCoQQwAcAEAUAoASPO1dApIAAAAAQABCMBcAQBACgAI8wlxCkAAAAAACAEMwUgBgFAQAQjAQ +AEAQAAAAAO5dQ5ICgAY8FOXFkA8AYzAlsAI8JRhlAN0CQjQAAEOg7V0EkoD/AiS//wMkJiiiACQg +gwAU5cWg7V0EopBAAAwYAKQnQAC/jzwAt484ALaPNAC1jzAAtI8sALOPKACyjyQAsY8gALCPCADg +A0gAvSfuXWKSAAAAAAQAQjBMAEAQAAAAAO5dYpIAAAAACABCMAMAQBAIAAIyGwBAEAKAAzzuXWKS +AAAAAAgAQjAMAEAUCAACMgoAQBAAAAAACABAEgKAAzwQN2KUAAAAAAABQjADAEAQAAAAAA5RAAwh +IAAA7l1ikvD/AyQkEEMA7l1iou5dY5IAAAAAJRgjAu5dY6JyLgAIAoAQPBA3YpQAAAAAAAFCMPL/ +QBACgAI8DV5DkAAAAACi/2AUAQAEJA5RAAwAAAAAvS4ACAAAAABTIQAMJAAEJHYBQBAhiEAAAoAC +POxdRZDuXUSS7V0Ckr//AyQPAIQwJBBDAO1dAqIQAKWjEQCkowgAJJYCgAI8EAClJyUgggAgAIQk +whsADAEABiQEAAMkFwACJAwAI64UACKuFwoADCEgIAKULgAIAAAAAAAuAAwAAAAApi4ACAAAAABx +/0AUAAAAADUtAAwAAAAAd/9AEAAAAADuXWKS8P8DJCQQQwDuXWKiAoADPO5dYpIQN2SUBABCNAAB +hDDuXWKiYf+AEAAAAAAOUQAMAQAEJGcuAAgAAAAAZf9AFAAAAACPLQAMAAAAAGH/QBAAAAAA7l1i +kvD/AyRBsAQ8JBBDAO5dYqLuXWOSCACFNIIAAiQBAGM0AoAXPO5dY6IAAICsAACipEKwBDxgG+Im +sBtFlAAAg5C+/wIkAwCGNCQYYgAAAaUwkP8CJAAAg6AAAMKgOACgECWwBjwlsAQ8hACCNAAARoyA +AIQ0AACCjAKACzwUXmSNADgGACEwAAAloMIAIRgAAAKACjwlqOMAISgAABxeQo0hIJQAKxiUACEo +tQAhKKMAKxCiACQBQBQAAAAAHF5CjQAAAAAQAUUQAQAFJGAb4iZYQUOMQrAHPAAA5pAYAGUA+/8C +JCQwwgAAAOagZ0YGPM+sxjQBAAQkISgAABIYAACCGgMAQBADACEQQwDAEAIAIRBDAIAQAgAZAEYA +EDAAACMQRgBCEAIAITDCAAIzBgABAAIkuSAADAowRgAlsAY88gLDNIj/AiQAAGKgEQDHNAAA4pAI +AMU0YBvkJgEAQjQAAOKgAACjlLAbgpT//2QwEACENAAApKT7/4QwAACkpAABQjACAIQ0AACkpAQA +QBBCsAI8IgADJAMAQjQAAEOg//eEMAAApKQoAMQ0AACDlO/+AiT+/wgkJBhiAAAAg6QAAIKUJgDF +NAKAAzwkEEgAAACCpMJcZJAAAKKUBACEMAAkQjQAAKKkCQCAEAAAAAAAAKKUAAAAACQQSAAAAKKk +AADjkP3/AiQkGGIAAADjoABoAkAACEIw/f9AEAAAAAAlsBI8EQBDNgAAYpAAAAAAAgBCNAAAYqAA +AAAAAAAAAAAAAAAAAAAAAAAAACYARDYAAIKUAAAAAAEAQjQAAIKkAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAIOU/9sCJCgARTYkGGIAAACDpAAAopQAAAAAAQBCNAAAoqQAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAopQAAAAAEAFCNAAAoqQIAFE2AAAjlmAb9iawG8KW +//9wMAAYEDYAADCmAAFCMP3/EDIAADCmBQBAEEKwAjwAAEOQ+/8EJCQYZAAAAEOgBAAQNlsfAAwy +AAQkAAAwpiIAAiTyAkM27/8QMgAAMKbIAAQkAABioFsfAAwAAAAAsBvClgAAAAAAAUIwQQBAEEKw +BjyEAEI2AABEjIAARjYAAMKMACgEACEYAAAhIAAAJTCCACU4owBYQcOOIyjUAIASBQAbAEMAAgBg +FAAAAAANAAcAAoALPBReY40SEAAAIxBFACEQQwAUXmKtFF5jjUKwAjwDAEI0WBtjJBReY60AAEOQ +AAAAACAAYzAgAGAUAAAAABReYo0CgAo8HF5EjSFARgArKAYBIUhnACFIJQErICQBWQCAFAAAAAAc +XkKNAAAAAEcASRABAAUkQrACPAAAQ5D7/wQkAQAGJCQYZAAAAEOgBACgEAEABCSAEAUAIRBFAIAw +AgC5IAAMISgAAEKwAjwiAAMkAwBCNAAAQ6BCsAY8AADCkGAb5SbQG6iM3BunlEGwAzxBAEI0CABk +NAAAwqAAAGisAACHpO5dY5Lw/wIk3BunpCQYYgDuXWOi7l1iktAbqKwCAEI07l1ionIuAAgCgBA8 +WS0ADAAAAAAx/kAQAAAAAAouAAwAAAAA7l1ikvD/AyQkEEMA7l1iou5dY5IAAAAAAgBjNO5dY6Js +LgAIAAAAAJmZAzwlsAI8l5ljNBgDQjQAAEOslC4ACAAAAAAYXkKNAAAAACsQggAMAEAUAAAAABhe +Qo1FLwAIAQAFJBheQo0AAAAAKxACAQoAQBQAAAAAGF5CjRYwAAgBAAUkGF5CjRxeQ40UXmSNIxBU +AEUvAAgjKEQAGF5CjRxeQ40UXmSNIxBGABYwAAgjKEQAAoACPOxdQ5AAAAAABwBgEAKAAjzuXUOQ +BAAEJA8AYzAEAGMoAwBgFAEABSQIAOADAAAAAEsuAAgAAAAAAYACPCWwAzzg/70n/MFCJBgDYzQQ +AKQnAABirBgAv6+KQAAMAAAAAAKABDwMXoKQAAAAAAsAQBABAAUkAoACPNAHAyQMXoCgEACkJ5BA +AAzcXUOsGAC/jyEQAAAIAOADIAC9JwKAAzwBAAQkAoACPA9eRKACgAI8DV5goO1dRJBLLgAM/wCE +MJBAAAwQAKQnGAC/jyEQAAAIAOADIAC9J0IRBQAPAEYw6P+9JwkAwygUAL+vFABgEBAAsK+CFgUA +AQBCMBQAQBAAwAI8JBCiAEMAQBTCFQQAAQBCMFAAQBACgAM8DOVjJCEYwwACgAQ8CF6FkAAAYpAA +AAAAJBBFAEcAQBAAAAAAFAC/jxAAsI8IAOADGAC9JyQQogAeAEAQwhUEAAKABjwHXsKQ/f8DJEKw +BDwkEEMAAoADPAdewqALXmCgAACCkO//AyQDAIU0JBBDAEAAAyQAAIKgAACjoAdewpAAAAAABwBC +MOb/QBQCgAI8BV5AoAKAAzztXWSQFAC/jxAAsI8BAAUk/wCEMEsuAAgYAL0nAQBCMCUAQBACgAM8 +DOVjJCEYwwACgAQ8CF6FkAAAYpAAAAAAJBBFAOf/QBQCgAY8B17CkP7/AyQkEEMAB17CoNcwAAgA +AAAAQrAHPAAA45Dv/wIkAwDwNCQYYgBAAAIkAADjoAIABCQAAAKiISgAALkgAAwA8AY0RAACJAAA +AqLBMAAIAAAAABQAv48QALCPAQAEJOFRAAgYAL0nAoAGPAdewpD+/wMkJBBDAAdewqDXMAAIAAAA +AIIWBQDo/70nAQBCMBQAv68OAEAQEACwrwDAAjwkEKIANwBAFAKAAjwGXkOQAgACJP8AYzBEAGIQ +AQAEJBQAv48QALCP4VEACBgAvScAwAI8JBCiAA4AQBQCgAY8B17CkP7/AyQkEEMAB17CoAdewpAA +AAAABwBCMBgAQBACgAI8FAC/jxAAsI8IAOADGAC9JwdewpD9/wMkQrAEPCQQQwACgAM8B17CoAte +YKAAAIKQ7/8DJAMAhTQkEEMAQAADJAAAgqAAAKOgB17CkAAAAAAHAEIw6v9AFAKAAjwFXkCgAoAD +PO1dZJAUAL+PEACwjwEABST/AIQwSy4ACBgAvSdCsAc8AADjkO//AiQDAPA0JBhiAEAAAiQAAOOg +AgAEJAAAAqIhKAAAuSAADADwBjREAAIkAAACohQAv48QALCPCADgAxgAvSfiLAAMAAAAABQAv48Q +ALCPDAAEJAEABSRLLgAIGAC9JwGAAjwlsAM86P+9J7TFQiQYA2M0EACwrwAAYqwCgBA87V0CkhQA +v68PAEIwAwBCKAUAQBABAAUkWS0ADAAAAAAEAEAQAQAFJO1dBJJLLgAM/wCEMAKABDxgG4Qk4BuD +lNwbhZQUAL+PEACwjwIAYzBBsAI8JRhlAAgAQjQYAL0nAABDpAgA4APcG4Ok4P+9JyWwAjwBgAM8 +GACyrxQAsa8QALCvHAC/rxgDUjRAxnEkAoAQPAgUBCYhKAAAITAAACE4AAAAAFGudjkADAAAAACb +MQAICBQEJuD/vScYALCv//+QMBwAv6+KQAAMEACkJwKABjxgG80kKhyikQAAAAAhAEAQKrACPCWw +Azw4AmQ0gP8CJAAAgqA0Amo00gFlNNYBZjTaAWc03gFjNAAAqJQAAMmUAADrlAAAbJQAAESVsP4C +Jv//UDAoHKSlAACgpBAApCcgHKilAADApCIcqaUAAOCkJByrpQAAYKQAAFClkEAADCYcrKUcAL+P +GACwjwgA4AMgAL0nCgBFNGMAAyT//wQ0AACikAAAAAAJAEAQZAACJP//QiT//0Iw/v9AFP//QiT/ +/2Ik//9DMPX/ZBQAAAAAYBvCJCgcSJQmHEeUIBxJlCIcSpQkHEuUJbADPDgCbDQ0AmI00gFkNNYB +ZTTaAWY03gFjNAAASKQAAImkAACqpBAApCcAAMukAABnpAAAgKGQQAAMAAAAABwAv48YALCPCADg +AyAAvSfQ/70nKAC0rywAv68kALOvIACyrxwAsa8YALCv//8UJAKAEzxBsAI8YBtjJgQAQjQAAEWM +1BtkjNAbZowCgAI88FxHkCWwCDywAwI1JZCFAAAAUqwAAEasAQACJIkD4hDUG3KsYBtkJtAbgowA +AAAAJBBSAAEAQjAOAEAQYBtnJiWwEDywAwI2AQAFJAAARawEAAs21BuDjAAAaY1AAAI8AQBjOCQQ +IgEmAUAQ1BuDrGAbZybQG+KMAAAAACQQUgAEAEIwFABAEGAbcSYlsAM8sANkNAQAAiQAAIKs1Bvi +jMQ45oz8AGM0rBvklAAAZYwEAEI4IUjEAAYAqRDUG+KsAoADPLBdYowAAAAACABCNLBdYqxgG3Em +0BsijgAAAAAkEFIACABCMAoAQBAAAAAAsBsilgAAAAAEAEIwXQNAFAKAAjzUGyKOAAAAAAgAQjjU +GyKuYBtwJtAbAo4AAAAAJCBSAAAIgzAGAGAQABCCMNQbAo4AAAAAAAhCONQbAq4AEIIwBQNAFAAA +AABgG3Am0BsDjgAAAAAkEHIAACBCMPcCQBQAAAAAJBByAACAQjC5AUAUAQADPGAbcCbQGwKOAAAA +ACQQUgAkEFQAJBBDAPEBQBQAAAAA0BsCjgIAAzwkEFIAJBBDACgCQBQAAAAAYBtwJtAbAo4EAAM8 +JBBSACQQVAAkEEMAYgJAFAAAAABgG3Am0BsCjggAAzwkEFIAJBBDAJsCQBQAAAAAYBtwJtAbAo4Q +AAM8JBBSACQQVAAkEEMAWgFAFAAAAABgG3Am0BsCjiAAAzwkEFIAJBBDABgBQBQAAAAAYBtwJtAb +Ao5AAAM8JBBSACQQVAAkEEMA1gBAFAAAAABgG2Um0BuijAAEAzwkEFIAJBBDAD0AQBBgG2YmKrAC +PCwAQzQAAGmM/wACJP8AJDEpA4IQAIAiMfkCQBQAgAI8AP8CPCQQIgELAEAQ/wACJKw3opAgsAM8 +ABICACEQQwAMAEmMJbADPLADYzQAAGms/wAkMf8AAiQbAIIQYBtwJv8AIzF8OAWOIBACPAAaAwAh +GGIAITBgABA4A64KAAQkrDcJogABByQeAQAMEACgr9AbBY4CgAY8sF3EjAAEAjwnEAIAJCiiACWw +AjwAgIQ0sANCNEGwAzwAAESsAABlrLBdxKzQGwWuYBtlJtQbpIwABAM8JbACPCYggwCwA0I0AABE +rNQbpKxgG2Ym0BvHjAAIBDwkKPIAJBCkAAgAQBCAAAg81BvDjCWwAjywA0I0JhhkAAAARKzUG8Os +gAAIPCQQqAAhAEAQAAAAANQbw4wlsAk8sAMqNSqwAjwAAEOtNgBCNAAAQ5AjsAQ8/x8CPMAYAwDw +B2Mw9DjFjCEYZAD//0I0JBhiAM4CZRD4OMOsAoAFPLBdo4wnIAgAJCDkAAAQYzRBsAI8AABDrQAA +RKywXaOs0BvErGAbYibUG0OMgAAEPCYYZADUG0OsYBtmJtAbw4wAAQU8JCByACQQhQAGAEAQJbAC +PNQbw4ywA0I0JhhlAAAARazUG8OsAAIFPCQQhQAGAEAQJbACPNQbw4ywA0I0JhhlAAAARazUG8Os +ABAFPCQQhQAMAEAQYBtjJrAbw5QAAAAABABiMAIAQBAACGI0sBvCpNQbwowAAAAAJhBFANQbwqxg +G2Mm0BtijAAgBTwkEFIAJBBFAAsAQBAAAAAAsBtklAAAAAAEAIIwAgBAEP/3gjCwG2Kk1BtijAAA +AAAmEEUA1BtirCwAv48oALSPJACzjyAAso8cALGPGACwjwgA4AMwAL0nIL0CPOwCAzZNAAc28QII +NggABiR4AkI0AABFpAAA4KAAAAahAABgrAAAYoz/AAQ8AADgoP8ASTAlSCQBAAAGofICBTYAAGSs +CgAKNgAAaayA/wMkAACgoAAAQ6EAAGKNgAADPCQQQwACAEAQhP8CJAAAQqEsHwAMAQAEJAIAAjYA +AEOU/78EJCQYZAAAAEOkJTIACGAbZyZwMAAMAAAAACWwAjwqsAY8sANCNAAAVKwoAMM0AABpjP8A +BST/ACQxbQOFECW9AjwAgCIxWQJAEAD/AjwAgAI8AABirP8AAiQhAIIQ/wAjMWAbcCZMOAWOIBAC +PAAaAwAhGGIAITBgAJg3CaLgNwOuBgAEJIAAByQeAQAMEACgrwKACTzAXSeRAoAIPLBdBY3QGwaO +YAACPAIA5zQnEAIAJDDCAAAIpTQAJgcAJbACPCUghQCAA0I0QbADPAAARKwAAGassF0FrcBdJ6HQ +GwauYBtiJtQbQ4xAAAQ8JhhkAJoyAAjUG0OscDAADAAAAAAqsAU8JACjNAAAaYz/AAYk/wAkMUgD +hhAlsAI8AIAiMWQCQBAA/wI8AIACPAAAYqz/AAIkJQCCEGAbcCb/ACMxTDgFjiAQAjwAGgMAIRhi +ACEwYACUNwmi4DcDrgYABCSAAAckHgEADBAAoK8CgAo8wF1HkQKACTywXSWN0BsGjmAAAjwEAOc0 +JxACACQwwgAACKU0JbADPEAAAjwAJgcAJqCCArADaDQlIIUAgANjNEGwAjwAAGSsAABGrLBdJa3A +XUeh0BsGrgAAFK1gG2Im1BtDjCAABDwmGGQAkjIACNQbQ6xwMAAMAAAAACWwBTywA6I0KrAHPAAA +VKwgAOM0AABpjP8ABiT/ACQxBwOGEJADojQAgCIxBQJAEAD/AjwAgAI8AABirP8AAiQhAIIQYBtw +Jv8AIzFAOAWOIBACPAAaAwAhGGIAITBgAJw3CaLUNwOuBQAEJIAAByQeAQAMEACgrwKACTzAXSeR +AoAIPLBdBY3QGwaOGAACPAEA5zQnEAIAJDDCAAAEpTQAJgcAJbACPCUghQCAA0I0QbADPAAARKwA +AGassF0FrcBdJ6HQGwauYBtiJtQbQ4wQAAQ8JhhkAIsyAAjUG0OscDAADAAAAAAqsAU8DACjNAAA +aYz/AAYk/wAkMcYChhAAgCIxVAJAEAD/AjwAgAI8AABirP8AAiQkAIIQYBtwJv8AIzEoOAWOIBAC +PAAaAwAhGGIAITBgAIA3CaK8NwOuAwAEJIAAByQeAQAMEACgrwKACjzAXUeRAoAJPLBdJY3QGwaO +AQAIPID/AiQlOOIAAIADNQABpTQnGAMAACYHACWwAjwkMMMAJSCFAIADQjRBsAM8AABErCegCAAA +AGassF0lrcBdR6HQGwauYBtjJtQbYowAAAAAAIBCONQbYqxgG3Am0BsCjgEAAzwkEFIAJBBUACQQ +QwAR/kAQAAAAAHAwAAwAAAAAKrAFPBAAozQAAGmM/wAGJP8AJDF8AoYQJbACPACAIjHQAUAQAIAC +PAAAYqz/AAIkIgCCEGAbcCb/ACMxKDgFjiAQAjwAGgMAIRhiACEwYACENwmivDcDrgMABCSAAAck +HgEADBAAoK8CgAk8wF0nkQKACDywXQWN0BsGjgEAAjwAgEI0QADnNCcQAgAkMMIAAAGlNAAmBwAl +sAI8JSCFAIADQjRBsAM8AABErAAAZqywXQWtwF0nodAbBq5gG2Im1BtDjAEABDxgG3AmJhhkANQb +Q6zQGwKOAgADPCQQUgAkEEMA2/1AEAAAAABwMAAMAAAAACqwBTwUAKM0AABpjP8ABiT/ACQxZAKG +ECWwAjwAgCIx+gFAEAD/AjwAgAI8AABirP8AAiQlAIIQYBtwJv8AIzE0OAWOIBACPAAaAwAhGGIA +ITBgAIg3CaLINwOuBAAEJIAAByQeAQAMEACgrwKACjzAXUeRAoAJPLBdJY3QGwaOBgACPCAA5zQn +EAIAJDDCAAACpTQlsAM8BAACPAAmBwAmoIICsANoNCUghQCAA2M0QbACPAAAZKwAAEassF0lrcBd +R6HQGwauAAAUrWAbYibUG0OMAgAEPGAbcCYmGGQA1BtDrNAbAo4EAAM8JBBSACQQVAAkEEMAof1A +EAAAAABwMAAMAAAAACWwAzywA2I0KrAHPAAAVKwYAOU0AACpjP8ABiT/ACQxFgKGEAQAAiQAgCIx +1gFAEAD/AjwAgAI8AACirP8AAiQhAIIQYBtwJv8AIzE0OAWOIBACPAAaAwAhGGIAITBgAIw3CaLI +NwOuBAAEJIAAByQeAQAMEACgrwKACTzAXSeRAoAIPLBdBY3QGwaOBgACPBAA5zQnEAIAJDDCAAAC +pTQAJgcAJbACPCUghQCAA0I0QbADPAAARKwAAGassF0FrcBdJ6HQGwauYBtiJtQbQ4wEAAQ8YBtw +JiYYZADUG0Os0BsCjggAAzwkEFIAJBBDAGj9QBAAAAAAcDAADAAAAAAqsAU8HACjNAAAaYz/AAYk +/wAkMd0BhhAlsAI8AIAiMTMBQBAA/wI8AIACPAAAYqz/AAIkJQCCEGAbcCb/ACMxQDgFjiAQAjwA +GgMAIRhiACEwYACQNwmi1DcDrgUABCSAAAckHgEADBAAoK8CgAo8wF1HkQKACTywXSWN0BsGjhgA +AjwIAOc0JxACACQwwgAABKU0JbADPBAAAjwAJgcAJqCCArADaDQlIIUAgANjNEGwAjwAAGSsAABG +rLBdJa3AXUeh0BsGrgAAFK1gG2Im1BtDjAgABDwmGGQAgzIACNQbQ6xwMAAMAAAAANQbAo7QGwOO +ACBCOGIyAAjUGwKucDAADAAAAAAqsAI8CABDNAAAaYz/AAIk/wAkMSwAghAAgCIxNAFAFACAAjwA +/wI8JBAiAQsAQBD/AAIkqDcCkiCwAzwAEgIAIRBDAAwASYwlsAM8sANjNAAAaaz/ACQx/wACJBoA +ghBgG3Am/wAjMXA4BY4gEAI8ABoDACEYYgAhMGAABDgDrgEABCSoNwmigAAHJB4BAAwQAKCv0BsF +jgKABjywXcSM/8cCJCQoogAlsAI8EACENIADQjRBsAM8AABErAAAZaywXcSs0BsFrmAbYybUG2KM +AAAAAAAQQjhbMgAI1BtirFYBAjUAAEOUAAAAAHT8YBAAAAAAflgADAcABCQSMgAIYBtkJgAAYqy4 +MgAI/wACJOQdJJZYOCaWAQCEJAAZBAAlMMIA8P9jMCAAxSQCEgMA5B0kphcAoqAWAKOgDADEjADw +Ajz//0I0/w9jMAAcAwAkIIIAJSCDAAwAxKxYOCWOAQAQJAEABCQxEAY8AAEHJB4BAAwQALCvWwEA +DAEABCQqsAI8AQBCNAIAAyQAAFCgAABDoNQbIo4AAAAACABCOE0yAAjUGyKu0AMjNYAAAiQAAGKs +CTMACGAbYiYlsAI8AQADJJADQjQAAEOs1TIACGAbZSYkECIBqf1AEP8AAiRHAMY0AADCkAAAAAD/ +AEQwDgCFEGAbYiaYNwSiAADCkP8AgzD/AEQwBwCDECE4AAIhKMAAAACikCEYgAD9/2IU/wBEMJg3 +46BgG2ImmDdDkCCwAjwAGgMAIRhiAAwAaYwlsAI8sANCNP8AJDEAAEmsgTMACP8AAiQkECIB/f1A +EP8AAiRFAOU0AACikAAAAAD/AEQwDgCGEGAbYiacNwSiAACikP8AgzD/AEQwCACDEGAbYiYhMAAC +AACikCEYgAD9/2IU/wBEMJw3w6BgG2ImnDdDkCCwAjwAGgMAIRhiAAwAaYwlsAI8sANCNP8AJDEA +AEms9jMACP8AAiQkECIBnv1AEP8AAiRGAKU0AACikAAAAAD/AEQwDgCGEGAbYiaUNwSiAACikP8A +gzD/AEQwCACDEGAbYiYhMAACAACikCEYgAD9/2IU/wBEMJQ3w6BgG2ImlDdDkCCwAjwAGgMAIRhi +AAwAaYwlsAI8sANCNP8AJDEAAEmsuDMACP8AAiQA/wI8JBAiATD+QBD/AAIkQQClNAAAopAAAAAA +/wBEMA4AhhBgG2ImhDcEogAAopD/AIMw/wBEMAgAgxBgG2ImITAAAgAAopAhGIAA/f9iFP8ARDCE +N8OgYBtiJoQ3Q5AgsAI8ABoDACEYYgAMAGmMJbACPLADQjT/ACQxAABJrGw0AAj/AAIkJBAiAc/+ +QBD/AAIkRAClNAAAopAAAAAA/wBEMA4AhhBgG2ImkDcEogAAopD/AIMw/wBEMAgAgxBgG2ImITAA +AgAAopAhGIAA/f9iFP8ARDCQN8OgYBtiJpA3Q5AgsAI8ABoDACEYYgAMAGmMJbACPLADQjT/ACQx +AABJrCw1AAj/AAIkJBAiAa79QBD/AAIkQAClNAAAopAAAAAA/wBEMA4AhhBgG2ImgDcEogAAopD/ +AIMw/wBEMAgAgxBgG2ImITAAAgAAopAhGIAA/f9iFP8ARDCAN8OgYBtiJoA3Q5AgsAI8ABoDACEY +YgAMAGmMJbACPLADQjT/ACQxAABJrCw0AAj/AAIkAABirHg1AAj/AAIkJBAiAQj+QBD/AAIkQgCl +NAAAopAAAAAA/wBEMA4AhhBgG2ImiDcEogAAopD/AIMw/wBEMAgAgxBgG2ImITAAAgAAopAhGIAA +/f9iFP8ARDCIN8OgYBtiJog3Q5AgsAI8ABoDACEYYgAMAGmMJbACPLADQjT/ACQxAABJrKo0AAj/ +AAIkJBAiASz+QBD/AAIkQwDlNAAAopAAAAAA/wBEMA4AhhBgG2ImjDcEogAAopD/AIMw/wBEMAgA +gxBgG2ImITAAAgAAopAhGIAA/f9iFP8ARDCMN8OgYBtiJow3Q5AgsAI8ABoDACEYYgAMAGmMJbAC +PLADQjT/ACQxAABJrO80AAj/AAIkBgADJJADQjQAAEOskDQACGAbYiYBAAMkkANCNAAAQ6ykMwAI +YBtiJiWwAjwHAAMkkANCNAAAQ6xgG2Mm1BtijAAAAAAAgEI4VjQACNQbYqwAAECsGTQACGAbYiYC +AAMkkANCNAAAQ6zfMwAIYBtiJpADYzQAAGKsEjUACGAbYiYDAAMkkANCNAAAQ6xTNQAIYBtiJgUA +AySQA0I0AABDrNE0AAhgG2Im4P+9JxwAv68YALKvFACxrxAAsK8lsAw8AYACPBgDgzUw3EIkAoAS +PEGwCzwAAGKsYBtKJgoAYjUAAESU3htDldwbSZUlMGQA///QMCQQCQICAEIwwgBAEMADgzUCAAIk +AABirAKACDywXQSN3AKCNQAAR5D9/wMkAIACPCQYIwElIIIAAgDGOAgAZTUCgAI87V1HoLBdBK3e +G0alIUhgAAAAo6TcG0OlJDgJAgQA4jAKAEAQCADiMN4bQ5UMAGQ1wAOFNQQAYzgEAAIkAACGkAAA +oqzeG0OlCADiMAgAQBAQAOIw3htClcADhDUIAAMkCABCOAAAg6zeG0KlEADiMAgAQBAgAOIw3htC +lcADhDUQAAMkEABCOAAAg6zeG0KlIADiMAgAQBCAAOIw3htClcADhDUgAAMkIABCOAAAg6zeG0Kl +gADiMHQAQBBgG0cmwAODNYAAAiRCsAs8AABirAMAcTXeG0KVAAAjkoAAQjggAGMwWQBgEN4bQqUg +AAIkAAAiogKAAzwPXmKQAAAAAHUAQBQhQAAAsBtClQAAAAAAAUIwTgBAEAKABjwCgAc87F3ikAAA +AABJAEAQAoAJPAKABDz4XYKMGF4kjRxeJY0hGAAAIRBEACswRAAhGGUAIRhmABheIq0cXiOt7F3k +kAIAAiT/AIQwBwCCEAKABDzsXeKQAwADJP8AQjBaAEMUAoAFPAKABDwKXoKQAAAAAP//QiQKXoKg +Cl6DkAAAAAAHAGAQAoACPPJdQ5AAAAAAAwBgFAAAAABbAAARgACGNQpegpAAAAAABgBAFAKABTwC +gAI8CV5DkAAAAAAKXoOgAoAFPAdeopACgAM8AgAEJBAAQjQHXqKg8V1ikCEoAAD/AEIwgDACACEw +wgC5IAAMADMGAEKwAjxEAAQkAwBCNAAARKACgAM87l1ikAAAAAAPAEIwBABCKAUAQBACgAY8BAAE +JEsuAAwBAAUkAoAGPLBdxIxgG0cm3BvllBAAAjwlIIIAQbADPCWwAjx//6UwsANCNAgAYzQAAESs +AABlpLBdxKzcG+WkYBtHJtwb4pQAAAAAJBBQAAAwQjAGAEAQAAAAAN4b4pQAAAAAABBCOAAgQjTe +G+KkHAC/jxgAso8UALGPEACwjwgA4AMgAL0nNjcACN4bRqUBAAgkD15goHI3AAgAAAAAB16ikAKA +AzwCAAQkEABCNAdeoqDxXWKQISgAAP8AQjCAMAIAITDCALkgAAwAMwYARAACJAAAIqK6NwAIAoAD +PIQAhDUAAIKMAoAIPAAAxIwUXgaNIRAAABheKI0cXimNAABlkSUQRAAhEEYA+/8EJCQopAAjQAIB +AABloQQAABEBAAYkgBAIACEQSACAMAIAAQAEJLkgAAwhKAAAQrACPCIAAyQDAEI0AABDoMQ3AAgC +gAY88P+9JwgAsq8EALGvAACwrwBACUAAaApAAHACQABgC0AlsAU8GAOnNAAA5owBgAI8HAOjNFzg +QiQAAGasAADirIAAg4x8AqI0gAKmNIQCpzSIAqg0AABDrAAAyawAAOqsAAALrXQAg4yMAqI0kAKn +NAAAQ6wIAIaMlAKoNJgCqTQAAOasDACCjJwCpjSgAqc0AAACrRAAg4ykAqg0qAKqNAAAI60UAIKM +rAKpNLACqzQAAMKsGACDjLQCrDS4Aq00AADjrBwAgoy8Aqc0wAKuNAAAAq0gAIOMxAKoNMgCrzQA +AEOtJACCjMwCqjTQArA0AAAirSgAg4zUAqk02AKxNAAAY60sAIaMcAKrNHQCsjQAAIatMACCjHgC +pjRsA6w0AACirTQAg4wCgAI8AADjrDgAhYzgyEeMAADFrTwAgowAAAAAAAACrUAAg4wAAAAAAADj +rUQAgowAAAAAAABCrUgAg4wAAAAAAAADrkwAgowAAAAAAAAirVAAg4wAAAAAAAAjrlQAgowAAAAA +AABirVgAg4wAAAAAAABDrlwAgowAAAAAAADCrCEQ4AAAAIKtAQDnJCEQ4AABAOckAACCrYI4AAgh +EOAAAYAbPCTieyclsBo8GANaJwAAW68h2KADgtobAIDaGwAIAHsnBABhrwgAYq8MAGOvEABkrxQA +Za8YAGavHABnryAAaK8kAGmvKABqrywAa68wAGyvNABtrzgAbq88AG+vEkAAABBIAAAAcApAQABw +r0QAca9IAHKvTABzr1AAdK9UAHWvWAB2r1wAd69gAHivZAB5r2gAfK9sAH2vcAB+r3QAf694AGiv +fABpr4AAaq8AaBpAJbAbPBwDezcAAAAAAAB6r38AWzMwAGATAAAAACWwGzwwA3s3AAAAAAAAeq8A +AAAAIdigA4LaGwCA2hsACAB7JwQAYa8IAGKvDABjrxAAZK8UAGWvGABmrxwAZ68gAGivJABprygA +aq8sAGuvMABsrzQAba84AG6vPABvrxJAAAAQSAAAAHAKQEAAcK9EAHGvSAByr0wAc69QAHSvVAB1 +r1gAdq9cAHevYAB4r2QAea9oAHyvbAB9r3AAfq90AH+veABor3wAaa+AAGqvFzgACCEgYAMAAAAA +JbAIPCADCDUAAAAAAAAarQAEWzMKAGATAAAAAAGACDzgxwglAAAAACWwGzwkA3s3AAAAAAAAaK8J ++AABAAAAAAAIWzMlsAg8KAMINQAAAAAAAButBgBgEwAAAAABgAg8MNwIJQAAAAAJ+AABAAAAAAKA +GjywXVonBABblyWwCDwwAwg1AAAAAAAAG60YAGATAAAAAAjomycAAAAABABhj/wDcHt8AGJ7vABk +e/wAZns8AWh7EwAAAhEAIAJ8AWp7vAFse/wBbns8AnB7fAJye7wCdHv8AnZ7PAN4e3wDfHu8A357 +gAB7j3Q5AAgAAAAAIdigA4LaGwCA2hsACAB7JwgAW6/8650nAABKjwAAAAAhAEARAAAAAAKACDwQ +XQglIUgAACFYAAABAGslGgBAESRwSwEUAMARAQAEJAAAAAAEAESjJlBLAQAASq+AgAkAIYAIAgAA +EI4AAAAACfgAAgAAAAABgBs8/OR7JyWwGjwYA1onAABbrwKAGjywXVon4f8AEAAAAAABACklQFgL +ADc5AAgAAAAAAoAbPLBdeychYAAABABspwgAeo8AAAAA+P9aJwAAWo8AAAAACABaJ4QARI8AAAAA ++f+AEAAAAAAEAEGP/ANQe3wAQnu8AER7/ABGezwBSHsTAAACEQAgAnwBSnu8AUx7/AFOezwCUHt8 +AlJ7vAJUe/wCVns8A1h7fANce7wDXnuAAFuPAAAAAAgAYAMQAABCAGAFQEIoBQBAKAUAAGCFQAQA +gawIAIKsDACDrCAAiKwkAImsKACKrCwAi6wwAIysNACNrDgAjqw8AI+sEkAAABBIAABAAJCsRACR +rEgAkqxMAJOsUACUrFQAlaxYAJasXACXrGAAmKxkAJmsaACcrGwAnaxwAJ6sdACfrHgAiKx8AIms +gACfrPj/hCQAAISMAAAAAAgAhCSEAIaMAAAAAPn/wBAAAAAAIdiAAAEAujQEAGGP/ANwe3wAYnu8 +AGR7/ABmezwBaHsTAAACEQAgAnwBanu8AWx7/AFuezwCcHt8AnJ7vAJ0e/wCdns8A3h7fAN8e7wD +fnuAAHuPAAAAAAgAYAMAYJpAAGAFQEIoBQBAKAUAAGCFQAQAgawIAIKsDACDrCAAiKwkAImsKACK +rCwAi6wwAIysNACNrDgAjqw8AI+sEkAAABBIAABAAJCsRACRrEgAkqxMAJOsUACUrFQAlKxYAJas +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 +GAC9JzFDAAh4HAKuYBtQJHAIAiQ0HAKu4AgDJEQIAiQ4HAOuRBwCrngIAyQMCAIkSBwDrkwcAq4U +CAMkKAgCJFAcA65UHAKuLAgDJFgIAiRYHAOuXBwCrlgMAyRcDAIkYBwDrmQcAq4cDAMkGAwCJCgI +pDRoHAOuZAgFJGwcAq6IDAMkjAwCJDEcBqJAHAWucBwDrnQcAq76WwAMPBwFrgABQjArAEAUvAgC +JKQIAiQxQwAIeBwCrgKAAjxgG0IkrAgDJHgcQ6x0CAMk5AgEJDQcQ6xMCAMkOBxErEQcQ6x8CAQk +DAgDJEgcRKxMHEOsHAgEJDgIAyRQHESsVBxDrDwIBCRcCAMkWBxErFwcQ6xoDAQkbAwDJGAcRKxk +HEOsLAwEJCgMAyRsCAUkaBxErGwcQ6yYDAQknAwDJDEcRqBAHEWscBxErHQcQ6xbQwAIPBxFrDFD +AAh4HAKuukMACCEYAAAgAGIsBgBAEAAAAAAGEGQAAQBCMPr/QBABAGMk//9jJAgA4AMhEGAA2P+9 +JxQAsa///wIkIYigABwAs68YALKvIAC/rxAAsK8hkMAAISjAAAsAIhIhmIAAJlwADAAAAAAhICAC +tUMADCGAQAAnKBEAJCiwAAQQUgAlKKIAISBgAiAAv48cALOPGACyjxQAsY8QALCPA1wACCgAvScC +gAI8ITCAAKQ3RIzBQwAI//8FJOD/vScYAL+vFACxrxAAsK8mXAAMIYigACGAQAC1QwAMISAgAiSA +EQIGEFAAGAC/jxQAsY8QALCPCADgAyAAvSfY/70nGACyrwKAEjxgG1ImFACxryGIgAAkCAQkJAC/ +ryAAtK8cALOvJlwADBAAsK9YHESOIaBAACZcAAzAjREA/38FPH+AAzz//6U0//9jNCQohQIkCAQk +A1wADCSAQwAsHwAMAQAEJACAEzxYHESOJYARAiWAEwIDXAAMISgAAiwfAAwBAAQkJSiTAgNcAAwk +CAQkLB8ADAEABCR4HESODwAFPCQAv48gALSPHACzjxgAso8UALGPEACwj///pTTjQwAIKAC9J+D/ +vScUALGvAoARPBAAsK8YAL+vYBsnJjMc5ZABgAM8JbACPJQQYyQYA0I0AgAGJAAAQ6w0AKYQIYCA +AAMAAyQ6AKMQLgACLhAAAi4HAEAQAAAAAP8ABDIYAL+PFACxjxAAsI/zQwAIIAC9J/r/phT/AAQy +MRzkkAEAAiQzAIIQAgCCKDgAQBQAAAAAOACFEGAbIiYuAIMQAAAAAAAIBCTjQwAM//8FJP/8Bjz/ +/8Y0JDBGAAAIBCTBQwAM//8FJGAbIiYxHESQAQADJAcAgxACAIIoLABAFAIAAiQsAIIQAwACJNv/ +ghQAAAAAYBsiJjQcRIwPAAU8wUMADCEwAAA7RAAI/wAEMiUAgizM/0AUAwADJBgAv48UALGPEACw +jyEQAAAIAOADIAC9J8f/QBQQAAIuGAC/jxQAsY8QALCPIRAAAAgA4AMgAL0nYBsiJjQcRIwPAAU8 +wUMADA8ABiRNRAAIAAgEJMz/gBRgGyImNBxEjA8ABSTBQwAMDwAGJE1EAAgACAQksv+AFAAAAABg +GyImNBxEjA8ABSTBQwAMITAAADtEAAj/AAQy4P+9JxQAsa8CgBE8YBsoJjMcBpEBgAM8JbACPEAS +YyQYA0I0AgAHJBgAsq8QALCvHAC/rwAAQ6whkKAAOQDHEP8AkDADAAMkPwDDEC4AAi4QAAIuDABA +EAAAAAAPAAQ8//+ENCQgRAIAFRAAHAC/jxgAso8UALGPEACwjyUgRADeQwAIIAC9J/X/xxQPAAQ8 +MRwEkQEAAiQzAIIQAgCCKDgAQBQAAAAAOACGEGAbIiYuAIMQAAAAAAAIBCTjQwAM//8FJP/8Bjz/ +/8Y0JDBGAAAIBCTBQwAM//8FJGAbIiYxHESQAQADJAcAgxACAIIoLABAFAIAAiQsAIIQAwACJNb/ +ghQAAAAAYBsiJjQcRIwPAAU8wUMADCEwAACoRAAIDwAEPCUAAi7H/0AUAwADJBwAv48YALKPFACx +jxAAsI8IAOADIAC9J8H/QBQAAAAAHAC/jxgAso8UALGPEACwjwgA4AMgAL0nYBsiJjQcRIwPAAU8 +wUMADA8ABiS/RAAIAAgEJMz/gBRgGyImNBxEjA8ABSTBQwAMDwAGJL9EAAgACAQkrf+AFAAAAABg +GyImNBxEjA8ABSTBQwAMITAAAKhEAAgPAAQ86P+9JxAAsK8hgIAAFAC/r/NDAAwhIAAAQAFENCEY +QAAfAAIuACMEABAAQBAQAAUuAAFkNAYAoBAAIwQAIRAAAhQAv48QALCPCADgAxgAvSfeQwAM8f8Q +JiEQAAIUAL+PEACwjwgA4AMYAL0n3kMADOL/ECYhEAACFAC/jxAAsI8IAOADGAC9J+D/vSclsAI8 +GAC/rxQAsa8QALCvISCCAAAAkIwhiKAAtUMADCEgoAAkgBECBhBQABgAv48UALGPEACwjwgA4AMg +AL0n2P+9JyWwAjwYALKvIZCCAP//AiQcALOvFACxryAAv68QALCvIYigACEgoAAhGEACEACiECGY +wAAAAFCOtUMADAAAAAAnGBEAJBhwAAQQUwAlGGIAAABDriAAv48cALOPGACyjxQAsY8QALCPCADg +AygAvScgAL+PHACzjxgAso8UALGPEACwjygAvScAAGasCADgAwAAAAAlsAI8ITiCAP//AiQnQAUA +CACiECQYxQAAAOKMAAAAACQQAgElEEMAAADirAgA4AMAAAAAAADmrAgA4AMAAAAA4P+9JxAAsK// +/wIkIYCgABgAsq8UALGvHAC/ryGIwAAhKMAACAACEiGQgAAmXAAMAAAAACcoEAAkKKIAJBAwAiUo +ogAhIEACHAC/jxgAso8UALGPEACwjwNcAAggAL0nAYACPCWwAzzQ/70nDBZCJBgDYzQgALKvAABi +rCGQgAAQAKQnJACzrxwAsa8hmMAAIYigACgAv6+KQAAMGACwrw8AAjz//0I0ISBAAgoAIhIhKGAC +JUQADAAAAAAhICACtUMADCGAQAAnKBEAJCiwAAQQUwAlKKIAkEQADP8ARDKQQAAMEACkJygAv48k +ALOPIACyjxwAsY8YALCPCADgAzAAvScBgAM8JbACPLAWYyQYA0I04P+9JwAAQ6wYAL+vFACxrxAA +sK8lRAAMIYigACGAQAC1QwAMISAgAiSAEQIGEFAAGAC/jxQAsY8QALCPCADgAyAAvSfQ/70nJAC1 +r/8AhDAhqMAAKAC2rxwAs68sAL+vIAC0rxgAsq8UALGvEACwryGwoADwQgAMIZgAACEAoBaAEBMA +/0UACAAAAAD9AAIkIwACEgUABCT8AAIkNwACEgAAAAD7AAIkMAACEjIABCT6AAIkLQACEgUABCT5 +AAIkKQACEg8ABTwEANGM//+lNCEgAAKDRQAMITAgAiwfAAwBAAQkGQACJCgAAhIhkAAAAgBiJv8A +UzArGHUCDwBgEIAQEwAhMFYAAADQjP8AAiQKAAIS/gACJNz/AhYyAAQkLB8ADAAAAAACAGIm/wBT +MCsYdQLz/2AUgBATACwAv48oALaPJAC1jyAAtI8cALOPGACyjxQAsY8QALCPAQACJAgA4AMwAL0n +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 +yABCNCAAAqb0VAAMBgAGJCWwAzxQAGI0AABEjFQAZTRYAGY0GACkrwAAooxcAGM0KgAEJhwAoq8A +AMeMGAClJwYABiQgAKevAABijBoAEiT0VAAMJACirzAABCYgAKUn9FQADAYABiQTAAMkFAAjrgwA +Mq4IAAWOBAAEjv/fAjwUAAaO//9CNBAAB47/4AMkJCiiAABAAjwkIIMAJSiiAP+BAyT+/wI8JDDD +AP//QjQAEoQ0AIADPCQgggAlOOMAACbGNIAApTQgAAIkAAASphAAB64CAAKiFAAGrgQABK4IAAWu +NAC/jzAAso8sALGPKACwjwgA4AM4AL0nsP+9JzwAta80ALOv///1MCWwEzwBgAI8LACxrxgDYzZU +QEIkIACxJkgAvq9EALevOAC0r2QAt5NgALSTIfCAAAAAYqwhICACQAC2rzAAsq9MAL+vKACwr/8A +tjBTIQAM/wDSMBIAQBQkAKKvAoAEPAKABTys6IQkE1gADIjspSRMAL+PSAC+j0QAt49AALaPPAC1 +jzgAtI80ALOPMACyjywAsY8oALCPCADgA1AAvScIAEOMsANiNgKAEDwAAEOsJACijyEwIAIhKAAA +CABElONUAAwlIJAAJACjjwAAAAAIAGKUAAAAACWIUABcAIAWIAAwJiAAMqZIAAIkegBCEsgAAiR5 +AEISUABiNgQAAiRWAMIWISjAA6QAAiSfAEISAoACPCQAoo8lsBA8sAMQNgwAVawkAKKPEgADJCEo +AAAUAEOsAAAVriQAoo8IAAYkCABDjAAAAAAAAAOuJACijwKAAzwIAESUAAAAACWIgwDsVAAMISAg +AgQAJY4IACSO/98CPP/gAyT//0I0FAAmjiQoowAkIIIAAEACPBAAJ44lIIIA4P8DJAASpTT/4AI8 +JCijAP//QjT/gQMkJDDDACQgggAABQM8AIACPCU44gAlIIMABQClNCAAAiQIACSuAAA1pgIAIqIU +ACauEAAnrgQAJa6KQAAMIACkJwKAAjwkAKOPmFRCJAQARIwAAGKsBABDrCQAoicAAIOsBABkrCAA +pCcAAAKukEAADAAAAABMAL+PSAC+j0QAt49AALaPPAC1jzgAtI80ALOPMACyjywAsY8oALCPCADg +A1AAvScAEEI2U1AACCAAIqYEAAQm9FQADAYABiQCgAU8SDelJAoABCb0VAAMBgAGJAKABTy0VaUk +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 +AgAQJAKABDwAgAY8nDkwouhUhCSYW8YkzyAADCEoAAACgAQ8AYAGPLg5MKIEVYQkkDvGJM8gAAwh +KAAAAoAEPAGABjzUOTCiIFWEJAg5xiTPIAAMISgAAAKABDwBgAY88DkwojxVhCR0RMYkzyAADCEo +AAACgAQ8AIAGPAw6MKJYVYQk/FrGJM8gAAwhKAAACQACJLhAIqLHPSCiOkEgosg9IKYYAL+PFACx +jxAAsI8IAOADIAC9JwOABTwAgKUk2P+9J0AQDTz//6UwAoACPGAbQiQgAL6vJfCtACw4XqwAAd4n +ODherAAB3iccALevGAC2rxQAta8QALSvDACzrwgAsq8EALGvAACwr0Q4XqwAAd4nUDherKobRJAA +Ad4nXDherAAB3idoOF6sILAGPDg4SIxEOEmMUDhKjFw4S4xoOEyMACIEAAABxzT/HwM8AAHeJ/// +YzQhOIcAISCGACQ44wAgEAY8JCCDAHQ4XqwhcMADJSitACWwDzwAAd4nKDhFrDQ4SKxAOEmsTDhK +rOw3RKxYOEus+DdHrGQ4TKysAOM1wDdGrLw3RqzMN0asyDdGrIA4XqzwN0Ss/DdHrHA4TqzYN0as +1DdGrOQ3RqzgN0asCDhGrAQ4RqysG0eUAALeJwAAaYwhEAU8mDherLAA4zUAAHmMgDhUjACApDQj +EA08IhAQPAKAFjwCgBc8AoAYPAKAEzwjIIcAAoADPCQQBzzAVGgkzDhErCGowAPIVM4mAATeJ9BU +6ibYVAsn4FRsJgAEsTUBACklAEASNgAB7zUBAAMkAoAEPHw4VKyFOEOglDhVrPw4UazAOEms8DhS +rOQ4WawAAOet4DhHrAA5RqwUOEasEDhGrJ44QKSdOECgnDhAoPQ4Taz4OE2suDhFrLw4RazEOEWs +yDhFrOg4UKzsOFCs3DhHrAQ5RqwQOV6sDDlerAQASq3IVM6uBABrrdBU6q4EAIyt2FQLrwQACK3g +VGyuwFSIrAQAzq0CgAQ8GBiDJAKABTwAGKIkGBiDrAKABDwEAAKtABiorMBUgqwhSGAACABerAEA +ByQEAGOsAAHeJwQASKwQAECsIUBAACEYwAEhKAAADwAGJCEgqQAhEKgA///GJCAAXqwoAEesGACl +JAAAjqwEAIOsAABkrAAB3if1/8EEIRiAAAKAAjzQVEgkAoADPAKAAjwEAAeNmBlLJAQAxK0AGGok +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 +HgAecngMAAAeAB9yAA4AAP////8GBgYEBA4AAP////8EAgIACA4AAAD/AAAAAAAAEA4AAP////8K +CAgEFA4AAP////8EAgIAGA4AAP////8KCAgEHA4AAP////8EAgIAAA4AAP////8AAAAABA4AAP// +//8AAAAACA4AAAD/AAAAAAAAEA4AAP////8AAAAAFA4AAP////8AAAAAGA4AAP////8AAAAAHA4A +AP////8AAAAAAA4AAP////8AAAAABA4AAP////8AAAAACA4AAAD/AAAAAAAAEA4AAP////8AAAAA +FA4AAP////8AAAAAGA4AAP////8AAAAAHA4AAP////8AAAAAAA4AAP////8AAAAABA4AAP////8A +AAAACA4AAAD/AAAAAAAAEA4AAP////8AAAAAFA4AAP////8AAAAAGA4AAP////8AAAAAHA4AAP// +//8AAAAABAgAAA8AAAADAAAAJAgAAA8A8AAEADAALAgAAA8A8AAEADAAcAgAAAAAAAQBAAAAZAgA +AAAEAAABAAAAeAgAAA8ADwACAAIAdA4AAAAAAA8GAAAAeA4AAAAAAA8GAAAAfA4AAAAAAA8GAAAA +gA4AAAAAAA8GAAAADAkAAP8AAAAzAAAABAwAAP8AAAAzAAAABA0AAA8AAAADAAAA9AEAAAAA//// +/wAANAIAAAAAAPgTAAAABAgAAA8AAAADAAAAJAgAAA8A8AAEADAALAgAAA8A8AACADAAcAgAAAAA +AAQBAAAAZAgAAAAEAAAAAAAAeAgAAA8ADwACAAAAdA4AAAAAAA8CAAAAeA4AAAAAAA8CAAAAfA4A +AAAAAA8CAAAAgA4AAAAAAA8CAAAADAkAAP8AAAARAAAABAwAAP8AAAAzAAAABA0AAA8AAAADAAAA +9AEAAAAA//93dwAANAIAAAAAAPgKAAAARAgAAP////8AAAEABAgAAA8AAAABAAAAJAgAAA8A8AAE +ADAALAgAAA8A8AACABAAcAgAAAAAAAQBAAAAZAgAAAAEAAAAAAAAeAgAAA8ADwACAAAAdA4AAAAA +AA8CAAAAeA4AAAAAAA8CAAAAfA4AAAAAAA8CAAAAgA4AAAAAAA8CAAAADAkAAP8AAAARAAAABAwA +AP8AAAARAAAABA0AAA8AAAABAAAA9AEAAAAA//93dwAANAIAAAAAAPgKAAAAHAAAAAAAAAcACAAA +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 +/wAAAAAAAAAAAAAAAAEBA/8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAANDfAYDQ3wGAMRAQAAAwAAAx +IBAAADAAADEoEAAAMAAAMSwQEAAwAAAxLxAQADAAADEwGAAAMAAAMTAgEAAwAAAiIBgIACAAACIh +FAgAIAAAIiEcCAAgAAAiISAIACAAACIhIBAAIAAAIiEgGAAgAAAaGRgQABgAABIREAgAEAAACgkI +AAAIAAAKCQgCAAgAAAoJCAQACAAACgkIBgAIAAAIBwYEAAYAAAYFBAIABAAABgUEAwAEAAAFBAMC +AAMAAAkIBwYHBgYFBQQEAwYFBQQEAwMDBQQEAwMCAgIACQgHBgcGBgUFBAQDBQQEAwMCAgIEAwMC +AgEBAQAAAAgICAgICAgICBAQIAgICAggICAgCAgICAggICAwCAgICBgYGBgYIDAwECAgICAgMDAI +ECAwMDAwMDAAAAgICAgICAgICBAQIAgICAgIICAgCAgICAggICAgCAgICBgYGBgYIDAwECAgICAg +MDAIECAwMDAwMDAAAAoJCAQACgkIBAAKCQgEAAoJCAQACgkIAAAKCQgAAAoJCAAACgkIAAAKCQgA +ABIREAgAEhEQCAAiISAYAAoJCAAACgkIAAAKCQgAAAoJCAAAIiEgGAAiISAYACIhHAgAIiAYCAAK +CQgCAAoJCAIACgkIAgAKCQgCAAoJCAAAIiEgEAAiISAIACIhHAgAMTAYAAAKCQgEAAoJCAQACgkI +BAAKCQgEABoZGBAAGhkYEAAaGRgQABoZGBAAGhkYEAAiISAIADEsEBAAMSgQAAASERAIACIhIBgA +IiEgGAAiISAIACIhFAgAIiAYCAAxMCAQADEsEBAACgkIAAASERAIACIhIBgAIiEgGAAxMCAQADEv +EBAAMS8QEAAxEBAAADEsEBAAAAAKCQgEAAoJCAQACgkIBAAKCQgEAAoJCAAACgkIAAAKCQgAAAoJ +CAAACgkIAAASERAIABIREAgAIiEgGAAKCQgEAAoJCAQACgkIAgAKCQgAAAoJCAAAIiEgGAAiIRwI +ACIhFAgACgkIAgAKCQgCAAoJCAIACgkIAgAKCQgAACIhIBAAIiEgCAAiIRQIACIhFAgACgkIBAAK +CQgEAAoJCAQACgkIBAAaGRgQABoZGBAAGhkYEAAaGRgQABoZGBAAIiEgCAAxLBAQADEoEAAAEhEQ +CAAiISAYACIhIBgAIiEgCAAiIRQIACIgGAgAMTAgEAAxLBAQAAoJCAAAEhEQCAAiISAYACIhIBgA +MTAgEAAxLxAQADEvEBAAMRAQAAAxLBAQAAAAAQIECAIECAwQGCAwAgQIDBAYIDAGDBAYJDA8SEgA +AAAAAAAAAAAAAAAlJywZGx4gIykqKwAAAAAlKSsuLgAAAAQAAAAEAAAACAAAABAAAAAYAAAAJAAA +ADAAAABIAAAAYAAAAJAAAADAAAAA2AAAAFAAAAB4AAAAoAAAAMgAAABAAQAAkAEAAOABAAAwAgAA +LAEAAEABAADgAQAA0AIAAIAMAACADAAAgAwAAKAPAACgDwAAAgAAAAIAAAAEAAAACAAAAAwAAAAS +AAAAGAAAACQAAAAwAAAASAAAAGAAAABsAAAAKAAAADwAAABQAAAAZAAAAKAAAADIAAAA8AAAABgB +AABkAAAAoAAAAPAAAABoAQAAQAYAAEAGAABABgAA0AcAANAHAABUhgGATMQAgEzEAIBMxACATMQA +gJzCAIBchgGAVIYBgFSGAYAAAAAAAAAAAESLAYBEiwGARIsBgESLAYA0hgGAMIoBgDyGAYBEhgGA +TIYBgAAAAAAAAAAACAQECAICAQGAAAAAUlRMODcxMiBGVyB2ZXJzaW9uIDAuMC4xIyDkuIAgNeac +iCAzMSAxNToyNTozOSBDU1QgMjAxMCAgU1ZOOiAlZAAAAABDaGlwIFZlcnNpb246JXgASENJIHR5 +cGU6ICV4KCV4KQoAAAByZl9jb2ZpZzogJXgoJXgsICV4LCAleCkKAAAAbXBfbW9kZTogJXgoJXgp +LCBJUUs6ICV4CgAAAHZjcyB0eXBlOiAleCgleCkKAAAAMzJrIGNhbGlicmE6ICVkLCAzMksgVFNG +OiAleAAAAAB0YXJnZXQgdGhlcm1hbDogJXgsICBidF9jb2V4aXN0OiAleAoAAAAAVKoBgCSpAYAk +qQGAJKkBgByqAYAkqQGAJKkBgCSpAYDkqQGAJKkBgCSpAYAkqQGAJKkBgCSpAYAkqQGAJKkBgKyp +AYAkqQGAJKkBgCSpAYB0qQGAJKkBgCSpAYAkqQGAPKkBgCSpAYAkqQGAJKkBgPyoAYBkBQCAWAUA +gEwFAIBABQCANAUAgCgFAIAcBQCAEAUAgAQFAID4BACAsAQAgGAbAoCwAyWwYBsCgGAbAoBgGwKA +YBsCgHJlcGVhdGVkIGVsZW1lbnQgSUQ6ICV4LCBjbWQgc2VxPSV4LCBoMmRzZXE9JXgKAGpvaW5i +c3NfaGRsAGdldCBqb2luIGNtZAoAAABObyBpcnAgJXMKAABzZXQgb3Btb2RlOiAleAoAZ2V0IHN1 +cnZleSBjbWQKAFNTSUQ6ICVzCgAAAHNldEF1dGg6ICV4CgAAAAByY3Ygc2V0X3N0YWtleQoAVHhf +QmVhY29uX2hkbAAAAHR4IGJlYWNvbiBjbWQoJXgpCgAAVXBkYXRlIE1hY0FkZHIKAAAOBA4QDhQO +GA4cDk9uQXNzb2NSZXEAAE9uQXNzb2NSc3AAAE9uUmVBc3NvY1JlcQAAAABPblJlQXNzb2NSc3AA +AAAAT25Qcm9iZVJlcQAAT25Qcm9iZVJzcAAAT25CZWFjb24AAAAAT25BVElNAABPbkRpc2Fzc29j +AABPbkF1dGgAAE9uRGVBdXRoAAAAAE9uQWN0aW9uAAAAAE9uUW9zTnVsbAAAAE9uRXhjZXB0aW9u +AEFUSU06ICV4CgAAAAIEBAcHDQ0NAgcHDQ0PDw8PAAAAAQECAwQFCBByZXBvcnRfc3VydmV5X2Rv +bmUAAHN1cnZleSBkb25lKCV4LCAleCkKAAAAAE5vIGlycCAlcwoAAHJlcG9ydF9qb2luX3JlcwBO +byBpcnAoJXgpICVzCgAAam9pbiByZXMoJXgsICV4KQoAAAByZXBvcnRfZGVsX3N0YV9ldmVudAAA +AABkZWwgc3RhCgAAAAByZXBvcnRfYWRkX3N0YV9ldmVudAAAAABhZGQgc3RhOiV4LCAleAoAcmN2 +IGRpc2Nvbm5lY3QKAGlzc3VlX3Byb2JlcmVxAABObyBpcnAgQCVzCgBXTU0oJXgpOiAleCwgJXgK +AAAAAGFzc29jIHJlamVjdCwgc3RhdHVzOiAlZAoAAABtYWMgaWQgIzU6ICV4LCAleCwgJXgKAABp +c3N1ZV9wcm9iZXJzcAAAcmVwb3J0X0JTU0lEX2luZm8AAABwYWNrZXQgdG9vIGxhcmdlKCV4KQoA +AAAAUPIBaW52YWxpZCBjYXA6JXgKAElCU1MgbW9kZSwgY3VyIGNoYW5uZWw6ICV4LCBiY24gaW50 +ZXJ2YWw6ICV4CgAAAG1hYyBpZCAjNDogJXgsICV4CgAAY3VyIGNoYW5uZWw6ICV4LCBiY24gaW50 +ZXJ2YWw6ICV4CgAAaXNzdWVfYXNzb2NyZXEAAABQ8gRpc3N1ZSBhc3NvY3JlcSgleCkKAFtXQVBJ +XSBnZXQgd2FwaSBJRQoAaXNzdWVfYWN0aW9uAAAAAGlzc3VlIGFjdGlvbjogJXgsICV4LCAleCAK +AABERUxCQTogJXgoJXgpCgAAQUREQkEgUlNQOiAleAoAAGlzc3VlX2F1dGgAAGlzc3VlIGF1dGgK +AGNsbnQgYXV0aCBmYWlsZWQgZHVlIHRvIGlsbGVnYWwgc2VxPSV4CgBjbG50IGF1dGggZmFpbCwg +c3RhdHVzOiAlZAoAbm8gY2hhbGxlbmdlIHRleHQ/CgBsaW5rIHRvIHVua25vd24gQVAKAGxpbmsg +dG8gQXRoZXJvcyBBUChNQUMpCgAAAABtYWMgaWQgIyV4OiAleCwgJXgKAGxpbmsgdG8gQnJvYWRj +b20gQVAKAAAAAGxpbmsgdG8gQXRoZXJvcyBBUAoAbGluayB0byBNYXJ2ZWxsIEFQCgBsaW5rIHRv +IFJlYWx0ZWsgOTZCIEFQCgBsaW5rIHRvIENpc2NvIEFQCgAAAGxpbmsgdG8gUmFsaW5rIEFQCgAA +bGluayB0byBSZWFsdGVrIDk2QiBBUCB3aXRoIHZpZGVvIG1vZGUKAGlzc3VlX2RlYXV0aAAAAABp +c3N1ZV9kZWF1dGgKAAAAaXNzdWVfZGlzYXNzb2MAAGlzc3VlX2Rpc2Fzc29jCgBpc3N1ZV9mcmFt +ZV9sZW4AZGlzY29ubmVjdCB0aW1lcjogbm8gYmVhY29uCgAAAABkaXNjb25uZWN0KG5vIGRhdGEg +cmN2ZCkKAAAAaXNzdWUgUW9zTnVsbCglZCkAAABgGwKAsAMlsBgDJbBERDMzBgAqsLhJAYC4SQGA +tEkBgLhJAYA4SgGAuEkBgLhJAYC4SQGAuEkBgLhJAYC4SQGALEoBgCBKAYC4SQGAuEkBgLhJAYC4 +SQGAuEkBgBRKAYC4SQGAuEkBgLhJAYAISgGAuEkBgPxJAYC4SQGAuEkBgLhJAYC4SQGAuEkBgLhJ +AYC4SQGAuEkBgLhJAYC4SQGAuEkBgPBJAYC4SQGAuEkBgLhJAYC4SQGAuEkBgLhJAYC4SQGAuEkB +gLhJAYC4SQGAuEkBgORJAYC4SQGAuEkBgLhJAYC4SQGAuEkBgLhJAYC4SQGAuEkBgLhJAYC4SQGA +uEkBgLhJAYC4SQGAuEkBgLhJAYC4SQGAuEkBgLhJAYC4SQGAuEkBgLhJAYC4SQGAuEkBgNhJAYC4 +SQGAuEkBgLhJAYC4SQGAuEkBgLhJAYC4SQGAuEkBgLhJAYC4SQGAuEkBgLhJAYC4SQGAuEkBgLhJ +AYC4SQGAuEkBgLhJAYC4SQGAuEkBgLhJAYC4SQGAuEkBgMxJAYC4SQGAuEkBgLhJAYC4SQGAuEkB +gLhJAYC4SQGAuEkBgLhJAYC4SQGAuEkBgMBJAYD4SgGA7EoBgOBKAYDUSgGAyEoBgLxKAYCwSgGA +pEoBgJhKAYCMSgGAgEoBgHRKAYAAUPIBAFDyAgAPrAIwMTIzNDU2Nzg5QUJDREVGAAAAACVkLgAl +aGhYOgAAAOzuAYBnZmZmh3wAgF18AIA3fACAEXwAgMF7AICbewCA63sAgHVwZGF0ZSBjYW0gZW50 +cnkgKCV4LCAleCkKAAAtPigleCwgJXgsICV4LCAleCkKAAACAAAICQAA34gAgOWIAIDriACA8YgA +gN+IAIDfiACA34gAgN+IAID3iACA/YgAgAOJAIAJiQCAYBsCgFVuaSBPazogQVAgZXhpc3QAAAAA +AADA/////w///8D/////DwAA/wP+AYB/4gGAeMcBwHGuAYBrlQFAZX8BwF9pAUBaVQFAVUIBgFAw +AQBMHwHARw8BwEMAAQBA8gCAPOQAADnXAMA1ywDAMsAAADC1AEAtqwDAKqIAgCiYAAAmkAAAJIgA +ACKAAAAgeQBAHnIAgBxsAAAbZgCAGWAAABhbAMAWVgCAFVEAQBRMAAATSAAAEkQAABFAAAAQNjUu +JRwSCQQzMisjGhEIBDAvKSEZEAgDLS0nHxgPCAMrKiUeFg4HAygoIhwVDQcDJiUhGxQNBgMkIx8Z +EwwGAyIhHRgRCwYCICAbFhEIBQIfHhoVEAoFAh0cGBQPCgUCGxoXEw4JBAIaGRYSDQkEAhgXFREM +CAQCFxYTEAwIBAIWFRIPCwcEARQUEQ4LBwMCExMQDQoGAwESEg8MCQYDARERDwwJBgMBEBAOCwgF +AwEPDw0LCAUDAQ4ODAoIBQIBDQ0MCgcFAgENDAsJBwQCAQwMCgkGBAIBCwsKCAYEAgELCgkIBgQC +AQoKCQcFAwIBCgkIBwUDAgEJCQgGBQMBAQkIBwYEAwEBNjUuGwAAAAAzMisZAAAAADAvKRgAAAAA +LS0XFwAAAAArKiUVAAAAACgoJBQAAAAAJiUhEwAAAAAkIx8SAAAAACIhHREAAAAAICAbEAAAAAAf +HhoPAAAAAB0cGA4AAAAAGxoXDgAAAAAaGRYNAAAAABgXFQwAAAAAFxYTCwAAAAAWFRILAAAAABQU +EQoAAAAAExMQCgAAAAASEg8JAAAAABERDwkAAAAAEBAOCAAAAAAPDw0IAAAAAA4ODAcAAAAADQ0M +BwAAAAANDAsGAAAAAAwMCgYAAAAACwsKBgAAAAALCgkFAAAAAAoKCQUAAAAACgkIBQAAAAAJCQgF +AAAAAAkIBwQAAAAAcmVzZXQoJXgpCgAAUFMAAOiGAYBYhwGAFIcBgFiHAYBYhwGAWIcBgFiHAYDA +hgGAAAECAgMDAwMEBAQEBAQEBAUFBQUFBQUFBQUFBQUFBQUGBgYGBgYGBgYGBgYGBgYGBgYGBgYG +BgYGBgYGBgYGBgcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcH +BwcHBwcHBwcHBwcHBwcHBwcICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI +CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI +CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgICAgICAgICCgoKCgoCAgICAgICAgICAgICAgI +CAgIoBAQEBAQEBAQEBAQEBAQEAQEBAQEBAQEBAQQEBAQEBAQQUFBQUFBAQEBAQEBAQEBAQEBAQEB +AQEBAQEQEBAQEBBCQkJCQkICAgICAgICAgICAgICAgICAgICAhAQEBAIAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAACgEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAEBAQEBAQEB +AQEBAQEBAQEBAQEBAQEBEAEBAQEBAQECAgICAgICAgICAgICAgICAgICAgICAgIQAgICAgICAgIt +XHwvAAAAAArWAAAAAAAA8PReAPD0XgAAAAAAAAAAAAAAAABg5V4A/////wIAAAAAAAAAAAAAALig +/Aj///// +==== diff --git a/sys/dev/ahci/ahci.c b/sys/dev/ahci/ahci.c index 78f59b77fc7b..7c29bf108944 100644 --- a/sys/dev/ahci/ahci.c +++ b/sys/dev/ahci/ahci.c @@ -196,6 +196,7 @@ static struct { {0x1e078086, 0x00, "Intel Panther Point", 0}, {0x1e0e8086, 0x00, "Intel Panther Point", 0}, {0x1e0f8086, 0x00, "Intel Panther Point", 0}, + {0x23a38086, 0x00, "Intel Coleto Creek", 0}, {0x8c028086, 0x00, "Intel Lynx Point", 0}, {0x8c038086, 0x00, "Intel Lynx Point", 0}, {0x8c048086, 0x00, "Intel Lynx Point", 0}, @@ -537,7 +538,10 @@ ahci_attach(device_t dev) (ctlr->caps & AHCI_CAP_NPMASK) + 1); } if (bootverbose && version >= 0x00010200) { - device_printf(dev, "Caps2:%s%s%s\n", + device_printf(dev, "Caps2:%s%s%s%s%s%s\n", + (ctlr->caps2 & AHCI_CAP2_DESO) ? " DESO":"", + (ctlr->caps2 & AHCI_CAP2_SADM) ? " SADM":"", + (ctlr->caps2 & AHCI_CAP2_SDS) ? " SDS":"", (ctlr->caps2 & AHCI_CAP2_APST) ? " APST":"", (ctlr->caps2 & AHCI_CAP2_NVMP) ? " NVMP":"", (ctlr->caps2 & AHCI_CAP2_BOH) ? " BOH":""); diff --git a/sys/dev/ahci/ahci.h b/sys/dev/ahci/ahci.h index c3bee40a4c6e..c44a76b9718c 100644 --- a/sys/dev/ahci/ahci.h +++ b/sys/dev/ahci/ahci.h @@ -100,6 +100,7 @@ #define ATA_SS_IPM_ACTIVE 0x00000100 #define ATA_SS_IPM_PARTIAL 0x00000200 #define ATA_SS_IPM_SLUMBER 0x00000600 +#define ATA_SS_IPM_DEVSLEEP 0x00000800 #define ATA_SERROR 14 #define ATA_SE_DATA_CORRECTED 0x00000001 @@ -205,6 +206,9 @@ #define AHCI_CAP2_BOH 0x00000001 #define AHCI_CAP2_NVMP 0x00000002 #define AHCI_CAP2_APST 0x00000004 +#define AHCI_CAP2_SDS 0x00000008 +#define AHCI_CAP2_SADM 0x00000010 +#define AHCI_CAP2_DESO 0x00000020 #define AHCI_OFFSET 0x100 #define AHCI_STEP 0x80 @@ -262,6 +266,7 @@ #define AHCI_P_CMD_ACTIVE 0x10000000 #define AHCI_P_CMD_PARTIAL 0x20000000 #define AHCI_P_CMD_SLUMBER 0x60000000 +#define AHCI_P_CMD_DEVSLEEP 0x80000000 #define AHCI_P_TFD 0x20 #define AHCI_P_SIG 0x24 diff --git a/sys/dev/aic7xxx/aic7xxx_pci.c b/sys/dev/aic7xxx/aic7xxx_pci.c index 2bf492764a32..73df3720ff8f 100644 --- a/sys/dev/aic7xxx/aic7xxx_pci.c +++ b/sys/dev/aic7xxx/aic7xxx_pci.c @@ -673,8 +673,8 @@ const u_int ahc_num_pci_devs = NUM_ELEMENTS(ahc_pci_ident_table); #define STA 0x08 #define DPR 0x01 -static int ahc_9005_subdevinfo_valid(uint16_t vendor, uint16_t device, - uint16_t subvendor, uint16_t subdevice); +static int ahc_9005_subdevinfo_valid(uint16_t device, uint16_t vendor, + uint16_t subdevice, uint16_t subvendor); static int ahc_ext_scbram_present(struct ahc_softc *ahc); static void ahc_scbram_config(struct ahc_softc *ahc, int enable, int pcheck, int fast, int large); @@ -766,7 +766,7 @@ ahc_find_pci_device(aic_dev_softc_t pci) * ID as valid. */ if (aic_get_pci_function(pci) > 0 - && ahc_9005_subdevinfo_valid(vendor, device, subvendor, subdevice) + && ahc_9005_subdevinfo_valid(device, vendor, subdevice, subvendor) && SUBID_9005_MFUNCENB(subdevice) == 0) return (NULL); diff --git a/sys/dev/ata/ata-pci.h b/sys/dev/ata/ata-pci.h index d1eb0e936f39..8b360731b7fd 100644 --- a/sys/dev/ata/ata-pci.h +++ b/sys/dev/ata/ata-pci.h @@ -274,6 +274,10 @@ struct ata_pci_controller { #define ATA_ISCH 0x811a8086 #define ATA_DH89XXCC 0x23238086 +#define ATA_COLETOCRK_AH1 0x23a38086 +#define ATA_COLETOCRK_S1 0x23a18086 +#define ATA_COLETOCRK_S2 0x23a68086 + #define ATA_ITE_ID 0x1283 #define ATA_IT8211F 0x82111283 #define ATA_IT8212F 0x82121283 diff --git a/sys/dev/ata/chipsets/ata-intel.c b/sys/dev/ata/chipsets/ata-intel.c index 6a11a2372701..d7b135d545c1 100644 --- a/sys/dev/ata/chipsets/ata-intel.c +++ b/sys/dev/ata/chipsets/ata-intel.c @@ -226,6 +226,9 @@ ata_intel_probe(device_t dev) { ATA_I31244, 0, 0, 2, ATA_SA150, "31244" }, { ATA_ISCH, 0, 0, 1, ATA_UDMA5, "SCH" }, { ATA_DH89XXCC, 0, INTEL_AHCI, 0, ATA_SA300, "DH89xxCC" }, + { ATA_COLETOCRK_S1, 0, INTEL_6CH2, 0, ATA_SA300, "COLETOCRK" }, + { ATA_COLETOCRK_S2, 0, INTEL_6CH2, 0, ATA_SA300, "COLETOCRK" }, + { ATA_COLETOCRK_AH1,0, INTEL_AHCI, 0, ATA_SA300, "COLETOCRK" }, { 0, 0, 0, 0, 0, 0}}; if (pci_get_vendor(dev) != ATA_INTEL_ID) diff --git a/sys/dev/ata/chipsets/ata-promise.c b/sys/dev/ata/chipsets/ata-promise.c index 40a7f72bbda9..62f25bd28052 100644 --- a/sys/dev/ata/chipsets/ata-promise.c +++ b/sys/dev/ata/chipsets/ata-promise.c @@ -287,6 +287,10 @@ ata_promise_chipinit(device_t dev) /* setup host packet controls */ hpkt = malloc(sizeof(struct ata_promise_sx4), M_ATAPCI, M_NOWAIT | M_ZERO); + if (hpkt == NULL) { + device_printf(dev, "Cannot allocate HPKT\n"); + goto failnfree; + } mtx_init(&hpkt->mtx, "ATA promise HPKT lock", NULL, MTX_DEF); TAILQ_INIT(&hpkt->queue); hpkt->busy = 0; diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c index ee60626a1ce1..0cfbca73cafb 100644 --- a/sys/dev/bge/if_bge.c +++ b/sys/dev/bge/if_bge.c @@ -176,6 +176,8 @@ static const struct bge_type { { BCOM_VENDORID, BCOM_DEVICEID_BCM5721 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5722 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5723 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5725 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5727 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5750 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5750M }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5751 }, @@ -195,6 +197,7 @@ static const struct bge_type { { BCOM_VENDORID, BCOM_DEVICEID_BCM5761E }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5761S }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5761SE }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5762 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5764 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5780 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5780S }, @@ -310,6 +313,7 @@ static const struct bge_revision { { BGE_CHIPID_BCM5722_A0, "BCM5722 A0" }, { BGE_CHIPID_BCM5761_A0, "BCM5761 A0" }, { BGE_CHIPID_BCM5761_A1, "BCM5761 A1" }, + { BGE_CHIPID_BCM5762_A0, "BCM5762 A0" }, { BGE_CHIPID_BCM5784_A0, "BCM5784 A0" }, { BGE_CHIPID_BCM5784_A1, "BCM5784 A1" }, /* 5754 and 5787 share the same ASIC ID */ @@ -354,6 +358,7 @@ static const struct bge_revision bge_majorrevs[] = { { BGE_ASICREV_BCM5717, "unknown BCM5717" }, { BGE_ASICREV_BCM5719, "unknown BCM5719" }, { BGE_ASICREV_BCM5720, "unknown BCM5720" }, + { BGE_ASICREV_BCM5762, "unknown BCM5762" }, { 0, NULL } }; @@ -1796,6 +1801,20 @@ bge_chipinit(struct bge_softc *sc) pci_write_config(sc->bge_dev, BGE_PCI_MSI_DATA + 2, val, 2); } + if (sc->bge_asicrev == BGE_ASICREV_BCM57765 || + sc->bge_asicrev == BGE_ASICREV_BCM57766) { + /* + * For the 57766 and non Ax versions of 57765, bootcode + * needs to setup the PCIE Fast Training Sequence (FTS) + * value to prevent transmit hangs. + */ + if (sc->bge_chiprev != BGE_CHIPREV_57765_AX) { + CSR_WRITE_4(sc, BGE_CPMU_PADRNG_CTL, + CSR_READ_4(sc, BGE_CPMU_PADRNG_CTL) | + BGE_CPMU_PADRNG_CTL_RDIV2); + } + } + /* * Set up the PCI DMA control register. */ @@ -1871,8 +1890,9 @@ bge_chipinit(struct bge_softc *sc) * a status tag update and leave interrupts permanently * disabled. */ - if (sc->bge_asicrev != BGE_ASICREV_BCM5717 && - sc->bge_asicrev != BGE_ASICREV_BCM57765) + if (!BGE_IS_57765_PLUS(sc) && + sc->bge_asicrev != BGE_ASICREV_BCM5717 && + sc->bge_asicrev != BGE_ASICREV_BCM5762) dma_rw_ctl |= BGE_PCIDMARWCTL_TAGGED_STATUS_WA; } pci_write_config(sc->bge_dev, BGE_PCI_DMA_RW_CTL, dma_rw_ctl, 4); @@ -1881,7 +1901,8 @@ bge_chipinit(struct bge_softc *sc) * Set up general mode register. */ mode_ctl = bge_dma_swap_options(sc); - if (sc->bge_asicrev == BGE_ASICREV_BCM5720) { + if (sc->bge_asicrev == BGE_ASICREV_BCM5720 || + sc->bge_asicrev == BGE_ASICREV_BCM5762) { /* Retain Host-2-BMC settings written by APE firmware. */ mode_ctl |= CSR_READ_4(sc, BGE_MODE_CTL) & (BGE_MODECTL_BYTESWAP_B2HRX_DATA | @@ -1939,7 +1960,7 @@ bge_blockinit(struct bge_softc *sc) struct bge_rcb *rcb; bus_size_t vrcb; bge_hostaddr taddr; - uint32_t dmactl, val; + uint32_t dmactl, rdmareg, val; int i, limit; /* @@ -2210,6 +2231,11 @@ bge_blockinit(struct bge_softc *sc) if (!BGE_IS_5705_PLUS(sc)) /* 5700 to 5704 had 16 send rings. */ limit = BGE_TX_RINGS_EXTSSRAM_MAX; + else if (BGE_IS_57765_PLUS(sc) || + sc->bge_asicrev == BGE_ASICREV_BCM5762) + limit = 2; + else if (BGE_IS_5717_PLUS(sc)) + limit = 4; else limit = 1; vrcb = BGE_MEMWIN_START + BGE_SEND_RING_RCB; @@ -2248,6 +2274,7 @@ bge_blockinit(struct bge_softc *sc) } else if (!BGE_IS_5705_PLUS(sc)) limit = BGE_RX_RINGS_MAX; else if (sc->bge_asicrev == BGE_ASICREV_BCM5755 || + sc->bge_asicrev == BGE_ASICREV_BCM5762 || BGE_IS_57765_PLUS(sc)) limit = 4; else @@ -2287,7 +2314,8 @@ bge_blockinit(struct bge_softc *sc) /* Set inter-packet gap */ val = 0x2620; - if (sc->bge_asicrev == BGE_ASICREV_BCM5720) + if (sc->bge_asicrev == BGE_ASICREV_BCM5720 || + sc->bge_asicrev == BGE_ASICREV_BCM5762) val |= CSR_READ_4(sc, BGE_TX_LENGTHS) & (BGE_TXLEN_JMB_FRM_LEN_MSK | BGE_TXLEN_CNT_DN_VAL_MSK); CSR_WRITE_4(sc, BGE_TX_LENGTHS, val); @@ -2451,7 +2479,8 @@ bge_blockinit(struct bge_softc *sc) val |= BGE_RDMAMODE_TSO6_ENABLE; } - if (sc->bge_asicrev == BGE_ASICREV_BCM5720) { + if (sc->bge_asicrev == BGE_ASICREV_BCM5720 || + sc->bge_asicrev == BGE_ASICREV_BCM5762) { val |= CSR_READ_4(sc, BGE_RDMA_MODE) & BGE_RDMAMODE_H2BNC_VLAN_DET; /* @@ -2465,14 +2494,18 @@ bge_blockinit(struct bge_softc *sc) sc->bge_asicrev == BGE_ASICREV_BCM5784 || sc->bge_asicrev == BGE_ASICREV_BCM5785 || sc->bge_asicrev == BGE_ASICREV_BCM57780 || - BGE_IS_5717_PLUS(sc)) { - dmactl = CSR_READ_4(sc, BGE_RDMA_RSRVCTRL); + BGE_IS_5717_PLUS(sc) || BGE_IS_57765_PLUS(sc)) { + if (sc->bge_asicrev == BGE_ASICREV_BCM5762) + rdmareg = BGE_RDMA_RSRVCTRL_REG2; + else + rdmareg = BGE_RDMA_RSRVCTRL; + dmactl = CSR_READ_4(sc, rdmareg); /* * Adjust tx margin to prevent TX data corruption and * fix internal FIFO overflow. */ - if (sc->bge_asicrev == BGE_ASICREV_BCM5719 && - sc->bge_chipid == BGE_CHIPID_BCM5719_A0) { + if (sc->bge_chipid == BGE_CHIPID_BCM5719_A0 || + sc->bge_asicrev == BGE_ASICREV_BCM5762) { dmactl &= ~(BGE_RDMA_RSRVCTRL_FIFO_LWM_MASK | BGE_RDMA_RSRVCTRL_FIFO_HWM_MASK | BGE_RDMA_RSRVCTRL_TXMRGN_MASK); @@ -2485,7 +2518,7 @@ bge_blockinit(struct bge_softc *sc) * The fix is to limit the number of RX BDs * the hardware would fetch at a fime. */ - CSR_WRITE_4(sc, BGE_RDMA_RSRVCTRL, dmactl | + CSR_WRITE_4(sc, rdmareg, dmactl | BGE_RDMA_RSRVCTRL_FIFO_OFLW_FIX); } @@ -2503,6 +2536,11 @@ bge_blockinit(struct bge_softc *sc) CSR_READ_4(sc, BGE_RDMA_LSO_CRPTEN_CTRL) | BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_BD_512 | BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_LSO_4K); + } else if (sc->bge_asicrev == BGE_ASICREV_BCM5762) { + CSR_WRITE_4(sc, BGE_RDMA_LSO_CRPTEN_CTRL_REG2, + CSR_READ_4(sc, BGE_RDMA_LSO_CRPTEN_CTRL_REG2) | + BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_BD_4K | + BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_LSO_4K); } CSR_WRITE_4(sc, BGE_RDMA_MODE, val); @@ -2652,6 +2690,9 @@ bge_chipid(device_t dev) case BCOM_DEVICEID_BCM5718: case BCOM_DEVICEID_BCM5719: case BCOM_DEVICEID_BCM5720: + case BCOM_DEVICEID_BCM5725: + case BCOM_DEVICEID_BCM5727: + case BCOM_DEVICEID_BCM5762: id = pci_read_config(dev, BGE_PCI_GEN2_PRODID_ASICREV, 4); break; @@ -3327,6 +3368,7 @@ bge_attach(device_t dev) /* Save chipset family. */ switch (sc->bge_asicrev) { + case BGE_ASICREV_BCM5762: case BGE_ASICREV_BCM57765: case BGE_ASICREV_BCM57766: sc->bge_flags |= BGE_FLAG_57765_PLUS; @@ -3387,6 +3429,7 @@ bge_attach(device_t dev) case BGE_ASICREV_BCM5719: case BGE_ASICREV_BCM5720: case BGE_ASICREV_BCM5761: + case BGE_ASICREV_BCM5762: sc->bge_flags |= BGE_FLAG_APE; break; } @@ -5214,17 +5257,51 @@ bge_encap(struct bge_softc *sc, struct mbuf **m_head, uint32_t *txidx) csum_flags |= BGE_TXBDFLAG_VLAN_TAG; vlan_tag = m->m_pkthdr.ether_vtag; } - for (i = 0; ; i++) { - d = &sc->bge_ldata.bge_tx_ring[idx]; - d->bge_addr.bge_addr_lo = BGE_ADDR_LO(segs[i].ds_addr); - d->bge_addr.bge_addr_hi = BGE_ADDR_HI(segs[i].ds_addr); - d->bge_len = segs[i].ds_len; - d->bge_flags = csum_flags; - d->bge_vlan_tag = vlan_tag; - d->bge_mss = mss; - if (i == nsegs - 1) - break; - BGE_INC(idx, BGE_TX_RING_CNT); + + if (sc->bge_asicrev == BGE_ASICREV_BCM5762 && + (m->m_pkthdr.csum_flags & CSUM_TSO) != 0) { + /* + * 5725 family of devices corrupts TSO packets when TSO DMA + * buffers cross into regions which are within MSS bytes of + * a 4GB boundary. If we encounter the condition, drop the + * packet. + */ + for (i = 0; ; i++) { + d = &sc->bge_ldata.bge_tx_ring[idx]; + d->bge_addr.bge_addr_lo = BGE_ADDR_LO(segs[i].ds_addr); + d->bge_addr.bge_addr_hi = BGE_ADDR_HI(segs[i].ds_addr); + d->bge_len = segs[i].ds_len; + if (d->bge_addr.bge_addr_lo + segs[i].ds_len + mss < + d->bge_addr.bge_addr_lo) + break; + d->bge_flags = csum_flags; + d->bge_vlan_tag = vlan_tag; + d->bge_mss = mss; + if (i == nsegs - 1) + break; + BGE_INC(idx, BGE_TX_RING_CNT); + } + if (i != nsegs - 1) { + bus_dmamap_sync(sc->bge_cdata.bge_tx_mtag, map, + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(sc->bge_cdata.bge_tx_mtag, map); + m_freem(*m_head); + *m_head = NULL; + return (EIO); + } + } else { + for (i = 0; ; i++) { + d = &sc->bge_ldata.bge_tx_ring[idx]; + d->bge_addr.bge_addr_lo = BGE_ADDR_LO(segs[i].ds_addr); + d->bge_addr.bge_addr_hi = BGE_ADDR_HI(segs[i].ds_addr); + d->bge_len = segs[i].ds_len; + d->bge_flags = csum_flags; + d->bge_vlan_tag = vlan_tag; + d->bge_mss = mss; + if (i == nsegs - 1) + break; + BGE_INC(idx, BGE_TX_RING_CNT); + } } /* Mark the last segment as end of packet... */ @@ -5451,7 +5528,8 @@ bge_init_locked(struct bge_softc *sc) mode = CSR_READ_4(sc, BGE_TX_MODE); if (BGE_IS_5755_PLUS(sc) || sc->bge_asicrev == BGE_ASICREV_BCM5906) mode |= BGE_TXMODE_MBUF_LOCKUP_FIX; - if (sc->bge_asicrev == BGE_ASICREV_BCM5720) { + if (sc->bge_asicrev == BGE_ASICREV_BCM5720 || + sc->bge_asicrev == BGE_ASICREV_BCM5762) { mode &= ~(BGE_TXMODE_JMB_FRM_LEN | BGE_TXMODE_CNT_DN_MODE); mode |= CSR_READ_4(sc, BGE_TX_MODE) & (BGE_TXMODE_JMB_FRM_LEN | BGE_TXMODE_CNT_DN_MODE); diff --git a/sys/dev/bge/if_bgereg.h b/sys/dev/bge/if_bgereg.h index 8ed84320dc6c..d6197c0d713e 100644 --- a/sys/dev/bge/if_bgereg.h +++ b/sys/dev/bge/if_bgereg.h @@ -331,6 +331,7 @@ #define BGE_CHIPID_BCM5717_B0 0x05717100 #define BGE_CHIPID_BCM5719_A0 0x05719000 #define BGE_CHIPID_BCM5720_A0 0x05720000 +#define BGE_CHIPID_BCM5762_A0 0x05762000 #define BGE_CHIPID_BCM57765_A0 0x57785000 #define BGE_CHIPID_BCM57765_B0 0x57785100 @@ -357,6 +358,7 @@ #define BGE_ASICREV_BCM5719 0x5719 #define BGE_ASICREV_BCM5720 0x5720 #define BGE_ASICREV_BCM5761 0x5761 +#define BGE_ASICREV_BCM5762 0x5762 #define BGE_ASICREV_BCM5784 0x5784 #define BGE_ASICREV_BCM5785 0x5785 #define BGE_ASICREV_BCM57765 0x57785 @@ -378,6 +380,7 @@ #define BGE_CHIPREV_5717_AX 0x57170 #define BGE_CHIPREV_5717_BX 0x57171 #define BGE_CHIPREV_5761_AX 0x57611 +#define BGE_CHIPREV_57765_AX 0x577850 #define BGE_CHIPREV_5784_AX 0x57841 /* PCI DMA Read/Write Control register */ @@ -1289,6 +1292,7 @@ #define BGE_CPMU_MUTEX_REQ 0x365C #define BGE_CPMU_MUTEX_GNT 0x3660 #define BGE_CPMU_PHY_STRAP 0x3664 +#define BGE_CPMU_PADRNG_CTL 0x3668 /* Central Power Management Unit (CPMU) register */ #define BGE_CPMU_CTRL_LINK_IDLE_MODE 0x00000200 @@ -1328,6 +1332,9 @@ /* CPMU GPHY Strap register */ #define BGE_CPMU_PHY_STRAP_IS_SERDES 0x00000020 +/* CPMU Padring Control register */ +#define BGE_CPMU_PADRNG_CTL_RDIV2 0x00040000 + /* * Mbuf Cluster Free registers (has nothing to do with BSD mbufs) */ @@ -1539,6 +1546,8 @@ */ #define BGE_RDMA_MODE 0x4800 #define BGE_RDMA_STATUS 0x4804 +#define BGE_RDMA_RSRVCTRL_REG2 0x4890 +#define BGE_RDMA_LSO_CRPTEN_CTRL_REG2 0x48A0 #define BGE_RDMA_RSRVCTRL 0x4900 #define BGE_RDMA_LSO_CRPTEN_CTRL 0x4910 @@ -2449,6 +2458,8 @@ struct bge_status_block { #define BCOM_DEVICEID_BCM5721 0x1659 #define BCOM_DEVICEID_BCM5722 0x165A #define BCOM_DEVICEID_BCM5723 0x165B +#define BCOM_DEVICEID_BCM5725 0x1643 +#define BCOM_DEVICEID_BCM5727 0x16F3 #define BCOM_DEVICEID_BCM5750 0x1676 #define BCOM_DEVICEID_BCM5750M 0x167C #define BCOM_DEVICEID_BCM5751 0x1677 @@ -2468,6 +2479,7 @@ struct bge_status_block { #define BCOM_DEVICEID_BCM5761E 0x1680 #define BCOM_DEVICEID_BCM5761S 0x1688 #define BCOM_DEVICEID_BCM5761SE 0x1689 +#define BCOM_DEVICEID_BCM5762 0x1687 #define BCOM_DEVICEID_BCM5764 0x1684 #define BCOM_DEVICEID_BCM5780 0x166A #define BCOM_DEVICEID_BCM5780S 0x166B diff --git a/sys/dev/ciss/ciss.c b/sys/dev/ciss/ciss.c index f9e62e469a27..f9f32569e55b 100644 --- a/sys/dev/ciss/ciss.c +++ b/sys/dev/ciss/ciss.c @@ -4378,11 +4378,17 @@ ciss_print_adapter(struct ciss_softc *sc) DB_COMMAND(ciss_prt, db_ciss_prt) { struct ciss_softc *sc; + devclass_t dc; + int maxciss, i; - sc = devclass_get_softc(devclass_find("ciss"), 0); - if (sc == NULL) { - printf("no ciss controllers\n"); - } else { + dc = devclass_find("ciss"); + if ( dc == NULL ) { + printf("%s: can't find devclass!\n", __func__); + return; + } + maxciss = devclass_get_maxunit(dc); + for (i = 0; i < maxciss; i++) { + sc = devclass_get_softc(dc, i); ciss_print_adapter(sc); } } diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h index c67570fcfd96..2d118c4c8b4c 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -172,6 +172,7 @@ enum { DOOMED = (1 << 0), PORT_INIT_DONE = (1 << 1), PORT_SYSCTL_CTX = (1 << 2), + HAS_TRACEQ = (1 << 3), }; #define IS_DOOMED(pi) ((pi)->flags & DOOMED) @@ -577,6 +578,14 @@ struct adapter { #endif int flags; + char ifp_lockname[16]; + struct mtx ifp_lock; + struct ifnet *ifp; /* tracer ifp */ + struct ifmedia media; + int traceq; /* iq used by all tracers, -1 if none */ + int tracer_valid; /* bitmap of valid tracers */ + int tracer_enabled; /* bitmap of enabled tracers */ + char fw_version[32]; char cfg_file[32]; u_int cfcsum; @@ -792,6 +801,8 @@ void t4_init_sge_cpl_handlers(struct adapter *); void t4_tweak_chip_settings(struct adapter *); int t4_read_chip_settings(struct adapter *); int t4_create_dma_tag(struct adapter *); +void t4_sge_sysctls(struct adapter *, struct sysctl_ctx_list *, + struct sysctl_oid_list *); int t4_destroy_dma_tag(struct adapter *); int t4_setup_adapter_queues(struct adapter *); int t4_teardown_adapter_queues(struct adapter *); @@ -808,6 +819,16 @@ int t4_eth_tx(struct ifnet *, struct sge_txq *, struct mbuf *); void t4_update_fl_bufsize(struct ifnet *); int can_resume_tx(struct sge_eq *); +/* t4_tracer.c */ +struct t4_tracer; +void t4_tracer_modload(void); +void t4_tracer_modunload(void); +void t4_tracer_port_detach(struct adapter *); +int t4_get_tracer(struct adapter *, struct t4_tracer *); +int t4_set_tracer(struct adapter *, struct t4_tracer *); +int t4_trace_pkt(struct sge_iq *, const struct rss_header *, struct mbuf *); +int t5_trace_pkt(struct sge_iq *, const struct rss_header *, struct mbuf *); + static inline struct wrqe * alloc_wrqe(int wr_len, struct sge_wrq *wrq) { diff --git a/sys/dev/cxgbe/common/t4_hw.c b/sys/dev/cxgbe/common/t4_hw.c index 3005f6346ab3..61742d437ee4 100644 --- a/sys/dev/cxgbe/common/t4_hw.c +++ b/sys/dev/cxgbe/common/t4_hw.c @@ -3624,22 +3624,24 @@ void t4_get_chan_txrate(struct adapter *adap, u64 *nic_rate, u64 *ofld_rate) * @idx: which filter to configure * @enable: whether to enable or disable the filter * - * Configures one of the tracing filters available in HW. If @enable is - * %0 @tp is not examined and may be %NULL. The user is responsible to - * set the single/multiple trace mode by writing to A_MPS_TRC_CFG register - * by using "cxgbtool iface reg reg_addr=val" command. See t4_sniffer/ - * docs/readme.txt for a complete description of how to setup traceing on - * T4. + * Configures one of the tracing filters available in HW. If @tp is %NULL + * it indicates that the filter is already written in the register and it + * just needs to be enabled or disabled. */ -int t4_set_trace_filter(struct adapter *adap, const struct trace_params *tp, int idx, - int enable) +int t4_set_trace_filter(struct adapter *adap, const struct trace_params *tp, + int idx, int enable) { int i, ofst = idx * 4; u32 data_reg, mask_reg, cfg; u32 multitrc = F_TRCMULTIFILTER; + u32 en = is_t4(adap) ? F_TFEN : F_T5_TFEN; - if (!enable) { - t4_write_reg(adap, A_MPS_TRC_FILTER_MATCH_CTL_A + ofst, 0); + if (idx < 0 || idx >= NTRACE) + return -EINVAL; + + if (tp == NULL || !enable) { + t4_set_reg_field(adap, A_MPS_TRC_FILTER_MATCH_CTL_A + ofst, en, + enable ? en : 0); return 0; } @@ -3660,8 +3662,7 @@ int t4_set_trace_filter(struct adapter *adap, const struct trace_params *tp, int */ if (tp->snap_len > ((10 * 1024 / 4) - (2 * 8))) return -EINVAL; - } - else { + } else { /* * If multiple tracers are disabled, to avoid deadlocks * maximum packet capture size of 9600 bytes is recommended. @@ -3672,12 +3673,13 @@ int t4_set_trace_filter(struct adapter *adap, const struct trace_params *tp, int return -EINVAL; } - if (tp->port > 11 || tp->invert > 1 || tp->skip_len > M_TFLENGTH || - tp->skip_ofst > M_TFOFFSET || tp->min_len > M_TFMINPKTSIZE) + if (tp->port > (is_t4(adap) ? 11 : 19) || tp->invert > 1 || + tp->skip_len > M_TFLENGTH || tp->skip_ofst > M_TFOFFSET || + tp->min_len > M_TFMINPKTSIZE) return -EINVAL; /* stop the tracer we'll be changing */ - t4_write_reg(adap, A_MPS_TRC_FILTER_MATCH_CTL_A + ofst, 0); + t4_set_reg_field(adap, A_MPS_TRC_FILTER_MATCH_CTL_A + ofst, en, 0); idx *= (A_MPS_TRC_FILTER1_MATCH - A_MPS_TRC_FILTER0_MATCH); data_reg = A_MPS_TRC_FILTER0_MATCH + idx; @@ -3691,11 +3693,10 @@ int t4_set_trace_filter(struct adapter *adap, const struct trace_params *tp, int V_TFCAPTUREMAX(tp->snap_len) | V_TFMINPKTSIZE(tp->min_len)); t4_write_reg(adap, A_MPS_TRC_FILTER_MATCH_CTL_A + ofst, - V_TFOFFSET(tp->skip_ofst) | V_TFLENGTH(tp->skip_len) | - is_t4(adap) ? - V_TFPORT(tp->port) | F_TFEN | V_TFINVERTMATCH(tp->invert) : - V_T5_TFPORT(tp->port) | F_T5_TFEN | - V_T5_TFINVERTMATCH(tp->invert)); + V_TFOFFSET(tp->skip_ofst) | V_TFLENGTH(tp->skip_len) | en | + (is_t4(adap) ? + V_TFPORT(tp->port) | V_TFINVERTMATCH(tp->invert) : + V_T5_TFPORT(tp->port) | V_T5_TFINVERTMATCH(tp->invert))); return 0; } @@ -3722,15 +3723,16 @@ void t4_get_trace_filter(struct adapter *adap, struct trace_params *tp, int idx, if (is_t4(adap)) { *enabled = !!(ctla & F_TFEN); tp->port = G_TFPORT(ctla); + tp->invert = !!(ctla & F_TFINVERTMATCH); } else { *enabled = !!(ctla & F_T5_TFEN); tp->port = G_T5_TFPORT(ctla); + tp->invert = !!(ctla & F_T5_TFINVERTMATCH); } tp->snap_len = G_TFCAPTUREMAX(ctlb); tp->min_len = G_TFMINPKTSIZE(ctlb); tp->skip_ofst = G_TFOFFSET(ctla); tp->skip_len = G_TFLENGTH(ctla); - tp->invert = !!(ctla & F_TFINVERTMATCH); ofst = (A_MPS_TRC_FILTER1_MATCH - A_MPS_TRC_FILTER0_MATCH) * idx; data_reg = A_MPS_TRC_FILTER0_MATCH + ofst; diff --git a/sys/dev/cxgbe/common/t4_hw.h b/sys/dev/cxgbe/common/t4_hw.h index 3bc209633096..b0b82bd0d7ac 100644 --- a/sys/dev/cxgbe/common/t4_hw.h +++ b/sys/dev/cxgbe/common/t4_hw.h @@ -45,6 +45,7 @@ enum { NTX_SCHED = 8, /* # of HW Tx scheduling queues */ PM_NSTATS = 5, /* # of PM stats */ MBOX_LEN = 64, /* mailbox size in bytes */ + NTRACE = 4, /* # of tracing filters */ TRACE_LEN = 112, /* length of trace data and mask */ FILTER_OPT_LEN = 36, /* filter tuple width of optional components */ NWOL_PAT = 8, /* # of WoL patterns */ diff --git a/sys/dev/cxgbe/t4_ioctl.h b/sys/dev/cxgbe/t4_ioctl.h index edfa9330f10b..a080f64bc364 100644 --- a/sys/dev/cxgbe/t4_ioctl.h +++ b/sys/dev/cxgbe/t4_ioctl.h @@ -51,6 +51,11 @@ enum { T4_GET_MEM, /* read memory */ T4_GET_I2C, /* read from i2c addressible device */ T4_CLEAR_STATS, /* clear a port's MAC statistics */ + T4_SET_OFLD_POLICY, /* Set offload policy */ + T4_SET_SCHED_CLASS, /* set sched class */ + T4_SET_SCHED_QUEUE, /* set queue class */ + T4_GET_TRACER, /* get information about a tracer */ + T4_SET_TRACER, /* program a tracer */ }; struct t4_reg { @@ -223,6 +228,25 @@ struct t4_mem_range { uint32_t *data; }; +#define T4_TRACE_LEN 112 +struct t4_trace_params { + uint32_t data[T4_TRACE_LEN / 4]; + uint32_t mask[T4_TRACE_LEN / 4]; + uint16_t snap_len; + uint16_t min_len; + uint8_t skip_ofst; + uint8_t skip_len; + uint8_t invert; + uint8_t port; +}; + +struct t4_tracer { + uint8_t idx; + uint8_t enabled; + uint8_t valid; + struct t4_trace_params tp; +}; + #define CHELSIO_T4_GETREG _IOWR('f', T4_GETREG, struct t4_reg) #define CHELSIO_T4_SETREG _IOW('f', T4_SETREG, struct t4_reg) #define CHELSIO_T4_REGDUMP _IOWR('f', T4_REGDUMP, struct t4_regdump) @@ -237,4 +261,6 @@ struct t4_mem_range { #define CHELSIO_T4_GET_MEM _IOW('f', T4_GET_MEM, struct t4_mem_range) #define CHELSIO_T4_GET_I2C _IOWR('f', T4_GET_I2C, struct t4_i2c_data) #define CHELSIO_T4_CLEAR_STATS _IOW('f', T4_CLEAR_STATS, uint32_t) +#define CHELSIO_T4_GET_TRACER _IOWR('f', T4_GET_TRACER, struct t4_tracer) +#define CHELSIO_T4_SET_TRACER _IOW('f', T4_SET_TRACER, struct t4_tracer) #endif diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index b0c5581ba5ed..1bdb4dfe3ac0 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -392,6 +392,7 @@ static int sysctl_devlog(SYSCTL_HANDLER_ARGS); static int sysctl_fcoe_stats(SYSCTL_HANDLER_ARGS); static int sysctl_hw_sched(SYSCTL_HANDLER_ARGS); static int sysctl_lb_stats(SYSCTL_HANDLER_ARGS); +static int sysctl_linkdnrc(SYSCTL_HANDLER_ARGS); static int sysctl_meminfo(SYSCTL_HANDLER_ARGS); static int sysctl_mps_tcam(SYSCTL_HANDLER_ARGS); static int sysctl_path_mtus(SYSCTL_HANDLER_ARGS); @@ -447,26 +448,27 @@ struct { }, t5_pciids[] = { {0xb000, "Chelsio Terminator 5 FPGA"}, {0x5400, "Chelsio T580-dbg"}, - {0x5401, "Chelsio T520-CR"}, + {0x5401, "Chelsio T520-CR"}, /* 2 x 10G */ + {0x5402, "Chelsio T522-CR"}, /* 2 x 10G, 2 X 1G */ {0x5403, "Chelsio T540-CR"}, /* 4 x 10G */ - {0x5407, "Chelsio T520-SO"}, - {0x5408, "Chelsio T520-CX"}, + {0x5407, "Chelsio T520-SO"}, /* 2 x 10G, nomem */ + {0x5409, "Chelsio T520-BT"}, /* 2 x 10GBaseT */ + {0x540a, "Chelsio T504-BT"}, /* 4 x 1G */ + {0x540d, "Chelsio T580-CR"}, /* 2 x 40G */ + {0x540e, "Chelsio T540-LP-CR"}, /* 4 x 10G */ {0x5410, "Chelsio T580-LP-CR"}, /* 2 x 40G */ - {0x5411, "Chelsio T520-LL-CR"}, + {0x5411, "Chelsio T520-LL-CR"}, /* 2 x 10G */ + {0x5412, "Chelsio T560-CR"}, /* 1 x 40G, 2 x 10G */ + {0x5414, "Chelsio T580-LP-SO-CR"}, /* 2 x 40G, nomem */ #ifdef notyet - {0x5402, "Chelsio T522-CR"}, {0x5404, "Chelsio T520-BCH"}, {0x5405, "Chelsio T540-BCH"}, {0x5406, "Chelsio T540-CH"}, - {0x5409, "Chelsio T520-BT"}, - {0x540a, "Chelsio T504-BT"}, + {0x5408, "Chelsio T520-CX"}, {0x540b, "Chelsio B520-SR"}, {0x540c, "Chelsio B504-BT"}, - {0x540d, "Chelsio T580-CR"}, - {0x540e, "Chelsio T540-LP-CR"}, {0x540f, "Chelsio Amsterdam"}, - {0x5412, "Chelsio T560-CR"}, - {0x5413, "Chelsio T580-CR"}, + {0x5413, "Chelsio T580-CHR"}, #endif }; @@ -557,6 +559,11 @@ t4_attach(device_t dev) pci_write_config(dev, i + PCIER_DEVICE_CTL, v, 2); } + sc->traceq = -1; + mtx_init(&sc->ifp_lock, sc->ifp_lockname, 0, MTX_DEF); + snprintf(sc->ifp_lockname, sizeof(sc->ifp_lockname), "%s tracer", + device_get_nameunit(dev)); + snprintf(sc->lockname, sizeof(sc->lockname), "%s", device_get_nameunit(dev)); mtx_init(&sc->sc_lock, sc->lockname, 0, MTX_DEF); @@ -588,8 +595,11 @@ t4_attach(device_t dev) for (i = 0; i < nitems(sc->fw_msg_handler); i++) sc->fw_msg_handler[i] = fw_msg_not_handled; t4_register_cpl_handler(sc, CPL_SET_TCB_RPL, t4_filter_rpl); + t4_register_cpl_handler(sc, CPL_TRACE_PKT, t4_trace_pkt); + t4_register_cpl_handler(sc, CPL_TRACE_PKT_T5, t5_trace_pkt); t4_init_sge_cpl_handlers(sc); + /* Prepare the adapter for operation */ rc = -t4_prep_adapter(sc); if (rc != 0) { @@ -668,6 +678,7 @@ t4_attach(device_t dev) snprintf(pi->lockname, sizeof(pi->lockname), "%sp%d", device_get_nameunit(dev), i); mtx_init(&pi->pi_lock, pi->lockname, 0, MTX_DEF); + sc->chan_map[pi->tx_chan] = i; if (is_10G_port(pi) || is_40G_port(pi)) { n10g++; @@ -916,6 +927,8 @@ t4_detach(device_t dev) mtx_destroy(&sc->tids.ftid_lock); if (mtx_initialized(&sc->sfl_lock)) mtx_destroy(&sc->sfl_lock); + if (mtx_initialized(&sc->ifp_lock)) + mtx_destroy(&sc->ifp_lock); bzero(sc, sizeof(*sc)); @@ -1018,6 +1031,11 @@ cxgbe_detach(device_t dev) #endif ADAPTER_UNLOCK(sc); + if (pi->flags & HAS_TRACEQ) { + sc->traceq = -1; /* cloner should not create ifnet */ + t4_tracer_port_detach(sc); + } + if (pi->vlan_c) EVENTHANDLER_DEREGISTER(vlan_config, pi->vlan_c); @@ -2887,6 +2905,17 @@ cxgbe_init_synchronized(struct port_info *pi) goto done; } + /* + * The first iq of the first port to come up is used for tracing. + */ + if (sc->traceq < 0) { + sc->traceq = sc->sge.rxq[pi->first_rxq].iq.abs_id; + t4_write_reg(sc, is_t4(sc) ? A_MPS_TRC_RSS_CONTROL : + A_MPS_T5_TRC_RSS_CONTROL, V_RSSCONTROL(pi->tx_chan) | + V_QUEUENUMBER(sc->traceq)); + pi->flags |= HAS_TRACEQ; + } + /* all ok */ setbit(&sc->open_device_map, pi->port_id); PORT_LOCK(pi); @@ -4194,6 +4223,8 @@ t4_sysctls(struct adapter *sc) SYSCTL_ADD_INT(ctx, children, OID_AUTO, "nfilters", CTLFLAG_RD, NULL, sc->tids.nftids, "number of filters"); + t4_sge_sysctls(sc, ctx, children); + #ifdef SBUF_DRAIN /* * dev.t4nex.X.misc. Marked CTLFLAG_SKIP to avoid information overload. @@ -4411,8 +4442,8 @@ cxgbe_sysctls(struct port_info *pi) oid = device_get_sysctl_tree(pi->dev); children = SYSCTL_CHILDREN(oid); - SYSCTL_ADD_INT(ctx, children, OID_AUTO, "linkdnrc", CTLFLAG_RD, - &pi->linkdnrc, 0, "reason why link is down"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "linkdnrc", CTLTYPE_STRING | + CTLFLAG_RD, pi, 0, sysctl_linkdnrc, "A", "reason why link is down"); if (pi->port_type == FW_PORT_TYPE_BT_XAUI) { SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "temperature", CTLTYPE_INT | CTLFLAG_RD, pi, 0, sysctl_btphy, "I", @@ -5458,6 +5489,37 @@ sysctl_lb_stats(SYSCTL_HANDLER_ARGS) return (rc); } +static int +sysctl_linkdnrc(SYSCTL_HANDLER_ARGS) +{ + int rc = 0; + struct port_info *pi = arg1; + struct sbuf *sb; + static const char *linkdnreasons[] = { + "non-specific", "remote fault", "autoneg failed", "reserved3", + "PHY overheated", "unknown", "rx los", "reserved7" + }; + + rc = sysctl_wire_old_buffer(req, 0); + if (rc != 0) + return(rc); + sb = sbuf_new_for_sysctl(NULL, NULL, 64, req); + if (sb == NULL) + return (ENOMEM); + + if (pi->linkdnrc < 0) + sbuf_printf(sb, "n/a"); + else if (pi->linkdnrc < nitems(linkdnreasons)) + sbuf_printf(sb, "%s", linkdnreasons[pi->linkdnrc]); + else + sbuf_printf(sb, "%d", pi->linkdnrc); + + rc = sbuf_finish(sb); + sbuf_delete(sb); + + return (rc); +} + struct mem_desc { unsigned int base; unsigned int limit; @@ -7414,6 +7476,12 @@ t4_ioctl(struct cdev *dev, unsigned long cmd, caddr_t data, int fflag, } break; } + case CHELSIO_T4_GET_TRACER: + rc = t4_get_tracer(sc, (struct t4_tracer *)data); + break; + case CHELSIO_T4_SET_TRACER: + rc = t4_set_tracer(sc, (struct t4_tracer *)data); + break; default: rc = EINVAL; } @@ -7650,12 +7718,14 @@ mod_event(module_t mod, int cmd, void *arg) mtx_init(&t4_uld_list_lock, "T4 ULDs", 0, MTX_DEF); SLIST_INIT(&t4_uld_list); #endif + t4_tracer_modload(); tweak_tunables(); break; case MOD_UNLOAD: if (atomic_fetchadd_int(&loaded, -1) > 1) break; + t4_tracer_modunload(); #ifdef TCP_OFFLOAD mtx_lock(&t4_uld_list_lock); if (!SLIST_EMPTY(&t4_uld_list)) { diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c index 586137a83afd..2a7d0580b4ee 100644 --- a/sys/dev/cxgbe/t4_sge.c +++ b/sys/dev/cxgbe/t4_sge.c @@ -276,7 +276,6 @@ t4_init_sge_cpl_handlers(struct adapter *sc) t4_register_cpl_handler(sc, CPL_FW6_MSG, handle_fw_msg); t4_register_cpl_handler(sc, CPL_SGE_EGR_UPDATE, handle_sge_egr_update); t4_register_cpl_handler(sc, CPL_RX_PKT, t4_eth_rx); - t4_register_fw_msg_handler(sc, FW6_TYPE_CMD_RPL, t4_handle_fw_rpl); } @@ -499,6 +498,24 @@ t4_create_dma_tag(struct adapter *sc) return (rc); } +void +t4_sge_sysctls(struct adapter *sc, struct sysctl_ctx_list *ctx, + struct sysctl_oid_list *children) +{ + + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "fl_pktshift", CTLFLAG_RD, + NULL, fl_pktshift, "payload DMA offset in rx buffer (bytes)"); + + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "fl_pad", CTLFLAG_RD, + NULL, fl_pad, "payload pad boundary (bytes)"); + + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "spg_len", CTLFLAG_RD, + NULL, spg_len, "status page size (bytes)"); + + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "cong_drop", CTLFLAG_RD, + NULL, cong_drop, "congestion drop setting"); +} + int t4_destroy_dma_tag(struct adapter *sc) { diff --git a/sys/dev/cxgbe/t4_tracer.c b/sys/dev/cxgbe/t4_tracer.c new file mode 100644 index 000000000000..04f64e3c01e7 --- /dev/null +++ b/sys/dev/cxgbe/t4_tracer.c @@ -0,0 +1,519 @@ +/*- + * Copyright (c) 2013 Chelsio Communications, Inc. + * All rights reserved. + * Written by: Navdeep Parhar <np@FreeBSD.org> + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); + +#include "opt_inet.h" +#include "opt_inet6.h" + +#include <sys/param.h> +#include <sys/lock.h> +#include <sys/types.h> +#include <sys/mbuf.h> +#include <sys/socket.h> +#include <sys/sockio.h> +#include <sys/sx.h> +#include <net/bpf.h> +#include <net/ethernet.h> +#include <net/if.h> +#include <net/if_clone.h> +#include <net/if_types.h> + +#include "common/common.h" +#include "common/t4_msg.h" +#include "common/t4_regs.h" +#include "t4_ioctl.h" + +/* + * Locking notes + * ============= + * + * An interface cloner is registered during mod_load and it can be used to + * create or destroy the tracing ifnet for an adapter at any time. It is + * possible for the cloned interface to outlive the adapter (adapter disappears + * in t4_detach but the tracing ifnet may live till mod_unload when removal of + * the cloner finally destroys any remaining cloned interfaces). When tracing + * filters are active, this ifnet is also receiving data. There are potential + * bad races between ifnet create, ifnet destroy, ifnet rx, ifnet ioctl, + * cxgbe_detach/t4_detach, mod_unload. + * + * a) The driver selects an iq for tracing (sc->traceq) inside a synch op. The + * iq is destroyed inside a synch op too (and sc->traceq updated). + * b) The cloner looks for an adapter that matches the name of the ifnet it's + * been asked to create, starts a synch op on that adapter, and proceeds only + * if the adapter has a tracing iq. + * c) The cloned ifnet and the adapter are coupled to each other via + * ifp->if_softc and sc->ifp. These can be modified only with the global + * t4_trace_lock sx as well as the sc->ifp_lock mutex held. Holding either + * of these will prevent any change. + * + * The order in which all the locks involved should be acquired are: + * t4_list_lock + * adapter lock + * (begin synch op and let go of the above two) + * t4_trace_lock + * sc->ifp_lock + */ + +static struct sx t4_trace_lock; +static const char *t4_cloner_name = "tXnex"; +static struct if_clone *t4_cloner; + +/* tracer ifnet routines. mostly no-ops. */ +static void tracer_init(void *); +static int tracer_ioctl(struct ifnet *, unsigned long, caddr_t); +static int tracer_transmit(struct ifnet *, struct mbuf *); +static void tracer_qflush(struct ifnet *); +static int tracer_media_change(struct ifnet *); +static void tracer_media_status(struct ifnet *, struct ifmediareq *); + +/* match name (request/response) */ +struct match_rr { + const char *name; + int lock; /* set to 1 to returned sc locked. */ + struct adapter *sc; + int rc; +}; + +static void +match_name(struct adapter *sc, void *arg) +{ + struct match_rr *mrr = arg; + + if (strcmp(device_get_nameunit(sc->dev), mrr->name) != 0) + return; + + KASSERT(mrr->sc == NULL, ("%s: multiple matches (%p, %p) for %s", + __func__, mrr->sc, sc, mrr->name)); + + mrr->sc = sc; + if (mrr->lock) + mrr->rc = begin_synchronized_op(mrr->sc, NULL, 0, "t4clon"); + else + mrr->rc = 0; +} + +static int +t4_cloner_match(struct if_clone *ifc, const char *name) +{ + struct match_rr mrr; + + mrr.name = name; + mrr.lock = 0; + mrr.sc = NULL; + t4_iterate(match_name, &mrr); + + return (mrr.sc != NULL); +} + +static int +t4_cloner_create(struct if_clone *ifc, char *name, size_t len, caddr_t params) +{ + struct match_rr mrr; + struct adapter *sc; + struct ifnet *ifp; + int rc, unit; + const uint8_t lla[ETHER_ADDR_LEN] = {0, 0, 0, 0, 0, 0}; + + mrr.name = name; + mrr.lock = 1; + mrr.sc = NULL; + mrr.rc = ENOENT; + t4_iterate(match_name, &mrr); + + if (mrr.rc != 0) + return (mrr.rc); + sc = mrr.sc; + + KASSERT(sc != NULL, ("%s: name (%s) matched but softc is NULL", + __func__, name)); + ASSERT_SYNCHRONIZED_OP(sc); + + sx_xlock(&t4_trace_lock); + + if (sc->ifp != NULL) { + rc = EEXIST; + goto done; + } + if (sc->traceq < 0) { + rc = EAGAIN; + goto done; + } + + + unit = -1; + rc = ifc_alloc_unit(ifc, &unit); + if (rc != 0) + goto done; + + ifp = if_alloc(IFT_ETHER); + if (ifp == NULL) { + ifc_free_unit(ifc, unit); + rc = ENOMEM; + goto done; + } + + /* Note that if_xname is not <if_dname><if_dunit>. */ + strlcpy(ifp->if_xname, name, sizeof(ifp->if_xname)); + ifp->if_dname = t4_cloner_name; + ifp->if_dunit = unit; + ifp->if_init = tracer_init; + ifp->if_flags = IFF_SIMPLEX | IFF_DRV_RUNNING; + ifp->if_ioctl = tracer_ioctl; + ifp->if_transmit = tracer_transmit; + ifp->if_qflush = tracer_qflush; + ifp->if_capabilities = IFCAP_JUMBO_MTU | IFCAP_VLAN_MTU; + ifmedia_init(&sc->media, IFM_IMASK, tracer_media_change, + tracer_media_status); + ifmedia_add(&sc->media, IFM_ETHER | IFM_FDX | IFM_NONE, 0, NULL); + ifmedia_set(&sc->media, IFM_ETHER | IFM_FDX | IFM_NONE); + ether_ifattach(ifp, lla); + if_up(ifp); + + mtx_lock(&sc->ifp_lock); + ifp->if_softc = sc; + sc->ifp = ifp; + mtx_unlock(&sc->ifp_lock); +done: + sx_xunlock(&t4_trace_lock); + end_synchronized_op(sc, 0); + return (rc); +} + +static int +t4_cloner_destroy(struct if_clone *ifc, struct ifnet *ifp) +{ + struct adapter *sc; + int unit = ifp->if_dunit; + + sx_xlock(&t4_trace_lock); + sc = ifp->if_softc; + if (sc != NULL) { + mtx_lock(&sc->ifp_lock); + sc->ifp = NULL; + ifp->if_softc = NULL; + mtx_unlock(&sc->ifp_lock); + ifmedia_removeall(&sc->media); + } + ether_ifdetach(ifp); + if_free(ifp); + ifc_free_unit(ifc, unit); + sx_xunlock(&t4_trace_lock); + + return (0); +} + +void +t4_tracer_modload() +{ + + sx_init(&t4_trace_lock, "T4/T5 tracer lock"); + t4_cloner = if_clone_advanced(t4_cloner_name, 0, t4_cloner_match, + t4_cloner_create, t4_cloner_destroy); +} + +void +t4_tracer_modunload() +{ + + if (t4_cloner != NULL) { + /* + * The module is being unloaded so the nexus drivers have + * detached. The tracing interfaces can not outlive the nexus + * (ifp->if_softc is the nexus) and must have been destroyed + * already. XXX: but if_clone is opaque to us and we can't + * assert LIST_EMPTY(&t4_cloner->ifc_iflist) at this time. + */ + if_clone_detach(t4_cloner); + } + sx_destroy(&t4_trace_lock); +} + +void +t4_tracer_port_detach(struct adapter *sc) +{ + + sx_xlock(&t4_trace_lock); + if (sc->ifp != NULL) { + mtx_lock(&sc->ifp_lock); + sc->ifp->if_softc = NULL; + sc->ifp = NULL; + mtx_unlock(&sc->ifp_lock); + } + ifmedia_removeall(&sc->media); + sx_xunlock(&t4_trace_lock); +} + +int +t4_get_tracer(struct adapter *sc, struct t4_tracer *t) +{ + int rc, i, enabled; + struct trace_params tp; + + if (t->idx >= NTRACE) { + t->idx = 0xff; + t->enabled = 0; + t->valid = 0; + return (0); + } + + rc = begin_synchronized_op(sc, NULL, HOLD_LOCK | SLEEP_OK | INTR_OK, + "t4gett"); + if (rc) + return (rc); + + for (i = t->idx; i < NTRACE; i++) { + if (isset(&sc->tracer_valid, t->idx)) { + t4_get_trace_filter(sc, &tp, i, &enabled); + t->idx = i; + t->enabled = enabled; + t->valid = 1; + memcpy(&t->tp.data[0], &tp.data[0], sizeof(t->tp.data)); + memcpy(&t->tp.mask[0], &tp.mask[0], sizeof(t->tp.mask)); + t->tp.snap_len = tp.snap_len; + t->tp.min_len = tp.min_len; + t->tp.skip_ofst = tp.skip_ofst; + t->tp.skip_len = tp.skip_len; + t->tp.invert = tp.invert; + + /* convert channel to port iff 0 <= port < 8. */ + if (tp.port < 4) + t->tp.port = sc->chan_map[tp.port]; + else if (tp.port < 8) + t->tp.port = sc->chan_map[tp.port - 4] + 4; + else + t->tp.port = tp.port; + + goto done; + } + } + + t->idx = 0xff; + t->enabled = 0; + t->valid = 0; +done: + end_synchronized_op(sc, LOCK_HELD); + + return (rc); +} + +int +t4_set_tracer(struct adapter *sc, struct t4_tracer *t) +{ + int rc; + struct trace_params tp, *tpp; + + if (t->idx >= NTRACE) + return (EINVAL); + + rc = begin_synchronized_op(sc, NULL, HOLD_LOCK | SLEEP_OK | INTR_OK, + "t4sett"); + if (rc) + return (rc); + + /* + * If no tracing filter is specified this time then check if the filter + * at the index is valid anyway because it was set previously. If so + * then this is a legitimate enable/disable operation. + */ + if (t->valid == 0) { + if (isset(&sc->tracer_valid, t->idx)) + tpp = NULL; + else + rc = EINVAL; + goto done; + } + + if (t->tp.port > 19 || t->tp.snap_len > 9600 || + t->tp.min_len > M_TFMINPKTSIZE || t->tp.skip_len > M_TFLENGTH || + t->tp.skip_ofst > M_TFOFFSET) { + rc = EINVAL; + goto done; + } + + memcpy(&tp.data[0], &t->tp.data[0], sizeof(tp.data)); + memcpy(&tp.mask[0], &t->tp.mask[0], sizeof(tp.mask)); + tp.snap_len = t->tp.snap_len; + tp.min_len = t->tp.min_len; + tp.skip_ofst = t->tp.skip_ofst; + tp.skip_len = t->tp.skip_len; + tp.invert = !!t->tp.invert; + + /* convert port to channel iff 0 <= port < 8. */ + if (t->tp.port < 4) { + if (sc->port[t->tp.port] == NULL) { + rc = EINVAL; + goto done; + } + tp.port = sc->port[t->tp.port]->tx_chan; + } else if (t->tp.port < 8) { + if (sc->port[t->tp.port - 4] == NULL) { + rc = EINVAL; + goto done; + } + tp.port = sc->port[t->tp.port - 4]->tx_chan + 4; + } + tpp = &tp; +done: + if (rc == 0) { + rc = -t4_set_trace_filter(sc, tpp, t->idx, t->enabled); + if (rc == 0) { + if (t->enabled) { + setbit(&sc->tracer_valid, t->idx); + if (sc->tracer_enabled == 0) { + t4_set_reg_field(sc, A_MPS_TRC_CFG, + F_TRCEN, F_TRCEN); + } + setbit(&sc->tracer_enabled, t->idx); + } else { + clrbit(&sc->tracer_enabled, t->idx); + if (sc->tracer_enabled == 0) { + t4_set_reg_field(sc, A_MPS_TRC_CFG, + F_TRCEN, 0); + } + } + } + } + end_synchronized_op(sc, LOCK_HELD); + + return (rc); +} + +int +t4_trace_pkt(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) +{ + struct adapter *sc = iq->adapter; + struct ifnet *ifp; + + KASSERT(m != NULL, ("%s: no payload with opcode %02x", __func__, + rss->opcode)); + + mtx_lock(&sc->ifp_lock); + ifp = sc->ifp; + if (sc->ifp) { + m_adj(m, sizeof(struct cpl_trace_pkt)); + m->m_pkthdr.rcvif = ifp; + ETHER_BPF_MTAP(ifp, m); + } + mtx_unlock(&sc->ifp_lock); + m_freem(m); + + return (0); +} + +int +t5_trace_pkt(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) +{ + struct adapter *sc = iq->adapter; + struct ifnet *ifp; + + KASSERT(m != NULL, ("%s: no payload with opcode %02x", __func__, + rss->opcode)); + + mtx_lock(&sc->ifp_lock); + ifp = sc->ifp; + if (ifp != NULL) { + m_adj(m, sizeof(struct cpl_t5_trace_pkt)); + m->m_pkthdr.rcvif = ifp; + ETHER_BPF_MTAP(ifp, m); + } + mtx_unlock(&sc->ifp_lock); + m_freem(m); + + return (0); +} + + +static void +tracer_init(void *arg) +{ + + return; +} + +static int +tracer_ioctl(struct ifnet *ifp, unsigned long cmd, caddr_t data) +{ + int rc = 0; + struct adapter *sc; + struct ifreq *ifr = (struct ifreq *)data; + + switch (cmd) { + case SIOCSIFMTU: + case SIOCSIFFLAGS: + case SIOCADDMULTI: + case SIOCDELMULTI: + case SIOCSIFCAP: + break; + case SIOCSIFMEDIA: + case SIOCGIFMEDIA: + sx_xlock(&t4_trace_lock); + sc = ifp->if_softc; + if (sc == NULL) + rc = EIO; + else + rc = ifmedia_ioctl(ifp, ifr, &sc->media, cmd); + sx_xunlock(&t4_trace_lock); + break; + default: + rc = ether_ioctl(ifp, cmd, data); + } + + return (rc); +} + +static int +tracer_transmit(struct ifnet *ifp, struct mbuf *m) +{ + + m_freem(m); + return (0); +} + +static void +tracer_qflush(struct ifnet *ifp) +{ + + return; +} + +static int +tracer_media_change(struct ifnet *ifp) +{ + + return (EOPNOTSUPP); +} + +static void +tracer_media_status(struct ifnet *ifp, struct ifmediareq *ifmr) +{ + + ifmr->ifm_status = IFM_AVALID | IFM_ACTIVE; + + return; +} diff --git a/sys/dev/drm2/i915/i915_gem.c b/sys/dev/drm2/i915/i915_gem.c index c505cdbc0e6b..6b8bce351f19 100644 --- a/sys/dev/drm2/i915/i915_gem.c +++ b/sys/dev/drm2/i915/i915_gem.c @@ -1289,8 +1289,8 @@ i915_gem_mmap_ioctl(struct drm_device *dev, void *data, vm_object_reference(obj->vm_obj); DRM_UNLOCK(dev); rv = vm_map_find(map, obj->vm_obj, args->offset, &addr, args->size, - VMFS_ANY_SPACE, VM_PROT_READ | VM_PROT_WRITE, - VM_PROT_READ | VM_PROT_WRITE, MAP_SHARED); + VMFS_OPTIMAL_SPACE, VM_PROT_READ | VM_PROT_WRITE, + VM_PROT_READ | VM_PROT_WRITE, MAP_INHERIT_SHARE); if (rv != KERN_SUCCESS) { vm_object_deallocate(obj->vm_obj); error = -vm_mmap_to_errno(rv); diff --git a/sys/dev/drm2/i915/intel_ringbuffer.c b/sys/dev/drm2/i915/intel_ringbuffer.c index c0b752b2b795..107a211e2851 100644 --- a/sys/dev/drm2/i915/intel_ringbuffer.c +++ b/sys/dev/drm2/i915/intel_ringbuffer.c @@ -365,8 +365,6 @@ init_pipe_control(struct intel_ring_buffer *ring) if (pc->cpu_page == NULL) goto err_unpin; pmap_qenter((uintptr_t)pc->cpu_page, &obj->pages[0], 1); - pmap_invalidate_range(kernel_pmap, (vm_offset_t)pc->cpu_page, - (vm_offset_t)pc->cpu_page + PAGE_SIZE); pmap_invalidate_cache_range((vm_offset_t)pc->cpu_page, (vm_offset_t)pc->cpu_page + PAGE_SIZE); @@ -394,8 +392,6 @@ cleanup_pipe_control(struct intel_ring_buffer *ring) obj = pc->obj; pmap_qremove((vm_offset_t)pc->cpu_page, 1); - pmap_invalidate_range(kernel_pmap, (vm_offset_t)pc->cpu_page, - (vm_offset_t)pc->cpu_page + PAGE_SIZE); kmem_free(kernel_map, (uintptr_t)pc->cpu_page, PAGE_SIZE); i915_gem_object_unpin(obj); drm_gem_object_unreference(&obj->base); @@ -972,9 +968,6 @@ static void cleanup_status_page(struct intel_ring_buffer *ring) return; pmap_qremove((vm_offset_t)ring->status_page.page_addr, 1); - pmap_invalidate_range(kernel_pmap, - (vm_offset_t)ring->status_page.page_addr, - (vm_offset_t)ring->status_page.page_addr + PAGE_SIZE); kmem_free(kernel_map, (vm_offset_t)ring->status_page.page_addr, PAGE_SIZE); i915_gem_object_unpin(obj); @@ -1014,9 +1007,6 @@ static int init_status_page(struct intel_ring_buffer *ring) } pmap_qenter((vm_offset_t)ring->status_page.page_addr, &obj->pages[0], 1); - pmap_invalidate_range(kernel_pmap, - (vm_offset_t)ring->status_page.page_addr, - (vm_offset_t)ring->status_page.page_addr + PAGE_SIZE); pmap_invalidate_cache_range((vm_offset_t)ring->status_page.page_addr, (vm_offset_t)ring->status_page.page_addr + PAGE_SIZE); ring->status_page.obj = obj; diff --git a/sys/dev/drm2/ttm/ttm_bo_vm.c b/sys/dev/drm2/ttm/ttm_bo_vm.c index 40a0fe4066c4..08e1c8777c6b 100644 --- a/sys/dev/drm2/ttm/ttm_bo_vm.c +++ b/sys/dev/drm2/ttm/ttm_bo_vm.c @@ -102,7 +102,7 @@ ttm_bo_vm_fault(vm_object_t vm_obj, vm_ooffset_t offset, struct ttm_buffer_object *bo = vm_obj->handle; struct ttm_bo_device *bdev = bo->bdev; struct ttm_tt *ttm = NULL; - vm_page_t m, oldm; + vm_page_t m, m1, oldm; int ret; int retval = VM_PAGER_OK; struct ttm_mem_type_manager *man = @@ -220,7 +220,14 @@ reserve: } m->valid = VM_PAGE_BITS_ALL; *mres = m; - vm_page_insert(m, vm_obj, OFF_TO_IDX(offset)); + m1 = vm_page_lookup(vm_obj, OFF_TO_IDX(offset)); + if (m1 == NULL) { + vm_page_insert(m, vm_obj, OFF_TO_IDX(offset)); + } else { + KASSERT(m == m1, + ("inconsistent insert bo %p m %p m1 %p offset %jx", + bo, m, m1, (uintmax_t)offset)); + } vm_page_busy(m); if (oldm != NULL) { diff --git a/sys/dev/etherswitch/arswitch/arswitch.c b/sys/dev/etherswitch/arswitch/arswitch.c index 0490580c3ad7..41139a35f4c5 100644 --- a/sys/dev/etherswitch/arswitch/arswitch.c +++ b/sys/dev/etherswitch/arswitch/arswitch.c @@ -58,6 +58,7 @@ #include <dev/etherswitch/arswitch/arswitchvar.h> #include <dev/etherswitch/arswitch/arswitch_reg.h> #include <dev/etherswitch/arswitch/arswitch_phy.h> +#include <dev/etherswitch/arswitch/arswitch_vlans.h> #include <dev/etherswitch/arswitch/arswitch_7240.h> #include <dev/etherswitch/arswitch/arswitch_8216.h> @@ -162,6 +163,74 @@ arswitch_attach_phys(struct arswitch_softc *sc) } static int +arswitch_reset(device_t dev) +{ + + arswitch_writereg(dev, AR8X16_REG_MASK_CTRL, + AR8X16_MASK_CTRL_SOFT_RESET); + DELAY(1000); + if (arswitch_readreg(dev, AR8X16_REG_MASK_CTRL) & + AR8X16_MASK_CTRL_SOFT_RESET) { + device_printf(dev, "unable to reset switch\n"); + return (-1); + } + return (0); +} + +static int +arswitch_set_vlan_mode(struct arswitch_softc *sc, uint32_t mode) +{ + + /* Check for invalid modes. */ + if ((mode & sc->info.es_vlan_caps) != mode) + return (EINVAL); + + switch (mode) { + case ETHERSWITCH_VLAN_DOT1Q: + sc->vlan_mode = ETHERSWITCH_VLAN_DOT1Q; + break; + case ETHERSWITCH_VLAN_PORT: + sc->vlan_mode = ETHERSWITCH_VLAN_PORT; + break; + default: + sc->vlan_mode = 0; + }; + + /* Reset VLANs. */ + arswitch_reset_vlans(sc); + + return (0); +} + +static void +arswitch_ports_init(struct arswitch_softc *sc) +{ + int port; + + /* Port0 - CPU */ + arswitch_writereg(sc->sc_dev, AR8X16_REG_PORT_STS(0), + (AR8X16_IS_SWITCH(sc, AR8216) ? + AR8X16_PORT_STS_SPEED_100 : AR8X16_PORT_STS_SPEED_1000) | + (AR8X16_IS_SWITCH(sc, AR8216) ? 0 : AR8X16_PORT_STS_RXFLOW) | + (AR8X16_IS_SWITCH(sc, AR8216) ? 0 : AR8X16_PORT_STS_TXFLOW) | + AR8X16_PORT_STS_RXMAC | + AR8X16_PORT_STS_TXMAC | + AR8X16_PORT_STS_DUPLEX); + arswitch_writereg(sc->sc_dev, AR8X16_REG_PORT_CTRL(0), + arswitch_readreg(sc->sc_dev, AR8X16_REG_PORT_CTRL(0)) & + ~AR8X16_PORT_CTRL_HEADER); + + for (port = 1; port <= sc->numphys; port++) { + /* Set ports to auto negotiation. */ + arswitch_writereg(sc->sc_dev, AR8X16_REG_PORT_STS(port), + AR8X16_PORT_STS_LINK_AUTO); + arswitch_writereg(sc->sc_dev, AR8X16_REG_PORT_CTRL(port), + arswitch_readreg(sc->sc_dev, AR8X16_REG_PORT_CTRL(port)) & + ~AR8X16_PORT_CTRL_HEADER); + } +} + +static int arswitch_attach(device_t dev) { struct arswitch_softc *sc; @@ -190,11 +259,8 @@ arswitch_attach(device_t dev) else return (ENXIO); - /* - * XXX these two should be part of the switch attach function - */ + /* Common defaults. */ sc->info.es_nports = 5; /* XXX technically 6, but 6th not used */ - sc->info.es_nvlangroups = 16; /* XXX Defaults for externally connected AR8316 */ sc->numphys = 4; @@ -211,34 +277,20 @@ arswitch_attach(device_t dev) (void) resource_int_value(device_get_name(dev), device_get_unit(dev), "is_gmii", &sc->is_gmii); - /* - * This requires much more setup depending upon each chip, including: - * - * + Proper reinitialisation of the PHYs; - * + Initialising the VLAN table; - * + Initialising the port access table and CPU flood/broadcast - * configuration; - * + Other things I haven't yet thought of. - */ -#ifdef NOTYET - arswitch_writereg(dev, AR8X16_REG_MASK_CTRL, - AR8X16_MASK_CTRL_SOFT_RESET); - DELAY(1000); - if (arswitch_readreg(dev, AR8X16_REG_MASK_CTRL) & - AR8X16_MASK_CTRL_SOFT_RESET) { - device_printf(dev, "unable to reset switch\n"); - return (ENXIO); - } -#endif + if (sc->numphys > AR8X16_NUM_PHYS) + sc->numphys = AR8X16_NUM_PHYS; - err = sc->hal.arswitch_hw_setup(sc); - if (err != 0) - return (err); + /* Reset the switch. */ + if (arswitch_reset(dev)) + return (ENXIO); err = sc->hal.arswitch_hw_global_setup(sc); if (err != 0) return (err); + /* Initialize the switch ports. */ + arswitch_ports_init(sc); + /* * Attach the PHYs and complete the bus enumeration. */ @@ -246,6 +298,15 @@ arswitch_attach(device_t dev) if (err != 0) return (err); + /* Default to ingress filters off. */ + err = arswitch_set_vlan_mode(sc, 0); + if (err != 0) + return (err); + + err = sc->hal.arswitch_hw_setup(sc); + if (err != 0) + return (err); + bus_generic_probe(dev); bus_enumerate_hinted_children(dev); err = bus_generic_attach(dev); @@ -428,19 +489,37 @@ arswitch_getinfo(device_t dev) static int arswitch_getport(device_t dev, etherswitch_port_t *p) { - struct arswitch_softc *sc = device_get_softc(dev); + struct arswitch_softc *sc; + struct ifmediareq *ifmr; struct mii_data *mii; - struct ifmediareq *ifmr = &p->es_ifmr; + uint32_t reg; int err; - - if (p->es_port < 0 || p->es_port >= AR8X16_NUM_PORTS) + + sc = device_get_softc(dev); + if (p->es_port < 0 || p->es_port > sc->numphys) return (ENXIO); - p->es_pvid = 0; + + ARSWITCH_LOCK(sc); + + /* Retrieve the PVID. */ + arswitch_get_pvid(sc, p->es_port, &p->es_pvid); + + /* Port flags. */ + reg = arswitch_readreg(sc->sc_dev, AR8X16_REG_PORT_CTRL(p->es_port)); + if (reg & AR8X16_PORT_CTRL_DOUBLE_TAG) + p->es_flags |= ETHERSWITCH_PORT_DOUBLE_TAG; + reg >>= AR8X16_PORT_CTRL_EGRESS_VLAN_MODE_SHIFT; + if ((reg & 0x3) == AR8X16_PORT_CTRL_EGRESS_VLAN_MODE_ADD) + p->es_flags |= ETHERSWITCH_PORT_ADDTAG; + if ((reg & 0x3) == AR8X16_PORT_CTRL_EGRESS_VLAN_MODE_STRIP) + p->es_flags |= ETHERSWITCH_PORT_STRIPTAG; + ARSWITCH_UNLOCK(sc); mii = arswitch_miiforport(sc, p->es_port); if (p->es_port == 0) { /* fill in fixed values for CPU port */ p->es_flags |= ETHERSWITCH_PORT_CPU; + ifmr = &p->es_ifmr; ifmr->ifm_count = 0; ifmr->ifm_current = ifmr->ifm_active = IFM_ETHER | IFM_1000_T | IFM_FDX; @@ -457,29 +536,58 @@ arswitch_getport(device_t dev, etherswitch_port_t *p) return (0); } -/* - * XXX doesn't yet work? - */ static int arswitch_setport(device_t dev, etherswitch_port_t *p) { int err; + uint32_t reg; struct arswitch_softc *sc; struct ifmedia *ifm; struct mii_data *mii; struct ifnet *ifp; - /* - * XXX check the sc numphys, or the #define ? - */ - if (p->es_port < 0 || p->es_port >= AR8X16_NUM_PHYS) + sc = device_get_softc(dev); + if (p->es_port < 0 || p->es_port > sc->numphys) return (ENXIO); - sc = device_get_softc(dev); + /* Port flags. */ + if (sc->vlan_mode == ETHERSWITCH_VLAN_DOT1Q) { - /* - * XXX TODO: don't set the CPU port? - */ + ARSWITCH_LOCK(sc); + /* Set the PVID. */ + if (p->es_pvid != 0) + arswitch_set_pvid(sc, p->es_port, p->es_pvid); + + /* Mutually exclusive. */ + if (p->es_flags & ETHERSWITCH_PORT_ADDTAG && + p->es_flags & ETHERSWITCH_PORT_STRIPTAG) { + ARSWITCH_UNLOCK(sc); + return (EINVAL); + } + + reg = 0; + if (p->es_flags & ETHERSWITCH_PORT_DOUBLE_TAG) + reg |= AR8X16_PORT_CTRL_DOUBLE_TAG; + if (p->es_flags & ETHERSWITCH_PORT_ADDTAG) + reg |= AR8X16_PORT_CTRL_EGRESS_VLAN_MODE_ADD << + AR8X16_PORT_CTRL_EGRESS_VLAN_MODE_SHIFT; + if (p->es_flags & ETHERSWITCH_PORT_STRIPTAG) + reg |= AR8X16_PORT_CTRL_EGRESS_VLAN_MODE_STRIP << + AR8X16_PORT_CTRL_EGRESS_VLAN_MODE_SHIFT; + + err = arswitch_modifyreg(sc->sc_dev, + AR8X16_REG_PORT_CTRL(p->es_port), + 0x3 << AR8X16_PORT_CTRL_EGRESS_VLAN_MODE_SHIFT | + AR8X16_PORT_CTRL_DOUBLE_TAG, reg); + + ARSWITCH_UNLOCK(sc); + if (err) + return (err); + } + + /* Do not allow media changes on CPU port. */ + if (p->es_port == AR8X16_PORT_CPU) + return (0); mii = arswitch_miiforport(sc, p->es_port); if (mii == NULL) @@ -488,28 +596,7 @@ arswitch_setport(device_t dev, etherswitch_port_t *p) ifp = arswitch_ifpforport(sc, p->es_port); ifm = &mii->mii_media; - err = ifmedia_ioctl(ifp, &p->es_ifr, ifm, SIOCSIFMEDIA); - return (err); -} - -static int -arswitch_getvgroup(device_t dev, etherswitch_vlangroup_t *vg) -{ - - /* XXX not implemented yet */ - vg->es_vid = 0; - vg->es_member_ports = 0; - vg->es_untagged_ports = 0; - vg->es_fid = 0; - return (0); -} - -static int -arswitch_setvgroup(device_t dev, etherswitch_vlangroup_t *vg) -{ - - /* XXX not implemented yet */ - return (0); + return (ifmedia_ioctl(ifp, &p->es_ifr, ifm, SIOCSIFMEDIA)); } static void @@ -546,6 +633,38 @@ arswitch_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr) ifmr->ifm_status = mii->mii_media_status; } +static int +arswitch_getconf(device_t dev, etherswitch_conf_t *conf) +{ + struct arswitch_softc *sc; + + sc = device_get_softc(dev); + + /* Return the VLAN mode. */ + conf->cmd = ETHERSWITCH_CONF_VLAN_MODE; + conf->vlan_mode = sc->vlan_mode; + + return (0); +} + +static int +arswitch_setconf(device_t dev, etherswitch_conf_t *conf) +{ + struct arswitch_softc *sc; + int err; + + sc = device_get_softc(dev); + + /* Set the VLAN mode. */ + if (conf->cmd & ETHERSWITCH_CONF_VLAN_MODE) { + err = arswitch_set_vlan_mode(sc, conf->vlan_mode); + if (err != 0) + return (err); + } + + return (0); +} + static device_method_t arswitch_methods[] = { /* Device interface */ DEVMETHOD(device_probe, arswitch_probe), @@ -576,6 +695,8 @@ static device_method_t arswitch_methods[] = { DEVMETHOD(etherswitch_setport, arswitch_setport), DEVMETHOD(etherswitch_getvgroup, arswitch_getvgroup), DEVMETHOD(etherswitch_setvgroup, arswitch_setvgroup), + DEVMETHOD(etherswitch_getconf, arswitch_getconf), + DEVMETHOD(etherswitch_setconf, arswitch_setconf), DEVMETHOD_END }; diff --git a/sys/dev/etherswitch/arswitch/arswitch_7240.c b/sys/dev/etherswitch/arswitch/arswitch_7240.c index c8f6426748c4..f3750bf7bb89 100644 --- a/sys/dev/etherswitch/arswitch/arswitch_7240.c +++ b/sys/dev/etherswitch/arswitch/arswitch_7240.c @@ -71,16 +71,6 @@ static int ar7240_hw_setup(struct arswitch_softc *sc) { - /* Enable CPU port; disable mirror port */ - arswitch_writereg(sc->sc_dev, AR8X16_REG_CPU_PORT, - AR8X16_CPU_PORT_EN | AR8X16_CPU_MIRROR_DIS); - - /* - * Let things settle; probing PHY4 doesn't seem reliable - * without a litle delay. - */ - DELAY(1000); - return (0); } @@ -91,6 +81,10 @@ static int ar7240_hw_global_setup(struct arswitch_softc *sc) { + /* Enable CPU port; disable mirror port */ + arswitch_writereg(sc->sc_dev, AR8X16_REG_CPU_PORT, + AR8X16_CPU_PORT_EN | AR8X16_CPU_MIRROR_DIS); + /* Setup TAG priority mapping */ arswitch_writereg(sc->sc_dev, AR8X16_REG_TAG_PRIO, 0xfa50); @@ -139,4 +133,9 @@ ar7240_attach(struct arswitch_softc *sc) sc->hal.arswitch_hw_setup = ar7240_hw_setup; sc->hal.arswitch_hw_global_setup = ar7240_hw_global_setup; + + /* Set the switch vlan capabilities. */ + sc->info.es_vlan_caps = ETHERSWITCH_VLAN_DOT1Q | + ETHERSWITCH_VLAN_PORT | ETHERSWITCH_VLAN_DOUBLE_TAG; + sc->info.es_nvlangroups = AR8X16_MAX_VLANS; } diff --git a/sys/dev/etherswitch/arswitch/arswitch_8216.c b/sys/dev/etherswitch/arswitch/arswitch_8216.c index eb49abad1414..72b232709b4d 100644 --- a/sys/dev/etherswitch/arswitch/arswitch_8216.c +++ b/sys/dev/etherswitch/arswitch/arswitch_8216.c @@ -89,4 +89,6 @@ ar8216_attach(struct arswitch_softc *sc) sc->hal.arswitch_hw_setup = ar8216_hw_setup; sc->hal.arswitch_hw_global_setup = ar8216_hw_global_setup; + + sc->info.es_nvlangroups = 0; } diff --git a/sys/dev/etherswitch/arswitch/arswitch_8226.c b/sys/dev/etherswitch/arswitch/arswitch_8226.c index 336120a7bffc..43d2281f2425 100644 --- a/sys/dev/etherswitch/arswitch/arswitch_8226.c +++ b/sys/dev/etherswitch/arswitch/arswitch_8226.c @@ -89,4 +89,6 @@ ar8226_attach(struct arswitch_softc *sc) sc->hal.arswitch_hw_setup = ar8226_hw_setup; sc->hal.arswitch_hw_global_setup = ar8226_hw_global_setup; + + sc->info.es_nvlangroups = 0; } diff --git a/sys/dev/etherswitch/arswitch/arswitch_8316.c b/sys/dev/etherswitch/arswitch/arswitch_8316.c index 3f01aed88b33..91dd72d90297 100644 --- a/sys/dev/etherswitch/arswitch/arswitch_8316.c +++ b/sys/dev/etherswitch/arswitch/arswitch_8316.c @@ -127,7 +127,18 @@ static int ar8316_hw_global_setup(struct arswitch_softc *sc) { - arswitch_writereg(sc->sc_dev, 0x38, 0xc000050e); + arswitch_writereg(sc->sc_dev, 0x38, AR8X16_MAGIC); + + /* Enable CPU port and disable mirror port. */ + arswitch_writereg(sc->sc_dev, AR8X16_REG_CPU_PORT, + AR8X16_CPU_PORT_EN | AR8X16_CPU_MIRROR_DIS); + + /* Setup TAG priority mapping. */ + arswitch_writereg(sc->sc_dev, AR8X16_REG_TAG_PRIO, 0xfa50); + + /* Enable ARP frame acknowledge. */ + arswitch_modifyreg(sc->sc_dev, AR8X16_REG_AT_CTRL, 0, + AR8X16_AT_CTRL_ARP_EN); /* * Flood address table misses to all ports, and enable forwarding of @@ -136,9 +147,14 @@ ar8316_hw_global_setup(struct arswitch_softc *sc) arswitch_writereg(sc->sc_dev, AR8X16_REG_FLOOD_MASK, AR8X16_FLOOD_MASK_BCAST_TO_CPU | 0x003f003f); + /* Enable jumbo frames. */ arswitch_modifyreg(sc->sc_dev, AR8X16_REG_GLOBAL_CTRL, AR8316_GLOBAL_CTRL_MTU_MASK, 9018 + 8 + 2); + /* Setup service TAG. */ + arswitch_modifyreg(sc->sc_dev, AR8X16_REG_SERVICE_TAG, + AR8X16_SERVICE_TAG_MASK, 0); + return (0); } @@ -148,4 +164,9 @@ ar8316_attach(struct arswitch_softc *sc) sc->hal.arswitch_hw_setup = ar8316_hw_setup; sc->hal.arswitch_hw_global_setup = ar8316_hw_global_setup; + + /* Set the switch vlan capabilities. */ + sc->info.es_vlan_caps = ETHERSWITCH_VLAN_DOT1Q | + ETHERSWITCH_VLAN_PORT | ETHERSWITCH_VLAN_DOUBLE_TAG; + sc->info.es_nvlangroups = AR8X16_MAX_VLANS; } diff --git a/sys/dev/etherswitch/arswitch/arswitch_phy.c b/sys/dev/etherswitch/arswitch/arswitch_phy.c index f896d421cc8c..8e190e2d92b7 100644 --- a/sys/dev/etherswitch/arswitch/arswitch_phy.c +++ b/sys/dev/etherswitch/arswitch/arswitch_phy.c @@ -127,16 +127,13 @@ arswitch_writephy(device_t dev, int phy, int reg, int data) return (ENXIO); ARSWITCH_LOCK(sc); - err = arswitch_writereg_lsb(dev, AR8X16_REG_MDIO_CTRL, - (data & AR8X16_MDIO_CTRL_DATA_MASK)); - if (err != 0) - goto out; - err = arswitch_writereg_msb(dev, AR8X16_REG_MDIO_CTRL, + err = arswitch_writereg(dev, AR8X16_REG_MDIO_CTRL, AR8X16_MDIO_CTRL_BUSY | AR8X16_MDIO_CTRL_MASTER_EN | AR8X16_MDIO_CTRL_CMD_WRITE | (phy << AR8X16_MDIO_CTRL_PHY_ADDR_SHIFT) | - (reg << AR8X16_MDIO_CTRL_REG_ADDR_SHIFT)); + (reg << AR8X16_MDIO_CTRL_REG_ADDR_SHIFT) | + (data & AR8X16_MDIO_CTRL_DATA_MASK)); if (err != 0) goto out; for (timeout = 100; timeout--; ) { diff --git a/sys/dev/etherswitch/arswitch/arswitch_reg.c b/sys/dev/etherswitch/arswitch/arswitch_reg.c index 4ec71ba661ce..5413406b8ad9 100644 --- a/sys/dev/etherswitch/arswitch/arswitch_reg.c +++ b/sys/dev/etherswitch/arswitch/arswitch_reg.c @@ -72,17 +72,10 @@ arswitch_split_setpage(device_t dev, uint32_t addr, uint16_t *phy, *phy = (((addr) >> 6) & 0x07) | 0x10; *reg = ((addr) >> 1) & 0x1f; - /* - * The earlier code would only switch the page - * over if the page were different. Experiments have - * shown that this is unstable. - * - * Hence, the page is always set here. - * - * See PR kern/172968 - */ - MDIO_WRITEREG(device_get_parent(dev), 0x18, 0, page); - sc->page = page; + if (sc->page != page) { + MDIO_WRITEREG(device_get_parent(dev), 0x18, 0, page); + sc->page = page; + } } /* @@ -171,8 +164,8 @@ arswitch_writereg(device_t dev, int addr, int value) { /* XXX Check the first write too? */ - arswitch_writereg_lsb(dev, addr, value); - return (arswitch_writereg_msb(dev, addr, value)); + arswitch_writereg_msb(dev, addr, value); + return (arswitch_writereg_lsb(dev, addr, value)); } int @@ -185,3 +178,24 @@ arswitch_modifyreg(device_t dev, int addr, int mask, int set) value |= set; return (arswitch_writereg(dev, addr, value)); } + +int +arswitch_waitreg(device_t dev, int addr, int mask, int val, int timeout) +{ + int err, v; + + err = -1; + while (1) { + v = arswitch_readreg(dev, addr); + v &= mask; + if (v == val) { + err = 0; + break; + } + if (!timeout) + break; + DELAY(1); + timeout--; + } + return (err); +} diff --git a/sys/dev/etherswitch/arswitch/arswitch_reg.h b/sys/dev/etherswitch/arswitch/arswitch_reg.h index fdac59f9d786..0167e2c1ca35 100644 --- a/sys/dev/etherswitch/arswitch/arswitch_reg.h +++ b/sys/dev/etherswitch/arswitch/arswitch_reg.h @@ -34,6 +34,7 @@ extern void arswitch_writedbg(device_t dev, int phy, uint16_t dbg_addr, extern int arswitch_readreg(device_t dev, int addr); extern int arswitch_writereg(device_t dev, int addr, int value); extern int arswitch_modifyreg(device_t dev, int addr, int mask, int set); +extern int arswitch_waitreg(device_t, int, int, int, int); extern int arswitch_readreg_lsb(device_t dev, int addr); extern int arswitch_readreg_msb(device_t dev, int addr); diff --git a/sys/dev/etherswitch/arswitch/arswitch_vlans.c b/sys/dev/etherswitch/arswitch/arswitch_vlans.c new file mode 100644 index 000000000000..2307f7102440 --- /dev/null +++ b/sys/dev/etherswitch/arswitch/arswitch_vlans.c @@ -0,0 +1,375 @@ +/*- + * Copyright (c) 2013 Luiz Otavio O Souza. + * Copyright (c) 2011-2012 Stefan Bethke. + * Copyright (c) 2012 Adrian Chadd. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include <sys/param.h> +#include <sys/bus.h> +#include <sys/errno.h> +#include <sys/kernel.h> +#include <sys/systm.h> +#include <sys/socket.h> + +#include <net/if.h> + +#include <dev/mii/mii.h> + +#include <dev/etherswitch/etherswitch.h> +#include <dev/etherswitch/arswitch/arswitchreg.h> +#include <dev/etherswitch/arswitch/arswitchvar.h> +#include <dev/etherswitch/arswitch/arswitch_reg.h> +#include <dev/etherswitch/arswitch/arswitch_vlans.h> + +#include "mdio_if.h" +#include "miibus_if.h" +#include "etherswitch_if.h" + +static int +arswitch_vlan_op(struct arswitch_softc *sc, uint32_t op, uint32_t vid, + uint32_t data) +{ + int err; + + if (arswitch_waitreg(sc->sc_dev, AR8X16_REG_VLAN_CTRL, + AR8X16_VLAN_ACTIVE, 0, 5)) + return (EBUSY); + + /* Load the vlan data if needed. */ + if (op == AR8X16_VLAN_OP_LOAD) { + err = arswitch_writereg(sc->sc_dev, AR8X16_REG_VLAN_DATA, + (data & AR8X16_VLAN_MEMBER) | AR8X16_VLAN_VALID); + if (err) + return (err); + } + + if (vid != 0) + op |= ((vid & ETHERSWITCH_VID_MASK) << AR8X16_VLAN_VID_SHIFT); + op |= AR8X16_VLAN_ACTIVE; + arswitch_writereg(sc->sc_dev, AR8X16_REG_VLAN_CTRL, op); + + /* Wait for command processing. */ + if (arswitch_waitreg(sc->sc_dev, AR8X16_REG_VLAN_CTRL, + AR8X16_VLAN_ACTIVE, 0, 5)) + return (EBUSY); + + return (0); +} + +static int +arswitch_flush_dot1q_vlan(struct arswitch_softc *sc) +{ + + ARSWITCH_LOCK_ASSERT(sc, MA_OWNED); + return (arswitch_vlan_op(sc, AR8X16_VLAN_OP_FLUSH, 0, 0)); +} + +static int +arswitch_purge_dot1q_vlan(struct arswitch_softc *sc, int vid) +{ + + ARSWITCH_LOCK_ASSERT(sc, MA_OWNED); + return (arswitch_vlan_op(sc, AR8X16_VLAN_OP_PURGE, vid, 0)); +} + +static int +arswitch_get_dot1q_vlan(struct arswitch_softc *sc, uint32_t *ports, int vid) +{ + uint32_t reg; + int err; + + ARSWITCH_LOCK_ASSERT(sc, MA_OWNED); + err = arswitch_vlan_op(sc, AR8X16_VLAN_OP_GET, vid, 0); + if (err) + return (err); + + reg = arswitch_readreg(sc->sc_dev, AR8X16_REG_VLAN_DATA); + if ((reg & AR8X16_VLAN_VALID) == 0) { + *ports = 0; + return (EINVAL); + } + reg &= ((1 << (sc->numphys + 1)) - 1); + *ports = reg; + return (0); +} + +static int +arswitch_set_dot1q_vlan(struct arswitch_softc *sc, uint32_t ports, int vid) +{ + int err; + + ARSWITCH_LOCK_ASSERT(sc, MA_OWNED); + err = arswitch_vlan_op(sc, AR8X16_VLAN_OP_LOAD, vid, ports); + if (err) + return (err); + return (0); +} + +static int +arswitch_get_port_vlan(struct arswitch_softc *sc, uint32_t *ports, int vid) +{ + int port; + uint32_t reg; + + ARSWITCH_LOCK_ASSERT(sc, MA_OWNED); + /* For port based vlans the vlanid is the same as the port index. */ + port = vid & ETHERSWITCH_VID_MASK; + reg = arswitch_readreg(sc->sc_dev, AR8X16_REG_PORT_VLAN(port)); + *ports = (reg >> AR8X16_PORT_VLAN_DEST_PORTS_SHIFT); + *ports &= AR8X16_VLAN_MEMBER; + return (0); +} + +static int +arswitch_set_port_vlan(struct arswitch_softc *sc, uint32_t ports, int vid) +{ + int err, port; + + ARSWITCH_LOCK_ASSERT(sc, MA_OWNED); + /* For port based vlans the vlanid is the same as the port index. */ + port = vid & ETHERSWITCH_VID_MASK; + err = arswitch_modifyreg(sc->sc_dev, AR8X16_REG_PORT_VLAN(port), + AR8X16_VLAN_MEMBER << AR8X16_PORT_VLAN_DEST_PORTS_SHIFT, + (ports & AR8X16_VLAN_MEMBER) << AR8X16_PORT_VLAN_DEST_PORTS_SHIFT); + if (err) + return (err); + return (0); +} + +/* + * Reset vlans to default state. + */ +void +arswitch_reset_vlans(struct arswitch_softc *sc) +{ + uint32_t ports; + int i, j; + + ARSWITCH_LOCK_ASSERT(sc, MA_NOTOWNED); + + ARSWITCH_LOCK(sc); + + /* Reset all vlan data. */ + memset(sc->vid, 0, sizeof(sc->vid)); + + /* Disable the QinQ and egress filters for all ports. */ + for (i = 0; i <= sc->numphys; i++) { + if (arswitch_modifyreg(sc->sc_dev, AR8X16_REG_PORT_CTRL(i), + 0x3 << AR8X16_PORT_CTRL_EGRESS_VLAN_MODE_SHIFT | + AR8X16_PORT_CTRL_DOUBLE_TAG, 0)) { + ARSWITCH_UNLOCK(sc); + return; + } + } + + if (arswitch_flush_dot1q_vlan(sc)) { + ARSWITCH_UNLOCK(sc); + return; + } + + if (sc->vlan_mode == ETHERSWITCH_VLAN_DOT1Q) { + /* + * Reset the port based vlan settings and turn on the + * ingress filter for all ports. + */ + ports = 0; + for (i = 0; i <= sc->numphys; i++) + arswitch_modifyreg(sc->sc_dev, + AR8X16_REG_PORT_VLAN(i), + AR8X16_PORT_VLAN_MODE_MASK | + AR8X16_VLAN_MEMBER << + AR8X16_PORT_VLAN_DEST_PORTS_SHIFT, + AR8X16_PORT_VLAN_MODE_SECURE << + AR8X16_PORT_VLAN_MODE_SHIFT); + + /* + * Setup vlan 1 as PVID for all switch ports. Add all ports + * as members of vlan 1. + */ + sc->vid[0] = 1; + /* Set PVID for everyone. */ + for (i = 0; i <= sc->numphys; i++) + arswitch_set_pvid(sc, i, sc->vid[0]); + ports = 0; + for (i = 0; i <= sc->numphys; i++) + ports |= (1 << i); + arswitch_set_dot1q_vlan(sc, ports, sc->vid[0]); + sc->vid[0] |= ETHERSWITCH_VID_VALID; + } else if (sc->vlan_mode == ETHERSWITCH_VLAN_PORT) { + /* Initialize the port based vlans. */ + for (i = 0; i <= sc->numphys; i++) { + sc->vid[i] = i | ETHERSWITCH_VID_VALID; + ports = 0; + for (j = 0; j <= sc->numphys; j++) + ports |= (1 << j); + arswitch_modifyreg(sc->sc_dev, + AR8X16_REG_PORT_VLAN(i), + AR8X16_PORT_VLAN_MODE_MASK | + AR8X16_VLAN_MEMBER << + AR8X16_PORT_VLAN_DEST_PORTS_SHIFT, + ports << AR8X16_PORT_VLAN_DEST_PORTS_SHIFT | + AR8X16_PORT_VLAN_MODE_SECURE << + AR8X16_PORT_VLAN_MODE_PORT_ONLY); + } + } else { + /* Disable the ingress filter and get everyone on all vlans. */ + for (i = 0; i <= sc->numphys; i++) + arswitch_modifyreg(sc->sc_dev, + AR8X16_REG_PORT_VLAN(i), + AR8X16_PORT_VLAN_MODE_MASK | + AR8X16_VLAN_MEMBER << + AR8X16_PORT_VLAN_DEST_PORTS_SHIFT, + AR8X16_VLAN_MEMBER << + AR8X16_PORT_VLAN_DEST_PORTS_SHIFT | + AR8X16_PORT_VLAN_MODE_SECURE << + AR8X16_PORT_VLAN_MODE_PORT_ONLY); + } + ARSWITCH_UNLOCK(sc); +} + +int +arswitch_getvgroup(device_t dev, etherswitch_vlangroup_t *vg) +{ + struct arswitch_softc *sc; + int err; + + sc = device_get_softc(dev); + ARSWITCH_LOCK_ASSERT(sc, MA_NOTOWNED); + + if (vg->es_vlangroup > sc->info.es_nvlangroups) + return (EINVAL); + + /* Reset the members ports. */ + vg->es_untagged_ports = 0; + vg->es_member_ports = 0; + + /* Not supported. */ + vg->es_fid = 0; + + /* Vlan ID. */ + ARSWITCH_LOCK(sc); + vg->es_vid = sc->vid[vg->es_vlangroup]; + if ((vg->es_vid & ETHERSWITCH_VID_VALID) == 0) { + ARSWITCH_UNLOCK(sc); + return (0); + } + + /* Member Ports. */ + switch (sc->vlan_mode) { + case ETHERSWITCH_VLAN_DOT1Q: + err = arswitch_get_dot1q_vlan(sc, &vg->es_member_ports, + vg->es_vid); + break; + case ETHERSWITCH_VLAN_PORT: + err = arswitch_get_port_vlan(sc, &vg->es_member_ports, + vg->es_vid); + break; + default: + vg->es_member_ports = 0; + err = -1; + } + ARSWITCH_UNLOCK(sc); + vg->es_untagged_ports = vg->es_member_ports; + return (err); +} + +int +arswitch_setvgroup(device_t dev, etherswitch_vlangroup_t *vg) +{ + struct arswitch_softc *sc; + int err, vid; + + sc = device_get_softc(dev); + ARSWITCH_LOCK_ASSERT(sc, MA_NOTOWNED); + + /* Check VLAN mode. */ + if (sc->vlan_mode == 0) + return (EINVAL); + + /* + * Check if we are changing the vlanid for an already used vtu entry. + * Then purge the entry first. + */ + ARSWITCH_LOCK(sc); + vid = sc->vid[vg->es_vlangroup]; + if (sc->vlan_mode == ETHERSWITCH_VLAN_DOT1Q && + (vid & ETHERSWITCH_VID_VALID) != 0 && + (vid & ETHERSWITCH_VID_MASK) != + (vg->es_vid & ETHERSWITCH_VID_MASK)) { + err = arswitch_purge_dot1q_vlan(sc, vid); + if (err) { + ARSWITCH_UNLOCK(sc); + return (err); + } + } + + /* Vlan ID. */ + if (sc->vlan_mode == ETHERSWITCH_VLAN_DOT1Q) { + sc->vid[vg->es_vlangroup] = vg->es_vid & ETHERSWITCH_VID_MASK; + /* Setting the vlanid to zero disables the vlangroup. */ + if (sc->vid[vg->es_vlangroup] == 0) { + ARSWITCH_UNLOCK(sc); + return (0); + } + sc->vid[vg->es_vlangroup] |= ETHERSWITCH_VID_VALID; + vid = sc->vid[vg->es_vlangroup]; + } + + /* Member Ports. */ + switch (sc->vlan_mode) { + case ETHERSWITCH_VLAN_DOT1Q: + err = arswitch_set_dot1q_vlan(sc, vg->es_member_ports, vid); + break; + case ETHERSWITCH_VLAN_PORT: + err = arswitch_set_port_vlan(sc, vg->es_member_ports, vid); + break; + default: + err = -1; + } + ARSWITCH_UNLOCK(sc); + return (err); +} + +int +arswitch_get_pvid(struct arswitch_softc *sc, int port, int *pvid) +{ + uint32_t reg; + + ARSWITCH_LOCK_ASSERT(sc, MA_OWNED); + reg = arswitch_readreg(sc->sc_dev, AR8X16_REG_PORT_VLAN(port)); + *pvid = reg & 0xfff; + return (0); +} + +int +arswitch_set_pvid(struct arswitch_softc *sc, int port, int pvid) +{ + + ARSWITCH_LOCK_ASSERT(sc, MA_OWNED); + return (arswitch_modifyreg(sc->sc_dev, + AR8X16_REG_PORT_VLAN(port), 0xfff, pvid)); +} diff --git a/sys/dev/etherswitch/arswitch/arswitch_vlans.h b/sys/dev/etherswitch/arswitch/arswitch_vlans.h new file mode 100644 index 000000000000..e671e225ea1e --- /dev/null +++ b/sys/dev/etherswitch/arswitch/arswitch_vlans.h @@ -0,0 +1,38 @@ +/*- + * Copyright (c) 2013 Luiz Otavio O Souza. + * Copyright (c) 2011-2012 Stefan Bethke. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ +#ifndef __ARSWITCH_VLANS_H__ +#define __ARSWITCH_VLANS_H__ + +void arswitch_reset_vlans(struct arswitch_softc *); +int arswitch_getvgroup(device_t, etherswitch_vlangroup_t *); +int arswitch_setvgroup(device_t, etherswitch_vlangroup_t *); +int arswitch_get_pvid(struct arswitch_softc *, int, int *); +int arswitch_set_pvid(struct arswitch_softc *, int, int); + +#endif /* __ARSWITCH_VLANS_H__ */ diff --git a/sys/dev/etherswitch/arswitch/arswitchreg.h b/sys/dev/etherswitch/arswitch/arswitchreg.h index 499d94cef3ef..38be689e9d11 100644 --- a/sys/dev/etherswitch/arswitch/arswitchreg.h +++ b/sys/dev/etherswitch/arswitch/arswitchreg.h @@ -114,7 +114,7 @@ #define AR8X16_VLAN_PRIO_EN (1 << 31) #define AR8X16_REG_VLAN_DATA 0x0044 -#define AR8X16_VLAN_MEMBER 0x000003ff +#define AR8X16_VLAN_MEMBER 0x0000003f #define AR8X16_VLAN_VALID (1 << 11) #define AR8X16_REG_ARL_CTRL0 0x0050 diff --git a/sys/dev/etherswitch/arswitch/arswitchvar.h b/sys/dev/etherswitch/arswitch/arswitchvar.h index 40e38a41d576..2db13ccdbccd 100644 --- a/sys/dev/etherswitch/arswitch/arswitchvar.h +++ b/sys/dev/etherswitch/arswitch/arswitchvar.h @@ -42,8 +42,6 @@ typedef enum { #define AR8X16_IS_SWITCH(_sc, _type) \ (!!((_sc)->sc_switchtype == AR8X16_SWITCH_ ## _type)) -struct arswitch_softc; - struct arswitch_softc { struct mtx sc_mtx; /* serialize access to softc */ device_t sc_dev; @@ -59,6 +57,10 @@ struct arswitch_softc { struct callout callout_tick; etherswitch_info_t info; + /* VLANs support */ + int vid[AR8X16_MAX_VLANS]; + uint32_t vlan_mode; + struct { int (* arswitch_hw_setup) (struct arswitch_softc *); int (* arswitch_hw_global_setup) (struct arswitch_softc *); diff --git a/sys/dev/etherswitch/etherswitch.h b/sys/dev/etherswitch/etherswitch.h index bb0167b6ae91..26190198b529 100644 --- a/sys/dev/etherswitch/etherswitch.h +++ b/sys/dev/etherswitch/etherswitch.h @@ -26,6 +26,8 @@ struct etherswitch_phyreg { typedef struct etherswitch_phyreg etherswitch_phyreg_t; #define ETHERSWITCH_NAMEMAX 64 +#define ETHERSWITCH_VID_MASK 0xfff +#define ETHERSWITCH_VID_VALID (1 << 12) #define ETHERSWITCH_VLAN_ISL (1 << 0) /* ISL */ #define ETHERSWITCH_VLAN_PORT (1 << 1) /* Port based vlan */ #define ETHERSWITCH_VLAN_DOT1Q (1 << 2) /* 802.1q */ diff --git a/sys/dev/etherswitch/ip17x/ip175c.c b/sys/dev/etherswitch/ip17x/ip175c.c index b106e2905349..ced23c0c548d 100644 --- a/sys/dev/etherswitch/ip17x/ip175c.c +++ b/sys/dev/etherswitch/ip17x/ip175c.c @@ -147,9 +147,9 @@ ip175c_dot1q_vlan_setup(struct ip17x_softc *sc) memset(vlans, 0, sizeof(vlans)); for (i = 0; i < IP17X_MAX_VLANS; i++) { v = &sc->vlan[i]; - if (v->vlanid == 0) + if ((v->vlanid & ETHERSWITCH_VID_VALID) == 0) continue; - vlans[v->vlanid] = v->ports; + vlans[v->vlanid & ETHERSWITCH_VID_MASK] = v->ports; } for (j = 0, i = 1; i <= IP17X_MAX_VLANS / 2; i++) { diff --git a/sys/dev/etherswitch/ip17x/ip175d.c b/sys/dev/etherswitch/ip17x/ip175d.c index 8bc28433e04d..1e6eee201d1c 100644 --- a/sys/dev/etherswitch/ip17x/ip175d.c +++ b/sys/dev/etherswitch/ip17x/ip175d.c @@ -94,7 +94,8 @@ ip175d_hw_setup(struct ip17x_softc *sc) striptag[i] = 0; v = &sc->vlan[i]; - if (v->vlanid == 0 || sc->vlan_mode == 0) { + if ((v->vlanid & ETHERSWITCH_VID_VALID) == 0 || + sc->vlan_mode == 0) { /* Vlangroup disabled. Reset the filter. */ ip17x_writephy(sc->sc_dev, 22, 14 + i, i + 1); ports[i] = 0x3f; @@ -105,7 +106,8 @@ ip175d_hw_setup(struct ip17x_softc *sc) ports[i] = v->ports; /* Setup the filter, write the VLAN id. */ - ip17x_writephy(sc->sc_dev, 22, 14 + i, v->vlanid); + ip17x_writephy(sc->sc_dev, 22, 14 + i, + v->vlanid & ETHERSWITCH_VID_MASK); for (j = 0; j < MII_NPHY; j++) { if ((ports[i] & (1 << j)) == 0) diff --git a/sys/dev/etherswitch/ip17x/ip17x_vlans.c b/sys/dev/etherswitch/ip17x/ip17x_vlans.c index 80bfc8bee40f..7c2c66d8550f 100644 --- a/sys/dev/etherswitch/ip17x/ip17x_vlans.c +++ b/sys/dev/etherswitch/ip17x/ip17x_vlans.c @@ -74,7 +74,7 @@ ip17x_reset_vlans(struct ip17x_softc *sc, uint32_t vlan_mode) if (((1 << phy) & sc->phymask) == 0) continue; v = &sc->vlan[i]; - v->vlanid = i++; + v->vlanid = i++ | ETHERSWITCH_VID_VALID; v->ports = (1 << sc->cpuport); for (j = 0; j < MII_NPHY; j++) { if (((1 << j) & sc->phymask) == 0) @@ -90,10 +90,10 @@ ip17x_reset_vlans(struct ip17x_softc *sc, uint32_t vlan_mode) * members of vlan 1. */ v = &sc->vlan[0]; - v->vlanid = 1; - /* Set PVID for everyone. */ + v->vlanid = 1 | ETHERSWITCH_VID_VALID; + /* Set PVID to 1 for everyone. */ for (i = 0; i < sc->numports; i++) - sc->pvid[i] = v->vlanid; + sc->pvid[i] = 1; for (i = 0; i < MII_NPHY; i++) { if ((sc->phymask & (1 << i)) == 0) continue; @@ -148,11 +148,29 @@ ip17x_setvgroup(device_t dev, etherswitch_vlangroup_t *vg) return (EINVAL); /* IP175C don't support VLAN IDs > 15. */ - if (IP17X_IS_SWITCH(sc, IP175C) && vg->es_vid > IP175C_LAST_VLAN) + if (IP17X_IS_SWITCH(sc, IP175C) && + (vg->es_vid & ETHERSWITCH_VID_MASK) > IP175C_LAST_VLAN) return (EINVAL); /* Vlan ID. */ - sc->vlan[vg->es_vlangroup].vlanid = vg->es_vid; + if (sc->vlan_mode == ETHERSWITCH_VLAN_DOT1Q) { + for (i = 0; i < sc->info.es_nvlangroups; i++) { + /* Is this Vlan ID already set in another vlangroup ? */ + if (i != vg->es_vlangroup && + sc->vlan[i].vlanid & ETHERSWITCH_VID_VALID && + (sc->vlan[i].vlanid & ETHERSWITCH_VID_MASK) == + (vg->es_vid & ETHERSWITCH_VID_MASK)) + return (EINVAL); + } + sc->vlan[vg->es_vlangroup].vlanid = vg->es_vid & + ETHERSWITCH_VID_MASK; + /* Setting the vlanid to zero disables the vlangroup. */ + if (sc->vlan[vg->es_vlangroup].vlanid == 0) { + sc->vlan[vg->es_vlangroup].ports = 0; + return (sc->hal.ip17x_hw_setup(sc)); + } + sc->vlan[vg->es_vlangroup].vlanid |= ETHERSWITCH_VID_VALID; + } /* Member Ports. */ sc->vlan[vg->es_vlangroup].ports = 0; diff --git a/sys/dev/etherswitch/rtl8366/rtl8366rb.c b/sys/dev/etherswitch/rtl8366/rtl8366rb.c index d4b1ee96cfea..1bc88a646942 100644 --- a/sys/dev/etherswitch/rtl8366/rtl8366rb.c +++ b/sys/dev/etherswitch/rtl8366/rtl8366rb.c @@ -619,7 +619,7 @@ rtl_getvgroup(device_t dev, etherswitch_vlangroup_t *vg) for (i=0; i<3; i++) vmcr[i] = rtl_readreg(dev, RTL8366RB_VMCR(i, vg->es_vlangroup)); - vg->es_vid = RTL8366RB_VMCR_VID(vmcr); + vg->es_vid = RTL8366RB_VMCR_VID(vmcr) | ETHERSWITCH_VID_VALID; vg->es_member_ports = RTL8366RB_VMCR_MEMBER(vmcr); vg->es_untagged_ports = RTL8366RB_VMCR_UNTAG(vmcr); vg->es_fid = RTL8366RB_VMCR_FID(vmcr); diff --git a/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c b/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c index 47f48dd6abde..74700061e545 100644 --- a/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c +++ b/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c @@ -943,6 +943,6 @@ static devclass_t netvsc_devclass; DRIVER_MODULE(hn, vmbus, netvsc_driver, netvsc_devclass, 0, 0); MODULE_VERSION(hn, 1); MODULE_DEPEND(hn, vmbus, 1, 1, 1); -SYSINIT(netvsc_initx, SI_SUB_RUN_SCHEDULER, SI_ORDER_MIDDLE + 1, netvsc_init, +SYSINIT(netvsc_initx, SI_SUB_KTHREAD_IDLE, SI_ORDER_MIDDLE + 1, netvsc_init, NULL); diff --git a/sys/dev/hyperv/utilities/hv_util.c b/sys/dev/hyperv/utilities/hv_util.c index 9ad4370285ff..43e421373ca5 100644 --- a/sys/dev/hyperv/utilities/hv_util.c +++ b/sys/dev/hyperv/utilities/hv_util.c @@ -488,5 +488,5 @@ DRIVER_MODULE(hv_utils, vmbus, util_driver, util_devclass, hv_util_modevent, 0); MODULE_VERSION(hv_utils, 1); MODULE_DEPEND(hv_utils, vmbus, 1, 1, 1); -SYSINIT(hv_util_initx, SI_SUB_RUN_SCHEDULER, SI_ORDER_MIDDLE + 1, +SYSINIT(hv_util_initx, SI_SUB_KTHREAD_IDLE, SI_ORDER_MIDDLE + 1, hv_util_init, NULL); diff --git a/sys/dev/ichsmb/ichsmb_pci.c b/sys/dev/ichsmb/ichsmb_pci.c index 083338fea5f0..049a98b621a0 100644 --- a/sys/dev/ichsmb/ichsmb_pci.c +++ b/sys/dev/ichsmb/ichsmb_pci.c @@ -85,6 +85,7 @@ __FBSDID("$FreeBSD$"); #define ID_PATSBURG 0x1d228086 #define ID_CPT 0x1c228086 #define ID_PPT 0x1e228086 +#define ID_COLETOCRK 0x23B08086 #define ID_LPT 0x8c228086 #define PCIS_SERIALBUS_SMBUS_PROGIF 0x00 @@ -192,6 +193,9 @@ ichsmb_pci_probe(device_t dev) case ID_LPT: device_set_desc(dev, "Intel Lynx Point SMBus controller"); break; + case ID_COLETOCRK: + device_set_desc(dev, "Intel Coleto Creek SMBus controller"); + break; default: return (ENXIO); } diff --git a/sys/dev/ichwd/ichwd.c b/sys/dev/ichwd/ichwd.c index 245cfbf5e9b6..f28f5e04f6b3 100644 --- a/sys/dev/ichwd/ichwd.c +++ b/sys/dev/ichwd/ichwd.c @@ -195,6 +195,7 @@ static struct ichwd_device ichwd_devices[] = { { DEVICEID_LPT1, "Intel Lynx Point watchdog timer", 10 }, { DEVICEID_LPT2, "Intel Lynx Point watchdog timer", 10 }, { DEVICEID_DH89XXCC_LPC, "Intel DH89xxCC watchdog timer", 10 }, + { DEVICEID_COLETOCRK_LPC, "Intel Coleto Creek watchdog timer", 10 }, { 0, NULL, 0 }, }; diff --git a/sys/dev/ichwd/ichwd.h b/sys/dev/ichwd/ichwd.h index 858e3bc24edf..6f0c7173efd7 100644 --- a/sys/dev/ichwd/ichwd.h +++ b/sys/dev/ichwd/ichwd.h @@ -126,6 +126,7 @@ struct ichwd_softc { #define DEVICEID_PPT30 0x1e5e #define DEVICEID_PPT31 0x1e5f #define DEVICEID_DH89XXCC_LPC 0x2310 +#define DEVICEID_COLETOCRK_LPC 0x2390 #define DEVICEID_82801AA 0x2410 #define DEVICEID_82801AB 0x2420 #define DEVICEID_82801BA 0x2440 diff --git a/sys/dev/ipmi/ipmi_isa.c b/sys/dev/ipmi/ipmi_isa.c index 9d3f9f34c2f2..fc66ab1840e5 100644 --- a/sys/dev/ipmi/ipmi_isa.c +++ b/sys/dev/ipmi/ipmi_isa.c @@ -78,6 +78,14 @@ static int ipmi_isa_probe(device_t dev) { + /* + * Give other drivers precedence. Unfortunately, this doesn't + * work if we have an SMBIOS table that duplicates a PCI device + * that's later on the bus than the PCI-ISA bridge. + */ + if (ipmi_attached) + return (ENXIO); + /* Skip any PNP devices. */ if (isa_get_logicalid(dev) != 0) return (ENXIO); @@ -175,14 +183,6 @@ ipmi_isa_attach(device_t dev) !ipmi_hint_identify(dev, &info)) return (ENXIO); - /* - * Give other drivers precedence. Unfortunately, this doesn't - * work if we have an SMBIOS table that duplicates a PCI device - * that's later on the bus than the PCI-ISA bridge. - */ - if (ipmi_attached) - return (EBUSY); - switch (info.iface_type) { case KCS_MODE: count = 2; diff --git a/sys/dev/ipmi/ipmivars.h b/sys/dev/ipmi/ipmivars.h index 614c6be36046..8e9e130d3ca7 100644 --- a/sys/dev/ipmi/ipmivars.h +++ b/sys/dev/ipmi/ipmivars.h @@ -219,7 +219,7 @@ struct ipmi_ipmb { ((sc)->ipmi_io_res[1] != NULL ? OUTB_MULTIPLE(sc, x, value) : \ OUTB_SINGLE(sc, x, value)) -#define MAX_TIMEOUT 3 * hz +#define MAX_TIMEOUT 6 * hz int ipmi_attach(device_t); int ipmi_detach(device_t); diff --git a/sys/dev/iwn/if_iwn.c b/sys/dev/iwn/if_iwn.c index 6e0cc1b69405..644a7ebbaf14 100644 --- a/sys/dev/iwn/if_iwn.c +++ b/sys/dev/iwn/if_iwn.c @@ -93,6 +93,8 @@ static const struct iwn_ident iwn_ident_table[] = { { 0x8086, 0x0091, "Intel Centrino Advanced-N 6230" }, { 0x8086, 0x0885, "Intel Centrino Wireless-N + WiMAX 6150" }, { 0x8086, 0x0886, "Intel Centrino Wireless-N + WiMAX 6150" }, + { 0x8086, 0x0887, "Intel Centrino Wireless-N 2230" }, + { 0x8086, 0x0888, "Intel Centrino Wireless-N 2230" }, { 0x8086, 0x0896, "Intel Centrino Wireless-N 130" }, { 0x8086, 0x0897, "Intel Centrino Wireless-N 130" }, { 0x8086, 0x08ae, "Intel Centrino Wireless-N 100" }, @@ -337,6 +339,7 @@ enum { IWN_DEBUG_CMD = 0x00001000, /* cmd submission */ IWN_DEBUG_TXRATE = 0x00002000, /* TX rate debugging */ IWN_DEBUG_PWRSAVE = 0x00004000, /* Power save operations */ + IWN_DEBUG_TRACE = 0x40000000, /* Print begin and start driver function */ IWN_DEBUG_FATAL = 0x80000000, /* fatal errors */ IWN_DEBUG_ANY = 0xffffffff }; @@ -445,6 +448,17 @@ iwn_attach(device_t dev) sc->sc_dev = dev; +#ifdef IWN_DEBUG + error = resource_int_value(device_get_name(sc->sc_dev), + device_get_unit(sc->sc_dev), "debug", &(sc->sc_debug)); + if (error != 0) + sc->sc_debug = 0; +#else + sc->sc_debug = 0; +#endif + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: begin\n",__func__); + /* * Get the offset of the PCI Express Capability Structure in PCI * Configuration Space. @@ -695,9 +709,11 @@ iwn_attach(device_t dev) if (bootverbose) ieee80211_announce(ic); + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); return 0; fail: iwn_detach(dev); + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end in error\n",__func__); return error; } @@ -706,6 +722,7 @@ iwn4965_attach(struct iwn_softc *sc, uint16_t pid) { struct iwn_ops *ops = &sc->ops; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); ops->load_firmware = iwn4965_load_firmware; ops->read_eeprom = iwn4965_read_eeprom; ops->post_alive = iwn4965_post_alive; @@ -736,6 +753,8 @@ iwn4965_attach(struct iwn_softc *sc, uint16_t pid) sc->txchainmask = IWN_ANT_AB; sc->rxchainmask = IWN_ANT_ABC; + DPRINTF(sc, IWN_DEBUG_TRACE, "%s: end\n",__func__); + return 0; } @@ -744,6 +763,8 @@ iwn5000_attach(struct iwn_softc *sc, uint16_t pid) { struct iwn_ops *ops = &sc->ops; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + ops->load_firmware = iwn5000_load_firmware; ops->read_eeprom = iwn5000_read_eeprom; ops->post_alive = iwn5000_post_alive; @@ -820,6 +841,7 @@ iwn5000_attach(struct iwn_softc *sc, uint16_t pid) default: device_printf(sc->sc_dev, "adapter type %d not supported\n", sc->hw_type); + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end in error\n",__func__); return ENOTSUP; } return 0; @@ -833,24 +855,25 @@ iwn_radiotap_attach(struct iwn_softc *sc) { struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; - + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); ieee80211_radiotap_attach(ic, &sc->sc_txtap.wt_ihdr, sizeof(sc->sc_txtap), IWN_TX_RADIOTAP_PRESENT, &sc->sc_rxtap.wr_ihdr, sizeof(sc->sc_rxtap), IWN_RX_RADIOTAP_PRESENT); + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__); } static void iwn_sysctlattach(struct iwn_softc *sc) { +#ifdef IWN_DEBUG struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(sc->sc_dev); struct sysctl_oid *tree = device_get_sysctl_tree(sc->sc_dev); -#ifdef IWN_DEBUG - sc->sc_debug = 0; SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "debug", CTLFLAG_RW, &sc->sc_debug, 0, "control debugging printfs"); + "debug", CTLFLAG_RW, &sc->sc_debug, sc->sc_debug, + "control debugging printfs"); #endif } @@ -938,6 +961,7 @@ iwn_detach(device_t dev) if (ifp != NULL) if_free(ifp); + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s done\n", __func__); IWN_LOCK_DESTROY(sc); return 0; } @@ -1098,6 +1122,7 @@ iwn_eeprom_lock(struct iwn_softc *sc) DELAY(10); } } + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end timeout\n", __func__); return ETIMEDOUT; } @@ -1117,6 +1142,8 @@ iwn_init_otprom(struct iwn_softc *sc) uint16_t prev, base, next; int count, error; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + /* Wait for clock stabilization before accessing prph. */ if ((error = iwn_clock_wait(sc)) != 0) return error; @@ -1160,6 +1187,9 @@ iwn_init_otprom(struct iwn_softc *sc) /* Skip "next" word. */ sc->prom_base = prev + 1; } + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__); + return 0; } @@ -1170,6 +1200,8 @@ iwn_read_prom_data(struct iwn_softc *sc, uint32_t addr, void *data, int count) uint32_t val, tmp; int ntries; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + addr += sc->prom_base; for (; count > 0; count -= 2, addr++) { IWN_WRITE(sc, IWN_EEPROM, addr << 2); @@ -1202,6 +1234,9 @@ iwn_read_prom_data(struct iwn_softc *sc, uint32_t addr, void *data, int count) if (count > 1) *out++ = val >> 24; } + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__); + return 0; } @@ -1332,6 +1367,8 @@ iwn_alloc_rx_ring(struct iwn_softc *sc, struct iwn_rx_ring *ring) ring->cur = 0; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + /* Allocate RX descriptors (256-byte aligned). */ size = IWN_RX_RING_COUNT * sizeof (uint32_t); error = iwn_dma_contig_alloc(sc, &ring->desc_dma, (void **)&ring->desc, @@ -1406,9 +1443,14 @@ iwn_alloc_rx_ring(struct iwn_softc *sc, struct iwn_rx_ring *ring) bus_dmamap_sync(ring->desc_dma.tag, ring->desc_dma.map, BUS_DMASYNC_PREWRITE); + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); + return 0; fail: iwn_free_rx_ring(sc, ring); + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end in error\n",__func__); + return error; } @@ -1417,6 +1459,8 @@ iwn_reset_rx_ring(struct iwn_softc *sc, struct iwn_rx_ring *ring) { int ntries; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + if (iwn_nic_lock(sc) == 0) { IWN_WRITE(sc, IWN_FH_RX_CONFIG, 0); for (ntries = 0; ntries < 1000; ntries++) { @@ -1436,6 +1480,8 @@ iwn_free_rx_ring(struct iwn_softc *sc, struct iwn_rx_ring *ring) { int i; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s \n", __func__); + iwn_dma_contig_free(&ring->desc_dma); iwn_dma_contig_free(&ring->stat_dma); @@ -1469,6 +1515,8 @@ iwn_alloc_tx_ring(struct iwn_softc *sc, struct iwn_tx_ring *ring, int qid) ring->queued = 0; ring->cur = 0; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + /* Allocate TX descriptors (256-byte aligned). */ size = IWN_TX_RING_COUNT * sizeof (struct iwn_tx_desc); error = iwn_dma_contig_alloc(sc, &ring->desc_dma, (void **)&ring->desc, @@ -1517,9 +1565,13 @@ iwn_alloc_tx_ring(struct iwn_softc *sc, struct iwn_tx_ring *ring, int qid) goto fail; } } + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__); + return 0; fail: iwn_free_tx_ring(sc, ring); + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end in error\n", __func__); return error; } @@ -1528,6 +1580,8 @@ iwn_reset_tx_ring(struct iwn_softc *sc, struct iwn_tx_ring *ring) { int i; + DPRINTF(sc, IWN_DEBUG_TRACE, "->doing %s \n", __func__); + for (i = 0; i < IWN_TX_RING_COUNT; i++) { struct iwn_tx_data *data = &ring->data[i]; @@ -1553,6 +1607,8 @@ iwn_free_tx_ring(struct iwn_softc *sc, struct iwn_tx_ring *ring) { int i; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s \n", __func__); + iwn_dma_contig_free(&ring->desc_dma); iwn_dma_contig_free(&ring->cmd_dma); @@ -1606,6 +1662,8 @@ iwn_read_eeprom(struct iwn_softc *sc, uint8_t macaddr[IEEE80211_ADDR_LEN]) uint16_t val; int error; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + /* Check whether adapter has an EEPROM or an OTPROM. */ if (sc->hw_type >= IWN_HW_REV_TYPE_1000 && (IWN_READ(sc, IWN_OTP_GP) & IWN_OTP_GP_DEV_SEL_OTP)) @@ -1663,6 +1721,9 @@ iwn_read_eeprom(struct iwn_softc *sc, uint8_t macaddr[IEEE80211_ADDR_LEN]) iwn_apm_stop(sc); /* Power OFF adapter. */ iwn_eeprom_unlock(sc); + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__); + return 0; } @@ -1673,6 +1734,8 @@ iwn4965_read_eeprom(struct iwn_softc *sc) uint16_t val; int i; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + /* Read regulatory domain (4 ASCII characters). */ iwn_read_prom_data(sc, IWN4965_EEPROM_DOMAIN, sc->eeprom_domain, 4); @@ -1711,6 +1774,8 @@ iwn4965_read_eeprom(struct iwn_softc *sc) iwn4965_print_power_group(sc, i); } #endif + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__); } #ifdef IWN_DEBUG @@ -1757,6 +1822,8 @@ iwn5000_read_eeprom(struct iwn_softc *sc) uint16_t val; int i; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + /* Read regulatory domain (4 ASCII characters). */ iwn_read_prom_data(sc, IWN5000_EEPROM_REG, &val, 2); base = le16toh(val); @@ -1800,6 +1867,9 @@ iwn5000_read_eeprom(struct iwn_softc *sc) DPRINTF(sc, IWN_DEBUG_CALIBRATE, "crystal calibration 0x%08x\n", le32toh(sc->eeprom_crystal)); } + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__); + } /* @@ -1835,6 +1905,8 @@ iwn_read_eeprom_band(struct iwn_softc *sc, int n) uint8_t chan; int i, nflags; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + for (i = 0; i < band->nchan; i++) { if (!(channels[i].flags & IWN_EEPROM_CHAN_VALID)) { DPRINTF(sc, IWN_DEBUG_RESET, @@ -1877,6 +1949,9 @@ iwn_read_eeprom_band(struct iwn_softc *sc, int n) c->ic_flags |= IEEE80211_CHAN_HT20; } } + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__); + } static void @@ -1890,8 +1965,12 @@ iwn_read_eeprom_ht40(struct iwn_softc *sc, int n) uint8_t chan; int i, nflags; - if (!(sc->sc_flags & IWN_FLAG_HAS_11N)) + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s start\n", __func__); + + if (!(sc->sc_flags & IWN_FLAG_HAS_11N)) { + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end no 11n\n", __func__); return; + } for (i = 0; i < band->nchan; i++) { if (!(channels[i].flags & IWN_EEPROM_CHAN_VALID)) { @@ -1939,6 +2018,9 @@ iwn_read_eeprom_ht40(struct iwn_softc *sc, int n) c->ic_flags &= ~IEEE80211_CHAN_HT; c->ic_flags |= IEEE80211_CHAN_HT40D | nflags; } + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__); + } static void @@ -2022,6 +2104,8 @@ iwn_read_eeprom_enhinfo(struct iwn_softc *sc) uint8_t flags; int i, j; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + iwn_read_prom_data(sc, IWN5000_EEPROM_REG, &val, 2); base = le16toh(val); iwn_read_prom_data(sc, base + IWN6000_EEPROM_ENHINFO, @@ -2072,6 +2156,9 @@ iwn_read_eeprom_enhinfo(struct iwn_softc *sc) c->ic_maxpower = maxpwr; } } + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__); + } static struct ieee80211_node * @@ -2218,6 +2305,8 @@ iwn_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) struct iwn_softc *sc = ic->ic_ifp->if_softc; int error = 0; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + DPRINTF(sc, IWN_DEBUG_STATE, "%s: %s -> %s\n", __func__, ieee80211_state_name[vap->iv_state], ieee80211_state_name[nstate]); @@ -2277,8 +2366,13 @@ iwn_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) } IWN_UNLOCK(sc); IEEE80211_LOCK(ic); - if (error != 0) + if (error != 0){ + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end in error\n", __func__); return error; + } + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); + return ivp->iv_newstate(vap, nstate, arg); } @@ -2342,6 +2436,8 @@ iwn_rx_done(struct iwn_softc *sc, struct iwn_rx_desc *desc, uint32_t flags; int error, len, rssi, nf; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + if (desc->type == IWN_MPDU_RX_DONE) { /* Check for prior RX_PHY notification. */ if (!sc->last_rx_valid) { @@ -2480,6 +2576,9 @@ iwn_rx_done(struct iwn_softc *sc, struct iwn_rx_desc *desc, (void)ieee80211_input_all(ic, m, rssi - nf, nf); IWN_LOCK(sc); + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); + } /* Process an incoming Compressed BlockAck. */ @@ -2501,6 +2600,8 @@ iwn_rx_compressed_ba(struct iwn_softc *sc, struct iwn_rx_desc *desc, uint8_t tid; int ackfailcnt = 0, i, lastidx, qid, *res, shift; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + bus_dmamap_sync(sc->rxq.data_dmat, data->map, BUS_DMASYNC_POSTREAD); qid = le16toh(ba->qid); @@ -2572,6 +2673,9 @@ iwn_rx_compressed_ba(struct iwn_softc *sc, struct iwn_rx_desc *desc, } bitmap >>= 1; } + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); + } /* @@ -2585,10 +2689,14 @@ iwn5000_rx_calib_results(struct iwn_softc *sc, struct iwn_rx_desc *desc, struct iwn_phy_calib *calib = (struct iwn_phy_calib *)(desc + 1); int len, idx = -1; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + /* Runtime firmware should not send such a notification. */ - if (sc->sc_flags & IWN_FLAG_CALIB_DONE) + if (sc->sc_flags & IWN_FLAG_CALIB_DONE){ + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s received after clib done\n", + __func__); return; - + } len = (le32toh(desc->len) & 0x3fff) - 4; bus_dmamap_sync(sc->rxq.data_dmat, data->map, BUS_DMASYNC_POSTREAD); @@ -2650,10 +2758,15 @@ iwn_rx_statistics(struct iwn_softc *sc, struct iwn_rx_desc *desc, struct iwn_stats *stats = (struct iwn_stats *)(desc + 1); int temp; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + /* Ignore statistics received during a scan. */ if (vap->iv_state != IEEE80211_S_RUN || - (ic->ic_flags & IEEE80211_F_SCAN)) + (ic->ic_flags & IEEE80211_F_SCAN)){ + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s received during calib\n", + __func__); return; + } bus_dmamap_sync(sc->rxq.data_dmat, data->map, BUS_DMASYNC_POSTREAD); @@ -2691,6 +2804,8 @@ iwn_rx_statistics(struct iwn_softc *sc, struct iwn_rx_desc *desc, iwn_collect_noise(sc, &stats->rx.general); else if (calib->state == IWN_CALIB_STATE_RUN) iwn_tune_sensitivity(sc, &stats->rx); + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); } /* @@ -2772,6 +2887,8 @@ iwn_tx_done(struct iwn_softc *sc, struct iwn_rx_desc *desc, int ackfailcnt, KASSERT(data->ni != NULL, ("no node")); + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + /* Unmap and free mbuf. */ bus_dmamap_sync(ring->data_dmat, data->map, BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(ring->data_dmat, data->map); @@ -2826,6 +2943,9 @@ iwn_tx_done(struct iwn_softc *sc, struct iwn_rx_desc *desc, int ackfailcnt, iwn_start_locked(ifp); } } + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); + } /* @@ -2873,6 +2993,8 @@ iwn_ampdu_tx_done(struct iwn_softc *sc, int qid, int idx, int nframes, uint8_t tid; int bit, i, lastidx, *res, seqno, shift, start; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + #ifdef NOT_YET if (nframes == 1) { if ((*status & 0xff) != 1 && (*status & 0xff) != 2) @@ -2959,6 +3081,9 @@ iwn_ampdu_tx_done(struct iwn_softc *sc, int qid, int idx, int nframes, iwn_start_locked(ifp); } } + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); + } /* @@ -3269,7 +3394,8 @@ iwn_intr(void *arg) r2 = IWN_READ(sc, IWN_FH_INT); } - DPRINTF(sc, IWN_DEBUG_INTR, "interrupt reg1=%x reg2=%x\n", r1, r2); + DPRINTF(sc, IWN_DEBUG_INTR, "interrupt reg1=0x%08x reg2=0x%08x\n" + , r1, r2); if (r1 == 0 && r2 == 0) goto done; /* Interrupt not for us. */ @@ -3342,6 +3468,8 @@ iwn4965_update_sched(struct iwn_softc *sc, int qid, int idx, uint8_t id, { uint16_t *w = &sc->sched[qid * IWN4965_SCHED_COUNT + idx]; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + *w = htole16(len + 8); bus_dmamap_sync(sc->sched_dma.tag, sc->sched_dma.map, BUS_DMASYNC_PREWRITE); @@ -3358,6 +3486,8 @@ iwn5000_update_sched(struct iwn_softc *sc, int qid, int idx, uint8_t id, { uint16_t *w = &sc->sched[qid * IWN5000_SCHED_COUNT + idx]; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + *w = htole16(id << 12 | (len + 8)); bus_dmamap_sync(sc->sched_dma.tag, sc->sched_dma.map, BUS_DMASYNC_PREWRITE); @@ -3374,6 +3504,8 @@ iwn5000_reset_sched(struct iwn_softc *sc, int qid, int idx) { uint16_t *w = &sc->sched[qid * IWN5000_SCHED_COUNT + idx]; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + *w = (*w & htole16(0xf000)) | htole16(1); bus_dmamap_sync(sc->sched_dma.tag, sc->sched_dma.map, BUS_DMASYNC_PREWRITE); @@ -3408,6 +3540,8 @@ iwn_tx_data(struct iwn_softc *sc, struct mbuf *m, struct ieee80211_node *ni) uint8_t tid, ridx, txant, type; int ac, i, totlen, error, pad, nsegs = 0, rate; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + IWN_LOCK_ASSERT(sc); wh = mtod(m, struct ieee80211_frame *); @@ -3653,6 +3787,8 @@ iwn_tx_data(struct iwn_softc *sc, struct mbuf *m, struct ieee80211_node *ni) if (++ring->queued > IWN_TX_RING_HIMARK) sc->qfullmsk |= 1 << ring->qid; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); + return 0; } @@ -3677,6 +3813,8 @@ iwn_tx_data_raw(struct iwn_softc *sc, struct mbuf *m, int ac, totlen, error, pad, nsegs = 0, i, rate; uint8_t ridx, type, txant; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + IWN_LOCK_ASSERT(sc); wh = mtod(m, struct ieee80211_frame *); @@ -3862,6 +4000,8 @@ iwn_tx_data_raw(struct iwn_softc *sc, struct mbuf *m, if (++ring->queued > IWN_TX_RING_HIMARK) sc->qfullmsk |= 1 << ring->qid; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); + return 0; } @@ -3874,6 +4014,8 @@ iwn_raw_xmit(struct ieee80211_node *ni, struct mbuf *m, struct iwn_softc *sc = ifp->if_softc; int error = 0; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { ieee80211_free_node(ni); m_freem(m); @@ -3902,6 +4044,9 @@ iwn_raw_xmit(struct ieee80211_node *ni, struct mbuf *m, sc->sc_tx_timer = 5; IWN_UNLOCK(sc); + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); + return error; } @@ -3957,6 +4102,8 @@ iwn_watchdog(void *arg) KASSERT(ifp->if_drv_flags & IFF_DRV_RUNNING, ("not running")); + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + if (sc->sc_tx_timer > 0) { if (--sc->sc_tx_timer == 0) { if_printf(ifp, "device timeout\n"); @@ -4024,6 +4171,8 @@ iwn_cmd(struct iwn_softc *sc, int code, const void *buf, int size, int async) bus_addr_t paddr; int totlen, error; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + if (async == 0) IWN_LOCK_ASSERT(sc); @@ -4079,6 +4228,8 @@ iwn_cmd(struct iwn_softc *sc, int code, const void *buf, int size, int async) ring->cur = (ring->cur + 1) % IWN_TX_RING_COUNT; IWN_WRITE(sc, IWN_HBUS_TARG_WRPTR, ring->qid << 8 | ring->cur); + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); + return async ? 0 : msleep(desc, &sc->sc_mtx, PCATCH, "iwncmd", hz); } @@ -4088,6 +4239,8 @@ iwn4965_add_node(struct iwn_softc *sc, struct iwn_node_info *node, int async) struct iwn4965_node_info hnode; caddr_t src, dst; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + /* * We use the node structure for 5000 Series internally (it is * a superset of the one for 4965AGN). We thus copy the common @@ -4104,6 +4257,9 @@ iwn4965_add_node(struct iwn_softc *sc, struct iwn_node_info *node, int async) static int iwn5000_add_node(struct iwn_softc *sc, struct iwn_node_info *node, int async) { + + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + /* Direct mapping. */ return iwn_cmd(sc, IWN_CMD_ADD_NODE, node, sizeof (*node), async); } @@ -4118,6 +4274,8 @@ iwn_set_link_quality(struct iwn_softc *sc, struct ieee80211_node *ni) uint8_t txant; int i, rate, txrate; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + /* Use the first valid TX antenna. */ txant = IWN_LSB(sc->txchainmask); @@ -4155,6 +4313,9 @@ iwn_set_link_quality(struct iwn_softc *sc, struct ieee80211_node *ni) if (txrate > 0) txrate--; } + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); + return iwn_cmd(sc, IWN_CMD_LINK_QUALITY, &linkq, sizeof linkq, 1); #undef RV } @@ -4173,6 +4334,8 @@ iwn_add_broadcast_node(struct iwn_softc *sc, int async) uint8_t txant; int i, error; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + memset(&node, 0, sizeof node); IEEE80211_ADDR_COPY(node.macaddr, ifp->if_broadcastaddr); node.id = sc->broadcast_id; @@ -4201,6 +4364,9 @@ iwn_add_broadcast_node(struct iwn_softc *sc, int async) for (i = 1; i < IWN_MAX_TX_RETRIES; i++) { linkq.retry[i] = linkq.retry[0]; } + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); + return iwn_cmd(sc, IWN_CMD_LINK_QUALITY, &linkq, sizeof linkq, async); } @@ -4212,6 +4378,8 @@ iwn_updateedca(struct ieee80211com *ic) struct iwn_edca_params cmd; int aci; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + memset(&cmd, 0, sizeof cmd); cmd.flags = htole32(IWN_EDCA_UPDATE); for (aci = 0; aci < WME_NUM_AC; aci++) { @@ -4228,6 +4396,9 @@ iwn_updateedca(struct ieee80211com *ic) (void)iwn_cmd(sc, IWN_CMD_EDCA_PARAMS, &cmd, sizeof cmd, 1); IWN_UNLOCK(sc); IEEE80211_LOCK(ic); + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); + return 0; #undef IWN_EXP2 } @@ -4243,6 +4414,8 @@ iwn_set_led(struct iwn_softc *sc, uint8_t which, uint8_t off, uint8_t on) { struct iwn_cmd_led led; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + /* Clear microcode LED ownership. */ IWN_CLRBITS(sc, IWN_LED, IWN_LED_BSM_CTRL); @@ -4263,6 +4436,8 @@ iwn_set_critical_temp(struct iwn_softc *sc) struct iwn_critical_temp crit; int32_t temp; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + IWN_WRITE(sc, IWN_UCODE_GP1_CLR, IWN_UCODE_GP1_CTEMP_STOP_RF); if (sc->hw_type == IWN_HW_REV_TYPE_5150) @@ -4283,6 +4458,8 @@ iwn_set_timing(struct iwn_softc *sc, struct ieee80211_node *ni) struct iwn_cmd_timing cmd; uint64_t val, mod; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + memset(&cmd, 0, sizeof cmd); memcpy(&cmd.tstamp, ni->ni_tstamp.data, sizeof (uint64_t)); cmd.bintval = htole16(ni->ni_intval); @@ -4305,6 +4482,8 @@ iwn4965_power_calibration(struct iwn_softc *sc, int temp) struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + /* Adjust TX power if need be (delta >= 3 degC). */ DPRINTF(sc, IWN_DEBUG_CALIBRATE, "%s: temperature %d->%d\n", __func__, sc->temp, temp); @@ -4476,6 +4655,8 @@ iwn5000_set_txpower(struct iwn_softc *sc, struct ieee80211_channel *ch, { struct iwn5000_cmd_txpower cmd; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + /* * TX power calibration is handled automatically by the firmware * for 5000 Series. @@ -4498,6 +4679,8 @@ iwn4965_get_rssi(struct iwn_softc *sc, struct iwn_rx_stat *stat) uint8_t mask, agc; int rssi; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + mask = (le16toh(phy->antenna) >> 4) & IWN_ANT_ABC; agc = (le16toh(phy->agc) >> 7) & 0x7f; @@ -4523,6 +4706,8 @@ iwn5000_get_rssi(struct iwn_softc *sc, struct iwn_rx_stat *stat) uint8_t agc; int rssi; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + agc = (le32toh(phy->agc) >> 9) & 0x7f; rssi = MAX(le16toh(phy->rssi[0]) & 0xff, @@ -4564,6 +4749,8 @@ iwn4965_get_temperature(struct iwn_softc *sc) struct iwn_ucode_info *uc = &sc->ucode_info; int32_t r1, r2, r3, r4, temp; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + r1 = le32toh(uc->temp[0].chan20MHz); r2 = le32toh(uc->temp[1].chan20MHz); r3 = le32toh(uc->temp[2].chan20MHz); @@ -4588,6 +4775,8 @@ iwn5000_get_temperature(struct iwn_softc *sc) { int32_t temp; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + /* * Temperature is not used by the driver for 5000 Series because * TX power calibration is handled by firmware. @@ -4611,6 +4800,8 @@ iwn_init_sensitivity(struct iwn_softc *sc) uint32_t flags; int error; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + /* Reset calibration state machine. */ memset(calib, 0, sizeof (*calib)); calib->state = IWN_CALIB_STATE_INIT; @@ -4655,6 +4846,8 @@ iwn_collect_noise(struct iwn_softc *sc, uint32_t val; int i; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + /* Accumulate RSSI and noise for all 3 antennas. */ for (i = 0; i < 3; i++) { calib->rssi[i] += le32toh(stats->rssi[i]) & 0xff; @@ -4693,6 +4886,9 @@ iwn_collect_noise(struct iwn_softc *sc, /* Enable power-saving mode if requested by user. */ if (ic->ic_flags & IEEE80211_F_PMGTON) (void)iwn_set_pslevel(sc, 0, 3, 1); + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); + } static int @@ -4700,6 +4896,8 @@ iwn4965_init_gains(struct iwn_softc *sc) { struct iwn_phy_calib_gain cmd; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + memset(&cmd, 0, sizeof cmd); cmd.code = IWN4965_PHY_CALIB_DIFF_GAIN; /* Differential gains initially set to 0 for all 3 antennas. */ @@ -4713,6 +4911,8 @@ iwn5000_init_gains(struct iwn_softc *sc) { struct iwn_phy_calib cmd; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + memset(&cmd, 0, sizeof cmd); cmd.code = sc->reset_noise_gain; cmd.ngroups = 1; @@ -4729,6 +4929,8 @@ iwn4965_set_gains(struct iwn_softc *sc) struct iwn_phy_calib_gain cmd; int i, delta, noise; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + /* Get minimal noise among connected antennas. */ noise = INT_MAX; /* NB: There's at least one antenna. */ for (i = 0; i < 3; i++) @@ -4762,6 +4964,8 @@ iwn5000_set_gains(struct iwn_softc *sc) struct iwn_phy_calib_gain cmd; int i, ant, div, delta; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + /* We collected 20 beacons and !=6050 need a 1.5 factor. */ div = (sc->hw_type == IWN_HW_REV_TYPE_6050) ? 20 : 30; @@ -4820,9 +5024,13 @@ iwn_tune_sensitivity(struct iwn_softc *sc, const struct iwn_rx_stats *stats) uint8_t noise[3], noise_ref; int i, needs_update = 0; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + /* Check that we've been enabled long enough. */ - if ((rxena = le32toh(stats->general.load)) == 0) + if ((rxena = le32toh(stats->general.load)) == 0){ + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end not so long\n", __func__); return; + } /* Compute number of false alarms since last call for OFDM. */ fa = le32toh(stats->ofdm.bad_plcp) - calib->bad_plcp_ofdm; @@ -4940,6 +5148,9 @@ iwn_tune_sensitivity(struct iwn_softc *sc, const struct iwn_rx_stats *stats) if (needs_update) (void)iwn_send_sensitivity(sc); + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); + #undef dec #undef inc } @@ -5147,6 +5358,8 @@ iwn_config(struct iwn_softc *sc) uint16_t rxchain; int error; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + if (sc->hw_type == IWN_HW_REV_TYPE_6005) { /* Set radio temperature sensor offset. */ error = iwn5000_temp_offset_calib(sc); @@ -5260,6 +5473,9 @@ iwn_config(struct iwn_softc *sc) "%s: could not set power saving level\n", __func__); return error; } + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); + return 0; } @@ -5294,6 +5510,8 @@ iwn_scan(struct iwn_softc *sc) uint8_t txant; int buflen, error; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + buf = malloc(IWN_SCAN_MAXSZ, M_DEVBUF, M_NOWAIT | M_ZERO); if (buf == NULL) { device_printf(sc->sc_dev, @@ -5429,6 +5647,9 @@ iwn_scan(struct iwn_softc *sc) hdr->nchan); error = iwn_cmd(sc, IWN_CMD_SCAN, buf, buflen, 1); free(buf, M_DEVBUF); + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); + return error; } @@ -5441,6 +5662,8 @@ iwn_auth(struct iwn_softc *sc, struct ieee80211vap *vap) struct ieee80211_node *ni = vap->iv_bss; int error; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + /* Update adapter configuration. */ IEEE80211_ADDR_COPY(sc->rxon.bssid, ni->ni_bssid); sc->rxon.chan = ieee80211_chan2ieee(ic, ni->ni_chan); @@ -5488,6 +5711,9 @@ iwn_auth(struct iwn_softc *sc, struct ieee80211vap *vap) error); return error; } + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); + return 0; } @@ -5502,6 +5728,8 @@ iwn_run(struct iwn_softc *sc, struct ieee80211vap *vap) uint32_t htflags = 0; int error; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + if (ic->ic_opmode == IEEE80211_M_MONITOR) { /* Link LED blinks while monitoring. */ iwn_set_led(sc, IWN_LED_LINK, 5, 5); @@ -5621,6 +5849,9 @@ iwn_run(struct iwn_softc *sc, struct ieee80211vap *vap) /* Link LED always on while associated. */ iwn_set_led(sc, IWN_LED_LINK, 0, 1); + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); + return 0; } @@ -5641,6 +5872,8 @@ iwn_ampdu_rx_start(struct ieee80211_node *ni, struct ieee80211_rx_ampdu *rap, uint8_t tid; int error; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + tid = MS(le16toh(baparamset), IEEE80211_BAPS_TID); ssn = MS(le16toh(baseqctl), IEEE80211_BASEQ_START); @@ -5673,6 +5906,8 @@ iwn_ampdu_rx_stop(struct ieee80211_node *ni, struct ieee80211_rx_ampdu *rap) struct iwn_node_info node; uint8_t tid; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + /* XXX: tid as an argument */ for (tid = 0; tid < WME_NUM_TID; tid++) { if (&ni->ni_rx_ampdu[tid] == rap) @@ -5696,6 +5931,8 @@ iwn_addba_request(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap, struct iwn_softc *sc = ni->ni_ic->ic_ifp->if_softc; int qid; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + for (qid = sc->firstaggqueue; qid < sc->ntxqs; qid++) { if (sc->qid2tap[qid] == NULL) break; @@ -5726,6 +5963,8 @@ iwn_addba_response(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap, uint8_t tid = tap->txa_tid; int ret; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + if (code == IEEE80211_STATUS_SUCCESS) { ni->ni_txseqs[tid] = tap->txa_start & 0xfff; ret = iwn_ampdu_tx_start(ni->ni_ic, ni, tid); @@ -5754,6 +5993,8 @@ iwn_ampdu_tx_start(struct ieee80211com *ic, struct ieee80211_node *ni, struct iwn_node_info node; int error, qid; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + /* Enable TX for the specified RA/TID. */ wn->disable_tid &= ~(1 << tid); memset(&node, 0, sizeof node); @@ -5785,6 +6026,8 @@ iwn_ampdu_tx_stop(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap) uint8_t tid = tap->txa_tid; int qid; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + sc->sc_addba_stop(ni, tap); if (tap->txa_private == NULL) @@ -5808,6 +6051,8 @@ iwn4965_ampdu_tx_start(struct iwn_softc *sc, struct ieee80211_node *ni, { struct iwn_node *wn = (void *)ni; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + /* Stop TX scheduler while we're changing its configuration. */ iwn_prph_write(sc, IWN4965_SCHED_QUEUE_STATUS(qid), IWN4965_TXQ_STATUS_CHGACT); @@ -5843,6 +6088,8 @@ iwn4965_ampdu_tx_start(struct iwn_softc *sc, struct ieee80211_node *ni, static void iwn4965_ampdu_tx_stop(struct iwn_softc *sc, int qid, uint8_t tid, uint16_t ssn) { + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + /* Stop TX scheduler while we're changing its configuration. */ iwn_prph_write(sc, IWN4965_SCHED_QUEUE_STATUS(qid), IWN4965_TXQ_STATUS_CHGACT); @@ -5863,6 +6110,8 @@ static void iwn5000_ampdu_tx_start(struct iwn_softc *sc, struct ieee80211_node *ni, int qid, uint8_t tid, uint16_t ssn) { + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + struct iwn_node *wn = (void *)ni; /* Stop TX scheduler while we're changing its configuration. */ @@ -5899,6 +6148,8 @@ iwn5000_ampdu_tx_start(struct iwn_softc *sc, struct ieee80211_node *ni, static void iwn5000_ampdu_tx_stop(struct iwn_softc *sc, int qid, uint8_t tid, uint16_t ssn) { + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + /* Stop TX scheduler while we're changing its configuration. */ iwn_prph_write(sc, IWN5000_SCHED_QUEUE_STATUS(qid), IWN5000_TXQ_STATUS_CHGACT); @@ -6045,6 +6296,8 @@ iwn4965_post_alive(struct iwn_softc *sc) if ((error = iwn_nic_lock(sc)) != 0) return error; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + /* Clear TX scheduler state in SRAM. */ sc->sched_base = iwn_prph_read(sc, IWN_SCHED_SRAM_ADDR); iwn_mem_set_region_4(sc, sc->sched_base + IWN4965_SCHED_CTX_OFF, 0, @@ -6095,11 +6348,15 @@ iwn5000_post_alive(struct iwn_softc *sc) { int error, qid; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + /* Switch to using ICT interrupt mode. */ iwn5000_ict_reset(sc); - if ((error = iwn_nic_lock(sc)) != 0) + if ((error = iwn_nic_lock(sc)) != 0){ + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end in error\n", __func__); return error; + } /* Clear TX scheduler state in SRAM. */ sc->sched_base = iwn_prph_read(sc, IWN_SCHED_SRAM_ADDR); @@ -6176,6 +6433,9 @@ iwn5000_post_alive(struct iwn_softc *sc) /* Send calibration results to runtime firmware. */ error = iwn5000_send_calibration(sc); } + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); + return error; } @@ -6299,6 +6559,8 @@ iwn5000_load_firmware_section(struct iwn_softc *sc, uint32_t dst, struct iwn_dma_info *dma = &sc->fw_dma; int error; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + /* Copy firmware section into pre-allocated DMA-safe memory. */ memcpy(dma->vaddr, section, size); bus_dmamap_sync(dma->tag, dma->map, BUS_DMASYNC_PREWRITE); @@ -6335,6 +6597,8 @@ iwn5000_load_firmware(struct iwn_softc *sc) struct iwn_fw_part *fw; int error; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + /* Load the initialization firmware on first boot only. */ fw = (sc->sc_flags & IWN_FLAG_CALIB_DONE) ? &sc->fw.main : &sc->fw.init; @@ -6517,6 +6781,8 @@ iwn_read_firmware(struct iwn_softc *sc) struct iwn_fw_info *fw = &sc->fw; int error; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + IWN_UNLOCK(sc); memset(fw, 0, sizeof (*fw)); @@ -6598,6 +6864,8 @@ iwn_apm_init(struct iwn_softc *sc) uint32_t reg; int error; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + /* Disable L0s exit timer (NMI bug workaround). */ IWN_SETBITS(sc, IWN_GIO_CHICKEN, IWN_GIO_CHICKEN_DIS_L0S_TIMER); /* Don't wait for ICH L0s (ICH bug workaround). */ @@ -6675,6 +6943,8 @@ iwn_apm_stop(struct iwn_softc *sc) static int iwn4965_nic_config(struct iwn_softc *sc) { + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + if (IWN_RFCFG_TYPE(sc->rfcfg) == 1) { /* * I don't believe this to be correct but this is what the @@ -6697,6 +6967,8 @@ iwn5000_nic_config(struct iwn_softc *sc) uint32_t tmp; int error; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + if (IWN_RFCFG_TYPE(sc->rfcfg) < 3) { IWN_SETBITS(sc, IWN_HW_IF_CONFIG, IWN_RFCFG_TYPE(sc->rfcfg) | @@ -6745,6 +7017,8 @@ iwn_hw_prepare(struct iwn_softc *sc) { int ntries; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + /* Check if hardware is ready. */ IWN_SETBITS(sc, IWN_HW_IF_CONFIG, IWN_HW_IF_CONFIG_NIC_READY); for (ntries = 0; ntries < 5; ntries++) { @@ -6782,6 +7056,8 @@ iwn_hw_init(struct iwn_softc *sc) struct iwn_ops *ops = &sc->ops; int error, chnl, qid; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + /* Clear pending interrupts. */ IWN_WRITE(sc, IWN_INT, 0xffffffff); @@ -6881,6 +7157,9 @@ iwn_hw_init(struct iwn_softc *sc) return error; } /* Do post-firmware initialization. */ + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); + return ops->post_alive(sc); } @@ -6889,6 +7168,8 @@ iwn_hw_stop(struct iwn_softc *sc) { int chnl, qid, ntries; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + IWN_WRITE(sc, IWN_RESET, IWN_RESET_NEVO); /* Disable interrupts. */ @@ -6942,6 +7223,8 @@ iwn_radio_on(void *arg0, int pending) struct ieee80211com *ic = ifp->if_l2com; struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + if (vap != NULL) { iwn_init(sc); ieee80211_init(vap); @@ -6956,6 +7239,8 @@ iwn_radio_off(void *arg0, int pending) struct ieee80211com *ic = ifp->if_l2com; struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + iwn_stop(sc); if (vap != NULL) ieee80211_stop(vap); @@ -6973,6 +7258,8 @@ iwn_init_locked(struct iwn_softc *sc) struct ifnet *ifp = sc->sc_ifp; int error; + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + IWN_LOCK_ASSERT(sc); if ((error = iwn_hw_prepare(sc)) != 0) { @@ -7026,9 +7313,13 @@ iwn_init_locked(struct iwn_softc *sc) ifp->if_drv_flags |= IFF_DRV_RUNNING; callout_reset(&sc->watchdog_to, hz, iwn_watchdog, sc); + + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); + return; fail: iwn_stop_locked(sc); + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end in error\n",__func__); } static void @@ -7114,6 +7405,8 @@ iwn_set_channel(struct ieee80211com *ic) struct iwn_softc *sc = ifp->if_softc; int error; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + IWN_LOCK(sc); sc->sc_rxtap.wr_chan_freq = htole16(c->ic_freq); sc->sc_rxtap.wr_chan_flags = htole16(c->ic_flags); @@ -7168,6 +7461,8 @@ iwn_hw_reset(void *arg0, int pending) struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; + DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); + iwn_stop(sc); iwn_init(sc); ieee80211_notify_radio(ic, 1); diff --git a/sys/dev/mii/brgphy.c b/sys/dev/mii/brgphy.c index be4276c45a4b..dd29b340d8e6 100644 --- a/sys/dev/mii/brgphy.c +++ b/sys/dev/mii/brgphy.c @@ -147,6 +147,7 @@ static const struct mii_phydesc brgphys[] = { MII_PHY_DESC(BROADCOM3, BCM5720C), MII_PHY_DESC(BROADCOM3, BCM57765), MII_PHY_DESC(BROADCOM3, BCM57780), + MII_PHY_DESC(BROADCOM4, BCM5725C), MII_PHY_DESC(xxBROADCOM_ALT1, BCM5906), MII_PHY_END }; @@ -932,6 +933,8 @@ brgphy_reset(struct mii_softc *sc) return; } break; + case MII_OUI_BROADCOM4: + return; } ifp = sc->mii_pdata->mii_ifp; diff --git a/sys/dev/mii/miidevs b/sys/dev/mii/miidevs index 422090665507..d2931f38a2ce 100644 --- a/sys/dev/mii/miidevs +++ b/sys/dev/mii/miidevs @@ -52,6 +52,7 @@ oui AMD 0x00001a Advanced Micro Devices oui BROADCOM 0x001018 Broadcom Corporation oui BROADCOM2 0x000af7 Broadcom Corporation oui BROADCOM3 0x001be9 Broadcom Corporation +oui BROADCOM4 0x18c086 Broadcom Corporation oui CICADA 0x0003f1 Cicada Semiconductor oui DAVICOM 0x00606e Davicom Semiconductor oui ENABLESEMI 0x0010dd Enable Semiconductor @@ -186,6 +187,7 @@ model BROADCOM3 BCM5717C 0x0020 BCM5717C 1000BASE-T media interface model BROADCOM3 BCM5719C 0x0022 BCM5719C 1000BASE-T media interface model BROADCOM3 BCM57765 0x0024 BCM57765 1000BASE-T media interface model BROADCOM3 BCM5720C 0x0036 BCM5720C 1000BASE-T media interface +model BROADCOM4 BCM5725C 0x0038 BCM5725C 1000BASE-T media interface model xxBROADCOM_ALT1 BCM5906 0x0004 BCM5906 10/100baseTX media interface /* Cicada Semiconductor PHYs (now owned by Vitesse?) */ diff --git a/sys/dev/mps/mps.c b/sys/dev/mps/mps.c index 1bb693fa43d6..b6c549aee243 100644 --- a/sys/dev/mps/mps.c +++ b/sys/dev/mps/mps.c @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include <sys/sysctl.h> #include <sys/queue.h> #include <sys/kthread.h> +#include <sys/taskqueue.h> #include <sys/endian.h> #include <sys/eventhandler.h> @@ -61,6 +62,7 @@ __FBSDID("$FreeBSD$"); #include <dev/pci/pcivar.h> +#include <cam/cam.h> #include <cam/scsi/scsi_all.h> #include <dev/mps/mpi/mpi2_type.h> @@ -73,13 +75,19 @@ __FBSDID("$FreeBSD$"); #include <dev/mps/mps_ioctl.h> #include <dev/mps/mpsvar.h> #include <dev/mps/mps_table.h> +#include <dev/mps/mps_sas.h> static int mps_diag_reset(struct mps_softc *sc, int sleep_flag); static int mps_init_queues(struct mps_softc *sc); static int mps_message_unit_reset(struct mps_softc *sc, int sleep_flag); static int mps_transition_operational(struct mps_softc *sc); +static int mps_iocfacts_allocate(struct mps_softc *sc, uint8_t attaching); +static void mps_iocfacts_free(struct mps_softc *sc); static void mps_startup(void *arg); static int mps_send_iocinit(struct mps_softc *sc); +static int mps_alloc_queues(struct mps_softc *sc); +static int mps_alloc_replies(struct mps_softc *sc); +static int mps_alloc_requests(struct mps_softc *sc); static int mps_attach_log(struct mps_softc *sc); static __inline void mps_complete_command(struct mps_softc *sc, struct mps_command *cm); @@ -89,6 +97,7 @@ static void mps_config_complete(struct mps_softc *sc, struct mps_command *cm); static void mps_periodic(void *); static int mps_reregister_events(struct mps_softc *sc); static void mps_enqueue_request(struct mps_softc *sc, struct mps_command *cm); +static int mps_get_iocfacts(struct mps_softc *sc, MPI2_IOC_FACTS_REPLY *facts); static int mps_wait_db_ack(struct mps_softc *sc, int timeout, int sleep_flag); SYSCTL_NODE(_hw, OID_AUTO, mps, CTLFLAG_RD, 0, "MPS Driver Parameters"); @@ -149,7 +158,8 @@ mps_diag_reset(struct mps_softc *sc,int sleep_flag) mpt2_reset_magic[i]); /* wait 100 msec */ if (mtx_owned(&sc->mps_mtx) && sleep_flag == CAN_SLEEP) - msleep(&sc->msleep_fake_chan, &sc->mps_mtx, 0, "mpsdiag", hz/10); + msleep(&sc->msleep_fake_chan, &sc->mps_mtx, 0, + "mpsdiag", hz/10); else if (sleep_flag == CAN_SLEEP) pause("mpsdiag", hz/10); else @@ -173,7 +183,8 @@ mps_diag_reset(struct mps_softc *sc,int sleep_flag) for (i = 0; i < 60000; i++) { /* wait 50 msec */ if (mtx_owned(&sc->mps_mtx) && sleep_flag == CAN_SLEEP) - msleep(&sc->msleep_fake_chan, &sc->mps_mtx, 0, "mpsdiag", hz/20); + msleep(&sc->msleep_fake_chan, &sc->mps_mtx, 0, + "mpsdiag", hz/20); else if (sleep_flag == CAN_SLEEP) pause("mpsdiag", hz/20); else @@ -303,9 +314,357 @@ mps_transition_operational(struct mps_softc *sc) return (error); } +/* + * This is called during attach and when re-initializing due to a Diag Reset. + * IOC Facts is used to allocate many of the structures needed by the driver. + * If called from attach, de-allocation is not required because the driver has + * not allocated any structures yet, but if called from a Diag Reset, previously + * allocated structures based on IOC Facts will need to be freed and re- + * allocated bases on the latest IOC Facts. + */ +static int +mps_iocfacts_allocate(struct mps_softc *sc, uint8_t attaching) +{ + int error, i; + Mpi2IOCFactsReply_t saved_facts; + uint8_t saved_mode, reallocating; + struct mpssas_lun *lun, *lun_tmp; + struct mpssas_target *targ; + + mps_dprint(sc, MPS_TRACE, "%s\n", __func__); + + /* Save old IOC Facts and then only reallocate if Facts have changed */ + if (!attaching) { + bcopy(sc->facts, &saved_facts, sizeof(MPI2_IOC_FACTS_REPLY)); + } + + /* + * Get IOC Facts. In all cases throughout this function, panic if doing + * a re-initialization and only return the error if attaching so the OS + * can handle it. + */ + if ((error = mps_get_iocfacts(sc, sc->facts)) != 0) { + if (attaching) { + mps_dprint(sc, MPS_FAULT, "%s failed to get IOC Facts " + "with error %d\n", __func__, error); + return (error); + } else { + panic("%s failed to get IOC Facts with error %d\n", + __func__, error); + } + } + + mps_print_iocfacts(sc, sc->facts); + + snprintf(sc->fw_version, sizeof(sc->fw_version), + "%02d.%02d.%02d.%02d", + sc->facts->FWVersion.Struct.Major, + sc->facts->FWVersion.Struct.Minor, + sc->facts->FWVersion.Struct.Unit, + sc->facts->FWVersion.Struct.Dev); + + mps_printf(sc, "Firmware: %s, Driver: %s\n", sc->fw_version, + MPS_DRIVER_VERSION); + mps_printf(sc, "IOCCapabilities: %b\n", sc->facts->IOCCapabilities, + "\20" "\3ScsiTaskFull" "\4DiagTrace" "\5SnapBuf" "\6ExtBuf" + "\7EEDP" "\10BiDirTarg" "\11Multicast" "\14TransRetry" "\15IR" + "\16EventReplay" "\17RaidAccel" "\20MSIXIndex" "\21HostDisc"); + + /* + * If the chip doesn't support event replay then a hard reset will be + * required to trigger a full discovery. Do the reset here then + * retransition to Ready. A hard reset might have already been done, + * but it doesn't hurt to do it again. Only do this if attaching, not + * for a Diag Reset. + */ + if (attaching) { + if ((sc->facts->IOCCapabilities & + MPI2_IOCFACTS_CAPABILITY_EVENT_REPLAY) == 0) { + mps_diag_reset(sc, NO_SLEEP); + if ((error = mps_transition_ready(sc)) != 0) { + mps_dprint(sc, MPS_FAULT, "%s failed to " + "transition to ready with error %d\n", + __func__, error); + return (error); + } + } + } + + /* + * Set flag if IR Firmware is loaded. If the RAID Capability has + * changed from the previous IOC Facts, log a warning, but only if + * checking this after a Diag Reset and not during attach. + */ + saved_mode = sc->ir_firmware; + if (sc->facts->IOCCapabilities & + MPI2_IOCFACTS_CAPABILITY_INTEGRATED_RAID) + sc->ir_firmware = 1; + if (!attaching) { + if (sc->ir_firmware != saved_mode) { + mps_dprint(sc, MPS_FAULT, "%s new IR/IT mode in IOC " + "Facts does not match previous mode\n", __func__); + } + } + + /* Only deallocate and reallocate if relevant IOC Facts have changed */ + reallocating = FALSE; + if ((!attaching) && + ((saved_facts.MsgVersion != sc->facts->MsgVersion) || + (saved_facts.HeaderVersion != sc->facts->HeaderVersion) || + (saved_facts.MaxChainDepth != sc->facts->MaxChainDepth) || + (saved_facts.RequestCredit != sc->facts->RequestCredit) || + (saved_facts.ProductID != sc->facts->ProductID) || + (saved_facts.IOCCapabilities != sc->facts->IOCCapabilities) || + (saved_facts.IOCRequestFrameSize != + sc->facts->IOCRequestFrameSize) || + (saved_facts.MaxTargets != sc->facts->MaxTargets) || + (saved_facts.MaxSasExpanders != sc->facts->MaxSasExpanders) || + (saved_facts.MaxEnclosures != sc->facts->MaxEnclosures) || + (saved_facts.HighPriorityCredit != sc->facts->HighPriorityCredit) || + (saved_facts.MaxReplyDescriptorPostQueueDepth != + sc->facts->MaxReplyDescriptorPostQueueDepth) || + (saved_facts.ReplyFrameSize != sc->facts->ReplyFrameSize) || + (saved_facts.MaxVolumes != sc->facts->MaxVolumes) || + (saved_facts.MaxPersistentEntries != + sc->facts->MaxPersistentEntries))) { + reallocating = TRUE; + } + + /* + * Some things should be done if attaching or re-allocating after a Diag + * Reset, but are not needed after a Diag Reset if the FW has not + * changed. + */ + if (attaching || reallocating) { + /* + * Check if controller supports FW diag buffers and set flag to + * enable each type. + */ + if (sc->facts->IOCCapabilities & + MPI2_IOCFACTS_CAPABILITY_DIAG_TRACE_BUFFER) + sc->fw_diag_buffer_list[MPI2_DIAG_BUF_TYPE_TRACE]. + enabled = TRUE; + if (sc->facts->IOCCapabilities & + MPI2_IOCFACTS_CAPABILITY_SNAPSHOT_BUFFER) + sc->fw_diag_buffer_list[MPI2_DIAG_BUF_TYPE_SNAPSHOT]. + enabled = TRUE; + if (sc->facts->IOCCapabilities & + MPI2_IOCFACTS_CAPABILITY_EXTENDED_BUFFER) + sc->fw_diag_buffer_list[MPI2_DIAG_BUF_TYPE_EXTENDED]. + enabled = TRUE; + + /* + * Set flag if EEDP is supported and if TLR is supported. + */ + if (sc->facts->IOCCapabilities & MPI2_IOCFACTS_CAPABILITY_EEDP) + sc->eedp_enabled = TRUE; + if (sc->facts->IOCCapabilities & MPI2_IOCFACTS_CAPABILITY_TLR) + sc->control_TLR = TRUE; + + /* + * Size the queues. Since the reply queues always need one free + * entry, we'll just deduct one reply message here. + */ + sc->num_reqs = MIN(MPS_REQ_FRAMES, sc->facts->RequestCredit); + sc->num_replies = MIN(MPS_REPLY_FRAMES + MPS_EVT_REPLY_FRAMES, + sc->facts->MaxReplyDescriptorPostQueueDepth) - 1; + + /* + * Initialize all Tail Queues + */ + TAILQ_INIT(&sc->req_list); + TAILQ_INIT(&sc->high_priority_req_list); + TAILQ_INIT(&sc->chain_list); + TAILQ_INIT(&sc->tm_list); + } + + /* + * If doing a Diag Reset and the FW is significantly different + * (reallocating will be set above in IOC Facts comparison), then all + * buffers based on the IOC Facts will need to be freed before they are + * reallocated. + */ + if (reallocating) { + mps_iocfacts_free(sc); + + /* + * The number of targets is based on IOC Facts, so free all of + * the allocated LUNs for each target and then the target buffer + * itself. + */ + for (i=0; i< saved_facts.MaxTargets; i++) { + targ = &sc->sassc->targets[i]; + SLIST_FOREACH_SAFE(lun, &targ->luns, lun_link, + lun_tmp) { + free(lun, M_MPT2); + } + } + free(sc->sassc->targets, M_MPT2); + + sc->sassc->targets = malloc(sizeof(struct mpssas_target) * + sc->facts->MaxTargets, M_MPT2, M_WAITOK|M_ZERO); + if (!sc->sassc->targets) { + panic("%s failed to alloc targets with error %d\n", + __func__, ENOMEM); + } + } + + /* + * Any deallocation has been completed. Now start reallocating + * if needed. Will only need to reallocate if attaching or if the new + * IOC Facts are different from the previous IOC Facts after a Diag + * Reset. Targets have already been allocated above if needed. + */ + if (attaching || reallocating) { + if (((error = mps_alloc_queues(sc)) != 0) || + ((error = mps_alloc_replies(sc)) != 0) || + ((error = mps_alloc_requests(sc)) != 0)) { + if (attaching ) { + mps_dprint(sc, MPS_FAULT, "%s failed to alloc " + "queues with error %d\n", __func__, error); + mps_free(sc); + return (error); + } else { + panic("%s failed to alloc queues with error " + "%d\n", __func__, error); + } + } + } + + /* Always initialize the queues */ + bzero(sc->free_queue, sc->fqdepth * 4); + mps_init_queues(sc); + + /* + * Always get the chip out of the reset state, but only panic if not + * attaching. If attaching and there is an error, that is handled by + * the OS. + */ + error = mps_transition_operational(sc); + if (error != 0) { + if (attaching) { + mps_printf(sc, "%s failed to transition to operational " + "with error %d\n", __func__, error); + mps_free(sc); + return (error); + } else { + panic("%s failed to transition to operational with " + "error %d\n", __func__, error); + } + } + + /* + * Finish the queue initialization. + * These are set here instead of in mps_init_queues() because the + * IOC resets these values during the state transition in + * mps_transition_operational(). The free index is set to 1 + * because the corresponding index in the IOC is set to 0, and the + * IOC treats the queues as full if both are set to the same value. + * Hence the reason that the queue can't hold all of the possible + * replies. + */ + sc->replypostindex = 0; + mps_regwrite(sc, MPI2_REPLY_FREE_HOST_INDEX_OFFSET, sc->replyfreeindex); + mps_regwrite(sc, MPI2_REPLY_POST_HOST_INDEX_OFFSET, 0); + + /* + * Attach the subsystems so they can prepare their event masks. + */ + /* XXX Should be dynamic so that IM/IR and user modules can attach */ + if (attaching) { + if (((error = mps_attach_log(sc)) != 0) || + ((error = mps_attach_sas(sc)) != 0) || + ((error = mps_attach_user(sc)) != 0)) { + mps_printf(sc, "%s failed to attach all subsystems: " + "error %d\n", __func__, error); + mps_free(sc); + return (error); + } + + if ((error = mps_pci_setup_interrupts(sc)) != 0) { + mps_printf(sc, "%s failed to setup interrupts\n", + __func__); + mps_free(sc); + return (error); + } + } + + /* + * Set flag if this is a WD controller. This shouldn't ever change, but + * reset it after a Diag Reset, just in case. + */ + sc->WD_available = FALSE; + if (pci_get_device(sc->mps_dev) == MPI2_MFGPAGE_DEVID_SSS6200) + sc->WD_available = TRUE; + + return (error); +} + +/* + * This is called if memory is being free (during detach for example) and when + * buffers need to be reallocated due to a Diag Reset. + */ +static void +mps_iocfacts_free(struct mps_softc *sc) +{ + struct mps_command *cm; + int i; + + mps_dprint(sc, MPS_TRACE, "%s\n", __func__); + + if (sc->post_busaddr != 0) + bus_dmamap_unload(sc->queues_dmat, sc->queues_map); + if (sc->post_queue != NULL) + bus_dmamem_free(sc->queues_dmat, sc->post_queue, + sc->queues_map); + if (sc->queues_dmat != NULL) + bus_dma_tag_destroy(sc->queues_dmat); + + if (sc->chain_busaddr != 0) + bus_dmamap_unload(sc->chain_dmat, sc->chain_map); + if (sc->chain_frames != NULL) + bus_dmamem_free(sc->chain_dmat, sc->chain_frames, + sc->chain_map); + if (sc->chain_dmat != NULL) + bus_dma_tag_destroy(sc->chain_dmat); + + if (sc->sense_busaddr != 0) + bus_dmamap_unload(sc->sense_dmat, sc->sense_map); + if (sc->sense_frames != NULL) + bus_dmamem_free(sc->sense_dmat, sc->sense_frames, + sc->sense_map); + if (sc->sense_dmat != NULL) + bus_dma_tag_destroy(sc->sense_dmat); + + if (sc->reply_busaddr != 0) + bus_dmamap_unload(sc->reply_dmat, sc->reply_map); + if (sc->reply_frames != NULL) + bus_dmamem_free(sc->reply_dmat, sc->reply_frames, + sc->reply_map); + if (sc->reply_dmat != NULL) + bus_dma_tag_destroy(sc->reply_dmat); + + if (sc->req_busaddr != 0) + bus_dmamap_unload(sc->req_dmat, sc->req_map); + if (sc->req_frames != NULL) + bus_dmamem_free(sc->req_dmat, sc->req_frames, sc->req_map); + if (sc->req_dmat != NULL) + bus_dma_tag_destroy(sc->req_dmat); + + if (sc->chains != NULL) + free(sc->chains, M_MPT2); + if (sc->commands != NULL) { + for (i = 1; i < sc->num_reqs; i++) { + cm = &sc->commands[i]; + bus_dmamap_destroy(sc->buffer_dmat, cm->cm_dmamap); + } + free(sc->commands, M_MPT2); + } + if (sc->buffer_dmat != NULL) + bus_dma_tag_destroy(sc->buffer_dmat); +} + /* - * XXX Some of this should probably move to mps.c - * * The terms diag reset and hard reset are used interchangeably in the MPI * docs to mean resetting the controller chip. In this code diag reset * cleans everything up, and the hard reset function just sends the reset @@ -317,7 +676,6 @@ int mps_reinit(struct mps_softc *sc) { int error; - uint32_t db; MPS_FUNCTRACE(sc); @@ -335,6 +693,9 @@ mps_reinit(struct mps_softc *sc) */ sc->mps_flags |= MPS_FLAGS_DIAGRESET; + /* + * Mask interrupts here. + */ mps_dprint(sc, MPS_INIT, "%s mask interrupts\n", __func__); mps_mask_intr(sc); @@ -351,39 +712,42 @@ mps_reinit(struct mps_softc *sc) /* Give the I/O subsystem special priority to get itself prepared */ mpssas_handle_reinit(sc); - /* reinitialize queues after the reset */ - bzero(sc->free_queue, sc->fqdepth * 4); - mps_init_queues(sc); - - /* get the chip out of the reset state */ - error = mps_transition_operational(sc); - if (error != 0) - /* XXXSL No need to panic here */ - panic("%s transition operational failed with error %d\n", + /* + * Get IOC Facts and allocate all structures based on this information. + * The attach function will also call mps_iocfacts_allocate at startup. + * If relevant values have changed in IOC Facts, this function will free + * all of the memory based on IOC Facts and reallocate that memory. + */ + if ((error = mps_iocfacts_allocate(sc, FALSE)) != 0) { + panic("%s IOC Facts based allocation failed with error %d\n", __func__, error); + } - /* Reinitialize the reply queue. This is delicate because this - * function is typically invoked by task mgmt completion callbacks, - * which are called by the interrupt thread. We need to make sure - * the interrupt handler loop will exit when we return to it, and - * that it will recognize the indexes we've changed. + /* + * Mapping structures will be re-allocated after getting IOC Page8, so + * free these structures here. */ - sc->replypostindex = 0; - mps_regwrite(sc, MPI2_REPLY_FREE_HOST_INDEX_OFFSET, sc->replyfreeindex); - mps_regwrite(sc, MPI2_REPLY_POST_HOST_INDEX_OFFSET, sc->replypostindex); - - db = mps_regread(sc, MPI2_DOORBELL_OFFSET); - mps_dprint(sc, MPS_INIT, "%s doorbell 0x%08x\n", __func__, db); - - mps_dprint(sc, MPS_INIT, "%s unmask interrupts post %u free %u\n", - __func__, sc->replypostindex, sc->replyfreeindex); + mps_mapping_exit(sc); + /* + * The static page function currently read is IOC Page8. Others can be + * added in future. It's possible that the values in IOC Page8 have + * changed after a Diag Reset due to user modification, so always read + * these. Interrupts are masked, so unmask them before getting config + * pages. + */ mps_unmask_intr(sc); + sc->mps_flags &= ~MPS_FLAGS_DIAGRESET; + mps_base_static_config_pages(sc); - mps_dprint(sc, MPS_INIT, "%s restarting post %u free %u\n", __func__, - sc->replypostindex, sc->replyfreeindex); + /* + * Some mapping info is based in IOC Page8 data, so re-initialize the + * mapping tables. + */ + mps_mapping_initialize(sc); - /* restart will reload the event masks clobbered by the reset, and + /* + * Restart will reload the event masks clobbered by the reset, and * then enable the port. */ mps_reregister_events(sc); @@ -392,8 +756,6 @@ mps_reinit(struct mps_softc *sc) mps_dprint(sc, MPS_INFO, "%s finished sc %p post %u free %u\n", __func__, sc, sc->replypostindex, sc->replyfreeindex); - sc->mps_flags &= ~MPS_FLAGS_DIAGRESET; - return 0; } @@ -639,48 +1001,13 @@ mps_get_iocfacts(struct mps_softc *sc, MPI2_IOC_FACTS_REPLY *facts) } static int -mps_get_portfacts(struct mps_softc *sc, MPI2_PORT_FACTS_REPLY *facts, int port) -{ - MPI2_PORT_FACTS_REQUEST *request; - MPI2_PORT_FACTS_REPLY *reply; - struct mps_command *cm; - int error; - - MPS_FUNCTRACE(sc); - - if ((cm = mps_alloc_command(sc)) == NULL) - return (EBUSY); - request = (MPI2_PORT_FACTS_REQUEST *)cm->cm_req; - request->Function = MPI2_FUNCTION_PORT_FACTS; - request->PortNumber = port; - cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; - cm->cm_data = NULL; - error = mps_request_polled(sc, cm); - reply = (MPI2_PORT_FACTS_REPLY *)cm->cm_reply; - if (reply == NULL) { - mps_printf(sc, "%s NULL reply\n", __func__); - goto done; - } - if ((reply->IOCStatus & MPI2_IOCSTATUS_MASK) != MPI2_IOCSTATUS_SUCCESS) { - mps_printf(sc, - "%s error %d iocstatus 0x%x iocloginfo 0x%x type 0x%x\n", - __func__, error, reply->IOCStatus, reply->IOCLogInfo, - reply->PortType); - error = ENXIO; - } - bcopy(reply, facts, sizeof(MPI2_PORT_FACTS_REPLY)); -done: - mps_free_command(sc, cm); - - return (error); -} - -static int mps_send_iocinit(struct mps_softc *sc) { MPI2_IOC_INIT_REQUEST init; MPI2_DEFAULT_REPLY reply; int req_sz, reply_sz, error; + struct timeval now; + uint64_t time_in_msec; MPS_FUNCTRACE(sc); @@ -709,8 +1036,10 @@ mps_send_iocinit(struct mps_softc *sc) init.ReplyDescriptorPostQueueAddress.Low = htole32((uint32_t)sc->post_busaddr); init.ReplyFreeQueueAddress.High = 0; init.ReplyFreeQueueAddress.Low = htole32((uint32_t)sc->free_busaddr); - init.TimeStamp.High = 0; - init.TimeStamp.Low = htole32((uint32_t)time_uptime); + getmicrotime(&now); + time_in_msec = (now.tv_sec * 1000 + now.tv_usec/1000); + init.TimeStamp.High = htole32((time_in_msec >> 32) & 0xFFFFFFFF); + init.TimeStamp.Low = htole32(time_in_msec & 0xFFFFFFFF); error = mps_request_sync(sc, &init, &reply, req_sz, reply_sz, 5); if ((reply.IOCStatus & MPI2_IOCSTATUS_MASK) != MPI2_IOCSTATUS_SUCCESS) @@ -1124,7 +1453,7 @@ mps_setup_sysctl(struct mps_softc *sc) int mps_attach(struct mps_softc *sc) { - int i, error; + int error; mps_get_tunables(sc); @@ -1146,151 +1475,20 @@ mps_attach(struct mps_softc *sc) __func__, __LINE__); return (ENOMEM); } - if ((error = mps_get_iocfacts(sc, sc->facts)) != 0) - return (error); - - mps_print_iocfacts(sc, sc->facts); - - snprintf(sc->fw_version, sizeof(sc->fw_version), - "%02d.%02d.%02d.%02d", - sc->facts->FWVersion.Struct.Major, - sc->facts->FWVersion.Struct.Minor, - sc->facts->FWVersion.Struct.Unit, - sc->facts->FWVersion.Struct.Dev); - - mps_printf(sc, "Firmware: %s, Driver: %s\n", sc->fw_version, - MPS_DRIVER_VERSION); - mps_printf(sc, "IOCCapabilities: %b\n", sc->facts->IOCCapabilities, - "\20" "\3ScsiTaskFull" "\4DiagTrace" "\5SnapBuf" "\6ExtBuf" - "\7EEDP" "\10BiDirTarg" "\11Multicast" "\14TransRetry" "\15IR" - "\16EventReplay" "\17RaidAccel" "\20MSIXIndex" "\21HostDisc"); - - /* - * If the chip doesn't support event replay then a hard reset will be - * required to trigger a full discovery. Do the reset here then - * retransition to Ready. A hard reset might have already been done, - * but it doesn't hurt to do it again. - */ - if ((sc->facts->IOCCapabilities & - MPI2_IOCFACTS_CAPABILITY_EVENT_REPLAY) == 0) { - mps_diag_reset(sc, NO_SLEEP); - if ((error = mps_transition_ready(sc)) != 0) - return (error); - } - - /* - * Set flag if IR Firmware is loaded. - */ - if (sc->facts->IOCCapabilities & - MPI2_IOCFACTS_CAPABILITY_INTEGRATED_RAID) - sc->ir_firmware = 1; - - /* - * Check if controller supports FW diag buffers and set flag to enable - * each type. - */ - if (sc->facts->IOCCapabilities & - MPI2_IOCFACTS_CAPABILITY_DIAG_TRACE_BUFFER) - sc->fw_diag_buffer_list[MPI2_DIAG_BUF_TYPE_TRACE].enabled = - TRUE; - if (sc->facts->IOCCapabilities & - MPI2_IOCFACTS_CAPABILITY_SNAPSHOT_BUFFER) - sc->fw_diag_buffer_list[MPI2_DIAG_BUF_TYPE_SNAPSHOT].enabled = - TRUE; - if (sc->facts->IOCCapabilities & - MPI2_IOCFACTS_CAPABILITY_EXTENDED_BUFFER) - sc->fw_diag_buffer_list[MPI2_DIAG_BUF_TYPE_EXTENDED].enabled = - TRUE; - - /* - * Set flag if EEDP is supported and if TLR is supported. - */ - if (sc->facts->IOCCapabilities & MPI2_IOCFACTS_CAPABILITY_EEDP) - sc->eedp_enabled = TRUE; - if (sc->facts->IOCCapabilities & MPI2_IOCFACTS_CAPABILITY_TLR) - sc->control_TLR = TRUE; /* - * Size the queues. Since the reply queues always need one free entry, - * we'll just deduct one reply message here. + * Get IOC Facts and allocate all structures based on this information. + * A Diag Reset will also call mps_iocfacts_allocate and re-read the IOC + * Facts. If relevant values have changed in IOC Facts, this function + * will free all of the memory based on IOC Facts and reallocate that + * memory. If this fails, any allocated memory should already be freed. */ - sc->num_reqs = MIN(MPS_REQ_FRAMES, sc->facts->RequestCredit); - sc->num_replies = MIN(MPS_REPLY_FRAMES + MPS_EVT_REPLY_FRAMES, - sc->facts->MaxReplyDescriptorPostQueueDepth) - 1; - TAILQ_INIT(&sc->req_list); - TAILQ_INIT(&sc->high_priority_req_list); - TAILQ_INIT(&sc->chain_list); - TAILQ_INIT(&sc->tm_list); - - if (((error = mps_alloc_queues(sc)) != 0) || - ((error = mps_alloc_replies(sc)) != 0) || - ((error = mps_alloc_requests(sc)) != 0)) { - mps_printf(sc, "%s failed to alloc\n", __func__); - mps_free(sc); - return (error); - } - - if (((error = mps_init_queues(sc)) != 0) || - ((error = mps_transition_operational(sc)) != 0)) { - mps_printf(sc, "%s failed to transition operational\n", __func__); - mps_free(sc); + if ((error = mps_iocfacts_allocate(sc, TRUE)) != 0) { + mps_dprint(sc, MPS_FAULT, "%s IOC Facts based allocation " + "failed with error %d\n", __func__, error); return (error); } - /* - * Finish the queue initialization. - * These are set here instead of in mps_init_queues() because the - * IOC resets these values during the state transition in - * mps_transition_operational(). The free index is set to 1 - * because the corresponding index in the IOC is set to 0, and the - * IOC treats the queues as full if both are set to the same value. - * Hence the reason that the queue can't hold all of the possible - * replies. - */ - sc->replypostindex = 0; - mps_regwrite(sc, MPI2_REPLY_FREE_HOST_INDEX_OFFSET, sc->replyfreeindex); - mps_regwrite(sc, MPI2_REPLY_POST_HOST_INDEX_OFFSET, 0); - - sc->pfacts = malloc(sizeof(MPI2_PORT_FACTS_REPLY) * - sc->facts->NumberOfPorts, M_MPT2, M_ZERO|M_WAITOK); - if(!sc->pfacts) { - device_printf(sc->mps_dev, "Cannot allocate memory %s %d\n", - __func__, __LINE__); - return (ENOMEM); - } - for (i = 0; i < sc->facts->NumberOfPorts; i++) { - if ((error = mps_get_portfacts(sc, &sc->pfacts[i], i)) != 0) { - mps_printf(sc, "%s failed to get portfacts for port %d\n", - __func__, i); - mps_free(sc); - return (error); - } - mps_print_portfacts(sc, &sc->pfacts[i]); - } - - /* Attach the subsystems so they can prepare their event masks. */ - /* XXX Should be dynamic so that IM/IR and user modules can attach */ - if (((error = mps_attach_log(sc)) != 0) || - ((error = mps_attach_sas(sc)) != 0) || - ((error = mps_attach_user(sc)) != 0)) { - mps_printf(sc, "%s failed to attach all subsystems: error %d\n", - __func__, error); - mps_free(sc); - return (error); - } - - if ((error = mps_pci_setup_interrupts(sc)) != 0) { - mps_printf(sc, "%s failed to setup interrupts\n", __func__); - mps_free(sc); - return (error); - } - - /* - * The static page function currently read is ioc page8. Others can be - * added in future. - */ - mps_base_static_config_pages(sc); - /* Start the periodic watchdog check on the IOC Doorbell */ mps_periodic(sc); @@ -1333,7 +1531,9 @@ mps_startup(void *arg) mps_lock(sc); mps_unmask_intr(sc); + /* initialize device mapping tables */ + mps_base_static_config_pages(sc); mps_mapping_initialize(sc); mpssas_startup(sc); mps_unlock(sc); @@ -1416,8 +1616,7 @@ mps_detach_log(struct mps_softc *sc) int mps_free(struct mps_softc *sc) { - struct mps_command *cm; - int i, error; + int error; /* Turn off the watchdog */ mps_lock(sc); @@ -1443,62 +1642,15 @@ mps_free(struct mps_softc *sc) if (sc->facts != NULL) free(sc->facts, M_MPT2); - if (sc->pfacts != NULL) - free(sc->pfacts, M_MPT2); - - if (sc->post_busaddr != 0) - bus_dmamap_unload(sc->queues_dmat, sc->queues_map); - if (sc->post_queue != NULL) - bus_dmamem_free(sc->queues_dmat, sc->post_queue, - sc->queues_map); - if (sc->queues_dmat != NULL) - bus_dma_tag_destroy(sc->queues_dmat); - - if (sc->chain_busaddr != 0) - bus_dmamap_unload(sc->chain_dmat, sc->chain_map); - if (sc->chain_frames != NULL) - bus_dmamem_free(sc->chain_dmat, sc->chain_frames,sc->chain_map); - if (sc->chain_dmat != NULL) - bus_dma_tag_destroy(sc->chain_dmat); - - if (sc->sense_busaddr != 0) - bus_dmamap_unload(sc->sense_dmat, sc->sense_map); - if (sc->sense_frames != NULL) - bus_dmamem_free(sc->sense_dmat, sc->sense_frames,sc->sense_map); - if (sc->sense_dmat != NULL) - bus_dma_tag_destroy(sc->sense_dmat); - - if (sc->reply_busaddr != 0) - bus_dmamap_unload(sc->reply_dmat, sc->reply_map); - if (sc->reply_frames != NULL) - bus_dmamem_free(sc->reply_dmat, sc->reply_frames,sc->reply_map); - if (sc->reply_dmat != NULL) - bus_dma_tag_destroy(sc->reply_dmat); - - if (sc->req_busaddr != 0) - bus_dmamap_unload(sc->req_dmat, sc->req_map); - if (sc->req_frames != NULL) - bus_dmamem_free(sc->req_dmat, sc->req_frames, sc->req_map); - if (sc->req_dmat != NULL) - bus_dma_tag_destroy(sc->req_dmat); - - if (sc->chains != NULL) - free(sc->chains, M_MPT2); - if (sc->commands != NULL) { - for (i = 1; i < sc->num_reqs; i++) { - cm = &sc->commands[i]; - bus_dmamap_destroy(sc->buffer_dmat, cm->cm_dmamap); - } - free(sc->commands, M_MPT2); - } - if (sc->buffer_dmat != NULL) - bus_dma_tag_destroy(sc->buffer_dmat); + /* + * Free all buffers that are based on IOC Facts. A Diag Reset may need + * to free these buffers too. + */ + mps_iocfacts_free(sc); if (sc->sysctl_tree != NULL) sysctl_ctx_free(&sc->sysctl_ctx); - mps_mapping_free_memory(sc); - /* Deregister the shutdown function */ if (sc->shutdown_eh != NULL) EVENTHANDLER_DEREGISTER(shutdown_final, sc->shutdown_eh); @@ -1925,7 +2077,7 @@ mps_reregister_events(struct mps_softc *sc) /* first, reregister events */ - for (i = 0; i < MPI2_EVENT_NOTIFY_EVENTMASK_WORDS; i++) + for (i = 0; i < MPI2_EVENT_NOTIFY_EVENTMASK_WORDS; i++) sc->event_mask[i] = -1; TAILQ_FOREACH(eh, &sc->event_list, eh_list) { @@ -1957,7 +2109,8 @@ mps_reregister_events(struct mps_softc *sc) error = mps_map_command(sc, cm); - mps_dprint(sc, MPS_TRACE, "%s finished with error %d\n", __func__, error); + mps_dprint(sc, MPS_TRACE, "%s finished with error %d\n", __func__, + error); return (error); } @@ -2313,26 +2466,50 @@ mps_map_command(struct mps_softc *sc, struct mps_command *cm) * be executed and enqueued automatically. Other errors come from msleep(). */ int -mps_wait_command(struct mps_softc *sc, struct mps_command *cm, int timeout) +mps_wait_command(struct mps_softc *sc, struct mps_command *cm, int timeout, + int sleep_flag) { int error, rc; + struct timeval cur_time, start_time; - mtx_assert(&sc->mps_mtx, MA_OWNED); - - if(sc->mps_flags & MPS_FLAGS_DIAGRESET) + if (sc->mps_flags & MPS_FLAGS_DIAGRESET) return EBUSY; cm->cm_complete = NULL; - cm->cm_flags |= MPS_CM_FLAGS_WAKEUP; + cm->cm_flags |= (MPS_CM_FLAGS_WAKEUP + MPS_CM_FLAGS_POLLED); error = mps_map_command(sc, cm); if ((error != 0) && (error != EINPROGRESS)) return (error); - error = msleep(cm, &sc->mps_mtx, 0, "mpswait", timeout*hz); + + // Check for context and wait for 50 mSec at a time until time has + // expired or the command has finished. If msleep can't be used, need + // to poll. + if (curthread->td_no_sleeping != 0) + sleep_flag = NO_SLEEP; + getmicrotime(&start_time); + if (mtx_owned(&sc->mps_mtx) && sleep_flag == CAN_SLEEP) { + error = msleep(cm, &sc->mps_mtx, 0, "mpswait", timeout*hz); + } else { + while ((cm->cm_flags & MPS_CM_FLAGS_COMPLETE) == 0) { + mps_intr_locked(sc); + if (sleep_flag == CAN_SLEEP) + pause("mpswait", hz/20); + else + DELAY(50000); + + getmicrotime(&cur_time); + if ((cur_time.tv_sec - start_time.tv_sec) > timeout) { + error = EWOULDBLOCK; + break; + } + } + } + if (error == EWOULDBLOCK) { mps_dprint(sc, MPS_FAULT, "Calling Reinit from %s\n", __func__); rc = mps_reinit(sc); - mps_dprint(sc, MPS_FAULT, "Reinit %s\n", - (rc == 0) ? "success" : "failed"); + mps_dprint(sc, MPS_FAULT, "Reinit %s\n", (rc == 0) ? "success" : + "failed"); error = ETIMEDOUT; } return (error); @@ -2432,7 +2609,7 @@ mps_read_config_page(struct mps_softc *sc, struct mps_config_params *params) cm->cm_complete = mps_config_complete; return (mps_map_command(sc, cm)); } else { - error = mps_wait_command(sc, cm, 0); + error = mps_wait_command(sc, cm, 0, CAN_SLEEP); if (error) { mps_dprint(sc, MPS_FAULT, "Error %d reading config page\n", error); diff --git a/sys/dev/mps/mps_config.c b/sys/dev/mps/mps_config.c index 939872e8faa5..d6e2a8c719ba 100644 --- a/sys/dev/mps/mps_config.c +++ b/sys/dev/mps/mps_config.c @@ -93,12 +93,15 @@ mps_config_get_ioc_pg8(struct mps_softc *sc, Mpi2ConfigReply_t *mpi_reply, request->Header.PageVersion = MPI2_IOCPAGE8_PAGEVERSION; cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; cm->cm_data = NULL; - error = mps_request_polled(sc, cm); + error = mps_wait_command(sc, cm, 60, CAN_SLEEP); reply = (MPI2_CONFIG_REPLY *)cm->cm_reply; if (error || (reply == NULL)) { /* FIXME */ - /* If the poll returns error then we need to do diag reset */ - printf("%s: poll for header completed with error %d", + /* + * If the request returns an error then we need to do a diag + * reset + */ + printf("%s: request for header completed with error %d", __func__, error); error = ENXIO; goto out; @@ -107,7 +110,10 @@ mps_config_get_ioc_pg8(struct mps_softc *sc, Mpi2ConfigReply_t *mpi_reply, bcopy(reply, mpi_reply, sizeof(MPI2_CONFIG_REPLY)); if (ioc_status != MPI2_IOCSTATUS_SUCCESS) { /* FIXME */ - /* If the poll returns error then we need to do diag reset */ + /* + * If the request returns an error then we need to do a diag + * reset + */ printf("%s: header read with error; iocstatus = 0x%x\n", __func__, ioc_status); error = ENXIO; @@ -144,12 +150,16 @@ mps_config_get_ioc_pg8(struct mps_softc *sc, Mpi2ConfigReply_t *mpi_reply, goto out; } cm->cm_data = page; - error = mps_request_polled(sc, cm); + + error = mps_wait_command(sc, cm, 60, CAN_SLEEP); reply = (MPI2_CONFIG_REPLY *)cm->cm_reply; if (error || (reply == NULL)) { /* FIXME */ - /* If the poll returns error then we need to do diag reset */ - printf("%s: poll for page completed with error %d", + /* + * If the request returns an error then we need to do a diag + * reset + */ + printf("%s: request for page completed with error %d", __func__, error); error = ENXIO; goto out; @@ -158,7 +168,10 @@ mps_config_get_ioc_pg8(struct mps_softc *sc, Mpi2ConfigReply_t *mpi_reply, bcopy(reply, mpi_reply, sizeof(MPI2_CONFIG_REPLY)); if (ioc_status != MPI2_IOCSTATUS_SUCCESS) { /* FIXME */ - /* If the poll returns error then we need to do diag reset */ + /* + * If the request returns an error then we need to do a diag + * reset + */ printf("%s: page read with error; iocstatus = 0x%x\n", __func__, ioc_status); error = ENXIO; @@ -211,6 +224,11 @@ mps_config_get_man_pg10(struct mps_softc *sc, Mpi2ConfigReply_t *mpi_reply) request->Header.PageVersion = MPI2_MANUFACTURING10_PAGEVERSION; cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; cm->cm_data = NULL; + + /* + * This page must be polled because the IOC isn't ready yet when this + * page is needed. + */ error = mps_request_polled(sc, cm); reply = (MPI2_CONFIG_REPLY *)cm->cm_reply; if (error || (reply == NULL)) { @@ -262,6 +280,11 @@ mps_config_get_man_pg10(struct mps_softc *sc, Mpi2ConfigReply_t *mpi_reply) goto out; } cm->cm_data = page; + + /* + * This page must be polled because the IOC isn't ready yet when this + * page is needed. + */ error = mps_request_polled(sc, cm); reply = (MPI2_CONFIG_REPLY *)cm->cm_reply; if (error || (reply == NULL)) { @@ -561,12 +584,15 @@ mps_config_get_dpm_pg0(struct mps_softc *sc, Mpi2ConfigReply_t *mpi_reply, MPI2_DPM_PGAD_ENTRY_COUNT_SHIFT; cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; cm->cm_data = NULL; - error = mps_request_polled(sc, cm); + error = mps_wait_command(sc, cm, 60, CAN_SLEEP); reply = (MPI2_CONFIG_REPLY *)cm->cm_reply; if (error || (reply == NULL)) { /* FIXME */ - /* If the poll returns error then we need to do diag reset */ - printf("%s: poll for header completed with error %d", + /* + * If the request returns an error then we need to do a diag + * reset + */ + printf("%s: request for header completed with error %d", __func__, error); error = ENXIO; goto out; @@ -575,7 +601,10 @@ mps_config_get_dpm_pg0(struct mps_softc *sc, Mpi2ConfigReply_t *mpi_reply, bcopy(reply, mpi_reply, sizeof(MPI2_CONFIG_REPLY)); if (ioc_status != MPI2_IOCSTATUS_SUCCESS) { /* FIXME */ - /* If the poll returns error then we need to do diag reset */ + /* + * If the request returns an error then we need to do a diag + * reset + */ printf("%s: header read with error; iocstatus = 0x%x\n", __func__, ioc_status); error = ENXIO; @@ -615,12 +644,15 @@ mps_config_get_dpm_pg0(struct mps_softc *sc, Mpi2ConfigReply_t *mpi_reply, goto out; } cm->cm_data = page; - error = mps_request_polled(sc, cm); + error = mps_wait_command(sc, cm, 60, CAN_SLEEP); reply = (MPI2_CONFIG_REPLY *)cm->cm_reply; if (error || (reply == NULL)) { /* FIXME */ - /* If the poll returns error then we need to do diag reset */ - printf("%s: poll for page completed with error %d", + /* + * If the request returns an error then we need to do a diag + * reset + */ + printf("%s: request for page completed with error %d", __func__, error); error = ENXIO; goto out; @@ -629,7 +661,10 @@ mps_config_get_dpm_pg0(struct mps_softc *sc, Mpi2ConfigReply_t *mpi_reply, bcopy(reply, mpi_reply, sizeof(MPI2_CONFIG_REPLY)); if (ioc_status != MPI2_IOCSTATUS_SUCCESS) { /* FIXME */ - /* If the poll returns error then we need to do diag reset */ + /* + * If the request returns an error then we need to do a diag + * reset + */ printf("%s: page read with error; iocstatus = 0x%x\n", __func__, ioc_status); error = ENXIO; @@ -685,12 +720,15 @@ int mps_config_set_dpm_pg0(struct mps_softc *sc, Mpi2ConfigReply_t *mpi_reply, request->PageAddress |= htole16(entry_idx); cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; cm->cm_data = NULL; - error = mps_request_polled(sc, cm); + error = mps_wait_command(sc, cm, 60, CAN_SLEEP); reply = (MPI2_CONFIG_REPLY *)cm->cm_reply; if (error || (reply == NULL)) { /* FIXME */ - /* If the poll returns error then we need to do diag reset */ - printf("%s: poll for header completed with error %d", + /* + * If the request returns an error then we need to do a diag + * reset + */ + printf("%s: request for header completed with error %d", __func__, error); error = ENXIO; goto out; @@ -699,7 +737,10 @@ int mps_config_set_dpm_pg0(struct mps_softc *sc, Mpi2ConfigReply_t *mpi_reply, bcopy(reply, mpi_reply, sizeof(MPI2_CONFIG_REPLY)); if (ioc_status != MPI2_IOCSTATUS_SUCCESS) { /* FIXME */ - /* If the poll returns error then we need to do diag reset */ + /* + * If the request returns an error then we need to do a diag + * reset + */ printf("%s: header read with error; iocstatus = 0x%x\n", __func__, ioc_status); error = ENXIO; @@ -741,12 +782,15 @@ int mps_config_set_dpm_pg0(struct mps_softc *sc, Mpi2ConfigReply_t *mpi_reply, bcopy(config_page, page, MIN(cm->cm_length, (sizeof(Mpi2DriverMappingPage0_t)))); cm->cm_data = page; - error = mps_request_polled(sc, cm); + error = mps_wait_command(sc, cm, 60, CAN_SLEEP); reply = (MPI2_CONFIG_REPLY *)cm->cm_reply; if (error || (reply == NULL)) { /* FIXME */ - /* If the poll returns error then we need to do diag reset */ - printf("%s: poll for page completed with error %d", + /* + * If the request returns an error then we need to do a diag + * reset + */ + printf("%s: request to write page completed with error %d", __func__, error); error = ENXIO; goto out; @@ -755,7 +799,10 @@ int mps_config_set_dpm_pg0(struct mps_softc *sc, Mpi2ConfigReply_t *mpi_reply, bcopy(reply, mpi_reply, sizeof(MPI2_CONFIG_REPLY)); if (ioc_status != MPI2_IOCSTATUS_SUCCESS) { /* FIXME */ - /* If the poll returns error then we need to do diag reset */ + /* + * If the request returns an error then we need to do a diag + * reset + */ printf("%s: page written with error; iocstatus = 0x%x\n", __func__, ioc_status); error = ENXIO; @@ -808,12 +855,15 @@ mps_config_get_sas_device_pg0(struct mps_softc *sc, Mpi2ConfigReply_t request->Header.PageVersion = MPI2_SASDEVICE0_PAGEVERSION; cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; cm->cm_data = NULL; - error = mps_request_polled(sc, cm); + error = mps_wait_command(sc, cm, 60, CAN_SLEEP); reply = (MPI2_CONFIG_REPLY *)cm->cm_reply; if (error || (reply == NULL)) { /* FIXME */ - /* If the poll returns error then we need to do diag reset */ - printf("%s: poll for header completed with error %d", + /* + * If the request returns an error then we need to do a diag + * reset + */ + printf("%s: request for header completed with error %d", __func__, error); error = ENXIO; goto out; @@ -822,7 +872,10 @@ mps_config_get_sas_device_pg0(struct mps_softc *sc, Mpi2ConfigReply_t bcopy(reply, mpi_reply, sizeof(MPI2_CONFIG_REPLY)); if (ioc_status != MPI2_IOCSTATUS_SUCCESS) { /* FIXME */ - /* If the poll returns error then we need to do diag reset */ + /* + * If the request returns an error then we need to do a diag + * reset + */ printf("%s: header read with error; iocstatus = 0x%x\n", __func__, ioc_status); error = ENXIO; @@ -862,12 +915,15 @@ mps_config_get_sas_device_pg0(struct mps_softc *sc, Mpi2ConfigReply_t } cm->cm_data = page; - error = mps_request_polled(sc, cm); + error = mps_wait_command(sc, cm, 60, CAN_SLEEP); reply = (MPI2_CONFIG_REPLY *)cm->cm_reply; if (error || (reply == NULL)) { /* FIXME */ - /* If the poll returns error then we need to do diag reset */ - printf("%s: poll for page completed with error %d", + /* + * If the request returns an error then we need to do a diag + * reset + */ + printf("%s: request for page completed with error %d", __func__, error); error = ENXIO; goto out; @@ -876,7 +932,10 @@ mps_config_get_sas_device_pg0(struct mps_softc *sc, Mpi2ConfigReply_t bcopy(reply, mpi_reply, sizeof(MPI2_CONFIG_REPLY)); if (ioc_status != MPI2_IOCSTATUS_SUCCESS) { /* FIXME */ - /* If the poll returns error then we need to do diag reset */ + /* + * If the request returns an error then we need to do a diag + * reset + */ printf("%s: page read with error; iocstatus = 0x%x\n", __func__, ioc_status); error = ENXIO; @@ -928,12 +987,15 @@ mps_config_get_bios_pg3(struct mps_softc *sc, Mpi2ConfigReply_t *mpi_reply, request->Header.PageVersion = MPI2_BIOSPAGE3_PAGEVERSION; cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; cm->cm_data = NULL; - error = mps_request_polled(sc, cm); + error = mps_wait_command(sc, cm, 60, CAN_SLEEP); reply = (MPI2_CONFIG_REPLY *)cm->cm_reply; if (error || (reply == NULL)) { /* FIXME */ - /* If the poll returns error then we need to do diag reset */ - printf("%s: poll for header completed with error %d", + /* + * If the request returns an error then we need to do a diag + * reset + */ + printf("%s: request for header completed with error %d", __func__, error); error = ENXIO; goto out; @@ -942,7 +1004,10 @@ mps_config_get_bios_pg3(struct mps_softc *sc, Mpi2ConfigReply_t *mpi_reply, bcopy(reply, mpi_reply, sizeof(MPI2_CONFIG_REPLY)); if (ioc_status != MPI2_IOCSTATUS_SUCCESS) { /* FIXME */ - /* If the poll returns error then we need to do diag reset */ + /* + * If the request returns an error then we need to do a diag + * reset + */ printf("%s: header read with error; iocstatus = 0x%x\n", __func__, ioc_status); error = ENXIO; @@ -980,12 +1045,15 @@ mps_config_get_bios_pg3(struct mps_softc *sc, Mpi2ConfigReply_t *mpi_reply, } cm->cm_data = page; - error = mps_request_polled(sc, cm); + error = mps_wait_command(sc, cm, 60, CAN_SLEEP); reply = (MPI2_CONFIG_REPLY *)cm->cm_reply; if (error || (reply == NULL)) { /* FIXME */ - /* If the poll returns error then we need to do diag reset */ - printf("%s: poll for page completed with error %d", + /* + * If the request returns an error then we need to do a diag + * reset + */ + printf("%s: request for page completed with error %d", __func__, error); error = ENXIO; goto out; @@ -994,7 +1062,10 @@ mps_config_get_bios_pg3(struct mps_softc *sc, Mpi2ConfigReply_t *mpi_reply, bcopy(reply, mpi_reply, sizeof(MPI2_CONFIG_REPLY)); if (ioc_status != MPI2_IOCSTATUS_SUCCESS) { /* FIXME */ - /* If the poll returns error then we need to do diag reset */ + /* + * If the request returns an error then we need to do a diag + * reset + */ printf("%s: page read with error; iocstatus = 0x%x\n", __func__, ioc_status); error = ENXIO; @@ -1046,6 +1117,11 @@ mps_config_get_raid_volume_pg0(struct mps_softc *sc, Mpi2ConfigReply_t request->Header.PageVersion = MPI2_RAIDVOLPAGE0_PAGEVERSION; cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; cm->cm_data = NULL; + + /* + * This page must be polled because the IOC isn't ready yet when this + * page is needed. + */ error = mps_request_polled(sc, cm); reply = (MPI2_CONFIG_REPLY *)cm->cm_reply; if (error || (reply == NULL)) { @@ -1099,6 +1175,10 @@ mps_config_get_raid_volume_pg0(struct mps_softc *sc, Mpi2ConfigReply_t } cm->cm_data = page; + /* + * This page must be polled because the IOC isn't ready yet when this + * page is needed. + */ error = mps_request_polled(sc, cm); reply = (MPI2_CONFIG_REPLY *)cm->cm_reply; if (error || (reply == NULL)) { @@ -1166,12 +1246,15 @@ mps_config_get_raid_volume_pg1(struct mps_softc *sc, Mpi2ConfigReply_t request->Header.PageVersion = MPI2_RAIDVOLPAGE1_PAGEVERSION; cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; cm->cm_data = NULL; - error = mps_request_polled(sc, cm); + error = mps_wait_command(sc, cm, 60, CAN_SLEEP); reply = (MPI2_CONFIG_REPLY *)cm->cm_reply; if (error || (reply == NULL)) { /* FIXME */ - /* If the poll returns error then we need to do diag reset */ - printf("%s: poll for header completed with error %d", + /* + * If the request returns an error then we need to do a diag + * reset + */ + printf("%s: request for header completed with error %d", __func__, error); error = ENXIO; goto out; @@ -1180,7 +1263,10 @@ mps_config_get_raid_volume_pg1(struct mps_softc *sc, Mpi2ConfigReply_t bcopy(reply, mpi_reply, sizeof(MPI2_CONFIG_REPLY)); if (ioc_status != MPI2_IOCSTATUS_SUCCESS) { /* FIXME */ - /* If the poll returns error then we need to do diag reset */ + /* + * If the request returns an error then we need to do a diag + * reset + */ printf("%s: header read with error; iocstatus = 0x%x\n", __func__, ioc_status); error = ENXIO; @@ -1219,12 +1305,15 @@ mps_config_get_raid_volume_pg1(struct mps_softc *sc, Mpi2ConfigReply_t } cm->cm_data = page; - error = mps_request_polled(sc, cm); + error = mps_wait_command(sc, cm, 60, CAN_SLEEP); reply = (MPI2_CONFIG_REPLY *)cm->cm_reply; if (error || (reply == NULL)) { /* FIXME */ - /* If the poll returns error then we need to do diag reset */ - printf("%s: poll for page completed with error %d", + /* + * If the request returns an error then we need to do a diag + * reset + */ + printf("%s: request for page completed with error %d", __func__, error); error = ENXIO; goto out; @@ -1233,7 +1322,10 @@ mps_config_get_raid_volume_pg1(struct mps_softc *sc, Mpi2ConfigReply_t bcopy(reply, mpi_reply, sizeof(MPI2_CONFIG_REPLY)); if (ioc_status != MPI2_IOCSTATUS_SUCCESS) { /* FIXME */ - /* If the poll returns error then we need to do diag reset */ + /* + * If the request returns an error then we need to do a diag + * reset + */ printf("%s: page read with error; iocstatus = 0x%x\n", __func__, ioc_status); error = ENXIO; @@ -1311,6 +1403,11 @@ mps_config_get_raid_pd_pg0(struct mps_softc *sc, Mpi2ConfigReply_t *mpi_reply, request->Header.PageVersion = MPI2_RAIDPHYSDISKPAGE0_PAGEVERSION; cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; cm->cm_data = NULL; + + /* + * This page must be polled because the IOC isn't ready yet when this + * page is needed. + */ error = mps_request_polled(sc, cm); reply = (MPI2_CONFIG_REPLY *)cm->cm_reply; if (error || (reply == NULL)) { @@ -1364,6 +1461,10 @@ mps_config_get_raid_pd_pg0(struct mps_softc *sc, Mpi2ConfigReply_t *mpi_reply, } cm->cm_data = page; + /* + * This page must be polled because the IOC isn't ready yet when this + * page is needed. + */ error = mps_request_polled(sc, cm); reply = (MPI2_CONFIG_REPLY *)cm->cm_reply; if (error || (reply == NULL)) { diff --git a/sys/dev/mps/mps_mapping.c b/sys/dev/mps/mps_mapping.c index c486ecb4c408..97e24be799eb 100644 --- a/sys/dev/mps/mps_mapping.c +++ b/sys/dev/mps/mps_mapping.c @@ -1217,12 +1217,12 @@ _mapping_add_new_device(struct mps_softc *sc, phy_change->is_processed = 1; } else { phy_change->is_processed = 1; - printf("%s: failed to add the " - "device with handle 0x%04x " - "to persistent table " - "because there is no free " - "space available\n", - __func__, + mps_dprint(sc, MPS_INFO, "%s: " + "failed to add the device " + "with handle 0x%04x to " + "persistent table because " + "there is no free space " + "available\n", __func__, phy_change->dev_handle); } } else { @@ -1319,12 +1319,12 @@ _mapping_add_new_device(struct mps_softc *sc, phy_change->is_processed = 1; } else if (dpm_idx == MPS_DPM_BAD_IDX) { phy_change->is_processed = 1; - printf("%s: failed to add the " - "device with handle 0x%04x " - "to persistent table " - "because there is no free " - "space available\n", - __func__, + mps_dprint(sc, MPS_INFO, "%s: " + "failed to add the device " + "with handle 0x%04x to " + "persistent table because " + "there is no free space " + "available\n", __func__, phy_change->dev_handle); } } diff --git a/sys/dev/mps/mps_sas.c b/sys/dev/mps/mps_sas.c index 80a0f520765c..9a4964a500a4 100644 --- a/sys/dev/mps/mps_sas.c +++ b/sys/dev/mps/mps_sas.c @@ -136,14 +136,12 @@ static void mpssas_action_smpio(struct mpssas_softc *sassc, union ccb *ccb); static void mpssas_resetdev_complete(struct mps_softc *, struct mps_command *); static int mpssas_send_abort(struct mps_softc *sc, struct mps_command *tm, struct mps_command *cm); static int mpssas_send_reset(struct mps_softc *sc, struct mps_command *tm, uint8_t type); -static void mpssas_rescan(struct mpssas_softc *sassc, union ccb *ccb); -static void mpssas_rescan_done(struct cam_periph *periph, union ccb *done_ccb); -static void mpssas_scanner_thread(void *arg); -#if __FreeBSD_version >= 1000006 static void mpssas_async(void *callback_arg, uint32_t code, struct cam_path *path, void *arg); -#else -static void mpssas_check_eedp(struct mpssas_softc *sassc); +#if (__FreeBSD_version < 901503) || \ + ((__FreeBSD_version >= 1000000) && (__FreeBSD_version < 1000006)) +static void mpssas_check_eedp(struct mps_softc *sc, struct cam_path *path, + struct ccb_getdev *cgd); static void mpssas_read_cap_done(struct cam_periph *periph, union ccb *done_ccb); #endif static int mpssas_send_portenable(struct mps_softc *sc); @@ -202,8 +200,12 @@ mpssas_startup_decrement(struct mpssas_softc *sassc) mps_dprint(sassc->sc, MPS_INIT, "%s releasing simq\n", __func__); sassc->flags &= ~MPSSAS_IN_STARTUP; +#if __FreeBSD_version >= 1000039 + xpt_release_boot(); +#else xpt_release_simq(sassc->sim, 1); mpssas_rescan_target(sassc->sc, NULL); +#endif } mps_dprint(sassc->sc, MPS_INIT, "%s refcount %u\n", __func__, sassc->startup_refcount); @@ -254,7 +256,6 @@ mpssas_free_tm(struct mps_softc *sc, struct mps_command *tm) mps_free_high_priority_command(sc, tm); } - void mpssas_rescan_target(struct mps_softc *sc, struct mpssas_target *targ) { @@ -280,7 +281,7 @@ mpssas_rescan_target(struct mps_softc *sc, struct mpssas_target *targ) } if (xpt_create_path(&ccb->ccb_h.path, NULL, pathid, - targetid, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { + targetid, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { mps_dprint(sc, MPS_ERROR, "unable to create path for rescan\n"); xpt_free_ccb(ccb); return; @@ -292,7 +293,7 @@ mpssas_rescan_target(struct mps_softc *sc, struct mpssas_target *targ) ccb->ccb_h.func_code = XPT_SCAN_TGT; mps_dprint(sc, MPS_TRACE, "%s targetid %u\n", __func__, targetid); - mpssas_rescan(sassc, ccb); + xpt_rescan(ccb); } static void @@ -690,9 +691,7 @@ int mps_attach_sas(struct mps_softc *sc) { struct mpssas_softc *sassc; -#if __FreeBSD_version >= 1000006 cam_status status; -#endif int unit, error = 0; MPS_FUNCTRACE(sc); @@ -740,16 +739,7 @@ mps_attach_sas(struct mps_softc *sc) taskqueue_start_threads(&sassc->ev_tq, 1, 255, "%s taskq", device_get_nameunit(sc->mps_dev)); - TAILQ_INIT(&sassc->ccb_scanq); - error = mps_kproc_create(mpssas_scanner_thread, sassc, - &sassc->rescan_thread, 0, 0, "mps_scan%d", unit); - if (error) { - mps_printf(sc, "Error %d starting rescan thread\n", error); - goto out; - } - mps_lock(sc); - sassc->flags |= MPSSAS_SCANTHREAD; /* * XXX There should be a bus for every port on the adapter, but since @@ -764,12 +754,16 @@ mps_attach_sas(struct mps_softc *sc) } /* - * Assume that discovery events will start right away. Freezing - * the simq will prevent the CAM boottime scanner from running - * before discovery is complete. + * Assume that discovery events will start right away. + * + * Hold off boot until discovery is complete. */ sassc->flags |= MPSSAS_IN_STARTUP | MPSSAS_IN_DISCOVERY; +#if __FreeBSD_version >= 1000039 + xpt_hold_boot(); +#else xpt_freeze_simq(sassc->sim, 1); +#endif sc->sassc->startup_refcount = 0; callout_init(&sassc->discovery_callout, 1 /*mpsafe*/); @@ -777,14 +771,42 @@ mps_attach_sas(struct mps_softc *sc) sassc->tm_count = 0; -#if __FreeBSD_version >= 1000006 - status = xpt_register_async(AC_ADVINFO_CHANGED, mpssas_async, sc, NULL); + /* + * Register for async events so we can determine the EEDP + * capabilities of devices. + */ + status = xpt_create_path(&sassc->path, /*periph*/NULL, + cam_sim_path(sc->sassc->sim), CAM_TARGET_WILDCARD, + CAM_LUN_WILDCARD); if (status != CAM_REQ_CMP) { - mps_dprint(sc, MPS_ERROR, - "Error %#x registering async handler for " - "AC_ADVINFO_CHANGED events\n", status); - } + mps_printf(sc, "Error %#x creating sim path\n", status); + sassc->path = NULL; + } else { + int event; + +#if (__FreeBSD_version >= 1000006) || \ + ((__FreeBSD_version >= 901503) && (__FreeBSD_version < 1000000)) + event = AC_ADVINFO_CHANGED; +#else + event = AC_FOUND_DEVICE; #endif + status = xpt_register_async(event, mpssas_async, sc, + sassc->path); + if (status != CAM_REQ_CMP) { + mps_dprint(sc, MPS_ERROR, + "Error %#x registering async handler for " + "AC_ADVINFO_CHANGED events\n", status); + xpt_free_path(sassc->path); + sassc->path = NULL; + } + } + if (status != CAM_REQ_CMP) { + /* + * EEDP use is the exception, not the rule. + * Warn the user, but do not fail to attach. + */ + mps_printf(sc, "EEDP capabilities disabled.\n"); + } mps_unlock(sc); @@ -823,9 +845,11 @@ mps_detach_sas(struct mps_softc *sc) mps_lock(sc); /* Deregister our async handler */ -#if __FreeBSD_version >= 1000006 - xpt_register_async(0, mpssas_async, sc, NULL); -#endif + if (sassc->path != NULL) { + xpt_register_async(0, mpssas_async, sc, sassc->path); + xpt_free_path(sassc->path); + sassc->path = NULL; + } if (sassc->flags & MPSSAS_IN_STARTUP) xpt_release_simq(sassc->sim, 1); @@ -835,15 +859,7 @@ mps_detach_sas(struct mps_softc *sc) cam_sim_free(sassc->sim, FALSE); } - if (sassc->flags & MPSSAS_SCANTHREAD) { - sassc->flags |= MPSSAS_SHUTDOWN; - wakeup(&sassc->ccb_scanq); - - if (sassc->flags & MPSSAS_SCANTHREAD) { - msleep(&sassc->flags, &sc->mps_mtx, PRIBIO, - "mps_shutdown", 30 * hz); - } - } + sassc->flags |= MPSSAS_SHUTDOWN; mps_unlock(sc); if (sassc->devq != NULL) @@ -934,7 +950,11 @@ mpssas_action(struct cam_sim *sim, union ccb *ccb) cpi->version_num = 1; cpi->hba_inquiry = PI_SDTR_ABLE|PI_TAG_ABLE|PI_WIDE_16; cpi->target_sprt = 0; +#if __FreeBSD_version >= 1000039 + cpi->hba_misc = PIM_NOBUSRESET | PIM_UNMAPPED | PIM_NOSCAN; +#else cpi->hba_misc = PIM_NOBUSRESET | PIM_UNMAPPED; +#endif cpi->hba_eng_cnt = 0; cpi->max_target = sassc->sc->facts->MaxTargets - 1; cpi->max_lun = 255; @@ -1624,13 +1644,24 @@ mpssas_action_scsiio(struct mpssas_softc *sassc, union ccb *ccb) return; } if (targ->flags & MPS_TARGET_FLAGS_RAID_COMPONENT) { - mps_dprint(sc, MPS_ERROR, "%s Raid component no SCSI IO supported %u\n", - __func__, csio->ccb_h.target_id); + mps_dprint(sc, MPS_ERROR, "%s Raid component no SCSI IO " + "supported %u\n", __func__, csio->ccb_h.target_id); csio->ccb_h.status = CAM_TID_INVALID; xpt_done(ccb); return; } /* + * Sometimes, it is possible to get a command that is not "In + * Progress" and was actually aborted by the upper layer. Check for + * this here and complete the command without error. + */ + if (ccb->ccb_h.status != CAM_REQ_INPROG) { + mps_dprint(sc, MPS_TRACE, "%s Command is not in progress for " + "target %u\n", __func__, csio->ccb_h.target_id); + xpt_done(ccb); + return; + } + /* * If devinfo is 0 this will be a volume. In that case don't tell CAM * that the volume has timed out. We want volumes to be enumerated * until they are deleted/removed, not just failed. @@ -1698,7 +1729,7 @@ mpssas_action_scsiio(struct mpssas_softc *sassc, union ccb *ccb) break; } - if (csio->cdb_len == 32) + if (csio->cdb_len == 32) mpi_control |= 4 << MPI2_SCSIIO_CONTROL_ADDCDBLEN_SHIFT; /* * It looks like the hardware doesn't require an explicit tag @@ -1826,6 +1857,7 @@ mpssas_action_scsiio(struct mpssas_softc *sassc, union ccb *ccb) targ->issued++; targ->outstanding++; TAILQ_INSERT_TAIL(&targ->commands, cm, cm_link); + ccb->ccb_h.status |= CAM_SIM_QUEUED; mpssas_log_command(cm, MPS_XINFO, "%s cm %p ccb %p outstanding %u\n", __func__, cm, ccb, targ->outstanding); @@ -2008,8 +2040,8 @@ mps_sc_failed_io_info(struct mps_softc *sc, struct ccb_scsiio *csio, * TO-DO * */ mps_dprint(sc, MPS_XINFO, "\tscsi_status(%s)(0x%02x), " - "scsi_state(%s)(0x%02x)\n", desc_scsi_status, - scsi_status, desc_scsi_state, scsi_state); + "scsi_state(%s)(0x%02x)\n", desc_scsi_status, scsi_status, + desc_scsi_state, scsi_state); if (sc->mps_debug & MPS_XINFO && scsi_state & MPI2_SCSI_STATE_AUTOSENSE_VALID) { @@ -2067,6 +2099,7 @@ mpssas_scsiio_complete(struct mps_softc *sc, struct mps_command *cm) cm->cm_targ->completed++; cm->cm_targ->outstanding--; TAILQ_REMOVE(&cm->cm_targ->commands, cm, cm_link); + ccb->ccb_h.status |= ~(CAM_STATUS_MASK | CAM_SIM_QUEUED); if (cm->cm_state == MPS_CM_STATE_TIMEDOUT) { TAILQ_REMOVE(&cm->cm_targ->timedout_commands, cm, cm_recovery); @@ -2142,7 +2175,7 @@ mpssas_scsiio_complete(struct mps_softc *sc, struct mps_command *cm) ccb->ccb_h.status |= CAM_RELEASE_SIMQ; sassc->flags &= ~MPSSAS_QUEUE_FROZEN; mps_dprint(sc, MPS_XINFO, - "Unfreezing SIM queue\n"); + "Unfreezing SIM queue\n"); } } @@ -2368,7 +2401,7 @@ mpssas_scsiio_complete(struct mps_softc *sc, struct mps_command *cm) ccb->ccb_h.status |= CAM_RELEASE_SIMQ; sassc->flags &= ~MPSSAS_QUEUE_FROZEN; mps_dprint(sc, MPS_XINFO, "Command completed, " - "unfreezing SIM queue\n"); + "unfreezing SIM queue\n"); } if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { @@ -2684,7 +2717,8 @@ mpssas_smpio_complete(struct mps_softc *sc, struct mps_command *cm) sasaddr = le32toh(req->SASAddress.Low); sasaddr |= ((uint64_t)(le32toh(req->SASAddress.High))) << 32; - if ((le16toh(rpl->IOCStatus) & MPI2_IOCSTATUS_MASK) != MPI2_IOCSTATUS_SUCCESS || + if ((le16toh(rpl->IOCStatus) & MPI2_IOCSTATUS_MASK) != + MPI2_IOCSTATUS_SUCCESS || rpl->SASStatus != MPI2_SASSTATUS_SUCCESS) { mps_dprint(sc, MPS_XINFO, "%s: IOCStatus %04x SASStatus %02x\n", __func__, le16toh(rpl->IOCStatus), rpl->SASStatus); @@ -2809,7 +2843,7 @@ mpssas_send_smpcmd(struct mpssas_softc *sassc, union ccb *ccb, uint64_t sasaddr) MPI2_SGLFLAGS_SYSTEM_ADDRESS_SPACE | MPI2_SGLFLAGS_SGL_TYPE_MPI; mps_dprint(sc, MPS_XINFO, "%s: sending SMP request to SAS " - "address %#jx\n", __func__, (uintmax_t)sasaddr); + "address %#jx\n", __func__, (uintmax_t)sasaddr); mpi_init_sge(cm, req, &req->SGL); @@ -3036,7 +3070,7 @@ mpssas_action_resetdev(struct mpssas_softc *sassc, union ccb *ccb) tm = mps_alloc_command(sc); if (tm == NULL) { mps_dprint(sc, MPS_ERROR, - "comand alloc failure in mpssas_action_resetdev\n"); + "command alloc failure in mpssas_action_resetdev\n"); ccb->ccb_h.status = CAM_RESRC_UNAVAIL; xpt_done(ccb); return; @@ -3126,114 +3160,6 @@ mpssas_poll(struct cam_sim *sim) } static void -mpssas_rescan_done(struct cam_periph *periph, union ccb *done_ccb) -{ - struct mpssas_softc *sassc; - char path_str[64]; - - if (done_ccb == NULL) - return; - - sassc = (struct mpssas_softc *)done_ccb->ccb_h.ppriv_ptr1; - - mtx_assert(&sassc->sc->mps_mtx, MA_OWNED); - - xpt_path_string(done_ccb->ccb_h.path, path_str, sizeof(path_str)); - mps_dprint(sassc->sc, MPS_XINFO, "Completing rescan for %s\n", path_str); - - xpt_free_path(done_ccb->ccb_h.path); - xpt_free_ccb(done_ccb); - -#if __FreeBSD_version < 1000006 - /* - * Before completing scan, get EEDP stuff for all of the existing - * targets. - */ - mpssas_check_eedp(sassc); -#endif - -} - -/* thread to handle bus rescans */ -static void -mpssas_scanner_thread(void *arg) -{ - struct mpssas_softc *sassc; - struct mps_softc *sc; - union ccb *ccb; - - sassc = (struct mpssas_softc *)arg; - sc = sassc->sc; - - MPS_FUNCTRACE(sc); - - mps_lock(sc); - for (;;) { - /* Sleep for 1 second and check the queue status*/ - msleep(&sassc->ccb_scanq, &sc->mps_mtx, PRIBIO, - "mps_scanq", 1 * hz); - if (sassc->flags & MPSSAS_SHUTDOWN) { - mps_dprint(sc, MPS_XINFO, "Scanner shutting down\n"); - break; - } -next_work: - // Get first work. - ccb = (union ccb *)TAILQ_FIRST(&sassc->ccb_scanq); - if (ccb == NULL) - continue; - // Got first work. - TAILQ_REMOVE(&sassc->ccb_scanq, &ccb->ccb_h, sim_links.tqe); - xpt_action(ccb); - if (sassc->flags & MPSSAS_SHUTDOWN) { - mps_dprint(sc, MPS_XINFO, "Scanner shutting down\n"); - break; - } - goto next_work; - } - - sassc->flags &= ~MPSSAS_SCANTHREAD; - wakeup(&sassc->flags); - mps_unlock(sc); - mps_dprint(sc, MPS_TRACE, "Scanner exiting\n"); - mps_kproc_exit(0); -} - -/* - * This function will send READ_CAP_16 to find out EEDP protection mode. - * It will check inquiry data before sending READ_CAP_16. - * Callback for READ_CAP_16 is "mpssas_read_cap_done". - * This is insternal scsi command and we need to take care release of devq, if - * CAM_DEV_QFRZN is set. Driver needs to release devq if it has frozen any. - * xpt_release_devq is called from mpssas_read_cap_done. - * - * All other commands will be handled by periph layer and there it will - * check for "CAM_DEV_QFRZN" and release of devq will be done. - */ -static void -mpssas_rescan(struct mpssas_softc *sassc, union ccb *ccb) -{ - char path_str[64]; - - MPS_FUNCTRACE(sassc->sc); - - mtx_assert(&sassc->sc->mps_mtx, MA_OWNED); - - if (ccb == NULL) - return; - - xpt_path_string(ccb->ccb_h.path, path_str, sizeof(path_str)); - mps_dprint(sassc->sc, MPS_XINFO, "Queueing rescan for %s\n", path_str); - - /* Prepare request */ - ccb->ccb_h.ppriv_ptr1 = sassc; - ccb->ccb_h.cbfcnp = mpssas_rescan_done; - xpt_setup_ccb(&ccb->ccb_h, ccb->ccb_h.path, MPS_PRIORITY_XPT); - TAILQ_INSERT_TAIL(&sassc->ccb_scanq, &ccb->ccb_h, sim_links.tqe); - wakeup(&sassc->ccb_scanq); -} - -#if __FreeBSD_version >= 1000006 -static void mpssas_async(void *callback_arg, uint32_t code, struct cam_path *path, void *arg) { @@ -3242,6 +3168,8 @@ mpssas_async(void *callback_arg, uint32_t code, struct cam_path *path, sc = (struct mps_softc *)callback_arg; switch (code) { +#if (__FreeBSD_version >= 1000006) || \ + ((__FreeBSD_version >= 901503) && (__FreeBSD_version < 1000000)) case AC_ADVINFO_CHANGED: { struct mpssas_target *target; struct mpssas_softc *sassc; @@ -3264,13 +3192,6 @@ mpssas_async(void *callback_arg, uint32_t code, struct cam_path *path, break; /* - * We're only interested in devices that are attached to - * this controller. - */ - if (xpt_path_path_id(path) != sassc->sim->path_id) - break; - - /* * We should have a handle for this, but check to make sure. */ target = &sassc->targets[xpt_path_target_id(path)]; @@ -3321,178 +3242,148 @@ mpssas_async(void *callback_arg, uint32_t code, struct cam_path *path, } break; } +#else + case AC_FOUND_DEVICE: { + struct ccb_getdev *cgd; + + cgd = arg; + mpssas_check_eedp(sc, path, cgd); + break; + } +#endif default: break; } } -#else /* __FreeBSD_version >= 1000006 */ +#if (__FreeBSD_version < 901503) || \ + ((__FreeBSD_version >= 1000000) && (__FreeBSD_version < 1000006)) static void -mpssas_check_eedp(struct mpssas_softc *sassc) +mpssas_check_eedp(struct mps_softc *sc, struct cam_path *path, + struct ccb_getdev *cgd) { - struct mps_softc *sc = sassc->sc; + struct mpssas_softc *sassc = sc->sassc; struct ccb_scsiio *csio; struct scsi_read_capacity_16 *scsi_cmd; struct scsi_read_capacity_eedp *rcap_buf; - union ccb *ccb; - path_id_t pathid = cam_sim_path(sassc->sim); + path_id_t pathid; target_id_t targetid; lun_id_t lunid; - struct cam_periph *found_periph; + union ccb *ccb; + struct cam_path *local_path; struct mpssas_target *target; struct mpssas_lun *lun; uint8_t found_lun; - struct ccb_getdev cgd; char path_str[64]; - /* - * Issue a READ CAPACITY 16 command to each LUN of each target. This - * info is used to determine if the LUN is formatted for EEDP support. - */ - for (targetid = 0; targetid < sc->facts->MaxTargets; targetid++) { - target = &sassc->targets[targetid]; - if (target->handle == 0x0) { - continue; - } + sassc = sc->sassc; + pathid = cam_sim_path(sassc->sim); + targetid = xpt_path_target_id(path); + lunid = xpt_path_lun_id(path); - lunid = 0; - do { - ccb = xpt_alloc_ccb_nowait(); - if (ccb == NULL) { - mps_dprint(sc, MPS_ERROR, "Unable to alloc CCB " - "for EEDP support.\n"); - return; - } + target = &sassc->targets[targetid]; + if (target->handle == 0x0) + return; - if (xpt_create_path(&ccb->ccb_h.path, NULL, - pathid, targetid, lunid) != CAM_REQ_CMP) { - mps_dprint(sc, MPS_ERROR, "Unable to create " - "path for EEDP support\n"); - xpt_free_ccb(ccb); - return; - } + /* + * Determine if the device is EEDP capable. + * + * If this flag is set in the inquiry data, + * the device supports protection information, + * and must support the 16 byte read + * capacity command, otherwise continue without + * sending read cap 16 + */ + if ((cgd->inq_data.spc3_flags & SPC3_SID_PROTECT) == 0) + return; - /* - * If a periph is returned, the LUN exists. Create an - * entry in the target's LUN list. - */ - if ((found_periph = cam_periph_find(ccb->ccb_h.path, - NULL)) != NULL) { - /* - * If LUN is already in list, don't create a new - * one. - */ - found_lun = FALSE; - SLIST_FOREACH(lun, &target->luns, lun_link) { - if (lun->lun_id == lunid) { - found_lun = TRUE; - break; - } - } - if (!found_lun) { - lun = malloc(sizeof(struct mpssas_lun), - M_MPT2, M_NOWAIT | M_ZERO); - if (lun == NULL) { - mps_dprint(sc, MPS_ERROR, - "Unable to alloc LUN for " - "EEDP support.\n"); - xpt_free_path(ccb->ccb_h.path); - xpt_free_ccb(ccb); - return; - } - lun->lun_id = lunid; - SLIST_INSERT_HEAD(&target->luns, lun, - lun_link); - } - lunid++; - /* Before Issuing READ CAPACITY 16, - * check Device type. - */ - xpt_setup_ccb(&cgd.ccb_h, ccb->ccb_h.path, - CAM_PRIORITY_NORMAL); - cgd.ccb_h.func_code = XPT_GDEV_TYPE; - xpt_action((union ccb *)&cgd); + /* + * Issue a READ CAPACITY 16 command. This info + * is used to determine if the LUN is formatted + * for EEDP support. + */ + ccb = xpt_alloc_ccb_nowait(); + if (ccb == NULL) { + mps_dprint(sc, MPS_ERROR, "Unable to alloc CCB " + "for EEDP support.\n"); + return; + } - /* - * If this flag is set in the inquiry data, - * the device supports protection information, - * and must support the 16 byte read - * capacity command, otherwise continue without - * sending read cap 16 - */ + if (xpt_create_path(&local_path, xpt_periph, + pathid, targetid, lunid) != CAM_REQ_CMP) { + mps_dprint(sc, MPS_ERROR, "Unable to create " + "path for EEDP support\n"); + xpt_free_ccb(ccb); + return; + } - xpt_path_string(ccb->ccb_h.path, path_str, - sizeof(path_str)); + /* + * If LUN is already in list, don't create a new + * one. + */ + found_lun = FALSE; + SLIST_FOREACH(lun, &target->luns, lun_link) { + if (lun->lun_id == lunid) { + found_lun = TRUE; + break; + } + } + if (!found_lun) { + lun = malloc(sizeof(struct mpssas_lun), M_MPT2, + M_NOWAIT | M_ZERO); + if (lun == NULL) { + mps_dprint(sc, MPS_ERROR, + "Unable to alloc LUN for EEDP support.\n"); + xpt_free_path(local_path); + xpt_free_ccb(ccb); + return; + } + lun->lun_id = lunid; + SLIST_INSERT_HEAD(&target->luns, lun, + lun_link); + } - if ((cgd.inq_data.spc3_flags & - SPC3_SID_PROTECT) == 0) { - xpt_free_path(ccb->ccb_h.path); - xpt_free_ccb(ccb); - continue; - } - - mps_dprint(sc, MPS_XINFO, - "Sending read cap: path %s" - " handle %d\n", path_str, target->handle ); - - /* - * Issue a READ CAPACITY 16 command for the LUN. - * The mpssas_read_cap_done function will load - * the read cap info into the LUN struct. - */ - rcap_buf = - malloc(sizeof(struct scsi_read_capacity_eedp), - M_MPT2, M_NOWAIT| M_ZERO); - if (rcap_buf == NULL) { - mps_dprint(sc, MPS_ERROR, "Unable to alloc read " - "capacity buffer for EEDP support.\n"); - xpt_free_path(ccb->ccb_h.path); - xpt_free_ccb(ccb); - return; - } - csio = &ccb->csio; - csio->ccb_h.func_code = XPT_SCSI_IO; - csio->ccb_h.flags = CAM_DIR_IN; - csio->ccb_h.retry_count = 4; - csio->ccb_h.cbfcnp = mpssas_read_cap_done; - csio->ccb_h.timeout = 60000; - csio->data_ptr = (uint8_t *)rcap_buf; - csio->dxfer_len = sizeof(struct - scsi_read_capacity_eedp); - csio->sense_len = MPS_SENSE_LEN; - csio->cdb_len = sizeof(*scsi_cmd); - csio->tag_action = MSG_SIMPLE_Q_TAG; + xpt_path_string(local_path, path_str, sizeof(path_str)); + mps_dprint(sc, MPS_INFO, "Sending read cap: path %s handle %d\n", + path_str, target->handle); - scsi_cmd = (struct scsi_read_capacity_16 *) - &csio->cdb_io.cdb_bytes; - bzero(scsi_cmd, sizeof(*scsi_cmd)); - scsi_cmd->opcode = 0x9E; - scsi_cmd->service_action = SRC16_SERVICE_ACTION; - ((uint8_t *)scsi_cmd)[13] = sizeof(struct - scsi_read_capacity_eedp); + /* + * Issue a READ CAPACITY 16 command for the LUN. + * The mpssas_read_cap_done function will load + * the read cap info into the LUN struct. + */ + rcap_buf = malloc(sizeof(struct scsi_read_capacity_eedp), + M_MPT2, M_NOWAIT | M_ZERO); + if (rcap_buf == NULL) { + mps_dprint(sc, MPS_FAULT, + "Unable to alloc read capacity buffer for EEDP support.\n"); + xpt_free_path(ccb->ccb_h.path); + xpt_free_ccb(ccb); + return; + } + xpt_setup_ccb(&ccb->ccb_h, local_path, CAM_PRIORITY_XPT); + csio = &ccb->csio; + csio->ccb_h.func_code = XPT_SCSI_IO; + csio->ccb_h.flags = CAM_DIR_IN; + csio->ccb_h.retry_count = 4; + csio->ccb_h.cbfcnp = mpssas_read_cap_done; + csio->ccb_h.timeout = 60000; + csio->data_ptr = (uint8_t *)rcap_buf; + csio->dxfer_len = sizeof(struct scsi_read_capacity_eedp); + csio->sense_len = MPS_SENSE_LEN; + csio->cdb_len = sizeof(*scsi_cmd); + csio->tag_action = MSG_SIMPLE_Q_TAG; - /* - * Set the path, target and lun IDs for the READ - * CAPACITY request. - */ - ccb->ccb_h.path_id = - xpt_path_path_id(ccb->ccb_h.path); - ccb->ccb_h.target_id = - xpt_path_target_id(ccb->ccb_h.path); - ccb->ccb_h.target_lun = - xpt_path_lun_id(ccb->ccb_h.path); + scsi_cmd = (struct scsi_read_capacity_16 *)&csio->cdb_io.cdb_bytes; + bzero(scsi_cmd, sizeof(*scsi_cmd)); + scsi_cmd->opcode = 0x9E; + scsi_cmd->service_action = SRC16_SERVICE_ACTION; + ((uint8_t *)scsi_cmd)[13] = sizeof(struct scsi_read_capacity_eedp); - ccb->ccb_h.ppriv_ptr1 = sassc; - xpt_action(ccb); - } else { - xpt_free_path(ccb->ccb_h.path); - xpt_free_ccb(ccb); - } - } while (found_periph); - } + ccb->ccb_h.ppriv_ptr1 = sassc; + xpt_action(ccb); } - static void mpssas_read_cap_done(struct cam_periph *periph, union ccb *done_ccb) { @@ -3545,6 +3436,10 @@ mpssas_read_cap_done(struct cam_periph *periph, union ccb *done_ccb) } if (rcap_buf->protect & 0x01) { + mps_dprint(sassc->sc, MPS_INFO, "LUN %d for " + "target ID %d is formatted for EEDP " + "support.\n", done_ccb->ccb_h.target_lun, + done_ccb->ccb_h.target_id); lun->eedp_formatted = TRUE; lun->eedp_block_size = scsi_4btoul(rcap_buf->length); } @@ -3556,7 +3451,8 @@ mpssas_read_cap_done(struct cam_periph *periph, union ccb *done_ccb) xpt_free_path(done_ccb->ccb_h.path); xpt_free_ccb(done_ccb); } -#endif /* __FreeBSD_version >= 1000006 */ +#endif /* (__FreeBSD_version < 901503) || \ + ((__FreeBSD_version >= 1000000) && (__FreeBSD_version < 1000006)) */ int mpssas_startup(struct mps_softc *sc) diff --git a/sys/dev/mps/mps_sas.h b/sys/dev/mps/mps_sas.h index 6857b98f06d4..662a29a0095a 100644 --- a/sys/dev/mps/mps_sas.h +++ b/sys/dev/mps/mps_sas.h @@ -87,7 +87,6 @@ struct mpssas_softc { #define MPSSAS_DISCOVERY_TIMEOUT_PENDING (1 << 2) #define MPSSAS_QUEUE_FROZEN (1 << 3) #define MPSSAS_SHUTDOWN (1 << 4) -#define MPSSAS_SCANTHREAD (1 << 5) struct mpssas_target *targets; struct cam_devq *devq; struct cam_sim *sim; @@ -101,9 +100,6 @@ struct mpssas_softc { u_int tm_count; struct proc *sysctl_proc; - TAILQ_HEAD(, ccb_hdr) ccb_scanq; - struct proc *rescan_thread; - struct taskqueue *ev_tq; struct task ev_task; TAILQ_HEAD(, mps_fw_event_work) ev_queue; diff --git a/sys/dev/mps/mps_sas_lsi.c b/sys/dev/mps/mps_sas_lsi.c index 18450ab1e99b..85d6d1fd5f10 100644 --- a/sys/dev/mps/mps_sas_lsi.c +++ b/sys/dev/mps/mps_sas_lsi.c @@ -699,7 +699,10 @@ mpssas_add_device(struct mps_softc *sc, u16 handle, u8 linkrate){ mps_dprint(sc, MPS_MAPPING, "Found device <%s> <%s> <0x%04x> <%d/%d>\n", devstring, mps_describe_table(mps_linkrate_names, targ->linkrate), targ->handle, targ->encl_handle, targ->encl_slot); + +#if __FreeBSD_version < 1000039 if ((sassc->flags & MPSSAS_IN_STARTUP) == 0) +#endif mpssas_rescan_target(sc, targ); mps_dprint(sc, MPS_MAPPING, "Target id 0x%x added\n", targ->tid); out: @@ -818,12 +821,15 @@ mpssas_get_sata_identify(struct mps_softc *sc, u16 handle, cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; cm->cm_data = buffer; cm->cm_length = htole32(sz); - error = mps_request_polled(sc, cm); + error = mps_wait_command(sc, cm, 60, CAN_SLEEP); reply = (Mpi2SataPassthroughReply_t *)cm->cm_reply; if (error || (reply == NULL)) { /* FIXME */ - /* If the poll returns error then we need to do diag reset */ - printf("%s: poll for page completed with error %d", + /* + * If the request returns an error then we need to do a diag + * reset + */ + printf("%s: request for page completed with error %d", __func__, error); error = ENXIO; goto out; @@ -955,7 +961,7 @@ mpssas_ir_shutdown(struct mps_softc *sc) action->Action = MPI2_RAID_ACTION_SYSTEM_SHUTDOWN_INITIATED; cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; mps_lock(sc); - mps_request_polled(sc, cm); + mps_wait_command(sc, cm, 5, CAN_SLEEP); mps_unlock(sc); /* diff --git a/sys/dev/mps/mps_user.c b/sys/dev/mps/mps_user.c index 9a03d8e799c6..9212f77f9c21 100644 --- a/sys/dev/mps/mps_user.c +++ b/sys/dev/mps/mps_user.c @@ -669,7 +669,7 @@ mps_user_command(struct mps_softc *sc, struct mps_usr_command *cmd) cm = mps_alloc_command(sc); if (cm == NULL) { - mps_printf(sc, "mps_user_command: no mps requests\n"); + mps_printf(sc, "%s: no mps requests\n", __func__); err = ENOMEM; goto Ret; } @@ -677,8 +677,8 @@ mps_user_command(struct mps_softc *sc, struct mps_usr_command *cmd) hdr = (MPI2_REQUEST_HEADER *)cm->cm_req; - mps_dprint(sc, MPS_USER, "mps_user_command: req %p %d rpl %p %d\n", - cmd->req, cmd->req_len, cmd->rpl, cmd->rpl_len ); + mps_dprint(sc, MPS_USER, "%s: req %p %d rpl %p %d\n", __func__, + cmd->req, cmd->req_len, cmd->rpl, cmd->rpl_len); if (cmd->req_len > (int)sc->facts->IOCRequestFrameSize * 4) { err = EINVAL; @@ -688,8 +688,8 @@ mps_user_command(struct mps_softc *sc, struct mps_usr_command *cmd) if (err != 0) goto RetFreeUnlocked; - mps_dprint(sc, MPS_USER, "mps_user_command: Function %02X " - "MsgFlags %02X\n", hdr->Function, hdr->MsgFlags ); + mps_dprint(sc, MPS_USER, "%s: Function %02X MsgFlags %02X\n", __func__, + hdr->Function, hdr->MsgFlags); if (cmd->len > 0) { buf = malloc(cmd->len, M_MPSUSER, M_WAITOK|M_ZERO); @@ -709,14 +709,16 @@ mps_user_command(struct mps_softc *sc, struct mps_usr_command *cmd) cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; err = mps_user_setup_request(cm, cmd); - if (err != 0) { - mps_printf(sc, "mps_user_command: unsupported function 0x%X\n", - hdr->Function ); - goto RetFreeUnlocked; + if (err == EINVAL) { + mps_printf(sc, "%s: unsupported parameter or unsupported " + "function in request (function = 0x%X)\n", __func__, + hdr->Function); } + if (err != 0) + goto RetFreeUnlocked; mps_lock(sc); - err = mps_wait_command(sc, cm, 60); + err = mps_wait_command(sc, cm, 60, CAN_SLEEP); if (err) { mps_printf(sc, "%s: invalid request: error %d\n", @@ -731,10 +733,8 @@ mps_user_command(struct mps_softc *sc, struct mps_usr_command *cmd) sz = 0; if (sz > cmd->rpl_len) { - mps_printf(sc, - "mps_user_command: reply buffer too small %d required %d\n", - cmd->rpl_len, sz ); - err = EINVAL; + mps_printf(sc, "%s: user reply buffer (%d) smaller than " + "returned buffer (%d)\n", __func__, cmd->rpl_len, sz); sz = cmd->rpl_len; } @@ -742,7 +742,7 @@ mps_user_command(struct mps_softc *sc, struct mps_usr_command *cmd) copyout(rpl, cmd->rpl, sz); if (buf != NULL) copyout(buf, cmd->buf, cmd->len); - mps_dprint(sc, MPS_USER, "mps_user_command: reply size %d\n", sz ); + mps_dprint(sc, MPS_USER, "%s: reply size %d\n", __func__, sz); RetFreeUnlocked: mps_lock(sc); @@ -849,7 +849,7 @@ mps_user_pass_thru(struct mps_softc *sc, mps_pass_thru_t *data) cm->cm_complete = NULL; cm->cm_complete_data = NULL; - err = mps_wait_command(sc, cm, 30); + err = mps_wait_command(sc, cm, 30, CAN_SLEEP); if (err != 0) { err = EIO; @@ -864,15 +864,14 @@ mps_user_pass_thru(struct mps_softc *sc, mps_pass_thru_t *data) sz = rpl->MsgLength * 4; if (sz > data->ReplySize) { - mps_printf(sc, "%s: reply buffer too small: %d, " - "required: %d\n", __func__, data->ReplySize, sz); - err = EINVAL; - } else { - mps_unlock(sc); - copyout(cm->cm_reply, PTRIN(data->PtrReply), - data->ReplySize); - mps_lock(sc); + mps_printf(sc, "%s: user reply buffer (%d) " + "smaller than returned buffer (%d)\n", + __func__, data->ReplySize, sz); } + mps_unlock(sc); + copyout(cm->cm_reply, PTRIN(data->PtrReply), + data->ReplySize); + mps_lock(sc); } mpssas_free_tm(sc, cm); goto Ret; @@ -986,7 +985,7 @@ mps_user_pass_thru(struct mps_softc *sc, mps_pass_thru_t *data) mps_lock(sc); - err = mps_wait_command(sc, cm, 30); + err = mps_wait_command(sc, cm, 30, CAN_SLEEP); if (err) { mps_printf(sc, "%s: invalid request: error %d\n", __func__, @@ -1025,15 +1024,13 @@ mps_user_pass_thru(struct mps_softc *sc, mps_pass_thru_t *data) sz = rpl->MsgLength * 4; if (sz > data->ReplySize) { - mps_printf(sc, "%s: reply buffer too small: %d, " - "required: %d\n", __func__, data->ReplySize, sz); - err = EINVAL; - } else { - mps_unlock(sc); - copyout(cm->cm_reply, PTRIN(data->PtrReply), - data->ReplySize); - mps_lock(sc); + mps_printf(sc, "%s: user reply buffer (%d) smaller " + "than returned buffer (%d)\n", __func__, + data->ReplySize, sz); } + mps_unlock(sc); + copyout(cm->cm_reply, PTRIN(data->PtrReply), data->ReplySize); + mps_lock(sc); if ((function == MPI2_FUNCTION_SCSI_IO_REQUEST) || (function == MPI2_FUNCTION_RAID_SCSI_IO_PASSTHROUGH)) { @@ -1203,7 +1200,7 @@ mps_post_fw_diag_buffer(struct mps_softc *sc, /* * Send command synchronously. */ - status = mps_wait_command(sc, cm, 30); + status = mps_wait_command(sc, cm, 30, CAN_SLEEP); if (status) { mps_printf(sc, "%s: invalid request: error %d\n", __func__, status); @@ -1252,8 +1249,8 @@ mps_release_fw_diag_buffer(struct mps_softc *sc, */ *return_code = MPS_FW_DIAG_ERROR_RELEASE_FAILED; if (!pBuffer->enabled) { - mps_dprint(sc, MPS_USER, "%s: This buffer type is not supported " - "by the IOC", __func__); + mps_dprint(sc, MPS_USER, "%s: This buffer type is not " + "supported by the IOC", __func__); return (MPS_DIAG_FAILURE); } @@ -1287,7 +1284,7 @@ mps_release_fw_diag_buffer(struct mps_softc *sc, /* * Send command synchronously. */ - status = mps_wait_command(sc, cm, 30); + status = mps_wait_command(sc, cm, 30, CAN_SLEEP); if (status) { mps_printf(sc, "%s: invalid request: error %d\n", __func__, status); diff --git a/sys/dev/mps/mpsvar.h b/sys/dev/mps/mpsvar.h index c30ee2c4e709..5f8a015d8f2d 100644 --- a/sys/dev/mps/mpsvar.h +++ b/sys/dev/mps/mpsvar.h @@ -32,7 +32,7 @@ #ifndef _MPSVAR_H #define _MPSVAR_H -#define MPS_DRIVER_VERSION "14.00.00.02-fbsd" +#define MPS_DRIVER_VERSION "16.00.00.00-fbsd" #define MPS_DB_MAX_WAIT 2500 @@ -304,7 +304,6 @@ struct mps_softc { bus_dma_tag_t buffer_dmat; MPI2_IOC_FACTS_REPLY *facts; - MPI2_PORT_FACTS_REPLY *pfacts; int num_reqs; int num_replies; int fqdepth; /* Free queue */ @@ -695,7 +694,8 @@ void mpssas_record_event(struct mps_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event_reply); int mps_map_command(struct mps_softc *sc, struct mps_command *cm); -int mps_wait_command(struct mps_softc *sc, struct mps_command *cm, int timeout); +int mps_wait_command(struct mps_softc *sc, struct mps_command *cm, int timeout, + int sleep_flag); int mps_request_polled(struct mps_softc *sc, struct mps_command *cm); int mps_config_get_bios_pg3(struct mps_softc *sc, Mpi2ConfigReply_t diff --git a/sys/dev/nvd/nvd.c b/sys/dev/nvd/nvd.c index 868a238301dc..b2e880b5c5c2 100644 --- a/sys/dev/nvd/nvd.c +++ b/sys/dev/nvd/nvd.c @@ -40,6 +40,8 @@ __FBSDID("$FreeBSD$"); #include <dev/nvme/nvme.h> +#define NVD_STR "nvd" + struct nvd_disk; static disk_ioctl_t nvd_ioctl; @@ -102,7 +104,7 @@ static int nvd_modevent(module_t mod, int type, void *arg) } moduledata_t nvd_mod = { - "nvd", + NVD_STR, (modeventhand_t)nvd_modevent, 0 }; @@ -271,6 +273,7 @@ nvd_new_controller(struct nvme_controller *ctrlr) static void * nvd_new_disk(struct nvme_namespace *ns, void *ctrlr_arg) { + uint8_t descr[NVME_MODEL_NUMBER_LENGTH+1]; struct nvd_disk *ndisk; struct disk *disk; struct nvd_controller *ctrlr = ctrlr_arg; @@ -280,7 +283,7 @@ nvd_new_disk(struct nvme_namespace *ns, void *ctrlr_arg) disk = disk_alloc(); disk->d_strategy = nvd_strategy; disk->d_ioctl = nvd_ioctl; - disk->d_name = "nvd"; + disk->d_name = NVD_STR; disk->d_drv1 = ndisk; disk->d_maxsize = nvme_ns_get_max_io_xfer_size(ns); @@ -310,16 +313,16 @@ nvd_new_disk(struct nvme_namespace *ns, void *ctrlr_arg) * d_ident and d_descr are both far bigger than the length of either * the serial or model number strings. */ - strlcpy(disk->d_ident, nvme_ns_get_serial_number(ns), - min(sizeof(disk->d_ident), NVME_SERIAL_NUMBER_LENGTH)); + nvme_strvis(disk->d_ident, nvme_ns_get_serial_number(ns), + sizeof(disk->d_ident), NVME_SERIAL_NUMBER_LENGTH); + + nvme_strvis(descr, nvme_ns_get_model_number(ns), sizeof(descr), + NVME_MODEL_NUMBER_LENGTH); #if __FreeBSD_version >= 900034 - strlcpy(disk->d_descr, nvme_ns_get_model_number(ns), - min(sizeof(disk->d_descr), NVME_MODEL_NUMBER_LENGTH)); + strlcpy(disk->d_descr, descr, sizeof(descr)); #endif - disk_create(disk, DISK_VERSION); - ndisk->ns = ns; ndisk->disk = disk; ndisk->cur_depth = 0; @@ -335,15 +338,29 @@ nvd_new_disk(struct nvme_namespace *ns, void *ctrlr_arg) TAILQ_INSERT_TAIL(&disk_head, ndisk, global_tailq); TAILQ_INSERT_TAIL(&ctrlr->disk_head, ndisk, ctrlr_tailq); + disk_create(disk, DISK_VERSION); + + printf(NVD_STR"%u: <%s> NVMe namespace\n", disk->d_unit, descr); + printf(NVD_STR"%u: %juMB (%ju %u byte sectors)\n", disk->d_unit, + (uintmax_t)disk->d_mediasize / (1024*1024), + (uintmax_t)disk->d_mediasize / disk->d_sectorsize, + disk->d_sectorsize); + return (NULL); } static void destroy_geom_disk(struct nvd_disk *ndisk) { - struct bio *bp; + struct bio *bp; + struct disk *disk; + uint32_t unit; + int cnt = 0; + disk = ndisk->disk; + unit = disk->d_unit; taskqueue_free(ndisk->tq); + disk_destroy(ndisk->disk); mtx_lock(&ndisk->bioqlock); @@ -354,9 +371,13 @@ destroy_geom_disk(struct nvd_disk *ndisk) bp->bio_error = EIO; bp->bio_flags |= BIO_ERROR; bp->bio_resid = bp->bio_bcount; - + cnt++; biodone(bp); } + + printf(NVD_STR"%u: lost device - %d outstanding\n", unit, cnt); + printf(NVD_STR"%u: removing device entry\n", unit); + mtx_unlock(&ndisk->bioqlock); mtx_destroy(&ndisk->bioqlock); diff --git a/sys/dev/nvme/nvme.c b/sys/dev/nvme/nvme.c index 65bb05e14ca4..eacd0cc49974 100644 --- a/sys/dev/nvme/nvme.c +++ b/sys/dev/nvme/nvme.c @@ -383,4 +383,3 @@ nvme_completion_poll_cb(void *arg, const struct nvme_completion *cpl) wmb(); status->done = TRUE; } - diff --git a/sys/dev/nvme/nvme.h b/sys/dev/nvme/nvme.h index f30505a7bc8f..9df75da046b7 100644 --- a/sys/dev/nvme/nvme.h +++ b/sys/dev/nvme/nvme.h @@ -404,10 +404,10 @@ struct nvme_controller_data { uint16_t ssvid; /** serial number */ - int8_t sn[NVME_SERIAL_NUMBER_LENGTH]; + uint8_t sn[NVME_SERIAL_NUMBER_LENGTH]; /** model number */ - int8_t mn[NVME_MODEL_NUMBER_LENGTH]; + uint8_t mn[NVME_MODEL_NUMBER_LENGTH]; /** firmware revision */ uint8_t fr[NVME_FIRMWARE_REVISION_LENGTH]; @@ -786,6 +786,8 @@ struct nvme_pt_command { #define nvme_completion_is_error(cpl) \ ((cpl)->status.sc != 0 || (cpl)->status.sct != 0) +void nvme_strvis(uint8_t *dst, const uint8_t *src, int dstlen, int srclen); + #ifdef _KERNEL struct bio; diff --git a/sys/dev/nvme/nvme_ns.c b/sys/dev/nvme/nvme_ns.c index 4658c7495ec3..fb31852bec35 100644 --- a/sys/dev/nvme/nvme_ns.c +++ b/sys/dev/nvme/nvme_ns.c @@ -155,7 +155,7 @@ nvme_ns_get_max_io_xfer_size(struct nvme_namespace *ns) uint32_t nvme_ns_get_sector_size(struct nvme_namespace *ns) { - return (1 << ns->data.lbaf[0].lbads); + return (1 << ns->data.lbaf[ns->data.flbas.format].lbads); } uint64_t @@ -310,6 +310,16 @@ nvme_ns_construct(struct nvme_namespace *ns, uint16_t id, } #endif + /* + * Note: format is a 0-based value, so > is appropriate here, + * not >=. + */ + if (ns->data.flbas.format > ns->data.nlbaf) { + printf("lba format %d exceeds number supported (%d)\n", + ns->data.flbas.format, ns->data.nlbaf+1); + return (1); + } + if (ctrlr->cdata.oncs.dsm) ns->flags |= NVME_NS_DEALLOCATE_SUPPORTED; diff --git a/sys/dev/nvme/nvme_ns_cmd.c b/sys/dev/nvme/nvme_ns_cmd.c index 50ec120d0721..b5c45dcbedf5 100644 --- a/sys/dev/nvme/nvme_ns_cmd.c +++ b/sys/dev/nvme/nvme_ns_cmd.c @@ -36,7 +36,8 @@ nvme_ns_cmd_read(struct nvme_namespace *ns, void *payload, uint64_t lba, struct nvme_request *req; struct nvme_command *cmd; - req = nvme_allocate_request_vaddr(payload, lba_count*512, cb_fn, cb_arg); + req = nvme_allocate_request_vaddr(payload, + lba_count*nvme_ns_get_sector_size(ns), cb_fn, cb_arg); if (req == NULL) return (ENOMEM); @@ -89,8 +90,8 @@ nvme_ns_cmd_write(struct nvme_namespace *ns, void *payload, uint64_t lba, struct nvme_request *req; struct nvme_command *cmd; - req = nvme_allocate_request_vaddr(payload, lba_count*512, cb_fn, - cb_arg); + req = nvme_allocate_request_vaddr(payload, + lba_count*nvme_ns_get_sector_size(ns), cb_fn, cb_arg); if (req == NULL) return (ENOMEM); diff --git a/sys/dev/nvme/nvme_util.c b/sys/dev/nvme/nvme_util.c new file mode 100644 index 000000000000..6d7084167a75 --- /dev/null +++ b/sys/dev/nvme/nvme_util.c @@ -0,0 +1,61 @@ +/*- + * Copyright (C) 2013 Intel Corporation + * Copyright (C) 1997 Justin T. Gibbs + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); + +#include <sys/param.h> +#include <dev/nvme/nvme.h> + +void +nvme_strvis(uint8_t *dst, const uint8_t *src, int dstlen, int srclen) +{ + uint8_t *cur_pos; + + /* Trim leading/trailing spaces, nulls. */ + while (srclen > 0 && src[0] == ' ') + src++, srclen--; + while (srclen > 0 + && (src[srclen - 1] == ' ' || src[srclen - 1] == '\0')) + srclen--; + + while (srclen > 0 && dstlen > 1) { + cur_pos = dst; + + /* Show '?' for non-printable characters. */ + if (*src < 0x20 || *src >= 0x7F) + *cur_pos++ = '?'; + else + *cur_pos++ = *src; + src++; + srclen--; + dstlen -= cur_pos - dst; + dst = cur_pos; + } + *dst = '\0'; +} + diff --git a/sys/dev/sound/pci/ds1.c b/sys/dev/sound/pci/ds1.c index d5107179aa64..16626b50e631 100644 --- a/sys/dev/sound/pci/ds1.c +++ b/sys/dev/sound/pci/ds1.c @@ -365,7 +365,7 @@ ds_allocpslot(struct sc_info *sc) } static int -ds_initpbank(volatile struct pbank *pb, int ch, int b16, int stereo, u_int32_t rate, bus_addr_t base, u_int32_t len) +ds_initpbank(volatile struct pbank *pb, int ch, int stereo, int b16, u_int32_t rate, bus_addr_t base, u_int32_t len) { u_int32_t lv[] = {1, 1, 0, 0, 0}; u_int32_t rv[] = {1, 0, 1, 0, 0}; diff --git a/sys/dev/uart/uart_bus_pci.c b/sys/dev/uart/uart_bus_pci.c index 062c3790c068..6419ebb89216 100644 --- a/sys/dev/uart/uart_bus_pci.c +++ b/sys/dev/uart/uart_bus_pci.c @@ -162,6 +162,7 @@ uart_pci_probe(device_t dev) { struct uart_softc *sc; const struct pci_id *id; + int result; sc = device_get_softc(dev); @@ -174,9 +175,14 @@ uart_pci_probe(device_t dev) return (ENXIO); match: + result = uart_bus_probe(dev, 0, id->rclk, id->rid, 0); + /* Bail out on error. */ + if (result > 0) + return (result); + /* Set/override the device description. */ if (id->desc) device_set_desc(dev, id->desc); - return (uart_bus_probe(dev, 0, id->rclk, id->rid, 0)); + return (result); } DRIVER_MODULE(uart, pci, uart_pci_driver, uart_devclass, NULL, NULL); diff --git a/sys/dev/usb/controller/xhci.c b/sys/dev/usb/controller/xhci.c index d25aa34503b9..6c9a6101f64c 100644 --- a/sys/dev/usb/controller/xhci.c +++ b/sys/dev/usb/controller/xhci.c @@ -1682,7 +1682,6 @@ restart: /* fill out buffer pointers */ if (average == 0) { - npkt = 0; memset(&buf_res, 0, sizeof(buf_res)); } else { usbd_get_page(temp->pc, temp->offset + @@ -1697,14 +1696,16 @@ restart: buf_res.length = XHCI_TD_PAGE_SIZE; npkt_off += buf_res.length; + } - /* setup npkt */ - npkt = (len_old - npkt_off + temp->max_packet_size - 1) / - temp->max_packet_size; + /* setup npkt */ + npkt = (len_old - npkt_off + temp->max_packet_size - 1) / + temp->max_packet_size; - if (npkt > 31) - npkt = 31; - } + if (npkt == 0) + npkt = 1; + else if (npkt > 31) + npkt = 31; /* fill out TRB's */ td->td_trb[x].qwTrb0 = @@ -1719,9 +1720,7 @@ restart: switch (temp->trb_type) { case XHCI_TRB_TYPE_ISOCH: - /* BEI: Interrupts are inhibited until EOT */ dword = XHCI_TRB_3_CHAIN_BIT | XHCI_TRB_3_CYCLE_BIT | - XHCI_TRB_3_BEI_BIT | XHCI_TRB_3_TBC_SET(temp->tbc) | XHCI_TRB_3_TLBPC_SET(temp->tlbpc); if (td != td_first) { @@ -1756,10 +1755,8 @@ restart: dword |= XHCI_TRB_3_DIR_IN; break; default: /* XHCI_TRB_TYPE_NORMAL */ - /* BEI: Interrupts are inhibited until EOT */ dword = XHCI_TRB_3_CHAIN_BIT | XHCI_TRB_3_CYCLE_BIT | XHCI_TRB_3_TYPE_SET(XHCI_TRB_TYPE_NORMAL) | - XHCI_TRB_3_BEI_BIT | XHCI_TRB_3_TBC_SET(temp->tbc) | XHCI_TRB_3_TLBPC_SET(temp->tlbpc); if (temp->direction == UE_DIR_IN) @@ -1838,6 +1835,7 @@ restart: usb_pc_cpu_flush(td_first->page_cache); } + /* clear TD SIZE to zero, hence this is the last TRB */ /* remove chain bit because this is the last TRB in the chain */ td->td_trb[td->ntrb - 1].dwTrb2 &= ~htole32(XHCI_TRB_2_TDSZ_SET(15)); td->td_trb[td->ntrb - 1].dwTrb3 &= ~htole32(XHCI_TRB_3_CHAIN_BIT); diff --git a/sys/dev/usb/gadget/g_audio.c b/sys/dev/usb/gadget/g_audio.c new file mode 100644 index 000000000000..a1d23944ff16 --- /dev/null +++ b/sys/dev/usb/gadget/g_audio.c @@ -0,0 +1,613 @@ +/*- + * Copyright (c) 2010 Hans Petter Selasky. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * USB audio specs: http://www.usb.org/developers/devclass_docs/audio10.pdf + * http://www.usb.org/developers/devclass_docs/frmts10.pdf + * http://www.usb.org/developers/devclass_docs/termt10.pdf + */ + +#include <sys/param.h> +__FBSDID("$FreeBSD$"); + +#include <sys/stdint.h> +#include <sys/stddef.h> +#include <sys/queue.h> +#include <sys/systm.h> +#include <sys/kernel.h> +#include <sys/bus.h> +#include <sys/linker_set.h> +#include <sys/module.h> +#include <sys/lock.h> +#include <sys/mutex.h> +#include <sys/condvar.h> +#include <sys/sysctl.h> +#include <sys/sx.h> +#include <sys/unistd.h> +#include <sys/callout.h> +#include <sys/malloc.h> +#include <sys/priv.h> + +#include <dev/usb/usb.h> +#include <dev/usb/usb_cdc.h> +#include <dev/usb/usbdi.h> +#include <dev/usb/usbdi_util.h> +#include <dev/usb/usbhid.h> +#include "usb_if.h" + +#define USB_DEBUG_VAR g_audio_debug +#include <dev/usb/usb_debug.h> + +#include <dev/usb/gadget/g_audio.h> + +enum { + G_AUDIO_ISOC0_RD, + G_AUDIO_ISOC1_RD, + G_AUDIO_ISOC0_WR, + G_AUDIO_ISOC1_WR, + G_AUDIO_N_TRANSFER, +}; + +struct g_audio_softc { + struct mtx sc_mtx; + struct usb_callout sc_callout; + struct usb_callout sc_watchdog; + struct usb_xfer *sc_xfer[G_AUDIO_N_TRANSFER]; + + int sc_mode; + int sc_pattern_len; + int sc_throughput; + int sc_tx_interval; + int sc_state; + int sc_noise_rem; + + int8_t sc_pattern[G_AUDIO_MAX_STRLEN]; + + uint16_t sc_data_len[2][G_AUDIO_FRAMES]; + + int16_t sc_data_buf[2][G_AUDIO_BUFSIZE / 2]; + + uint8_t sc_volume_setting[32]; + uint8_t sc_volume_limit[32]; + uint8_t sc_sample_rate[32]; +}; + +static SYSCTL_NODE(_hw_usb, OID_AUTO, g_audio, CTLFLAG_RW, 0, "USB audio gadget"); + +#ifdef USB_DEBUG +static int g_audio_debug = 0; + +SYSCTL_INT(_hw_usb_g_audio, OID_AUTO, debug, CTLFLAG_RW, + &g_audio_debug, 0, "Debug level"); +#endif + +static int g_audio_mode = 0; + +SYSCTL_INT(_hw_usb_g_audio, OID_AUTO, mode, CTLFLAG_RW, + &g_audio_mode, 0, "Mode selection"); + +static int g_audio_pattern_interval = 1000; + +SYSCTL_INT(_hw_usb_g_audio, OID_AUTO, pattern_interval, CTLFLAG_RW, + &g_audio_pattern_interval, 0, "Pattern interval in milliseconds"); + +static char g_audio_pattern_data[G_AUDIO_MAX_STRLEN]; + +SYSCTL_STRING(_hw_usb_g_audio, OID_AUTO, pattern, CTLFLAG_RW, + &g_audio_pattern_data, sizeof(g_audio_pattern_data), "Data pattern"); + +static int g_audio_throughput; + +SYSCTL_INT(_hw_usb_g_audio, OID_AUTO, throughput, CTLFLAG_RD, + &g_audio_throughput, sizeof(g_audio_throughput), "Throughput in bytes per second"); + +static device_probe_t g_audio_probe; +static device_attach_t g_audio_attach; +static device_detach_t g_audio_detach; +static usb_handle_request_t g_audio_handle_request; + +static usb_callback_t g_audio_isoc_read_callback; +static usb_callback_t g_audio_isoc_write_callback; + +static devclass_t g_audio_devclass; + +static void g_audio_watchdog(void *arg); +static void g_audio_timeout(void *arg); + +static device_method_t g_audio_methods[] = { + /* USB interface */ + DEVMETHOD(usb_handle_request, g_audio_handle_request), + + /* Device interface */ + DEVMETHOD(device_probe, g_audio_probe), + DEVMETHOD(device_attach, g_audio_attach), + DEVMETHOD(device_detach, g_audio_detach), + + DEVMETHOD_END +}; + +static driver_t g_audio_driver = { + .name = "g_audio", + .methods = g_audio_methods, + .size = sizeof(struct g_audio_softc), +}; + +DRIVER_MODULE(g_audio, uhub, g_audio_driver, g_audio_devclass, 0, 0); +MODULE_DEPEND(g_audio, usb, 1, 1, 1); + +static const struct usb_config g_audio_config[G_AUDIO_N_TRANSFER] = { + + [G_AUDIO_ISOC0_RD] = { + .type = UE_ISOCHRONOUS, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_RX, + .flags = {.ext_buffer = 1,.pipe_bof = 1,.short_xfer_ok = 1,}, + .bufsize = G_AUDIO_BUFSIZE, + .callback = &g_audio_isoc_read_callback, + .frames = G_AUDIO_FRAMES, + .usb_mode = USB_MODE_DEVICE, + .if_index = 1, + }, + + [G_AUDIO_ISOC1_RD] = { + .type = UE_ISOCHRONOUS, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_RX, + .flags = {.ext_buffer = 1,.pipe_bof = 1,.short_xfer_ok = 1,}, + .bufsize = G_AUDIO_BUFSIZE, + .callback = &g_audio_isoc_read_callback, + .frames = G_AUDIO_FRAMES, + .usb_mode = USB_MODE_DEVICE, + .if_index = 1, + }, + + [G_AUDIO_ISOC0_WR] = { + .type = UE_ISOCHRONOUS, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_TX, + .flags = {.ext_buffer = 1,.pipe_bof = 1,}, + .bufsize = G_AUDIO_BUFSIZE, + .callback = &g_audio_isoc_write_callback, + .frames = G_AUDIO_FRAMES, + .usb_mode = USB_MODE_DEVICE, + .if_index = 2, + }, + + [G_AUDIO_ISOC1_WR] = { + .type = UE_ISOCHRONOUS, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_TX, + .flags = {.ext_buffer = 1,.pipe_bof = 1,}, + .bufsize = G_AUDIO_BUFSIZE, + .callback = &g_audio_isoc_write_callback, + .frames = G_AUDIO_FRAMES, + .usb_mode = USB_MODE_DEVICE, + .if_index = 2, + }, +}; + +static void +g_audio_timeout_reset(struct g_audio_softc *sc) +{ + int i = g_audio_pattern_interval; + + sc->sc_tx_interval = i; + + if (i <= 0) + i = 1; + else if (i > 1023) + i = 1023; + + i = USB_MS_TO_TICKS(i); + + usb_callout_reset(&sc->sc_callout, i, &g_audio_timeout, sc); +} + +static void +g_audio_timeout(void *arg) +{ + struct g_audio_softc *sc = arg; + + sc->sc_mode = g_audio_mode; + + memcpy(sc->sc_pattern, g_audio_pattern_data, sizeof(sc->sc_pattern)); + + sc->sc_pattern[G_AUDIO_MAX_STRLEN - 1] = 0; + + sc->sc_pattern_len = strlen(sc->sc_pattern); + + if (sc->sc_mode != G_AUDIO_MODE_LOOP) { + usbd_transfer_start(sc->sc_xfer[G_AUDIO_ISOC0_WR]); + usbd_transfer_start(sc->sc_xfer[G_AUDIO_ISOC1_WR]); + } + g_audio_timeout_reset(sc); +} + +static void +g_audio_watchdog_reset(struct g_audio_softc *sc) +{ + usb_callout_reset(&sc->sc_watchdog, hz, &g_audio_watchdog, sc); +} + +static void +g_audio_watchdog(void *arg) +{ + struct g_audio_softc *sc = arg; + int i; + + i = sc->sc_throughput; + + sc->sc_throughput = 0; + + g_audio_throughput = i; + + g_audio_watchdog_reset(sc); +} + +static int +g_audio_probe(device_t dev) +{ + struct usb_attach_arg *uaa = device_get_ivars(dev); + + DPRINTFN(11, "\n"); + + if (uaa->usb_mode != USB_MODE_DEVICE) + return (ENXIO); + + if ((uaa->info.bInterfaceClass == UICLASS_AUDIO) && + (uaa->info.bInterfaceSubClass == UISUBCLASS_AUDIOCONTROL)) + return (0); + + return (ENXIO); +} + +static int +g_audio_attach(device_t dev) +{ + struct g_audio_softc *sc = device_get_softc(dev); + struct usb_attach_arg *uaa = device_get_ivars(dev); + int error; + int i; + uint8_t iface_index[3]; + + DPRINTFN(11, "\n"); + + device_set_usb_desc(dev); + + mtx_init(&sc->sc_mtx, "g_audio", NULL, MTX_DEF); + + usb_callout_init_mtx(&sc->sc_callout, &sc->sc_mtx, 0); + usb_callout_init_mtx(&sc->sc_watchdog, &sc->sc_mtx, 0); + + sc->sc_mode = G_AUDIO_MODE_SILENT; + + sc->sc_noise_rem = 1; + + for (i = 0; i != G_AUDIO_FRAMES; i++) { + sc->sc_data_len[0][i] = G_AUDIO_BUFSIZE / G_AUDIO_FRAMES; + sc->sc_data_len[1][i] = G_AUDIO_BUFSIZE / G_AUDIO_FRAMES; + } + + iface_index[0] = uaa->info.bIfaceIndex; + iface_index[1] = uaa->info.bIfaceIndex + 1; + iface_index[2] = uaa->info.bIfaceIndex + 2; + + error = usbd_set_alt_interface_index(uaa->device, iface_index[1], 1); + if (error) { + DPRINTF("alt iface setting error=%s\n", usbd_errstr(error)); + goto detach; + } + error = usbd_set_alt_interface_index(uaa->device, iface_index[2], 1); + if (error) { + DPRINTF("alt iface setting error=%s\n", usbd_errstr(error)); + goto detach; + } + error = usbd_transfer_setup(uaa->device, + iface_index, sc->sc_xfer, g_audio_config, + G_AUDIO_N_TRANSFER, sc, &sc->sc_mtx); + + if (error) { + DPRINTF("error=%s\n", usbd_errstr(error)); + goto detach; + } + usbd_set_parent_iface(uaa->device, iface_index[1], iface_index[0]); + usbd_set_parent_iface(uaa->device, iface_index[2], iface_index[0]); + + mtx_lock(&sc->sc_mtx); + + usbd_transfer_start(sc->sc_xfer[G_AUDIO_ISOC0_RD]); + usbd_transfer_start(sc->sc_xfer[G_AUDIO_ISOC1_RD]); + + usbd_transfer_start(sc->sc_xfer[G_AUDIO_ISOC0_WR]); + usbd_transfer_start(sc->sc_xfer[G_AUDIO_ISOC1_WR]); + + g_audio_timeout_reset(sc); + + g_audio_watchdog_reset(sc); + + mtx_unlock(&sc->sc_mtx); + + return (0); /* success */ + +detach: + g_audio_detach(dev); + + return (ENXIO); /* error */ +} + +static int +g_audio_detach(device_t dev) +{ + struct g_audio_softc *sc = device_get_softc(dev); + + DPRINTF("\n"); + + mtx_lock(&sc->sc_mtx); + usb_callout_stop(&sc->sc_callout); + usb_callout_stop(&sc->sc_watchdog); + mtx_unlock(&sc->sc_mtx); + + usbd_transfer_unsetup(sc->sc_xfer, G_AUDIO_N_TRANSFER); + + usb_callout_drain(&sc->sc_callout); + usb_callout_drain(&sc->sc_watchdog); + + mtx_destroy(&sc->sc_mtx); + + return (0); +} + + +static int32_t +g_noise(struct g_audio_softc *sc) +{ + uint32_t temp; + const uint32_t prime = 0xFFFF1D; + + if (sc->sc_noise_rem & 1) { + sc->sc_noise_rem += prime; + } + sc->sc_noise_rem /= 2; + + temp = sc->sc_noise_rem; + + /* unsigned to signed conversion */ + + temp ^= 0x800000; + if (temp & 0x800000) { + temp |= (-0x800000); + } + return temp; +} + +static void +g_audio_make_samples(struct g_audio_softc *sc, int16_t *ptr, int samples) +{ + int i; + int j; + + for (i = 0; i != samples; i++) { + + j = g_noise(sc); + + if ((sc->sc_state < 0) || (sc->sc_state >= sc->sc_pattern_len)) + sc->sc_state = 0; + + if (sc->sc_pattern_len != 0) { + j = (j * sc->sc_pattern[sc->sc_state]) >> 16; + sc->sc_state++; + } + *ptr++ = j / 256; + *ptr++ = j / 256; + } +} + +static void +g_audio_isoc_write_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct g_audio_softc *sc = usbd_xfer_softc(xfer); + int actlen; + int aframes; + int nr = (xfer == sc->sc_xfer[G_AUDIO_ISOC0_WR]) ? 0 : 1; + int16_t *ptr; + int i; + + usbd_xfer_status(xfer, &actlen, NULL, &aframes, NULL); + + DPRINTF("st=%d aframes=%d actlen=%d bytes\n", + USB_GET_STATE(xfer), aframes, actlen); + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + + sc->sc_throughput += actlen; + + if (sc->sc_mode == G_AUDIO_MODE_LOOP) + break; /* sync with RX */ + + case USB_ST_SETUP: +tr_setup: + + ptr = sc->sc_data_buf[nr]; + + if (sc->sc_mode == G_AUDIO_MODE_PATTERN) { + + for (i = 0; i != G_AUDIO_FRAMES; i++) { + + usbd_xfer_set_frame_data(xfer, i, ptr, sc->sc_data_len[nr][i]); + + g_audio_make_samples(sc, ptr, (G_AUDIO_BUFSIZE / G_AUDIO_FRAMES) / 2); + + ptr += (G_AUDIO_BUFSIZE / G_AUDIO_FRAMES) / 2; + } + } else if (sc->sc_mode == G_AUDIO_MODE_LOOP) { + + for (i = 0; i != G_AUDIO_FRAMES; i++) { + + usbd_xfer_set_frame_data(xfer, i, ptr, sc->sc_data_len[nr][i] & ~3); + + g_audio_make_samples(sc, ptr, sc->sc_data_len[nr][i] / 4); + + ptr += (G_AUDIO_BUFSIZE / G_AUDIO_FRAMES) / 2; + } + } + break; + + default: /* Error */ + DPRINTF("error=%s\n", usbd_errstr(error)); + + if (error != USB_ERR_CANCELLED) { + /* try to clear stall first */ + usbd_xfer_set_stall(xfer); + goto tr_setup; + } + break; + } +} + +static void +g_audio_isoc_read_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct g_audio_softc *sc = usbd_xfer_softc(xfer); + int actlen; + int aframes; + int nr = (xfer == sc->sc_xfer[G_AUDIO_ISOC0_RD]) ? 0 : 1; + int16_t *ptr; + int i; + + usbd_xfer_status(xfer, &actlen, NULL, &aframes, NULL); + + DPRINTF("st=%d aframes=%d actlen=%d bytes\n", + USB_GET_STATE(xfer), aframes, actlen); + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + + sc->sc_throughput += actlen; + + for (i = 0; i != G_AUDIO_FRAMES; i++) { + sc->sc_data_len[nr][i] = usbd_xfer_frame_len(xfer, i); + } + + usbd_transfer_start(sc->sc_xfer[G_AUDIO_ISOC0_WR]); + usbd_transfer_start(sc->sc_xfer[G_AUDIO_ISOC1_WR]); + + break; + + case USB_ST_SETUP: +tr_setup: + ptr = sc->sc_data_buf[nr]; + + for (i = 0; i != G_AUDIO_FRAMES; i++) { + + usbd_xfer_set_frame_data(xfer, i, ptr, + G_AUDIO_BUFSIZE / G_AUDIO_FRAMES); + + ptr += (G_AUDIO_BUFSIZE / G_AUDIO_FRAMES) / 2; + } + + usbd_transfer_submit(xfer); + break; + + default: /* Error */ + DPRINTF("error=%s\n", usbd_errstr(error)); + + if (error != USB_ERR_CANCELLED) { + /* try to clear stall first */ + usbd_xfer_set_stall(xfer); + goto tr_setup; + } + break; + } +} + + +static int +g_audio_handle_request(device_t dev, + const void *preq, void **pptr, uint16_t *plen, + uint16_t offset, uint8_t *pstate) +{ + struct g_audio_softc *sc = device_get_softc(dev); + const struct usb_device_request *req = preq; + uint8_t is_complete = *pstate; + + if (!is_complete) { + if ((req->bmRequestType == UT_READ_CLASS_INTERFACE) && + (req->bRequest == 0x82 /* get min */ )) { + + if (offset == 0) { + USETW(sc->sc_volume_limit, 0); + *plen = 2; + *pptr = &sc->sc_volume_limit; + } else { + *plen = 0; + } + return (0); + } else if ((req->bmRequestType == UT_READ_CLASS_INTERFACE) && + (req->bRequest == 0x83 /* get max */ )) { + + if (offset == 0) { + USETW(sc->sc_volume_limit, 0x2000); + *plen = 2; + *pptr = &sc->sc_volume_limit; + } else { + *plen = 0; + } + return (0); + } else if ((req->bmRequestType == UT_READ_CLASS_INTERFACE) && + (req->bRequest == 0x84 /* get residue */ )) { + + if (offset == 0) { + USETW(sc->sc_volume_limit, 0); + *plen = 2; + *pptr = &sc->sc_volume_limit; + } else { + *plen = 0; + } + return (0); + } else if ((req->bmRequestType == UT_WRITE_CLASS_INTERFACE) && + (req->bRequest == 0x01 /* set value */ )) { + + if (offset == 0) { + *plen = sizeof(sc->sc_volume_setting); + *pptr = &sc->sc_volume_setting; + } else { + *plen = 0; + } + return (0); + } else if ((req->bmRequestType == UT_WRITE_CLASS_ENDPOINT) && + (req->bRequest == 0x01 /* set value */ )) { + + if (offset == 0) { + *plen = sizeof(sc->sc_sample_rate); + *pptr = &sc->sc_sample_rate; + } else { + *plen = 0; + } + return (0); + } + } + return (ENXIO); /* use builtin handler */ +} diff --git a/sys/dev/usb/gadget/g_audio.h b/sys/dev/usb/gadget/g_audio.h new file mode 100644 index 000000000000..530e0c46dc37 --- /dev/null +++ b/sys/dev/usb/gadget/g_audio.h @@ -0,0 +1,40 @@ +/* $FreeBSD$ */ +/*- + * Copyright (c) 2010 Hans Petter Selasky. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _G_AUDIO_H_ +#define _G_AUDIO_H_ + +#define G_AUDIO_MAX_STRLEN 32 /* chars */ +#define G_AUDIO_FRAMES 8 +#define G_AUDIO_BUFSIZE (G_AUDIO_FRAMES * 2 * 2 * 48) /* units */ + +#define G_AUDIO_MODE_SILENT 0 +#define G_AUDIO_MODE_DUMP 1 +#define G_AUDIO_MODE_LOOP 2 +#define G_AUDIO_MODE_PATTERN 3 +#define G_AUDIO_MODE_MAX 4 + +#endif /* _G_AUDIO_H_ */ diff --git a/sys/dev/usb/gadget/g_keyboard.c b/sys/dev/usb/gadget/g_keyboard.c new file mode 100644 index 000000000000..465a34ce34ce --- /dev/null +++ b/sys/dev/usb/gadget/g_keyboard.c @@ -0,0 +1,411 @@ +/*- + * Copyright (c) 2010 Hans Petter Selasky. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * HID spec: http://www.usb.org/developers/devclass_docs/HID1_11.pdf + */ + +#include <sys/param.h> +__FBSDID("$FreeBSD$"); + +#include <sys/stdint.h> +#include <sys/stddef.h> +#include <sys/queue.h> +#include <sys/systm.h> +#include <sys/kernel.h> +#include <sys/bus.h> +#include <sys/linker_set.h> +#include <sys/module.h> +#include <sys/lock.h> +#include <sys/mutex.h> +#include <sys/condvar.h> +#include <sys/sysctl.h> +#include <sys/sx.h> +#include <sys/unistd.h> +#include <sys/callout.h> +#include <sys/malloc.h> +#include <sys/priv.h> + +#include <dev/usb/usb.h> +#include <dev/usb/usbdi.h> +#include <dev/usb/usbdi_util.h> +#include <dev/usb/usbhid.h> +#include "usb_if.h" + +#define USB_DEBUG_VAR g_keyboard_debug +#include <dev/usb/usb_debug.h> + +#include <dev/usb/gadget/g_keyboard.h> + +static SYSCTL_NODE(_hw_usb, OID_AUTO, g_keyboard, CTLFLAG_RW, 0, "USB keyboard gadget"); + +#ifdef USB_DEBUG +static int g_keyboard_debug = 0; + +SYSCTL_INT(_hw_usb_g_keyboard, OID_AUTO, debug, CTLFLAG_RW, + &g_keyboard_debug, 0, "Debug level"); +#endif + +static int g_keyboard_mode = 0; + +SYSCTL_INT(_hw_usb_g_keyboard, OID_AUTO, mode, CTLFLAG_RW, + &g_keyboard_mode, 0, "Mode selection"); + +static int g_keyboard_key_press_interval = 1000; + +SYSCTL_INT(_hw_usb_g_keyboard, OID_AUTO, key_press_interval, CTLFLAG_RW, + &g_keyboard_key_press_interval, 0, "Key Press Interval in milliseconds"); + +static char g_keyboard_key_press_pattern[G_KEYBOARD_MAX_STRLEN]; + +SYSCTL_STRING(_hw_usb_g_keyboard, OID_AUTO, key_press_pattern, CTLFLAG_RW, + g_keyboard_key_press_pattern, sizeof(g_keyboard_key_press_pattern), + "Key Press Patterns"); + +#define UPROTO_BOOT_KEYBOARD 1 + +#define G_KEYBOARD_NMOD 8 /* units */ +#define G_KEYBOARD_NKEYCODE 6 /* units */ + +struct g_keyboard_data { + uint8_t modifiers; +#define MOD_CONTROL_L 0x01 +#define MOD_CONTROL_R 0x10 +#define MOD_SHIFT_L 0x02 +#define MOD_SHIFT_R 0x20 +#define MOD_ALT_L 0x04 +#define MOD_ALT_R 0x40 +#define MOD_WIN_L 0x08 +#define MOD_WIN_R 0x80 + uint8_t reserved; + uint8_t keycode[G_KEYBOARD_NKEYCODE]; +}; + +enum { + G_KEYBOARD_INTR_DT, + G_KEYBOARD_N_TRANSFER, +}; + +struct g_keyboard_softc { + struct mtx sc_mtx; + struct usb_callout sc_callout; + struct g_keyboard_data sc_data[2]; + struct usb_xfer *sc_xfer[G_KEYBOARD_N_TRANSFER]; + + int sc_mode; + int sc_state; + int sc_pattern_len; + + char sc_pattern[G_KEYBOARD_MAX_STRLEN]; + + uint8_t sc_led_state[4]; +}; + +static device_probe_t g_keyboard_probe; +static device_attach_t g_keyboard_attach; +static device_detach_t g_keyboard_detach; +static usb_handle_request_t g_keyboard_handle_request; +static usb_callback_t g_keyboard_intr_callback; + +static devclass_t g_keyboard_devclass; + +static device_method_t g_keyboard_methods[] = { + /* USB interface */ + DEVMETHOD(usb_handle_request, g_keyboard_handle_request), + + /* Device interface */ + DEVMETHOD(device_probe, g_keyboard_probe), + DEVMETHOD(device_attach, g_keyboard_attach), + DEVMETHOD(device_detach, g_keyboard_detach), + + DEVMETHOD_END +}; + +static driver_t g_keyboard_driver = { + .name = "g_keyboard", + .methods = g_keyboard_methods, + .size = sizeof(struct g_keyboard_softc), +}; + +DRIVER_MODULE(g_keyboard, uhub, g_keyboard_driver, g_keyboard_devclass, 0, 0); +MODULE_DEPEND(g_keyboard, usb, 1, 1, 1); + +static const struct usb_config g_keyboard_config[G_KEYBOARD_N_TRANSFER] = { + [G_KEYBOARD_INTR_DT] = { + .type = UE_INTERRUPT, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_IN, + .flags = {.ext_buffer = 1,.pipe_bof = 1,}, + .bufsize = sizeof(struct g_keyboard_data), + .callback = &g_keyboard_intr_callback, + .frames = 2, + .usb_mode = USB_MODE_DEVICE, + }, +}; + +static void g_keyboard_timeout(void *arg); + +static void +g_keyboard_timeout_reset(struct g_keyboard_softc *sc) +{ + int i = g_keyboard_key_press_interval; + + if (i <= 0) + i = 1; + else if (i > 1023) + i = 1023; + + i = USB_MS_TO_TICKS(i); + + usb_callout_reset(&sc->sc_callout, i, &g_keyboard_timeout, sc); +} + +static void +g_keyboard_timeout(void *arg) +{ + struct g_keyboard_softc *sc = arg; + + sc->sc_mode = g_keyboard_mode; + + memcpy(sc->sc_pattern, g_keyboard_key_press_pattern, sizeof(sc->sc_pattern)); + + sc->sc_pattern[G_KEYBOARD_MAX_STRLEN - 1] = 0; + + sc->sc_pattern_len = strlen(sc->sc_pattern); + + DPRINTFN(11, "Timeout %p\n", sc->sc_xfer[G_KEYBOARD_INTR_DT]); + + usbd_transfer_start(sc->sc_xfer[G_KEYBOARD_INTR_DT]); + + g_keyboard_timeout_reset(sc); +} + +static int +g_keyboard_probe(device_t dev) +{ + struct usb_attach_arg *uaa = device_get_ivars(dev); + + DPRINTFN(11, "\n"); + + if (uaa->usb_mode != USB_MODE_DEVICE) + return (ENXIO); + + if ((uaa->info.bInterfaceClass == UICLASS_HID) && + (uaa->info.bInterfaceSubClass == UISUBCLASS_BOOT) && + (uaa->info.bInterfaceProtocol == UPROTO_BOOT_KEYBOARD)) + return (0); + + return (ENXIO); +} + +static int +g_keyboard_attach(device_t dev) +{ + struct g_keyboard_softc *sc = device_get_softc(dev); + struct usb_attach_arg *uaa = device_get_ivars(dev); + int error; + + DPRINTFN(11, "\n"); + + device_set_usb_desc(dev); + + mtx_init(&sc->sc_mtx, "g_keyboard", NULL, MTX_DEF); + + usb_callout_init_mtx(&sc->sc_callout, &sc->sc_mtx, 0); + + sc->sc_mode = G_KEYBOARD_MODE_SILENT; + + error = usbd_transfer_setup(uaa->device, + &uaa->info.bIfaceIndex, sc->sc_xfer, g_keyboard_config, + G_KEYBOARD_N_TRANSFER, sc, &sc->sc_mtx); + + if (error) { + DPRINTF("error=%s\n", usbd_errstr(error)); + goto detach; + } + mtx_lock(&sc->sc_mtx); + g_keyboard_timeout_reset(sc); + mtx_unlock(&sc->sc_mtx); + + return (0); /* success */ + +detach: + g_keyboard_detach(dev); + + return (ENXIO); /* error */ +} + +static int +g_keyboard_detach(device_t dev) +{ + struct g_keyboard_softc *sc = device_get_softc(dev); + + DPRINTF("\n"); + + mtx_lock(&sc->sc_mtx); + usb_callout_stop(&sc->sc_callout); + mtx_unlock(&sc->sc_mtx); + + usbd_transfer_unsetup(sc->sc_xfer, G_KEYBOARD_N_TRANSFER); + + usb_callout_drain(&sc->sc_callout); + + mtx_destroy(&sc->sc_mtx); + + return (0); +} + +static uint8_t +g_keyboard_get_keycode(struct g_keyboard_softc *sc, int index) +{ + int key; + int mod = sc->sc_pattern_len; + + if (mod == 0) + index = 0; + else + index %= mod; + + if ((index >= 0) && (index < sc->sc_pattern_len)) + key = sc->sc_pattern[index]; + else + key = 'a'; + + if (key >= 'a' && key <= 'z') + return (key - 'a' + 0x04); + else + return (0x04); +} + +static void +g_keyboard_intr_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct g_keyboard_softc *sc = usbd_xfer_softc(xfer); + int actlen; + int aframes; + + usbd_xfer_status(xfer, &actlen, NULL, &aframes, NULL); + + DPRINTF("st=%d aframes=%d actlen=%d bytes\n", + USB_GET_STATE(xfer), aframes, actlen); + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + break; + + case USB_ST_SETUP: +tr_setup: + if (sc->sc_mode == G_KEYBOARD_MODE_SILENT) { + memset(&sc->sc_data, 0, sizeof(sc->sc_data)); + usbd_xfer_set_frame_data(xfer, 0, &sc->sc_data[0], sizeof(sc->sc_data[0])); + usbd_xfer_set_frame_data(xfer, 1, &sc->sc_data[1], sizeof(sc->sc_data[1])); + usbd_xfer_set_frames(xfer, 2); + usbd_transfer_submit(xfer); + + } else if (sc->sc_mode == G_KEYBOARD_MODE_PATTERN) { + + memset(&sc->sc_data, 0, sizeof(sc->sc_data)); + + if ((sc->sc_state < 0) || (sc->sc_state >= G_KEYBOARD_MAX_STRLEN)) + sc->sc_state = 0; + + switch (sc->sc_state % 6) { + case 0: + sc->sc_data[0].keycode[0] = + g_keyboard_get_keycode(sc, sc->sc_state + 0); + case 1: + sc->sc_data[0].keycode[1] = + g_keyboard_get_keycode(sc, sc->sc_state + 1); + case 2: + sc->sc_data[0].keycode[2] = + g_keyboard_get_keycode(sc, sc->sc_state + 2); + case 3: + sc->sc_data[0].keycode[3] = + g_keyboard_get_keycode(sc, sc->sc_state + 3); + case 4: + sc->sc_data[0].keycode[4] = + g_keyboard_get_keycode(sc, sc->sc_state + 4); + default: + sc->sc_data[0].keycode[5] = + g_keyboard_get_keycode(sc, sc->sc_state + 5); + } + + sc->sc_state++; + + usbd_xfer_set_frame_data(xfer, 0, &sc->sc_data[0], sizeof(sc->sc_data[0])); + usbd_xfer_set_frame_data(xfer, 1, &sc->sc_data[1], sizeof(sc->sc_data[1])); + usbd_xfer_set_frames(xfer, 2); + usbd_transfer_submit(xfer); + } + break; + + default: /* Error */ + DPRINTF("error=%s\n", usbd_errstr(error)); + + if (error != USB_ERR_CANCELLED) { + /* try to clear stall first */ + usbd_xfer_set_stall(xfer); + goto tr_setup; + } + break; + } +} + +static int +g_keyboard_handle_request(device_t dev, + const void *preq, void **pptr, uint16_t *plen, + uint16_t offset, uint8_t *pstate) +{ + struct g_keyboard_softc *sc = device_get_softc(dev); + const struct usb_device_request *req = preq; + uint8_t is_complete = *pstate; + + if (!is_complete) { + if ((req->bmRequestType == UT_WRITE_CLASS_INTERFACE) && + (req->bRequest == UR_SET_REPORT) && + (req->wValue[0] == 0x00) && + (req->wValue[1] == 0x02)) { + + if (offset == 0) { + *plen = sizeof(sc->sc_led_state); + *pptr = &sc->sc_led_state; + } else { + *plen = 0; + } + return (0); + } else if ((req->bmRequestType == UT_WRITE_CLASS_INTERFACE) && + (req->bRequest == UR_SET_PROTOCOL) && + (req->wValue[0] == 0x00) && + (req->wValue[1] == 0x00)) { + *plen = 0; + return (0); + } else if ((req->bmRequestType == UT_WRITE_CLASS_INTERFACE) && + (req->bRequest == UR_SET_IDLE)) { + *plen = 0; + return (0); + } + } + return (ENXIO); /* use builtin handler */ +} diff --git a/sys/dev/usb/gadget/g_keyboard.h b/sys/dev/usb/gadget/g_keyboard.h new file mode 100644 index 000000000000..669bf8ac6ef3 --- /dev/null +++ b/sys/dev/usb/gadget/g_keyboard.h @@ -0,0 +1,35 @@ +/* $FreeBSD$ */ +/*- + * Copyright (c) 2010 Hans Petter Selasky. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _G_KEYBOARD_H_ +#define _G_KEYBOARD_H_ + +#define G_KEYBOARD_MAX_STRLEN 32 +#define G_KEYBOARD_MODE_SILENT 0 +#define G_KEYBOARD_MODE_PATTERN 1 +#define G_KEYBOARD_MODE_MAX 2 + +#endif /* _G_KEYBOARD_H_ */ diff --git a/sys/dev/usb/gadget/g_modem.c b/sys/dev/usb/gadget/g_modem.c new file mode 100644 index 000000000000..f26c4fdc35d0 --- /dev/null +++ b/sys/dev/usb/gadget/g_modem.c @@ -0,0 +1,544 @@ +/*- + * Copyright (c) 2010 Hans Petter Selasky. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Comm Class spec: http://www.usb.org/developers/devclass_docs/usbccs10.pdf + * http://www.usb.org/developers/devclass_docs/usbcdc11.pdf + * http://www.usb.org/developers/devclass_docs/cdc_wmc10.zip + */ + +#include <sys/param.h> +__FBSDID("$FreeBSD$"); + +#include <sys/stdint.h> +#include <sys/stddef.h> +#include <sys/queue.h> +#include <sys/systm.h> +#include <sys/kernel.h> +#include <sys/bus.h> +#include <sys/linker_set.h> +#include <sys/module.h> +#include <sys/lock.h> +#include <sys/mutex.h> +#include <sys/condvar.h> +#include <sys/sysctl.h> +#include <sys/sx.h> +#include <sys/unistd.h> +#include <sys/callout.h> +#include <sys/malloc.h> +#include <sys/priv.h> + +#include <dev/usb/usb.h> +#include <dev/usb/usb_cdc.h> +#include <dev/usb/usbdi.h> +#include <dev/usb/usbdi_util.h> +#include <dev/usb/usbhid.h> +#include "usb_if.h" + +#define USB_DEBUG_VAR g_modem_debug +#include <dev/usb/usb_debug.h> + +#include <dev/usb/gadget/g_modem.h> + +enum { + G_MODEM_INTR_DT, + G_MODEM_BULK_RD, + G_MODEM_BULK_WR, + G_MODEM_N_TRANSFER, +}; + +struct g_modem_softc { + struct mtx sc_mtx; + struct usb_callout sc_callout; + struct usb_callout sc_watchdog; + struct usb_xfer *sc_xfer[G_MODEM_N_TRANSFER]; + + int sc_mode; + int sc_tx_busy; + int sc_pattern_len; + int sc_throughput; + int sc_tx_interval; + + char sc_pattern[G_MODEM_MAX_STRLEN]; + + uint16_t sc_data_len; + + uint8_t sc_data_buf[G_MODEM_BUFSIZE]; + uint8_t sc_line_coding[32]; + uint8_t sc_abstract_state[32]; +}; + +static SYSCTL_NODE(_hw_usb, OID_AUTO, g_modem, CTLFLAG_RW, 0, "USB modem gadget"); + +#ifdef USB_DEBUG +static int g_modem_debug = 0; + +SYSCTL_INT(_hw_usb_g_modem, OID_AUTO, debug, CTLFLAG_RW, + &g_modem_debug, 0, "Debug level"); +#endif + +static int g_modem_mode = 0; + +SYSCTL_INT(_hw_usb_g_modem, OID_AUTO, mode, CTLFLAG_RW, + &g_modem_mode, 0, "Mode selection"); + +static int g_modem_pattern_interval = 1000; + +SYSCTL_INT(_hw_usb_g_modem, OID_AUTO, pattern_interval, CTLFLAG_RW, + &g_modem_pattern_interval, 0, "Pattern interval in milliseconds"); + +static char g_modem_pattern_data[G_MODEM_MAX_STRLEN]; + +SYSCTL_STRING(_hw_usb_g_modem, OID_AUTO, pattern, CTLFLAG_RW, + &g_modem_pattern_data, sizeof(g_modem_pattern_data), "Data pattern"); + +static int g_modem_throughput; + +SYSCTL_INT(_hw_usb_g_modem, OID_AUTO, throughput, CTLFLAG_RD, + &g_modem_throughput, sizeof(g_modem_throughput), "Throughput in bytes per second"); + +static device_probe_t g_modem_probe; +static device_attach_t g_modem_attach; +static device_detach_t g_modem_detach; +static usb_handle_request_t g_modem_handle_request; +static usb_callback_t g_modem_intr_callback; +static usb_callback_t g_modem_bulk_read_callback; +static usb_callback_t g_modem_bulk_write_callback; + +static void g_modem_timeout(void *arg); + +static devclass_t g_modem_devclass; + +static device_method_t g_modem_methods[] = { + /* USB interface */ + DEVMETHOD(usb_handle_request, g_modem_handle_request), + + /* Device interface */ + DEVMETHOD(device_probe, g_modem_probe), + DEVMETHOD(device_attach, g_modem_attach), + DEVMETHOD(device_detach, g_modem_detach), + + DEVMETHOD_END +}; + +static driver_t g_modem_driver = { + .name = "g_modem", + .methods = g_modem_methods, + .size = sizeof(struct g_modem_softc), +}; + +DRIVER_MODULE(g_modem, uhub, g_modem_driver, g_modem_devclass, 0, 0); +MODULE_DEPEND(g_modem, usb, 1, 1, 1); + +static const struct usb_config g_modem_config[G_MODEM_N_TRANSFER] = { + + [G_MODEM_INTR_DT] = { + .type = UE_INTERRUPT, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_TX, + .flags = {.ext_buffer = 1,.pipe_bof = 1,}, + .bufsize = 0, /* use wMaxPacketSize */ + .callback = &g_modem_intr_callback, + .frames = 1, + .usb_mode = USB_MODE_DEVICE, + .if_index = 0, + }, + + [G_MODEM_BULK_RD] = { + .type = UE_BULK, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_RX, + .flags = {.ext_buffer = 1,.pipe_bof = 1,.short_xfer_ok = 1,}, + .bufsize = G_MODEM_BUFSIZE, + .callback = &g_modem_bulk_read_callback, + .frames = 1, + .usb_mode = USB_MODE_DEVICE, + .if_index = 1, + }, + + [G_MODEM_BULK_WR] = { + .type = UE_BULK, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_TX, + .flags = {.ext_buffer = 1,.pipe_bof = 1,}, + .bufsize = G_MODEM_BUFSIZE, + .callback = &g_modem_bulk_write_callback, + .frames = 1, + .usb_mode = USB_MODE_DEVICE, + .if_index = 1, + }, +}; + +static void +g_modem_timeout_reset(struct g_modem_softc *sc) +{ + int i = g_modem_pattern_interval; + + sc->sc_tx_interval = i; + + if (i <= 0) + i = 1; + else if (i > 1023) + i = 1023; + + i = USB_MS_TO_TICKS(i); + + usb_callout_reset(&sc->sc_callout, i, &g_modem_timeout, sc); +} + +static void +g_modem_timeout(void *arg) +{ + struct g_modem_softc *sc = arg; + + sc->sc_mode = g_modem_mode; + + memcpy(sc->sc_pattern, g_modem_pattern_data, sizeof(sc->sc_pattern)); + + sc->sc_pattern[G_MODEM_MAX_STRLEN - 1] = 0; + + sc->sc_pattern_len = strlen(sc->sc_pattern); + + DPRINTFN(11, "Timeout %p\n", sc->sc_xfer[G_MODEM_INTR_DT]); + + usbd_transfer_start(sc->sc_xfer[G_MODEM_BULK_WR]); + usbd_transfer_start(sc->sc_xfer[G_MODEM_BULK_RD]); + + g_modem_timeout_reset(sc); +} + +static void g_modem_watchdog(void *arg); + +static void +g_modem_watchdog_reset(struct g_modem_softc *sc) +{ + usb_callout_reset(&sc->sc_watchdog, hz, &g_modem_watchdog, sc); +} + +static void +g_modem_watchdog(void *arg) +{ + struct g_modem_softc *sc = arg; + int i; + + i = sc->sc_throughput; + + sc->sc_throughput = 0; + + g_modem_throughput = i; + + g_modem_watchdog_reset(sc); +} + +static int +g_modem_probe(device_t dev) +{ + struct usb_attach_arg *uaa = device_get_ivars(dev); + + DPRINTFN(11, "\n"); + + if (uaa->usb_mode != USB_MODE_DEVICE) + return (ENXIO); + + if ((uaa->info.bInterfaceClass == UICLASS_CDC) && + (uaa->info.bInterfaceSubClass == UISUBCLASS_ABSTRACT_CONTROL_MODEL) && + (uaa->info.bInterfaceProtocol == UIPROTO_CDC_AT)) + return (0); + + return (ENXIO); +} + +static int +g_modem_attach(device_t dev) +{ + struct g_modem_softc *sc = device_get_softc(dev); + struct usb_attach_arg *uaa = device_get_ivars(dev); + int error; + uint8_t iface_index[2]; + + DPRINTFN(11, "\n"); + + device_set_usb_desc(dev); + + mtx_init(&sc->sc_mtx, "g_modem", NULL, MTX_DEF); + + usb_callout_init_mtx(&sc->sc_callout, &sc->sc_mtx, 0); + usb_callout_init_mtx(&sc->sc_watchdog, &sc->sc_mtx, 0); + + sc->sc_mode = G_MODEM_MODE_SILENT; + + iface_index[0] = uaa->info.bIfaceIndex; + iface_index[1] = uaa->info.bIfaceIndex + 1; + + error = usbd_transfer_setup(uaa->device, + iface_index, sc->sc_xfer, g_modem_config, + G_MODEM_N_TRANSFER, sc, &sc->sc_mtx); + + if (error) { + DPRINTF("error=%s\n", usbd_errstr(error)); + goto detach; + } + usbd_set_parent_iface(uaa->device, iface_index[1], iface_index[0]); + + mtx_lock(&sc->sc_mtx); + g_modem_timeout_reset(sc); + g_modem_watchdog_reset(sc); + mtx_unlock(&sc->sc_mtx); + + return (0); /* success */ + +detach: + g_modem_detach(dev); + + return (ENXIO); /* error */ +} + +static int +g_modem_detach(device_t dev) +{ + struct g_modem_softc *sc = device_get_softc(dev); + + DPRINTF("\n"); + + mtx_lock(&sc->sc_mtx); + usb_callout_stop(&sc->sc_callout); + usb_callout_stop(&sc->sc_watchdog); + mtx_unlock(&sc->sc_mtx); + + usbd_transfer_unsetup(sc->sc_xfer, G_MODEM_N_TRANSFER); + + usb_callout_drain(&sc->sc_callout); + usb_callout_drain(&sc->sc_watchdog); + + mtx_destroy(&sc->sc_mtx); + + return (0); +} + +static void +g_modem_intr_callback(struct usb_xfer *xfer, usb_error_t error) +{ + int actlen; + int aframes; + + usbd_xfer_status(xfer, &actlen, NULL, &aframes, NULL); + + DPRINTF("st=%d aframes=%d actlen=%d bytes\n", + USB_GET_STATE(xfer), aframes, actlen); + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + break; + + case USB_ST_SETUP: +tr_setup: + break; + + default: /* Error */ + DPRINTF("error=%s\n", usbd_errstr(error)); + + if (error != USB_ERR_CANCELLED) { + /* try to clear stall first */ + usbd_xfer_set_stall(xfer); + goto tr_setup; + } + break; + } +} + +static void +g_modem_bulk_write_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct g_modem_softc *sc = usbd_xfer_softc(xfer); + int actlen; + int aframes; + int mod; + int x; + int max; + + usbd_xfer_status(xfer, &actlen, NULL, &aframes, NULL); + + DPRINTF("st=%d aframes=%d actlen=%d bytes\n", + USB_GET_STATE(xfer), aframes, actlen); + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + + sc->sc_tx_busy = 0; + sc->sc_throughput += actlen; + + if (sc->sc_mode == G_MODEM_MODE_LOOP) { + /* start loop */ + usbd_transfer_start(sc->sc_xfer[G_MODEM_BULK_RD]); + break; + } else if ((sc->sc_mode == G_MODEM_MODE_PATTERN) && (sc->sc_tx_interval != 0)) { + /* wait for next timeout */ + break; + } + case USB_ST_SETUP: +tr_setup: + if (sc->sc_mode == G_MODEM_MODE_PATTERN) { + + mod = sc->sc_pattern_len; + max = sc->sc_tx_interval ? mod : G_MODEM_BUFSIZE; + + if (mod == 0) { + for (x = 0; x != max; x++) + sc->sc_data_buf[x] = x % 255; + } else { + for (x = 0; x != max; x++) + sc->sc_data_buf[x] = sc->sc_pattern[x % mod]; + } + + usbd_xfer_set_frame_data(xfer, 0, sc->sc_data_buf, max); + usbd_xfer_set_interval(xfer, 0); + usbd_xfer_set_frames(xfer, 1); + usbd_transfer_submit(xfer); + + } else if (sc->sc_mode == G_MODEM_MODE_LOOP) { + + if (sc->sc_tx_busy == 0) + break; + + x = sc->sc_tx_interval; + + if (x < 0) + x = 0; + else if (x > 256) + x = 256; + + usbd_xfer_set_frame_data(xfer, 0, sc->sc_data_buf, sc->sc_data_len); + usbd_xfer_set_interval(xfer, x); + usbd_xfer_set_frames(xfer, 1); + usbd_transfer_submit(xfer); + } else { + sc->sc_tx_busy = 0; + } + break; + + default: /* Error */ + DPRINTF("error=%s\n", usbd_errstr(error)); + + if (error != USB_ERR_CANCELLED) { + /* try to clear stall first */ + usbd_xfer_set_stall(xfer); + goto tr_setup; + } + break; + } +} + +static void +g_modem_bulk_read_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct g_modem_softc *sc = usbd_xfer_softc(xfer); + int actlen; + int aframes; + + usbd_xfer_status(xfer, &actlen, NULL, &aframes, NULL); + + DPRINTF("st=%d aframes=%d actlen=%d bytes\n", + USB_GET_STATE(xfer), aframes, actlen); + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + + sc->sc_throughput += actlen; + + if (sc->sc_mode == G_MODEM_MODE_LOOP) { + sc->sc_tx_busy = 1; + sc->sc_data_len = actlen; + usbd_transfer_start(sc->sc_xfer[G_MODEM_BULK_WR]); + break; + } + + case USB_ST_SETUP: +tr_setup: + if ((sc->sc_mode == G_MODEM_MODE_SILENT) || + (sc->sc_tx_busy != 0)) + break; + + usbd_xfer_set_frame_data(xfer, 0, sc->sc_data_buf, G_MODEM_BUFSIZE); + usbd_xfer_set_frames(xfer, 1); + usbd_transfer_submit(xfer); + break; + + default: /* Error */ + DPRINTF("error=%s\n", usbd_errstr(error)); + + if (error != USB_ERR_CANCELLED) { + /* try to clear stall first */ + usbd_xfer_set_stall(xfer); + goto tr_setup; + } + break; + } +} + + +static int +g_modem_handle_request(device_t dev, + const void *preq, void **pptr, uint16_t *plen, + uint16_t offset, uint8_t *pstate) +{ + struct g_modem_softc *sc = device_get_softc(dev); + const struct usb_device_request *req = preq; + uint8_t is_complete = *pstate; + + if (!is_complete) { + if ((req->bmRequestType == UT_WRITE_CLASS_INTERFACE) && + (req->bRequest == UCDC_SET_LINE_CODING) && + (req->wValue[0] == 0x00) && + (req->wValue[1] == 0x00)) { + + if (offset == 0) { + *plen = sizeof(sc->sc_line_coding); + *pptr = &sc->sc_line_coding; + } else { + *plen = 0; + } + return (0); + } else if ((req->bmRequestType == UT_WRITE_CLASS_INTERFACE) && + (req->bRequest == UCDC_SET_COMM_FEATURE)) { + + if (offset == 0) { + *plen = sizeof(sc->sc_abstract_state); + *pptr = &sc->sc_abstract_state; + } else { + *plen = 0; + } + return (0); + } else if ((req->bmRequestType == UT_WRITE_CLASS_INTERFACE) && + (req->bRequest == UCDC_SET_CONTROL_LINE_STATE)) { + *plen = 0; + return (0); + } else if ((req->bmRequestType == UT_WRITE_CLASS_INTERFACE) && + (req->bRequest == UCDC_SEND_BREAK)) { + *plen = 0; + return (0); + } + } + return (ENXIO); /* use builtin handler */ +} diff --git a/sys/dev/usb/gadget/g_modem.h b/sys/dev/usb/gadget/g_modem.h new file mode 100644 index 000000000000..c0d7e332e71d --- /dev/null +++ b/sys/dev/usb/gadget/g_modem.h @@ -0,0 +1,39 @@ +/* $FreeBSD$ */ +/*- + * Copyright (c) 2010 Hans Petter Selasky. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _G_MODEM_H_ +#define _G_MODEM_H_ + +#define G_MODEM_MAX_STRLEN 32 /* chars */ +#define G_MODEM_BUFSIZE 4096 /* bytes */ + +#define G_MODEM_MODE_SILENT 0 +#define G_MODEM_MODE_DUMP 1 +#define G_MODEM_MODE_LOOP 2 +#define G_MODEM_MODE_PATTERN 3 +#define G_MODEM_MODE_MAX 4 + +#endif /* _G_MODEM_H_ */ diff --git a/sys/dev/usb/gadget/g_mouse.c b/sys/dev/usb/gadget/g_mouse.c new file mode 100644 index 000000000000..a87889bee6fd --- /dev/null +++ b/sys/dev/usb/gadget/g_mouse.c @@ -0,0 +1,456 @@ +/*- + * Copyright (c) 2010 Hans Petter Selasky. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * HID spec: http://www.usb.org/developers/devclass_docs/HID1_11.pdf + */ + +#include <sys/param.h> +__FBSDID("$FreeBSD$"); + +#include <sys/stdint.h> +#include <sys/stddef.h> +#include <sys/queue.h> +#include <sys/systm.h> +#include <sys/kernel.h> +#include <sys/bus.h> +#include <sys/linker_set.h> +#include <sys/module.h> +#include <sys/lock.h> +#include <sys/mutex.h> +#include <sys/condvar.h> +#include <sys/sysctl.h> +#include <sys/sx.h> +#include <sys/unistd.h> +#include <sys/callout.h> +#include <sys/malloc.h> +#include <sys/priv.h> + +#include <dev/usb/usb.h> +#include <dev/usb/usbdi.h> +#include <dev/usb/usbdi_util.h> +#include <dev/usb/usbhid.h> +#include "usb_if.h" + +#define USB_DEBUG_VAR g_mouse_debug +#include <dev/usb/usb_debug.h> + +#include <dev/usb/gadget/g_mouse.h> + +static SYSCTL_NODE(_hw_usb, OID_AUTO, g_mouse, CTLFLAG_RW, 0, "USB mouse gadget"); + +#ifdef USB_DEBUG +static int g_mouse_debug = 0; + +SYSCTL_INT(_hw_usb_g_mouse, OID_AUTO, debug, CTLFLAG_RW, + &g_mouse_debug, 0, "Debug level"); +#endif + +static int g_mouse_mode = 0; + +SYSCTL_INT(_hw_usb_g_mouse, OID_AUTO, mode, CTLFLAG_RW, + &g_mouse_mode, 0, "Mode selection"); + +static int g_mouse_button_press_interval = 0; + +SYSCTL_INT(_hw_usb_g_mouse, OID_AUTO, button_press_interval, CTLFLAG_RW, + &g_mouse_button_press_interval, 0, "Mouse button update interval in milliseconds"); + +static int g_mouse_cursor_update_interval = 1023; + +SYSCTL_INT(_hw_usb_g_mouse, OID_AUTO, cursor_update_interval, CTLFLAG_RW, + &g_mouse_cursor_update_interval, 0, "Mouse cursor update interval in milliseconds"); + +static int g_mouse_cursor_radius = 128; + +SYSCTL_INT(_hw_usb_g_mouse, OID_AUTO, cursor_radius, CTLFLAG_RW, + &g_mouse_cursor_radius, 0, "Mouse cursor radius in pixels"); + +struct g_mouse_data { + uint8_t buttons; +#define BUT_0 0x01 +#define BUT_1 0x02 +#define BUT_2 0x04 + int8_t dx; + int8_t dy; + int8_t dz; +}; + +enum { + G_MOUSE_INTR_DT, + G_MOUSE_N_TRANSFER, +}; + +struct g_mouse_softc { + struct mtx sc_mtx; + struct usb_callout sc_button_press_callout; + struct usb_callout sc_cursor_update_callout; + struct g_mouse_data sc_data; + struct usb_xfer *sc_xfer[G_MOUSE_N_TRANSFER]; + + int sc_mode; + int sc_radius; + int sc_last_x_state; + int sc_last_y_state; + int sc_curr_x_state; + int sc_curr_y_state; + int sc_tick; + + uint8_t sc_do_cursor_update; + uint8_t sc_do_button_update; +}; + +static device_probe_t g_mouse_probe; +static device_attach_t g_mouse_attach; +static device_detach_t g_mouse_detach; +static usb_handle_request_t g_mouse_handle_request; +static usb_callback_t g_mouse_intr_callback; + +static devclass_t g_mouse_devclass; + +static device_method_t g_mouse_methods[] = { + /* USB interface */ + DEVMETHOD(usb_handle_request, g_mouse_handle_request), + + /* Device interface */ + DEVMETHOD(device_probe, g_mouse_probe), + DEVMETHOD(device_attach, g_mouse_attach), + DEVMETHOD(device_detach, g_mouse_detach), + + DEVMETHOD_END +}; + +static driver_t g_mouse_driver = { + .name = "g_mouse", + .methods = g_mouse_methods, + .size = sizeof(struct g_mouse_softc), +}; + +DRIVER_MODULE(g_mouse, uhub, g_mouse_driver, g_mouse_devclass, 0, 0); +MODULE_DEPEND(g_mouse, usb, 1, 1, 1); + +static const struct usb_config g_mouse_config[G_MOUSE_N_TRANSFER] = { + + [G_MOUSE_INTR_DT] = { + .type = UE_INTERRUPT, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_IN, + .flags = {.ext_buffer = 1,.pipe_bof = 1,}, + .bufsize = sizeof(struct g_mouse_data), + .callback = &g_mouse_intr_callback, + .frames = 1, + .usb_mode = USB_MODE_DEVICE, + }, +}; + +static void g_mouse_button_press_timeout(void *arg); +static void g_mouse_cursor_update_timeout(void *arg); + +static void +g_mouse_button_press_timeout_reset(struct g_mouse_softc *sc) +{ + int i = g_mouse_button_press_interval; + + if (i <= 0) { + sc->sc_data.buttons = 0; + sc->sc_do_button_update = 0; + } else { + sc->sc_do_button_update = 1; + } + + if ((i <= 0) || (i > 1023)) + i = 1023; + + i = USB_MS_TO_TICKS(i); + + usb_callout_reset(&sc->sc_button_press_callout, i, + &g_mouse_button_press_timeout, sc); +} + +static void +g_mouse_cursor_update_timeout_reset(struct g_mouse_softc *sc) +{ + int i = g_mouse_cursor_update_interval; + + if (i <= 0) { + sc->sc_data.dx = 0; + sc->sc_data.dy = 0; + sc->sc_do_cursor_update = 0; + sc->sc_tick = 0; + } else { + sc->sc_do_cursor_update = 1; + } + + if ((i <= 0) || (i > 1023)) + i = 1023; + + i = USB_MS_TO_TICKS(i); + + usb_callout_reset(&sc->sc_cursor_update_callout, i, + &g_mouse_cursor_update_timeout, sc); +} + +static void +g_mouse_update_mode_radius(struct g_mouse_softc *sc) +{ + sc->sc_mode = g_mouse_mode; + sc->sc_radius = g_mouse_cursor_radius; + + if (sc->sc_radius < 0) + sc->sc_radius = 0; + else if (sc->sc_radius > 1023) + sc->sc_radius = 1023; +} + +static void +g_mouse_button_press_timeout(void *arg) +{ + struct g_mouse_softc *sc = arg; + + g_mouse_update_mode_radius(sc); + + DPRINTFN(11, "Timeout %p (button press)\n", sc->sc_xfer[G_MOUSE_INTR_DT]); + + g_mouse_button_press_timeout_reset(sc); + + usbd_transfer_start(sc->sc_xfer[G_MOUSE_INTR_DT]); +} + +static void +g_mouse_cursor_update_timeout(void *arg) +{ + struct g_mouse_softc *sc = arg; + + g_mouse_update_mode_radius(sc); + + DPRINTFN(11, "Timeout %p (cursor update)\n", sc->sc_xfer[G_MOUSE_INTR_DT]); + + g_mouse_cursor_update_timeout_reset(sc); + + usbd_transfer_start(sc->sc_xfer[G_MOUSE_INTR_DT]); +} + +static int +g_mouse_probe(device_t dev) +{ + struct usb_attach_arg *uaa = device_get_ivars(dev); + + DPRINTFN(11, "\n"); + + if (uaa->usb_mode != USB_MODE_DEVICE) + return (ENXIO); + + if ((uaa->info.bInterfaceClass == UICLASS_HID) && + (uaa->info.bInterfaceSubClass == UISUBCLASS_BOOT) && + (uaa->info.bInterfaceProtocol == UIPROTO_MOUSE)) + return (0); + + return (ENXIO); +} + +static int +g_mouse_attach(device_t dev) +{ + struct g_mouse_softc *sc = device_get_softc(dev); + struct usb_attach_arg *uaa = device_get_ivars(dev); + int error; + + DPRINTFN(11, "\n"); + + device_set_usb_desc(dev); + + mtx_init(&sc->sc_mtx, "g_mouse", NULL, MTX_DEF); + + usb_callout_init_mtx(&sc->sc_button_press_callout, &sc->sc_mtx, 0); + usb_callout_init_mtx(&sc->sc_cursor_update_callout, &sc->sc_mtx, 0); + + sc->sc_mode = G_MOUSE_MODE_SILENT; + + error = usbd_transfer_setup(uaa->device, + &uaa->info.bIfaceIndex, sc->sc_xfer, g_mouse_config, + G_MOUSE_N_TRANSFER, sc, &sc->sc_mtx); + + if (error) { + DPRINTF("error=%s\n", usbd_errstr(error)); + goto detach; + } + + mtx_lock(&sc->sc_mtx); + g_mouse_button_press_timeout_reset(sc); + g_mouse_cursor_update_timeout_reset(sc); + mtx_unlock(&sc->sc_mtx); + + return (0); /* success */ + +detach: + g_mouse_detach(dev); + + return (ENXIO); /* error */ +} + +static int +g_mouse_detach(device_t dev) +{ + struct g_mouse_softc *sc = device_get_softc(dev); + + DPRINTF("\n"); + + mtx_lock(&sc->sc_mtx); + usb_callout_stop(&sc->sc_button_press_callout); + usb_callout_stop(&sc->sc_cursor_update_callout); + mtx_unlock(&sc->sc_mtx); + + usbd_transfer_unsetup(sc->sc_xfer, G_MOUSE_N_TRANSFER); + + usb_callout_drain(&sc->sc_button_press_callout); + usb_callout_drain(&sc->sc_cursor_update_callout); + + mtx_destroy(&sc->sc_mtx); + + return (0); +} + +static void +g_mouse_intr_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct g_mouse_softc *sc = usbd_xfer_softc(xfer); + int actlen; + int aframes; + int dx; + int dy; + int radius; + + usbd_xfer_status(xfer, &actlen, NULL, &aframes, NULL); + + DPRINTF("st=%d aframes=%d actlen=%d bytes\n", + USB_GET_STATE(xfer), aframes, actlen); + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + if (!(sc->sc_do_cursor_update || sc->sc_do_button_update)) + break; + + case USB_ST_SETUP: +tr_setup: + + if (sc->sc_do_cursor_update) { + sc->sc_do_cursor_update = 0; + sc->sc_tick += 80; + if ((sc->sc_tick < 0) || (sc->sc_tick > 7999)) + sc->sc_tick = 0; + } + + if (sc->sc_do_button_update) { + sc->sc_do_button_update = 0; + sc->sc_data.buttons ^= BUT_0; + } + + radius = sc->sc_radius; + + switch (sc->sc_mode) { + case G_MOUSE_MODE_SILENT: + sc->sc_data.buttons = 0; + break; + case G_MOUSE_MODE_SPIRAL: + radius = (radius * (8000-sc->sc_tick)) / 8000; + case G_MOUSE_MODE_CIRCLE: + /* TODO */ + sc->sc_curr_y_state = 0; + sc->sc_curr_x_state = 0; + break; + case G_MOUSE_MODE_BOX: + if (sc->sc_tick < 2000) { + sc->sc_curr_x_state = (sc->sc_tick * radius) / 2000; + sc->sc_curr_y_state = 0; + } else if (sc->sc_tick < 4000) { + sc->sc_curr_x_state = radius; + sc->sc_curr_y_state = -(((sc->sc_tick - 2000) * radius) / 2000); + } else if (sc->sc_tick < 6000) { + sc->sc_curr_x_state = radius - (((sc->sc_tick - 4000) * radius) / 2000); + sc->sc_curr_y_state = -radius; + } else { + sc->sc_curr_x_state = 0; + sc->sc_curr_y_state = -radius + (((sc->sc_tick - 6000) * radius) / 2000); + } + break; + default: + break; + } + + dx = sc->sc_curr_x_state - sc->sc_last_x_state; + dy = sc->sc_curr_y_state - sc->sc_last_y_state; + + if (dx < -63) + dx = -63; + else if (dx > 63) + dx = 63; + + if (dy < -63) + dy = -63; + else if (dy > 63) + dy = 63; + + sc->sc_last_x_state += dx; + sc->sc_last_y_state += dy; + + sc->sc_data.dx = dx; + sc->sc_data.dy = dy; + + usbd_xfer_set_frame_data(xfer, 0, &sc->sc_data, sizeof(sc->sc_data)); + usbd_xfer_set_frames(xfer, 1); + usbd_transfer_submit(xfer); + break; + + default: /* Error */ + DPRINTF("error=%s\n", usbd_errstr(error)); + + if (error != USB_ERR_CANCELLED) { + /* try to clear stall first */ + usbd_xfer_set_stall(xfer); + goto tr_setup; + } + break; + } +} + +static int +g_mouse_handle_request(device_t dev, + const void *preq, void **pptr, uint16_t *plen, + uint16_t offset, uint8_t *pstate) +{ + const struct usb_device_request *req = preq; + uint8_t is_complete = *pstate; + + if (!is_complete) { + if ((req->bmRequestType == UT_WRITE_CLASS_INTERFACE) && + (req->bRequest == UR_SET_PROTOCOL) && + (req->wValue[0] == 0x00) && + (req->wValue[1] == 0x00)) { + *plen = 0; + return (0); + } + } + return (ENXIO); /* use builtin handler */ +} diff --git a/sys/dev/usb/gadget/g_mouse.h b/sys/dev/usb/gadget/g_mouse.h new file mode 100644 index 000000000000..6e763bcf486c --- /dev/null +++ b/sys/dev/usb/gadget/g_mouse.h @@ -0,0 +1,36 @@ +/* $FreeBSD$ */ +/*- + * Copyright (c) 2010 Hans Petter Selasky. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _G_MOUSE_H_ +#define _G_MOUSE_H_ + +#define G_MOUSE_MODE_SILENT 0 +#define G_MOUSE_MODE_CIRCLE 1 +#define G_MOUSE_MODE_BOX 2 +#define G_MOUSE_MODE_SPIRAL 3 +#define G_MOUSE_MODE_MAX 4 + +#endif /* _G_MOUSE_H_ */ diff --git a/sys/dev/usb/net/if_ipheth.c b/sys/dev/usb/net/if_ipheth.c index 64f8d5486551..4460e00f4ea3 100644 --- a/sys/dev/usb/net/if_ipheth.c +++ b/sys/dev/usb/net/if_ipheth.c @@ -149,6 +149,7 @@ static const struct usb_ether_methods ipheth_ue_methods = { USB_IFACE_PROTOCOL(pt) static const STRUCT_USB_HOST_ID ipheth_devs[] = { +#if 0 {IPHETH_ID(USB_VENDOR_APPLE, USB_PRODUCT_APPLE_IPHONE, IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS, IPHETH_USBINTF_PROTO)}, @@ -167,6 +168,13 @@ static const STRUCT_USB_HOST_ID ipheth_devs[] = { {IPHETH_ID(USB_VENDOR_APPLE, USB_PRODUCT_APPLE_IPHONE_5, IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS, IPHETH_USBINTF_PROTO)}, +#else + /* product agnostic interface match */ + {USB_VENDOR(USB_VENDOR_APPLE), + USB_IFACE_CLASS(IPHETH_USBINTF_CLASS), + USB_IFACE_SUBCLASS(IPHETH_USBINTF_SUBCLASS), + USB_IFACE_PROTOCOL(IPHETH_USBINTF_PROTO)}, +#endif }; static int diff --git a/sys/dev/usb/usb_pf.c b/sys/dev/usb/usb_pf.c index d849a133e82c..121105b2b27e 100644 --- a/sys/dev/usb/usb_pf.c +++ b/sys/dev/usb/usb_pf.c @@ -182,7 +182,6 @@ usbpf_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params) error = ifc_alloc_unit(ifc, &unit); if (error) { - ifc_free_unit(ifc, unit); device_printf(ubus->parent, "usbpf: Could not allocate " "instance\n"); return (error); diff --git a/sys/dev/usb/wlan/if_rsu.c b/sys/dev/usb/wlan/if_rsu.c new file mode 100644 index 000000000000..30cdbe93549a --- /dev/null +++ b/sys/dev/usb/wlan/if_rsu.c @@ -0,0 +1,2482 @@ +/* $OpenBSD: if_rsu.c,v 1.17 2013/04/15 09:23:01 mglocker Exp $ */ + +/*- + * Copyright (c) 2010 Damien Bergamini <damien.bergamini@free.fr> + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); + +/* + * Driver for Realtek RTL8188SU/RTL8191SU/RTL8192SU. + * + * TODO: + * o 11n support + * o h/w crypto + * o hostap / ibss / mesh + */ +#include <sys/param.h> +#include <sys/endian.h> +#include <sys/sockio.h> +#include <sys/mbuf.h> +#include <sys/kernel.h> +#include <sys/socket.h> +#include <sys/systm.h> +#include <sys/conf.h> +#include <sys/bus.h> +#include <sys/rman.h> +#include <sys/firmware.h> +#include <sys/module.h> + +#include <machine/bus.h> +#include <machine/resource.h> + +#include <net/bpf.h> +#include <net/if.h> +#include <net/if_arp.h> +#include <net/if_dl.h> +#include <net/if_media.h> +#include <net/if_types.h> + +#include <netinet/in.h> +#include <netinet/in_systm.h> +#include <netinet/in_var.h> +#include <netinet/if_ether.h> +#include <netinet/ip.h> + +#include <net80211/ieee80211_var.h> +#include <net80211/ieee80211_regdomain.h> +#include <net80211/ieee80211_radiotap.h> + +#include <dev/usb/usb.h> +#include <dev/usb/usbdi.h> +#include "usbdevs.h" + +#define USB_DEBUG_VAR rsu_debug +#include <dev/usb/usb_debug.h> + +#include <dev/usb/wlan/if_rsureg.h> + +#ifdef USB_DEBUG +static int rsu_debug = 0; +SYSCTL_NODE(_hw_usb, OID_AUTO, rsu, CTLFLAG_RW, 0, "USB rsu"); +SYSCTL_INT(_hw_usb_rsu, OID_AUTO, debug, CTLFLAG_RW, &rsu_debug, 0, + "Debug level"); +#endif + +static const STRUCT_USB_HOST_ID rsu_devs[] = { +#define RSU_HT_NOT_SUPPORTED 0 +#define RSU_HT_SUPPORTED 1 +#define RSU_DEV_HT(v,p) { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, \ + RSU_HT_SUPPORTED) } +#define RSU_DEV(v,p) { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, \ + RSU_HT_NOT_SUPPORTED) } + RSU_DEV(ASUS, RTL8192SU), + RSU_DEV(AZUREWAVE, RTL8192SU_4), + RSU_DEV_HT(ACCTON, RTL8192SU), + RSU_DEV_HT(ASUS, USBN10), + RSU_DEV_HT(AZUREWAVE, RTL8192SU_1), + RSU_DEV_HT(AZUREWAVE, RTL8192SU_2), + RSU_DEV_HT(AZUREWAVE, RTL8192SU_3), + RSU_DEV_HT(AZUREWAVE, RTL8192SU_5), + RSU_DEV_HT(BELKIN, RTL8192SU_1), + RSU_DEV_HT(BELKIN, RTL8192SU_2), + RSU_DEV_HT(BELKIN, RTL8192SU_3), + RSU_DEV_HT(CONCEPTRONIC2, RTL8192SU_1), + RSU_DEV_HT(CONCEPTRONIC2, RTL8192SU_2), + RSU_DEV_HT(CONCEPTRONIC2, RTL8192SU_3), + RSU_DEV_HT(COREGA, RTL8192SU), + RSU_DEV_HT(DLINK2, DWA131A1), + RSU_DEV_HT(DLINK2, RTL8192SU_1), + RSU_DEV_HT(DLINK2, RTL8192SU_2), + RSU_DEV_HT(EDIMAX, RTL8192SU_1), + RSU_DEV_HT(EDIMAX, RTL8192SU_2), + RSU_DEV_HT(EDIMAX, RTL8192SU_3), + RSU_DEV_HT(GUILLEMOT, HWGUN54), + RSU_DEV_HT(GUILLEMOT, HWNUM300), + RSU_DEV_HT(HAWKING, RTL8192SU_1), + RSU_DEV_HT(HAWKING, RTL8192SU_2), + RSU_DEV_HT(PLANEX2, GWUSNANO), + RSU_DEV_HT(REALTEK, RTL8171), + RSU_DEV_HT(REALTEK, RTL8172), + RSU_DEV_HT(REALTEK, RTL8173), + RSU_DEV_HT(REALTEK, RTL8174), + RSU_DEV_HT(REALTEK, RTL8192SU), + RSU_DEV_HT(REALTEK, RTL8712), + RSU_DEV_HT(REALTEK, RTL8713), + RSU_DEV_HT(SENAO, RTL8192SU_1), + RSU_DEV_HT(SENAO, RTL8192SU_2), + RSU_DEV_HT(SITECOMEU, WL349V1), + RSU_DEV_HT(SITECOMEU, WL353), + RSU_DEV_HT(SWEEX2, LW154), +#undef RSU_DEV_HT +#undef RSU_DEV +}; + +static device_probe_t rsu_match; +static device_attach_t rsu_attach; +static device_detach_t rsu_detach; +static usb_callback_t rsu_bulk_tx_callback; +static usb_callback_t rsu_bulk_rx_callback; +static usb_error_t rsu_do_request(struct rsu_softc *, + struct usb_device_request *, void *); +static struct ieee80211vap * + rsu_vap_create(struct ieee80211com *, const char name[], + int, enum ieee80211_opmode, int, const uint8_t bssid[], + const uint8_t mac[]); +static void rsu_vap_delete(struct ieee80211vap *); +static void rsu_scan_start(struct ieee80211com *); +static void rsu_scan_end(struct ieee80211com *); +static void rsu_set_channel(struct ieee80211com *); +static void rsu_update_mcast(struct ifnet *); +static int rsu_alloc_rx_list(struct rsu_softc *); +static void rsu_free_rx_list(struct rsu_softc *); +static int rsu_alloc_tx_list(struct rsu_softc *); +static void rsu_free_tx_list(struct rsu_softc *); +static void rsu_free_list(struct rsu_softc *, struct rsu_data [], int); +static struct rsu_data *_rsu_getbuf(struct rsu_softc *); +static struct rsu_data *rsu_getbuf(struct rsu_softc *); +static int rsu_write_region_1(struct rsu_softc *, uint16_t, uint8_t *, + int); +static void rsu_write_1(struct rsu_softc *, uint16_t, uint8_t); +static void rsu_write_2(struct rsu_softc *, uint16_t, uint16_t); +static void rsu_write_4(struct rsu_softc *, uint16_t, uint32_t); +static int rsu_read_region_1(struct rsu_softc *, uint16_t, uint8_t *, + int); +static uint8_t rsu_read_1(struct rsu_softc *, uint16_t); +static uint16_t rsu_read_2(struct rsu_softc *, uint16_t); +static uint32_t rsu_read_4(struct rsu_softc *, uint16_t); +static int rsu_fw_iocmd(struct rsu_softc *, uint32_t); +static uint8_t rsu_efuse_read_1(struct rsu_softc *, uint16_t); +static int rsu_read_rom(struct rsu_softc *); +static int rsu_fw_cmd(struct rsu_softc *, uint8_t, void *, int); +static void rsu_calib_task(void *, int); +static int rsu_newstate(struct ieee80211vap *, enum ieee80211_state, int); +#ifdef notyet +static void rsu_set_key(struct rsu_softc *, const struct ieee80211_key *); +static void rsu_delete_key(struct rsu_softc *, const struct ieee80211_key *); +#endif +static int rsu_site_survey(struct rsu_softc *, struct ieee80211vap *); +static int rsu_join_bss(struct rsu_softc *, struct ieee80211_node *); +static int rsu_disconnect(struct rsu_softc *); +static void rsu_event_survey(struct rsu_softc *, uint8_t *, int); +static void rsu_event_join_bss(struct rsu_softc *, uint8_t *, int); +static void rsu_rx_event(struct rsu_softc *, uint8_t, uint8_t *, int); +static void rsu_rx_multi_event(struct rsu_softc *, uint8_t *, int); +static int8_t rsu_get_rssi(struct rsu_softc *, int, void *); +static struct mbuf * + rsu_rx_frame(struct rsu_softc *, uint8_t *, int, int *); +static struct mbuf * + rsu_rx_multi_frame(struct rsu_softc *, uint8_t *, int, int *); +static struct mbuf * + rsu_rxeof(struct usb_xfer *, struct rsu_data *, int *); +static void rsu_txeof(struct usb_xfer *, struct rsu_data *); +static int rsu_raw_xmit(struct ieee80211_node *, struct mbuf *, + const struct ieee80211_bpf_params *); +static void rsu_init(void *); +static void rsu_init_locked(struct rsu_softc *); +static void rsu_watchdog(void *); +static int rsu_tx_start(struct rsu_softc *, struct ieee80211_node *, + struct mbuf *, struct rsu_data *); +static void rsu_start(struct ifnet *); +static void rsu_start_locked(struct ifnet *); +static int rsu_ioctl(struct ifnet *, u_long, caddr_t); +static void rsu_stop(struct ifnet *, int); +static void rsu_stop_locked(struct ifnet *, int); + +static device_method_t rsu_methods[] = { + DEVMETHOD(device_probe, rsu_match), + DEVMETHOD(device_attach, rsu_attach), + DEVMETHOD(device_detach, rsu_detach), + + DEVMETHOD_END +}; + +static driver_t rsu_driver = { + .name = "rsu", + .methods = rsu_methods, + .size = sizeof(struct rsu_softc) +}; + +static devclass_t rsu_devclass; + +DRIVER_MODULE(rsu, uhub, rsu_driver, rsu_devclass, NULL, 0); +MODULE_DEPEND(rsu, wlan, 1, 1, 1); +MODULE_DEPEND(rsu, usb, 1, 1, 1); +MODULE_DEPEND(rsu, firmware, 1, 1, 1); +MODULE_VERSION(rsu, 1); + +static const struct usb_config rsu_config[RSU_N_TRANSFER] = { + [RSU_BULK_RX] = { + .type = UE_BULK, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_IN, + .bufsize = RSU_RXBUFSZ, + .flags = { + .pipe_bof = 1, + .short_xfer_ok = 1 + }, + .callback = rsu_bulk_rx_callback + }, + [RSU_BULK_TX_BE] = { + .type = UE_BULK, + .endpoint = 0x06, + .direction = UE_DIR_OUT, + .bufsize = RSU_TXBUFSZ, + .flags = { + .ext_buffer = 1, + .pipe_bof = 1, + .force_short_xfer = 1 + }, + .callback = rsu_bulk_tx_callback, + .timeout = RSU_TX_TIMEOUT + }, + [RSU_BULK_TX_BK] = { + .type = UE_BULK, + .endpoint = 0x06, + .direction = UE_DIR_OUT, + .bufsize = RSU_TXBUFSZ, + .flags = { + .ext_buffer = 1, + .pipe_bof = 1, + .force_short_xfer = 1 + }, + .callback = rsu_bulk_tx_callback, + .timeout = RSU_TX_TIMEOUT + }, + [RSU_BULK_TX_VI] = { + .type = UE_BULK, + .endpoint = 0x04, + .direction = UE_DIR_OUT, + .bufsize = RSU_TXBUFSZ, + .flags = { + .ext_buffer = 1, + .pipe_bof = 1, + .force_short_xfer = 1 + }, + .callback = rsu_bulk_tx_callback, + .timeout = RSU_TX_TIMEOUT + }, + [RSU_BULK_TX_VO] = { + .type = UE_BULK, + .endpoint = 0x04, + .direction = UE_DIR_OUT, + .bufsize = RSU_TXBUFSZ, + .flags = { + .ext_buffer = 1, + .pipe_bof = 1, + .force_short_xfer = 1 + }, + .callback = rsu_bulk_tx_callback, + .timeout = RSU_TX_TIMEOUT + }, +}; + +static int +rsu_match(device_t self) +{ + struct usb_attach_arg *uaa = device_get_ivars(self); + + if (uaa->usb_mode != USB_MODE_HOST || + uaa->info.bIfaceIndex != 0 || + uaa->info.bConfigIndex != 0) + return (ENXIO); + + return (usbd_lookup_id_by_uaa(rsu_devs, sizeof(rsu_devs), uaa)); +} + +static int +rsu_attach(device_t self) +{ + struct usb_attach_arg *uaa = device_get_ivars(self); + struct rsu_softc *sc = device_get_softc(self); + struct ifnet *ifp; + struct ieee80211com *ic; + int error; + uint8_t iface_index, bands; + + device_set_usb_desc(self); + sc->sc_udev = uaa->device; + sc->sc_dev = self; + + mtx_init(&sc->sc_mtx, device_get_nameunit(self), MTX_NETWORK_LOCK, + MTX_DEF); + TIMEOUT_TASK_INIT(taskqueue_thread, &sc->calib_task, 0, + rsu_calib_task, sc); + callout_init(&sc->sc_watchdog_ch, 0); + + iface_index = 0; + error = usbd_transfer_setup(uaa->device, &iface_index, sc->sc_xfer, + rsu_config, RSU_N_TRANSFER, sc, &sc->sc_mtx); + if (error) { + device_printf(sc->sc_dev, + "could not allocate USB transfers, err=%s\n", + usbd_errstr(error)); + goto fail_usb; + } + RSU_LOCK(sc); + /* Read chip revision. */ + sc->cut = MS(rsu_read_4(sc, R92S_PMC_FSM), R92S_PMC_FSM_CUT); + if (sc->cut != 3) + sc->cut = (sc->cut >> 1) + 1; + error = rsu_read_rom(sc); + if (error != 0) { + device_printf(self, "could not read ROM\n"); + goto fail_rom; + } + RSU_UNLOCK(sc); + IEEE80211_ADDR_COPY(sc->sc_bssid, &sc->rom[0x12]); + device_printf(self, "MAC/BB RTL8712 cut %d\n", sc->cut); + ifp = sc->sc_ifp = if_alloc(IFT_IEEE80211); + if (ifp == NULL) { + device_printf(self, "cannot allocate interface\n"); + goto fail_ifalloc; + } + ic = ifp->if_l2com; + ifp->if_softc = sc; + if_initname(ifp, "rsu", device_get_unit(self)); + ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; + ifp->if_init = rsu_init; + ifp->if_ioctl = rsu_ioctl; + ifp->if_start = rsu_start; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; + IFQ_SET_READY(&ifp->if_snd); + ifp->if_capabilities |= IFCAP_RXCSUM; + ifp->if_capenable |= IFCAP_RXCSUM; + ifp->if_hwassist = CSUM_TCP; + + ic->ic_ifp = ifp; + ic->ic_phytype = IEEE80211_T_OFDM; /* Not only, but not used. */ + ic->ic_opmode = IEEE80211_M_STA; /* Default to BSS mode. */ + + /* Set device capabilities. */ + ic->ic_caps = + IEEE80211_C_STA | /* station mode */ + IEEE80211_C_BGSCAN | /* Background scan. */ + IEEE80211_C_SHPREAMBLE | /* Short preamble supported. */ + IEEE80211_C_SHSLOT | /* Short slot time supported. */ + IEEE80211_C_WPA; /* WPA/RSN. */ + +#if 0 + /* Check if HT support is present. */ + if (usb_lookup(rsu_devs_noht, uaa->vendor, uaa->product) == NULL) { + /* Set HT capabilities. */ + ic->ic_htcaps = + IEEE80211_HTCAP_CBW20_40 | + IEEE80211_HTCAP_DSSSCCK40; + /* Set supported HT rates. */ + for (i = 0; i < 2; i++) + ic->ic_sup_mcs[i] = 0xff; + } +#endif + + /* Set supported .11b and .11g rates. */ + bands = 0; + setbit(&bands, IEEE80211_MODE_11B); + setbit(&bands, IEEE80211_MODE_11G); + ieee80211_init_channels(ic, NULL, &bands); + + ieee80211_ifattach(ic, sc->sc_bssid); + ic->ic_raw_xmit = rsu_raw_xmit; + ic->ic_scan_start = rsu_scan_start; + ic->ic_scan_end = rsu_scan_end; + ic->ic_set_channel = rsu_set_channel; + ic->ic_vap_create = rsu_vap_create; + ic->ic_vap_delete = rsu_vap_delete; + ic->ic_update_mcast = rsu_update_mcast; + + ieee80211_radiotap_attach(ic, &sc->sc_txtap.wt_ihdr, + sizeof(sc->sc_txtap), RSU_TX_RADIOTAP_PRESENT, + &sc->sc_rxtap.wr_ihdr, sizeof(sc->sc_rxtap), + RSU_RX_RADIOTAP_PRESENT); + + if (bootverbose) + ieee80211_announce(ic); + + return (0); + +fail_ifalloc: +fail_rom: + usbd_transfer_unsetup(sc->sc_xfer, RSU_N_TRANSFER); +fail_usb: + mtx_destroy(&sc->sc_mtx); + return (ENXIO); +} + +static int +rsu_detach(device_t self) +{ + struct rsu_softc *sc = device_get_softc(self); + struct ifnet *ifp = sc->sc_ifp; + struct ieee80211com *ic = ifp->if_l2com; + + if (!device_is_attached(self)) + return (0); + rsu_stop(ifp, 1); + usbd_transfer_unsetup(sc->sc_xfer, RSU_N_TRANSFER); + ieee80211_ifdetach(ic); + + callout_drain(&sc->sc_watchdog_ch); + taskqueue_drain_timeout(taskqueue_thread, &sc->calib_task); + + /* Free Tx/Rx buffers. */ + rsu_free_tx_list(sc); + rsu_free_rx_list(sc); + + if_free(ifp); + mtx_destroy(&sc->sc_mtx); + + return (0); +} + +static usb_error_t +rsu_do_request(struct rsu_softc *sc, struct usb_device_request *req, + void *data) +{ + usb_error_t err; + int ntries = 10; + + RSU_ASSERT_LOCKED(sc); + + while (ntries--) { + err = usbd_do_request_flags(sc->sc_udev, &sc->sc_mtx, + req, data, 0, NULL, 250 /* ms */); + if (err == 0 || !device_is_attached(sc->sc_dev)) + break; + DPRINTFN(1, "Control request failed, %s (retrying)\n", + usbd_errstr(err)); + usb_pause_mtx(&sc->sc_mtx, hz / 100); + } + + return (err); +} + +static struct ieee80211vap * +rsu_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], int unit, + enum ieee80211_opmode opmode, int flags, + const uint8_t bssid[IEEE80211_ADDR_LEN], + const uint8_t mac[IEEE80211_ADDR_LEN]) +{ + struct rsu_vap *uvp; + struct ieee80211vap *vap; + + if (!TAILQ_EMPTY(&ic->ic_vaps)) /* only one at a time */ + return (NULL); + + uvp = (struct rsu_vap *) malloc(sizeof(struct rsu_vap), + M_80211_VAP, M_NOWAIT | M_ZERO); + if (uvp == NULL) + return (NULL); + vap = &uvp->vap; + ieee80211_vap_setup(ic, vap, name, unit, opmode, + flags, bssid, mac); + + /* override state transition machine */ + uvp->newstate = vap->iv_newstate; + vap->iv_newstate = rsu_newstate; + + /* complete setup */ + ieee80211_vap_attach(vap, ieee80211_media_change, + ieee80211_media_status); + ic->ic_opmode = opmode; + + return (vap); +} + +static void +rsu_vap_delete(struct ieee80211vap *vap) +{ + struct rsu_vap *uvp = RSU_VAP(vap); + + ieee80211_vap_detach(vap); + free(uvp, M_80211_VAP); +} + +static void +rsu_scan_start(struct ieee80211com *ic) +{ + int error; + struct ifnet *ifp = ic->ic_ifp; + struct rsu_softc *sc = ifp->if_softc; + + /* Scanning is done by the firmware. */ + RSU_LOCK(sc); + error = rsu_site_survey(sc, TAILQ_FIRST(&ic->ic_vaps)); + RSU_UNLOCK(sc); + if (error != 0) + device_printf(sc->sc_dev, + "could not send site survey command\n"); +} + +static void +rsu_scan_end(struct ieee80211com *ic) +{ + /* Nothing to do here. */ +} + +static void +rsu_set_channel(struct ieee80211com *ic __unused) +{ + /* We are unable to switch channels, yet. */ +} + +static void +rsu_update_mcast(struct ifnet *ifp) +{ + /* XXX do nothing? */ +} + +static int +rsu_alloc_list(struct rsu_softc *sc, struct rsu_data data[], + int ndata, int maxsz) +{ + int i, error; + + for (i = 0; i < ndata; i++) { + struct rsu_data *dp = &data[i]; + dp->sc = sc; + dp->m = NULL; + dp->buf = malloc(maxsz, M_USBDEV, M_NOWAIT); + if (dp->buf == NULL) { + device_printf(sc->sc_dev, + "could not allocate buffer\n"); + error = ENOMEM; + goto fail; + } + dp->ni = NULL; + } + + return (0); +fail: + rsu_free_list(sc, data, ndata); + return (error); +} + +static int +rsu_alloc_rx_list(struct rsu_softc *sc) +{ + int error, i; + + error = rsu_alloc_list(sc, sc->sc_rx, RSU_RX_LIST_COUNT, + RSU_RXBUFSZ); + if (error != 0) + return (error); + + STAILQ_INIT(&sc->sc_rx_active); + STAILQ_INIT(&sc->sc_rx_inactive); + + for (i = 0; i < RSU_RX_LIST_COUNT; i++) + STAILQ_INSERT_HEAD(&sc->sc_rx_inactive, &sc->sc_rx[i], next); + + return (0); +} + +static int +rsu_alloc_tx_list(struct rsu_softc *sc) +{ + int error, i; + + error = rsu_alloc_list(sc, sc->sc_tx, RSU_TX_LIST_COUNT, + RSU_TXBUFSZ); + if (error != 0) + return (error); + + STAILQ_INIT(&sc->sc_tx_active); + STAILQ_INIT(&sc->sc_tx_inactive); + STAILQ_INIT(&sc->sc_tx_pending); + + for (i = 0; i < RSU_TX_LIST_COUNT; i++) { + STAILQ_INSERT_HEAD(&sc->sc_tx_inactive, &sc->sc_tx[i], next); + } + + return (0); +} + +static void +rsu_free_tx_list(struct rsu_softc *sc) +{ + rsu_free_list(sc, sc->sc_tx, RSU_TX_LIST_COUNT); +} + +static void +rsu_free_rx_list(struct rsu_softc *sc) +{ + rsu_free_list(sc, sc->sc_rx, RSU_RX_LIST_COUNT); +} + +static void +rsu_free_list(struct rsu_softc *sc, struct rsu_data data[], int ndata) +{ + int i; + + for (i = 0; i < ndata; i++) { + struct rsu_data *dp = &data[i]; + + if (dp->buf != NULL) { + free(dp->buf, M_USBDEV); + dp->buf = NULL; + } + if (dp->ni != NULL) { + ieee80211_free_node(dp->ni); + dp->ni = NULL; + } + } +} + +static struct rsu_data * +_rsu_getbuf(struct rsu_softc *sc) +{ + struct rsu_data *bf; + + bf = STAILQ_FIRST(&sc->sc_tx_inactive); + if (bf != NULL) + STAILQ_REMOVE_HEAD(&sc->sc_tx_inactive, next); + else + bf = NULL; + if (bf == NULL) + DPRINTF("out of xmit buffers\n"); + return (bf); +} + +static struct rsu_data * +rsu_getbuf(struct rsu_softc *sc) +{ + struct rsu_data *bf; + + RSU_ASSERT_LOCKED(sc); + + bf = _rsu_getbuf(sc); + if (bf == NULL) { + struct ifnet *ifp = sc->sc_ifp; + DPRINTF("stop queue\n"); + ifp->if_drv_flags |= IFF_DRV_OACTIVE; + } + return (bf); +} + +static int +rsu_write_region_1(struct rsu_softc *sc, uint16_t addr, uint8_t *buf, + int len) +{ + usb_device_request_t req; + + req.bmRequestType = UT_WRITE_VENDOR_DEVICE; + req.bRequest = R92S_REQ_REGS; + USETW(req.wValue, addr); + USETW(req.wIndex, 0); + USETW(req.wLength, len); + + return (rsu_do_request(sc, &req, buf)); +} + +static void +rsu_write_1(struct rsu_softc *sc, uint16_t addr, uint8_t val) +{ + rsu_write_region_1(sc, addr, &val, 1); +} + +static void +rsu_write_2(struct rsu_softc *sc, uint16_t addr, uint16_t val) +{ + val = htole16(val); + rsu_write_region_1(sc, addr, (uint8_t *)&val, 2); +} + +static void +rsu_write_4(struct rsu_softc *sc, uint16_t addr, uint32_t val) +{ + val = htole32(val); + rsu_write_region_1(sc, addr, (uint8_t *)&val, 4); +} + +static int +rsu_read_region_1(struct rsu_softc *sc, uint16_t addr, uint8_t *buf, + int len) +{ + usb_device_request_t req; + + req.bmRequestType = UT_READ_VENDOR_DEVICE; + req.bRequest = R92S_REQ_REGS; + USETW(req.wValue, addr); + USETW(req.wIndex, 0); + USETW(req.wLength, len); + + return (rsu_do_request(sc, &req, buf)); +} + +static uint8_t +rsu_read_1(struct rsu_softc *sc, uint16_t addr) +{ + uint8_t val; + + if (rsu_read_region_1(sc, addr, &val, 1) != 0) + return (0xff); + return (val); +} + +static uint16_t +rsu_read_2(struct rsu_softc *sc, uint16_t addr) +{ + uint16_t val; + + if (rsu_read_region_1(sc, addr, (uint8_t *)&val, 2) != 0) + return (0xffff); + return (le16toh(val)); +} + +static uint32_t +rsu_read_4(struct rsu_softc *sc, uint16_t addr) +{ + uint32_t val; + + if (rsu_read_region_1(sc, addr, (uint8_t *)&val, 4) != 0) + return (0xffffffff); + return (le32toh(val)); +} + +static int +rsu_fw_iocmd(struct rsu_softc *sc, uint32_t iocmd) +{ + int ntries; + + rsu_write_4(sc, R92S_IOCMD_CTRL, iocmd); + DELAY(100); + for (ntries = 0; ntries < 50; ntries++) { + if (rsu_read_4(sc, R92S_IOCMD_CTRL) == 0) + return (0); + DELAY(10); + } + return (ETIMEDOUT); +} + +static uint8_t +rsu_efuse_read_1(struct rsu_softc *sc, uint16_t addr) +{ + uint32_t reg; + int ntries; + + reg = rsu_read_4(sc, R92S_EFUSE_CTRL); + reg = RW(reg, R92S_EFUSE_CTRL_ADDR, addr); + reg &= ~R92S_EFUSE_CTRL_VALID; + rsu_write_4(sc, R92S_EFUSE_CTRL, reg); + /* Wait for read operation to complete. */ + for (ntries = 0; ntries < 100; ntries++) { + reg = rsu_read_4(sc, R92S_EFUSE_CTRL); + if (reg & R92S_EFUSE_CTRL_VALID) + return (MS(reg, R92S_EFUSE_CTRL_DATA)); + DELAY(5); + } + device_printf(sc->sc_dev, + "could not read efuse byte at address 0x%x\n", addr); + return (0xff); +} + +static int +rsu_read_rom(struct rsu_softc *sc) +{ + uint8_t *rom = sc->rom; + uint16_t addr = 0; + uint32_t reg; + uint8_t off, msk; + int i; + + /* Make sure that ROM type is eFuse and that autoload succeeded. */ + reg = rsu_read_1(sc, R92S_EE_9346CR); + if ((reg & (R92S_9356SEL | R92S_EEPROM_EN)) != R92S_EEPROM_EN) + return (EIO); + + /* Turn on 2.5V to prevent eFuse leakage. */ + reg = rsu_read_1(sc, R92S_EFUSE_TEST + 3); + rsu_write_1(sc, R92S_EFUSE_TEST + 3, reg | 0x80); + DELAY(1000); + rsu_write_1(sc, R92S_EFUSE_TEST + 3, reg & ~0x80); + + /* Read full ROM image. */ + memset(&sc->rom, 0xff, sizeof(sc->rom)); + while (addr < 512) { + reg = rsu_efuse_read_1(sc, addr); + if (reg == 0xff) + break; + addr++; + off = reg >> 4; + msk = reg & 0xf; + for (i = 0; i < 4; i++) { + if (msk & (1 << i)) + continue; + rom[off * 8 + i * 2 + 0] = + rsu_efuse_read_1(sc, addr); + addr++; + rom[off * 8 + i * 2 + 1] = + rsu_efuse_read_1(sc, addr); + addr++; + } + } +#ifdef USB_DEBUG + if (rsu_debug >= 5) { + /* Dump ROM content. */ + printf("\n"); + for (i = 0; i < sizeof(sc->rom); i++) + printf("%02x:", rom[i]); + printf("\n"); + } +#endif + return (0); +} + +static int +rsu_fw_cmd(struct rsu_softc *sc, uint8_t code, void *buf, int len) +{ + struct rsu_data *data; + struct r92s_tx_desc *txd; + struct r92s_fw_cmd_hdr *cmd; + int cmdsz, xferlen; + + data = rsu_getbuf(sc); + if (data == NULL) + return (ENOMEM); + + /* Round-up command length to a multiple of 8 bytes. */ + cmdsz = (len + 7) & ~7; + + xferlen = sizeof(*txd) + sizeof(*cmd) + cmdsz; + KASSERT(xferlen <= RSU_TXBUFSZ, ("%s: invalid length", __func__)); + memset(data->buf, 0, xferlen); + + /* Setup Tx descriptor. */ + txd = (struct r92s_tx_desc *)data->buf; + txd->txdw0 = htole32( + SM(R92S_TXDW0_OFFSET, sizeof(*txd)) | + SM(R92S_TXDW0_PKTLEN, sizeof(*cmd) + cmdsz) | + R92S_TXDW0_OWN | R92S_TXDW0_FSG | R92S_TXDW0_LSG); + txd->txdw1 = htole32(SM(R92S_TXDW1_QSEL, R92S_TXDW1_QSEL_H2C)); + + /* Setup command header. */ + cmd = (struct r92s_fw_cmd_hdr *)&txd[1]; + cmd->len = htole16(cmdsz); + cmd->code = code; + cmd->seq = sc->cmd_seq; + sc->cmd_seq = (sc->cmd_seq + 1) & 0x7f; + + /* Copy command payload. */ + memcpy(&cmd[1], buf, len); + + DPRINTFN(2, "Tx cmd code=0x%x len=0x%x\n", code, cmdsz); + data->buflen = xferlen; + STAILQ_INSERT_TAIL(&sc->sc_tx_pending, data, next); + usbd_transfer_start(sc->sc_xfer[RSU_BULK_TX_VO]); + + return (0); +} + +/* ARGSUSED */ +static void +rsu_calib_task(void *arg, int pending __unused) +{ + struct rsu_softc *sc = arg; + uint32_t reg; + + DPRINTFN(6, "running calibration task\n"); + RSU_LOCK(sc); +#ifdef notyet + /* Read WPS PBC status. */ + rsu_write_1(sc, R92S_MAC_PINMUX_CTRL, + R92S_GPIOMUX_EN | SM(R92S_GPIOSEL_GPIO, R92S_GPIOSEL_GPIO_JTAG)); + rsu_write_1(sc, R92S_GPIO_IO_SEL, + rsu_read_1(sc, R92S_GPIO_IO_SEL) & ~R92S_GPIO_WPS); + reg = rsu_read_1(sc, R92S_GPIO_CTRL); + if (reg != 0xff && (reg & R92S_GPIO_WPS)) + DPRINTF(("WPS PBC is pushed\n")); +#endif + /* Read current signal level. */ + if (rsu_fw_iocmd(sc, 0xf4000001) == 0) { + reg = rsu_read_4(sc, R92S_IOCMD_DATA); + DPRINTFN(8, "RSSI=%d%%\n", reg >> 4); + } + if (sc->sc_calibrating) { + RSU_UNLOCK(sc); + taskqueue_enqueue_timeout(taskqueue_thread, &sc->calib_task, + hz * 2); + } else + RSU_UNLOCK(sc); +} + +static int +rsu_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) +{ + struct rsu_vap *uvp = RSU_VAP(vap); + struct ieee80211com *ic = vap->iv_ic; + struct rsu_softc *sc = ic->ic_ifp->if_softc; + struct ieee80211_node *ni; + struct ieee80211_rateset *rs; + enum ieee80211_state ostate; + int error, startcal = 0; + + ostate = vap->iv_state; + DPRINTF("%s -> %s\n", ieee80211_state_name[ostate], + ieee80211_state_name[nstate]); + + IEEE80211_UNLOCK(ic); + if (ostate == IEEE80211_S_RUN) { + RSU_LOCK(sc); + /* Stop calibration. */ + sc->sc_calibrating = 0; + RSU_UNLOCK(sc); + taskqueue_drain_timeout(taskqueue_thread, &sc->calib_task); + /* Disassociate from our current BSS. */ + RSU_LOCK(sc); + rsu_disconnect(sc); + } else + RSU_LOCK(sc); + switch (nstate) { + case IEEE80211_S_INIT: + break; + case IEEE80211_S_AUTH: + ni = ieee80211_ref_node(vap->iv_bss); + error = rsu_join_bss(sc, ni); + ieee80211_free_node(ni); + if (error != 0) { + device_printf(sc->sc_dev, + "could not send join command\n"); + } + break; + case IEEE80211_S_RUN: + ni = ieee80211_ref_node(vap->iv_bss); + rs = &ni->ni_rates; + /* Indicate highest supported rate. */ + ni->ni_txrate = rs->rs_rates[rs->rs_nrates - 1]; + ieee80211_free_node(ni); + startcal = 1; + break; + default: + break; + } + sc->sc_calibrating = 1; + RSU_UNLOCK(sc); + IEEE80211_LOCK(ic); + /* Start periodic calibration. */ + taskqueue_enqueue_timeout(taskqueue_thread, &sc->calib_task, hz * 2); + + return (uvp->newstate(vap, nstate, arg)); +} + +#ifdef notyet +static void +rsu_set_key(struct rsu_softc *sc, const struct ieee80211_key *k) +{ + struct r92s_fw_cmd_set_key key; + + memset(&key, 0, sizeof(key)); + /* Map net80211 cipher to HW crypto algorithm. */ + switch (k->wk_cipher->ic_cipher) { + case IEEE80211_CIPHER_WEP: + if (k->wk_keylen < 8) + key.algo = R92S_KEY_ALGO_WEP40; + else + key.algo = R92S_KEY_ALGO_WEP104; + break; + case IEEE80211_CIPHER_TKIP: + key.algo = R92S_KEY_ALGO_TKIP; + break; + case IEEE80211_CIPHER_AES_CCM: + key.algo = R92S_KEY_ALGO_AES; + break; + default: + return; + } + key.id = k->wk_keyix; + key.grpkey = (k->wk_flags & IEEE80211_KEY_GROUP) != 0; + memcpy(key.key, k->wk_key, MIN(k->wk_keylen, sizeof(key.key))); + (void)rsu_fw_cmd(sc, R92S_CMD_SET_KEY, &key, sizeof(key)); +} + +static void +rsu_delete_key(struct rsu_softc *sc, const struct ieee80211_key *k) +{ + struct r92s_fw_cmd_set_key key; + + memset(&key, 0, sizeof(key)); + key.id = k->wk_keyix; + (void)rsu_fw_cmd(sc, R92S_CMD_SET_KEY, &key, sizeof(key)); +} +#endif + +static int +rsu_site_survey(struct rsu_softc *sc, struct ieee80211vap *vap) +{ + struct r92s_fw_cmd_sitesurvey cmd; + struct ifnet *ifp = sc->sc_ifp; + struct ieee80211com *ic = ifp->if_l2com; + + memset(&cmd, 0, sizeof(cmd)); + if ((ic->ic_flags & IEEE80211_F_ASCAN) || sc->scan_pass == 1) + cmd.active = htole32(1); + cmd.limit = htole32(48); + if (sc->scan_pass == 1 && vap->iv_des_nssid > 0) { + /* Do a directed scan for second pass. */ + cmd.ssidlen = htole32(vap->iv_des_ssid[0].len); + memcpy(cmd.ssid, vap->iv_des_ssid[0].ssid, + vap->iv_des_ssid[0].len); + + } + DPRINTF("sending site survey command, pass=%d\n", sc->scan_pass); + return (rsu_fw_cmd(sc, R92S_CMD_SITE_SURVEY, &cmd, sizeof(cmd))); +} + +static int +rsu_join_bss(struct rsu_softc *sc, struct ieee80211_node *ni) +{ + struct ifnet *ifp = sc->sc_ifp; + struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211vap *vap = ni->ni_vap; + struct ndis_wlan_bssid_ex *bss; + struct ndis_802_11_fixed_ies *fixed; + struct r92s_fw_cmd_auth auth; + uint8_t buf[sizeof(*bss) + 128], *frm; + uint8_t opmode; + int error; + + /* Let the FW decide the opmode based on the capinfo field. */ + opmode = NDIS802_11AUTOUNKNOWN; + DPRINTF("setting operating mode to %d\n", opmode); + error = rsu_fw_cmd(sc, R92S_CMD_SET_OPMODE, &opmode, sizeof(opmode)); + if (error != 0) + return (error); + + memset(&auth, 0, sizeof(auth)); + if (vap->iv_flags & IEEE80211_F_WPA) { + auth.mode = R92S_AUTHMODE_WPA; + auth.dot1x = ni->ni_authmode == IEEE80211_AUTH_8021X; + } else + auth.mode = R92S_AUTHMODE_OPEN; + DPRINTF("setting auth mode to %d\n", auth.mode); + error = rsu_fw_cmd(sc, R92S_CMD_SET_AUTH, &auth, sizeof(auth)); + if (error != 0) + return (error); + + memset(buf, 0, sizeof(buf)); + bss = (struct ndis_wlan_bssid_ex *)buf; + IEEE80211_ADDR_COPY(bss->macaddr, ni->ni_bssid); + bss->ssid.ssidlen = htole32(ni->ni_esslen); + memcpy(bss->ssid.ssid, ni->ni_essid, ni->ni_esslen); + if (vap->iv_flags & (IEEE80211_F_PRIVACY | IEEE80211_F_WPA)) + bss->privacy = htole32(1); + bss->rssi = htole32(ni->ni_avgrssi); + if (ic->ic_curmode == IEEE80211_MODE_11B) + bss->networktype = htole32(NDIS802_11DS); + else + bss->networktype = htole32(NDIS802_11OFDM24); + bss->config.len = htole32(sizeof(bss->config)); + bss->config.bintval = htole32(ni->ni_intval); + bss->config.dsconfig = htole32(ieee80211_chan2ieee(ic, ni->ni_chan)); + bss->inframode = htole32(NDIS802_11INFRASTRUCTURE); + memcpy(bss->supprates, ni->ni_rates.rs_rates, + ni->ni_rates.rs_nrates); + /* Write the fixed fields of the beacon frame. */ + fixed = (struct ndis_802_11_fixed_ies *)&bss[1]; + memcpy(&fixed->tstamp, ni->ni_tstamp.data, 8); + fixed->bintval = htole16(ni->ni_intval); + fixed->capabilities = htole16(ni->ni_capinfo); + /* Write IEs to be included in the association request. */ + frm = (uint8_t *)&fixed[1]; + frm = ieee80211_add_rsn(frm, vap); + frm = ieee80211_add_wpa(frm, vap); + frm = ieee80211_add_qos(frm, ni); + if (ni->ni_flags & IEEE80211_NODE_HT) + frm = ieee80211_add_htcap(frm, ni); + bss->ieslen = htole32(frm - (uint8_t *)fixed); + bss->len = htole32(((frm - buf) + 3) & ~3); + DPRINTF("sending join bss command to %s chan %d\n", + ether_sprintf(bss->macaddr), le32toh(bss->config.dsconfig)); + return (rsu_fw_cmd(sc, R92S_CMD_JOIN_BSS, buf, sizeof(buf))); +} + +static int +rsu_disconnect(struct rsu_softc *sc) +{ + uint32_t zero = 0; /* :-) */ + + /* Disassociate from our current BSS. */ + DPRINTF("sending disconnect command\n"); + return (rsu_fw_cmd(sc, R92S_CMD_DISCONNECT, &zero, sizeof(zero))); +} + +static void +rsu_event_survey(struct rsu_softc *sc, uint8_t *buf, int len) +{ + struct ifnet *ifp = sc->sc_ifp; + struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211_frame *wh; + struct ieee80211_channel *c; + struct ndis_wlan_bssid_ex *bss; + struct mbuf *m; + int pktlen; + + if (__predict_false(len < sizeof(*bss))) + return; + bss = (struct ndis_wlan_bssid_ex *)buf; + if (__predict_false(len < sizeof(*bss) + le32toh(bss->ieslen))) + return; + + DPRINTFN(2, "found BSS %s: len=%d chan=%d inframode=%d " + "networktype=%d privacy=%d\n", + ether_sprintf(bss->macaddr), le32toh(bss->len), + le32toh(bss->config.dsconfig), le32toh(bss->inframode), + le32toh(bss->networktype), le32toh(bss->privacy)); + + /* Build a fake beacon frame to let net80211 do all the parsing. */ + pktlen = sizeof(*wh) + le32toh(bss->ieslen); + if (__predict_false(pktlen > MCLBYTES)) + return; + MGETHDR(m, M_DONTWAIT, MT_DATA); + if (__predict_false(m == NULL)) + return; + if (pktlen > MHLEN) { + MCLGET(m, M_DONTWAIT); + if (!(m->m_flags & M_EXT)) { + m_free(m); + return; + } + } + wh = mtod(m, struct ieee80211_frame *); + wh->i_fc[0] = IEEE80211_FC0_VERSION_0 | IEEE80211_FC0_TYPE_MGT | + IEEE80211_FC0_SUBTYPE_BEACON; + wh->i_fc[1] = IEEE80211_FC1_DIR_NODS; + *(uint16_t *)wh->i_dur = 0; + IEEE80211_ADDR_COPY(wh->i_addr1, ifp->if_broadcastaddr); + IEEE80211_ADDR_COPY(wh->i_addr2, bss->macaddr); + IEEE80211_ADDR_COPY(wh->i_addr3, bss->macaddr); + *(uint16_t *)wh->i_seq = 0; + memcpy(&wh[1], (uint8_t *)&bss[1], le32toh(bss->ieslen)); + + /* Finalize mbuf. */ + m->m_pkthdr.len = m->m_len = pktlen; + m->m_pkthdr.rcvif = ifp; + /* Fix the channel. */ + c = ieee80211_find_channel_byieee(ic, + le32toh(bss->config.dsconfig), + IEEE80211_CHAN_G); + if (c) { + ic->ic_curchan = c; + ieee80211_radiotap_chan_change(ic); + } + /* XXX avoid a LOR */ + RSU_UNLOCK(sc); + ieee80211_input_all(ic, m, le32toh(bss->rssi), 0); + RSU_LOCK(sc); +} + +static void +rsu_event_join_bss(struct rsu_softc *sc, uint8_t *buf, int len) +{ + struct ifnet *ifp = sc->sc_ifp; + struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); + struct ieee80211_node *ni = vap->iv_bss; + struct r92s_event_join_bss *rsp; + int res; + + if (__predict_false(len < sizeof(*rsp))) + return; + rsp = (struct r92s_event_join_bss *)buf; + res = (int)le32toh(rsp->join_res); + + DPRINTF("Rx join BSS event len=%d res=%d\n", len, res); + if (res <= 0) { + RSU_UNLOCK(sc); + ieee80211_new_state(vap, IEEE80211_S_SCAN, -1); + RSU_LOCK(sc); + return; + } + DPRINTF("associated with %s associd=%d\n", + ether_sprintf(rsp->bss.macaddr), le32toh(rsp->associd)); + ni->ni_associd = le32toh(rsp->associd) | 0xc000; + RSU_UNLOCK(sc); + ieee80211_new_state(vap, IEEE80211_S_RUN, + IEEE80211_FC0_SUBTYPE_ASSOC_RESP); + RSU_LOCK(sc); +} + +static void +rsu_rx_event(struct rsu_softc *sc, uint8_t code, uint8_t *buf, int len) +{ + struct ifnet *ifp = sc->sc_ifp; + struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); + + DPRINTFN(4, "Rx event code=%d len=%d\n", code, len); + switch (code) { + case R92S_EVT_SURVEY: + if (vap->iv_state == IEEE80211_S_SCAN) + rsu_event_survey(sc, buf, len); + break; + case R92S_EVT_SURVEY_DONE: + DPRINTF("site survey pass %d done, found %d BSS\n", + sc->scan_pass, le32toh(*(uint32_t *)buf)); + if (vap->iv_state != IEEE80211_S_SCAN) + break; /* Ignore if not scanning. */ + if (sc->scan_pass == 0 && vap->iv_des_nssid != 0) { + /* Schedule a directed scan for hidden APs. */ + sc->scan_pass = 1; + RSU_UNLOCK(sc); + ieee80211_new_state(vap, IEEE80211_S_SCAN, -1); + RSU_LOCK(sc); + break; + } + sc->scan_pass = 0; + break; + case R92S_EVT_JOIN_BSS: + if (vap->iv_state == IEEE80211_S_AUTH) + rsu_event_join_bss(sc, buf, len); + break; + case R92S_EVT_DEL_STA: + DPRINTF("disassociated from %s\n", ether_sprintf(buf)); + if (vap->iv_state == IEEE80211_S_RUN && + IEEE80211_ADDR_EQ(vap->iv_bss->ni_bssid, buf)) { + RSU_UNLOCK(sc); + ieee80211_new_state(vap, IEEE80211_S_SCAN, -1); + RSU_LOCK(sc); + } + break; + case R92S_EVT_WPS_PBC: + DPRINTF("WPS PBC pushed.\n"); + break; + case R92S_EVT_FWDBG: + if (ifp->if_flags & IFF_DEBUG) { + buf[60] = '\0'; + printf("FWDBG: %s\n", (char *)buf); + } + break; + } +} + +static void +rsu_rx_multi_event(struct rsu_softc *sc, uint8_t *buf, int len) +{ + struct r92s_fw_cmd_hdr *cmd; + int cmdsz; + + DPRINTFN(6, "Rx events len=%d\n", len); + + /* Skip Rx status. */ + buf += sizeof(struct r92s_rx_stat); + len -= sizeof(struct r92s_rx_stat); + + /* Process all events. */ + for (;;) { + /* Check that command header fits. */ + if (__predict_false(len < sizeof(*cmd))) + break; + cmd = (struct r92s_fw_cmd_hdr *)buf; + /* Check that command payload fits. */ + cmdsz = le16toh(cmd->len); + if (__predict_false(len < sizeof(*cmd) + cmdsz)) + break; + + /* Process firmware event. */ + rsu_rx_event(sc, cmd->code, (uint8_t *)&cmd[1], cmdsz); + + if (!(cmd->seq & R92S_FW_CMD_MORE)) + break; + buf += sizeof(*cmd) + cmdsz; + len -= sizeof(*cmd) + cmdsz; + } +} + +static int8_t +rsu_get_rssi(struct rsu_softc *sc, int rate, void *physt) +{ + static const int8_t cckoff[] = { 14, -2, -20, -40 }; + struct r92s_rx_phystat *phy; + struct r92s_rx_cck *cck; + uint8_t rpt; + int8_t rssi; + + if (rate <= 3) { + cck = (struct r92s_rx_cck *)physt; + rpt = (cck->agc_rpt >> 6) & 0x3; + rssi = cck->agc_rpt & 0x3e; + rssi = cckoff[rpt] - rssi; + } else { /* OFDM/HT. */ + phy = (struct r92s_rx_phystat *)physt; + rssi = ((le32toh(phy->phydw1) >> 1) & 0x7f) - 106; + } + return (rssi); +} + +static struct mbuf * +rsu_rx_frame(struct rsu_softc *sc, uint8_t *buf, int pktlen, int *rssi) +{ + struct ifnet *ifp = sc->sc_ifp; + struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211_frame *wh; + struct r92s_rx_stat *stat; + uint32_t rxdw0, rxdw3; + struct mbuf *m; + uint8_t rate; + int infosz; + + stat = (struct r92s_rx_stat *)buf; + rxdw0 = le32toh(stat->rxdw0); + rxdw3 = le32toh(stat->rxdw3); + + if (__predict_false(rxdw0 & R92S_RXDW0_CRCERR)) { + ifp->if_ierrors++; + return NULL; + } + if (__predict_false(pktlen < sizeof(*wh) || pktlen > MCLBYTES)) { + ifp->if_ierrors++; + return NULL; + } + + rate = MS(rxdw3, R92S_RXDW3_RATE); + infosz = MS(rxdw0, R92S_RXDW0_INFOSZ) * 8; + + /* Get RSSI from PHY status descriptor if present. */ + if (infosz != 0) + *rssi = rsu_get_rssi(sc, rate, &stat[1]); + else + *rssi = 0; + + DPRINTFN(5, "Rx frame len=%d rate=%d infosz=%d rssi=%d\n", + pktlen, rate, infosz, *rssi); + + MGETHDR(m, M_DONTWAIT, MT_DATA); + if (__predict_false(m == NULL)) { + ifp->if_ierrors++; + return NULL; + } + if (pktlen > MHLEN) { + MCLGET(m, M_DONTWAIT); + if (__predict_false(!(m->m_flags & M_EXT))) { + ifp->if_ierrors++; + m_freem(m); + return NULL; + } + } + /* Finalize mbuf. */ + m->m_pkthdr.rcvif = ifp; + /* Hardware does Rx TCP checksum offload. */ + if (rxdw3 & R92S_RXDW3_TCPCHKVALID) { + if (__predict_true(rxdw3 & R92S_RXDW3_TCPCHKRPT)) + m->m_pkthdr.csum_flags |= CSUM_DATA_VALID; + } + wh = (struct ieee80211_frame *)((uint8_t *)&stat[1] + infosz); + memcpy(mtod(m, uint8_t *), wh, pktlen); + m->m_pkthdr.len = m->m_len = pktlen; + + if (ieee80211_radiotap_active(ic)) { + struct rsu_rx_radiotap_header *tap = &sc->sc_rxtap; + + /* Map HW rate index to 802.11 rate. */ + tap->wr_flags = 2; + if (!(rxdw3 & R92S_RXDW3_HTC)) { + switch (rate) { + /* CCK. */ + case 0: tap->wr_rate = 2; break; + case 1: tap->wr_rate = 4; break; + case 2: tap->wr_rate = 11; break; + case 3: tap->wr_rate = 22; break; + /* OFDM. */ + case 4: tap->wr_rate = 12; break; + case 5: tap->wr_rate = 18; break; + case 6: tap->wr_rate = 24; break; + case 7: tap->wr_rate = 36; break; + case 8: tap->wr_rate = 48; break; + case 9: tap->wr_rate = 72; break; + case 10: tap->wr_rate = 96; break; + case 11: tap->wr_rate = 108; break; + } + } else if (rate >= 12) { /* MCS0~15. */ + /* Bit 7 set means HT MCS instead of rate. */ + tap->wr_rate = 0x80 | (rate - 12); + } + tap->wr_dbm_antsignal = *rssi; + tap->wr_chan_freq = htole16(ic->ic_curchan->ic_freq); + tap->wr_chan_flags = htole16(ic->ic_curchan->ic_flags); + } + + return (m); +} + +static struct mbuf * +rsu_rx_multi_frame(struct rsu_softc *sc, uint8_t *buf, int len, int *rssi) +{ + struct r92s_rx_stat *stat; + uint32_t rxdw0; + int totlen, pktlen, infosz, npkts; + struct mbuf *m, *m0 = NULL, *prevm = NULL; + + /* Get the number of encapsulated frames. */ + stat = (struct r92s_rx_stat *)buf; + npkts = MS(le32toh(stat->rxdw2), R92S_RXDW2_PKTCNT); + DPRINTFN(6, "Rx %d frames in one chunk\n", npkts); + + /* Process all of them. */ + while (npkts-- > 0) { + if (__predict_false(len < sizeof(*stat))) + break; + stat = (struct r92s_rx_stat *)buf; + rxdw0 = le32toh(stat->rxdw0); + + pktlen = MS(rxdw0, R92S_RXDW0_PKTLEN); + if (__predict_false(pktlen == 0)) + break; + + infosz = MS(rxdw0, R92S_RXDW0_INFOSZ) * 8; + + /* Make sure everything fits in xfer. */ + totlen = sizeof(*stat) + infosz + pktlen; + if (__predict_false(totlen > len)) + break; + + /* Process 802.11 frame. */ + m = rsu_rx_frame(sc, buf, pktlen, rssi); + if (m0 == NULL) + m0 = m; + if (prevm == NULL) + prevm = m; + else { + prevm->m_next = m; + prevm = m; + } + /* Next chunk is 128-byte aligned. */ + totlen = (totlen + 127) & ~127; + buf += totlen; + len -= totlen; + } + + return (m0); +} + +static struct mbuf * +rsu_rxeof(struct usb_xfer *xfer, struct rsu_data *data, int *rssi) +{ + struct rsu_softc *sc = data->sc; + struct r92s_rx_stat *stat; + int len; + + usbd_xfer_status(xfer, &len, NULL, NULL, NULL); + + if (__predict_false(len < sizeof(*stat))) { + DPRINTF("xfer too short %d\n", len); + sc->sc_ifp->if_ierrors++; + return (NULL); + } + /* Determine if it is a firmware C2H event or an 802.11 frame. */ + stat = (struct r92s_rx_stat *)data->buf; + if ((le32toh(stat->rxdw1) & 0x1ff) == 0x1ff) { + rsu_rx_multi_event(sc, data->buf, len); + /* No packets to process. */ + return (NULL); + } else + return (rsu_rx_multi_frame(sc, data->buf, len, rssi)); +} + +static void +rsu_bulk_rx_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct rsu_softc *sc = usbd_xfer_softc(xfer); + struct ifnet *ifp = sc->sc_ifp; + struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211_frame *wh; + struct ieee80211_node *ni; + struct mbuf *m = NULL, *next; + struct rsu_data *data; + int rssi = 1; + + RSU_ASSERT_LOCKED(sc); + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + data = STAILQ_FIRST(&sc->sc_rx_active); + if (data == NULL) + goto tr_setup; + STAILQ_REMOVE_HEAD(&sc->sc_rx_active, next); + m = rsu_rxeof(xfer, data, &rssi); + STAILQ_INSERT_TAIL(&sc->sc_rx_inactive, data, next); + /* FALLTHROUGH */ + case USB_ST_SETUP: +tr_setup: + data = STAILQ_FIRST(&sc->sc_rx_inactive); + if (data == NULL) { + KASSERT(m == NULL, ("mbuf isn't NULL")); + return; + } + STAILQ_REMOVE_HEAD(&sc->sc_rx_inactive, next); + STAILQ_INSERT_TAIL(&sc->sc_rx_active, data, next); + usbd_xfer_set_frame_data(xfer, 0, data->buf, + usbd_xfer_max_len(xfer)); + usbd_transfer_submit(xfer); + /* + * To avoid LOR we should unlock our private mutex here to call + * ieee80211_input() because here is at the end of a USB + * callback and safe to unlock. + */ + RSU_UNLOCK(sc); + while (m != NULL) { + next = m->m_next; + m->m_next = NULL; + wh = mtod(m, struct ieee80211_frame *); + ni = ieee80211_find_rxnode(ic, + (struct ieee80211_frame_min *)wh); + if (ni != NULL) { + (void)ieee80211_input(ni, m, rssi, 0); + ieee80211_free_node(ni); + } else + (void)ieee80211_input_all(ic, m, rssi, 0); + m = next; + } + RSU_LOCK(sc); + break; + default: + /* needs it to the inactive queue due to a error. */ + data = STAILQ_FIRST(&sc->sc_rx_active); + if (data != NULL) { + STAILQ_REMOVE_HEAD(&sc->sc_rx_active, next); + STAILQ_INSERT_TAIL(&sc->sc_rx_inactive, data, next); + } + if (error != USB_ERR_CANCELLED) { + usbd_xfer_set_stall(xfer); + ifp->if_ierrors++; + goto tr_setup; + } + break; + } + +} + + +static void +rsu_txeof(struct usb_xfer *xfer, struct rsu_data *data) +{ + struct rsu_softc *sc = usbd_xfer_softc(xfer); + struct ifnet *ifp = sc->sc_ifp; + struct mbuf *m; + + RSU_ASSERT_LOCKED(sc); + + /* + * Do any tx complete callback. Note this must be done before releasing + * the node reference. + */ + if (data->m) { + m = data->m; + if (m->m_flags & M_TXCB) { + /* XXX status? */ + ieee80211_process_callback(data->ni, m, 0); + } + m_freem(m); + data->m = NULL; + } + if (data->ni) { + ieee80211_free_node(data->ni); + data->ni = NULL; + } + sc->sc_tx_timer = 0; + ifp->if_opackets++; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; +} + +static void +rsu_bulk_tx_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct rsu_softc *sc = usbd_xfer_softc(xfer); + struct ifnet *ifp = sc->sc_ifp; + struct rsu_data *data; + + RSU_ASSERT_LOCKED(sc); + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + data = STAILQ_FIRST(&sc->sc_tx_active); + if (data == NULL) + goto tr_setup; + DPRINTF("transfer done %p\n", data); + STAILQ_REMOVE_HEAD(&sc->sc_tx_active, next); + rsu_txeof(xfer, data); + STAILQ_INSERT_TAIL(&sc->sc_tx_inactive, data, next); + /* FALLTHROUGH */ + case USB_ST_SETUP: +tr_setup: + data = STAILQ_FIRST(&sc->sc_tx_pending); + if (data == NULL) { + DPRINTF("empty pending queue sc %p\n", sc); + return; + } + STAILQ_REMOVE_HEAD(&sc->sc_tx_pending, next); + STAILQ_INSERT_TAIL(&sc->sc_tx_active, data, next); + usbd_xfer_set_frame_data(xfer, 0, data->buf, data->buflen); + DPRINTF("submitting transfer %p\n", data); + usbd_transfer_submit(xfer); + rsu_start_locked(ifp); + break; + default: + data = STAILQ_FIRST(&sc->sc_tx_active); + if (data == NULL) + goto tr_setup; + if (data->ni != NULL) { + ieee80211_free_node(data->ni); + data->ni = NULL; + ifp->if_oerrors++; + } + if (error != USB_ERR_CANCELLED) { + usbd_xfer_set_stall(xfer); + goto tr_setup; + } + break; + } +} + +static int +rsu_tx_start(struct rsu_softc *sc, struct ieee80211_node *ni, + struct mbuf *m0, struct rsu_data *data) +{ + struct ifnet *ifp = sc->sc_ifp; + struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211vap *vap = ni->ni_vap; + struct ieee80211_frame *wh; + struct ieee80211_key *k = NULL; + struct r92s_tx_desc *txd; + struct usb_xfer *xfer; + uint8_t type, tid = 0; + int hasqos, xferlen; + struct usb_xfer *rsu_pipes[4] = { + sc->sc_xfer[RSU_BULK_TX_BE], + sc->sc_xfer[RSU_BULK_TX_BK], + sc->sc_xfer[RSU_BULK_TX_VI], + sc->sc_xfer[RSU_BULK_TX_VO] + }; + + RSU_ASSERT_LOCKED(sc); + + wh = mtod(m0, struct ieee80211_frame *); + type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; + + if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + k = ieee80211_crypto_encap(ni, m0); + if (k == NULL) { + device_printf(sc->sc_dev, + "ieee80211_crypto_encap returns NULL.\n"); + /* XXX we don't expect the fragmented frames */ + m_freem(m0); + return (ENOBUFS); + } + wh = mtod(m0, struct ieee80211_frame *); + } + switch (type) { + case IEEE80211_FC0_TYPE_CTL: + case IEEE80211_FC0_TYPE_MGT: + xfer = sc->sc_xfer[RSU_BULK_TX_VO]; + break; + default: + KASSERT(M_WME_GETAC(m0) < 4, + ("unsupported WME pipe %d", M_WME_GETAC(m0))); + xfer = rsu_pipes[M_WME_GETAC(m0)]; + break; + } + hasqos = 0; + + /* Fill Tx descriptor. */ + txd = (struct r92s_tx_desc *)data->buf; + memset(txd, 0, sizeof(*txd)); + + txd->txdw0 |= htole32( + SM(R92S_TXDW0_PKTLEN, m0->m_pkthdr.len) | + SM(R92S_TXDW0_OFFSET, sizeof(*txd)) | + R92S_TXDW0_OWN | R92S_TXDW0_FSG | R92S_TXDW0_LSG); + + txd->txdw1 |= htole32( + SM(R92S_TXDW1_MACID, R92S_MACID_BSS) | + SM(R92S_TXDW1_QSEL, R92S_TXDW1_QSEL_BE)); + if (!hasqos) + txd->txdw1 |= htole32(R92S_TXDW1_NONQOS); +#ifdef notyet + if (k != NULL) { + switch (k->wk_cipher->ic_cipher) { + case IEEE80211_CIPHER_WEP: + cipher = R92S_TXDW1_CIPHER_WEP; + break; + case IEEE80211_CIPHER_TKIP: + cipher = R92S_TXDW1_CIPHER_TKIP; + break; + case IEEE80211_CIPHER_AES_CCM: + cipher = R92S_TXDW1_CIPHER_AES; + break; + default: + cipher = R92S_TXDW1_CIPHER_NONE; + } + txd->txdw1 |= htole32( + SM(R92S_TXDW1_CIPHER, cipher) | + SM(R92S_TXDW1_KEYIDX, k->k_id)); + } +#endif + txd->txdw2 |= htole32(R92S_TXDW2_BK); + if (IEEE80211_IS_MULTICAST(wh->i_addr1)) + txd->txdw2 |= htole32(R92S_TXDW2_BMCAST); + /* + * Firmware will use and increment the sequence number for the + * specified TID. + */ + txd->txdw3 |= htole32(SM(R92S_TXDW3_SEQ, tid)); + + if (ieee80211_radiotap_active_vap(vap)) { + struct rsu_tx_radiotap_header *tap = &sc->sc_txtap; + + tap->wt_flags = 0; + tap->wt_chan_freq = htole16(ic->ic_curchan->ic_freq); + tap->wt_chan_flags = htole16(ic->ic_curchan->ic_flags); + ieee80211_radiotap_tx(vap, m0); + } + xferlen = sizeof(*txd) + m0->m_pkthdr.len; + m_copydata(m0, 0, m0->m_pkthdr.len, (caddr_t)&txd[1]); + + data->buflen = xferlen; + data->ni = ni; + data->m = m0; + STAILQ_INSERT_TAIL(&sc->sc_tx_pending, data, next); + usbd_transfer_start(xfer); + + return (0); +} + +static void +rsu_start(struct ifnet *ifp) +{ + struct rsu_softc *sc = ifp->if_softc; + + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + return; + + RSU_LOCK(sc); + rsu_start_locked(ifp); + RSU_UNLOCK(sc); +} + +static void +rsu_start_locked(struct ifnet *ifp) +{ + struct rsu_softc *sc = ifp->if_softc; + struct ieee80211_node *ni; + struct mbuf *m; + struct rsu_data *bf; + + RSU_ASSERT_LOCKED(sc); + + for (;;) { + IFQ_DRV_DEQUEUE(&ifp->if_snd, m); + if (m == NULL) + break; + bf = rsu_getbuf(sc); + if (bf == NULL) { + IFQ_DRV_PREPEND(&ifp->if_snd, m); + break; + } + ni = (struct ieee80211_node *)m->m_pkthdr.rcvif; + m->m_pkthdr.rcvif = NULL; + + if (rsu_tx_start(sc, ni, m, bf) != 0) { + ifp->if_oerrors++; + STAILQ_INSERT_HEAD(&sc->sc_tx_inactive, bf, next); + ieee80211_free_node(ni); + break; + } + sc->sc_tx_timer = 5; + callout_reset(&sc->sc_watchdog_ch, hz, rsu_watchdog, sc); + } +} + +static void +rsu_watchdog(void *arg) +{ + struct rsu_softc *sc = arg; + struct ifnet *ifp = sc->sc_ifp; + + if (sc->sc_tx_timer > 0) { + if (--sc->sc_tx_timer == 0) { + device_printf(sc->sc_dev, "device timeout\n"); + /* rsu_init(ifp); XXX needs a process context! */ + ifp->if_oerrors++; + return; + } + callout_reset(&sc->sc_watchdog_ch, hz, rsu_watchdog, sc); + } +} + +static int +rsu_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) +{ + struct ieee80211com *ic = ifp->if_l2com; + struct ifreq *ifr = (struct ifreq *) data; + int error = 0, startall = 0; + + switch (cmd) { + case SIOCSIFFLAGS: + if (ifp->if_flags & IFF_UP) { + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { + rsu_init(ifp->if_softc); + startall = 1; + } + } else { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) + rsu_stop(ifp, 1); + } + if (startall) + ieee80211_start_all(ic); + break; + case SIOCGIFMEDIA: + error = ifmedia_ioctl(ifp, ifr, &ic->ic_media, cmd); + break; + case SIOCGIFADDR: + error = ether_ioctl(ifp, cmd, data); + break; + default: + error = EINVAL; + break; + } + + return (error); +} + +/* + * Power on sequence for A-cut adapters. + */ +static void +rsu_power_on_acut(struct rsu_softc *sc) +{ + uint32_t reg; + + rsu_write_1(sc, R92S_SPS0_CTRL + 1, 0x53); + rsu_write_1(sc, R92S_SPS0_CTRL + 0, 0x57); + + /* Enable AFE macro block's bandgap and Mbias. */ + rsu_write_1(sc, R92S_AFE_MISC, + rsu_read_1(sc, R92S_AFE_MISC) | + R92S_AFE_MISC_BGEN | R92S_AFE_MISC_MBEN); + /* Enable LDOA15 block. */ + rsu_write_1(sc, R92S_LDOA15_CTRL, + rsu_read_1(sc, R92S_LDOA15_CTRL) | R92S_LDA15_EN); + + rsu_write_1(sc, R92S_SPS1_CTRL, + rsu_read_1(sc, R92S_SPS1_CTRL) | R92S_SPS1_LDEN); + usb_pause_mtx(&sc->sc_mtx, 2 * hz); + /* Enable switch regulator block. */ + rsu_write_1(sc, R92S_SPS1_CTRL, + rsu_read_1(sc, R92S_SPS1_CTRL) | R92S_SPS1_SWEN); + + rsu_write_4(sc, R92S_SPS1_CTRL, 0x00a7b267); + + rsu_write_1(sc, R92S_SYS_ISO_CTRL + 1, + rsu_read_1(sc, R92S_SYS_ISO_CTRL + 1) | 0x08); + + rsu_write_1(sc, R92S_SYS_FUNC_EN + 1, + rsu_read_1(sc, R92S_SYS_FUNC_EN + 1) | 0x20); + + rsu_write_1(sc, R92S_SYS_ISO_CTRL + 1, + rsu_read_1(sc, R92S_SYS_ISO_CTRL + 1) & ~0x90); + + /* Enable AFE clock. */ + rsu_write_1(sc, R92S_AFE_XTAL_CTRL + 1, + rsu_read_1(sc, R92S_AFE_XTAL_CTRL + 1) & ~0x04); + /* Enable AFE PLL macro block. */ + rsu_write_1(sc, R92S_AFE_PLL_CTRL, + rsu_read_1(sc, R92S_AFE_PLL_CTRL) | 0x11); + /* Attach AFE PLL to MACTOP/BB. */ + rsu_write_1(sc, R92S_SYS_ISO_CTRL, + rsu_read_1(sc, R92S_SYS_ISO_CTRL) & ~0x11); + + /* Switch to 40MHz clock instead of 80MHz. */ + rsu_write_2(sc, R92S_SYS_CLKR, + rsu_read_2(sc, R92S_SYS_CLKR) & ~R92S_SYS_CLKSEL); + + /* Enable MAC clock. */ + rsu_write_2(sc, R92S_SYS_CLKR, + rsu_read_2(sc, R92S_SYS_CLKR) | + R92S_MAC_CLK_EN | R92S_SYS_CLK_EN); + + rsu_write_1(sc, R92S_PMC_FSM, 0x02); + + /* Enable digital core and IOREG R/W. */ + rsu_write_1(sc, R92S_SYS_FUNC_EN + 1, + rsu_read_1(sc, R92S_SYS_FUNC_EN + 1) | 0x08); + + rsu_write_1(sc, R92S_SYS_FUNC_EN + 1, + rsu_read_1(sc, R92S_SYS_FUNC_EN + 1) | 0x80); + + /* Switch the control path to firmware. */ + reg = rsu_read_2(sc, R92S_SYS_CLKR); + reg = (reg & ~R92S_SWHW_SEL) | R92S_FWHW_SEL; + rsu_write_2(sc, R92S_SYS_CLKR, reg); + + rsu_write_2(sc, R92S_CR, 0x37fc); + + /* Fix USB RX FIFO issue. */ + rsu_write_1(sc, 0xfe5c, + rsu_read_1(sc, 0xfe5c) | 0x80); + rsu_write_1(sc, 0x00ab, + rsu_read_1(sc, 0x00ab) | 0xc0); + + rsu_write_1(sc, R92S_SYS_CLKR, + rsu_read_1(sc, R92S_SYS_CLKR) & ~R92S_SYS_CPU_CLKSEL); +} + +/* + * Power on sequence for B-cut and C-cut adapters. + */ +static void +rsu_power_on_bcut(struct rsu_softc *sc) +{ + uint32_t reg; + int ntries; + + /* Prevent eFuse leakage. */ + rsu_write_1(sc, 0x37, 0xb0); + usb_pause_mtx(&sc->sc_mtx, 10); + rsu_write_1(sc, 0x37, 0x30); + + /* Switch the control path to hardware. */ + reg = rsu_read_2(sc, R92S_SYS_CLKR); + if (reg & R92S_FWHW_SEL) { + rsu_write_2(sc, R92S_SYS_CLKR, + reg & ~(R92S_SWHW_SEL | R92S_FWHW_SEL)); + } + rsu_write_1(sc, R92S_SYS_FUNC_EN + 1, + rsu_read_1(sc, R92S_SYS_FUNC_EN + 1) & ~0x8c); + DELAY(1000); + + rsu_write_1(sc, R92S_SPS0_CTRL + 1, 0x53); + rsu_write_1(sc, R92S_SPS0_CTRL + 0, 0x57); + + reg = rsu_read_1(sc, R92S_AFE_MISC); + rsu_write_1(sc, R92S_AFE_MISC, reg | R92S_AFE_MISC_BGEN); + rsu_write_1(sc, R92S_AFE_MISC, reg | R92S_AFE_MISC_BGEN | + R92S_AFE_MISC_MBEN | R92S_AFE_MISC_I32_EN); + + /* Enable PLL. */ + rsu_write_1(sc, R92S_LDOA15_CTRL, + rsu_read_1(sc, R92S_LDOA15_CTRL) | R92S_LDA15_EN); + + rsu_write_1(sc, R92S_LDOV12D_CTRL, + rsu_read_1(sc, R92S_LDOV12D_CTRL) | R92S_LDV12_EN); + + rsu_write_1(sc, R92S_SYS_ISO_CTRL + 1, + rsu_read_1(sc, R92S_SYS_ISO_CTRL + 1) | 0x08); + + rsu_write_1(sc, R92S_SYS_FUNC_EN + 1, + rsu_read_1(sc, R92S_SYS_FUNC_EN + 1) | 0x20); + + /* Support 64KB IMEM. */ + rsu_write_1(sc, R92S_SYS_ISO_CTRL + 1, + rsu_read_1(sc, R92S_SYS_ISO_CTRL + 1) & ~0x97); + + /* Enable AFE clock. */ + rsu_write_1(sc, R92S_AFE_XTAL_CTRL + 1, + rsu_read_1(sc, R92S_AFE_XTAL_CTRL + 1) & ~0x04); + /* Enable AFE PLL macro block. */ + reg = rsu_read_1(sc, R92S_AFE_PLL_CTRL); + rsu_write_1(sc, R92S_AFE_PLL_CTRL, reg | 0x11); + DELAY(500); + rsu_write_1(sc, R92S_AFE_PLL_CTRL, reg | 0x51); + DELAY(500); + rsu_write_1(sc, R92S_AFE_PLL_CTRL, reg | 0x11); + DELAY(500); + + /* Attach AFE PLL to MACTOP/BB. */ + rsu_write_1(sc, R92S_SYS_ISO_CTRL, + rsu_read_1(sc, R92S_SYS_ISO_CTRL) & ~0x11); + + /* Switch to 40MHz clock. */ + rsu_write_1(sc, R92S_SYS_CLKR, 0x00); + /* Disable CPU clock and 80MHz SSC. */ + rsu_write_1(sc, R92S_SYS_CLKR, + rsu_read_1(sc, R92S_SYS_CLKR) | 0xa0); + /* Enable MAC clock. */ + rsu_write_2(sc, R92S_SYS_CLKR, + rsu_read_2(sc, R92S_SYS_CLKR) | + R92S_MAC_CLK_EN | R92S_SYS_CLK_EN); + + rsu_write_1(sc, R92S_PMC_FSM, 0x02); + + /* Enable digital core and IOREG R/W. */ + rsu_write_1(sc, R92S_SYS_FUNC_EN + 1, + rsu_read_1(sc, R92S_SYS_FUNC_EN + 1) | 0x08); + + rsu_write_1(sc, R92S_SYS_FUNC_EN + 1, + rsu_read_1(sc, R92S_SYS_FUNC_EN + 1) | 0x80); + + /* Switch the control path to firmware. */ + reg = rsu_read_2(sc, R92S_SYS_CLKR); + reg = (reg & ~R92S_SWHW_SEL) | R92S_FWHW_SEL; + rsu_write_2(sc, R92S_SYS_CLKR, reg); + + rsu_write_2(sc, R92S_CR, 0x37fc); + + /* Fix USB RX FIFO issue. */ + rsu_write_1(sc, 0xfe5c, + rsu_read_1(sc, 0xfe5c) | 0x80); + + rsu_write_1(sc, R92S_SYS_CLKR, + rsu_read_1(sc, R92S_SYS_CLKR) & ~R92S_SYS_CPU_CLKSEL); + + rsu_write_1(sc, 0xfe1c, 0x80); + + /* Make sure TxDMA is ready to download firmware. */ + for (ntries = 0; ntries < 20; ntries++) { + reg = rsu_read_1(sc, R92S_TCR); + if ((reg & (R92S_TCR_IMEM_CHK_RPT | R92S_TCR_EMEM_CHK_RPT)) == + (R92S_TCR_IMEM_CHK_RPT | R92S_TCR_EMEM_CHK_RPT)) + break; + DELAY(5); + } + if (ntries == 20) { + DPRINTF("TxDMA is not ready\n"); + /* Reset TxDMA. */ + reg = rsu_read_1(sc, R92S_CR); + rsu_write_1(sc, R92S_CR, reg & ~R92S_CR_TXDMA_EN); + DELAY(2); + rsu_write_1(sc, R92S_CR, reg | R92S_CR_TXDMA_EN); + } +} + +static void +rsu_power_off(struct rsu_softc *sc) +{ + /* Turn RF off. */ + rsu_write_1(sc, R92S_RF_CTRL, 0x00); + usb_pause_mtx(&sc->sc_mtx, 5); + + /* Turn MAC off. */ + /* Switch control path. */ + rsu_write_1(sc, R92S_SYS_CLKR + 1, 0x38); + /* Reset MACTOP. */ + rsu_write_1(sc, R92S_SYS_FUNC_EN + 1, 0x70); + rsu_write_1(sc, R92S_PMC_FSM, 0x06); + rsu_write_1(sc, R92S_SYS_ISO_CTRL + 0, 0xf9); + rsu_write_1(sc, R92S_SYS_ISO_CTRL + 1, 0xe8); + + /* Disable AFE PLL. */ + rsu_write_1(sc, R92S_AFE_PLL_CTRL, 0x00); + /* Disable A15V. */ + rsu_write_1(sc, R92S_LDOA15_CTRL, 0x54); + /* Disable eFuse 1.2V. */ + rsu_write_1(sc, R92S_SYS_FUNC_EN + 1, 0x50); + rsu_write_1(sc, R92S_LDOV12D_CTRL, 0x24); + /* Enable AFE macro block's bandgap and Mbias. */ + rsu_write_1(sc, R92S_AFE_MISC, 0x30); + /* Disable 1.6V LDO. */ + rsu_write_1(sc, R92S_SPS0_CTRL + 0, 0x56); + rsu_write_1(sc, R92S_SPS0_CTRL + 1, 0x43); +} + +static int +rsu_fw_loadsection(struct rsu_softc *sc, const uint8_t *buf, int len) +{ + struct rsu_data *data; + struct r92s_tx_desc *txd; + int mlen; + + while (len > 0) { + data = rsu_getbuf(sc); + if (data == NULL) + return (ENOMEM); + txd = (struct r92s_tx_desc *)data->buf; + memset(txd, 0, sizeof(*txd)); + if (len <= RSU_TXBUFSZ - sizeof(*txd)) { + /* Last chunk. */ + txd->txdw0 |= htole32(R92S_TXDW0_LINIP); + mlen = len; + } else + mlen = RSU_TXBUFSZ - sizeof(*txd); + txd->txdw0 |= htole32(SM(R92S_TXDW0_PKTLEN, mlen)); + memcpy(&txd[1], buf, mlen); + data->buflen = sizeof(*txd) + mlen; + DPRINTF("starting transfer %p\n", data); + STAILQ_INSERT_TAIL(&sc->sc_tx_pending, data, next); + buf += mlen; + len -= mlen; + } + usbd_transfer_start(sc->sc_xfer[RSU_BULK_TX_VO]); + + return (0); +} + +static int +rsu_load_firmware(struct rsu_softc *sc) +{ + const struct r92s_fw_hdr *hdr; + struct r92s_fw_priv *dmem; + const uint8_t *imem, *emem; + int imemsz, ememsz; + const struct firmware *fw; + size_t size; + uint32_t reg; + int ntries, error; + + RSU_UNLOCK(sc); + /* Read firmware image from the filesystem. */ + if ((fw = firmware_get("rsu-rtl8712fw")) == NULL) { + device_printf(sc->sc_dev, + "%s: failed load firmware of file rsu-rtl8712fw\n", + __func__); + RSU_LOCK(sc); + return (ENXIO); + } + RSU_LOCK(sc); + size = fw->datasize; + if (size < sizeof(*hdr)) { + device_printf(sc->sc_dev, "firmware too short\n"); + error = EINVAL; + goto fail; + } + hdr = (const struct r92s_fw_hdr *)fw->data; + if (hdr->signature != htole16(0x8712) && + hdr->signature != htole16(0x8192)) { + device_printf(sc->sc_dev, + "invalid firmware signature 0x%x\n", + le16toh(hdr->signature)); + error = EINVAL; + goto fail; + } + DPRINTF("FW V%d %02x-%02x %02x:%02x\n", le16toh(hdr->version), + hdr->month, hdr->day, hdr->hour, hdr->minute); + + /* Make sure that driver and firmware are in sync. */ + if (hdr->privsz != htole32(sizeof(*dmem))) { + device_printf(sc->sc_dev, "unsupported firmware image\n"); + error = EINVAL; + goto fail; + } + /* Get FW sections sizes. */ + imemsz = le32toh(hdr->imemsz); + ememsz = le32toh(hdr->sramsz); + /* Check that all FW sections fit in image. */ + if (size < sizeof(*hdr) + imemsz + ememsz) { + device_printf(sc->sc_dev, "firmware too short\n"); + error = EINVAL; + goto fail; + } + imem = (const uint8_t *)&hdr[1]; + emem = imem + imemsz; + + /* Load IMEM section. */ + error = rsu_fw_loadsection(sc, imem, imemsz); + if (error != 0) { + device_printf(sc->sc_dev, + "could not load firmware section %s\n", "IMEM"); + goto fail; + } + /* Wait for load to complete. */ + for (ntries = 0; ntries < 10; ntries++) { + usb_pause_mtx(&sc->sc_mtx, 10); + reg = rsu_read_2(sc, R92S_TCR); + if (reg & R92S_TCR_IMEM_CODE_DONE) + break; + } + if (ntries == 10 || !(reg & R92S_TCR_IMEM_CHK_RPT)) { + device_printf(sc->sc_dev, "timeout waiting for %s transfer\n", + "IMEM"); + error = ETIMEDOUT; + goto fail; + } + + /* Load EMEM section. */ + error = rsu_fw_loadsection(sc, emem, ememsz); + if (error != 0) { + device_printf(sc->sc_dev, + "could not load firmware section %s\n", "EMEM"); + goto fail; + } + /* Wait for load to complete. */ + for (ntries = 0; ntries < 10; ntries++) { + usb_pause_mtx(&sc->sc_mtx, 10); + reg = rsu_read_2(sc, R92S_TCR); + if (reg & R92S_TCR_EMEM_CODE_DONE) + break; + } + if (ntries == 10 || !(reg & R92S_TCR_EMEM_CHK_RPT)) { + device_printf(sc->sc_dev, "timeout waiting for %s transfer\n", + "EMEM"); + error = ETIMEDOUT; + goto fail; + } + + /* Enable CPU. */ + rsu_write_1(sc, R92S_SYS_CLKR, + rsu_read_1(sc, R92S_SYS_CLKR) | R92S_SYS_CPU_CLKSEL); + if (!(rsu_read_1(sc, R92S_SYS_CLKR) & R92S_SYS_CPU_CLKSEL)) { + device_printf(sc->sc_dev, "could not enable system clock\n"); + error = EIO; + goto fail; + } + rsu_write_2(sc, R92S_SYS_FUNC_EN, + rsu_read_2(sc, R92S_SYS_FUNC_EN) | R92S_FEN_CPUEN); + if (!(rsu_read_2(sc, R92S_SYS_FUNC_EN) & R92S_FEN_CPUEN)) { + device_printf(sc->sc_dev, + "could not enable microcontroller\n"); + error = EIO; + goto fail; + } + /* Wait for CPU to initialize. */ + for (ntries = 0; ntries < 100; ntries++) { + if (rsu_read_2(sc, R92S_TCR) & R92S_TCR_IMEM_RDY) + break; + DELAY(1000); + } + if (ntries == 100) { + device_printf(sc->sc_dev, + "timeout waiting for microcontroller\n"); + error = ETIMEDOUT; + goto fail; + } + + /* Update DMEM section before loading. */ + dmem = __DECONST(struct r92s_fw_priv *, &hdr->priv); + memset(dmem, 0, sizeof(*dmem)); + dmem->hci_sel = R92S_HCI_SEL_USB | R92S_HCI_SEL_8172; + dmem->nendpoints = sc->npipes; + dmem->rf_config = 0x12; /* 1T2R */ + dmem->vcs_type = R92S_VCS_TYPE_AUTO; + dmem->vcs_mode = R92S_VCS_MODE_RTS_CTS; +#ifdef notyet + dmem->bw40_en = (ic->ic_htcaps & IEEE80211_HTCAP_CBW20_40) != 0; +#endif + dmem->turbo_mode = 1; + /* Load DMEM section. */ + error = rsu_fw_loadsection(sc, (uint8_t *)dmem, sizeof(*dmem)); + if (error != 0) { + device_printf(sc->sc_dev, + "could not load firmware section %s\n", "DMEM"); + goto fail; + } + /* Wait for load to complete. */ + for (ntries = 0; ntries < 100; ntries++) { + if (rsu_read_2(sc, R92S_TCR) & R92S_TCR_DMEM_CODE_DONE) + break; + DELAY(1000); + } + if (ntries == 100) { + device_printf(sc->sc_dev, "timeout waiting for %s transfer\n", + "DMEM"); + error = ETIMEDOUT; + goto fail; + } + /* Wait for firmware readiness. */ + for (ntries = 0; ntries < 60; ntries++) { + if (!(rsu_read_2(sc, R92S_TCR) & R92S_TCR_FWRDY)) + break; + DELAY(1000); + } + if (ntries == 60) { + device_printf(sc->sc_dev, + "timeout waiting for firmware readiness\n"); + error = ETIMEDOUT; + goto fail; + } + fail: + firmware_put(fw, FIRMWARE_UNLOAD); + return (error); +} + + +static int +rsu_raw_xmit(struct ieee80211_node *ni, struct mbuf *m, + const struct ieee80211_bpf_params *params) +{ + struct ieee80211com *ic = ni->ni_ic; + struct ifnet *ifp = ic->ic_ifp; + struct rsu_softc *sc = ifp->if_softc; + struct rsu_data *bf; + + /* prevent management frames from being sent if we're not ready */ + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { + m_freem(m); + ieee80211_free_node(ni); + return (ENETDOWN); + } + RSU_LOCK(sc); + bf = rsu_getbuf(sc); + if (bf == NULL) { + ieee80211_free_node(ni); + m_freem(m); + RSU_UNLOCK(sc); + return (ENOBUFS); + } + ifp->if_opackets++; + if (rsu_tx_start(sc, ni, m, bf) != 0) { + ieee80211_free_node(ni); + ifp->if_oerrors++; + STAILQ_INSERT_HEAD(&sc->sc_tx_inactive, bf, next); + RSU_UNLOCK(sc); + return (EIO); + } + RSU_UNLOCK(sc); + sc->sc_tx_timer = 5; + + return (0); +} + +static void +rsu_init(void *arg) +{ + struct rsu_softc *sc = arg; + + RSU_LOCK(sc); + rsu_init_locked(arg); + RSU_UNLOCK(sc); +} + +static void +rsu_init_locked(struct rsu_softc *sc) +{ + struct ifnet *ifp = sc->sc_ifp; + struct r92s_set_pwr_mode cmd; + int error; + + /* Init host async commands ring. */ + sc->cmdq.cur = sc->cmdq.next = sc->cmdq.queued = 0; + + /* Allocate Tx/Rx buffers. */ + error = rsu_alloc_rx_list(sc); + if (error != 0) { + device_printf(sc->sc_dev, "could not allocate Rx buffers\n"); + return; + } + error = rsu_alloc_tx_list(sc); + if (error != 0) { + device_printf(sc->sc_dev, "could not allocate Tx buffers\n"); + rsu_free_rx_list(sc); + return; + } + /* Power on adapter. */ + if (sc->cut == 1) + rsu_power_on_acut(sc); + else + rsu_power_on_bcut(sc); + /* Load firmware. */ + error = rsu_load_firmware(sc); + if (error != 0) + goto fail; + + /* Enable Rx TCP checksum offload. */ + rsu_write_4(sc, R92S_RCR, + rsu_read_4(sc, R92S_RCR) | 0x04000000); + /* Append PHY status. */ + rsu_write_4(sc, R92S_RCR, + rsu_read_4(sc, R92S_RCR) | 0x02000000); + + rsu_write_4(sc, R92S_CR, + rsu_read_4(sc, R92S_CR) & ~0xff000000); + + /* Use 128 bytes pages. */ + rsu_write_1(sc, 0x00b5, + rsu_read_1(sc, 0x00b5) | 0x01); + /* Enable USB Rx aggregation. */ + rsu_write_1(sc, 0x00bd, + rsu_read_1(sc, 0x00bd) | 0x80); + /* Set USB Rx aggregation threshold. */ + rsu_write_1(sc, 0x00d9, 0x01); + /* Set USB Rx aggregation timeout (1.7ms/4). */ + rsu_write_1(sc, 0xfe5b, 0x04); + /* Fix USB Rx FIFO issue. */ + rsu_write_1(sc, 0xfe5c, + rsu_read_1(sc, 0xfe5c) | 0x80); + + /* Set MAC address. */ + rsu_write_region_1(sc, R92S_MACID, IF_LLADDR(ifp), + IEEE80211_ADDR_LEN); + + /* NB: it really takes that long for firmware to boot. */ + usb_pause_mtx(&sc->sc_mtx, 1500); + + DPRINTF("setting MAC address to %s\n", ether_sprintf(IF_LLADDR(ifp))); + error = rsu_fw_cmd(sc, R92S_CMD_SET_MAC_ADDRESS, IF_LLADDR(ifp), + IEEE80211_ADDR_LEN); + if (error != 0) { + device_printf(sc->sc_dev, "could not set MAC address\n"); + goto fail; + } + + rsu_write_1(sc, R92S_USB_HRPWM, + R92S_USB_HRPWM_PS_ST_ACTIVE | R92S_USB_HRPWM_PS_ALL_ON); + + memset(&cmd, 0, sizeof(cmd)); + cmd.mode = R92S_PS_MODE_ACTIVE; + DPRINTF("setting ps mode to %d\n", cmd.mode); + error = rsu_fw_cmd(sc, R92S_CMD_SET_PWR_MODE, &cmd, sizeof(cmd)); + if (error != 0) { + device_printf(sc->sc_dev, "could not set PS mode\n"); + goto fail; + } + +#if 0 + if (ic->ic_htcaps & IEEE80211_HTCAP_CBW20_40) { + /* Enable 40MHz mode. */ + error = rsu_fw_iocmd(sc, + SM(R92S_IOCMD_CLASS, 0xf4) | + SM(R92S_IOCMD_INDEX, 0x00) | + SM(R92S_IOCMD_VALUE, 0x0007)); + if (error != 0) { + device_printf(sc->sc_dev, + "could not enable 40MHz mode\n"); + goto fail; + } + } + + /* Set default channel. */ + ic->ic_bss->ni_chan = ic->ic_ibss_chan; +#endif + sc->scan_pass = 0; + usbd_transfer_start(sc->sc_xfer[RSU_BULK_RX]); + + /* We're ready to go. */ + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + + callout_reset(&sc->sc_watchdog_ch, hz, rsu_watchdog, sc); + + return; +fail: + rsu_free_rx_list(sc); + rsu_free_tx_list(sc); + return; +} + +static void +rsu_stop(struct ifnet *ifp, int disable) +{ + struct rsu_softc *sc = ifp->if_softc; + + RSU_LOCK(sc); + rsu_stop_locked(ifp, disable); + RSU_UNLOCK(sc); +} + +static void +rsu_stop_locked(struct ifnet *ifp, int disable __unused) +{ + struct rsu_softc *sc = ifp->if_softc; + int i; + + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); + callout_stop(&sc->sc_watchdog_ch); + sc->sc_calibrating = 0; + taskqueue_cancel_timeout(taskqueue_thread, &sc->calib_task, NULL); + + /* Power off adapter. */ + rsu_power_off(sc); + + for (i = 0; i < RSU_N_TRANSFER; i++) + usbd_transfer_stop(sc->sc_xfer[i]); +} + diff --git a/sys/dev/usb/wlan/if_rsureg.h b/sys/dev/usb/wlan/if_rsureg.h new file mode 100644 index 000000000000..8258dac16aeb --- /dev/null +++ b/sys/dev/usb/wlan/if_rsureg.h @@ -0,0 +1,784 @@ + +/*- + * Copyright (c) 2010 Damien Bergamini <damien.bergamini@free.fr> + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $OpenBSD: if_rsureg.h,v 1.3 2013/04/15 09:23:01 mglocker Exp $ + * $FreeBSD$ + */ + +/* Maximum number of pipes is 11. */ +#define R92S_MAX_EP 11 + +/* USB Requests. */ +#define R92S_REQ_REGS 0x05 + +/* + * MAC registers. + */ +#define R92S_SYSCFG 0x0000 +#define R92S_SYS_ISO_CTRL (R92S_SYSCFG + 0x000) +#define R92S_SYS_FUNC_EN (R92S_SYSCFG + 0x002) +#define R92S_PMC_FSM (R92S_SYSCFG + 0x004) +#define R92S_SYS_CLKR (R92S_SYSCFG + 0x008) +#define R92S_EE_9346CR (R92S_SYSCFG + 0x00a) +#define R92S_AFE_MISC (R92S_SYSCFG + 0x010) +#define R92S_SPS0_CTRL (R92S_SYSCFG + 0x011) +#define R92S_SPS1_CTRL (R92S_SYSCFG + 0x018) +#define R92S_RF_CTRL (R92S_SYSCFG + 0x01f) +#define R92S_LDOA15_CTRL (R92S_SYSCFG + 0x020) +#define R92S_LDOV12D_CTRL (R92S_SYSCFG + 0x021) +#define R92S_AFE_XTAL_CTRL (R92S_SYSCFG + 0x026) +#define R92S_AFE_PLL_CTRL (R92S_SYSCFG + 0x028) +#define R92S_EFUSE_CTRL (R92S_SYSCFG + 0x030) +#define R92S_EFUSE_TEST (R92S_SYSCFG + 0x034) +#define R92S_EFUSE_CLK_CTRL (R92S_SYSCFG + 0x2f8) + +#define R92S_CMDCTRL 0x0040 +#define R92S_CR (R92S_CMDCTRL + 0x000) +#define R92S_TCR (R92S_CMDCTRL + 0x004) +#define R92S_RCR (R92S_CMDCTRL + 0x008) + +#define R92S_MACIDSETTING 0x0050 +#define R92S_MACID (R92S_MACIDSETTING + 0x000) + +#define R92S_GP 0x01e0 +#define R92S_GPIO_CTRL (R92S_GP + 0x00c) +#define R92S_GPIO_IO_SEL (R92S_GP + 0x00e) +#define R92S_MAC_PINMUX_CTRL (R92S_GP + 0x011) + +#define R92S_IOCMD_CTRL 0x0370 +#define R92S_IOCMD_DATA 0x0374 + +#define R92S_USB_HRPWM 0xfe58 + +/* Bits for R92S_SYS_FUNC_EN. */ +#define R92S_FEN_CPUEN 0x0400 + +/* Bits for R92S_PMC_FSM. */ +#define R92S_PMC_FSM_CUT_M 0x000f8000 +#define R92S_PMC_FSM_CUT_S 15 + +/* Bits for R92S_SYS_CLKR. */ +#define R92S_SYS_CLKSEL 0x0001 +#define R92S_SYS_PS_CLKSEL 0x0002 +#define R92S_SYS_CPU_CLKSEL 0x0004 +#define R92S_MAC_CLK_EN 0x0800 +#define R92S_SYS_CLK_EN 0x1000 +#define R92S_SWHW_SEL 0x4000 +#define R92S_FWHW_SEL 0x8000 + +/* Bits for R92S_EE_9346CR. */ +#define R92S_9356SEL 0x10 +#define R92S_EEPROM_EN 0x20 + +/* Bits for R92S_AFE_MISC. */ +#define R92S_AFE_MISC_BGEN 0x01 +#define R92S_AFE_MISC_MBEN 0x02 +#define R92S_AFE_MISC_I32_EN 0x08 + +/* Bits for R92S_SPS1_CTRL. */ +#define R92S_SPS1_LDEN 0x01 +#define R92S_SPS1_SWEN 0x02 + +/* Bits for R92S_LDOA15_CTRL. */ +#define R92S_LDA15_EN 0x01 + +/* Bits for R92S_LDOV12D_CTRL. */ +#define R92S_LDV12_EN 0x01 + +/* Bits for R92C_EFUSE_CTRL. */ +#define R92S_EFUSE_CTRL_DATA_M 0x000000ff +#define R92S_EFUSE_CTRL_DATA_S 0 +#define R92S_EFUSE_CTRL_ADDR_M 0x0003ff00 +#define R92S_EFUSE_CTRL_ADDR_S 8 +#define R92S_EFUSE_CTRL_VALID 0x80000000 + +/* Bits for R92S_CR. */ +#define R92S_CR_TXDMA_EN 0x10 + +/* Bits for R92S_TCR. */ +#define R92S_TCR_IMEM_CODE_DONE 0x01 +#define R92S_TCR_IMEM_CHK_RPT 0x02 +#define R92S_TCR_EMEM_CODE_DONE 0x04 +#define R92S_TCR_EMEM_CHK_RPT 0x08 +#define R92S_TCR_DMEM_CODE_DONE 0x10 +#define R92S_TCR_IMEM_RDY 0x20 +#define R92S_TCR_FWRDY 0x80 + +/* Bits for R92S_GPIO_IO_SEL. */ +#define R92S_GPIO_WPS 0x10 + +/* Bits for R92S_MAC_PINMUX_CTRL. */ +#define R92S_GPIOSEL_GPIO_M 0x03 +#define R92S_GPIOSEL_GPIO_S 0 +#define R92S_GPIOSEL_GPIO_JTAG 0 +#define R92S_GPIOSEL_GPIO_PHYDBG 1 +#define R92S_GPIOSEL_GPIO_BT 2 +#define R92S_GPIOSEL_GPIO_WLANDBG 3 +#define R92S_GPIOMUX_EN 0x08 + +/* Bits for R92S_IOCMD_CTRL. */ +#define R92S_IOCMD_CLASS_M 0xff000000 +#define R92S_IOCMD_CLASS_S 24 +#define R92S_IOCMD_CLASS_BB_RF 0xf0 +#define R92S_IOCMD_VALUE_M 0x00ffff00 +#define R92S_IOCMD_VALUE_S 8 +#define R92S_IOCMD_INDEX_M 0x000000ff +#define R92S_IOCMD_INDEX_S 0 +#define R92S_IOCMD_INDEX_BB_READ 0 +#define R92S_IOCMD_INDEX_BB_WRITE 1 +#define R92S_IOCMD_INDEX_RF_READ 2 +#define R92S_IOCMD_INDEX_RF_WRITE 3 + +/* Bits for R92S_USB_HRPWM. */ +#define R92S_USB_HRPWM_PS_ALL_ON 0x04 +#define R92S_USB_HRPWM_PS_ST_ACTIVE 0x08 + +/* + * Macros to access subfields in registers. + */ +/* Mask and Shift (getter). */ +#define MS(val, field) \ + (((val) & field##_M) >> field##_S) + +/* Shift and Mask (setter). */ +#define SM(field, val) \ + (((val) << field##_S) & field##_M) + +/* Rewrite. */ +#define RW(var, field, val) \ + (((var) & ~field##_M) | SM(field, val)) + +/* + * Firmware image header. + */ +struct r92s_fw_priv { + /* QWORD0 */ + uint16_t signature; + uint8_t hci_sel; +#define R92S_HCI_SEL_PCIE 0x01 +#define R92S_HCI_SEL_USB 0x02 +#define R92S_HCI_SEL_SDIO 0x04 +#define R92S_HCI_SEL_8172 0x10 +#define R92S_HCI_SEL_AP 0x80 + + uint8_t chip_version; + uint16_t custid; + uint8_t rf_config; + uint8_t nendpoints; + /* QWORD1 */ + uint32_t regulatory; + uint8_t rfintfs; + uint8_t def_nettype; + uint8_t turbo_mode; + uint8_t lowpower_mode; + /* QWORD2 */ + uint8_t lbk_mode; + uint8_t mp_mode; + uint8_t vcs_type; +#define R92S_VCS_TYPE_DISABLE 0 +#define R92S_VCS_TYPE_ENABLE 1 +#define R92S_VCS_TYPE_AUTO 2 + + uint8_t vcs_mode; +#define R92S_VCS_MODE_NONE 0 +#define R92S_VCS_MODE_RTS_CTS 1 +#define R92S_VCS_MODE_CTS2SELF 2 + + uint32_t reserved1; + /* QWORD3 */ + uint8_t qos_en; + uint8_t bw40_en; + uint8_t amsdu2ampdu_en; + uint8_t ampdu_en; + uint8_t rc_offload; + uint8_t agg_offload; + uint16_t reserved2; + /* QWORD4 */ + uint8_t beacon_offload; + uint8_t mlme_offload; + uint8_t hwpc_offload; + uint8_t tcpcsum_offload; + uint8_t tcp_offload; + uint8_t ps_offload; + uint8_t wwlan_offload; + uint8_t reserved3; + /* QWORD5 */ + uint16_t tcp_tx_len; + uint16_t tcp_rx_len; + uint32_t reserved4; +} __packed; + +struct r92s_fw_hdr { + uint16_t signature; + uint16_t version; + uint32_t dmemsz; + uint32_t imemsz; + uint32_t sramsz; + uint32_t privsz; + uint16_t efuse_addr; + uint16_t h2c_resp_addr; + uint32_t svnrev; + uint8_t month; + uint8_t day; + uint8_t hour; + uint8_t minute; + struct r92s_fw_priv priv; +} __packed; + +/* Structure for FW commands and FW events notifications. */ +struct r92s_fw_cmd_hdr { + uint16_t len; + uint8_t code; + uint8_t seq; +#define R92S_FW_CMD_MORE 0x80 + + uint32_t reserved; +} __packed; + +/* FW commands codes. */ +#define R92S_CMD_READ_MACREG 0 +#define R92S_CMD_WRITE_MACREG 1 +#define R92S_CMD_READ_BBREG 2 +#define R92S_CMD_WRITE_BBREG 3 +#define R92S_CMD_READ_RFREG 4 +#define R92S_CMD_WRITE_RFREG 5 +#define R92S_CMD_READ_EEPROM 6 +#define R92S_CMD_WRITE_EEPROM 7 +#define R92S_CMD_READ_EFUSE 8 +#define R92S_CMD_WRITE_EFUSE 9 +#define R92S_CMD_READ_CAM 10 +#define R92S_CMD_WRITE_CAM 11 +#define R92S_CMD_SET_BCNITV 12 +#define R92S_CMD_SET_MBIDCFG 13 +#define R92S_CMD_JOIN_BSS 14 +#define R92S_CMD_DISCONNECT 15 +#define R92S_CMD_CREATE_BSS 16 +#define R92S_CMD_SET_OPMODE 17 +#define R92S_CMD_SITE_SURVEY 18 +#define R92S_CMD_SET_AUTH 19 +#define R92S_CMD_SET_KEY 20 +#define R92S_CMD_SET_STA_KEY 21 +#define R92S_CMD_SET_ASSOC_STA 22 +#define R92S_CMD_DEL_ASSOC_STA 23 +#define R92S_CMD_SET_STAPWRSTATE 24 +#define R92S_CMD_SET_BASIC_RATE 25 +#define R92S_CMD_GET_BASIC_RATE 26 +#define R92S_CMD_SET_DATA_RATE 27 +#define R92S_CMD_GET_DATA_RATE 28 +#define R92S_CMD_SET_PHY_INFO 29 +#define R92S_CMD_GET_PHY_INFO 30 +#define R92S_CMD_SET_PHY 31 +#define R92S_CMD_GET_PHY 32 +#define R92S_CMD_READ_RSSI 33 +#define R92S_CMD_READ_GAIN 34 +#define R92S_CMD_SET_ATIM 35 +#define R92S_CMD_SET_PWR_MODE 36 +#define R92S_CMD_JOIN_BSS_RPT 37 +#define R92S_CMD_SET_RA_TABLE 38 +#define R92S_CMD_GET_RA_TABLE 39 +#define R92S_CMD_GET_CCX_REPORT 40 +#define R92S_CMD_GET_DTM_REPORT 41 +#define R92S_CMD_GET_TXRATE_STATS 42 +#define R92S_CMD_SET_USB_SUSPEND 43 +#define R92S_CMD_SET_H2C_LBK 44 +#define R92S_CMD_ADDBA_REQ 45 +#define R92S_CMD_SET_CHANNEL 46 +#define R92S_CMD_SET_TXPOWER 47 +#define R92S_CMD_SWITCH_ANTENNA 48 +#define R92S_CMD_SET_CRYSTAL_CAL 49 +#define R92S_CMD_SET_SINGLE_CARRIER_TX 50 +#define R92S_CMD_SET_SINGLE_TONE_TX 51 +#define R92S_CMD_SET_CARRIER_SUPPR_TX 52 +#define R92S_CMD_SET_CONTINUOUS_TX 53 +#define R92S_CMD_SWITCH_BANDWIDTH 54 +#define R92S_CMD_TX_BEACON 55 +#define R92S_CMD_SET_POWER_TRACKING 56 +#define R92S_CMD_AMSDU_TO_AMPDU 57 +#define R92S_CMD_SET_MAC_ADDRESS 58 +#define R92S_CMD_GET_H2C_LBK 59 +#define R92S_CMD_SET_PBREQ_IE 60 +#define R92S_CMD_SET_ASSOCREQ_IE 61 +#define R92S_CMD_SET_PBRESP_IE 62 +#define R92S_CMD_SET_ASSOCRESP_IE 63 +#define R92S_CMD_GET_CURDATARATE 64 +#define R92S_CMD_GET_TXRETRY_CNT 65 +#define R92S_CMD_GET_RXRETRY_CNT 66 +#define R92S_CMD_GET_BCNOK_CNT 67 +#define R92S_CMD_GET_BCNERR_CNT 68 +#define R92S_CMD_GET_CURTXPWR_LEVEL 69 +#define R92S_CMD_SET_DIG 70 +#define R92S_CMD_SET_RA 71 +#define R92S_CMD_SET_PT 72 +#define R92S_CMD_READ_TSSI 73 + +/* FW events notifications codes. */ +#define R92S_EVT_READ_MACREG 0 +#define R92S_EVT_READ_BBREG 1 +#define R92S_EVT_READ_RFREG 2 +#define R92S_EVT_READ_EEPROM 3 +#define R92S_EVT_READ_EFUSE 4 +#define R92S_EVT_READ_CAM 5 +#define R92S_EVT_GET_BASICRATE 6 +#define R92S_EVT_GET_DATARATE 7 +#define R92S_EVT_SURVEY 8 +#define R92S_EVT_SURVEY_DONE 9 +#define R92S_EVT_JOIN_BSS 10 +#define R92S_EVT_ADD_STA 11 +#define R92S_EVT_DEL_STA 12 +#define R92S_EVT_ATIM_DONE 13 +#define R92S_EVT_TX_REPORT 14 +#define R92S_EVT_CCX_REPORT 15 +#define R92S_EVT_DTM_REPORT 16 +#define R92S_EVT_TXRATE_STATS 17 +#define R92S_EVT_C2H_LBK 18 +#define R92S_EVT_FWDBG 19 +#define R92S_EVT_C2H_FEEDBACK 20 +#define R92S_EVT_ADDBA 21 +#define R92S_EVT_C2H_BCN 22 +#define R92S_EVT_PWR_STATE 23 +#define R92S_EVT_WPS_PBC 24 +#define R92S_EVT_ADDBA_REQ_REPORT 25 + +/* Structure for R92S_CMD_SITE_SURVEY. */ +struct r92s_fw_cmd_sitesurvey { + uint32_t active; + uint32_t limit; + uint32_t ssidlen; + uint8_t ssid[32 + 1]; +} __packed; + +/* Structure for R92S_CMD_SET_AUTH. */ +struct r92s_fw_cmd_auth { + uint8_t mode; +#define R92S_AUTHMODE_OPEN 0 +#define R92S_AUTHMODE_SHARED 1 +#define R92S_AUTHMODE_WPA 2 + + uint8_t dot1x; +} __packed; + +/* Structure for R92S_CMD_SET_KEY. */ +struct r92s_fw_cmd_set_key { + uint8_t algo; +#define R92S_KEY_ALGO_NONE 0 +#define R92S_KEY_ALGO_WEP40 1 +#define R92S_KEY_ALGO_TKIP 2 +#define R92S_KEY_ALGO_TKIP_MMIC 3 +#define R92S_KEY_ALGO_AES 4 +#define R92S_KEY_ALGO_WEP104 5 + + uint8_t id; + uint8_t grpkey; + uint8_t key[16]; +} __packed; + +/* Structures for R92S_EVENT_SURVEY/R92S_CMD_JOIN_BSS. */ +/* NDIS_802_11_SSID. */ +struct ndis_802_11_ssid { + uint32_t ssidlen; + uint8_t ssid[32]; +} __packed; + +/* NDIS_802_11_CONFIGURATION_FH. */ +struct ndis_802_11_configuration_fh { + uint32_t len; + uint32_t hoppattern; + uint32_t hopset; + uint32_t dwelltime; +} __packed; + +/* NDIS_802_11_CONFIGURATION. */ +struct ndis_802_11_configuration { + uint32_t len; + uint32_t bintval; + uint32_t atim; + uint32_t dsconfig; + struct ndis_802_11_configuration_fh fhconfig; +} __packed; + +/* NDIS_WLAN_BSSID_EX. */ +struct ndis_wlan_bssid_ex { + uint32_t len; + uint8_t macaddr[IEEE80211_ADDR_LEN]; + uint8_t reserved[2]; + struct ndis_802_11_ssid ssid; + uint32_t privacy; + int32_t rssi; + uint32_t networktype; +#define NDIS802_11FH 0 +#define NDIS802_11DS 1 +#define NDIS802_11OFDM5 2 +#define NDIS802_11OFDM24 3 +#define NDIS802_11AUTOMODE 4 + + struct ndis_802_11_configuration config; + uint32_t inframode; +#define NDIS802_11IBSS 0 +#define NDIS802_11INFRASTRUCTURE 1 +#define NDIS802_11AUTOUNKNOWN 2 +#define NDIS802_11MONITOR 3 +#define NDIS802_11APMODE 4 + + uint8_t supprates[16]; + uint32_t ieslen; + /* Followed by ``ieslen'' bytes. */ +} __packed; + +/* NDIS_802_11_FIXED_IEs. */ +struct ndis_802_11_fixed_ies { + uint8_t tstamp[8]; + uint16_t bintval; + uint16_t capabilities; +} __packed; + +/* Structure for R92S_CMD_SET_PWR_MODE. */ +struct r92s_set_pwr_mode { + uint8_t mode; +#define R92S_PS_MODE_ACTIVE 0 +#define R92S_PS_MODE_MIN 1 +#define R92S_PS_MODE_MAX 2 +#define R92S_PS_MODE_DTIM 3 +#define R92S_PS_MODE_VOIP 4 +#define R92S_PS_MODE_UAPSD_WMM 5 +#define R92S_PS_MODE_UAPSD 6 +#define R92S_PS_MODE_IBSS 7 +#define R92S_PS_MODE_WWLAN 8 +#define R92S_PS_MODE_RADIOOFF 9 +#define R92S_PS_MODE_DISABLE 10 + + uint8_t low_traffic_en; + uint8_t lpnav_en; + uint8_t rf_low_snr_en; + uint8_t dps_en; + uint8_t bcn_rx_en; + uint8_t bcn_pass_cnt; + uint8_t bcn_to; + uint16_t bcn_itv; + uint8_t app_itv; + uint8_t awake_bcn_itv; + uint8_t smart_ps; + uint8_t bcn_pass_time; +} __packed; + +/* Structure for event R92S_EVENT_JOIN_BSS. */ +struct r92s_event_join_bss { + uint32_t next; + uint32_t prev; + uint32_t networktype; + uint32_t fixed; + uint32_t lastscanned; + uint32_t associd; + uint32_t join_res; + struct ndis_wlan_bssid_ex bss; +} __packed; + +#define R92S_MACID_BSS 5 + +/* Rx MAC descriptor. */ +struct r92s_rx_stat { + uint32_t rxdw0; +#define R92S_RXDW0_PKTLEN_M 0x00003fff +#define R92S_RXDW0_PKTLEN_S 0 +#define R92S_RXDW0_CRCERR 0x00004000 +#define R92S_RXDW0_INFOSZ_M 0x000f0000 +#define R92S_RXDW0_INFOSZ_S 16 +#define R92S_RXDW0_QOS 0x00800000 +#define R92S_RXDW0_SHIFT_M 0x03000000 +#define R92S_RXDW0_SHIFT_S 24 +#define R92S_RXDW0_DECRYPTED 0x08000000 + + uint32_t rxdw1; +#define R92S_RXDW1_MOREFRAG 0x08000000 + + uint32_t rxdw2; +#define R92S_RXDW2_FRAG_M 0x0000f000 +#define R92S_RXDW2_FRAG_S 12 +#define R92S_RXDW2_PKTCNT_M 0x00ff0000 +#define R92S_RXDW2_PKTCNT_S 16 + + uint32_t rxdw3; +#define R92S_RXDW3_RATE_M 0x0000003f +#define R92S_RXDW3_RATE_S 0 +#define R92S_RXDW3_TCPCHKRPT 0x00000800 +#define R92S_RXDW3_IPCHKRPT 0x00001000 +#define R92S_RXDW3_TCPCHKVALID 0x00002000 +#define R92S_RXDW3_HTC 0x00004000 + + uint32_t rxdw4; + uint32_t rxdw5; +} __packed __attribute__((aligned(4))); + +/* Rx PHY descriptor. */ +struct r92s_rx_phystat { + uint32_t phydw0; + uint32_t phydw1; + uint32_t phydw2; + uint32_t phydw3; + uint32_t phydw4; + uint32_t phydw5; + uint32_t phydw6; + uint32_t phydw7; +} __packed __attribute__((aligned(4))); + +/* Rx PHY CCK descriptor. */ +struct r92s_rx_cck { + uint8_t adc_pwdb[4]; + uint8_t sq_rpt; + uint8_t agc_rpt; +} __packed; + +/* Tx MAC descriptor. */ +struct r92s_tx_desc { + uint32_t txdw0; +#define R92S_TXDW0_PKTLEN_M 0x0000ffff +#define R92S_TXDW0_PKTLEN_S 0 +#define R92S_TXDW0_OFFSET_M 0x00ff0000 +#define R92S_TXDW0_OFFSET_S 16 +#define R92S_TXDW0_TYPE_M 0x03000000 +#define R92S_TXDW0_TYPE_S 24 +#define R92S_TXDW0_LSG 0x04000000 +#define R92S_TXDW0_FSG 0x08000000 +#define R92S_TXDW0_LINIP 0x10000000 +#define R92S_TXDW0_OWN 0x80000000 + + uint32_t txdw1; +#define R92S_TXDW1_MACID_M 0x0000001f +#define R92S_TXDW1_MACID_S 0 +#define R92S_TXDW1_MOREDATA 0x00000020 +#define R92S_TXDW1_MOREFRAG 0x00000040 +#define R92S_TXDW1_QSEL_M 0x00001f00 +#define R92S_TXDW1_QSEL_S 8 +#define R92S_TXDW1_QSEL_BE 0x03 +#define R92S_TXDW1_QSEL_H2C 0x1f +#define R92S_TXDW1_NONQOS 0x00010000 +#define R92S_TXDW1_KEYIDX_M 0x00060000 +#define R92S_TXDW1_KEYIDX_S 17 +#define R92S_TXDW1_CIPHER_M 0x00c00000 +#define R92S_TXDW1_CIPHER_S 22 +#define R92S_TXDW1_CIPHER_WEP 1 +#define R92S_TXDW1_CIPHER_TKIP 2 +#define R92S_TXDW1_CIPHER_AES 3 +#define R92S_TXDW1_HWPC 0x80000000 + + uint32_t txdw2; +#define R92S_TXDW2_BMCAST 0x00000080 +#define R92S_TXDW2_AGGEN 0x20000000 +#define R92S_TXDW2_BK 0x40000000 + + uint32_t txdw3; +#define R92S_TXDW3_SEQ_M 0x0fff0000 +#define R92S_TXDW3_SEQ_S 16 +#define R92S_TXDW3_FRAG_M 0xf0000000 +#define R92S_TXDW3_FRAG_S 28 + + uint32_t txdw4; +#define R92S_TXDW4_TXBW 0x00040000 + + uint32_t txdw5; +#define R92S_TXDW5_DISFB 0x00008000 + + uint16_t ipchksum; + uint16_t tcpchksum; + + uint16_t txbufsize; + uint16_t reserved1; +} __packed __attribute__((aligned(4))); + + +/* + * Driver definitions. + */ +#define RSU_RX_LIST_COUNT 1 +#ifdef __OpenBSD__ +#define RSU_TX_LIST_COUNT (8 + 1) /* NB: +1 for FW commands. */ +#else +#define RSU_TX_LIST_COUNT 32 +#endif + +#define RSU_HOST_CMD_RING_COUNT 32 + +#define RSU_RXBUFSZ (8 * 1024) +#define RSU_TXBUFSZ \ + ((sizeof(struct r92s_tx_desc) + IEEE80211_MAX_LEN + 3) & ~3) + +#define RSU_TX_TIMEOUT 5000 /* ms */ +#define RSU_CMD_TIMEOUT 2000 /* ms */ + +/* Queue ids (used by soft only). */ +#define RSU_QID_BCN 0 +#define RSU_QID_MGT 1 +#define RSU_QID_BMC 2 +#define RSU_QID_VO 3 +#define RSU_QID_VI 4 +#define RSU_QID_BE 5 +#define RSU_QID_BK 6 +#define RSU_QID_RXOFF 7 +#define RSU_QID_H2C 8 +#define RSU_QID_C2H 9 + +/* Map AC to queue id. */ +static const uint8_t rsu_ac2qid[WME_NUM_AC] = { + RSU_QID_BE, + RSU_QID_BK, + RSU_QID_VI, + RSU_QID_VO +}; + +/* Pipe index to endpoint address mapping. */ +static const uint8_t r92s_epaddr[] = + { 0x83, 0x04, 0x06, 0x0d, + 0x05, 0x07, + 0x89, 0x0a, 0x0b, 0x0c }; + +/* Queue id to pipe index mapping for 4 endpoints configurations. */ +static const uint8_t rsu_qid2idx_4ep[] = + { 3, 3, 3, 1, 1, 2, 2, 0, 3, 0 }; + +/* Queue id to pipe index mapping for 6 endpoints configurations. */ +static const uint8_t rsu_qid2idx_6ep[] = + { 3, 3, 3, 1, 4, 2, 5, 0, 3, 0 }; + +/* Queue id to pipe index mapping for 11 endpoints configurations. */ +static const uint8_t rsu_qid2idx_11ep[] = + { 7, 9, 8, 1, 4, 2, 5, 0, 3, 6 }; + +struct rsu_rx_radiotap_header { + struct ieee80211_radiotap_header wr_ihdr; + uint8_t wr_flags; + uint8_t wr_rate; + uint16_t wr_chan_freq; + uint16_t wr_chan_flags; + uint8_t wr_dbm_antsignal; +} __packed __aligned(8); + +#define RSU_RX_RADIOTAP_PRESENT \ + (1 << IEEE80211_RADIOTAP_FLAGS | \ + 1 << IEEE80211_RADIOTAP_RATE | \ + 1 << IEEE80211_RADIOTAP_CHANNEL | \ + 1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL) + +struct rsu_tx_radiotap_header { + struct ieee80211_radiotap_header wt_ihdr; + uint8_t wt_flags; + uint16_t wt_chan_freq; + uint16_t wt_chan_flags; +} __packed __aligned(8); + +#define RSU_TX_RADIOTAP_PRESENT \ + (1 << IEEE80211_RADIOTAP_FLAGS | \ + 1 << IEEE80211_RADIOTAP_CHANNEL) + +struct rsu_softc; + +struct rsu_host_cmd { + void (*cb)(struct rsu_softc *, void *); + uint8_t data[256]; +}; + +struct rsu_cmd_newstate { + enum ieee80211_state state; + int arg; +}; + +struct rsu_cmd_key { + struct ieee80211_key key; +}; + +struct rsu_host_cmd_ring { + struct rsu_host_cmd cmd[RSU_HOST_CMD_RING_COUNT]; + int cur; + int next; + int queued; +}; + +enum { + RSU_BULK_RX, + RSU_BULK_TX_BE, /* = WME_AC_BE */ + RSU_BULK_TX_BK, /* = WME_AC_BK */ + RSU_BULK_TX_VI, /* = WME_AC_VI */ + RSU_BULK_TX_VO, /* = WME_AC_VI */ + RSU_N_TRANSFER = 5, +}; + +struct rsu_data { + struct rsu_softc *sc; + uint8_t *buf; + uint16_t buflen; + struct mbuf *m; + struct ieee80211_node *ni; + STAILQ_ENTRY(rsu_data) next; +}; + +struct rsu_vap { + struct ieee80211vap vap; + struct ieee80211_beacon_offsets bo; + + int (*newstate)(struct ieee80211vap *, + enum ieee80211_state, int); +}; +#define RSU_VAP(vap) ((struct rsu_vap *)(vap)) + +#define RSU_LOCK(sc) mtx_lock(&(sc)->sc_mtx) +#define RSU_UNLOCK(sc) mtx_unlock(&(sc)->sc_mtx) +#define RSU_ASSERT_LOCKED(sc) mtx_assert(&(sc)->sc_mtx, MA_OWNED) + +struct rsu_softc { + struct ifnet *sc_ifp; + device_t sc_dev; + struct usb_device *sc_udev; + int (*sc_newstate)(struct ieee80211com *, + enum ieee80211_state, int); + struct usbd_interface *sc_iface; + struct timeout_task calib_task; + struct callout sc_watchdog_ch; + struct usbd_pipe *pipe[R92S_MAX_EP]; + int npipes; + const uint8_t *qid2idx; + struct mtx sc_mtx; + + u_int cut; + int scan_pass; + int sc_tx_timer; + struct rsu_host_cmd_ring cmdq; + struct rsu_data sc_rx[RSU_RX_LIST_COUNT]; + struct rsu_data sc_tx[RSU_TX_LIST_COUNT]; + struct rsu_data *fwcmd_data; + uint8_t cmd_seq; + uint8_t rom[128]; + uint8_t sc_bssid[IEEE80211_ADDR_LEN]; + struct usb_xfer *sc_xfer[RSU_N_TRANSFER]; + uint8_t sc_calibrating; + + STAILQ_HEAD(, rsu_data) sc_rx_active; + STAILQ_HEAD(, rsu_data) sc_rx_inactive; + STAILQ_HEAD(, rsu_data) sc_tx_active; + STAILQ_HEAD(, rsu_data) sc_tx_inactive; + STAILQ_HEAD(, rsu_data) sc_tx_pending; + + union { + struct rsu_rx_radiotap_header th; + uint8_t pad[64]; + } sc_rxtapu; +#define sc_rxtap sc_rxtapu.th + int sc_rxtap_len; + + union { + struct rsu_tx_radiotap_header th; + uint8_t pad[64]; + } sc_txtapu; +#define sc_txtap sc_txtapu.th + int sc_txtap_len; +}; diff --git a/sys/dev/usb/wlan/if_rumvar.h b/sys/dev/usb/wlan/if_rumvar.h index bc74e57f7bbc..17944aaf3b41 100644 --- a/sys/dev/usb/wlan/if_rumvar.h +++ b/sys/dev/usb/wlan/if_rumvar.h @@ -29,7 +29,7 @@ struct rum_rx_radiotap_header { int8_t wr_antsignal; int8_t wr_antnoise; uint8_t wr_antenna; -}; +} __packed __aligned(8); #define RT2573_RX_RADIOTAP_PRESENT \ ((1 << IEEE80211_RADIOTAP_FLAGS) | \ @@ -47,7 +47,7 @@ struct rum_tx_radiotap_header { uint16_t wt_chan_freq; uint16_t wt_chan_flags; uint8_t wt_antenna; -}; +} __packed __aligned(8); #define RT2573_TX_RADIOTAP_PRESENT \ ((1 << IEEE80211_RADIOTAP_FLAGS) | \ diff --git a/sys/dev/usb/wlan/if_runvar.h b/sys/dev/usb/wlan/if_runvar.h index 24f308eae559..37ae3fa4ce15 100644 --- a/sys/dev/usb/wlan/if_runvar.h +++ b/sys/dev/usb/wlan/if_runvar.h @@ -58,7 +58,7 @@ struct run_rx_radiotap_header { int8_t wr_dbm_antsignal; uint8_t wr_antenna; uint8_t wr_antsignal; -} __packed; +} __packed __aligned(8); #define RUN_RX_RADIOTAP_PRESENT \ (1 << IEEE80211_RADIOTAP_FLAGS | \ @@ -75,7 +75,7 @@ struct run_tx_radiotap_header { uint16_t wt_chan_freq; uint16_t wt_chan_flags; uint8_t wt_hwqueue; -} __packed; +} __packed __aligned(8); #define IEEE80211_RADIOTAP_HWQUEUE 15 diff --git a/sys/dev/usb/wlan/if_uathvar.h b/sys/dev/usb/wlan/if_uathvar.h index ed84ba9029bc..fae360460bbb 100644 --- a/sys/dev/usb/wlan/if_uathvar.h +++ b/sys/dev/usb/wlan/if_uathvar.h @@ -52,7 +52,7 @@ struct uath_rx_radiotap_header { int8_t wr_antsignal; int8_t wr_antnoise; u_int8_t wr_antenna; -} __packed; +} __packed __aligned(8); #define UATH_RX_RADIOTAP_PRESENT ( \ (1 << IEEE80211_RADIOTAP_TSFT) | \ @@ -69,7 +69,7 @@ struct uath_tx_radiotap_header { uint8_t wt_flags; uint16_t wt_chan_freq; uint16_t wt_chan_flags; -} __packed; +} __packed __aligned(8); #define UATH_TX_RADIOTAP_PRESENT \ ((1 << IEEE80211_RADIOTAP_FLAGS) | \ diff --git a/sys/dev/usb/wlan/if_upgtvar.h b/sys/dev/usb/wlan/if_upgtvar.h index 070f9f6769eb..c50276be9cb4 100644 --- a/sys/dev/usb/wlan/if_upgtvar.h +++ b/sys/dev/usb/wlan/if_upgtvar.h @@ -380,7 +380,7 @@ struct upgt_rx_radiotap_header { uint16_t wr_chan_freq; uint16_t wr_chan_flags; int8_t wr_antsignal; -} __packed; +} __packed __aligned(8); #define UPGT_RX_RADIOTAP_PRESENT \ ((1 << IEEE80211_RADIOTAP_FLAGS) | \ @@ -394,7 +394,7 @@ struct upgt_tx_radiotap_header { uint8_t wt_rate; uint16_t wt_chan_freq; uint16_t wt_chan_flags; -} __packed; +} __packed __aligned(8); #define UPGT_TX_RADIOTAP_PRESENT \ ((1 << IEEE80211_RADIOTAP_FLAGS) | \ diff --git a/sys/dev/usb/wlan/if_uralvar.h b/sys/dev/usb/wlan/if_uralvar.h index 3bd015e219b5..c62b0e449680 100644 --- a/sys/dev/usb/wlan/if_uralvar.h +++ b/sys/dev/usb/wlan/if_uralvar.h @@ -34,7 +34,7 @@ struct ural_rx_radiotap_header { int8_t wr_antsignal; int8_t wr_antnoise; uint8_t wr_antenna; -}; +} __packed __aligned(8); #define RAL_RX_RADIOTAP_PRESENT \ ((1 << IEEE80211_RADIOTAP_FLAGS) | \ @@ -51,7 +51,7 @@ struct ural_tx_radiotap_header { uint16_t wt_chan_freq; uint16_t wt_chan_flags; uint8_t wt_antenna; -}; +} __packed __aligned(8); #define RAL_TX_RADIOTAP_PRESENT \ ((1 << IEEE80211_RADIOTAP_FLAGS) | \ diff --git a/sys/dev/usb/wlan/if_urtwnreg.h b/sys/dev/usb/wlan/if_urtwnreg.h index c827b3e1398b..51fa99051bc0 100644 --- a/sys/dev/usb/wlan/if_urtwnreg.h +++ b/sys/dev/usb/wlan/if_urtwnreg.h @@ -1030,7 +1030,7 @@ struct urtwn_rx_radiotap_header { uint16_t wr_chan_freq; uint16_t wr_chan_flags; uint8_t wr_dbm_antsignal; -} __packed; +} __packed __aligned(8); #define URTWN_RX_RADIOTAP_PRESENT \ (1 << IEEE80211_RADIOTAP_FLAGS | \ @@ -1043,7 +1043,7 @@ struct urtwn_tx_radiotap_header { uint8_t wt_flags; uint16_t wt_chan_freq; uint16_t wt_chan_flags; -} __packed; +} __packed __aligned(8); #define URTWN_TX_RADIOTAP_PRESENT \ (1 << IEEE80211_RADIOTAP_FLAGS | \ diff --git a/sys/dev/usb/wlan/if_urtwvar.h b/sys/dev/usb/wlan/if_urtwvar.h index 6b551065be63..e99cbf4e30a7 100644 --- a/sys/dev/usb/wlan/if_urtwvar.h +++ b/sys/dev/usb/wlan/if_urtwvar.h @@ -63,7 +63,7 @@ struct urtw_rx_radiotap_header { uint16_t wr_chan_freq; uint16_t wr_chan_flags; int8_t wr_dbm_antsignal; -} __packed; +} __packed __aligned(8); #define URTW_RX_RADIOTAP_PRESENT \ ((1 << IEEE80211_RADIOTAP_FLAGS) | \ @@ -75,7 +75,7 @@ struct urtw_tx_radiotap_header { uint8_t wt_flags; uint16_t wt_chan_freq; uint16_t wt_chan_flags; -} __packed; +} __packed __aligned(8); #define URTW_TX_RADIOTAP_PRESENT \ ((1 << IEEE80211_RADIOTAP_FLAGS) | \ diff --git a/sys/dev/usb/wlan/if_zydreg.h b/sys/dev/usb/wlan/if_zydreg.h index 34742e929912..06ba2abe2bbf 100644 --- a/sys/dev/usb/wlan/if_zydreg.h +++ b/sys/dev/usb/wlan/if_zydreg.h @@ -1185,7 +1185,7 @@ struct zyd_rx_radiotap_header { uint16_t wr_chan_flags; int8_t wr_antsignal; int8_t wr_antnoise; -} __packed; +} __packed __aligned(8); #define ZYD_RX_RADIOTAP_PRESENT \ ((1 << IEEE80211_RADIOTAP_FLAGS) | \ @@ -1200,7 +1200,7 @@ struct zyd_tx_radiotap_header { uint8_t wt_rate; uint16_t wt_chan_freq; uint16_t wt_chan_flags; -} __packed; +} __packed __aligned(8); #define ZYD_TX_RADIOTAP_PRESENT \ ((1 << IEEE80211_RADIOTAP_FLAGS) | \ diff --git a/sys/dev/watchdog/watchdog.c b/sys/dev/watchdog/watchdog.c index 71d8ecdb6ecb..54a5db9cc9b7 100644 --- a/sys/dev/watchdog/watchdog.c +++ b/sys/dev/watchdog/watchdog.c @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include <sys/kernel.h> #include <sys/malloc.h> #include <sys/module.h> +#include <sys/sysctl.h> #include <sys/syslog.h> #include <sys/watchdog.h> #include <sys/bus.h> @@ -60,10 +61,56 @@ static int wd_softtimeout_act = WD_SOFT_LOG; /* action for the software timeout static struct cdev *wd_dev; static volatile u_int wd_last_u; /* last timeout value set by kern_do_pat */ +static u_int wd_last_u_sysctl; /* last timeout value set by kern_do_pat */ +static u_int wd_last_u_sysctl_secs; /* wd_last_u in seconds */ + +SYSCTL_NODE(_hw, OID_AUTO, watchdog, CTLFLAG_RD, 0, "Main watchdog device"); +SYSCTL_UINT(_hw_watchdog, OID_AUTO, wd_last_u, CTLFLAG_RD, + &wd_last_u_sysctl, 0, "Watchdog last update time"); +SYSCTL_UINT(_hw_watchdog, OID_AUTO, wd_last_u_secs, CTLFLAG_RD, + &wd_last_u_sysctl_secs, 0, "Watchdog last update time"); static int wd_lastpat_valid = 0; static time_t wd_lastpat = 0; /* when the watchdog was last patted */ +static void +pow2ns_to_ts(int pow2ns, struct timespec *ts) +{ + uint64_t ns; + + ns = 1ULL << pow2ns; + ts->tv_sec = ns / 1000000000ULL; + ts->tv_nsec = ns % 1000000000ULL; +} + +static int +pow2ns_to_ticks(int pow2ns) +{ + struct timeval tv; + struct timespec ts; + + pow2ns_to_ts(pow2ns, &ts); + TIMESPEC_TO_TIMEVAL(&tv, &ts); + return (tvtohz(&tv)); +} + +static int +seconds_to_pow2ns(int seconds) +{ + uint64_t power; + uint64_t ns; + uint64_t shifted; + + ns = ((uint64_t)seconds) * 1000000000ULL; + power = flsll(ns); + shifted = 1ULL << power; + if (shifted <= ns) { + power++; + } + return (power); +} + + int wdog_kern_pat(u_int utim) { @@ -86,6 +133,8 @@ wdog_kern_pat(u_int utim) * This can be zero (to disable the watchdog) */ wd_last_u = (utim & WD_INTERVAL); + wd_last_u_sysctl = wd_last_u; + wd_last_u_sysctl_secs = pow2ns_to_ticks(wd_last_u) / hz; } if ((utim & WD_INTERVAL) == WD_TO_NEVER) { utim = 0; @@ -101,7 +150,7 @@ wdog_kern_pat(u_int utim) callout_stop(&wd_softtimeo_handle); } else { (void) callout_reset(&wd_softtimeo_handle, - hz*utim, wd_timeout_cb, "soft"); + pow2ns_to_ticks(utim), wd_timeout_cb, "soft"); } error = 0; } else { @@ -201,10 +250,13 @@ static int wd_set_pretimeout(int newtimeout, int disableiftoolong) { u_int utime; + struct timespec utime_ts; + int timeout_ticks; utime = wdog_kern_last_timeout(); + pow2ns_to_ts(utime, &utime_ts); /* do not permit a pre-timeout >= than the timeout. */ - if (newtimeout >= utime) { + if (newtimeout >= utime_ts.tv_sec) { /* * If 'disableiftoolong' then just fall through * so as to disable the pre-watchdog @@ -222,8 +274,22 @@ wd_set_pretimeout(int newtimeout, int disableiftoolong) return 0; } + timeout_ticks = pow2ns_to_ticks(utime) - (hz*newtimeout); +#if 0 + printf("wd_set_pretimeout: " + "newtimeout: %d, " + "utime: %d -> utime_ticks: %d, " + "hz*newtimeout: %d, " + "timeout_ticks: %d -> sec: %d\n", + newtimeout, + utime, pow2ns_to_ticks(utime), + hz*newtimeout, + timeout_ticks, timeout_ticks / hz); +#endif + /* We determined the value is sane, so reset the callout */ - (void) callout_reset(&wd_pretimeo_handle, hz*(utime - newtimeout), + (void) callout_reset(&wd_pretimeo_handle, + timeout_ticks, wd_timeout_cb, "pre-timeout"); wd_pretimeout = newtimeout; return 0; @@ -282,7 +348,7 @@ wd_ioctl(struct cdev *dev __unused, u_long cmd, caddr_t data, break; case WDIOC_SETTIMEOUT: u = *(u_int *)data; - error = wdog_kern_pat(u); + error = wdog_kern_pat(seconds_to_pow2ns(u)); break; case WDIOC_GETTIMEOUT: u = wdog_kern_last_timeout(); diff --git a/sys/dev/wi/if_wi.c b/sys/dev/wi/if_wi.c index 2ca3c8cf8fa1..c9bf2e069b16 100644 --- a/sys/dev/wi/if_wi.c +++ b/sys/dev/wi/if_wi.c @@ -1905,8 +1905,7 @@ wi_seek_bap(struct wi_softc *sc, int id, int off) static int wi_read_bap(struct wi_softc *sc, int id, int off, void *buf, int buflen) { - u_int16_t *ptr; - int i, error, cnt; + int error, cnt; if (buflen == 0) return 0; @@ -1915,9 +1914,7 @@ wi_read_bap(struct wi_softc *sc, int id, int off, void *buf, int buflen) return error; } cnt = (buflen + 1) / 2; - ptr = (u_int16_t *)buf; - for (i = 0; i < cnt; i++) - *ptr++ = CSR_READ_2(sc, WI_DATA0); + CSR_READ_MULTI_STREAM_2(sc, WI_DATA0, (u_int16_t *)buf, cnt); sc->sc_bap_off += cnt * 2; return 0; } @@ -1925,8 +1922,7 @@ wi_read_bap(struct wi_softc *sc, int id, int off, void *buf, int buflen) static int wi_write_bap(struct wi_softc *sc, int id, int off, void *buf, int buflen) { - u_int16_t *ptr; - int i, error, cnt; + int error, cnt; if (buflen == 0) return 0; @@ -1936,9 +1932,7 @@ wi_write_bap(struct wi_softc *sc, int id, int off, void *buf, int buflen) return error; } cnt = (buflen + 1) / 2; - ptr = (u_int16_t *)buf; - for (i = 0; i < cnt; i++) - CSR_WRITE_2(sc, WI_DATA0, ptr[i]); + CSR_WRITE_MULTI_STREAM_2(sc, WI_DATA0, (u_int16_t *)buf, cnt); sc->sc_bap_off += cnt * 2; return 0; diff --git a/sys/dev/wi/if_wi_macio.c b/sys/dev/wi/if_wi_macio.c new file mode 100644 index 000000000000..ab1d8753e3ea --- /dev/null +++ b/sys/dev/wi/if_wi_macio.c @@ -0,0 +1,141 @@ +/*- + * Copyright (c) 2013 Justin Hibbits + * All rights reserved. + * Copyright (c) 1997, 1998, 1999 + * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Bill Paul. + * 4. Neither the name of the author nor the names of any co-contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * Lucent WaveLAN/IEEE 802.11 MacIO attachment for FreeBSD. + * + * Based on the PCMCIA driver + * Written by Bill Paul <wpaul@ctr.columbia.edu> + * Electrical Engineering Department + * Columbia University, New York City + */ + +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); + +#include <sys/param.h> +#include <sys/kernel.h> +#include <sys/socket.h> +#include <sys/systm.h> +#include <sys/module.h> +#include <sys/bus.h> + +#include <machine/bus.h> +#include <machine/resource.h> +#include <sys/rman.h> + +#include <dev/ofw/ofw_bus.h> +#include <dev/ofw/openfirm.h> +#include <machine/ofw_machdep.h> + +#include <net/if.h> +#include <net/if_arp.h> +#include <net/ethernet.h> +#include <net/if_dl.h> +#include <net/if_media.h> +#include <net/if_types.h> + +#include <net80211/ieee80211_var.h> +#include <net80211/ieee80211_radiotap.h> + +#include <dev/wi/if_wavelan_ieee.h> +#include <dev/wi/if_wireg.h> +#include <dev/wi/if_wivar.h> + +static int wi_macio_probe(device_t); +static int wi_macio_attach(device_t); + +static device_method_t wi_macio_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, wi_macio_probe), + DEVMETHOD(device_attach, wi_macio_attach), + DEVMETHOD(device_detach, wi_detach), + DEVMETHOD(device_shutdown, wi_shutdown), + + { 0, 0 } +}; + +static driver_t wi_macio_driver = { + "wi", + wi_macio_methods, + sizeof(struct wi_softc) +}; + +DRIVER_MODULE(wi, macio, wi_macio_driver, wi_devclass, 0, 0); +MODULE_DEPEND(wi, wlan, 1, 1, 1); + +static int +wi_macio_probe(device_t dev) +{ + const char *name, *compat; + + /* Make sure we're a network driver */ + name = ofw_bus_get_name(dev); + if (name == NULL) + return (ENXIO); + + if (strcmp(name, "radio") != 0) { + return ENXIO; + } + compat = ofw_bus_get_compat(dev); + if (strcmp(compat, "wireless") != 0) { + return ENXIO; + } + + device_set_desc(dev, "Apple Airport"); + return 0; +} + +static int +wi_macio_attach(device_t dev) +{ + struct wi_softc *sc; + int error; + + sc = device_get_softc(dev); + sc->wi_gone = 0; + sc->wi_bus_type = 0; + + error = wi_alloc(dev, 0); + if (error == 0) { + /* Make sure interrupts are disabled. */ + CSR_WRITE_2(sc, WI_INT_EN, 0); + CSR_WRITE_2(sc, WI_EVENT_ACK, 0xFFFF); + + error = wi_attach(dev); + if (error != 0) + wi_free(dev); + } + return error; +} diff --git a/sys/fs/cd9660/iso.h b/sys/fs/cd9660/iso.h index 89322e74dab6..a831d7b881c4 100644 --- a/sys/fs/cd9660/iso.h +++ b/sys/fs/cd9660/iso.h @@ -291,56 +291,65 @@ u_short sgetrune(const char *, size_t, char const **, int, void *); */ static __inline uint8_t -isonum_711(unsigned char *p) +isonum_711(const unsigned char *p) { - return p[0]; + + return (p[0]); } -static __inline uint8_t -isonum_712(unsigned char *p) +static __inline int8_t +isonum_712(const unsigned char *p) { - return p[0]; + + return ((signed char)p[0]); } static __inline uint8_t -isonum_713(unsigned char *p) +isonum_713(const unsigned char *p) { - return p[0]; + + return (p[0]); } static __inline uint16_t -isonum_721(unsigned char *p) +isonum_721(const unsigned char *p) { + return (p[0] | p[1] << 8); } static __inline uint16_t -isonum_722(unsigned char *p) +isonum_722(const unsigned char *p) { + return (p[1] | p[0] << 8); } static __inline uint16_t -isonum_723(unsigned char *p) +isonum_723(const unsigned char *p) { + return (p[0] | p[1] << 8); } static __inline uint32_t -isonum_731(unsigned char *p) +isonum_731(const unsigned char *p) { + return (p[0] | p[1] << 8 | p[2] << 16 | p[3] << 24); } static __inline uint32_t -isonum_732(unsigned char *p) +isonum_732(const unsigned char *p) { + return (p[3] | p[2] << 8 | p[1] << 16 | p[0] << 24); } static __inline uint32_t -isonum_733(unsigned char *p) +isonum_733(const unsigned char *p) { + return (p[0] | p[1] << 8 | p[2] << 16 | p[3] << 24); } diff --git a/sys/fs/devfs/devfs_rule.c b/sys/fs/devfs/devfs_rule.c index f37dd9dbafb5..dd06e36482ec 100644 --- a/sys/fs/devfs/devfs_rule.c +++ b/sys/fs/devfs/devfs_rule.c @@ -101,7 +101,7 @@ struct devfs_ruleset { static devfs_rid devfs_rid_input(devfs_rid rid, struct devfs_mount *dm); static void devfs_rule_applyde_recursive(struct devfs_krule *dk, - struct devfs_dirent *de); + struct devfs_mount *dm, struct devfs_dirent *de); static void devfs_rule_applydm(struct devfs_krule *dk, struct devfs_mount *dm); static int devfs_rule_autonumber(struct devfs_ruleset *ds, devfs_rnum *rnp); static struct devfs_krule *devfs_rule_byid(devfs_rid rid); @@ -109,13 +109,16 @@ static int devfs_rule_delete(struct devfs_krule *dkp); static struct cdev *devfs_rule_getdev(struct devfs_dirent *de); static int devfs_rule_input(struct devfs_rule *dr, struct devfs_mount *dm); static int devfs_rule_insert(struct devfs_rule *dr); -static int devfs_rule_match(struct devfs_krule *dk, struct devfs_dirent *de); -static int devfs_rule_matchpath(struct devfs_krule *dk, +static int devfs_rule_match(struct devfs_krule *dk, struct devfs_mount *dm, + struct devfs_dirent *de); +static int devfs_rule_matchpath(struct devfs_krule *dk, struct devfs_mount *dm, struct devfs_dirent *de); -static void devfs_rule_run(struct devfs_krule *dk, struct devfs_dirent *de, unsigned depth); +static void devfs_rule_run(struct devfs_krule *dk, struct devfs_mount *dm, + struct devfs_dirent *de, unsigned depth); static void devfs_ruleset_applyde(struct devfs_ruleset *ds, - struct devfs_dirent *de, unsigned depth); + struct devfs_mount *dm, struct devfs_dirent *de, + unsigned depth); static void devfs_ruleset_applydm(struct devfs_ruleset *ds, struct devfs_mount *dm); static struct devfs_ruleset *devfs_ruleset_bynum(devfs_rsnum rsnum); @@ -146,7 +149,7 @@ devfs_rules_apply(struct devfs_mount *dm, struct devfs_dirent *de) sx_slock(&sx_rules); ds = devfs_ruleset_bynum(dm->dm_ruleset); KASSERT(ds != NULL, ("mount-point has NULL ruleset")); - devfs_ruleset_applyde(ds, de, devfs_rule_depth); + devfs_ruleset_applyde(ds, dm, de, devfs_rule_depth); sx_sunlock(&sx_rules); } @@ -337,13 +340,14 @@ devfs_rid_input(devfs_rid rid, struct devfs_mount *dm) * XXX: a linear search could be done through the cdev list instead. */ static void -devfs_rule_applyde_recursive(struct devfs_krule *dk, struct devfs_dirent *de) +devfs_rule_applyde_recursive(struct devfs_krule *dk, struct devfs_mount *dm, + struct devfs_dirent *de) { struct devfs_dirent *de2; TAILQ_FOREACH(de2, &de->de_dlist, de_list) - devfs_rule_applyde_recursive(dk, de2); - devfs_rule_run(dk, de, devfs_rule_depth); + devfs_rule_applyde_recursive(dk, dm, de2); + devfs_rule_run(dk, dm, de, devfs_rule_depth); } /* @@ -353,7 +357,7 @@ static void devfs_rule_applydm(struct devfs_krule *dk, struct devfs_mount *dm) { - devfs_rule_applyde_recursive(dk, dm->dm_rootdir); + devfs_rule_applyde_recursive(dk, dm, dm->dm_rootdir); } /* @@ -525,7 +529,8 @@ devfs_rule_insert(struct devfs_rule *dr) * de; 0, otherwise. */ static int -devfs_rule_match(struct devfs_krule *dk, struct devfs_dirent *de) +devfs_rule_match(struct devfs_krule *dk, struct devfs_mount *dm, + struct devfs_dirent *de) { struct devfs_rule *dr = &dk->dk_rule; struct cdev *dev; @@ -558,7 +563,7 @@ devfs_rule_match(struct devfs_krule *dk, struct devfs_dirent *de) dev_relthread(dev, ref); } if (dr->dr_icond & DRC_PATHPTRN) - if (!devfs_rule_matchpath(dk, de)) + if (!devfs_rule_matchpath(dk, dm, de)) return (0); return (1); @@ -568,35 +573,43 @@ devfs_rule_match(struct devfs_krule *dk, struct devfs_dirent *de) * Determine whether dk matches de on account of dr_pathptrn. */ static int -devfs_rule_matchpath(struct devfs_krule *dk, struct devfs_dirent *de) +devfs_rule_matchpath(struct devfs_krule *dk, struct devfs_mount *dm, + struct devfs_dirent *de) { struct devfs_rule *dr = &dk->dk_rule; - char *pname; struct cdev *dev; + int match; + char *pname, *specname; + specname = NULL; dev = devfs_rule_getdev(de); if (dev != NULL) pname = dev->si_name; else if (de->de_dirent->d_type == DT_LNK || - de->de_dirent->d_type == DT_DIR) - pname = de->de_dirent->d_name; - else + (de->de_dirent->d_type == DT_DIR && de != dm->dm_rootdir && + (de->de_flags & (DE_DOT | DE_DOTDOT)) == 0)) { + specname = malloc(SPECNAMELEN + 1, M_TEMP, M_WAITOK); + pname = devfs_fqpn(specname, dm, de, NULL); + } else return (0); - KASSERT(pname != NULL, ("devfs_rule_matchpath: NULL pname")); - return (fnmatch(dr->dr_pathptrn, pname, 0) == 0); + KASSERT(pname != NULL, ("devfs_rule_matchpath: NULL pname")); + match = fnmatch(dr->dr_pathptrn, pname, FNM_PATHNAME) == 0; + free(specname, M_TEMP); + return (match); } /* * Run dk on de. */ static void -devfs_rule_run(struct devfs_krule *dk, struct devfs_dirent *de, unsigned depth) +devfs_rule_run(struct devfs_krule *dk, struct devfs_mount *dm, + struct devfs_dirent *de, unsigned depth) { struct devfs_rule *dr = &dk->dk_rule; struct devfs_ruleset *ds; - if (!devfs_rule_match(dk, de)) + if (!devfs_rule_match(dk, dm, de)) return; if (dr->dr_iacts & DRA_BACTS) { if (dr->dr_bacts & DRB_HIDE) @@ -623,7 +636,7 @@ devfs_rule_run(struct devfs_krule *dk, struct devfs_dirent *de, unsigned depth) if (depth > 0) { ds = devfs_ruleset_bynum(dk->dk_rule.dr_incset); KASSERT(ds != NULL, ("DRA_INCSET but bad dr_incset")); - devfs_ruleset_applyde(ds, de, depth - 1); + devfs_ruleset_applyde(ds, dm, de, depth - 1); } } } @@ -632,12 +645,13 @@ devfs_rule_run(struct devfs_krule *dk, struct devfs_dirent *de, unsigned depth) * Apply all the rules in ds to de. */ static void -devfs_ruleset_applyde(struct devfs_ruleset *ds, struct devfs_dirent *de, unsigned depth) +devfs_ruleset_applyde(struct devfs_ruleset *ds, struct devfs_mount *dm, + struct devfs_dirent *de, unsigned depth) { struct devfs_krule *dk; TAILQ_FOREACH(dk, &ds->ds_rules, dk_list) - devfs_rule_run(dk, de, depth); + devfs_rule_run(dk, dm, de, depth); } /* diff --git a/sys/fs/ext2fs/ext2_hash.c b/sys/fs/ext2fs/ext2_hash.c index 4876a7f120e4..4d69f64444ea 100644 --- a/sys/fs/ext2fs/ext2_hash.c +++ b/sys/fs/ext2fs/ext2_hash.c @@ -27,6 +27,30 @@ * $FreeBSD$ */ +/* + * The following notice applies to the code in ext2_half_md4(): + * + * Copyright (C) 1990-2, RSA Data Security, Inc. All rights reserved. + * + * License to copy and use this software is granted provided that it + * is identified as the "RSA Data Security, Inc. MD4 Message-Digest + * Algorithm" in all material mentioning or referencing this software + * or this function. + * + * License is also granted to make and use derivative works provided + * that such works are identified as "derived from the RSA Data + * Security, Inc. MD4 Message-Digest Algorithm" in all material + * mentioning or referencing the derived work. + * + * RSA Data Security, Inc. makes no representations concerning either + * the merchantability of this software or the suitability of this + * software for any particular purpose. It is provided "as is" + * without express or implied warranty of any kind. + * + * These notices must be retained in any copies of any part of this + * documentation and/or software. + */ + #include <sys/param.h> #include <sys/systm.h> #include <sys/conf.h> @@ -69,13 +93,13 @@ /* * MD4 basic transformation. It transforms state based on block. * - * This is a half md4 algorithm because in Linux it uses this algorithm in dir - * index. This function is copied from kern/md4c.c file and is modified as - * necessary. + * This is a half md4 algorithm since Linux uses this algorithm for dir + * index. This function is derived from the RSA Data Security, Inc. MD4 + * Message-Digest Algorithm and was modified as necessary. * * The return value of this function is uint32_t in Linux, but actually we don't - * need to check this value. So in our version this function don't return any - * values. + * need to check this value, so in our version this function doesn't return any + * value. */ static void ext2_half_md4(uint32_t hash[4], uint32_t data[8]) diff --git a/sys/fs/ext2fs/ext2_lookup.c b/sys/fs/ext2fs/ext2_lookup.c index 4072254c41ff..990ed330217f 100644 --- a/sys/fs/ext2fs/ext2_lookup.c +++ b/sys/fs/ext2fs/ext2_lookup.c @@ -128,60 +128,66 @@ ext2_is_dot_entry(struct componentname *cnp) /* * Vnode op for reading directories. - * - * This function has to convert directory entries from the on-disk - * format to the format defined by <sys/dirent.h>. Unfortunately, the - * conversion will blow up some entries by four bytes, so it can't be - * done in place. Instead, the conversion is done entry by entry and - * the converted entry is sent via uiomove. - * - * XXX allocate a buffer, convert as many entries as possible, then send - * the whole buffer to uiomove */ int ext2_readdir(struct vop_readdir_args *ap) { + struct vnode *vp = ap->a_vp; struct uio *uio = ap->a_uio; - int count, error; - - struct ext2fs_direct_2 *edp, *dp; - int ncookies; + struct buf *bp; + struct inode *ip; + struct ext2fs_direct_2 *dp, *edp; + u_long *cookies; struct dirent dstdp; - struct uio auio; - struct iovec aiov; - caddr_t dirbuf; + off_t offset, startoffset; + size_t readcnt, skipcnt; + ssize_t startresid; + int ncookies; int DIRBLKSIZ = VTOI(ap->a_vp)->i_e2fs->e2fs_bsize; - int readcnt; - off_t startoffset = uio->uio_offset; + int error; - count = uio->uio_resid; - /* - * Avoid complications for partial directory entries by adjusting - * the i/o to end at a block boundary. Don't give up (like ufs - * does) if the initial adjustment gives a negative count, since - * many callers don't supply a large enough buffer. The correct - * size is a little larger than DIRBLKSIZ to allow for expansion - * of directory entries, but some callers just use 512. - */ - count -= (uio->uio_offset + count) & (DIRBLKSIZ -1); - if (count <= 0) - count += DIRBLKSIZ; - auio = *uio; - auio.uio_iov = &aiov; - auio.uio_iovcnt = 1; - auio.uio_resid = count; - auio.uio_segflg = UIO_SYSSPACE; - aiov.iov_len = count; - dirbuf = malloc(count, M_TEMP, M_WAITOK); - aiov.iov_base = dirbuf; - error = VOP_READ(ap->a_vp, &auio, 0, ap->a_cred); - if (error == 0) { - readcnt = count - auio.uio_resid; - edp = (struct ext2fs_direct_2 *)&dirbuf[readcnt]; + if (uio->uio_offset < 0) + return (EINVAL); + ip = VTOI(vp); + if (ap->a_ncookies != NULL) { + ncookies = uio->uio_resid; + if (uio->uio_offset >= ip->i_size) + ncookies = 0; + else if (ip->i_size - uio->uio_offset < ncookies) + ncookies = ip->i_size - uio->uio_offset; + ncookies = ncookies / (offsetof(struct ext2fs_direct_2, + e2d_namlen) + 4) + 1; + cookies = malloc(ncookies * sizeof(*cookies), M_TEMP, M_WAITOK); + *ap->a_ncookies = ncookies; + *ap->a_cookies = cookies; + } else { ncookies = 0; - bzero(&dstdp, offsetof(struct dirent, d_name)); - for (dp = (struct ext2fs_direct_2 *)dirbuf; - !error && uio->uio_resid > 0 && dp < edp; ) { + cookies = NULL; + } + offset = startoffset = uio->uio_offset; + startresid = uio->uio_resid; + error = 0; + while (error == 0 && uio->uio_resid > 0 && + uio->uio_offset < ip->i_size) { + error = ext2_blkatoff(vp, uio->uio_offset, NULL, &bp); + if (error) + break; + if (bp->b_offset + bp->b_bcount > ip->i_size) + readcnt = ip->i_size - bp->b_offset; + else + readcnt = bp->b_bcount; + skipcnt = (size_t)(uio->uio_offset - bp->b_offset) & + ~(size_t)(DIRBLKSIZ - 1); + offset = bp->b_offset + skipcnt; + dp = (struct ext2fs_direct_2 *)&bp->b_data[skipcnt]; + edp = (struct ext2fs_direct_2 *)&bp->b_data[readcnt]; + while (error == 0 && uio->uio_resid > 0 && dp < edp) { + if (dp->e2d_reclen <= offsetof(struct ext2fs_direct_2, + e2d_namlen) || (caddr_t)dp + dp->e2d_reclen > + (caddr_t)edp) { + error = EIO; + break; + } /*- * "New" ext2fs directory entries differ in 3 ways * from ufs on-disk ones: @@ -198,57 +204,60 @@ ext2_readdir(struct vop_readdir_args *ap) * because ext2fs uses a machine-independent disk * layout. */ - dstdp.d_fileno = dp->e2d_ino; - dstdp.d_type = FTTODT(dp->e2d_type); dstdp.d_namlen = dp->e2d_namlen; + dstdp.d_type = FTTODT(dp->e2d_type); + if (offsetof(struct ext2fs_direct_2, e2d_namlen) + + dstdp.d_namlen > dp->e2d_reclen) { + error = EIO; + break; + } + if (offset < startoffset || dp->e2d_ino == 0) + goto nextentry; + dstdp.d_fileno = dp->e2d_ino; dstdp.d_reclen = GENERIC_DIRSIZ(&dstdp); bcopy(dp->e2d_name, dstdp.d_name, dstdp.d_namlen); - bzero(dstdp.d_name + dstdp.d_namlen, - dstdp.d_reclen - offsetof(struct dirent, d_name) - - dstdp.d_namlen); - - if (dp->e2d_reclen > 0) { - if(dstdp.d_reclen <= uio->uio_resid) { - /* advance dp */ - dp = (struct ext2fs_direct_2 *) - ((char *)dp + dp->e2d_reclen); - error = - uiomove(&dstdp, dstdp.d_reclen, uio); - if (!error) - ncookies++; - } else - break; - } else { - error = EIO; + dstdp.d_name[dstdp.d_namlen] = '\0'; + if (dstdp.d_reclen > uio->uio_resid) { + if (uio->uio_resid == startresid) + error = EINVAL; + else + error = EJUSTRETURN; break; } - } - /* we need to correct uio_offset */ - uio->uio_offset = startoffset + (caddr_t)dp - dirbuf; - - if (!error && ap->a_ncookies != NULL) { - u_long *cookiep, *cookies, *ecookies; - off_t off; - - if (uio->uio_segflg != UIO_SYSSPACE || uio->uio_iovcnt != 1) - panic("ext2_readdir: unexpected uio from NFS server"); - cookies = malloc(ncookies * sizeof(u_long), M_TEMP, - M_WAITOK); - off = startoffset; - for (dp = (struct ext2fs_direct_2 *)dirbuf, - cookiep = cookies, ecookies = cookies + ncookies; - cookiep < ecookies; - dp = (struct ext2fs_direct_2 *)((caddr_t) dp + dp->e2d_reclen)) { - off += dp->e2d_reclen; - *cookiep++ = (u_long) off; + /* Advance dp. */ + error = uiomove((caddr_t)&dstdp, dstdp.d_reclen, uio); + if (error) + break; + if (cookies != NULL) { + KASSERT(ncookies > 0, + ("ext2_readdir: cookies buffer too small")); + *cookies = offset + dp->e2d_reclen; + cookies++; + ncookies--; } - *ap->a_ncookies = ncookies; - *ap->a_cookies = cookies; +nextentry: + offset += dp->e2d_reclen; + dp = (struct ext2fs_direct_2 *)((caddr_t)dp + + dp->e2d_reclen); + } + bqrelse(bp); + uio->uio_offset = offset; + } + /* We need to correct uio_offset. */ + uio->uio_offset = offset; + if (error == EJUSTRETURN) + error = 0; + if (ap->a_ncookies != NULL) { + if (error == 0) { + ap->a_ncookies -= ncookies; + } else { + free(*ap->a_cookies, M_TEMP); + *ap->a_ncookies = 0; + *ap->a_cookies = NULL; } } - free(dirbuf, M_TEMP); - if (ap->a_eofflag) - *ap->a_eofflag = VTOI(ap->a_vp)->i_size <= uio->uio_offset; + if (error == 0 && ap->a_eofflag) + *ap->a_eofflag = ip->i_size <= uio->uio_offset; return (error); } diff --git a/sys/fs/fuse/fuse_internal.h b/sys/fs/fuse/fuse_internal.h index d29fd3068d30..187245cbd907 100644 --- a/sys/fs/fuse/fuse_internal.h +++ b/sys/fs/fuse/fuse_internal.h @@ -223,8 +223,6 @@ fuse_internal_attr_fat2vat(struct mount *mp, vap->va_mtime.tv_nsec = fat->mtimensec; vap->va_ctime.tv_sec = fat->ctime; vap->va_ctime.tv_nsec = fat->ctimensec; - vap->va_birthtime.tv_sec = fat->crtime; - vap->va_birthtime.tv_nsec = fat->crtimensec; vap->va_blocksize = PAGE_SIZE; vap->va_type = IFTOVT(fat->mode); diff --git a/sys/fs/fuse/fuse_kernel.h b/sys/fs/fuse/fuse_kernel.h index 5ae7192cecc0..07cd4a999588 100644 --- a/sys/fs/fuse/fuse_kernel.h +++ b/sys/fs/fuse/fuse_kernel.h @@ -34,32 +34,14 @@ * $FreeBSD$ */ -/* - * This file defines the kernel interface of FUSE - * - * Protocol changelog: - * - * 7.9: - * - new fuse_getattr_in input argument of GETATTR - * - add lk_flags in fuse_lk_in - * - add lock_owner field to fuse_setattr_in, fuse_read_in and fuse_write_in - * - add blksize field to fuse_attr - * - add file flags field to fuse_read_in and fuse_write_in - * - * 7.10 - * - add nonseekable open flag - */ - -#ifndef _FS_FUSE_FUSE_KERNEL_H_ -#define _FS_FUSE_FUSE_KERNEL_H_ - #ifndef linux #include <sys/types.h> #define __u64 uint64_t #define __u32 uint32_t #define __s32 int32_t #else -#include <linux/types.h> +#include <asm/types.h> +#include <linux/major.h> #endif /** Version number of this interface */ @@ -71,6 +53,12 @@ /** The node ID of the root inode */ #define FUSE_ROOT_ID 1 +/** The major number of the fuse character device */ +#define FUSE_MAJOR MISC_MAJOR + +/** The minor number of the fuse character device */ +#define FUSE_MINOR 229 + /* Make sure all structures are padded to 64bit boundary, so 32bit userspace works under 64bit kernels */ @@ -81,17 +69,14 @@ struct fuse_attr { __u64 atime; __u64 mtime; __u64 ctime; - __u64 crtime; __u32 atimensec; __u32 mtimensec; __u32 ctimensec; - __u32 crtimensec; __u32 mode; __u32 nlink; __u32 uid; __u32 gid; __u32 rdev; - __u32 blksize; }; struct fuse_kstatfs { @@ -124,62 +109,27 @@ struct fuse_file_lock { #define FATTR_ATIME (1 << 4) #define FATTR_MTIME (1 << 5) #define FATTR_FH (1 << 6) -#define FATTR_ATIME_NOW (1 << 7) -#define FATTR_MTIME_NOW (1 << 8) -#define FATTR_LOCKOWNER (1 << 9) /** * Flags returned by the OPEN request * * FOPEN_DIRECT_IO: bypass page cache for this open file * FOPEN_KEEP_CACHE: don't invalidate the data cache on open - * FOPEN_NONSEEKABLE: the file is not seekable */ #define FOPEN_DIRECT_IO (1 << 0) #define FOPEN_KEEP_CACHE (1 << 1) -#define FOPEN_NONSEEKABLE (1 << 2) /** * INIT request/reply flags - * - * FUSE_EXPORT_SUPPORT: filesystem handles lookups of "." and ".." */ #define FUSE_ASYNC_READ (1 << 0) #define FUSE_POSIX_LOCKS (1 << 1) -#define FUSE_FILE_OPS (1 << 2) -#define FUSE_ATOMIC_O_TRUNC (1 << 3) -#define FUSE_EXPORT_SUPPORT (1 << 4) -#define FUSE_BIG_WRITES (1 << 5) /** * Release flags */ #define FUSE_RELEASE_FLUSH (1 << 0) -/** - * Getattr flags - */ -#define FUSE_GETATTR_FH (1 << 0) - -/** - * Lock flags - */ -#define FUSE_LK_FLOCK (1 << 0) - -/** - * WRITE flags - * - * FUSE_WRITE_CACHE: delayed write from page cache, file handle is guessed - * FUSE_WRITE_LOCKOWNER: lock_owner field is valid - */ -#define FUSE_WRITE_CACHE (1 << 0) -#define FUSE_WRITE_LOCKOWNER (1 << 1) - -/** - * Read flags - */ -#define FUSE_READ_LOCKOWNER (1 << 1) - enum fuse_opcode { FUSE_LOOKUP = 1, FUSE_FORGET = 2, /* no reply */ @@ -222,8 +172,6 @@ enum fuse_opcode { /* The read buffer is required to be at least 8k, but may be much larger */ #define FUSE_MIN_READ_BUFFER 8192 -#define FUSE_COMPAT_ENTRY_OUT_SIZE 120 - struct fuse_entry_out { __u64 nodeid; /* Inode ID */ __u64 generation; /* Inode generation: nodeid:gen must @@ -239,14 +187,6 @@ struct fuse_forget_in { __u64 nlookup; }; -struct fuse_getattr_in { - __u32 getattr_flags; - __u32 dummy; - __u64 fh; -}; - -#define FUSE_COMPAT_ATTR_OUT_SIZE 96 - struct fuse_attr_out { __u64 attr_valid; /* Cache timeout for the attributes */ __u32 attr_valid_nsec; @@ -254,11 +194,6 @@ struct fuse_attr_out { struct fuse_attr attr; }; -struct fuse_mknod_in { - __u32 mode; - __u32 rdev; -}; - struct fuse_mkdir_in { __u32 mode; __u32 padding; @@ -277,7 +212,7 @@ struct fuse_setattr_in { __u32 padding; __u64 fh; __u64 size; - __u64 lock_owner; + __u64 unused1; __u64 atime; __u64 mtime; __u64 unused2; @@ -320,22 +255,14 @@ struct fuse_read_in { __u64 fh; __u64 offset; __u32 size; - __u32 read_flags; - __u64 lock_owner; - __u32 flags; __u32 padding; }; -#define FUSE_COMPAT_WRITE_IN_SIZE 24 - struct fuse_write_in { __u64 fh; __u64 offset; __u32 size; __u32 write_flags; - __u64 lock_owner; - __u32 flags; - __u32 padding; }; struct fuse_write_out { @@ -374,8 +301,6 @@ struct fuse_lk_in { __u64 fh; __u64 owner; struct fuse_file_lock lk; - __u32 lk_flags; - __u32 padding; }; struct fuse_lk_out { @@ -439,12 +364,10 @@ struct fuse_dirent { __u64 off; __u32 namelen; __u32 type; - char name[]; + char name[0]; }; #define FUSE_NAME_OFFSET offsetof(struct fuse_dirent, name) #define FUSE_DIRENT_ALIGN(x) (((x) + sizeof(__u64) - 1) & ~(sizeof(__u64) - 1)) #define FUSE_DIRENT_SIZE(d) \ FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen) - -#endif /* !_FS_FUSE_FUSE_KERNEL_H_ */ diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c index 808d2b262726..b60b0ebf986e 100644 --- a/sys/fs/nfs/nfs_commonsubs.c +++ b/sys/fs/nfs/nfs_commonsubs.c @@ -761,21 +761,21 @@ nfsrv_getattrbits(struct nfsrv_descript *nd, nfsattrbit_t *attrbitp, int *cntp, error = NFSERR_BADXDR; goto nfsmout; } - if (cnt > NFSATTRBIT_MAXWORDS) { + if (cnt > NFSATTRBIT_MAXWORDS) outcnt = NFSATTRBIT_MAXWORDS; - if (retnotsupp) - *retnotsupp = NFSERR_ATTRNOTSUPP; - } else { + else outcnt = cnt; - } NFSZERO_ATTRBIT(attrbitp); if (outcnt > 0) { NFSM_DISSECT(tl, u_int32_t *, outcnt * NFSX_UNSIGNED); for (i = 0; i < outcnt; i++) attrbitp->bits[i] = fxdr_unsigned(u_int32_t, *tl++); } - if (cnt > outcnt) - error = nfsm_advance(nd, (cnt - outcnt) * NFSX_UNSIGNED, -1); + for (i = 0; i < (cnt - outcnt); i++) { + NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED); + if (retnotsupp != NULL && *tl != 0) + *retnotsupp = NFSERR_ATTRNOTSUPP; + } if (cntp) *cntp = NFSX_UNSIGNED + (cnt * NFSX_UNSIGNED); nfsmout: diff --git a/sys/fs/tmpfs/tmpfs_vfsops.c b/sys/fs/tmpfs/tmpfs_vfsops.c index 8cf8693bdff1..4d55f51fbbc1 100644 --- a/sys/fs/tmpfs/tmpfs_vfsops.c +++ b/sys/fs/tmpfs/tmpfs_vfsops.c @@ -79,7 +79,7 @@ static int tmpfs_statfs(struct mount *, struct statfs *); static const char *tmpfs_opts[] = { "from", "size", "maxfilesize", "inodes", "uid", "gid", "mode", "export", - NULL + "union", NULL }; static const char *tmpfs_updateopts[] = { diff --git a/sys/gdb/gdb_cons.c b/sys/gdb/gdb_cons.c index 6ecdc04a42f9..ff746658601f 100644 --- a/sys/gdb/gdb_cons.c +++ b/sys/gdb/gdb_cons.c @@ -136,7 +136,7 @@ oktousecallout(void *data __unused) { calloutok = 1; } -SYSINIT(gdbhack, SI_SUB_RUN_SCHEDULER, SI_ORDER_MIDDLE, oktousecallout, NULL); +SYSINIT(gdbhack, SI_SUB_LAST, SI_ORDER_MIDDLE, oktousecallout, NULL); static void gdb_cnputc(struct consdev *cp, int c) diff --git a/sys/geom/raid/g_raid.c b/sys/geom/raid/g_raid.c index 0d7ac4984ad2..fd6d69c7a043 100644 --- a/sys/geom/raid/g_raid.c +++ b/sys/geom/raid/g_raid.c @@ -2171,7 +2171,7 @@ g_raid_destroy_disk(struct g_raid_disk *disk) int g_raid_destroy(struct g_raid_softc *sc, int how) { - int opens; + int error, opens; g_topology_assert_not(); if (sc == NULL) @@ -2188,11 +2188,13 @@ g_raid_destroy(struct g_raid_softc *sc, int how) G_RAID_DEBUG1(1, sc, "%d volumes are still open.", opens); + sx_xunlock(&sc->sc_lock); return (EBUSY); case G_RAID_DESTROY_DELAYED: G_RAID_DEBUG1(1, sc, "Array will be destroyed on last close."); sc->sc_stopping = G_RAID_DESTROY_DELAYED; + sx_xunlock(&sc->sc_lock); return (EBUSY); case G_RAID_DESTROY_HARD: G_RAID_DEBUG1(1, sc, @@ -2206,9 +2208,9 @@ g_raid_destroy(struct g_raid_softc *sc, int how) /* Wake up worker to let it selfdestruct. */ g_raid_event_send(sc, G_RAID_NODE_E_WAKE, 0); /* Sleep until node destroyed. */ - sx_sleep(&sc->sc_stopping, &sc->sc_lock, - PRIBIO | PDROP, "r:destroy", 0); - return (0); + error = sx_sleep(&sc->sc_stopping, &sc->sc_lock, + PRIBIO | PDROP, "r:destroy", hz * 3); + return (error == EWOULDBLOCK ? EBUSY : 0); } static void @@ -2303,8 +2305,6 @@ g_raid_destroy_geom(struct gctl_req *req __unused, sx_xlock(&sc->sc_lock); g_cancel_event(sc); error = g_raid_destroy(gp->softc, G_RAID_DESTROY_SOFT); - if (error != 0) - sx_xunlock(&sc->sc_lock); g_topology_lock(); return (error); } @@ -2469,7 +2469,6 @@ g_raid_shutdown_post_sync(void *arg, int howto) struct g_geom *gp, *gp2; struct g_raid_softc *sc; struct g_raid_volume *vol; - int error; mp = arg; DROP_GIANT(); @@ -2483,9 +2482,7 @@ g_raid_shutdown_post_sync(void *arg, int howto) TAILQ_FOREACH(vol, &sc->sc_volumes, v_next) g_raid_clean(vol, -1); g_cancel_event(sc); - error = g_raid_destroy(sc, G_RAID_DESTROY_DELAYED); - if (error != 0) - sx_xunlock(&sc->sc_lock); + g_raid_destroy(sc, G_RAID_DESTROY_DELAYED); g_topology_lock(); } g_topology_unlock(); diff --git a/sys/geom/raid/g_raid_ctl.c b/sys/geom/raid/g_raid_ctl.c index 428f315d658d..dc1536abcffb 100644 --- a/sys/geom/raid/g_raid_ctl.c +++ b/sys/geom/raid/g_raid_ctl.c @@ -181,7 +181,7 @@ g_raid_ctl_stop(struct gctl_req *req, struct g_class *mp) sx_xlock(&sc->sc_lock); error = g_raid_destroy(sc, how); if (error != 0) - sx_xunlock(&sc->sc_lock); + gctl_error(req, "Array is busy."); g_topology_lock(); } diff --git a/sys/i386/i386/identcpu.c b/sys/i386/i386/identcpu.c index b47972cd8057..beec9b1e7dff 100644 --- a/sys/i386/i386/identcpu.c +++ b/sys/i386/i386/identcpu.c @@ -1121,6 +1121,13 @@ finishidentcpu(void) } } + if (cpu_high >= 5 && (cpu_feature2 & CPUID2_MON) != 0) { + do_cpuid(5, regs); + cpu_mon_mwait_flags = regs[2]; + cpu_mon_min_size = regs[0] & CPUID5_MON_MIN_SIZE; + cpu_mon_max_size = regs[1] & CPUID5_MON_MAX_SIZE; + } + /* Detect AMD features (PTE no-execute bit, 3dnow, 64 bit mode etc) */ if (cpu_vendor_id == CPU_VENDOR_INTEL || cpu_vendor_id == CPU_VENDOR_AMD) { diff --git a/sys/i386/i386/initcpu.c b/sys/i386/i386/initcpu.c index 97454bc112cc..5f33897360c6 100644 --- a/sys/i386/i386/initcpu.c +++ b/sys/i386/i386/initcpu.c @@ -97,6 +97,9 @@ u_int cpu_procinfo2 = 0; /* Multicore info */ char cpu_vendor[20] = ""; /* CPU Origin code */ u_int cpu_vendor_id = 0; /* CPU vendor ID */ u_int cpu_clflush_line_size = 32; +u_int cpu_mon_mwait_flags; /* MONITOR/MWAIT flags (CPUID.05H.ECX) */ +u_int cpu_mon_min_size; /* MONITOR minimum range size, bytes */ +u_int cpu_mon_max_size; /* MONITOR minimum range size, bytes */ SYSCTL_UINT(_hw, OID_AUTO, via_feature_rng, CTLFLAG_RD, &via_feature_rng, 0, "VIA RNG feature available in CPU"); diff --git a/sys/i386/i386/sys_machdep.c b/sys/i386/i386/sys_machdep.c index 374690fa7a59..00d74d330692 100644 --- a/sys/i386/i386/sys_machdep.c +++ b/sys/i386/i386/sys_machdep.c @@ -164,8 +164,9 @@ sysarch(td, uap) break; case I386_SET_LDT: if (kargs.largs.descs != NULL) { - lp = (union descriptor *)kmem_alloc(kernel_map, - kargs.largs.num * sizeof(union descriptor)); + lp = (union descriptor *)kmem_malloc(kernel_map, + kargs.largs.num * sizeof(union descriptor), + M_WAITOK); if (lp == NULL) { error = ENOMEM; break; @@ -298,7 +299,8 @@ i386_extend_pcb(struct thread *td) 0 /* granularity */ }; - ext = (struct pcb_ext *)kmem_alloc(kernel_map, ctob(IOPAGES+1)); + ext = (struct pcb_ext *)kmem_malloc(kernel_map, ctob(IOPAGES+1), + M_WAITOK); if (ext == 0) return (ENOMEM); bzero(ext, sizeof(struct pcb_ext)); @@ -471,8 +473,8 @@ user_ldt_alloc(struct mdproc *mdp, int len) M_SUBPROC, M_WAITOK); new_ldt->ldt_len = len = NEW_MAX_LD(len); - new_ldt->ldt_base = (caddr_t)kmem_alloc(kernel_map, - round_page(len * sizeof(union descriptor))); + new_ldt->ldt_base = (caddr_t)kmem_malloc(kernel_map, + round_page(len * sizeof(union descriptor)), M_WAITOK); if (new_ldt->ldt_base == NULL) { free(new_ldt, M_SUBPROC); mtx_lock_spin(&dt_lock); @@ -511,8 +513,8 @@ user_ldt_alloc(struct mdproc *mdp, int len) M_SUBPROC, M_WAITOK); new_ldt->ldt_len = len = NEW_MAX_LD(len); - new_ldt->ldt_base = (caddr_t)kmem_alloc(kernel_map, - len * sizeof(union descriptor)); + new_ldt->ldt_base = (caddr_t)kmem_malloc(kernel_map, + len * sizeof(union descriptor), M_WAITOK); if (new_ldt->ldt_base == NULL) { free(new_ldt, M_SUBPROC); mtx_lock_spin(&dt_lock); diff --git a/sys/i386/include/md_var.h b/sys/i386/include/md_var.h index 3563e6ce7a71..9c8a693f0c52 100644 --- a/sys/i386/include/md_var.h +++ b/sys/i386/include/md_var.h @@ -57,6 +57,9 @@ extern u_int cpu_procinfo2; extern char cpu_vendor[]; extern u_int cpu_vendor_id; extern u_int cyrix_did; +extern u_int cpu_mon_mwait_flags; +extern u_int cpu_mon_min_size; +extern u_int cpu_mon_max_size; extern char kstack[]; extern char sigcode[]; extern int szsigcode; diff --git a/sys/ia64/ia64/mca.c b/sys/ia64/ia64/mca.c index 7b882f6911a1..dd0b9c386538 100644 --- a/sys/ia64/ia64/mca.c +++ b/sys/ia64/ia64/mca.c @@ -284,8 +284,8 @@ ia64_mca_init(void) } max_size = round_page(max_size); - p = (max_size) ? contigmalloc(max_size, M_TEMP, 0, 0ul, - 256*1024*1024 - 1, PAGE_SIZE, 256*1024*1024) : NULL; + p = (max_size) ? contigmalloc(max_size, M_TEMP, M_NOWAIT, 0ul, ~0ul, + PAGE_SIZE, 256*1024*1024) : NULL; if (p != NULL) { mca_info_block = IA64_PHYS_TO_RR7(ia64_tpa((u_int64_t)p)); diff --git a/sys/ia64/ia64/pmap.c b/sys/ia64/ia64/pmap.c index f2a4c65ec13c..44181848afee 100644 --- a/sys/ia64/ia64/pmap.c +++ b/sys/ia64/ia64/pmap.c @@ -2451,7 +2451,7 @@ pmap_mapdev(vm_paddr_t pa, vm_size_t sz) if (md == NULL) { printf("%s: [%#lx..%#lx] not covered by memory descriptor\n", __func__, pa, pa + sz - 1); - return (NULL); + return ((void *)IA64_PHYS_TO_RR6(pa)); } if (md->md_type == EFI_MD_TYPE_FREE) { diff --git a/sys/ia64/pci/pci_cfgreg.c b/sys/ia64/pci/pci_cfgreg.c index 00d8397a18e1..e3f472b80d67 100644 --- a/sys/ia64/pci/pci_cfgreg.c +++ b/sys/ia64/pci/pci_cfgreg.c @@ -70,7 +70,7 @@ pci_cfgregread(int bus, int slot, int func, int reg, int len) register_t is; u_long addr; - addr = pci_sal_address(0, bus, slot, func, reg); + addr = pci_sal_address(bus >> 8, bus & 0xff, slot, func, reg); if (addr == ~0ul) return (~0); @@ -91,7 +91,7 @@ pci_cfgregwrite(int bus, int slot, int func, int reg, uint32_t data, int len) register_t is; u_long addr; - addr = pci_sal_address(0, bus, slot, func, reg); + addr = pci_sal_address(bus >> 8, bus & 0xff, slot, func, reg); if (addr == ~0ul) return; diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index 5d5346e7b8d8..1eb364745a16 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -243,9 +243,6 @@ restart: /* * Traverse the (now) ordered list of system initialization tasks. * Perform each task, and continue on to the next task. - * - * The last item on the list is expected to be the scheduler, - * which will not return. */ for (sipp = sysinit; sipp < sysinit_end; sipp++) { @@ -303,7 +300,13 @@ restart: } } - panic("Shouldn't get here!"); + mtx_assert(&Giant, MA_OWNED | MA_NOTRECURSED); + mtx_unlock(&Giant); + + /* + * Now hand over this thread to swapper. + */ + swapper(); /* NOTREACHED*/ } @@ -346,7 +349,7 @@ static char wit_warn[] = "WARNING: WITNESS option enabled, expect reduced performance.\n"; SYSINIT(witwarn, SI_SUB_COPYRIGHT, SI_ORDER_THIRD + 1, print_caddr_t, wit_warn); -SYSINIT(witwarn2, SI_SUB_RUN_SCHEDULER, SI_ORDER_THIRD + 1, +SYSINIT(witwarn2, SI_SUB_LAST, SI_ORDER_THIRD + 1, print_caddr_t, wit_warn); #endif @@ -355,7 +358,7 @@ static char diag_warn[] = "WARNING: DIAGNOSTIC option enabled, expect reduced performance.\n"; SYSINIT(diagwarn, SI_SUB_COPYRIGHT, SI_ORDER_THIRD + 2, print_caddr_t, diag_warn); -SYSINIT(diagwarn2, SI_SUB_RUN_SCHEDULER, SI_ORDER_THIRD + 2, +SYSINIT(diagwarn2, SI_SUB_LAST, SI_ORDER_THIRD + 2, print_caddr_t, diag_warn); #endif diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index 5bd2daa7197f..6acfc63c4294 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -918,8 +918,7 @@ proc_to_reap(struct thread *td, struct proc *p, idtype_t idtype, id_t id, } break; case P_JAILID: - if (p->p_ucred->cr_prison == NULL || - (p->p_ucred->cr_prison->pr_id != (int)id)) { + if (p->p_ucred->cr_prison->pr_id != (int)id) { PROC_UNLOCK(p); return (0); } diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c index 05fd5e560304..5e4a5020ef15 100644 --- a/sys/kern/kern_malloc.c +++ b/sys/kern/kern_malloc.c @@ -116,8 +116,6 @@ MALLOC_DEFINE(M_IP6NDP, "ip6ndp", "IPv6 Neighbor Discovery"); static void kmeminit(void *); SYSINIT(kmem, SI_SUB_KMEM, SI_ORDER_FIRST, kmeminit, NULL); -static MALLOC_DEFINE(M_FREE, "free", "should be on free list"); - static struct malloc_type *kmemstatistics; static vm_offset_t kmembase; static vm_offset_t kmemlimit; diff --git a/sys/kern/kern_ntptime.c b/sys/kern/kern_ntptime.c index 41b33b54e3e8..7c95575293d4 100644 --- a/sys/kern/kern_ntptime.c +++ b/sys/kern/kern_ntptime.c @@ -1051,5 +1051,5 @@ start_periodic_resettodr(void *arg __unused) periodic_resettodr, NULL); } -SYSINIT(periodic_resettodr, SI_SUB_RUN_SCHEDULER, SI_ORDER_MIDDLE, +SYSINIT(periodic_resettodr, SI_SUB_LAST, SI_ORDER_MIDDLE, start_periodic_resettodr, NULL); diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 9df22ad37551..09dc2ca583df 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -2063,10 +2063,8 @@ tdsendsignal(struct proc *p, struct thread *td, int sig, ksiginfo_t *ksi) if (td == NULL) { td = sigtd(p, sig, prop); sigqueue = &p->p_sigqueue; - } else { - KASSERT(td->td_proc == p, ("invalid thread")); + } else sigqueue = &td->td_sigqueue; - } SDT_PROBE(proc, kernel, , signal_send, td, p, sig, 0, 0 ); diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c index 9e0cc0687785..3aaed602d872 100644 --- a/sys/kern/kern_time.c +++ b/sys/kern/kern_time.c @@ -98,9 +98,6 @@ static int realtimer_settime(struct itimer *, int, static int realtimer_delete(struct itimer *); static void realtimer_clocktime(clockid_t, struct timespec *); static void realtimer_expire(void *); -static int kern_timer_create(struct thread *, clockid_t, - struct sigevent *, int *, int); -static int kern_timer_delete(struct thread *, int); int register_posix_clock(int, struct kclock *); void itimer_fire(struct itimer *it); @@ -183,38 +180,46 @@ int sys_clock_getcpuclockid2(struct thread *td, struct clock_getcpuclockid2_args *uap) { clockid_t clk_id; + int error; + + error = kern_clock_getcpuclockid2(td, uap->id, uap->which, &clk_id); + if (error == 0) + error = copyout(&clk_id, uap->clock_id, sizeof(clockid_t)); + return (error); +} + +int +kern_clock_getcpuclockid2(struct thread *td, id_t id, int which, + clockid_t *clk_id) +{ struct proc *p; pid_t pid; lwpid_t tid; int error; - switch(uap->which) { + switch (which) { case CPUCLOCK_WHICH_PID: - if (uap->id != 0) { - p = pfind(uap->id); + if (id != 0) { + p = pfind(id); if (p == NULL) return (ESRCH); error = p_cansee(td, p); PROC_UNLOCK(p); - if (error) + if (error != 0) return (error); - pid = uap->id; + pid = id; } else { pid = td->td_proc->p_pid; } - clk_id = MAKE_PROCESS_CPUCLOCK(pid); - break; + *clk_id = MAKE_PROCESS_CPUCLOCK(pid); + return (0); case CPUCLOCK_WHICH_TID: - if (uap->id == 0) - tid = td->td_tid; - else - tid = uap->id; - clk_id = MAKE_THREAD_CPUCLOCK(tid); - break; + tid = id == 0 ? td->td_tid : id; + *clk_id = MAKE_THREAD_CPUCLOCK(tid); + return (0); default: return (EINVAL); } - return (copyout(&clk_id, uap->clock_id, sizeof(clockid_t))); } #ifndef _SYS_SYSPROTO_H_ @@ -1059,31 +1064,30 @@ struct ktimer_create_args { int sys_ktimer_create(struct thread *td, struct ktimer_create_args *uap) { - struct sigevent *evp1, ev; + struct sigevent *evp, ev; int id; int error; - if (uap->evp != NULL) { + if (uap->evp == NULL) { + evp = NULL; + } else { error = copyin(uap->evp, &ev, sizeof(ev)); if (error != 0) return (error); - evp1 = &ev; - } else - evp1 = NULL; - - error = kern_timer_create(td, uap->clock_id, evp1, &id, -1); - + evp = &ev; + } + error = kern_ktimer_create(td, uap->clock_id, evp, &id, -1); if (error == 0) { error = copyout(&id, uap->timerid, sizeof(int)); if (error != 0) - kern_timer_delete(td, id); + kern_ktimer_delete(td, id); } return (error); } -static int -kern_timer_create(struct thread *td, clockid_t clock_id, - struct sigevent *evp, int *timerid, int preset_id) +int +kern_ktimer_create(struct thread *td, clockid_t clock_id, struct sigevent *evp, + int *timerid, int preset_id) { struct proc *p = td->td_proc; struct itimer *it; @@ -1198,7 +1202,8 @@ struct ktimer_delete_args { int sys_ktimer_delete(struct thread *td, struct ktimer_delete_args *uap) { - return (kern_timer_delete(td, uap->timerid)); + + return (kern_ktimer_delete(td, uap->timerid)); } static struct itimer * @@ -1220,8 +1225,8 @@ itimer_find(struct proc *p, int timerid) return (it); } -static int -kern_timer_delete(struct thread *td, int timerid) +int +kern_ktimer_delete(struct thread *td, int timerid) { struct proc *p = td->td_proc; struct itimer *it; @@ -1263,35 +1268,40 @@ struct ktimer_settime_args { int sys_ktimer_settime(struct thread *td, struct ktimer_settime_args *uap) { - struct proc *p = td->td_proc; - struct itimer *it; struct itimerspec val, oval, *ovalp; int error; error = copyin(uap->value, &val, sizeof(val)); if (error != 0) return (error); - - if (uap->ovalue != NULL) - ovalp = &oval; - else - ovalp = NULL; + ovalp = uap->ovalue != NULL ? &oval : NULL; + error = kern_ktimer_settime(td, uap->timerid, uap->flags, &val, ovalp); + if (error == 0 && uap->ovalue != NULL) + error = copyout(ovalp, uap->ovalue, sizeof(*ovalp)); + return (error); +} + +int +kern_ktimer_settime(struct thread *td, int timer_id, int flags, + struct itimerspec *val, struct itimerspec *oval) +{ + struct proc *p; + struct itimer *it; + int error; + p = td->td_proc; PROC_LOCK(p); - if (uap->timerid < 3 || - (it = itimer_find(p, uap->timerid)) == NULL) { + if (timer_id < 3 || (it = itimer_find(p, timer_id)) == NULL) { PROC_UNLOCK(p); error = EINVAL; } else { PROC_UNLOCK(p); itimer_enter(it); - error = CLOCK_CALL(it->it_clockid, timer_settime, - (it, uap->flags, &val, ovalp)); + error = CLOCK_CALL(it->it_clockid, timer_settime, (it, + flags, val, oval)); itimer_leave(it); ITIMER_UNLOCK(it); } - if (error == 0 && uap->ovalue != NULL) - error = copyout(ovalp, uap->ovalue, sizeof(*ovalp)); return (error); } @@ -1304,26 +1314,34 @@ struct ktimer_gettime_args { int sys_ktimer_gettime(struct thread *td, struct ktimer_gettime_args *uap) { - struct proc *p = td->td_proc; - struct itimer *it; struct itimerspec val; int error; + error = kern_ktimer_gettime(td, uap->timerid, &val); + if (error == 0) + error = copyout(&val, uap->value, sizeof(val)); + return (error); +} + +int +kern_ktimer_gettime(struct thread *td, int timer_id, struct itimerspec *val) +{ + struct proc *p; + struct itimer *it; + int error; + + p = td->td_proc; PROC_LOCK(p); - if (uap->timerid < 3 || - (it = itimer_find(p, uap->timerid)) == NULL) { + if (timer_id < 3 || (it = itimer_find(p, timer_id)) == NULL) { PROC_UNLOCK(p); error = EINVAL; } else { PROC_UNLOCK(p); itimer_enter(it); - error = CLOCK_CALL(it->it_clockid, timer_gettime, - (it, &val)); + error = CLOCK_CALL(it->it_clockid, timer_gettime, (it, val)); itimer_leave(it); ITIMER_UNLOCK(it); } - if (error == 0) - error = copyout(&val, uap->value, sizeof(val)); return (error); } @@ -1618,7 +1636,7 @@ itimers_event_hook_exit(void *arg, struct proc *p) panic("unhandled event"); for (; i < TIMER_MAX; ++i) { if ((it = its->its_timers[i]) != NULL) - kern_timer_delete(curthread, i); + kern_ktimer_delete(curthread, i); } if (its->its_timers[0] == NULL && its->its_timers[1] == NULL && diff --git a/sys/kern/kern_uuid.c b/sys/kern/kern_uuid.c index 14ace891b609..fd4027b00440 100644 --- a/sys/kern/kern_uuid.c +++ b/sys/kern/kern_uuid.c @@ -71,54 +71,41 @@ struct uuid_private { CTASSERT(sizeof(struct uuid_private) == 16); +struct uuid_macaddr { + uint16_t state; +#define UUID_ETHER_EMPTY 0 +#define UUID_ETHER_RANDOM 1 +#define UUID_ETHER_UNIQUE 2 + uint16_t node[UUID_NODE_LEN>>1]; +}; + static struct uuid_private uuid_last; +#define UUID_NETHER 4 +static struct uuid_macaddr uuid_ether[UUID_NETHER]; + static struct mtx uuid_mutex; MTX_SYSINIT(uuid_lock, &uuid_mutex, "UUID generator mutex lock", MTX_DEF); /* - * Return the first MAC address we encounter or, if none was found, - * construct a sufficiently random multicast address. We don't try - * to return the same MAC address as previously returned. We always - * generate a new multicast address if no MAC address exists in the - * system. - * It would be nice to know if 'ifnet' or any of its sub-structures - * has been changed in any way. If not, we could simply skip the - * scan and safely return the MAC address we returned before. + * Return the first MAC address added in the array. If it's empty, then + * construct a sufficiently random multicast MAC address first. Any + * addresses added later will bump the random MAC address up tp the next + * index. */ static void uuid_node(uint16_t *node) { - struct ifnet *ifp; - struct ifaddr *ifa; - struct sockaddr_dl *sdl; int i; - CURVNET_SET(TD_TO_VNET(curthread)); - IFNET_RLOCK_NOSLEEP(); - TAILQ_FOREACH(ifp, &V_ifnet, if_link) { - /* Walk the address list */ - IF_ADDR_RLOCK(ifp); - TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { - sdl = (struct sockaddr_dl*)ifa->ifa_addr; - if (sdl != NULL && sdl->sdl_family == AF_LINK && - sdl->sdl_type == IFT_ETHER) { - /* Got a MAC address. */ - bcopy(LLADDR(sdl), node, UUID_NODE_LEN); - IF_ADDR_RUNLOCK(ifp); - IFNET_RUNLOCK_NOSLEEP(); - CURVNET_RESTORE(); - return; - } - } - IF_ADDR_RUNLOCK(ifp); + if (uuid_ether[0].state == UUID_ETHER_EMPTY) { + for (i = 0; i < (UUID_NODE_LEN>>1); i++) + uuid_ether[0].node[i] = (uint16_t)arc4random(); + *((uint8_t*)uuid_ether[0].node) |= 0x01; + uuid_ether[0].state = UUID_ETHER_RANDOM; } - IFNET_RUNLOCK_NOSLEEP(); - for (i = 0; i < (UUID_NODE_LEN>>1); i++) - node[i] = (uint16_t)arc4random(); - *((uint8_t*)node) |= 0x01; - CURVNET_RESTORE(); + node[i] = uuid_ether[0].node[i]; } /* @@ -211,6 +198,76 @@ sys_uuidgen(struct thread *td, struct uuidgen_args *uap) } int +uuid_ether_add(const uint8_t *addr) +{ + int i, sum; + + /* + * Validate input. No multicast (flag 0x1), no locally administered + * (flag 0x2) and no 'all-zeroes' addresses. + */ + if (addr[0] & 0x03) + return (EINVAL); + sum = 0; + for (i = 0; i < UUID_NODE_LEN; i++) + sum += addr[i]; + if (sum == 0) + return (EINVAL); + + mtx_lock(&uuid_mutex); + + /* Make sure the MAC isn't known already and that there's space. */ + i = 0; + while (i < UUID_NETHER && uuid_ether[i].state == UUID_ETHER_UNIQUE) { + if (!bcmp(addr, uuid_ether[i].node, UUID_NODE_LEN)) { + mtx_unlock(&uuid_mutex); + return (EEXIST); + } + i++; + } + if (i == UUID_NETHER) { + mtx_unlock(&uuid_mutex); + return (ENOSPC); + } + + /* Insert MAC at index, moving the non-empty entry if possible. */ + if (uuid_ether[i].state == UUID_ETHER_RANDOM && i < UUID_NETHER - 1) + uuid_ether[i + 1] = uuid_ether[i]; + uuid_ether[i].state = UUID_ETHER_UNIQUE; + bcopy(addr, uuid_ether[i].node, UUID_NODE_LEN); + mtx_unlock(&uuid_mutex); + return (0); +} + +int +uuid_ether_del(const uint8_t *addr) +{ + int i; + + mtx_lock(&uuid_mutex); + i = 0; + while (i < UUID_NETHER && uuid_ether[i].state == UUID_ETHER_UNIQUE && + bcmp(addr, uuid_ether[i].node, UUID_NODE_LEN)) + i++; + if (i == UUID_NETHER || uuid_ether[i].state != UUID_ETHER_UNIQUE) { + mtx_unlock(&uuid_mutex); + return (ENOENT); + } + + /* Remove it by shifting higher index entries down. */ + while (i < UUID_NETHER - 1 && uuid_ether[i].state != UUID_ETHER_EMPTY) { + uuid_ether[i] = uuid_ether[i + 1]; + i++; + } + if (uuid_ether[i].state != UUID_ETHER_EMPTY) { + uuid_ether[i].state = UUID_ETHER_EMPTY; + bzero(uuid_ether[i].node, UUID_NODE_LEN); + } + mtx_unlock(&uuid_mutex); + return (0); +} + +int snprintf_uuid(char *buf, size_t sz, struct uuid *uuid) { struct uuid_private *id; diff --git a/sys/kern/sched_4bsd.c b/sys/kern/sched_4bsd.c index d1595c71a83c..7c7d48118e52 100644 --- a/sys/kern/sched_4bsd.c +++ b/sys/kern/sched_4bsd.c @@ -143,7 +143,7 @@ static struct kproc_desc sched_kp = { schedcpu_thread, NULL }; -SYSINIT(schedcpu, SI_SUB_RUN_SCHEDULER, SI_ORDER_FIRST, kproc_start, +SYSINIT(schedcpu, SI_SUB_LAST, SI_ORDER_FIRST, kproc_start, &sched_kp); SYSINIT(sched_setup, SI_SUB_RUN_QUEUE, SI_ORDER_FIRST, sched_setup, NULL); diff --git a/sys/kern/subr_counter.c b/sys/kern/subr_counter.c index 2656ed781030..b3ddc7adc35f 100644 --- a/sys/kern/subr_counter.c +++ b/sys/kern/subr_counter.c @@ -104,4 +104,4 @@ counter_startup(void) uint64_pcpu_zone = uma_zcreate("uint64 pcpu", sizeof(uint64_t), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_PCPU); } -SYSINIT(counter, SI_SUB_CPU, SI_ORDER_FOURTH, counter_startup, NULL); +SYSINIT(counter, SI_SUB_KMEM, SI_ORDER_ANY, counter_startup, NULL); diff --git a/sys/kern/subr_vmem.c b/sys/kern/subr_vmem.c index b48dbcabce81..6aa8ad3a75f7 100644 --- a/sys/kern/subr_vmem.c +++ b/sys/kern/subr_vmem.c @@ -650,7 +650,7 @@ vmem_start_callout(void *unused) SYSINIT(vfs, SI_SUB_CONFIGURE, SI_ORDER_ANY, vmem_start_callout, NULL); static void -vmem_add1(vmem_t *vm, vmem_addr_t addr, vmem_size_t size, int flags, int type) +vmem_add1(vmem_t *vm, vmem_addr_t addr, vmem_size_t size, int type) { bt_t *btspan; bt_t *btfree; @@ -726,7 +726,7 @@ vmem_import(vmem_t *vm, vmem_size_t size, int flags) if (error) return ENOMEM; - vmem_add1(vm, addr, size, flags, BT_TYPE_SPAN); + vmem_add1(vm, addr, size, BT_TYPE_SPAN); return 0; } @@ -1176,7 +1176,7 @@ vmem_add(vmem_t *vm, vmem_addr_t addr, vmem_size_t size, int flags) flags &= VMEM_FLAGS; VMEM_LOCK(vm); if (vm->vm_nfreetags >= BT_MAXALLOC || bt_fill(vm, flags) == 0) - vmem_add1(vm, addr, size, flags, BT_TYPE_SPAN_STATIC); + vmem_add1(vm, addr, size, BT_TYPE_SPAN_STATIC); else error = ENOMEM; VMEM_UNLOCK(vm); diff --git a/sys/kern/sysv_shm.c b/sys/kern/sysv_shm.c index a1c6b34f03cb..90f5d7764fdc 100644 --- a/sys/kern/sysv_shm.c +++ b/sys/kern/sysv_shm.c @@ -414,7 +414,7 @@ kern_shmat(td, shmid, shmaddr, shmflg) vm_object_reference(shmseg->object); rv = vm_map_find(&p->p_vmspace->vm_map, shmseg->object, 0, &attach_va, size, (flags & MAP_FIXED) ? VMFS_NO_SPACE : - VMFS_ANY_SPACE, prot, prot, MAP_INHERIT_SHARE); + VMFS_OPTIMAL_SPACE, prot, prot, MAP_INHERIT_SHARE); if (rv != KERN_SUCCESS) { vm_object_deallocate(shmseg->object); error = ENOMEM; diff --git a/sys/kern/uipc_mqueue.c b/sys/kern/uipc_mqueue.c index 73579d30af5a..11acedb6134a 100644 --- a/sys/kern/uipc_mqueue.c +++ b/sys/kern/uipc_mqueue.c @@ -2235,10 +2235,9 @@ sys_kmq_timedsend(struct thread *td, struct kmq_timedsend_args *uap) return (error); } -int -sys_kmq_notify(struct thread *td, struct kmq_notify_args *uap) +static int +kern_kmq_notify(struct thread *td, int mqd, struct sigevent *sigev) { - struct sigevent ev; struct filedesc *fdp; struct proc *p; struct mqueue *mq; @@ -2246,34 +2245,31 @@ sys_kmq_notify(struct thread *td, struct kmq_notify_args *uap) struct mqueue_notifier *nt, *newnt = NULL; int error; - p = td->td_proc; - fdp = td->td_proc->p_fd; - if (uap->sigev) { - error = copyin(uap->sigev, &ev, sizeof(ev)); - if (error) - return (error); - if (ev.sigev_notify != SIGEV_SIGNAL && - ev.sigev_notify != SIGEV_THREAD_ID && - ev.sigev_notify != SIGEV_NONE) + if (sigev != NULL) { + if (sigev->sigev_notify != SIGEV_SIGNAL && + sigev->sigev_notify != SIGEV_THREAD_ID && + sigev->sigev_notify != SIGEV_NONE) return (EINVAL); - if ((ev.sigev_notify == SIGEV_SIGNAL || - ev.sigev_notify == SIGEV_THREAD_ID) && - !_SIG_VALID(ev.sigev_signo)) + if ((sigev->sigev_notify == SIGEV_SIGNAL || + sigev->sigev_notify == SIGEV_THREAD_ID) && + !_SIG_VALID(sigev->sigev_signo)) return (EINVAL); } - error = getmq(td, uap->mqd, &fp, NULL, &mq); + p = td->td_proc; + fdp = td->td_proc->p_fd; + error = getmq(td, mqd, &fp, NULL, &mq); if (error) return (error); again: FILEDESC_SLOCK(fdp); - fp2 = fget_locked(fdp, uap->mqd); + fp2 = fget_locked(fdp, mqd); if (fp2 == NULL) { FILEDESC_SUNLOCK(fdp); error = EBADF; goto out; } #ifdef CAPABILITIES - error = cap_check(cap_rights(fdp, uap->mqd), CAP_POLL_EVENT); + error = cap_check(cap_rights(fdp, mqd), CAP_POLL_EVENT); if (error) { FILEDESC_SUNLOCK(fdp); goto out; @@ -2286,12 +2282,12 @@ again: } mtx_lock(&mq->mq_mutex); FILEDESC_SUNLOCK(fdp); - if (uap->sigev != NULL) { + if (sigev != NULL) { if (mq->mq_notifier != NULL) { error = EBUSY; } else { PROC_LOCK(p); - nt = notifier_search(p, uap->mqd); + nt = notifier_search(p, mqd); if (nt == NULL) { if (newnt == NULL) { PROC_UNLOCK(p); @@ -2314,10 +2310,10 @@ again: nt->nt_ksi.ksi_flags |= KSI_INS | KSI_EXT; nt->nt_ksi.ksi_code = SI_MESGQ; nt->nt_proc = p; - nt->nt_ksi.ksi_mqd = uap->mqd; + nt->nt_ksi.ksi_mqd = mqd; notifier_insert(p, nt); } - nt->nt_sigev = ev; + nt->nt_sigev = *sigev; mq->mq_notifier = nt; PROC_UNLOCK(p); /* @@ -2330,7 +2326,7 @@ again: mqueue_send_notification(mq); } } else { - notifier_remove(p, mq, uap->mqd); + notifier_remove(p, mq, mqd); } mtx_unlock(&mq->mq_mutex); @@ -2341,6 +2337,23 @@ out: return (error); } +int +sys_kmq_notify(struct thread *td, struct kmq_notify_args *uap) +{ + struct sigevent ev, *evp; + int error; + + if (uap->sigev == NULL) { + evp = NULL; + } else { + error = copyin(uap->sigev, &ev, sizeof(ev)); + if (error != 0) + return (error); + evp = &ev; + } + return (kern_kmq_notify(td, uap->mqd, evp)); +} + static void mqueue_fdclose(struct thread *td, int fd, struct file *fp) { @@ -2637,6 +2650,7 @@ static struct syscall_helper_data mq_syscalls[] = { #ifdef COMPAT_FREEBSD32 #include <compat/freebsd32/freebsd32.h> #include <compat/freebsd32/freebsd32_proto.h> +#include <compat/freebsd32/freebsd32_signal.h> #include <compat/freebsd32/freebsd32_syscall.h> #include <compat/freebsd32/freebsd32_util.h> @@ -2763,12 +2777,33 @@ freebsd32_kmq_timedreceive(struct thread *td, return (error); } +int +freebsd32_kmq_notify(struct thread *td, struct freebsd32_kmq_notify_args *uap) +{ + struct sigevent ev, *evp; + struct sigevent32 ev32; + int error; + + if (uap->sigev == NULL) { + evp = NULL; + } else { + error = copyin(uap->sigev, &ev32, sizeof(ev32)); + if (error != 0) + return (error); + error = convert_sigevent32(&ev32, &ev); + if (error != 0) + return (error); + evp = &ev; + } + return (kern_kmq_notify(td, uap->mqd, evp)); +} + static struct syscall_helper_data mq32_syscalls[] = { SYSCALL32_INIT_HELPER(freebsd32_kmq_open), SYSCALL32_INIT_HELPER(freebsd32_kmq_setattr), SYSCALL32_INIT_HELPER(freebsd32_kmq_timedsend), SYSCALL32_INIT_HELPER(freebsd32_kmq_timedreceive), - SYSCALL32_INIT_HELPER_COMPAT(kmq_notify), + SYSCALL32_INIT_HELPER(freebsd32_kmq_notify), SYSCALL32_INIT_HELPER_COMPAT(kmq_unlink), SYSCALL_INIT_LAST }; diff --git a/sys/kern/uipc_shm.c b/sys/kern/uipc_shm.c index 7a36a63c984c..496b771cae4f 100644 --- a/sys/kern/uipc_shm.c +++ b/sys/kern/uipc_shm.c @@ -779,7 +779,7 @@ shm_map(struct file *fp, size_t size, off_t offset, void **memp) offset = trunc_page(offset); size = round_page(size + ofs); rv = vm_map_find(kernel_map, obj, offset, &kva, size, - VMFS_ALIGNED_SPACE, VM_PROT_READ | VM_PROT_WRITE, + VMFS_OPTIMAL_SPACE, VM_PROT_READ | VM_PROT_WRITE, VM_PROT_READ | VM_PROT_WRITE, 0); if (rv == KERN_SUCCESS) { rv = vm_map_wire(kernel_map, kva, kva + size, diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index 46ceef2bc446..454909ec6470 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -122,6 +122,7 @@ counter_u64_t sfstat[sizeof(struct sfstat) / sizeof(uint64_t)]; int nsfbufs; int nsfbufspeak; int nsfbufsused; +static int sfreadahead = 1; SYSCTL_INT(_kern_ipc, OID_AUTO, nsfbufs, CTLFLAG_RDTUN, &nsfbufs, 0, "Maximum number of sendfile(2) sf_bufs available"); @@ -129,6 +130,9 @@ SYSCTL_INT(_kern_ipc, OID_AUTO, nsfbufspeak, CTLFLAG_RD, &nsfbufspeak, 0, "Number of sendfile(2) sf_bufs at peak usage"); SYSCTL_INT(_kern_ipc, OID_AUTO, nsfbufsused, CTLFLAG_RD, &nsfbufsused, 0, "Number of sendfile(2) sf_bufs in use"); +SYSCTL_INT(_kern_ipc, OID_AUTO, sfreadahead, CTLFLAG_RW, &sfreadahead, 0, + "Number of sendfile(2) read-ahead MAXBSIZE blocks"); + static void sfstat_init(const void *unused) @@ -2240,6 +2244,7 @@ retry_space: error = EBUSY; else { ssize_t resid; + int readahead = sfreadahead * MAXBSIZE; /* * Ensure that our page is still around @@ -2255,9 +2260,9 @@ retry_space: * wrong, but is consistent with our original * implementation. */ - error = vn_rdwr(UIO_READ, vp, NULL, MAXBSIZE, + error = vn_rdwr(UIO_READ, vp, NULL, readahead, trunc_page(off), UIO_NOCOPY, IO_NODELOCKED | - IO_VMIO | ((MAXBSIZE / bsize) << IO_SEQSHIFT), + IO_VMIO | ((readahead / bsize) << IO_SEQSHIFT), td->td_ucred, NOCRED, &resid, td); VM_OBJECT_WLOCK(obj); vm_page_io_finish(pg); diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c index 5fb9341b9911..862443c426f2 100644 --- a/sys/kern/vfs_aio.c +++ b/sys/kern/vfs_aio.c @@ -2755,31 +2755,6 @@ aiocb32_copyin_old_sigevent(struct aiocb *ujob, struct aiocb *kjob) } static int -convert_sigevent32(struct sigevent32 *sig32, struct sigevent *sig) -{ - - CP(*sig32, *sig, sigev_notify); - switch (sig->sigev_notify) { - case SIGEV_NONE: - break; - case SIGEV_THREAD_ID: - CP(*sig32, *sig, sigev_notify_thread_id); - /* FALLTHROUGH */ - case SIGEV_SIGNAL: - CP(*sig32, *sig, sigev_signo); - break; - case SIGEV_KEVENT: - CP(*sig32, *sig, sigev_notify_kqueue); - CP(*sig32, *sig, sigev_notify_kevent_flags); - PTRIN_CP(*sig32, *sig, sigev_value.sival_ptr); - break; - default: - return (EINVAL); - } - return (0); -} - -static int aiocb32_copyin(struct aiocb *ujob, struct aiocb *kjob) { struct aiocb32 job32; diff --git a/sys/kern/vfs_mountroot.c b/sys/kern/vfs_mountroot.c index 162738d173d2..57d155b32fd3 100644 --- a/sys/kern/vfs_mountroot.c +++ b/sys/kern/vfs_mountroot.c @@ -714,8 +714,8 @@ parse_mount(char **conf) goto out; } - if (strcmp(fs, "zfs") != 0 && dev[0] != '\0' && - !parse_mount_dev_present(dev)) { + if (strcmp(fs, "zfs") != 0 && strstr(fs, "nfs") == NULL && + dev[0] != '\0' && !parse_mount_dev_present(dev)) { printf("mountroot: waiting for device %s ...\n", dev); delay = hz / 10; timeout = root_mount_timeout * hz; diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index e2c28130d59b..6fb49ae7dbe4 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -3453,16 +3453,23 @@ vfs_msync(struct mount *mp, int flags) } static void -destroy_vpollinfo(struct vpollinfo *vi) +destroy_vpollinfo_free(struct vpollinfo *vi) { - knlist_clear(&vi->vpi_selinfo.si_note, 1); - seldrain(&vi->vpi_selinfo); knlist_destroy(&vi->vpi_selinfo.si_note); mtx_destroy(&vi->vpi_lock); uma_zfree(vnodepoll_zone, vi); } +static void +destroy_vpollinfo(struct vpollinfo *vi) +{ + + knlist_clear(&vi->vpi_selinfo.si_note, 1); + seldrain(&vi->vpi_selinfo); + destroy_vpollinfo_free(vi); +} + /* * Initalize per-vnode helper structure to hold poll-related state. */ @@ -3480,7 +3487,7 @@ v_addpollinfo(struct vnode *vp) VI_LOCK(vp); if (vp->v_pollinfo != NULL) { VI_UNLOCK(vp); - destroy_vpollinfo(vi); + destroy_vpollinfo_free(vi); return; } vp->v_pollinfo = vi; diff --git a/bin/sh/init.h b/sys/libkern/flsll.c index 384bb699feaa..0629480cea9a 100644 --- a/bin/sh/init.h +++ b/sys/libkern/flsll.c @@ -1,10 +1,7 @@ /*- - * Copyright (c) 1991, 1993 + * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * - * This code is derived from software contributed to Berkeley by - * Kenneth Almquist. - * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -28,9 +25,23 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * @(#)init.h 8.2 (Berkeley) 5/4/95 - * $FreeBSD$ */ -void reset(void); +#include <sys/cdefs.h> +#include <sys/libkern.h> +__FBSDID("$FreeBSD$"); + +/* + * Find Last Set bit + */ +int +flsll(long long mask) +{ + int bit; + + if (mask == 0) + return (0); + for (bit = 1; mask != 1; bit++) + mask = (unsigned long long)mask >> 1; + return (bit); +} diff --git a/sys/mips/atheros/ar71xx_chip.c b/sys/mips/atheros/ar71xx_chip.c index d141b1c35067..db7920f6b258 100644 --- a/sys/mips/atheros/ar71xx_chip.c +++ b/sys/mips/atheros/ar71xx_chip.c @@ -78,6 +78,8 @@ __FBSDID("$FreeBSD$"); uint32_t u_ar71xx_cpu_freq; uint32_t u_ar71xx_ahb_freq; uint32_t u_ar71xx_ddr_freq; +uint32_t u_ar71xx_uart_freq; +uint32_t u_ar71xx_wdt_freq; uint32_t u_ar71xx_refclk; static void @@ -107,6 +109,8 @@ ar71xx_chip_detect_sys_frequency(void) div = (((pll >> AR71XX_AHB_DIV_SHIFT) & AR71XX_AHB_DIV_MASK) + 1) * 2; u_ar71xx_ahb_freq = u_ar71xx_cpu_freq / div; + u_ar71xx_wdt_freq = u_ar71xx_cpu_freq / div; + u_ar71xx_uart_freq = u_ar71xx_cpu_freq / div; } /* diff --git a/sys/mips/atheros/ar71xx_cpudef.h b/sys/mips/atheros/ar71xx_cpudef.h index bd880222f3ee..a30157c2a0aa 100644 --- a/sys/mips/atheros/ar71xx_cpudef.h +++ b/sys/mips/atheros/ar71xx_cpudef.h @@ -121,10 +121,14 @@ extern uint32_t u_ar71xx_refclk; extern uint32_t u_ar71xx_cpu_freq; extern uint32_t u_ar71xx_ahb_freq; extern uint32_t u_ar71xx_ddr_freq; +extern uint32_t u_ar71xx_uart_freq; +extern uint32_t u_ar71xx_wdt_freq; static inline uint64_t ar71xx_refclk(void) { return u_ar71xx_refclk; } static inline uint64_t ar71xx_cpu_freq(void) { return u_ar71xx_cpu_freq; } static inline uint64_t ar71xx_ahb_freq(void) { return u_ar71xx_ahb_freq; } static inline uint64_t ar71xx_ddr_freq(void) { return u_ar71xx_ddr_freq; } - +static inline uint64_t ar71xx_uart_freq(void) { return u_ar71xx_uart_freq; } +static inline uint64_t ar71xx_wdt_freq(void) { return u_ar71xx_wdt_freq; } + #endif diff --git a/sys/mips/atheros/ar71xx_gpio.c b/sys/mips/atheros/ar71xx_gpio.c index e6319cf6d405..0fad2ec8053a 100644 --- a/sys/mips/atheros/ar71xx_gpio.c +++ b/sys/mips/atheros/ar71xx_gpio.c @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include <mips/atheros/ar71xx_setup.h> #include <mips/atheros/ar71xx_gpiovar.h> #include <mips/atheros/ar933xreg.h> +#include <mips/atheros/ar934xreg.h> #include "gpio_if.h" @@ -90,13 +91,23 @@ static int ar71xx_gpio_pin_toggle(device_t dev, uint32_t pin); static void ar71xx_gpio_function_enable(struct ar71xx_gpio_softc *sc, uint32_t mask) { - GPIO_SET_BITS(sc, AR71XX_GPIO_FUNCTION, mask); + if (ar71xx_soc == AR71XX_SOC_AR9341 || + ar71xx_soc == AR71XX_SOC_AR9342 || + ar71xx_soc == AR71XX_SOC_AR9344) + GPIO_SET_BITS(sc, AR934X_GPIO_REG_FUNC, mask); + else + GPIO_SET_BITS(sc, AR71XX_GPIO_FUNCTION, mask); } static void ar71xx_gpio_function_disable(struct ar71xx_gpio_softc *sc, uint32_t mask) { - GPIO_CLEAR_BITS(sc, AR71XX_GPIO_FUNCTION, mask); + if (ar71xx_soc == AR71XX_SOC_AR9341 || + ar71xx_soc == AR71XX_SOC_AR9342 || + ar71xx_soc == AR71XX_SOC_AR9344) + GPIO_CLEAR_BITS(sc, AR934X_GPIO_REG_FUNC, mask); + else + GPIO_CLEAR_BITS(sc, AR71XX_GPIO_FUNCTION, mask); } static void @@ -141,6 +152,10 @@ ar71xx_gpio_pin_max(device_t dev, int *maxpin) case AR71XX_SOC_AR9331: *maxpin = AR933X_GPIO_COUNT - 1; break; + case AR71XX_SOC_AR9341: + case AR71XX_SOC_AR9342: + case AR71XX_SOC_AR9344: + *maxpin = AR934X_GPIO_COUNT - 1; default: *maxpin = AR71XX_GPIO_PINS - 1; } diff --git a/sys/mips/atheros/ar71xx_setup.c b/sys/mips/atheros/ar71xx_setup.c index c79286d74d58..d7fec3bb32a5 100644 --- a/sys/mips/atheros/ar71xx_setup.c +++ b/sys/mips/atheros/ar71xx_setup.c @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include <mips/atheros/ar71xxreg.h> #include <mips/atheros/ar933xreg.h> +#include <mips/atheros/ar934xreg.h> #include <mips/atheros/ar71xx_setup.h> @@ -62,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include <mips/atheros/ar724x_chip.h> #include <mips/atheros/ar91xx_chip.h> #include <mips/atheros/ar933x_chip.h> +#include <mips/atheros/ar934x_chip.h> #define AR71XX_SYS_TYPE_LEN 128 @@ -158,6 +160,30 @@ ar71xx_detect_sys_type(void) ar71xx_cpu_ops = &ar933x_chip_def; break; + case REV_ID_MAJOR_AR9341: + minor = 0; + rev = (id & AR934X_REV_ID_REVISION_MASK); + chip = "9341"; + ar71xx_soc = AR71XX_SOC_AR9341; + ar71xx_cpu_ops = &ar934x_chip_def; + break; + + case REV_ID_MAJOR_AR9342: + minor = 0; + rev = (id & AR934X_REV_ID_REVISION_MASK); + chip = "9342"; + ar71xx_soc = AR71XX_SOC_AR9342; + ar71xx_cpu_ops = &ar934x_chip_def; + break; + + case REV_ID_MAJOR_AR9344: + minor = 0; + rev = (id & AR934X_REV_ID_REVISION_MASK); + chip = "9344"; + ar71xx_soc = AR71XX_SOC_AR9344; + ar71xx_cpu_ops = &ar934x_chip_def; + break; + default: panic("ar71xx: unknown chip id:0x%08x\n", id); } diff --git a/sys/mips/atheros/ar724x_chip.c b/sys/mips/atheros/ar724x_chip.c index 74502d5a71be..c06eca63cd22 100644 --- a/sys/mips/atheros/ar724x_chip.c +++ b/sys/mips/atheros/ar724x_chip.c @@ -90,6 +90,8 @@ ar724x_chip_detect_sys_frequency(void) div = (((pll >> AR724X_AHB_DIV_SHIFT) & AR724X_AHB_DIV_MASK) + 1) * 2; u_ar71xx_ahb_freq = u_ar71xx_cpu_freq / div; + u_ar71xx_wdt_freq = u_ar71xx_cpu_freq / div; + u_ar71xx_uart_freq = u_ar71xx_cpu_freq / div; } static void diff --git a/sys/mips/atheros/ar91xx_chip.c b/sys/mips/atheros/ar91xx_chip.c index 37feaf7ebdbb..a4174b47363d 100644 --- a/sys/mips/atheros/ar91xx_chip.c +++ b/sys/mips/atheros/ar91xx_chip.c @@ -84,6 +84,8 @@ ar91xx_chip_detect_sys_frequency(void) div = (((pll >> AR91XX_AHB_DIV_SHIFT) & AR91XX_AHB_DIV_MASK) + 1) * 2; u_ar71xx_ahb_freq = u_ar71xx_cpu_freq / div; + u_ar71xx_uart_freq = u_ar71xx_cpu_freq / div; + u_ar71xx_wdt_freq = u_ar71xx_cpu_freq / div; } static void diff --git a/sys/mips/atheros/ar933x_chip.c b/sys/mips/atheros/ar933x_chip.c index cf0de55331f2..1b68cadd7a56 100644 --- a/sys/mips/atheros/ar933x_chip.c +++ b/sys/mips/atheros/ar933x_chip.c @@ -114,6 +114,10 @@ ar933x_chip_detect_sys_frequency(void) AR933X_PLL_CLOCK_CTRL_AHB_DIV_MASK) + 1; u_ar71xx_ahb_freq = freq / t; } + + /* XXX uart should be the refclk, no? */ + u_ar71xx_uart_freq = u_ar71xx_ahb_freq; + u_ar71xx_wdt_freq = u_ar71xx_ahb_freq; } static void diff --git a/sys/mips/atheros/ar934x_chip.c b/sys/mips/atheros/ar934x_chip.c new file mode 100644 index 000000000000..2a76e114aaad --- /dev/null +++ b/sys/mips/atheros/ar934x_chip.c @@ -0,0 +1,333 @@ +/*- + * Copyright (c) 2013 Adrian Chadd <adrian@FreeBSD.org> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); + +#include "opt_ddb.h" + +#include <sys/param.h> +#include <sys/conf.h> +#include <sys/kernel.h> +#include <sys/systm.h> +#include <sys/bus.h> +#include <sys/cons.h> +#include <sys/kdb.h> +#include <sys/reboot.h> + +#include <vm/vm.h> +#include <vm/vm_page.h> + +#include <net/ethernet.h> + +#include <machine/clock.h> +#include <machine/cpu.h> +#include <machine/cpuregs.h> +#include <machine/hwfunc.h> +#include <machine/md_var.h> +#include <machine/trap.h> +#include <machine/vmparam.h> + +#include <mips/atheros/ar71xxreg.h> +#include <mips/atheros/ar934xreg.h> + +#include <mips/atheros/ar71xx_cpudef.h> +#include <mips/atheros/ar71xx_setup.h> + +#include <mips/atheros/ar71xx_chip.h> +#include <mips/atheros/ar934x_chip.h> + +static void +ar934x_chip_detect_mem_size(void) +{ +} + +static uint32_t +ar934x_get_pll_freq(uint32_t ref, uint32_t ref_div, uint32_t nint, + uint32_t nfrac, uint32_t frac, uint32_t out_div) +{ + uint64_t t; + uint32_t ret; + + t = u_ar71xx_refclk; + t *= nint; + t = t / ref_div; + ret = t; + + t = u_ar71xx_refclk; + t *= nfrac; + t = t / (ref_div * frac); + ret += t; + + ret /= (1 << out_div); + return (ret); +} + +static void +ar934x_chip_detect_sys_frequency(void) +{ + uint32_t pll, out_div, ref_div, nint, nfrac, frac, clk_ctrl, postdiv; + uint32_t cpu_pll, ddr_pll; + uint32_t bootstrap; + + bootstrap = ATH_READ_REG(AR934X_RESET_REG_BOOTSTRAP); + if (bootstrap & AR934X_BOOTSTRAP_REF_CLK_40) + u_ar71xx_refclk = 40 * 1000 * 1000; + else + u_ar71xx_refclk = 25 * 1000 * 1000; + + pll = ATH_READ_REG(AR934X_SRIF_CPU_DPLL2_REG); + if (pll & AR934X_SRIF_DPLL2_LOCAL_PLL) { + out_div = (pll >> AR934X_SRIF_DPLL2_OUTDIV_SHIFT) & + AR934X_SRIF_DPLL2_OUTDIV_MASK; + pll = ATH_READ_REG(AR934X_SRIF_CPU_DPLL1_REG); + nint = (pll >> AR934X_SRIF_DPLL1_NINT_SHIFT) & + AR934X_SRIF_DPLL1_NINT_MASK; + nfrac = pll & AR934X_SRIF_DPLL1_NFRAC_MASK; + ref_div = (pll >> AR934X_SRIF_DPLL1_REFDIV_SHIFT) & + AR934X_SRIF_DPLL1_REFDIV_MASK; + frac = 1 << 18; + } else { + pll = ATH_READ_REG(AR934X_PLL_CPU_CONFIG_REG); + out_div = (pll >> AR934X_PLL_CPU_CONFIG_OUTDIV_SHIFT) & + AR934X_PLL_CPU_CONFIG_OUTDIV_MASK; + ref_div = (pll >> AR934X_PLL_CPU_CONFIG_REFDIV_SHIFT) & + AR934X_PLL_CPU_CONFIG_REFDIV_MASK; + nint = (pll >> AR934X_PLL_CPU_CONFIG_NINT_SHIFT) & + AR934X_PLL_CPU_CONFIG_NINT_MASK; + nfrac = (pll >> AR934X_PLL_CPU_CONFIG_NFRAC_SHIFT) & + AR934X_PLL_CPU_CONFIG_NFRAC_MASK; + frac = 1 << 6; + } + + cpu_pll = ar934x_get_pll_freq(u_ar71xx_refclk, ref_div, nint, + nfrac, frac, out_div); + + pll = ATH_READ_REG(AR934X_SRIF_DDR_DPLL2_REG); + if (pll & AR934X_SRIF_DPLL2_LOCAL_PLL) { + out_div = (pll >> AR934X_SRIF_DPLL2_OUTDIV_SHIFT) & + AR934X_SRIF_DPLL2_OUTDIV_MASK; + pll = ATH_READ_REG(AR934X_SRIF_DDR_DPLL1_REG); + nint = (pll >> AR934X_SRIF_DPLL1_NINT_SHIFT) & + AR934X_SRIF_DPLL1_NINT_MASK; + nfrac = pll & AR934X_SRIF_DPLL1_NFRAC_MASK; + ref_div = (pll >> AR934X_SRIF_DPLL1_REFDIV_SHIFT) & + AR934X_SRIF_DPLL1_REFDIV_MASK; + frac = 1 << 18; + } else { + pll = ATH_READ_REG(AR934X_PLL_DDR_CONFIG_REG); + out_div = (pll >> AR934X_PLL_DDR_CONFIG_OUTDIV_SHIFT) & + AR934X_PLL_DDR_CONFIG_OUTDIV_MASK; + ref_div = (pll >> AR934X_PLL_DDR_CONFIG_REFDIV_SHIFT) & + AR934X_PLL_DDR_CONFIG_REFDIV_MASK; + nint = (pll >> AR934X_PLL_DDR_CONFIG_NINT_SHIFT) & + AR934X_PLL_DDR_CONFIG_NINT_MASK; + nfrac = (pll >> AR934X_PLL_DDR_CONFIG_NFRAC_SHIFT) & + AR934X_PLL_DDR_CONFIG_NFRAC_MASK; + frac = 1 << 10; + } + + ddr_pll = ar934x_get_pll_freq(u_ar71xx_refclk, ref_div, nint, + nfrac, frac, out_div); + + clk_ctrl = ATH_READ_REG(AR934X_PLL_CPU_DDR_CLK_CTRL_REG); + + postdiv = (clk_ctrl >> AR934X_PLL_CPU_DDR_CLK_CTRL_CPU_POST_DIV_SHIFT) & + AR934X_PLL_CPU_DDR_CLK_CTRL_CPU_POST_DIV_MASK; + + if (clk_ctrl & AR934X_PLL_CPU_DDR_CLK_CTRL_CPU_PLL_BYPASS) + u_ar71xx_cpu_freq = u_ar71xx_refclk; + else if (clk_ctrl & AR934X_PLL_CPU_DDR_CLK_CTRL_CPUCLK_FROM_CPUPLL) + u_ar71xx_cpu_freq = cpu_pll / (postdiv + 1); + else + u_ar71xx_cpu_freq = ddr_pll / (postdiv + 1); + + postdiv = (clk_ctrl >> AR934X_PLL_CPU_DDR_CLK_CTRL_DDR_POST_DIV_SHIFT) & + AR934X_PLL_CPU_DDR_CLK_CTRL_DDR_POST_DIV_MASK; + + if (clk_ctrl & AR934X_PLL_CPU_DDR_CLK_CTRL_DDR_PLL_BYPASS) + u_ar71xx_ddr_freq = u_ar71xx_refclk; + else if (clk_ctrl & AR934X_PLL_CPU_DDR_CLK_CTRL_DDRCLK_FROM_DDRPLL) + u_ar71xx_ddr_freq = ddr_pll / (postdiv + 1); + else + u_ar71xx_ddr_freq = cpu_pll / (postdiv + 1); + + postdiv = (clk_ctrl >> AR934X_PLL_CPU_DDR_CLK_CTRL_AHB_POST_DIV_SHIFT) & + AR934X_PLL_CPU_DDR_CLK_CTRL_AHB_POST_DIV_MASK; + + if (clk_ctrl & AR934X_PLL_CPU_DDR_CLK_CTRL_AHB_PLL_BYPASS) + u_ar71xx_ahb_freq = u_ar71xx_refclk; + else if (clk_ctrl & AR934X_PLL_CPU_DDR_CLK_CTRL_AHBCLK_FROM_DDRPLL) + u_ar71xx_ahb_freq = ddr_pll / (postdiv + 1); + else + u_ar71xx_ahb_freq = cpu_pll / (postdiv + 1); + + u_ar71xx_wdt_freq = u_ar71xx_refclk; + u_ar71xx_uart_freq = u_ar71xx_refclk; +} + +static void +ar934x_chip_device_stop(uint32_t mask) +{ + uint32_t reg; + + reg = ATH_READ_REG(AR934X_RESET_REG_RESET_MODULE); + ATH_WRITE_REG(AR934X_RESET_REG_RESET_MODULE, reg | mask); +} + +static void +ar934x_chip_device_start(uint32_t mask) +{ + uint32_t reg; + + reg = ATH_READ_REG(AR934X_RESET_REG_RESET_MODULE); + ATH_WRITE_REG(AR934X_RESET_REG_RESET_MODULE, reg & ~mask); +} + +static int +ar934x_chip_device_stopped(uint32_t mask) +{ + uint32_t reg; + + reg = ATH_READ_REG(AR934X_RESET_REG_RESET_MODULE); + return ((reg & mask) == mask); +} + +static void +ar934x_chip_set_mii_speed(uint32_t unit, uint32_t speed) +{ + + /* XXX TODO */ + return; +} + +/* + * XXX TODO !! + */ +static void +ar934x_chip_set_pll_ge(int unit, int speed, uint32_t pll) +{ + + switch (unit) { + case 0: + /* XXX TODO */ + break; + case 1: + /* XXX TODO */ + break; + default: + printf("%s: invalid PLL set for arge unit: %d\n", + __func__, unit); + return; + } +} + +static void +ar934x_chip_ddr_flush_ge(int unit) +{ + + switch (unit) { + case 0: + ar71xx_ddr_flush(AR934X_DDR_REG_FLUSH_GE0); + break; + case 1: + ar71xx_ddr_flush(AR934X_DDR_REG_FLUSH_GE1); + break; + default: + printf("%s: invalid DDR flush for arge unit: %d\n", + __func__, unit); + return; + } +} + +static void +ar934x_chip_ddr_flush_ip2(void) +{ + + ar71xx_ddr_flush(AR934X_DDR_REG_FLUSH_WMAC); +} + +static uint32_t +ar934x_chip_get_eth_pll(unsigned int mac, int speed) +{ +#if 0 + uint32_t pll; + + switch (speed) { + case 10: + pll = AR933X_PLL_VAL_10; + break; + case 100: + pll = AR933X_PLL_VAL_100; + break; + case 1000: + pll = AR933X_PLL_VAL_1000; + break; + default: + printf("%s%d: invalid speed %d\n", __func__, mac, speed); + pll = 0; + } + return (pll); +#endif + return (0); +} + +static void +ar934x_chip_init_usb_peripheral(void) +{ + uint32_t reg; + + reg = ATH_READ_REG(AR934X_RESET_REG_BOOTSTRAP); + if (reg & AR934X_BOOTSTRAP_USB_MODE_DEVICE) + return; + + ar71xx_device_stop(AR934X_RESET_USBSUS_OVERRIDE); + DELAY(100); + + ar71xx_device_start(AR934X_RESET_USB_PHY); + DELAY(100); + + ar71xx_device_start(AR934X_RESET_USB_PHY_ANALOG); + DELAY(100); + + ar71xx_device_start(AR934X_RESET_USB_HOST); + DELAY(100); +} + +struct ar71xx_cpu_def ar934x_chip_def = { + &ar934x_chip_detect_mem_size, + &ar934x_chip_detect_sys_frequency, + &ar934x_chip_device_stop, + &ar934x_chip_device_start, + &ar934x_chip_device_stopped, + &ar934x_chip_set_pll_ge, + &ar934x_chip_set_mii_speed, + &ar71xx_chip_set_mii_if, + &ar934x_chip_ddr_flush_ge, + &ar934x_chip_get_eth_pll, + &ar934x_chip_ddr_flush_ip2, + &ar934x_chip_init_usb_peripheral +}; diff --git a/sys/mips/atheros/ar934x_chip.h b/sys/mips/atheros/ar934x_chip.h new file mode 100644 index 000000000000..ba21b25f6eec --- /dev/null +++ b/sys/mips/atheros/ar934x_chip.h @@ -0,0 +1,34 @@ +/*- + * Copyright (c) 2013 Adrian Chadd <adrian@FreeBSD.org> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* $FreeBSD$ */ + +#ifndef __AR934X_CHIP_H__ +#define __AR934X_CHIP_H__ + +extern struct ar71xx_cpu_def ar934x_chip_def; + +#endif diff --git a/sys/mips/atheros/files.ar71xx b/sys/mips/atheros/files.ar71xx index b72e614e9354..4685685d2d45 100644 --- a/sys/mips/atheros/files.ar71xx +++ b/sys/mips/atheros/files.ar71xx @@ -25,6 +25,7 @@ mips/atheros/ar71xx_chip.c standard mips/atheros/ar724x_chip.c standard mips/atheros/ar91xx_chip.c standard mips/atheros/ar933x_chip.c standard +mips/atheros/ar934x_chip.c standard mips/atheros/ar71xx_fixup.c optional ar71xx_ath_eeprom dev/hwpmc/hwpmc_mips24k.c optional hwpmc_mips24k diff --git a/sys/mips/atheros/uart_bus_ar71xx.c b/sys/mips/atheros/uart_bus_ar71xx.c index 4c04aba360f4..73361521f1b0 100644 --- a/sys/mips/atheros/uart_bus_ar71xx.c +++ b/sys/mips/atheros/uart_bus_ar71xx.c @@ -70,7 +70,7 @@ uart_ar71xx_probe(device_t dev) struct uart_softc *sc; uint64_t freq; - freq = ar71xx_ahb_freq(); + freq = ar71xx_uart_freq(); sc = device_get_softc(dev); sc->sc_sysdev = SLIST_FIRST(&uart_sysdevs); diff --git a/sys/mips/atheros/uart_bus_ar933x.c b/sys/mips/atheros/uart_bus_ar933x.c index 27c1277d4384..1ce6c624169d 100644 --- a/sys/mips/atheros/uart_bus_ar933x.c +++ b/sys/mips/atheros/uart_bus_ar933x.c @@ -72,7 +72,7 @@ uart_ar933x_probe(device_t dev) struct uart_softc *sc; uint64_t freq; - freq = ar71xx_refclk(); + freq = ar71xx_uart_freq(); sc = device_get_softc(dev); sc->sc_sysdev = SLIST_FIRST(&uart_sysdevs); diff --git a/sys/mips/atheros/uart_cpu_ar71xx.c b/sys/mips/atheros/uart_cpu_ar71xx.c index 8465c26d6502..f004c1fea400 100644 --- a/sys/mips/atheros/uart_cpu_ar71xx.c +++ b/sys/mips/atheros/uart_cpu_ar71xx.c @@ -56,7 +56,7 @@ uart_cpu_getdev(int devtype, struct uart_devinfo *di) { uint64_t freq; - freq = ar71xx_ahb_freq(); + freq = ar71xx_uart_freq(); di->ops = uart_getops(&uart_ns8250_class); di->bas.chan = 0; diff --git a/sys/mips/atheros/uart_cpu_ar933x.c b/sys/mips/atheros/uart_cpu_ar933x.c index d23a5c8495b3..c4f942e41088 100644 --- a/sys/mips/atheros/uart_cpu_ar933x.c +++ b/sys/mips/atheros/uart_cpu_ar933x.c @@ -58,7 +58,7 @@ uart_cpu_getdev(int devtype, struct uart_devinfo *di) { uint64_t freq; - freq = ar71xx_refclk(); + freq = ar71xx_uart_freq(); di->ops = uart_getops(&uart_ar933x_class); di->bas.chan = 0; diff --git a/sys/mips/cavium/std.octeon1 b/sys/mips/cavium/std.octeon1 index 8f8a54ab5e86..70618ca898b6 100644 --- a/sys/mips/cavium/std.octeon1 +++ b/sys/mips/cavium/std.octeon1 @@ -1,7 +1,3 @@ -# /* -# * This product includes software developed by the University of -# * California, Berkeley and its contributors." -# */ # $FreeBSD$ # files "../cavium/files.octeon1" diff --git a/sys/mips/conf/AR934X_BASE b/sys/mips/conf/AR934X_BASE new file mode 100644 index 000000000000..4e07eebc1def --- /dev/null +++ b/sys/mips/conf/AR934X_BASE @@ -0,0 +1,124 @@ +# +# AR91XX -- Kernel configuration base file for the Atheros AR913x SoC. +# +# This file (and the hints file accompanying it) are not designed to be +# used by themselves. Instead, users of this file should create a kernel +# config file which includes this file (which gets the basic hints), then +# override the default options (adding devices as needed) and adding +# hints as needed (for example, the GPIO and LAN PHY.) +# +# $FreeBSD$ +# + +machine mips mips +ident AR934X_BASE +cpu CPU_MIPS4KC +makeoptions KERNLOADADDR=0x80050000 +options HZ=1000 + +files "../atheros/files.ar71xx" +hints "AR934X_BASE.hints" + +makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +# makeoptions MODULES_OVERRIDE="random gpio ar71xx if_gif if_gre if_bridge bridgestp usb wlan wlan_xauth wlan_acl wlan_wep wlan_tkip wlan_ccmp wlan_rssadapt wlan_amrr ath ath_ahb hwpmc" +makeoptions MODULES_OVERRIDE="" + +options DDB +options KDB +options ALQ + +options SCHED_4BSD #4BSD scheduler +options INET #InterNETworking +#options INET6 #InterNETworking +#options NFSCL #Network Filesystem Client +options PSEUDOFS #Pseudo-filesystem framework +options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions + +# Don't include the SCSI/CAM strings in the default build +options SCSI_NO_SENSE_STRINGS +options SCSI_NO_OP_STRINGS + +# .. And no sysctl strings +options NO_SYSCTL_DESCR + +# Limit IO size +options NBUF=128 + +# Limit UMTX hash size +# options UMTX_NUM_CHAINS=64 + +# PMC +#options HWPMC_HOOKS +#device hwpmc +#device hwpmc_mips24k + +# options NFS_LEGACYRPC +# Debugging for use in -current +#options INVARIANTS +#options INVARIANT_SUPPORT +#options WITNESS +#options WITNESS_SKIPSPIN +options FFS #Berkeley Fast Filesystem +#options SOFTUPDATES #Enable FFS soft updates support +#options UFS_ACL #Support for access control lists +#options UFS_DIRHASH #Improve performance on big directories +options NO_FFS_SNAPSHOT # We don't require snapshot support + +# Wireless NIC cards +options IEEE80211_DEBUG +options IEEE80211_SUPPORT_MESH +options IEEE80211_SUPPORT_TDMA +options IEEE80211_SUPPORT_SUPERG +options IEEE80211_ALQ # 802.11 ALQ logging support +device wlan # 802.11 support +device wlan_wep # 802.11 WEP support +device wlan_ccmp # 802.11 CCMP support +device wlan_tkip # 802.11 TKIP support +device wlan_xauth # 802.11 hostap support + +# ath(4) +device ath # Atheros network device +device ath_rate_sample +device ath_ahb # Atheros host bus glue +options ATH_DEBUG +options ATH_DIAGAPI +option ATH_ENABLE_11N +option AH_DEBUG_ALQ + +#device ath_hal +device ath_ar9300 # AR9330 HAL; no need for the others +option AH_DEBUG +option AH_SUPPORT_AR5416 # 11n HAL support +option AH_SUPPORT_AR9340 # Chipset support +option AH_DEBUG_ALQ +option AH_AR5416_INTERRUPT_MITIGATION + +device mii +device arge + +device usb +options USB_EHCI_BIG_ENDIAN_DESC # handle big-endian byte order +options USB_DEBUG +options USB_HOST_ALIGN=32 # AR71XX (MIPS in general?) requires this +device ehci + +device scbus +device umass +device da + +device spibus +device ar71xx_spi +device mx25l +device ar71xx_wdog + +device uart +device uart_ar71xx + +device loop +device ether +device md +device bpf +device random +device if_bridge +device gpio +device gpioled diff --git a/sys/mips/conf/AR934X_BASE.hints b/sys/mips/conf/AR934X_BASE.hints new file mode 100644 index 000000000000..91f8631218bd --- /dev/null +++ b/sys/mips/conf/AR934X_BASE.hints @@ -0,0 +1,61 @@ +# This file (and the kernel config file accompanying it) are not designed +# to be used by themselves. Instead, users of this file should create a +# kernel # config file which includes this file (which gets the basic hints), +# then override the default options (adding devices as needed) and adding +# hints as needed (for example, the GPIO and LAN PHY.) + +# $FreeBSD$ + +hint.apb.0.at="nexus0" +hint.apb.0.irq=4 + +# uart0 +hint.uart.0.at="apb0" +# NB: This isn't an ns8250 UART +hint.uart.0.maddr=0x18020003 +hint.uart.0.msize=0x18 +hint.uart.0.irq=3 + +#ehci - note the 0x100 offset for the AR913x/AR724x +hint.ehci.0.at="nexus0" +hint.ehci.0.maddr=0x1b000100 +hint.ehci.0.msize=0x00001000 +hint.ehci.0.irq=1 + +hint.arge.0.at="nexus0" +hint.arge.0.maddr=0x19000000 +hint.arge.0.msize=0x1000 +hint.arge.0.irq=2 + +hint.arge.1.at="nexus0" +hint.arge.1.maddr=0x1a000000 +hint.arge.1.msize=0x1000 +hint.arge.1.irq=3 + +# XXX The ath device hangs off of the AHB, rather than the Nexus. +hint.ath.0.at="nexus0" +hint.ath.0.maddr=0x18100000 +hint.ath.0.msize=0x20000 +hint.ath.0.irq=0 +hint.ath.0.vendor_id=0x168c +hint.ath.0.device_id=0x0031 +# Set this to define where the ath calibration data +# should be fetched from in physical memory. +# hint.ath.0.eepromaddr=0x1fff1000 + +# SPI flash +hint.spi.0.at="nexus0" +hint.spi.0.maddr=0x1f000000 +hint.spi.0.msize=0x10 + +hint.mx25l.0.at="spibus0" +hint.mx25l.0.cs=0 + +# Watchdog +hint.ar71xx_wdog.0.at="nexus0" + +# The GPIO function and pin mask is configured per-board +hint.gpio.0.at="apb0" +hint.gpio.0.maddr=0x18040000 +hint.gpio.0.msize=0x1000 +hint.gpio.0.irq=2 diff --git a/sys/mips/conf/DB120 b/sys/mips/conf/DB120 new file mode 100644 index 000000000000..7578f0912957 --- /dev/null +++ b/sys/mips/conf/DB120 @@ -0,0 +1,46 @@ +# +# DB120 - the AR9344 SoC reference design +# +# $FreeBSD$ +# + +# Include the default AR934x parameters +include "AR934X_BASE" + +ident DB120 + +# Override hints with board values +hints "DB120.hints" + +# Force the board memory - the base DB120 has 128MB RAM +options AR71XX_REALMEM=(32*1024*1024) + +# i2c GPIO bus +#device gpioiic +#device iicbb +#device iicbus +#device iic + +# Options required for miiproxy and mdiobus +options ARGE_MDIO # Export an MDIO bus separate from arge +device miiproxy # MDIO bus <-> MII PHY rendezvous + +device etherswitch +device arswitch + +# read MSDOS formatted disks - USB +#options MSDOSFS + +# Enable the uboot environment stuff rather then the +# redboot stuff. +options AR71XX_ENV_UBOOT + +# uzip - to boot natively from flash +device geom_uncompress +options GEOM_UNCOMPRESS + +# Used for the static uboot partition map +device geom_map + +# Boot off of the rootfs, as defined in the geom_map setup. +options ROOTDEVNAME=\"ufs:map/rootfs.uncompress\" diff --git a/sys/mips/conf/DB120.hints b/sys/mips/conf/DB120.hints new file mode 100644 index 000000000000..d395f153a64f --- /dev/null +++ b/sys/mips/conf/DB120.hints @@ -0,0 +1,3 @@ +# $FreeBSD$ + +# This is a placeholder until the hardware support is complete. diff --git a/sys/mips/conf/DIR-825 b/sys/mips/conf/DIR-825 index 3609d769709e..62189cfc285e 100644 --- a/sys/mips/conf/DIR-825 +++ b/sys/mips/conf/DIR-825 @@ -24,7 +24,7 @@ nodevice gpio nodevice gpioled nodevice gif nodevice gre -nodevice bridge +nodevice if_bridge nodevice usb nodevice ehci nodevice wlan diff --git a/sys/mips/conf/DIR-825.hints b/sys/mips/conf/DIR-825.hints index c978f6d9b325..0fe0196de9bd 100644 --- a/sys/mips/conf/DIR-825.hints +++ b/sys/mips/conf/DIR-825.hints @@ -15,11 +15,11 @@ hint.arge.1.media=1000 hint.arge.1.fduplex=1 # ath0 - slot 17 -hint.pcib.0.bus.0.17.0.ath_fixup_addr=0x1fff1000 +hint.pcib.0.bus.0.17.0.ath_fixup_addr=0x1f661000 hint.pcib.0.bus.0.17.0.ath_fixup_size=4096 # ath1 - slot 18 -hint.pcib.0.bus.0.18.0.ath_fixup_addr=0x1fff5000 +hint.pcib.0.bus.0.18.0.ath_fixup_addr=0x1f665000 hint.pcib.0.bus.0.18.0.ath_fixup_size=4096 # .. and now, telling each ath(4) NIC where to find the firmware diff --git a/sys/modules/Makefile b/sys/modules/Makefile index 5ffa6b2c2dd5..badfdd93b956 100644 --- a/sys/modules/Makefile +++ b/sys/modules/Makefile @@ -284,7 +284,6 @@ SUBDIR= \ re \ reiserfs \ rl \ - ${_runfw} \ ${_s3} \ ${_safe} \ ${_sbni} \ @@ -446,7 +445,6 @@ _fxp= fxp _ispfw= ispfw _mwlfw= mwlfw _ralfw= ralfw -_runfw= runfw _sf= sf _sn= sn _ti= ti @@ -825,6 +823,7 @@ _sound= sound .if ${MK_CDDL} != "no" || defined(ALL_MODULES) _opensolaris= opensolaris .endif +_wi= wi .endif .if ${MACHINE_ARCH} == "powerpc64" diff --git a/sys/modules/cxgbe/if_cxgbe/Makefile b/sys/modules/cxgbe/if_cxgbe/Makefile index 1e0eb9dc6a6e..f4ebcdd39dc3 100644 --- a/sys/modules/cxgbe/if_cxgbe/Makefile +++ b/sys/modules/cxgbe/if_cxgbe/Makefile @@ -8,7 +8,7 @@ CXGBE = ${.CURDIR}/../../../dev/cxgbe .PATH: ${CXGBE} ${CXGBE}/common KMOD = if_cxgbe -SRCS = t4_main.c t4_sge.c t4_l2t.c +SRCS = t4_main.c t4_sge.c t4_l2t.c t4_tracer.c SRCS+= t4_hw.c SRCS+= device_if.h bus_if.h pci_if.h SRCS+= opt_inet.h opt_inet6.h diff --git a/sys/modules/dtrace/dtrace/Makefile b/sys/modules/dtrace/dtrace/Makefile index 4f040624b310..db1fdc115680 100644 --- a/sys/modules/dtrace/dtrace/Makefile +++ b/sys/modules/dtrace/dtrace/Makefile @@ -49,3 +49,6 @@ EXPORT_SYMS= dtrace_register \ dtrace_asm.o: assym.s .include <bsd.kmod.mk> + +CWARNFLAGS+= -Wno-parentheses +CWARNFLAGS+= -Wno-uninitialized diff --git a/sys/modules/nvme/Makefile b/sys/modules/nvme/Makefile index 17004bca5f32..ae727a7d0b1a 100644 --- a/sys/modules/nvme/Makefile +++ b/sys/modules/nvme/Makefile @@ -12,6 +12,7 @@ SRCS = nvme.c \ nvme_qpair.c \ nvme_sysctl.c \ nvme_test.c \ + nvme_util.c \ \ bus_if.h \ device_if.h \ diff --git a/sys/modules/runfw/Makefile b/sys/modules/runfw/Makefile deleted file mode 100644 index c6e788429ac9..000000000000 --- a/sys/modules/runfw/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -# $FreeBSD$ - -KMOD= runfw -FIRMWS= run.fw:runfw:1 - -CLEANFILES= run.fw - -run.fw: ${.CURDIR}/../../contrib/dev/run/rt2870.fw.uu - uudecode -p ${.CURDIR}/../../contrib/dev/run/rt2870.fw.uu > ${.TARGET} - -.include <bsd.kmod.mk> diff --git a/sys/modules/usb/Makefile b/sys/modules/usb/Makefile index 6f2626fe4dfe..325b00d72289 100644 --- a/sys/modules/usb/Makefile +++ b/sys/modules/usb/Makefile @@ -31,20 +31,36 @@ # MK_SOURCELESS_UCODE option (see below). SUBDIR = usb -SUBDIR += ${_dwc_otg} ehci ${_musb} ohci uhci xhci ${_uss820dci} ${_at91dci} ${_atmegadci} ${_avr32dci} -SUBDIR += ${_rum} run ${_uath} upgt usie ural ${_zyd} ${_urtw} urtwn urtwnfw +SUBDIR += ${_dwc_otg} ehci ${_musb} ohci uhci xhci ${_uss820dci} ${_at91dci} \ + ${_atmegadci} ${_avr32dci} ${_rsu} ${_rsufw} +SUBDIR += ${_rum} ${_run} ${_runfw} ${_uath} upgt usie ural ${_zyd} ${_urtw} +SUBDIR += ${_urtwn} ${_urtwnfw} SUBDIR += atp uhid ukbd ums udbp ufm uep SUBDIR += ucom u3g uark ubsa ubser uchcom ucycom ufoma uftdi ugensa uipaq ulpt \ umct umcs umodem umoscom uplcom uslcom uvisor uvscom SUBDIR += uether aue axe cdce cue ${_kue} mos rue smsc udav uhso ipheth SUBDIR += usfs umass urio SUBDIR += quirk template +SUBDIR += ${_g_audio} ${_g_keyboard} ${_g_modem} ${_g_mouse} + +.if ${MK_USB_GADGET_EXAMPLES} == "yes" +_g_audio= g_audio +_g_keyboard= g_keyboard +_g_modem= g_modem +_g_mouse= g_mouse +.endif .if ${MK_SOURCELESS_UCODE} != "no" _rum= rum _uath= uath _zyd= zyd _kue= kue +_urtwn= urtwn +_urtwnfw= urtwnfw +_run= run +_runfw= runfw +_rsu= rsu +_rsufw= rsufw .endif .if ${MACHINE_CPUARCH} == "amd64" diff --git a/sys/modules/usb/g_audio/Makefile b/sys/modules/usb/g_audio/Makefile new file mode 100644 index 000000000000..7425adeccfd8 --- /dev/null +++ b/sys/modules/usb/g_audio/Makefile @@ -0,0 +1,35 @@ +# +# $FreeBSD$ +# +# Copyright (c) 2010 Hans Petter Selasky. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# + +.PATH: ${.CURDIR}/../../../dev/usb/gadget + +KMOD= g_audio + +SRCS= bus_if.h usb_if.h device_if.h vnode_if.h \ + card_if.h opt_usb.h pci_if.h g_audio.c + +.include <bsd.kmod.mk> diff --git a/sys/modules/usb/g_keyboard/Makefile b/sys/modules/usb/g_keyboard/Makefile new file mode 100644 index 000000000000..302a24294d3c --- /dev/null +++ b/sys/modules/usb/g_keyboard/Makefile @@ -0,0 +1,35 @@ +# +# $FreeBSD$ +# +# Copyright (c) 2008 Hans Petter Selasky. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# + +.PATH: ${.CURDIR}/../../../dev/usb/gadget + +KMOD= g_keyboard + +SRCS= bus_if.h usb_if.h device_if.h vnode_if.h \ + opt_usb.h g_keyboard.c + +.include <bsd.kmod.mk> diff --git a/sys/modules/usb/g_modem/Makefile b/sys/modules/usb/g_modem/Makefile new file mode 100644 index 000000000000..980849efe3c9 --- /dev/null +++ b/sys/modules/usb/g_modem/Makefile @@ -0,0 +1,35 @@ +# +# $FreeBSD$ +# +# Copyright (c) 2010 Hans Petter Selasky. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# + +.PATH: ${.CURDIR}/../../../dev/usb/gadget + +KMOD= g_modem + +SRCS= bus_if.h usb_if.h device_if.h vnode_if.h \ + card_if.h opt_usb.h pci_if.h g_modem.c + +.include <bsd.kmod.mk> diff --git a/sys/modules/usb/g_mouse/Makefile b/sys/modules/usb/g_mouse/Makefile new file mode 100644 index 000000000000..b6d30de1622c --- /dev/null +++ b/sys/modules/usb/g_mouse/Makefile @@ -0,0 +1,35 @@ +# +# $FreeBSD$ +# +# Copyright (c) 2008 Hans Petter Selasky. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# + +.PATH: ${.CURDIR}/../../../dev/usb/gadget + +KMOD= g_mouse + +SRCS= bus_if.h usb_if.h device_if.h vnode_if.h \ + opt_usb.h g_mouse.c + +.include <bsd.kmod.mk> diff --git a/sys/modules/usb/rsu/Makefile b/sys/modules/usb/rsu/Makefile new file mode 100644 index 000000000000..482071c21718 --- /dev/null +++ b/sys/modules/usb/rsu/Makefile @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../../dev/usb/wlan + +KMOD = if_rsu +SRCS = if_rsu.c if_rsureg.h \ + bus_if.h device_if.h \ + opt_bus.h opt_usb.h usb_if.h usbdevs.h + +.include <bsd.kmod.mk> diff --git a/sys/modules/usb/rsufw/Makefile b/sys/modules/usb/rsufw/Makefile new file mode 100644 index 000000000000..3076e6914c58 --- /dev/null +++ b/sys/modules/usb/rsufw/Makefile @@ -0,0 +1,5 @@ +# $FreeBSD$ + +SUBDIR= rsurtl8712fw + +.include <bsd.subdir.mk> diff --git a/sys/modules/usb/rsufw/Makefile.inc b/sys/modules/usb/rsufw/Makefile.inc new file mode 100644 index 000000000000..03779b948015 --- /dev/null +++ b/sys/modules/usb/rsufw/Makefile.inc @@ -0,0 +1,15 @@ +# $FreeBSD$ +# +# Common rules for building firmware. Note this gets auto-included +# by the subdir Makefile's as a consequence of included bsd.kmod.mk. + +_FIRM= ${IMG}.fw + +CLEANFILES+= ${_FIRM} + +FIRMWS= ${_FIRM}:${KMOD}:120 + +FIRMWARE_LICENSE= realtek + +${_FIRM}: ${.CURDIR}/../../../../contrib/dev/rsu/${_FIRM}.uu + uudecode -p $? > ${.TARGET} diff --git a/sys/modules/usb/rsufw/rsurtl8712fw/Makefile b/sys/modules/usb/rsufw/rsurtl8712fw/Makefile new file mode 100644 index 000000000000..30132d76cdcb --- /dev/null +++ b/sys/modules/usb/rsufw/rsurtl8712fw/Makefile @@ -0,0 +1,6 @@ +# $FreeBSD$ + +KMOD= rsu-rtl8712fw +IMG= rsu-rtl8712fw + +.include <bsd.kmod.mk> diff --git a/sys/modules/usb/runfw/Makefile b/sys/modules/usb/runfw/Makefile new file mode 100644 index 000000000000..3734153fc146 --- /dev/null +++ b/sys/modules/usb/runfw/Makefile @@ -0,0 +1,11 @@ +# $FreeBSD$ + +KMOD= runfw +FIRMWS= run.fw:runfw:1 + +CLEANFILES= run.fw + +run.fw: ${.CURDIR}/../../../contrib/dev/run/rt2870.fw.uu + uudecode -p $? > ${.TARGET} + +.include <bsd.kmod.mk> diff --git a/sys/modules/wi/Makefile b/sys/modules/wi/Makefile index badbd750616e..46215a8ffade 100644 --- a/sys/modules/wi/Makefile +++ b/sys/modules/wi/Makefile @@ -7,4 +7,9 @@ SRCS= if_wi.c if_wi_pccard.c if_wi_pci.c \ card_if.h device_if.h bus_if.h pci_if.h pccarddevs.h \ opt_wlan.h +.if ${MACHINE_CPUARCH} == "powerpc" +SRCS+= if_wi_macio.c +SRCS+= ofw_bus_if.h +.endif + .include <bsd.kmod.mk> diff --git a/sys/net/ieee8023ad_lacp.c b/sys/net/ieee8023ad_lacp.c index a2d42e007a74..014140b4bd27 100644 --- a/sys/net/ieee8023ad_lacp.c +++ b/sys/net/ieee8023ad_lacp.c @@ -193,18 +193,6 @@ SYSCTL_INT(_net_link_lagg_lacp, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &lacp_debug, 0, "Enable LACP debug logging (1=debug, 2=trace)"); TUNABLE_INT("net.link.lagg.lacp.debug", &lacp_debug); -/* bitmap of ports */ -static int lacp_rx_test = 0; -static int lacp_tx_test = 0; -SYSCTL_INT(_net_link_lagg_lacp, OID_AUTO, rxtest, CTLFLAG_RW, &lacp_rx_test, 0, - "RXTest"); -SYSCTL_INT(_net_link_lagg_lacp, OID_AUTO, txtest, CTLFLAG_RW, &lacp_tx_test, 0, - "TXTest"); - -static int lacp_strict = 1; -SYSCTL_INT(_net_link_lagg_lacp, OID_AUTO, strict, CTLFLAG_RW, &lacp_strict, - 0, "Strict spec compliance"); - #define LACP_DPRINTF(a) if (lacp_debug & 0x01) { lacp_dprintf a ; } #define LACP_TRACE(a) if (lacp_debug & 0x02) { lacp_dprintf(a,"%s\n",__func__); } #define LACP_TPRINTF(a) if (lacp_debug & 0x04) { lacp_dprintf a ; } @@ -315,7 +303,7 @@ lacp_pdu_input(struct lacp_port *lp, struct mbuf *m) lacp_dump_lacpdu(du); } - if ((1 << lp->lp_ifp->if_dunit) & lacp_rx_test) { + if ((1 << lp->lp_ifp->if_dunit) & lp->lp_lsc->lsc_debug.lsc_rx_test) { LACP_TPRINTF((lp, "Dropping RX PDU\n")); goto bad; } @@ -750,10 +738,48 @@ lacp_transit_expire(void *vp) lsc->lsc_suppress_distributing = FALSE; } +static void +lacp_attach_sysctl(struct lacp_softc *lsc, struct sysctl_oid *p_oid) +{ + struct lagg_softc *sc = lsc->lsc_softc; + + SYSCTL_ADD_UINT(&sc->ctx, SYSCTL_CHILDREN(p_oid), OID_AUTO, + "lacp_strict_mode", + CTLFLAG_RW, + &lsc->lsc_strict_mode, + lsc->lsc_strict_mode, + "Enable LACP strict mode"); +} + +static void +lacp_attach_sysctl_debug(struct lacp_softc *lsc, struct sysctl_oid *p_oid) +{ + struct lagg_softc *sc = lsc->lsc_softc; + struct sysctl_oid *oid; + + /* Create a child of the parent lagg interface */ + oid = SYSCTL_ADD_NODE(&sc->ctx, SYSCTL_CHILDREN(p_oid), + OID_AUTO, "debug", CTLFLAG_RD, NULL, "DEBUG"); + + SYSCTL_ADD_UINT(&sc->ctx, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_test", + CTLFLAG_RW, + &lsc->lsc_debug.lsc_rx_test, + lsc->lsc_debug.lsc_rx_test, + "Bitmap of if_dunit entries to drop RX frames for"); + SYSCTL_ADD_UINT(&sc->ctx, SYSCTL_CHILDREN(oid), OID_AUTO, + "tx_test", + CTLFLAG_RW, + &lsc->lsc_debug.lsc_tx_test, + lsc->lsc_debug.lsc_tx_test, + "Bitmap of if_dunit entries to drop TX frames for"); +} + int lacp_attach(struct lagg_softc *sc) { struct lacp_softc *lsc; + struct sysctl_oid *oid; lsc = malloc(sizeof(struct lacp_softc), M_DEVBUF, M_NOWAIT|M_ZERO); @@ -765,10 +791,19 @@ lacp_attach(struct lagg_softc *sc) lsc->lsc_hashkey = arc4random(); lsc->lsc_active_aggregator = NULL; + lsc->lsc_strict_mode = 1; LACP_LOCK_INIT(lsc); TAILQ_INIT(&lsc->lsc_aggregators); LIST_INIT(&lsc->lsc_ports); + /* Create a child of the parent lagg interface */ + oid = SYSCTL_ADD_NODE(&sc->ctx, SYSCTL_CHILDREN(sc->sc_oid), + OID_AUTO, "lacp", CTLFLAG_RD, NULL, "LACP"); + + /* Attach sysctl nodes */ + lacp_attach_sysctl(lsc, oid); + lacp_attach_sysctl_debug(lsc, oid); + callout_init_mtx(&lsc->lsc_transit_callout, &lsc->lsc_mtx, 0); callout_init_mtx(&lsc->lsc_callout, &lsc->lsc_mtx, 0); @@ -1343,7 +1378,7 @@ re_eval: case LACP_MUX_DISTRIBUTING: if (selected != LACP_SELECTED || !p_sync || !p_collecting) { new_state = LACP_MUX_COLLECTING; - lacp_dprintf(lp, "Interface stopped DISTRIBUTING, possible flaping\n"); + lacp_dprintf(lp, "Interface stopped DISTRIBUTING, possible flapping\n"); sc->sc_flapping++; } break; @@ -1594,7 +1629,7 @@ lacp_sm_rx_record_pdu(struct lacp_port *lp, const struct lacpdu *du) } /* XXX Hack, still need to implement 5.4.9 para 2,3,4 */ - if (lacp_strict) + if (lp->lp_lsc->lsc_strict_mode) lp->lp_partner.lip_state |= LACP_STATE_SYNC; lacp_sm_ptx_update_timeout(lp, oldpstate); @@ -1622,7 +1657,7 @@ lacp_sm_rx_record_default(struct lacp_port *lp) LACP_TRACE(lp); oldpstate = lp->lp_partner.lip_state; - if (lacp_strict) + if (lp->lp_lsc->lsc_strict_mode) lp->lp_partner = lacp_partner_admin_strict; else lp->lp_partner = lacp_partner_admin_optimistic;; @@ -1660,7 +1695,7 @@ lacp_sm_rx_update_default_selected(struct lacp_port *lp) LACP_TRACE(lp); - if (lacp_strict) + if (lp->lp_lsc->lsc_strict_mode) lacp_sm_rx_update_selected_from_peerinfo(lp, &lacp_partner_admin_strict); else @@ -1695,10 +1730,11 @@ lacp_sm_tx(struct lacp_port *lp) return; } - if (((1 << lp->lp_ifp->if_dunit) & lacp_tx_test) == 0) + if (((1 << lp->lp_ifp->if_dunit) & lp->lp_lsc->lsc_debug.lsc_tx_test) == 0) { error = lacp_xmit_lacpdu(lp); - else + } else { LACP_TPRINTF((lp, "Dropping TX PDU\n")); + } if (error == 0) { lp->lp_flags &= ~LACP_PORT_NTT; diff --git a/sys/net/ieee8023ad_lacp.h b/sys/net/ieee8023ad_lacp.h index 9cebc5910298..ca5f76eaaba9 100644 --- a/sys/net/ieee8023ad_lacp.h +++ b/sys/net/ieee8023ad_lacp.h @@ -245,6 +245,11 @@ struct lacp_softc { struct lacp_portmap lsc_pmap[2]; volatile u_int lsc_activemap; u_int32_t lsc_hashkey; + struct { + u_int32_t lsc_rx_test; + u_int32_t lsc_tx_test; + } lsc_debug; + u_int32_t lsc_strict_mode; }; #define LACP_TYPE_ACTORINFO 1 diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index b33696fe6027..572ee06d3660 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -382,6 +382,12 @@ SYSCTL_INT(_net_link_bridge, OID_AUTO, inherit_mac, CTLFLAG_RW, &bridge_inherit_mac, 0, "Inherit MAC address from the first bridge member"); +static VNET_DEFINE(int, allow_llz_overlap) = 0; +#define V_allow_llz_overlap VNET(allow_llz_overlap) +SYSCTL_VNET_INT(_net_link_bridge, OID_AUTO, allow_llz_overlap, CTLFLAG_RW, + &VNET_NAME(allow_llz_overlap), 0, "Allow overlap of link-local scope " + "zones of a bridge interface and the member interfaces"); + struct bridge_control { int (*bc_func)(struct bridge_softc *, void *); int bc_argsize; @@ -1064,7 +1070,8 @@ bridge_ioctl_add(struct bridge_softc *sc, void *arg) */ /* Check if the parent interface has a link-local scope addr. */ - if (in6ifa_llaonifp(sc->sc_ifp) != NULL) { + if (V_allow_llz_overlap == 0 && + in6ifa_llaonifp(sc->sc_ifp) != NULL) { /* * If any, remove all inet6 addresses from the member * interfaces. @@ -1093,32 +1100,6 @@ bridge_ioctl_add(struct bridge_softc *sc, void *arg) "IPv6 address scope violation.\n", ifs->if_xname); } - } else { - struct in6_ifaddr *ia6_m, *ia6_s; - /* - * If not, check whether one of the existing member - * interfaces have inet6 address. If any, remove - * inet6 addresses on the interface to be added. - */ - ia6_m = NULL; - BRIDGE_XLOCK(sc); - LIST_FOREACH(bif, &sc->sc_iflist, bif_next) { - ia6_m = in6ifa_llaonifp(bif->bif_ifp); - if (ia6_m != NULL) - break; - } - BRIDGE_XDROP(sc); - ia6_s = in6ifa_llaonifp(ifs); - - if (ia6_m != NULL && ia6_s != NULL) { - BRIDGE_UNLOCK(sc); - in6_ifdetach(ifs); - BRIDGE_LOCK(sc); - if_printf(sc->sc_ifp, "IPv6 addresses on %s have " - "been removed before adding it as a member " - "to prevent IPv6 address scope violation.\n", - ifs->if_xname); - } } #endif /* Allow the first Ethernet member to define the MTU */ diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 3fd6c9d116e4..4f9672deb353 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -48,6 +48,7 @@ #include <sys/socket.h> #include <sys/sockio.h> #include <sys/sysctl.h> +#include <sys/uuid.h> #include <net/if.h> #include <net/if_arp.h> @@ -926,6 +927,8 @@ ether_ifattach(struct ifnet *ifp, const u_int8_t *lla) break; if (i != ifp->if_addrlen) if_printf(ifp, "Ethernet address: %6D\n", lla, ":"); + + uuid_ether_add(LLADDR(sdl)); } /* @@ -934,6 +937,11 @@ ether_ifattach(struct ifnet *ifp, const u_int8_t *lla) void ether_ifdetach(struct ifnet *ifp) { + struct sockaddr_dl *sdl; + + sdl = (struct sockaddr_dl *)(ifp->if_addr->ifa_addr); + uuid_ether_del(LLADDR(sdl)); + if (IFP2AC(ifp)->ac_netgraph != NULL) { KASSERT(ng_ether_detach_p != NULL, ("ng_ether_detach_p is NULL")); diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c index bc2127c6012e..a46e1f386ad4 100644 --- a/sys/net/if_lagg.c +++ b/sys/net/if_lagg.c @@ -291,7 +291,8 @@ lagg_clone_create(struct if_clone *ifc, int unit, caddr_t params) sysctl_ctx_init(&sc->ctx); snprintf(num, sizeof(num), "%u", unit); sc->use_flowid = def_use_flowid; - oid = SYSCTL_ADD_NODE(&sc->ctx, &SYSCTL_NODE_CHILDREN(_net_link, lagg), + sc->sc_oid = oid = SYSCTL_ADD_NODE(&sc->ctx, + &SYSCTL_NODE_CHILDREN(_net_link, lagg), OID_AUTO, num, CTLFLAG_RD, NULL, ""); SYSCTL_ADD_INT(&sc->ctx, SYSCTL_CHILDREN(oid), OID_AUTO, "use_flowid", CTLTYPE_INT|CTLFLAG_RW, &sc->use_flowid, sc->use_flowid, diff --git a/sys/net/if_lagg.h b/sys/net/if_lagg.h index cbec8d632a68..a851f441b330 100644 --- a/sys/net/if_lagg.h +++ b/sys/net/if_lagg.h @@ -228,6 +228,7 @@ struct lagg_softc { eventhandler_tag vlan_detach; struct callout sc_callout; struct sysctl_ctx_list ctx; /* sysctl variables */ + struct sysctl_oid *sc_oid; /* sysctl tree oid */ int use_flowid; /* use M_FLOWID */ }; diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index 928d2abb169d..479977c6c963 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -968,8 +968,8 @@ flush: #ifdef INET6 if (rti_need_deembed) { /* sin6_scope_id is recovered before sending rtm. */ + sin6 = (struct sockaddr_in6 *)&ss; for (i = 0; i < RTAX_MAX; i++) { - sin6 = (struct sockaddr_in6 *)&ss; if (info.rti_info[i] == NULL) continue; if (info.rti_info[i]->sa_family != AF_INET6) diff --git a/sys/net80211/ieee80211.h b/sys/net80211/ieee80211.h index a3da7397825d..0b1f05027393 100644 --- a/sys/net80211/ieee80211.h +++ b/sys/net80211/ieee80211.h @@ -711,6 +711,7 @@ enum { IEEE80211_ELEMID_IBSSDFS = 41, IEEE80211_ELEMID_ERP = 42, IEEE80211_ELEMID_HTCAP = 45, + IEEE80211_ELEMID_QOS = 46, IEEE80211_ELEMID_RSN = 48, IEEE80211_ELEMID_XRATES = 50, IEEE80211_ELEMID_HTINFO = 61, diff --git a/sys/net80211/ieee80211_mesh.c b/sys/net80211/ieee80211_mesh.c index 35b98fab361c..417747b2ff40 100644 --- a/sys/net80211/ieee80211_mesh.c +++ b/sys/net80211/ieee80211_mesh.c @@ -1040,14 +1040,10 @@ mesh_transmit_to_gate(struct ieee80211vap *vap, struct mbuf *m, struct ieee80211_mesh_route *rt_gate) { struct ifnet *ifp = vap->iv_ifp; - struct ieee80211com *ic = vap->iv_ic; struct ieee80211_node *ni; - struct ether_header *eh; - int error; - IEEE80211_TX_UNLOCK_ASSERT(ic); + IEEE80211_TX_UNLOCK_ASSERT(vap->iv_ic); - eh = mtod(m, struct ether_header *); ni = ieee80211_mesh_find_txnode(vap, rt_gate->rt_dest); if (ni == NULL) { ifp->if_oerrors++; @@ -1055,106 +1051,13 @@ mesh_transmit_to_gate(struct ieee80211vap *vap, struct mbuf *m, return; } - if ((ni->ni_flags & IEEE80211_NODE_PWR_MGT) && - (m->m_flags & M_PWR_SAV) == 0) { - /* - * Station in power save mode; pass the frame - * to the 802.11 layer and continue. We'll get - * the frame back when the time is right. - * XXX lose WDS vap linkage? - */ - (void) ieee80211_pwrsave(ni, m); - ieee80211_free_node(ni); - return; - } - - /* calculate priority so drivers can find the tx queue */ - if (ieee80211_classify(ni, m)) { - IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_OUTPUT, - eh->ether_dhost, NULL, - "%s", "classification failure"); - vap->iv_stats.is_tx_classify++; - ifp->if_oerrors++; - m_freem(m); - ieee80211_free_node(ni); - return; - } /* - * Stash the node pointer. Note that we do this after - * any call to ieee80211_dwds_mcast because that code - * uses any existing value for rcvif to identify the - * interface it (might have been) received on. + * Send through the VAP packet transmit path. + * This consumes the node ref grabbed above and + * the mbuf, regardless of whether there's a problem + * or not. */ - m->m_pkthdr.rcvif = (void *)ni; - - BPF_MTAP(ifp, m); /* 802.3 tx */ - - /* - * Check if A-MPDU tx aggregation is setup or if we - * should try to enable it. The sta must be associated - * with HT and A-MPDU enabled for use. When the policy - * routine decides we should enable A-MPDU we issue an - * ADDBA request and wait for a reply. The frame being - * encapsulated will go out w/o using A-MPDU, or possibly - * it might be collected by the driver and held/retransmit. - * The default ic_ampdu_enable routine handles staggering - * ADDBA requests in case the receiver NAK's us or we are - * otherwise unable to establish a BA stream. - */ - if ((ni->ni_flags & IEEE80211_NODE_AMPDU_TX) && - (vap->iv_flags_ht & IEEE80211_FHT_AMPDU_TX) && - (m->m_flags & M_EAPOL) == 0) { - int tid = WME_AC_TO_TID(M_WME_GETAC(m)); - struct ieee80211_tx_ampdu *tap = &ni->ni_tx_ampdu[tid]; - - ieee80211_txampdu_count_packet(tap); - if (IEEE80211_AMPDU_RUNNING(tap)) { - /* - * Operational, mark frame for aggregation. - * - * XXX do tx aggregation here - */ - m->m_flags |= M_AMPDU_MPDU; - } else if (!IEEE80211_AMPDU_REQUESTED(tap) && - ic->ic_ampdu_enable(ni, tap)) { - /* - * Not negotiated yet, request service. - */ - ieee80211_ampdu_request(ni, tap); - /* XXX hold frame for reply? */ - } - } -#ifdef IEEE80211_SUPPORT_SUPERG - else if (IEEE80211_ATH_CAP(vap, ni, IEEE80211_NODE_FF)) { - m = ieee80211_ff_check(ni, m); - if (m == NULL) { - /* NB: any ni ref held on stageq */ - return; - } - } -#endif /* IEEE80211_SUPPORT_SUPERG */ - - IEEE80211_TX_LOCK(ic); - if (__predict_true((vap->iv_caps & IEEE80211_C_8023ENCAP) == 0)) { - /* - * Encapsulate the packet in prep for transmission. - */ - m = ieee80211_encap(vap, ni, m); - if (m == NULL) { - /* NB: stat+msg handled in ieee80211_encap */ - IEEE80211_TX_UNLOCK(ic); - ieee80211_free_node(ni); - return; - } - } - error = ieee80211_parent_transmit(ic, m); - IEEE80211_TX_UNLOCK(ic); - if (error != 0) { - ieee80211_free_node(ni); - } else { - ifp->if_opackets++; - } - ic->ic_lastdata = ticks; + (void) ieee80211_vap_pkt_send_dest(vap, m, ni); } /* diff --git a/sys/net80211/ieee80211_output.c b/sys/net80211/ieee80211_output.c index defebc9d85e4..3be382cf277b 100644 --- a/sys/net80211/ieee80211_output.c +++ b/sys/net80211/ieee80211_output.c @@ -110,6 +110,153 @@ doprint(struct ieee80211vap *vap, int subtype) #endif /* + * Transmit a frame to the given destination on the given VAP. + * + * It's up to the caller to figure out the details of who this + * is going to and resolving the node. + * + * This routine takes care of queuing it for power save, + * A-MPDU state stuff, fast-frames state stuff, encapsulation + * if required, then passing it up to the driver layer. + * + * This routine (for now) consumes the mbuf and frees the node + * reference; it ideally will return a TX status which reflects + * whether the mbuf was consumed or not, so the caller can + * free the mbuf (if appropriate) and the node reference (again, + * if appropriate.) + */ +int +ieee80211_vap_pkt_send_dest(struct ieee80211vap *vap, struct mbuf *m, + struct ieee80211_node *ni) +{ + struct ieee80211com *ic = vap->iv_ic; + struct ifnet *ifp = vap->iv_ifp; + int error; + + if ((ni->ni_flags & IEEE80211_NODE_PWR_MGT) && + (m->m_flags & M_PWR_SAV) == 0) { + /* + * Station in power save mode; pass the frame + * to the 802.11 layer and continue. We'll get + * the frame back when the time is right. + * XXX lose WDS vap linkage? + */ + (void) ieee80211_pwrsave(ni, m); + ieee80211_free_node(ni); + /* XXX better status? */ + return (ENOBUFS); + } + /* calculate priority so drivers can find the tx queue */ + if (ieee80211_classify(ni, m)) { + IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_OUTPUT, + ni->ni_macaddr, NULL, + "%s", "classification failure"); + vap->iv_stats.is_tx_classify++; + ifp->if_oerrors++; + m_freem(m); + ieee80211_free_node(ni); + /* XXX better status? */ + return (ENOBUFS); + } + /* + * Stash the node pointer. Note that we do this after + * any call to ieee80211_dwds_mcast because that code + * uses any existing value for rcvif to identify the + * interface it (might have been) received on. + */ + m->m_pkthdr.rcvif = (void *)ni; + + BPF_MTAP(ifp, m); /* 802.3 tx */ + + + /* + * Check if A-MPDU tx aggregation is setup or if we + * should try to enable it. The sta must be associated + * with HT and A-MPDU enabled for use. When the policy + * routine decides we should enable A-MPDU we issue an + * ADDBA request and wait for a reply. The frame being + * encapsulated will go out w/o using A-MPDU, or possibly + * it might be collected by the driver and held/retransmit. + * The default ic_ampdu_enable routine handles staggering + * ADDBA requests in case the receiver NAK's us or we are + * otherwise unable to establish a BA stream. + */ + if ((ni->ni_flags & IEEE80211_NODE_AMPDU_TX) && + (vap->iv_flags_ht & IEEE80211_FHT_AMPDU_TX) && + (m->m_flags & M_EAPOL) == 0) { + int tid = WME_AC_TO_TID(M_WME_GETAC(m)); + struct ieee80211_tx_ampdu *tap = &ni->ni_tx_ampdu[tid]; + + ieee80211_txampdu_count_packet(tap); + if (IEEE80211_AMPDU_RUNNING(tap)) { + /* + * Operational, mark frame for aggregation. + * + * XXX do tx aggregation here + */ + m->m_flags |= M_AMPDU_MPDU; + } else if (!IEEE80211_AMPDU_REQUESTED(tap) && + ic->ic_ampdu_enable(ni, tap)) { + /* + * Not negotiated yet, request service. + */ + ieee80211_ampdu_request(ni, tap); + /* XXX hold frame for reply? */ + } + } + +#ifdef IEEE80211_SUPPORT_SUPERG + else if (IEEE80211_ATH_CAP(vap, ni, IEEE80211_NODE_FF)) { + m = ieee80211_ff_check(ni, m); + if (m == NULL) { + /* NB: any ni ref held on stageq */ + /* XXX better status? */ + return (ENOBUFS); + } + } +#endif /* IEEE80211_SUPPORT_SUPERG */ + + /* + * Grab the TX lock - serialise the TX process from this + * point (where TX state is being checked/modified) + * through to driver queue. + */ + IEEE80211_TX_LOCK(ic); + + if (__predict_true((vap->iv_caps & IEEE80211_C_8023ENCAP) == 0)) { + /* + * Encapsulate the packet in prep for transmission. + */ + m = ieee80211_encap(vap, ni, m); + if (m == NULL) { + /* NB: stat+msg handled in ieee80211_encap */ + IEEE80211_TX_UNLOCK(ic); + ieee80211_free_node(ni); + /* XXX better status? */ + return (ENOBUFS); + } + } + error = ieee80211_parent_transmit(ic, m); + + /* + * Unlock at this point - no need to hold it across + * ieee80211_free_node() (ie, the comlock) + */ + IEEE80211_TX_UNLOCK(ic); + if (error != 0) { + /* NB: IFQ_HANDOFF reclaims mbuf */ + ieee80211_free_node(ni); + } else { + ifp->if_opackets++; + } + ic->ic_lastdata = ticks; + + return (0); +} + + + +/* * Send the given mbuf through the given vap. * * This consumes the mbuf regardless of whether the transmit @@ -129,7 +276,6 @@ ieee80211_start_pkt(struct ieee80211vap *vap, struct mbuf *m) struct ifnet *ifp = vap->iv_ifp; struct ieee80211_node *ni; struct ether_header *eh; - int error; /* * Cancel any background scan. @@ -236,124 +382,12 @@ ieee80211_start_pkt(struct ieee80211vap *vap, struct mbuf *m) } } #endif - if ((ni->ni_flags & IEEE80211_NODE_PWR_MGT) && - (m->m_flags & M_PWR_SAV) == 0) { - /* - * Station in power save mode; pass the frame - * to the 802.11 layer and continue. We'll get - * the frame back when the time is right. - * XXX lose WDS vap linkage? - */ - (void) ieee80211_pwrsave(ni, m); - ieee80211_free_node(ni); - /* XXX better status? */ - return (ENOBUFS); - } - /* calculate priority so drivers can find the tx queue */ - if (ieee80211_classify(ni, m)) { - IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_OUTPUT, - eh->ether_dhost, NULL, - "%s", "classification failure"); - vap->iv_stats.is_tx_classify++; - ifp->if_oerrors++; - m_freem(m); - ieee80211_free_node(ni); - /* XXX better status? */ - return (ENOBUFS); - } - /* - * Stash the node pointer. Note that we do this after - * any call to ieee80211_dwds_mcast because that code - * uses any existing value for rcvif to identify the - * interface it (might have been) received on. - */ - m->m_pkthdr.rcvif = (void *)ni; - - BPF_MTAP(ifp, m); /* 802.3 tx */ - - - /* - * Check if A-MPDU tx aggregation is setup or if we - * should try to enable it. The sta must be associated - * with HT and A-MPDU enabled for use. When the policy - * routine decides we should enable A-MPDU we issue an - * ADDBA request and wait for a reply. The frame being - * encapsulated will go out w/o using A-MPDU, or possibly - * it might be collected by the driver and held/retransmit. - * The default ic_ampdu_enable routine handles staggering - * ADDBA requests in case the receiver NAK's us or we are - * otherwise unable to establish a BA stream. - */ - if ((ni->ni_flags & IEEE80211_NODE_AMPDU_TX) && - (vap->iv_flags_ht & IEEE80211_FHT_AMPDU_TX) && - (m->m_flags & M_EAPOL) == 0) { - int tid = WME_AC_TO_TID(M_WME_GETAC(m)); - struct ieee80211_tx_ampdu *tap = &ni->ni_tx_ampdu[tid]; - - ieee80211_txampdu_count_packet(tap); - if (IEEE80211_AMPDU_RUNNING(tap)) { - /* - * Operational, mark frame for aggregation. - * - * XXX do tx aggregation here - */ - m->m_flags |= M_AMPDU_MPDU; - } else if (!IEEE80211_AMPDU_REQUESTED(tap) && - ic->ic_ampdu_enable(ni, tap)) { - /* - * Not negotiated yet, request service. - */ - ieee80211_ampdu_request(ni, tap); - /* XXX hold frame for reply? */ - } - } - -#ifdef IEEE80211_SUPPORT_SUPERG - else if (IEEE80211_ATH_CAP(vap, ni, IEEE80211_NODE_FF)) { - m = ieee80211_ff_check(ni, m); - if (m == NULL) { - /* NB: any ni ref held on stageq */ - /* XXX better status? */ - return (ENOBUFS); - } - } -#endif /* IEEE80211_SUPPORT_SUPERG */ - - /* - * Grab the TX lock - serialise the TX process from this - * point (where TX state is being checked/modified) - * through to driver queue. - */ - IEEE80211_TX_LOCK(ic); - - if (__predict_true((vap->iv_caps & IEEE80211_C_8023ENCAP) == 0)) { - /* - * Encapsulate the packet in prep for transmission. - */ - m = ieee80211_encap(vap, ni, m); - if (m == NULL) { - /* NB: stat+msg handled in ieee80211_encap */ - IEEE80211_TX_UNLOCK(ic); - ieee80211_free_node(ni); - /* XXX better status? */ - return (ENOBUFS); - } - } - error = ieee80211_parent_transmit(ic, m); /* - * Unlock at this point - no need to hold it across - * ieee80211_free_node() (ie, the comlock) + * We've resolved the sender, so attempt to transmit it. */ - IEEE80211_TX_UNLOCK(ic); - if (error != 0) { - /* NB: IFQ_HANDOFF reclaims mbuf */ - ieee80211_free_node(ni); - } else { - ifp->if_opackets++; - } - ic->ic_lastdata = ticks; - + if (ieee80211_vap_pkt_send_dest(vap, m, ni) != 0) + return (ENOBUFS); return (0); #undef IS_DWDS } @@ -1883,6 +1917,40 @@ ieee80211_add_countryie(uint8_t *frm, struct ieee80211com *ic) return add_appie(frm, ic->ic_countryie); } +uint8_t * +ieee80211_add_wpa(uint8_t *frm, const struct ieee80211vap *vap) +{ + if (vap->iv_flags & IEEE80211_F_WPA1 && vap->iv_wpa_ie != NULL) + return (add_ie(frm, vap->iv_wpa_ie)); + else { + /* XXX else complain? */ + return (frm); + } +} + +uint8_t * +ieee80211_add_rsn(uint8_t *frm, const struct ieee80211vap *vap) +{ + if (vap->iv_flags & IEEE80211_F_WPA2 && vap->iv_rsn_ie != NULL) + return (add_ie(frm, vap->iv_rsn_ie)); + else { + /* XXX else complain? */ + return (frm); + } +} + +uint8_t * +ieee80211_add_qos(uint8_t *frm, const struct ieee80211_node *ni) +{ + if (ni->ni_flags & IEEE80211_NODE_QOS) { + *frm++ = IEEE80211_ELEMID_QOS; + *frm++ = 1; + *frm++ = 0; + } + + return (frm); +} + /* * Send a probe request frame with the specified ssid * and any optional information element data. @@ -1951,17 +2019,9 @@ ieee80211_send_probereq(struct ieee80211_node *ni, frm = ieee80211_add_ssid(frm, ssid, ssidlen); rs = ieee80211_get_suprates(ic, ic->ic_curchan); frm = ieee80211_add_rates(frm, rs); - if (vap->iv_flags & IEEE80211_F_WPA2) { - if (vap->iv_rsn_ie != NULL) - frm = add_ie(frm, vap->iv_rsn_ie); - /* XXX else complain? */ - } + frm = ieee80211_add_rsn(frm, vap); frm = ieee80211_add_xrates(frm, rs); - if (vap->iv_flags & IEEE80211_F_WPA1) { - if (vap->iv_wpa_ie != NULL) - frm = add_ie(frm, vap->iv_wpa_ie); - /* XXX else complain? */ - } + frm = ieee80211_add_wpa(frm, vap); if (vap->iv_appie_probereq != NULL) frm = add_appie(frm, vap->iv_appie_probereq); m->m_pkthdr.len = m->m_len = frm - mtod(m, uint8_t *); @@ -2227,11 +2287,7 @@ ieee80211_send_mgmt(struct ieee80211_node *ni, int type, int arg) frm = ieee80211_add_ssid(frm, ni->ni_essid, ni->ni_esslen); frm = ieee80211_add_rates(frm, &ni->ni_rates); - if (vap->iv_flags & IEEE80211_F_WPA2) { - if (vap->iv_rsn_ie != NULL) - frm = add_ie(frm, vap->iv_rsn_ie); - /* XXX else complain? */ - } + frm = ieee80211_add_rsn(frm, vap); frm = ieee80211_add_xrates(frm, &ni->ni_rates); if (capinfo & IEEE80211_CAPINFO_SPECTRUM_MGMT) { frm = ieee80211_add_powercapability(frm, @@ -2242,11 +2298,7 @@ ieee80211_send_mgmt(struct ieee80211_node *ni, int type, int arg) ni->ni_ies.htcap_ie != NULL && ni->ni_ies.htcap_ie[0] == IEEE80211_ELEMID_HTCAP) frm = ieee80211_add_htcap(frm, ni); - if (vap->iv_flags & IEEE80211_F_WPA1) { - if (vap->iv_wpa_ie != NULL) - frm = add_ie(frm, vap->iv_wpa_ie); - /* XXX else complain */ - } + frm = ieee80211_add_wpa(frm, vap); if ((ic->ic_flags & IEEE80211_F_WME) && ni->ni_ies.wme_ie != NULL) frm = ieee80211_add_wme_info(frm, &ic->ic_wme); @@ -2513,11 +2565,7 @@ ieee80211_alloc_proberesp(struct ieee80211_node *bss, int legacy) if (IEEE80211_IS_CHAN_ANYG(bss->ni_chan)) frm = ieee80211_add_erp(frm, ic); frm = ieee80211_add_xrates(frm, rs); - if (vap->iv_flags & IEEE80211_F_WPA2) { - if (vap->iv_rsn_ie != NULL) - frm = add_ie(frm, vap->iv_rsn_ie); - /* XXX else complain? */ - } + frm = ieee80211_add_rsn(frm, vap); /* * NB: legacy 11b clients do not get certain ie's. * The caller identifies such clients by passing @@ -2529,11 +2577,7 @@ ieee80211_alloc_proberesp(struct ieee80211_node *bss, int legacy) frm = ieee80211_add_htcap(frm, bss); frm = ieee80211_add_htinfo(frm, bss); } - if (vap->iv_flags & IEEE80211_F_WPA1) { - if (vap->iv_wpa_ie != NULL) - frm = add_ie(frm, vap->iv_wpa_ie); - /* XXX else complain? */ - } + frm = ieee80211_add_wpa(frm, vap); if (vap->iv_flags & IEEE80211_F_WME) frm = ieee80211_add_wme_param(frm, &ic->ic_wme); if (IEEE80211_IS_CHAN_HT(bss->ni_chan) && @@ -2831,21 +2875,13 @@ ieee80211_beacon_construct(struct mbuf *m, uint8_t *frm, frm = ieee80211_add_erp(frm, ic); } frm = ieee80211_add_xrates(frm, rs); - if (vap->iv_flags & IEEE80211_F_WPA2) { - if (vap->iv_rsn_ie != NULL) - frm = add_ie(frm, vap->iv_rsn_ie); - /* XXX else complain */ - } + frm = ieee80211_add_rsn(frm, vap); if (IEEE80211_IS_CHAN_HT(ni->ni_chan)) { frm = ieee80211_add_htcap(frm, ni); bo->bo_htinfo = frm; frm = ieee80211_add_htinfo(frm, ni); } - if (vap->iv_flags & IEEE80211_F_WPA1) { - if (vap->iv_wpa_ie != NULL) - frm = add_ie(frm, vap->iv_wpa_ie); - /* XXX else complain */ - } + frm = ieee80211_add_wpa(frm, vap); if (vap->iv_flags & IEEE80211_F_WME) { bo->bo_wme = frm; frm = ieee80211_add_wme_param(frm, &ic->ic_wme); diff --git a/sys/net80211/ieee80211_proto.h b/sys/net80211/ieee80211_proto.h index e4bca5b51603..94dd097649e4 100644 --- a/sys/net80211/ieee80211_proto.h +++ b/sys/net80211/ieee80211_proto.h @@ -98,6 +98,8 @@ int ieee80211_raw_xmit(struct ieee80211_node *, struct mbuf *, const struct ieee80211_bpf_params *); int ieee80211_output(struct ifnet *, struct mbuf *, const struct sockaddr *, struct route *ro); +int ieee80211_vap_pkt_send_dest(struct ieee80211vap *, struct mbuf *, + struct ieee80211_node *); int ieee80211_raw_output(struct ieee80211vap *, struct ieee80211_node *, struct mbuf *, const struct ieee80211_bpf_params *); void ieee80211_send_setup(struct ieee80211_node *, struct mbuf *, int, int, @@ -136,6 +138,9 @@ struct mbuf *ieee80211_alloc_cts(struct ieee80211com *, uint8_t *ieee80211_add_rates(uint8_t *, const struct ieee80211_rateset *); uint8_t *ieee80211_add_xrates(uint8_t *, const struct ieee80211_rateset *); +uint8_t *ieee80211_add_wpa(uint8_t *, const struct ieee80211vap *); +uint8_t *ieee80211_add_rsn(uint8_t *, const struct ieee80211vap *); +uint8_t *ieee80211_add_qos(uint8_t *, const struct ieee80211_node *); uint16_t ieee80211_getcapinfo(struct ieee80211vap *, struct ieee80211_channel *); diff --git a/sys/netgraph/ng_pppoe.c b/sys/netgraph/ng_pppoe.c index 818bd7ac7f27..6c2ed678d39d 100644 --- a/sys/netgraph/ng_pppoe.c +++ b/sys/netgraph/ng_pppoe.c @@ -1887,6 +1887,7 @@ scan_tags(sessp sp, const struct pppoe_hdr* ph) case PTT_SRV_ERR: case PTT_SYS_ERR: case PTT_GEN_ERR: + case PTT_MAX_PAYL: break; } pt = (const struct pppoe_tag*)ptn; diff --git a/sys/netgraph/ng_pppoe.h b/sys/netgraph/ng_pppoe.h index d5126cf74cd8..6ef81b791ec7 100644 --- a/sys/netgraph/ng_pppoe.h +++ b/sys/netgraph/ng_pppoe.h @@ -172,6 +172,7 @@ struct ngpppoe_sts { #define PTT_AC_COOKIE (0x0104) #define PTT_VENDOR (0x0105) #define PTT_RELAY_SID (0x0110) +#define PTT_MAX_PAYL (0x0120) /* PPP-Max-Payload (RFC4638) */ #define PTT_SRV_ERR (0x0201) #define PTT_SYS_ERR (0x0202) #define PTT_GEN_ERR (0x0203) @@ -188,6 +189,7 @@ struct ngpppoe_sts { #define PTT_AC_COOKIE (0x0401) #define PTT_VENDOR (0x0501) #define PTT_RELAY_SID (0x1001) +#define PTT_MAX_PAYL (0x2001) /* PPP-Max-Payload (RFC4638) */ #define PTT_SRV_ERR (0x0102) #define PTT_SYS_ERR (0x0202) #define PTT_GEN_ERR (0x0302) diff --git a/sys/netinet/sctp_asconf.c b/sys/netinet/sctp_asconf.c index 32226d53a72c..a20f966446c7 100644 --- a/sys/netinet/sctp_asconf.c +++ b/sys/netinet/sctp_asconf.c @@ -1191,7 +1191,6 @@ sctp_asconf_queue_mgmt(struct sctp_tcb *stcb, struct sctp_ifa *ifa, uint16_t type) { struct sctp_asconf_addr *aa, *aa_next; - struct sockaddr *sa; /* make sure the request isn't already in the queue */ TAILQ_FOREACH_SAFE(aa, &stcb->asoc.asconf_queue, next, aa_next) { @@ -1255,7 +1254,6 @@ sctp_asconf_queue_mgmt(struct sctp_tcb *stcb, struct sctp_ifa *ifa, struct sockaddr_in6 *sin6; sin6 = (struct sockaddr_in6 *)&ifa->address.sa; - sa = (struct sockaddr *)sin6; aa->ap.addrp.ph.param_type = SCTP_IPV6_ADDRESS; aa->ap.addrp.ph.param_length = (sizeof(struct sctp_ipv6addr_param)); aa->ap.aph.ph.param_length = sizeof(struct sctp_asconf_paramhdr) + @@ -1271,7 +1269,6 @@ sctp_asconf_queue_mgmt(struct sctp_tcb *stcb, struct sctp_ifa *ifa, struct sockaddr_in *sin; sin = (struct sockaddr_in *)&ifa->address.sa; - sa = (struct sockaddr *)sin; aa->ap.addrp.ph.param_type = SCTP_IPV4_ADDRESS; aa->ap.addrp.ph.param_length = (sizeof(struct sctp_ipv4addr_param)); aa->ap.aph.ph.param_length = sizeof(struct sctp_asconf_paramhdr) + @@ -1294,13 +1291,13 @@ sctp_asconf_queue_mgmt(struct sctp_tcb *stcb, struct sctp_ifa *ifa, if (SCTP_BASE_SYSCTL(sctp_debug_on) & SCTP_DEBUG_ASCONF2) { if (type == SCTP_ADD_IP_ADDRESS) { SCTP_PRINTF("asconf_queue_mgmt: inserted asconf ADD_IP_ADDRESS: "); - SCTPDBG_ADDR(SCTP_DEBUG_ASCONF2, sa); + SCTPDBG_ADDR(SCTP_DEBUG_ASCONF2, &ifa->address.sa); } else if (type == SCTP_DEL_IP_ADDRESS) { SCTP_PRINTF("asconf_queue_mgmt: appended asconf DEL_IP_ADDRESS: "); - SCTPDBG_ADDR(SCTP_DEBUG_ASCONF2, sa); + SCTPDBG_ADDR(SCTP_DEBUG_ASCONF2, &ifa->address.sa); } else { SCTP_PRINTF("asconf_queue_mgmt: appended asconf SET_PRIM_ADDR: "); - SCTPDBG_ADDR(SCTP_DEBUG_ASCONF2, sa); + SCTPDBG_ADDR(SCTP_DEBUG_ASCONF2, &ifa->address.sa); } } #endif diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index f65c262971bf..6ee71260265e 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -5705,7 +5705,7 @@ sctp_common_input_processing(struct mbuf **mm, int iphlen, int offset, int lengt #ifdef INET case AF_INET: if (ipsec4_in_reject(m, &inp->ip_inp.inp)) { - IPSECSTAT_INC(in_polvio); + IPSECSTAT_INC(ips_in_polvio); SCTP_STAT_INCR(sctps_hdrops); goto out; } @@ -5714,7 +5714,7 @@ sctp_common_input_processing(struct mbuf **mm, int iphlen, int offset, int lengt #ifdef INET6 case AF_INET6: if (ipsec6_in_reject(m, &inp->ip_inp.inp)) { - IPSEC6STAT_INC(in_polvio); + IPSEC6STAT_INC(ips_in_polvio); SCTP_STAT_INCR(sctps_hdrops); goto out; } diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index 59c22c7e7783..e07bb05a5af2 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -4543,11 +4543,7 @@ sctp_send_initiate(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int so_locked struct mbuf *m; struct sctp_nets *net; struct sctp_init_chunk *init; - -#if defined(INET) || defined(INET6) struct sctp_supported_addr_param *sup_addr; - -#endif struct sctp_adaptation_layer_indication *ali; struct sctp_supported_chunk_types_param *pr_supported; struct sctp_paramhdr *ph; diff --git a/sys/netinet/sctp_usrreq.c b/sys/netinet/sctp_usrreq.c index 972ea23d1b71..d36698546d35 100644 --- a/sys/netinet/sctp_usrreq.c +++ b/sys/netinet/sctp_usrreq.c @@ -3942,7 +3942,6 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize, sctp_hmaclist_t *hmaclist; uint16_t hmacid; uint32_t i; - size_t found; SCTP_CHECK_AND_CAST(shmac, optval, struct sctp_hmacalgo, optsize); if (optsize < sizeof(struct sctp_hmacalgo) + shmac->shmac_number_of_idents * sizeof(uint16_t)) { @@ -3966,14 +3965,14 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize, goto sctp_set_hmac_done; } } - found = 0; for (i = 0; i < hmaclist->num_algo; i++) { if (hmaclist->hmac[i] == SCTP_AUTH_HMAC_ID_SHA1) { /* already in list */ - found = 1; + break; } } - if (!found) { + if (i == hmaclist->num_algo) { + /* not found in list */ sctp_free_hmaclist(hmaclist); SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 7999263b4399..99bbbd3c41b6 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -899,12 +899,12 @@ findpcb: #ifdef IPSEC #ifdef INET6 if (isipv6 && ipsec6_in_reject(m, inp)) { - IPSEC6STAT_INC(in_polvio); + IPSEC6STAT_INC(ips_in_polvio); goto dropunlock; } else #endif /* INET6 */ if (ipsec4_in_reject(m, inp) != 0) { - IPSECSTAT_INC(in_polvio); + IPSECSTAT_INC(ips_in_polvio); goto dropunlock; } #endif /* IPSEC */ diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 982a2db305fd..afd11e68c019 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -282,7 +282,7 @@ udp_append(struct inpcb *inp, struct ip *ip, struct mbuf *n, int off, /* Check AH/ESP integrity. */ if (ipsec4_in_reject(n, inp)) { m_freem(n); - IPSECSTAT_INC(in_polvio); + IPSECSTAT_INC(ips_in_polvio); return; } #ifdef IPSEC_NAT_T @@ -1294,7 +1294,7 @@ udp4_espdecap(struct inpcb *inp, struct mbuf *m, int off) if (minlen > m->m_pkthdr.len) minlen = m->m_pkthdr.len; if ((m = m_pullup(m, minlen)) == NULL) { - IPSECSTAT_INC(in_inval); + IPSECSTAT_INC(ips_in_inval); return (NULL); /* Bypass caller processing. */ } data = mtod(m, caddr_t); /* Points to ip header. */ @@ -1334,7 +1334,7 @@ udp4_espdecap(struct inpcb *inp, struct mbuf *m, int off) uint32_t spi; if (payload <= sizeof(struct esp)) { - IPSECSTAT_INC(in_inval); + IPSECSTAT_INC(ips_in_inval); m_freem(m); return (NULL); /* Discard. */ } @@ -1355,7 +1355,7 @@ udp4_espdecap(struct inpcb *inp, struct mbuf *m, int off) tag = m_tag_get(PACKET_TAG_IPSEC_NAT_T_PORTS, 2 * sizeof(uint16_t), M_NOWAIT); if (tag == NULL) { - IPSECSTAT_INC(in_nomem); + IPSECSTAT_INC(ips_in_nomem); m_freem(m); return (NULL); /* Discard. */ } diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index f8c2b7e4de86..a8930d79d7fe 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -2746,6 +2746,13 @@ in6_domifattach(struct ifnet *ifp) { struct in6_ifextra *ext; + /* There are not IPv6-capable interfaces. */ + switch (ifp->if_type) { + case IFT_PFLOG: + case IFT_PFSYNC: + case IFT_USB: + return (NULL); + } ext = (struct in6_ifextra *)malloc(sizeof(*ext), M_IFADDR, M_WAITOK); bzero(ext, sizeof(*ext)); diff --git a/sys/netinet6/in6_ifattach.c b/sys/netinet6/in6_ifattach.c index 674356a91b4b..9e089d9e2223 100644 --- a/sys/netinet6/in6_ifattach.c +++ b/sys/netinet6/in6_ifattach.c @@ -724,15 +724,8 @@ in6_ifattach(struct ifnet *ifp, struct ifnet *altifp) struct in6_ifaddr *ia; struct in6_addr in6; - /* some of the interfaces are inherently not IPv6 capable */ - switch (ifp->if_type) { - case IFT_PFLOG: - case IFT_PFSYNC: - ND_IFINFO(ifp)->flags &= ~ND6_IFF_AUTO_LINKLOCAL; - ND_IFINFO(ifp)->flags |= ND6_IFF_IFDISABLED; + if (ifp->if_afdata[AF_INET6] == NULL) return; - } - /* * quirks based on interface type */ diff --git a/sys/netinet6/ip6_forward.c b/sys/netinet6/ip6_forward.c index ed62a23a5e33..fa54fe43fc09 100644 --- a/sys/netinet6/ip6_forward.c +++ b/sys/netinet6/ip6_forward.c @@ -120,7 +120,7 @@ ip6_forward(struct mbuf *m, int srcrt) * before forwarding packet actually. */ if (ipsec6_in_reject(m, NULL)) { - IPSEC6STAT_INC(in_polvio); + IPSEC6STAT_INC(ips_in_polvio); m_freem(m); return; } @@ -182,7 +182,7 @@ ip6_forward(struct mbuf *m, int srcrt) sp = ipsec_getpolicybyaddr(m, IPSEC_DIR_OUTBOUND, IP_FORWARDING, &error); if (sp == NULL) { - IPSEC6STAT_INC(out_inval); + IPSEC6STAT_INC(ips_out_inval); IP6STAT_INC(ip6s_cantforward); if (mcopy) { #if 0 @@ -203,7 +203,7 @@ ip6_forward(struct mbuf *m, int srcrt) /* * This packet is just discarded. */ - IPSEC6STAT_INC(out_polvio); + IPSEC6STAT_INC(ips_out_polvio); IP6STAT_INC(ip6s_cantforward); KEY_FREESP(&sp); if (mcopy) { diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index 0a67a8a91bb6..2c27c714cec6 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -1227,6 +1227,8 @@ nd6_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp) struct nd_prefix *pr; int i = 0, error = 0; + if (ifp->if_afdata[AF_INET6] == NULL) + return (EPFNOSUPPORT); switch (cmd) { case SIOCGDRLST_IN6: /* @@ -1801,6 +1803,8 @@ nd6_slowtimo(void *arg) nd6_slowtimo, curvnet); IFNET_RLOCK_NOSLEEP(); TAILQ_FOREACH(ifp, &V_ifnet, if_list) { + if (ifp->if_afdata[AF_INET6] == NULL) + continue; nd6if = ND_IFINFO(ifp); if (nd6if->basereachable && /* already initialized */ (nd6if->recalctm -= ND6_SLOWTIMER_INTERVAL) <= 0) { diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c index 2eb865a61d4a..a37dfc5900d0 100644 --- a/sys/netinet6/raw_ip6.c +++ b/sys/netinet6/raw_ip6.c @@ -269,7 +269,7 @@ rip6_input(struct mbuf **mp, int *offp, int proto) */ if (n && ipsec6_in_reject(n, last)) { m_freem(n); - IPSEC6STAT_INC(in_polvio); + IPSEC6STAT_INC(ips_in_polvio); /* Do not inject data into pcb. */ } else #endif /* IPSEC */ @@ -301,7 +301,7 @@ rip6_input(struct mbuf **mp, int *offp, int proto) */ if ((last != NULL) && ipsec6_in_reject(m, last)) { m_freem(m); - IPSEC6STAT_INC(in_polvio); + IPSEC6STAT_INC(ips_in_polvio); IP6STAT_DEC(ip6s_delivered); /* Do not inject data into pcb. */ INP_RUNLOCK(last); diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c index 1f0d52cbb9f2..6aadae10d47d 100644 --- a/sys/netinet6/udp6_usrreq.c +++ b/sys/netinet6/udp6_usrreq.c @@ -141,7 +141,7 @@ udp6_append(struct inpcb *inp, struct mbuf *n, int off, /* Check AH/ESP integrity. */ if (ipsec6_in_reject(n, inp)) { m_freem(n); - IPSEC6STAT_INC(in_polvio); + IPSEC6STAT_INC(ips_in_polvio); return; } #endif /* IPSEC */ diff --git a/sys/netipsec/ipsec.h b/sys/netipsec/ipsec.h index d5bd4cd554bc..0b928761bda7 100644 --- a/sys/netipsec/ipsec.h +++ b/sys/netipsec/ipsec.h @@ -217,43 +217,17 @@ struct secspacq { /* statistics for ipsec processing */ struct ipsecstat { - uint64_t in_success; /* succeeded inbound process */ - uint64_t in_polvio; - /* security policy violation for inbound process */ - uint64_t in_nosa; /* inbound SA is unavailable */ - uint64_t in_inval; /* inbound processing failed due to EINVAL */ - uint64_t in_nomem; /* inbound processing failed due to ENOBUFS */ - uint64_t in_badspi; /* failed getting a SPI */ - uint64_t in_ahreplay; /* AH replay check failed */ - uint64_t in_espreplay; /* ESP replay check failed */ - uint64_t in_ahauthsucc; /* AH authentication success */ - uint64_t in_ahauthfail; /* AH authentication failure */ - uint64_t in_espauthsucc; /* ESP authentication success */ - uint64_t in_espauthfail; /* ESP authentication failure */ - uint64_t in_esphist[256]; - uint64_t in_ahhist[256]; - uint64_t in_comphist[256]; - uint64_t out_success; /* succeeded outbound process */ - uint64_t out_polvio; - /* security policy violation for outbound process */ - uint64_t out_nosa; /* outbound SA is unavailable */ - uint64_t out_inval; /* outbound process failed due to EINVAL */ - uint64_t out_nomem; /* inbound processing failed due to ENOBUFS */ - uint64_t out_noroute; /* there is no route */ - uint64_t out_esphist[256]; - uint64_t out_ahhist[256]; - uint64_t out_comphist[256]; - - uint64_t spdcachelookup; - uint64_t spdcachemiss; - uint64_t ips_in_polvio; /* input: sec policy violation */ + uint64_t ips_in_nomem; /* input: no memory available */ + uint64_t ips_in_inval; /* input: generic error */ + uint64_t ips_out_polvio; /* output: sec policy violation */ uint64_t ips_out_nosa; /* output: SA unavailable */ uint64_t ips_out_nomem; /* output: no memory available */ uint64_t ips_out_noroute; /* output: no route available */ uint64_t ips_out_inval; /* output: generic error */ uint64_t ips_out_bundlesa; /* output: bundled SA processed */ + uint64_t ips_mbcoalesced; /* mbufs coalesced during clone */ uint64_t ips_clcoalesced; /* clusters coalesced during clone */ uint64_t ips_clcopied; /* clusters copied during clone */ diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c index 5c4475736c23..982f85635741 100644 --- a/sys/netpfil/pf/if_pfsync.c +++ b/sys/netpfil/pf/if_pfsync.c @@ -1324,7 +1324,10 @@ pfsyncioctl(struct ifnet *ifp, u_long cmd, caddr_t data) else if ((sifp = ifunit_ref(pfsyncr.pfsyncr_syncdev)) == NULL) return (EINVAL); - if (pfsyncr.pfsyncr_syncpeer.s_addr == 0 && sifp != NULL) + if (sifp != NULL && ( + pfsyncr.pfsyncr_syncpeer.s_addr == 0 || + pfsyncr.pfsyncr_syncpeer.s_addr == + htonl(INADDR_PFSYNC_GROUP))) mship = malloc((sizeof(struct in_multi *) * IP_MIN_MEMBERSHIPS), M_PFSYNC, M_WAITOK | M_ZERO); diff --git a/sys/nfs/bootp_subr.c b/sys/nfs/bootp_subr.c index 2c57a91d629e..7b84f94cd0f8 100644 --- a/sys/nfs/bootp_subr.c +++ b/sys/nfs/bootp_subr.c @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include "opt_bootp.h" #include "opt_nfs.h" +#include "opt_rootdevname.h" #include <sys/param.h> #include <sys/systm.h> @@ -55,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include <sys/mount.h> #include <sys/mbuf.h> #include <sys/proc.h> +#include <sys/reboot.h> #include <sys/socket.h> #include <sys/socketvar.h> #include <sys/sysctl.h> @@ -167,6 +169,7 @@ struct bootpc_tagcontext { struct bootpc_globalcontext { STAILQ_HEAD(, bootpc_ifcontext) interfaces; u_int32_t xid; + int any_root_overrides; int gotrootpath; int gotgw; int ifnum; @@ -865,13 +868,14 @@ bootpc_call(struct bootpc_globalcontext *gctx, struct thread *td) BOOTP_SETTLE_DELAY; } else printf(" (ignored)"); - if (ifctx->gotrootpath) { + if (ifctx->gotrootpath || + gctx->any_root_overrides) { gotrootpath = 1; rtimo = time_second + BOOTP_SETTLE_DELAY; - printf(" (got root path)"); - } else - printf(" (no root path)"); + if (ifctx->gotrootpath) + printf(" (got root path)"); + } printf("\n"); } } /* while secs */ @@ -1371,7 +1375,7 @@ static void bootpc_decode_reply(struct nfsv3_diskless *nd, struct bootpc_ifcontext *ifctx, struct bootpc_globalcontext *gctx) { - char *p; + char *p, *s; unsigned int ip; ifctx->gotgw = 0; @@ -1438,8 +1442,30 @@ bootpc_decode_reply(struct nfsv3_diskless *nd, struct bootpc_ifcontext *ifctx, } } - p = bootpc_tag(&gctx->tag, &ifctx->reply, ifctx->replylen, + /* + * Choose a root filesystem. If a value is forced in the environment + * and it contains "nfs:", use it unconditionally. Otherwise, if the + * kernel is compiled with the ROOTDEVNAME option, then use it if: + * - The server doesn't provide a pathname. + * - The boothowto flags include RB_DFLTROOT (user said to override + * the server value). + */ + p = NULL; + if ((s = getenv("vfs.root.mountfrom")) != NULL) { + if ((p = strstr(s, "nfs:")) != NULL) + p = strdup(p + 4, M_TEMP); + freeenv(s); + } + if (p == NULL) { + p = bootpc_tag(&gctx->tag, &ifctx->reply, ifctx->replylen, TAG_ROOT); + } +#ifdef ROOTDEVNAME + if ((p == NULL || (boothowto & RB_DFLTROOT) != 0) && + (p = strstr(ROOTDEVNAME, "nfs:")) != NULL) { + p += 4; + } +#endif if (p != NULL) { if (gctx->setrootfs != NULL) { printf("rootfs %s (ignored) ", p); @@ -1544,6 +1570,17 @@ bootpc_init(void) gctx->starttime = time_second; /* + * If ROOTDEVNAME is defined or vfs.root.mountfrom is set then we have + * root-path overrides that can potentially let us boot even if we don't + * get a root path from the server, so we can treat that as a non-error. + */ +#ifdef ROOTDEVNAME + gctx->any_root_overrides = 1; +#else + gctx->any_root_overrides = testenv("vfs.root.mountfrom"); +#endif + + /* * Find a network interface. */ CURVNET_SET(TD_TO_VNET(td)); @@ -1652,19 +1689,10 @@ retry: bootpc_compose_query(ifctx, td); error = bootpc_call(gctx, td); - if (error != 0) { -#ifdef BOOTP_NFSROOT - panic("BOOTP call failed"); -#else printf("BOOTP call failed\n"); -#endif } - rootdevnames[0] = "nfs:"; -#ifdef NFSCLIENT - rootdevnames[1] = "oldnfs:"; -#endif mountopts(&nd->root_args, NULL); STAILQ_FOREACH(ifctx, &gctx->interfaces, next) @@ -1672,7 +1700,7 @@ retry: bootpc_decode_reply(nd, ifctx, gctx); #ifdef BOOTP_NFSROOT - if (gctx->gotrootpath == 0) + if (gctx->gotrootpath == 0 && gctx->any_root_overrides == 0) panic("bootpc: No root path offered"); #endif @@ -1699,9 +1727,16 @@ retry: error = md_mount(&nd->root_saddr, nd->root_hostnam, nd->root_fh, &nd->root_fhsize, &nd->root_args, td); - if (error != 0) - panic("nfs_boot: mountd root, error=%d", error); - + if (error != 0) { + if (gctx->any_root_overrides == 0) + panic("nfs_boot: mount root, error=%d", error); + else + goto out; + } + rootdevnames[0] = "nfs:"; +#ifdef NFSCLIENT + rootdevnames[1] = "oldnfs:"; +#endif nfs_diskless_valid = 3; } diff --git a/sys/ofed/drivers/net/mlx4/en_netdev.c b/sys/ofed/drivers/net/mlx4/en_netdev.c index 3dca7563f66d..0a59ab44383f 100644 --- a/sys/ofed/drivers/net/mlx4/en_netdev.c +++ b/sys/ofed/drivers/net/mlx4/en_netdev.c @@ -43,6 +43,7 @@ #include <net/if_vlan_var.h> #include <sys/sockio.h> +static void mlx4_en_init_locked(struct mlx4_en_priv *priv); static void mlx4_en_sysctl_stat(struct mlx4_en_priv *priv); static void mlx4_en_vlan_rx_add_vid(void *arg, struct net_device *dev, u16 vid) @@ -495,11 +496,6 @@ static void mlx4_en_do_get_stats(struct work_struct *work) queue_delayed_work(mdev->workqueue, &priv->stats_task, STATS_DELAY); } - if (mdev->mac_removed[MLX4_MAX_PORTS + 1 - priv->port]) { - panic("mlx4_en_do_get_stats: Unexpected mac removed for %d\n", - priv->port); - mdev->mac_removed[MLX4_MAX_PORTS + 1 - priv->port] = 0; - } mutex_unlock(&mdev->state_lock); } @@ -688,8 +684,8 @@ int mlx4_en_start_port(struct net_device *dev) mlx4_en_set_multicast(dev); /* Enable the queues. */ - atomic_clear_int(&dev->if_drv_flags, IFF_DRV_OACTIVE); - atomic_set_int(&dev->if_drv_flags, IFF_DRV_RUNNING); + dev->if_drv_flags &= ~IFF_DRV_OACTIVE; + dev->if_drv_flags |= IFF_DRV_RUNNING; callout_reset(&priv->watchdog_timer, MLX4_EN_WATCHDOG_TIMEOUT, mlx4_en_watchdog_timeout, priv); @@ -761,7 +757,7 @@ void mlx4_en_stop_port(struct net_device *dev) callout_stop(&priv->watchdog_timer); - atomic_clear_int(&dev->if_drv_flags, IFF_DRV_RUNNING); + dev->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); } static void mlx4_en_restart(struct work_struct *work) @@ -802,19 +798,30 @@ mlx4_en_init(void *arg) { struct mlx4_en_priv *priv; struct mlx4_en_dev *mdev; + + priv = arg; + mdev = priv->mdev; + mutex_lock(&mdev->state_lock); + mlx4_en_init_locked(priv); + mutex_unlock(&mdev->state_lock); +} + +static void +mlx4_en_init_locked(struct mlx4_en_priv *priv) +{ + + struct mlx4_en_dev *mdev; struct ifnet *dev; int i; - priv = arg; dev = priv->dev; mdev = priv->mdev; - mutex_lock(&mdev->state_lock); if (dev->if_drv_flags & IFF_DRV_RUNNING) mlx4_en_stop_port(dev); if (!mdev->device_up) { en_err(priv, "Cannot open - device down/disabled\n"); - goto out; + return; } /* Reset HW statistics and performance counters */ @@ -835,9 +842,6 @@ mlx4_en_init(void *arg) mlx4_en_set_default_moderation(priv); if (mlx4_en_start_port(dev)) en_err(priv, "Failed starting port:%d\n", priv->port); - -out: - mutex_unlock(&mdev->state_lock); } void mlx4_en_free_resources(struct mlx4_en_priv *priv) @@ -927,9 +931,14 @@ void mlx4_en_destroy_netdev(struct net_device *dev) if (priv->sysctl) sysctl_ctx_free(&priv->conf_ctx); + mutex_lock(&mdev->state_lock); + mlx4_en_stop_port(dev); + mutex_unlock(&mdev->state_lock); + cancel_delayed_work(&priv->stats_task); /* flush any pending task for this netdev */ flush_workqueue(mdev->workqueue); + callout_drain(&priv->watchdog_timer); /* Detach the netdev so tasks would not attempt to access it */ mutex_lock(&mdev->state_lock); @@ -1091,31 +1100,32 @@ static int mlx4_en_ioctl(struct ifnet *dev, u_long command, caddr_t data) error = -mlx4_en_change_mtu(dev, ifr->ifr_mtu); break; case SIOCSIFFLAGS: + mutex_lock(&mdev->state_lock); if (dev->if_flags & IFF_UP) { - if ((dev->if_drv_flags & IFF_DRV_RUNNING) == 0) { - mutex_lock(&mdev->state_lock); + if ((dev->if_drv_flags & IFF_DRV_RUNNING) == 0) mlx4_en_start_port(dev); - mutex_unlock(&mdev->state_lock); - } else + else mlx4_en_set_multicast(dev); } else { - mutex_lock(&mdev->state_lock); if (dev->if_drv_flags & IFF_DRV_RUNNING) { mlx4_en_stop_port(dev); if_link_state_change(dev, LINK_STATE_DOWN); } - mutex_unlock(&mdev->state_lock); } + mutex_unlock(&mdev->state_lock); break; case SIOCADDMULTI: case SIOCDELMULTI: + mutex_lock(&mdev->state_lock); mlx4_en_set_multicast(dev); + mutex_unlock(&mdev->state_lock); break; case SIOCSIFMEDIA: case SIOCGIFMEDIA: error = ifmedia_ioctl(dev, ifr, &priv->media, command); break; case SIOCSIFCAP: + mutex_lock(&mdev->state_lock); mask = ifr->ifr_reqcap ^ dev->if_capenable; if (mask & IFCAP_HWCSUM) dev->if_capenable ^= IFCAP_HWCSUM; @@ -1130,7 +1140,8 @@ static int mlx4_en_ioctl(struct ifnet *dev, u_long command, caddr_t data) if (mask & IFCAP_WOL_MAGIC) dev->if_capenable ^= IFCAP_WOL_MAGIC; if (dev->if_drv_flags & IFF_DRV_RUNNING) - mlx4_en_init(priv); + mlx4_en_init_locked(priv); + mutex_unlock(&mdev->state_lock); VLAN_CAPABILITIES(dev); break; default: diff --git a/sys/ofed/drivers/net/mlx4/en_tx.c b/sys/ofed/drivers/net/mlx4/en_tx.c index d28522085504..9ad3c59b7d08 100644 --- a/sys/ofed/drivers/net/mlx4/en_tx.c +++ b/sys/ofed/drivers/net/mlx4/en_tx.c @@ -780,8 +780,12 @@ retry: tx_desc->ctrl.srcrb_flags = cpu_to_be32(MLX4_WQE_CTRL_CQ_UPDATE | MLX4_WQE_CTRL_SOLICITED); if (mb->m_pkthdr.csum_flags & (CSUM_IP|CSUM_TCP|CSUM_UDP)) { - tx_desc->ctrl.srcrb_flags |= cpu_to_be32(MLX4_WQE_CTRL_IP_CSUM | - MLX4_WQE_CTRL_TCP_UDP_CSUM); + if (mb->m_pkthdr.csum_flags & CSUM_IP) + tx_desc->ctrl.srcrb_flags |= + cpu_to_be32(MLX4_WQE_CTRL_IP_CSUM); + if (mb->m_pkthdr.csum_flags & (CSUM_TCP|CSUM_UDP)) + tx_desc->ctrl.srcrb_flags |= + cpu_to_be32(MLX4_WQE_CTRL_TCP_UDP_CSUM); priv->port_stats.tx_chksum_offload++; } diff --git a/sys/ofed/include/linux/module.h b/sys/ofed/include/linux/module.h index 1e3a682a181e..8c83006841b1 100644 --- a/sys/ofed/include/linux/module.h +++ b/sys/ofed/include/linux/module.h @@ -68,17 +68,17 @@ _module_run(void *arg) } #define module_init(fn) \ - SYSINIT(fn, SI_SUB_RUN_SCHEDULER, SI_ORDER_FIRST, _module_run, (fn)) + SYSINIT(fn, SI_SUB_LAST, SI_ORDER_FIRST, _module_run, (fn)) /* * XXX This is a freebsdism designed to work around not having a module * load order resolver built in. */ #define module_init_order(fn, order) \ - SYSINIT(fn, SI_SUB_RUN_SCHEDULER, (order), _module_run, (fn)) + SYSINIT(fn, SI_SUB_LAST, (order), _module_run, (fn)) #define module_exit(fn) \ - SYSUNINIT(fn, SI_SUB_RUN_SCHEDULER, SI_ORDER_FIRST, _module_run, (fn)) + SYSUNINIT(fn, SI_SUB_LAST, SI_ORDER_FIRST, _module_run, (fn)) #define module_get(module) #define module_put(module) diff --git a/sys/powerpc/ofw/ofw_real.c b/sys/powerpc/ofw/ofw_real.c index f4066c2cf7b5..210f9133d53f 100644 --- a/sys/powerpc/ofw/ofw_real.c +++ b/sys/powerpc/ofw/ofw_real.c @@ -210,12 +210,12 @@ ofw_real_bounce_alloc(void *junk) mtx_lock(&of_bounce_mtx); - of_bounce_virt = contigmalloc(PAGE_SIZE, M_OFWREAL, 0, 0, + of_bounce_virt = contigmalloc(4 * PAGE_SIZE, M_OFWREAL, 0, 0, ulmin(platform_real_maxaddr(), BUS_SPACE_MAXADDR_32BIT), PAGE_SIZE, - PAGE_SIZE); + 4 * PAGE_SIZE); of_bounce_phys = vtophys(of_bounce_virt); - of_bounce_size = PAGE_SIZE; + of_bounce_size = 4 * PAGE_SIZE; /* * For virtual-mode OF, direct map this physical address so that diff --git a/sys/powerpc/powermac/macio.c b/sys/powerpc/powermac/macio.c index eae6386f3c79..b31cf15394f7 100644 --- a/sys/powerpc/powermac/macio.c +++ b/sys/powerpc/powermac/macio.c @@ -605,3 +605,47 @@ macio_get_devinfo(device_t dev, device_t child) dinfo = device_get_ivars(child); return (&dinfo->mdi_obdinfo); } + +int +macio_enable_wireless(device_t dev, bool enable) +{ + struct macio_softc *sc = device_get_softc(dev); + uint32_t x; + + if (enable) { + x = bus_read_4(sc->sc_memr, KEYLARGO_FCR2); + x |= 0x4; + bus_write_4(sc->sc_memr, KEYLARGO_FCR2, x); + + /* Enable card slot. */ + bus_write_1(sc->sc_memr, KEYLARGO_GPIO_BASE + 0x0f, 5); + DELAY(1000); + bus_write_1(sc->sc_memr, KEYLARGO_GPIO_BASE + 0x0f, 4); + DELAY(1000); + x = bus_read_4(sc->sc_memr, KEYLARGO_FCR2); + x &= ~0x80000000; + + bus_write_4(sc->sc_memr, KEYLARGO_FCR2, x); + /* out8(gpio + 0x10, 4); */ + + bus_write_1(sc->sc_memr, KEYLARGO_EXTINT_GPIO_REG_BASE + 0x0b, 0); + bus_write_1(sc->sc_memr, KEYLARGO_EXTINT_GPIO_REG_BASE + 0x0a, 0x28); + bus_write_1(sc->sc_memr, KEYLARGO_EXTINT_GPIO_REG_BASE + 0x0d, 0x28); + bus_write_1(sc->sc_memr, KEYLARGO_GPIO_BASE + 0x0d, 0x28); + bus_write_1(sc->sc_memr, KEYLARGO_GPIO_BASE + 0x0e, 0x28); + bus_write_4(sc->sc_memr, 0x1c000, 0); + + /* Initialize the card. */ + bus_write_4(sc->sc_memr, 0x1a3e0, 0x41); + x = bus_read_4(sc->sc_memr, KEYLARGO_FCR2); + x |= 0x80000000; + bus_write_4(sc->sc_memr, KEYLARGO_FCR2, x); + } else { + x = bus_read_4(sc->sc_memr, KEYLARGO_FCR2); + x &= ~0x4; + bus_write_4(sc->sc_memr, KEYLARGO_FCR2, x); + /* out8(gpio + 0x10, 0); */ + } + + return (0); +} diff --git a/sys/powerpc/powermac/maciovar.h b/sys/powerpc/powermac/maciovar.h index ea0a029be21b..61fac469b37f 100644 --- a/sys/powerpc/powermac/maciovar.h +++ b/sys/powerpc/powermac/maciovar.h @@ -43,10 +43,15 @@ #define HEATHROW_FCR 0x38 #define KEYLARGO_FCR0 0x38 #define KEYLARGO_FCR1 0x3c +#define KEYLARGO_FCR2 0x40 #define FCR_ENET_ENABLE 0x60000000 #define FCR_ENET_RESET 0x80000000 +/* Used only by macio_enable_wireless() for now. */ +#define KEYLARGO_GPIO_BASE 0x6a +#define KEYLARGO_EXTINT_GPIO_REG_BASE 0x58 + /* * Format of a macio reg property entry. */ @@ -66,4 +71,6 @@ struct macio_devinfo { struct resource_list mdi_resources; }; +extern int macio_enable_wireless(device_t dev, bool enable); + #endif /* _MACIO_MACIOVAR_H_ */ diff --git a/sys/sys/kernel.h b/sys/sys/kernel.h index c54677a8d810..687b42caf09c 100644 --- a/sys/sys/kernel.h +++ b/sys/sys/kernel.h @@ -79,7 +79,7 @@ extern volatile int ticks; * enumeration values are explicit rather than implicit to provide * for binary compatibility with inserted elements. * - * The SI_SUB_RUN_SCHEDULER value must have the highest lexical value. + * The SI_SUB_LAST value must have the highest lexical value. * * The SI_SUB_SWAP values represent a value used by * the BSD 4.4Lite but not by FreeBSD; it is maintained in dependent @@ -165,7 +165,7 @@ enum sysinit_sub_id { SI_SUB_KTHREAD_IDLE = 0xee00000, /* idle procs*/ SI_SUB_SMP = 0xf000000, /* start the APs*/ SI_SUB_RACCTD = 0xf100000, /* start raccd*/ - SI_SUB_RUN_SCHEDULER = 0xfffffff /* scheduler*/ + SI_SUB_LAST = 0xfffffff /* final initialization */ }; diff --git a/sys/sys/libkern.h b/sys/sys/libkern.h index c04e88d2e095..3665b3a59946 100644 --- a/sys/sys/libkern.h +++ b/sys/sys/libkern.h @@ -94,6 +94,10 @@ int fls(int); #ifndef HAVE_INLINE_FLSL int flsl(long); #endif +#ifndef HAVE_INLINE_FLSLL +int flsll(long long); +#endif + int fnmatch(const char *, const char *, int); int locc(int, char *, u_int); void *memchr(const void *s, int c, size_t n); diff --git a/sys/sys/param.h b/sys/sys/param.h index 8957516db978..20fa2c887844 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1000038 /* Master, propagated to newvers */ +#define __FreeBSD_version 1000040 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, diff --git a/sys/sys/sched.h b/sys/sys/sched.h index bfd8522cedc0..7a4235d2672e 100644 --- a/sys/sys/sched.h +++ b/sys/sys/sched.h @@ -182,7 +182,7 @@ static void name ## _add_proc(void *dummy __unused) \ #name, CTLTYPE_LONG|CTLFLAG_RD|CTLFLAG_MPSAFE, \ ptr, 0, sysctl_dpcpu_long, "LU", descr); \ } \ -SYSINIT(name, SI_SUB_RUN_SCHEDULER, SI_ORDER_MIDDLE, name ## _add_proc, NULL); +SYSINIT(name, SI_SUB_LAST, SI_ORDER_MIDDLE, name ## _add_proc, NULL); #define SCHED_STAT_DEFINE(name, descr) \ DPCPU_DEFINE(unsigned long, name); \ diff --git a/sys/sys/syscallsubr.h b/sys/sys/syscallsubr.h index 49e8be1b7fec..e18c7354ca15 100644 --- a/sys/sys/syscallsubr.h +++ b/sys/sys/syscallsubr.h @@ -76,6 +76,8 @@ int kern_chmod(struct thread *td, char *path, enum uio_seg pathseg, int mode); int kern_chown(struct thread *td, char *path, enum uio_seg pathseg, int uid, int gid); +int kern_clock_getcpuclockid2(struct thread *td, id_t id, int which, + clockid_t *clk_id); int kern_clock_getres(struct thread *td, clockid_t clock_id, struct timespec *ts); int kern_clock_gettime(struct thread *td, clockid_t clock_id, @@ -226,6 +228,13 @@ int kern_symlink(struct thread *td, char *path, char *link, enum uio_seg segflg); int kern_symlinkat(struct thread *td, char *path1, int fd, char *path2, enum uio_seg segflg); +int kern_ktimer_create(struct thread *td, clockid_t clock_id, + struct sigevent *evp, int *timerid, int preset_id); +int kern_ktimer_delete(struct thread *, int); +int kern_ktimer_settime(struct thread *td, int timer_id, int flags, + struct itimerspec *val, struct itimerspec *oval); +int kern_ktimer_gettime(struct thread *td, int timer_id, + struct itimerspec *val); int kern_thr_new(struct thread *td, struct thr_param *param); int kern_thr_suspend(struct thread *td, struct timespec *tsp); int kern_truncate(struct thread *td, char *path, enum uio_seg pathseg, diff --git a/sys/sys/uuid.h b/sys/sys/uuid.h index 0f40bb20e31b..0748f6114853 100644 --- a/sys/sys/uuid.h +++ b/sys/sys/uuid.h @@ -58,6 +58,9 @@ struct sbuf; struct uuid *kern_uuidgen(struct uuid *, size_t); +int uuid_ether_add(const uint8_t *); +int uuid_ether_del(const uint8_t *); + int snprintf_uuid(char *, size_t, struct uuid *); int printf_uuid(struct uuid *); int sbuf_printf_uuid(struct sbuf *, struct uuid *); diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c index 3a9492a17a7c..900209ee2ae4 100644 --- a/sys/vm/uma_core.c +++ b/sys/vm/uma_core.c @@ -1139,9 +1139,10 @@ keg_small_init(uma_keg_t keg) u_int shsize; if (keg->uk_flags & UMA_ZONE_PCPU) { - KASSERT(mp_ncpus > 0, ("%s: ncpus %d\n", __func__, mp_ncpus)); + u_int ncpus = mp_ncpus ? mp_ncpus : MAXCPU; + keg->uk_slabsize = sizeof(struct pcpu); - keg->uk_ppera = howmany(mp_ncpus * sizeof(struct pcpu), + keg->uk_ppera = howmany(ncpus * sizeof(struct pcpu), PAGE_SIZE); } else { keg->uk_slabsize = UMA_SLAB_SIZE; diff --git a/sys/vm/uma_int.h b/sys/vm/uma_int.h index 8d46c912f7ca..9aa05609114c 100644 --- a/sys/vm/uma_int.h +++ b/sys/vm/uma_int.h @@ -49,14 +49,6 @@ * 10% memory waste we potentially allocate a separate uma_slab_t if this will * improve the number of items per slab that will fit. * - * Other potential space optimizations are storing the 8bit of linkage in space - * wasted between items due to alignment problems. This may yield a much better - * memory footprint for certain sizes of objects. Another alternative is to - * increase the UMA_SLAB_SIZE, or allow for dynamic slab sizes. I prefer - * dynamic slab sizes because we could stick with 8 bit indices and only use - * large slab sizes for zones with a lot of waste per slab. This may create - * inefficiencies in the vm subsystem due to fragmentation in the address space. - * * The only really gross cases, with regards to memory waste, are for those * items that are just over half the page size. You can get nearly 50% waste, * so you fall back to the memory footprint of the power of two allocator. I diff --git a/sys/vm/vm.h b/sys/vm/vm.h index bfb4a60b3a08..d87495d3f417 100644 --- a/sys/vm/vm.h +++ b/sys/vm/vm.h @@ -147,6 +147,7 @@ int swap_reserve_by_cred(vm_ooffset_t incr, struct ucred *cred); void swap_reserve_force(vm_ooffset_t incr); void swap_release(vm_ooffset_t decr); void swap_release_by_cred(vm_ooffset_t decr, struct ucred *cred); +void swapper(void); #endif /* VM_H */ diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c index 6183518861f9..948e2b3c0d24 100644 --- a/sys/vm/vm_glue.c +++ b/sys/vm/vm_glue.c @@ -96,16 +96,6 @@ __FBSDID("$FreeBSD$"); #include <vm/vm_pager.h> #include <vm/swap_pager.h> -/* - * System initialization - * - * THIS MUST BE THE LAST INITIALIZATION ITEM!!! - * - * Note: run scheduling should be divorced from the vm system. - */ -static void scheduler(void *); -SYSINIT(scheduler, SI_SUB_RUN_SCHEDULER, SI_ORDER_ANY, scheduler, NULL); - #ifndef NO_SWAPPING static int swapout(struct proc *); static void swapclear(struct proc *); @@ -695,10 +685,8 @@ faultin(p) * * Giant is held on entry. */ -/* ARGSUSED*/ -static void -scheduler(dummy) - void *dummy; +void +swapper(void) { struct proc *p; struct thread *td; @@ -708,9 +696,6 @@ scheduler(dummy) int ppri; int pri; - mtx_assert(&Giant, MA_OWNED | MA_NOTRECURSED); - mtx_unlock(&Giant); - loop: if (vm_page_count_min()) { VM_WAIT; @@ -761,7 +746,7 @@ loop: * Nothing to do, back to sleep. */ if ((p = pp) == NULL) { - tsleep(&proc0, PVM, "sched", MAXSLP * hz / 2); + tsleep(&proc0, PVM, "swapin", MAXSLP * hz / 2); goto loop; } PROC_LOCK(p); diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index 778c0545b7ca..c43bce21b74e 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -239,8 +239,7 @@ vm_map_zinit(void *mem, int size, int flags) vm_map_t map; map = (vm_map_t)mem; - map->nentries = 0; - map->size = 0; + memset(map, 0, sizeof(*map)); mtx_init(&map->system_mtx, "vm map (system)", NULL, MTX_DEF | MTX_DUPOK); sx_init(&map->lock, "vm map (user)"); return (0); @@ -1444,19 +1443,29 @@ vm_map_find(vm_map_t map, vm_object_t object, vm_ooffset_t offset, vm_size_t length, int find_space, vm_prot_t prot, vm_prot_t max, int cow) { - vm_offset_t start; + vm_offset_t start, initial_addr; int result; - start = *addr; + if (find_space == VMFS_OPTIMAL_SPACE && (object == NULL || + (object->flags & OBJ_COLORED) == 0)) + find_space = VMFS_ANY_SPACE; + initial_addr = *addr; +again: + start = initial_addr; vm_map_lock(map); do { if (find_space != VMFS_NO_SPACE) { if (vm_map_findspace(map, start, length, addr)) { vm_map_unlock(map); + if (find_space == VMFS_OPTIMAL_SPACE) { + find_space = VMFS_ANY_SPACE; + goto again; + } return (KERN_NO_SPACE); } switch (find_space) { case VMFS_ALIGNED_SPACE: + case VMFS_OPTIMAL_SPACE: pmap_align_superpage(object, offset, addr, length); break; @@ -1473,11 +1482,11 @@ vm_map_find(vm_map_t map, vm_object_t object, vm_ooffset_t offset, } result = vm_map_insert(map, object, offset, start, start + length, prot, max, cow); - } while (result == KERN_NO_SPACE && (find_space == VMFS_ALIGNED_SPACE + } while (result == KERN_NO_SPACE && (find_space == VMFS_ALIGNED_SPACE || #ifdef VMFS_TLB_ALIGNED_SPACE - || find_space == VMFS_TLB_ALIGNED_SPACE + find_space == VMFS_TLB_ALIGNED_SPACE || #endif - )); + find_space == VMFS_OPTIMAL_SPACE)); vm_map_unlock(map); return (result); } diff --git a/sys/vm/vm_map.h b/sys/vm/vm_map.h index a73691d8890d..824a9a0f6e83 100644 --- a/sys/vm/vm_map.h +++ b/sys/vm/vm_map.h @@ -343,9 +343,10 @@ long vmspace_resident_count(struct vmspace *vmspace); */ #define VMFS_NO_SPACE 0 /* don't find; use the given range */ #define VMFS_ANY_SPACE 1 /* find a range with any alignment */ -#define VMFS_ALIGNED_SPACE 2 /* find a superpage-aligned range */ +#define VMFS_OPTIMAL_SPACE 2 /* find a range with optimal alignment*/ +#define VMFS_ALIGNED_SPACE 3 /* find a superpage-aligned range */ #if defined(__mips__) -#define VMFS_TLB_ALIGNED_SPACE 3 /* find a TLB entry aligned range */ +#define VMFS_TLB_ALIGNED_SPACE 4 /* find a TLB entry aligned range */ #endif /* diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c index c7e22c3f96f6..1b0809756c20 100644 --- a/sys/vm/vm_mmap.c +++ b/sys/vm/vm_mmap.c @@ -1224,6 +1224,9 @@ sys_munlock(td, uap) { vm_offset_t addr, end, last, start; vm_size_t size; +#ifdef RACCT + vm_map_t map; +#endif int error; error = priv_check(td, PRIV_VM_MUNLOCK); @@ -1241,7 +1244,9 @@ sys_munlock(td, uap) #ifdef RACCT if (error == KERN_SUCCESS) { PROC_LOCK(td->td_proc); - racct_sub(td->td_proc, RACCT_MEMLOCK, ptoa(end - start)); + map = &td->td_proc->p_vmspace->vm_map; + racct_set(td->td_proc, RACCT_MEMLOCK, + ptoa(pmap_wired_count(map->pmap))); PROC_UNLOCK(td->td_proc); } #endif @@ -1603,7 +1608,8 @@ vm_mmap(vm_map_t map, vm_offset_t *addr, vm_size_t size, vm_prot_t prot, else if (fitit) rv = vm_map_find(map, object, foff, addr, size, object != NULL && object->type == OBJT_DEVICE ? - VMFS_ALIGNED_SPACE : VMFS_ANY_SPACE, prot, maxprot, docow); + VMFS_ALIGNED_SPACE : VMFS_OPTIMAL_SPACE, prot, maxprot, + docow); else rv = vm_map_fixed(map, object, foff, *addr, size, prot, maxprot, docow); diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c index 6d6e6260b973..841820b4b2ff 100644 --- a/sys/vm/vm_pageout.c +++ b/sys/vm/vm_pageout.c @@ -157,7 +157,6 @@ static int vm_pageout_stats; static int vm_pageout_stats_interval; static int vm_pageout_full_stats; static int vm_pageout_full_stats_interval; -static int vm_pageout_algorithm; static int defer_swap_pageouts; static int disable_swap_pageouts; @@ -169,9 +168,6 @@ static int vm_swap_enabled = 1; static int vm_swap_idle_enabled = 0; #endif -SYSCTL_INT(_vm, VM_PAGEOUT_ALGORITHM, pageout_algorithm, - CTLFLAG_RW, &vm_pageout_algorithm, 0, "LRU page mgmt"); - SYSCTL_INT(_vm, OID_AUTO, max_launder, CTLFLAG_RW, &vm_max_launder, 0, "Limit dirty flushes in pageout"); @@ -712,7 +708,7 @@ vm_pageout_object_deactivate_pages(pmap_t pmap, vm_object_t first_object, { vm_object_t backing_object, object; vm_page_t p; - int actcount, remove_mode; + int act_delta, remove_mode; VM_OBJECT_ASSERT_LOCKED(first_object); if ((first_object->flags & OBJ_FICTITIOUS) != 0) @@ -743,22 +739,20 @@ vm_pageout_object_deactivate_pages(pmap_t pmap, vm_object_t first_object, vm_page_unlock(p); continue; } - actcount = pmap_ts_referenced(p); + act_delta = pmap_ts_referenced(p); if ((p->aflags & PGA_REFERENCED) != 0) { - if (actcount == 0) - actcount = 1; + if (act_delta == 0) + act_delta = 1; vm_page_aflag_clear(p, PGA_REFERENCED); } - if (p->queue != PQ_ACTIVE && actcount != 0) { + if (p->queue != PQ_ACTIVE && act_delta != 0) { vm_page_activate(p); - p->act_count += actcount; + p->act_count += act_delta; } else if (p->queue == PQ_ACTIVE) { - if (actcount == 0) { + if (act_delta == 0) { p->act_count -= min(p->act_count, ACT_DECLINE); - if (!remove_mode && - (vm_pageout_algorithm || - p->act_count == 0)) { + if (!remove_mode && p->act_count == 0) { pmap_remove_all(p); vm_page_deactivate(p); } else @@ -875,7 +869,7 @@ vm_pageout_scan(int pass) int page_shortage, maxscan, pcount; int addl_page_shortage; vm_object_t object; - int actcount; + int act_delta; int vnodes_skipped = 0; int maxlaunder; boolean_t queues_locked; @@ -995,44 +989,40 @@ vm_pageout_scan(int pass) queues_locked = FALSE; /* - * If the object is not being used, we ignore previous + * We bump the activation count if the page has been + * referenced while in the inactive queue. This makes + * it less likely that the page will be added back to the + * inactive queue prematurely again. Here we check the + * page tables (or emulated bits, if any), given the upper + * level VM system not knowing anything about existing * references. */ - if (object->ref_count == 0) { + act_delta = 0; + if ((m->aflags & PGA_REFERENCED) != 0) { vm_page_aflag_clear(m, PGA_REFERENCED); + act_delta = 1; + } + if (object->ref_count != 0) { + act_delta += pmap_ts_referenced(m); + } else { KASSERT(!pmap_page_is_mapped(m), ("vm_pageout_scan: page %p is mapped", m)); - - /* - * Otherwise, if the page has been referenced while in the - * inactive queue, we bump the "activation count" upwards, - * making it less likely that the page will be added back to - * the inactive queue prematurely again. Here we check the - * page tables (or emulated bits, if any), given the upper - * level VM system not knowing anything about existing - * references. - */ - } else if ((m->aflags & PGA_REFERENCED) == 0 && - (actcount = pmap_ts_referenced(m)) != 0) { - vm_page_activate(m); - VM_OBJECT_WUNLOCK(object); - m->act_count += actcount + ACT_ADVANCE; - vm_page_unlock(m); - goto relock_queues; } /* * If the upper level VM system knows about any page - * references, we activate the page. We also set the - * "activation count" higher than normal so that we will less - * likely place pages back onto the inactive queue again. + * references, we reactivate the page or requeue it. */ - if ((m->aflags & PGA_REFERENCED) != 0) { - vm_page_aflag_clear(m, PGA_REFERENCED); - actcount = pmap_ts_referenced(m); - vm_page_activate(m); + if (act_delta != 0) { + if (object->ref_count) { + vm_page_activate(m); + m->act_count += act_delta + ACT_ADVANCE; + } else { + vm_pagequeue_lock(pq); + queues_locked = TRUE; + vm_page_requeue_locked(m); + } VM_OBJECT_WUNLOCK(object); - m->act_count += actcount + ACT_ADVANCE + 1; vm_page_unlock(m); goto relock_queues; } @@ -1330,51 +1320,40 @@ relock_queues: /* * Check to see "how much" the page has been used. */ - actcount = 0; - if (object->ref_count != 0) { - if (m->aflags & PGA_REFERENCED) { - actcount += 1; - } - actcount += pmap_ts_referenced(m); - if (actcount) { - m->act_count += ACT_ADVANCE + actcount; - if (m->act_count > ACT_MAX) - m->act_count = ACT_MAX; - } + act_delta = 0; + if (m->aflags & PGA_REFERENCED) { + vm_page_aflag_clear(m, PGA_REFERENCED); + act_delta += 1; } + if (object->ref_count != 0) + act_delta += pmap_ts_referenced(m); /* - * Since we have "tested" this bit, we need to clear it now. + * Advance or decay the act_count based on recent usage. */ - vm_page_aflag_clear(m, PGA_REFERENCED); + if (act_delta) { + m->act_count += ACT_ADVANCE + act_delta; + if (m->act_count > ACT_MAX) + m->act_count = ACT_MAX; + } else { + m->act_count -= min(m->act_count, ACT_DECLINE); + act_delta = m->act_count; + } /* - * Only if an object is currently being used, do we use the - * page activation count stats. + * Move this page to the tail of the active or inactive + * queue depending on usage. */ - if (actcount != 0 && object->ref_count != 0) + if (act_delta == 0) { + KASSERT(object->ref_count != 0 || + !pmap_page_is_mapped(m), + ("vm_pageout_scan: page %p is mapped", m)); + /* Dequeue to avoid later lock recursion. */ + vm_page_dequeue_locked(m); + vm_page_deactivate(m); + page_shortage--; + } else vm_page_requeue_locked(m); - else { - m->act_count -= min(m->act_count, ACT_DECLINE); - if (vm_pageout_algorithm || - object->ref_count == 0 || - m->act_count == 0) { - page_shortage--; - /* Dequeue to avoid later lock recursion. */ - vm_page_dequeue_locked(m); - if (object->ref_count == 0) { - KASSERT(!pmap_page_is_mapped(m), - ("vm_pageout_scan: page %p is mapped", m)); - if (m->dirty == 0) - vm_page_cache(m); - else - vm_page_deactivate(m); - } else { - vm_page_deactivate(m); - } - } else - vm_page_requeue_locked(m); - } vm_page_unlock(m); VM_OBJECT_WUNLOCK(object); m = next; diff --git a/sys/vm/vm_param.h b/sys/vm/vm_param.h index c404989cd257..22401fd80588 100644 --- a/sys/vm/vm_param.h +++ b/sys/vm/vm_param.h @@ -82,7 +82,7 @@ #define VM_V_CACHE_MIN 7 /* cnt.v_cache_min */ #define VM_V_CACHE_MAX 8 /* cnt.v_cache_max */ #define VM_V_PAGEOUT_FREE_MIN 9 /* cnt.v_pageout_free_min */ -#define VM_PAGEOUT_ALGORITHM 10 /* pageout algorithm */ +#define VM_OBSOLETE_10 10 /* pageout algorithm */ #define VM_SWAPPING_ENABLED 11 /* swapping enabled */ #define VM_MAXID 12 /* number of valid vm ids */ @@ -97,7 +97,7 @@ { "v_cache_min", CTLTYPE_UINT }, \ { "v_cache_max", CTLTYPE_UINT }, \ { "v_pageout_free_min", CTLTYPE_UINT}, \ - { "pageout_algorithm", CTLTYPE_INT}, \ + { "obsolete_pageout_algorithm", CTLTYPE_INT}, \ { "swap_enabled", CTLTYPE_INT},\ } diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c index fa927689cc56..4c7da16261e5 100644 --- a/sys/vm/vnode_pager.c +++ b/sys/vm/vnode_pager.c @@ -158,11 +158,6 @@ vnode_destroy_vobject(struct vnode *vp) VM_OBJECT_WLOCK(obj); if (obj->ref_count == 0) { /* - * vclean() may be called twice. The first time - * removes the primary reference to the object, - * the second time goes one further and is a - * special-case to terminate the object. - * * don't double-terminate the object */ if ((obj->flags & OBJ_DEAD) == 0) diff --git a/sys/x86/include/specialreg.h b/sys/x86/include/specialreg.h index bf1333f8984d..4247ee2caccb 100644 --- a/sys/x86/include/specialreg.h +++ b/sys/x86/include/specialreg.h @@ -240,6 +240,29 @@ #define CPUID_LOCAL_APIC_ID 0xff000000 /* + * CPUID instruction 5 info + */ +#define CPUID5_MON_MIN_SIZE 0x0000ffff /* eax */ +#define CPUID5_MON_MAX_SIZE 0x0000ffff /* ebx */ +#define CPUID5_MON_MWAIT_EXT 0x00000001 /* ecx */ +#define CPUID5_MWAIT_INTRBREAK 0x00000002 /* ecx */ + +/* + * MWAIT cpu power states. Lower 4 bits are sub-states. + */ +#define MWAIT_C0 0xf0 +#define MWAIT_C1 0x00 +#define MWAIT_C2 0x10 +#define MWAIT_C3 0x20 +#define MWAIT_C4 0x30 + +/* + * MWAIT extensions. + */ +/* Interrupt breaks MWAIT even when masked. */ +#define MWAIT_INTRBREAK 0x00000001 + +/* * CPUID instruction 6 ecx info */ #define CPUID_PERF_STAT 0x00000001 diff --git a/tools/build/options/WITH_BSD_PATCH b/tools/build/options/WITH_BSD_PATCH deleted file mode 100644 index 8430d2a8ab99..000000000000 --- a/tools/build/options/WITH_BSD_PATCH +++ /dev/null @@ -1,2 +0,0 @@ -.\" $FreeBSD$ -Install BSD-licensed patch as 'patch' instead of GNU patch. diff --git a/tools/build/options/WITH_GNU_PATCH b/tools/build/options/WITH_GNU_PATCH new file mode 100644 index 000000000000..d2a751f92964 --- /dev/null +++ b/tools/build/options/WITH_GNU_PATCH @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Install GNU-licensed patch as 'patch' instead of BSD patch. diff --git a/tools/regression/aio/aiotest/aiotest.c b/tools/regression/aio/aiotest/aiotest.c index 60de273dc463..48c7ababc944 100644 --- a/tools/regression/aio/aiotest/aiotest.c +++ b/tools/regression/aio/aiotest/aiotest.c @@ -49,6 +49,7 @@ #include <fcntl.h> #include <libutil.h> #include <limits.h> +#include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -269,7 +270,7 @@ aio_write_test(struct aio_context *ac) if (len != ac->ac_buflen) { aio_cleanup(ac); errx(-1, "FAIL: %s: aio_write_test: aio_waitcomplete: short " - "write (%d)", ac->ac_test, len); + "write (%jd)", ac->ac_test, (intmax_t)len); } } @@ -329,7 +330,7 @@ aio_read_test(struct aio_context *ac) if (len != ac->ac_buflen) { aio_cleanup(ac); errx(-1, "FAIL: %s: aio_read_test: aio_waitcomplete: short " - "read (%d)", ac->ac_test, len); + "read (%jd)", ac->ac_test, (intmax_t)len); } if (aio_test_buffer(ac->ac_buffer, ac->ac_buflen, ac->ac_seed) == 0) { @@ -366,7 +367,7 @@ aio_file_cleanup(void *arg) #define FILE_LEN GLOBAL_MAX #define FILE_TIMEOUT 30 -static int +static void aio_file_test(void) { char pathname[PATH_MAX]; @@ -414,7 +415,7 @@ aio_fifo_cleanup(void *arg) #define FIFO_LEN 256 #define FIFO_TIMEOUT 30 -static int +static void aio_fifo_test(void) { int error, read_fd = -1, write_fd = -1; @@ -481,7 +482,7 @@ aio_unix_socketpair_cleanup(void *arg) #define UNIX_SOCKETPAIR_LEN 256 #define UNIX_SOCKETPAIR_TIMEOUT 30 -static int +static void aio_unix_socketpair_test(void) { struct aio_unix_socketpair_arg arg; @@ -515,13 +516,14 @@ aio_pty_cleanup(void *arg) { struct aio_pty_arg *apa; + apa = arg; close(apa->apa_read_fd); close(apa->apa_write_fd); }; #define PTY_LEN 256 #define PTY_TIMEOUT 30 -static int +static void aio_pty_test(void) { struct aio_pty_arg arg; @@ -573,7 +575,7 @@ aio_pipe_cleanup(void *arg) #define PIPE_LEN 256 #define PIPE_TIMEOUT 30 -static int +static void aio_pipe_test(void) { struct aio_context ac; @@ -628,7 +630,7 @@ aio_md_cleanup(void *arg) #define MD_LEN GLOBAL_MAX #define MD_TIMEOUT 30 -static int +static void aio_md_test(void) { int error, fd, i, mdctl_fd, unit; diff --git a/tools/regression/lib/libc/gen/test-wordexp.c b/tools/regression/lib/libc/gen/test-wordexp.c index d94f870598df..15d1b7cdfeef 100644 --- a/tools/regression/lib/libc/gen/test-wordexp.c +++ b/tools/regression/lib/libc/gen/test-wordexp.c @@ -195,6 +195,18 @@ main(int argc, char *argv[]) r = wordexp("test } test", &we, 0); assert(r == WRDE_BADCHAR); + /* WRDE_SYNTAX */ + r = wordexp("'", &we, 0); + assert(r == WRDE_SYNTAX); + r = wordexp("'", &we, WRDE_UNDEF); + assert(r == WRDE_SYNTAX); + r = wordexp("'\\'", &we, 0); + assert(r == 0); + assert(we.we_wordc == 1); + assert(strcmp(we.we_wordv[0], "\\") == 0); + assert(we.we_wordv[1] == NULL); + wordfree(&we); + /* With a SIGCHLD handler that reaps all zombies. */ sa.sa_flags = 0; sigemptyset(&sa.sa_mask); diff --git a/tools/tools/crypto/ipsecstats.c b/tools/tools/crypto/ipsecstats.c index 7da16e551bb4..9f98ea897465 100644 --- a/tools/tools/crypto/ipsecstats.c +++ b/tools/tools/crypto/ipsecstats.c @@ -25,11 +25,12 @@ * * $FreeBSD$ */ -#include <stdio.h> #include <sys/types.h> #include <netipsec/ipsec.h> #include <netipsec/ah_var.h> #include <netipsec/esp_var.h> +#include <stdint.h> +#include <stdio.h> struct alg { int a; diff --git a/tools/tools/cxgbetool/cxgbetool.c b/tools/tools/cxgbetool/cxgbetool.c index a97cf1f279ea..44c4b2d44937 100644 --- a/tools/tools/cxgbetool/cxgbetool.c +++ b/tools/tools/cxgbetool/cxgbetool.c @@ -98,6 +98,9 @@ usage(FILE *fp) "\tregdump [<module>] ... dump registers\n" "\tstdio interactive mode\n" "\ttcb <tid> read TCB\n" + "\ttracer <idx> tx<n>|rx<n> set and enable a tracer)\n" + "\ttracer <idx> disable|enable disable or enable a tracer\n" + "\ttracer list list all tracers\n" ); } @@ -1658,6 +1661,203 @@ clearstats(int argc, const char *argv[]) } static int +show_tracers(void) +{ + struct t4_tracer t; + char *s; + int rc, port_idx, i; + long long val; + + /* Magic values: MPS_TRC_CFG = 0x9800. MPS_TRC_CFG[1:1] = TrcEn */ + rc = read_reg(0x9800, 4, &val); + if (rc != 0) + return (rc); + printf("tracing is %s\n", val & 2 ? "ENABLED" : "DISABLED"); + + t.idx = 0; + for (t.idx = 0; ; t.idx++) { + rc = doit(CHELSIO_T4_GET_TRACER, &t); + if (rc != 0 || t.idx == 0xff) + break; + + if (t.tp.port < 4) { + s = "Rx"; + port_idx = t.tp.port; + } else if (t.tp.port < 8) { + s = "Tx"; + port_idx = t.tp.port - 4; + } else if (t.tp.port < 12) { + s = "loopback"; + port_idx = t.tp.port - 8; + } else if (t.tp.port < 16) { + s = "MPS Rx"; + port_idx = t.tp.port - 12; + } else if (t.tp.port < 20) { + s = "MPS Tx"; + port_idx = t.tp.port - 16; + } else { + s = "unknown"; + port_idx = t.tp.port; + } + + printf("\ntracer %u (currently %s) captures ", t.idx, + t.enabled ? "ENABLED" : "DISABLED"); + if (t.tp.port < 8) + printf("port %u %s, ", port_idx, s); + else + printf("%s %u, ", s, port_idx); + printf("snap length: %u, min length: %u\n", t.tp.snap_len, + t.tp.min_len); + printf("packets captured %smatch filter\n", + t.tp.invert ? "do not " : ""); + if (t.tp.skip_ofst) { + printf("filter pattern: "); + for (i = 0; i < t.tp.skip_ofst * 2; i += 2) + printf("%08x%08x", t.tp.data[i], + t.tp.data[i + 1]); + printf("/"); + for (i = 0; i < t.tp.skip_ofst * 2; i += 2) + printf("%08x%08x", t.tp.mask[i], + t.tp.mask[i + 1]); + printf("@0\n"); + } + printf("filter pattern: "); + for (i = t.tp.skip_ofst * 2; i < T4_TRACE_LEN / 4; i += 2) + printf("%08x%08x", t.tp.data[i], t.tp.data[i + 1]); + printf("/"); + for (i = t.tp.skip_ofst * 2; i < T4_TRACE_LEN / 4; i += 2) + printf("%08x%08x", t.tp.mask[i], t.tp.mask[i + 1]); + printf("@%u\n", (t.tp.skip_ofst + t.tp.skip_len) * 8); + } + + return (rc); +} + +static int +tracer_onoff(uint8_t idx, int enabled) +{ + struct t4_tracer t; + + t.idx = idx; + t.enabled = enabled; + t.valid = 0; + + return doit(CHELSIO_T4_SET_TRACER, &t); +} + +static void +create_tracing_ifnet() +{ + char *cmd[] = { + "/sbin/ifconfig", __DECONST(char *, nexus), "create", NULL + }; + char *env[] = {NULL}; + + if (vfork() == 0) { + close(STDERR_FILENO); + execve(cmd[0], cmd, env); + _exit(0); + } +} + +/* + * XXX: Allow user to specify snaplen, minlen, and pattern (including inverted + * matching). Right now this is a quick-n-dirty implementation that traces the + * first 128B of all tx or rx on a port + */ +static int +set_tracer(uint8_t idx, int argc, const char *argv[]) +{ + struct t4_tracer t; + int len, port; + + bzero(&t, sizeof (t)); + t.idx = idx; + t.enabled = 1; + t.valid = 1; + + if (argc != 1) { + warnx("must specify tx<n> or rx<n>."); + return (EINVAL); + } + + len = strlen(argv[0]); + if (len != 3) { + warnx("argument must be 3 characters (tx<n> or rx<n>)"); + return (EINVAL); + } + + if (strncmp(argv[0], "tx", 2) == 0) { + port = argv[0][2] - '0'; + if (port < 0 || port > 3) { + warnx("'%c' in %s is invalid", argv[0][2], argv[0]); + return (EINVAL); + } + port += 4; + } else if (strncmp(argv[0], "rx", 2) == 0) { + port = argv[0][2] - '0'; + if (port < 0 || port > 3) { + warnx("'%c' in %s is invalid", argv[0][2], argv[0]); + return (EINVAL); + } + } else { + warnx("argument '%s' isn't tx<n> or rx<n>", argv[0]); + return (EINVAL); + } + + t.tp.snap_len = 128; + t.tp.min_len = 0; + t.tp.skip_ofst = 0; + t.tp.skip_len = 0; + t.tp.invert = 0; + t.tp.port = port; + + create_tracing_ifnet(); + return doit(CHELSIO_T4_SET_TRACER, &t); +} + +static int +tracer_cmd(int argc, const char *argv[]) +{ + long long val; + uint8_t idx; + char *s; + + if (argc == 0) { + warnx("tracer: no arguments."); + return (EINVAL); + }; + + /* list */ + if (strcmp(argv[0], "list") == 0) { + if (argc != 1) + warnx("trailing arguments after \"list\" ignored."); + + return show_tracers(); + } + + /* <idx> ... */ + s = str_to_number(argv[0], NULL, &val); + if (*s || val > 0xff) { + warnx("\"%s\" is neither an index nor a tracer subcommand.", + argv[0]); + return (EINVAL); + } + idx = (int8_t)val; + + /* <idx> disable */ + if (argc == 2 && strcmp(argv[1], "disable") == 0) + return tracer_onoff(idx, 0); + + /* <idx> enable */ + if (argc == 2 && strcmp(argv[1], "enable") == 0) + return tracer_onoff(idx, 1); + + /* <idx> ... */ + return set_tracer(idx, argc - 1, argv + 1); +} + +static int run_cmd(int argc, const char *argv[]) { int rc = -1; @@ -1687,6 +1887,8 @@ run_cmd(int argc, const char *argv[]) rc = read_i2c(argc, argv); else if (!strcmp(cmd, "clearstats")) rc = clearstats(argc, argv); + else if (!strcmp(cmd, "tracer")) + rc = tracer_cmd(argc, argv); else { rc = EINVAL; warnx("invalid command \"%s\"", cmd); diff --git a/tools/tools/sysdoc/tunables.mdoc b/tools/tools/sysdoc/tunables.mdoc index 35ef9c067238..8b426e66ac9e 100644 --- a/tools/tools/sysdoc/tunables.mdoc +++ b/tools/tools/sysdoc/tunables.mdoc @@ -2259,9 +2259,6 @@ Displays the number of swap devices available to the system. This is a read-only variable. --- -vm.pageout_algorithm - ---- vm.pageout_full_stats_interval --- diff --git a/tools/tools/zfsboottest/Makefile b/tools/tools/zfsboottest/Makefile index c0c7d92c19e9..a04c78fa25e1 100644 --- a/tools/tools/zfsboottest/Makefile +++ b/tools/tools/zfsboottest/Makefile @@ -15,8 +15,7 @@ CFLAGS= -O1 \ -I${.CURDIR}/../../../sys/cddl/boot/zfs \ -I. \ -fdiagnostics-show-option \ - -W -Wextra -Wno-sign-compare -Wno-unused-parameter \ - -Werror + -W -Wextra -Wno-sign-compare -Wno-unused-parameter LDFLAGS+=-lmd .if ${MACHINE_CPUARCH} == "amd64" diff --git a/usr.bin/fetch/fetch.1 b/usr.bin/fetch/fetch.1 index 900c0ee26eee..6053518a8dad 100644 --- a/usr.bin/fetch/fetch.1 +++ b/usr.bin/fetch/fetch.1 @@ -1,5 +1,6 @@ .\"- -.\" Copyright (c) 2000-2011 Dag-Erling Smørgrav +.\" Copyright (c) 2000-2013 Dag-Erling Smørgrav +.\" Copyright (c) 2013 Michael Gmelin <freebsd@grem.de> .\" All rights reserved. .\" Portions Copyright (c) 1999 Massachusetts Institute of Technology; used .\" by permission. @@ -29,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 27, 2011 +.Dd July 30, 2013 .Dt FETCH 1 .Os .Sh NAME @@ -38,22 +39,51 @@ .Sh SYNOPSIS .Nm .Op Fl 146AadFlMmnPpqRrsUv +.Op Fl -allow-sslv2 .Op Fl B Ar bytes +.Op Fl -bind-address= Ns Ar host +.Op Fl -ca-cert= Ns Ar file +.Op Fl -ca-path= Ns Ar dir +.Op Fl -cert= Ns Ar file +.Op Fl -crl= Ns Ar file .Op Fl i Ar file +.Op Fl -key= Ns Ar file .Op Fl N Ar file +.Op Fl -no-passive +.Op Fl -no-proxy= Ns Ar list +.Op Fl -no-sslv3 +.Op Fl -no-tlsv1 +.Op Fl -no-verify-hostname +.Op Fl -no-verify-peer .Op Fl o Ar file +.Op Fl -referer= Ns Ar URL .Op Fl S Ar bytes .Op Fl T Ar seconds +.Op Fl -user-agent= Ns Ar agent-string .Op Fl w Ar seconds .Ar URL ... .Nm .Op Fl 146AadFlMmnPpqRrsUv .Op Fl B Ar bytes +.Op Fl -bind-address= Ns Ar host +.Op Fl -ca-cert= Ns Ar file +.Op Fl -ca-path= Ns Ar dir +.Op Fl -cert= Ns Ar file +.Op Fl -crl= Ns Ar file .Op Fl i Ar file +.Op Fl -key= Ns Ar file .Op Fl N Ar file +.Op Fl -no-passive +.Op Fl -no-proxy= Ns Ar list +.Op Fl -no-sslv3 +.Op Fl -no-tlsv1 +.Op Fl -no-verify-hostname +.Op Fl -no-verify-peer .Op Fl o Ar file +.Op Fl -referer= Ns Ar URL .Op Fl S Ar bytes .Op Fl T Ar seconds +.Op Fl -user-agent= Ns Ar agent-string .Op Fl w Ar seconds .Fl h Ar host Fl f Ar file Oo Fl c Ar dir Oc .Sh DESCRIPTION @@ -67,23 +97,26 @@ command line. .Pp The following options are available: .Bl -tag -width Fl -.It Fl 1 +.It Fl 1 , -one-file Stop and return exit code 0 at the first successfully retrieved file. -.It Fl 4 +.It Fl 4 , -ipv4-only Forces .Nm to use IPv4 addresses only. -.It Fl 6 +.It Fl 6 , -ipv6-only Forces .Nm to use IPv6 addresses only. -.It Fl A +.It Fl A , -no-redirect Do not automatically follow ``temporary'' (302) redirects. Some broken Web sites will return a redirect instead of a not-found error when the requested object does not exist. -.It Fl a +.It Fl a , -retry Automatically retry the transfer upon soft failures. -.It Fl B Ar bytes +.It Fl -allow-sslv2 +[SSL] +Allow SSL version 2 when negotiating the connection. +.It Fl B Ar bytes , Fl -buffer-size= Ns Ar bytes Specify the read buffer size in bytes. The default is 4096 bytes. Attempts to set a buffer size lower than this will be silently @@ -92,15 +125,43 @@ The number of reads actually performed is reported at verbosity level two or higher (see the .Fl v flag). +.It Fl -bind-address= Ns Ar host +Specifies a hostname or IP address to which sockets used for outgoing +connections will be bound. .It Fl c Ar dir The file to retrieve is in directory .Ar dir on the remote host. This option is deprecated and is provided for backward compatibility only. -.It Fl d +.It Fl -ca-cert= Ns Ar file +[SSL] +Path to certificate bundle containing trusted CA certificates. +If not specified, +.Pa /etc/ssl/cert.pem +is used. +The file may contain multiple CA certificates. The port +.Pa security/ca_root_nss +is a common source of a current CA bundle. +.It Fl -ca-path= Ns Ar dir +[SSL] +The directory +.Ar dir +contains trusted CA hashes. +.It Fl -cert= Ns Ar file +[SSL] +.Ar file +is a PEM encoded client certificate/key which will be used in +client certificate authentication. +.It Fl -crl= Ns Ar file +[SSL] +Points to certificate revocation list +.Ar file , +which has to be in PEM format and may contain peer certificates that have +been revoked. +.It Fl d , -direct Use a direct connection even if a proxy is configured. -.It Fl F +.It Fl F , -force-restart In combination with the .Fl r flag, forces a restart even if the local and remote files have @@ -118,17 +179,22 @@ The file to retrieve is located on the host .Ar host . This option is deprecated and is provided for backward compatibility only. -.It Fl i Ar file +.It Fl i Ar file , Fl -if-modified-since= Ns Ar file If-Modified-Since mode: the remote file will only be retrieved if it is newer than .Ar file on the local host. (HTTP only) -.It Fl l +.It Fl -key= Ns Ar file +[SSL] +.Ar file +is a PEM encoded client key that will be used in client certificate +authentication in case key and client certificate are stored separately. +.It Fl l , -symlink If the target is a file-scheme URL, make a symbolic link to the target rather than trying to copy it. .It Fl M -.It Fl m +.It Fl m , -mirror Mirror mode: if the file already exists locally and has the same size and modification time as the remote file, it will not be fetched. Note that the @@ -136,7 +202,7 @@ Note that the and .Fl r flags are mutually exclusive. -.It Fl N Ar file +.It Fl N Ar file , Fl -netrc= Ns Ar file Use .Ar file instead of @@ -146,9 +212,28 @@ See .Xr ftp 1 for a description of the file format. This feature is experimental. -.It Fl n +.It Fl n , -no-mtime Do not preserve the modification time of the transferred file. -.It Fl o Ar file +.It Fl -no-passive +Forces the FTP code to use active mode. +.It Fl -no-proxy= Ns Ar list +Either a single asterisk, which disables the use of proxies +altogether, or a comma- or whitespace-separated list of hosts for +which proxies should not be used. +.It Fl -no-sslv3 +[SSL] +Don't allow SSL version 3 when negotiating the connection. +.It Fl -no-tlsv1 +[SSL] +Don't allow TLS version 1 when negotiating the connection. +.It Fl -no-verify-hostname +[SSL] +Do not verify that the hostname matches the subject of the +certificate presented by the server. +.It Fl -no-verify-peer +[SSL] +Do not verify the peer certificate against trusted CAs. +.It Fl o Ar file , Fl output= Ns Ar file Set the output file name to .Ar file . By default, a ``pathname'' is extracted from the specified URI, and @@ -163,36 +248,45 @@ If the argument is a directory, fetched file(s) will be placed within the directory, with name(s) selected as in the default behaviour. .It Fl P -.It Fl p +.It Fl p , -passive Use passive FTP. These flags have no effect, since passive FTP is the default, but are provided for compatibility with earlier versions where active FTP was the default. -To force active mode, set the +To force active mode, use the +.Fl -no-passive +flag or set the .Ev FTP_PASSIVE_MODE environment variable to .Ql NO . -.It Fl q +.It Fl -referer= Ns Ar URL +Specifies the referrer URL to use for HTTP requests. +If +.Ar URL +is set to +.Dq auto , +the document URL will be used as referrer URL. +.It Fl q , -quiet Quiet mode. -.It Fl R +.It Fl R , -keep-output The output files are precious, and should not be deleted under any circumstances, even if the transfer failed or was incomplete. -.It Fl r +.It Fl r , -restart Restart a previously interrupted transfer. Note that the .Fl m and .Fl r flags are mutually exclusive. -.It Fl S Ar bytes +.It Fl S Ar bytes , Fl -require-size= Ns Ar bytes Require the file size reported by the server to match the specified value. If it does not, a message is printed and the file is not fetched. If the server does not support reporting file sizes, this option is ignored and the file is fetched unconditionally. -.It Fl s +.It Fl s , -print-size Print the size in bytes of each requested file, without fetching it. -.It Fl T Ar seconds +.It Fl T Ar seconds , Fl -timeout= Ns Ar seconds Set timeout value to .Ar seconds . Overrides the environment variables @@ -200,15 +294,19 @@ Overrides the environment variables for FTP transfers or .Ev HTTP_TIMEOUT for HTTP transfers if set. -.It Fl U +.It Fl U , -passive-portrange-default When using passive FTP, allocate the port for the data connection from the low (default) port range. See .Xr ip 4 for details on how to specify which port range this corresponds to. -.It Fl v +.It Fl -user-agent= Ns Ar agent-string +Specifies the User-Agent string to use for HTTP requests. +This can be useful when working with HTTP origin or proxy servers that +differentiate between user agents. +.It Fl v , -verbose Increase verbosity level. -.It Fl w Ar seconds +.It Fl w Ar seconds , Fl -retry-delay= Ns Ar seconds When the .Fl a flag is specified, wait this many seconds between successive retries. @@ -242,6 +340,7 @@ for a description of additional environment variables, including .Ev FTP_PASSWORD , .Ev FTP_PROXY , .Ev ftp_proxy , +.Ev HTTP_ACCEPT , .Ev HTTP_AUTH , .Ev HTTP_PROXY , .Ev http_proxy , @@ -249,8 +348,19 @@ for a description of additional environment variables, including .Ev HTTP_REFERER , .Ev HTTP_USER_AGENT , .Ev NETRC , -.Ev NO_PROXY No and -.Ev no_proxy . +.Ev NO_PROXY , +.Ev no_proxy , +.Ev SSL_ALLOW_SSL2 , +.Ev SSL_CA_CERT_FILE , +.Ev SSL_CA_CERT_PATH , +.Ev SSL_CLIENT_CERT_FILE , +.Ev SSL_CLIENT_KEY_FILE , +.Ev SSL_CRL_FILE , +.Ev SSL_NO_SSL3 , +.Ev SSL_NO_TLS1 , +.Ev SSL_NO_VERIFY_HOSTNAME +and +.Ev SSL_NO_VERIFY_PEER . .Sh EXIT STATUS The .Nm @@ -287,7 +397,9 @@ by and later completely rewritten to use the .Xr fetch 3 library by -.An Dag-Erling Sm\(/orgrav Aq des@FreeBSD.org . +.An Dag-Erling Sm\(/orgrav Aq des@FreeBSD.org +and +.An Michael Gmelin Aq freebsd@grem.de . .Sh NOTES The .Fl b diff --git a/usr.bin/fetch/fetch.c b/usr.bin/fetch/fetch.c index 27211b347280..c61e88e599d3 100644 --- a/usr.bin/fetch/fetch.c +++ b/usr.bin/fetch/fetch.c @@ -1,5 +1,6 @@ /*- * Copyright (c) 2000-2011 Dag-Erling Smørgrav + * Copyright (c) 2013 Michael Gmelin <freebsd@grem.de> * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include <ctype.h> #include <err.h> #include <errno.h> +#include <getopt.h> #include <signal.h> #include <stdint.h> #include <stdio.h> @@ -93,6 +95,78 @@ static long ftp_timeout = TIMEOUT; /* default timeout for FTP transfers */ static long http_timeout = TIMEOUT;/* default timeout for HTTP transfers */ static char *buf; /* transfer buffer */ +enum options +{ + OPTION_BIND_ADDRESS, + OPTION_NO_FTP_PASSIVE_MODE, + OPTION_HTTP_REFERER, + OPTION_HTTP_USER_AGENT, + OPTION_NO_PROXY, + OPTION_SSL_ALLOW_SSL2, + OPTION_SSL_CA_CERT_FILE, + OPTION_SSL_CA_CERT_PATH, + OPTION_SSL_CLIENT_CERT_FILE, + OPTION_SSL_CLIENT_KEY_FILE, + OPTION_SSL_CRL_FILE, + OPTION_SSL_NO_SSL3, + OPTION_SSL_NO_TLS1, + OPTION_SSL_NO_VERIFY_HOSTNAME, + OPTION_SSL_NO_VERIFY_PEER +}; + + +static struct option longopts[] = +{ + /* mapping to single character argument */ + { "one-file", no_argument, NULL, '1' }, + { "ipv4-only", no_argument, NULL, '4' }, + { "ipv6-only", no_argument, NULL, '6' }, + { "no-redirect", no_argument, NULL, 'A' }, + { "retry", no_argument, NULL, 'a' }, + { "buffer-size", required_argument, NULL, 'B' }, + /* -c not mapped, since it's deprecated */ + { "direct", no_argument, NULL, 'd' }, + { "force-restart", no_argument, NULL, 'F' }, + /* -f not mapped, since it's deprecated */ + /* -h not mapped, since it's deprecated */ + { "if-modified-since", required_argument, NULL, 'i' }, + { "symlink", no_argument, NULL, 'l' }, + /* -M not mapped since it's the same as -m */ + { "mirror", no_argument, NULL, 'm' }, + { "netrc", required_argument, NULL, 'N' }, + { "no-mtime", no_argument, NULL, 'n' }, + { "output", required_argument, NULL, 'o' }, + /* -P not mapped since it's the same as -p */ + { "passive", no_argument, NULL, 'p' }, + { "quiet", no_argument, NULL, 'q' }, + { "keep-output", no_argument, NULL, 'R' }, + { "restart", no_argument, NULL, 'r' }, + { "require-size", required_argument, NULL, 'S' }, + { "print-size", no_argument, NULL, 's' }, + { "timeout", required_argument, NULL, 'T' }, + { "passive-portrange-default", no_argument, NULL, 'T' }, + { "verbose", no_argument, NULL, 'v' }, + { "retry-delay", required_argument, NULL, 'w' }, + + /* options without a single character equivalent */ + { "bind-address", required_argument, NULL, OPTION_BIND_ADDRESS }, + { "no-passive", no_argument, NULL, OPTION_NO_FTP_PASSIVE_MODE }, + { "referer", required_argument, NULL, OPTION_HTTP_REFERER }, + { "user-agent", required_argument, NULL, OPTION_HTTP_USER_AGENT }, + { "no-proxy", required_argument, NULL, OPTION_NO_PROXY }, + { "allow-sslv2", no_argument, NULL, OPTION_SSL_ALLOW_SSL2 }, + { "ca-cert", required_argument, NULL, OPTION_SSL_CA_CERT_FILE }, + { "ca-path", required_argument, NULL, OPTION_SSL_CA_CERT_PATH }, + { "cert", required_argument, NULL, OPTION_SSL_CLIENT_CERT_FILE }, + { "key", required_argument, NULL, OPTION_SSL_CLIENT_KEY_FILE }, + { "crl", required_argument, NULL, OPTION_SSL_CRL_FILE }, + { "no-sslv3", no_argument, NULL, OPTION_SSL_NO_SSL3 }, + { "no-tlsv1", no_argument, NULL, OPTION_SSL_NO_TLS1 }, + { "no-verify-hostname", no_argument, NULL, OPTION_SSL_NO_VERIFY_HOSTNAME }, + { "no-verify-peer", no_argument, NULL, OPTION_SSL_NO_VERIFY_PEER }, + + { NULL, 0, NULL, 0 } +}; /* * Signal handler @@ -769,11 +843,19 @@ fetch(char *URL, const char *path) static void usage(void) { - fprintf(stderr, "%s\n%s\n%s\n%s\n", -"usage: fetch [-146AadFlMmnPpqRrsUv] [-B bytes] [-N file] [-o file] [-S bytes]", -" [-T seconds] [-w seconds] [-i file] URL ...", -" fetch [-146AadFlMmnPpqRrsUv] [-B bytes] [-N file] [-o file] [-S bytes]", -" [-T seconds] [-w seconds] [-i file] -h host -f file [-c dir]"); + fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n", +"usage: fetch [-146AadFlMmnPpqRrsUv] [--allow-sslv2] [-B bytes]", +" [--bind-address=host] [--ca-cert=file] [--ca-path=dir] [--cert=file]", +" [--crl=file] [-i file] [--key=file] [-N file] [--no-passive]", +" [--no-proxy=list] [--no-sslv3] [--no-tlsv1] [--no-verify-hostname]", +" [--no-verify-peer] [-o file] [--referer=URL] [-S bytes] [-T seconds]", +" [--user-agent=agent-string] [-w seconds] URL ...", +" fetch [-146AadFlMmnPpqRrsUv] [--allow-sslv2] [-B bytes]", +" [--bind-address=host] [--ca-cert=file] [--ca-path=dir] [--cert=file]", +" [--crl=file] [-i file] [--key=file] [-N file] [--no-passive]", +" [--no-proxy=list] [--no-sslv3] [--no-tlsv1] [--no-verify-hostname]", +" [--no-verify-peer] [-o file] [--referer=URL] [-S bytes] [-T seconds]", +" [--user-agent=agent-string] [-w seconds] -h host -f file [-c dir]"); } @@ -789,8 +871,10 @@ main(int argc, char *argv[]) char *end, *q; int c, e, r; - while ((c = getopt(argc, argv, - "146AaB:bc:dFf:Hh:i:lMmN:nPpo:qRrS:sT:tUvw:")) != -1) + + while ((c = getopt_long(argc, argv, + "146AaB:bc:dFf:Hh:i:lMmN:nPpo:qRrS:sT:tUvw:", + longopts, NULL)) != -1) switch (c) { case '1': once_flag = 1; @@ -904,6 +988,51 @@ main(int argc, char *argv[]) if (*optarg == '\0' || *end != '\0') errx(1, "invalid delay (%s)", optarg); break; + case OPTION_BIND_ADDRESS: + setenv("FETCH_BIND_ADDRESS", optarg, 1); + break; + case OPTION_NO_FTP_PASSIVE_MODE: + setenv("FTP_PASSIVE_MODE", "no", 1); + break; + case OPTION_HTTP_REFERER: + setenv("HTTP_REFERER", optarg, 1); + break; + case OPTION_HTTP_USER_AGENT: + setenv("HTTP_USER_AGENT", optarg, 1); + break; + case OPTION_NO_PROXY: + setenv("NO_PROXY", optarg, 1); + break; + case OPTION_SSL_ALLOW_SSL2: + setenv("SSL_ALLOW_SSL2", "", 1); + break; + case OPTION_SSL_CA_CERT_FILE: + setenv("SSL_CA_CERT_FILE", optarg, 1); + break; + case OPTION_SSL_CA_CERT_PATH: + setenv("SSL_CA_CERT_PATH", optarg, 1); + break; + case OPTION_SSL_CLIENT_CERT_FILE: + setenv("SSL_CLIENT_CERT_FILE", optarg, 1); + break; + case OPTION_SSL_CLIENT_KEY_FILE: + setenv("SSL_CLIENT_KEY_FILE", optarg, 1); + break; + case OPTION_SSL_CRL_FILE: + setenv("SSL_CLIENT_CRL_FILE", optarg, 1); + break; + case OPTION_SSL_NO_SSL3: + setenv("SSL_NO_SSL3", "", 1); + break; + case OPTION_SSL_NO_TLS1: + setenv("SSL_NO_TLS1", "", 1); + break; + case OPTION_SSL_NO_VERIFY_HOSTNAME: + setenv("SSL_NO_VERIFY_HOSTNAME", "", 1); + break; + case OPTION_SSL_NO_VERIFY_PEER: + setenv("SSL_NO_VERIFY_PEER", "", 1); + break; default: usage(); exit(1); diff --git a/usr.bin/grep/regex/tre-fastmatch.c b/usr.bin/grep/regex/tre-fastmatch.c index b7a7c91fbcfd..4b589009bde1 100644 --- a/usr.bin/grep/regex/tre-fastmatch.c +++ b/usr.bin/grep/regex/tre-fastmatch.c @@ -395,7 +395,7 @@ static int fastcmp(const fastmatch_t *fg, const void *data, if (p == NULL) \ return REG_ESPACE; \ for (unsigned int i = 0; i < plen; i++) \ - p[i] = tolower(pat[i]); \ + p[i] = tolower((unsigned char)pat[i]); \ _CALC_BMGS(arr, p, plen); \ xfree(p); \ } \ @@ -1030,7 +1030,7 @@ fastcmp(const fastmatch_t *fg, const void *data, tre_str_type_t type) continue; /* Compare */ - if (fg->icase ? (tolower(pat_byte[i]) == tolower(str_byte[i])) + if (fg->icase ? (tolower((unsigned char)pat_byte[i]) == tolower((unsigned char)str_byte[i])) : (pat_byte[i] == str_byte[i])) continue; } diff --git a/usr.bin/netstat/ipsec.c b/usr.bin/netstat/ipsec.c index 2eb8ee0723cb..b4014ad4d77b 100644 --- a/usr.bin/netstat/ipsec.c +++ b/usr.bin/netstat/ipsec.c @@ -166,84 +166,18 @@ static struct val2str ipsec_compnames[] = { { -1, NULL }, }; -static void ipsec_hist(const u_quad_t *hist, size_t histmax, - const struct val2str *name, const char *title); static void print_ipsecstats(const struct ipsecstat *ipsecstat); - -/* - * Dump IPSEC statistics structure. - */ -static void -ipsec_hist(const u_quad_t *hist, size_t histmax, const struct val2str *name, - const char *title) -{ - int first; - size_t proto; - const struct val2str *p; - - first = 1; - for (proto = 0; proto < histmax; proto++) { - if (hist[proto] <= 0) - continue; - if (first) { - printf("\t%s histogram:\n", title); - first = 0; - } - for (p = name; p && p->str; p++) { - if (p->val == (int)proto) - break; - } - if (p && p->str) { - printf("\t\t%s: %ju\n", p->str, (uintmax_t)hist[proto]); - } else { - printf("\t\t#%ld: %ju\n", (long)proto, - (uintmax_t)hist[proto]); - } - } -} - static void print_ipsecstats(const struct ipsecstat *ipsecstat) { #define p(f, m) if (ipsecstat->f || sflag <= 1) \ printf(m, (uintmax_t)ipsecstat->f, plural(ipsecstat->f)) -#define pes(f, m) if (ipsecstat->f || sflag <= 1) \ - printf(m, (uintmax_t)ipsecstat->f, plurales(ipsecstat->f)) -#define hist(f, n, t) \ - ipsec_hist((f), sizeof(f)/sizeof(f[0]), (n), (t)); - - p(in_success, "\t%ju inbound packet%s processed successfully\n"); - p(in_polvio, "\t%ju inbound packet%s violated process security " - "policy\n"); - p(in_nosa, "\t%ju inbound packet%s with no SA available\n"); - p(in_inval, "\t%ju invalid inbound packet%s\n"); - p(in_nomem, "\t%ju inbound packet%s failed due to insufficient memory\n"); - p(in_badspi, "\t%ju inbound packet%s failed getting SPI\n"); - p(in_ahreplay, "\t%ju inbound packet%s failed on AH replay check\n"); - p(in_espreplay, "\t%ju inbound packet%s failed on ESP replay check\n"); - p(in_ahauthsucc, "\t%ju inbound packet%s considered authentic\n"); - p(in_ahauthfail, "\t%ju inbound packet%s failed on authentication\n"); - hist(ipsecstat->in_ahhist, ipsec_ahnames, "AH input"); - hist(ipsecstat->in_esphist, ipsec_espnames, "ESP input"); - hist(ipsecstat->in_comphist, ipsec_compnames, "IPComp input"); - - p(out_success, "\t%ju outbound packet%s processed successfully\n"); - p(out_polvio, "\t%ju outbound packet%s violated process security " - "policy\n"); - p(out_nosa, "\t%ju outbound packet%s with no SA available\n"); - p(out_inval, "\t%ju invalid outbound packet%s\n"); - p(out_nomem, "\t%ju outbound packet%s failed due to insufficient memory\n"); - p(out_noroute, "\t%ju outbound packet%s with no route\n"); - hist(ipsecstat->out_ahhist, ipsec_ahnames, "AH output"); - hist(ipsecstat->out_esphist, ipsec_espnames, "ESP output"); - hist(ipsecstat->out_comphist, ipsec_compnames, "IPComp output"); - p(spdcachelookup, "\t%ju SPD cache lookup%s\n"); - pes(spdcachemiss, "\t%ju SPD cache miss%s\n"); -#undef pes -#undef hist p(ips_in_polvio, "\t%ju inbound packet%s violated process " "security policy\n"); + p(ips_in_nomem, "\t%ju inbound packet%s failed due to " + "insufficient memory\n"); + p(ips_in_inval, "\t%ju invalid inbound packet%s\n"); p(ips_out_polvio, "\t%ju outbound packet%s violated process " "security policy\n"); p(ips_out_nosa, "\t%ju outbound packet%s with no SA available\n"); diff --git a/usr.bin/patch/Makefile b/usr.bin/patch/Makefile index 382a05fc0e54..18261f677dfe 100644 --- a/usr.bin/patch/Makefile +++ b/usr.bin/patch/Makefile @@ -3,14 +3,14 @@ .include <bsd.own.mk> -.if ${MK_BSD_PATCH} == "yes" -PROG= patch -.else +.if ${MK_GNU_PATCH} == "yes" PROG= bsdpatch CLEANFILES+= bsdpatch.1 bsdpatch.1: patch.1 cp ${.ALLSRC} ${.TARGET} +.else +PROG= patch .endif SRCS= backupfile.c inp.c mkpath.c patch.c pch.c util.c diff --git a/usr.bin/patch/patch.c b/usr.bin/patch/patch.c index d008c0f5aecb..956482cb38f1 100644 --- a/usr.bin/patch/patch.c +++ b/usr.bin/patch/patch.c @@ -239,8 +239,10 @@ main(int argc, char *argv[]) if (!skip_rest_of_patch) scan_input(filearg[0]); - /* from here on, open no standard i/o files, because malloc */ - /* might misfire and we can't catch it easily */ + /* + * from here on, open no standard i/o files, because + * malloc might misfire and we can't catch it easily + */ /* apply each hunk of patch */ hunk = 0; diff --git a/usr.bin/script/script.1 b/usr.bin/script/script.1 index a142482071b8..9b8efcd8af36 100644 --- a/usr.bin/script/script.1 +++ b/usr.bin/script/script.1 @@ -178,7 +178,7 @@ and options first appeared in .Nx 2.0 and were ported to -.Fx 10.0 . +.Fx 9.2 . .Sh BUGS The .Nm diff --git a/usr.bin/svn/lib/libapr_util/Makefile b/usr.bin/svn/lib/libapr_util/Makefile index 4d82443b4e6a..4f25e8f5bfac 100644 --- a/usr.bin/svn/lib/libapr_util/Makefile +++ b/usr.bin/svn/lib/libapr_util/Makefile @@ -10,10 +10,10 @@ SRCS= apr_base64.c apr_brigade.c apr_buckets.c apr_buckets_alloc.c \ apr_buckets_heap.c apr_buckets_mmap.c apr_buckets_pipe.c \ apr_buckets_pool.c apr_buckets_refcount.c apr_buckets_simple.c \ apr_buckets_socket.c apr_crypto.c apr_date.c apr_dbd.c \ - apr_hooks.c apr_md4.c apr_md5.c apr_memcache.c \ + apr_hooks.c apr_md4.c apr_md5.c apr_memcache.c apr_passwd.c \ apr_queue.c apr_reslist.c apr_rmm.c apr_sha1.c apr_strmatch.c \ apr_thread_pool.c apr_uri.c apr_xml.c apu_dso.c apu_version.c \ - getuuid.c uuid.c xlate.c + crypt_blowfish.c getuuid.c uuid.c xlate.c .PATH: ${APRU}/buckets ${APRU}/crypto ${APRU}/dbd \ ${APRU}/encoding ${APRU}/hooks \ diff --git a/usr.bin/svn/lib/libapr_util/apu.h b/usr.bin/svn/lib/libapr_util/apu.h index ea090bf51b95..639cec46f9d9 100644 --- a/usr.bin/svn/lib/libapr_util/apu.h +++ b/usr.bin/svn/lib/libapr_util/apu.h @@ -43,6 +43,7 @@ * conventions at compile time. */ +#if defined(DOXYGEN) || !defined(WIN32) /** * The public APR-UTIL functions are declared with APU_DECLARE(), so they may * use the most appropriate calling convention. Public APR functions with @@ -67,6 +68,19 @@ * declarations within headers to properly import the variable. */ #define APU_DECLARE_DATA +#elif defined(APU_DECLARE_STATIC) +#define APU_DECLARE(type) type __stdcall +#define APU_DECLARE_NONSTD(type) type __cdecl +#define APU_DECLARE_DATA +#elif defined(APU_DECLARE_EXPORT) +#define APU_DECLARE(type) __declspec(dllexport) type __stdcall +#define APU_DECLARE_NONSTD(type) __declspec(dllexport) type __cdecl +#define APU_DECLARE_DATA __declspec(dllexport) +#else +#define APU_DECLARE(type) __declspec(dllimport) type __stdcall +#define APU_DECLARE_NONSTD(type) __declspec(dllimport) type __cdecl +#define APU_DECLARE_DATA __declspec(dllimport) +#endif #if !defined(WIN32) || defined(APU_MODULE_DECLARE_STATIC) /** diff --git a/usr.bin/svn/svn_private_config.h b/usr.bin/svn/svn_private_config.h index b08ac7af9ed3..00eb0fc5d5e7 100644 --- a/usr.bin/svn/svn_private_config.h +++ b/usr.bin/svn/svn_private_config.h @@ -105,7 +105,7 @@ #define PACKAGE_NAME "subversion" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "subversion 1.8.0" +#define PACKAGE_STRING "subversion 1.8.1" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "subversion" @@ -114,7 +114,7 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "1.8.0" +#define PACKAGE_VERSION "1.8.1" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -129,10 +129,10 @@ #define SVN_BINDIR "/usr/bin" /* Defined to the config.guess name of the build system */ -#define SVN_BUILD_HOST "bikeshed-violet-magenta-aqua-freebsd" +#define SVN_BUILD_HOST "bikeshed-green-indigo-orange-freebsd" /* Defined to the config.guess name of the build target */ -#define SVN_BUILD_TARGET "bikeshed-violet-magenta-aqua-freebsd" +#define SVN_BUILD_TARGET "bikeshed-green-indigo-orange-freebsd" /* The path of a default editor for the client. */ /* #undef SVN_CLIENT_EDITOR */ diff --git a/usr.bin/truss/syscall.h b/usr.bin/truss/syscall.h index 49ff9a44a519..94776a0dddb9 100644 --- a/usr.bin/truss/syscall.h +++ b/usr.bin/truss/syscall.h @@ -40,7 +40,7 @@ enum Argtype { None = 1, Hex, Octal, Int, Name, Ptr, Stat, Ioctl, Quad, Fd_set, Sigaction, Fcntl, Mprot, Mmapflags, Whence, Readlinkres, Umtx, Sigset, Sigprocmask, Kevent, Sockdomain, Socktype, Open, Fcntlflag, Rusage, BinString, Shutdown, Resource, Rlimit, Timeval2, - Pathconf }; + Pathconf, Rforkflags }; #define ARG_MASK 0xff #define OUT 0x100 diff --git a/usr.bin/truss/syscalls.c b/usr.bin/truss/syscalls.c index 1a9c4de04bc4..6668d7ce0836 100644 --- a/usr.bin/truss/syscalls.c +++ b/usr.bin/truss/syscalls.c @@ -93,6 +93,9 @@ static struct syscall syscalls[] = { { .name = "fcntl", .ret_type = 1, .nargs = 3, .args = { { Int, 0 } , { Fcntl, 1 }, { Fcntlflag | OUT, 2 } } }, { .name = "fork", .ret_type = 1, .nargs = 0 }, + { .name = "vfork", .ret_type = 1, .nargs = 0 }, + { .name = "rfork", .ret_type = 1, .nargs = 1, + .args = { { Rforkflags, 0 } } }, { .name = "getegid", .ret_type = 1, .nargs = 0 }, { .name = "geteuid", .ret_type = 1, .nargs = 0 }, { .name = "getgid", .ret_type = 1, .nargs = 0 }, @@ -369,6 +372,11 @@ static struct xlat pathconf_arg[] = { XEND }; +static struct xlat rfork_flags[] = { + X(RFPROC) X(RFNOWAIT) X(RFFDG) X(RFCFDG) X(RFTHREAD) X(RFMEM) + X(RFSIGSHARE) X(RFTSIGZMB) X(RFLINUXTHPN) XEND +}; + #undef X #undef XEND @@ -906,6 +914,9 @@ print_arg(struct syscall_args *sc, unsigned long *args, long retval, case Pathconf: tmp = strdup(xlookup(pathconf_arg, args[sc->offset])); break; + case Rforkflags: + tmp = strdup(xlookup_bits(rfork_flags, args[sc->offset])); + break; case Sockaddr: { struct sockaddr_storage ss; char addr[64]; diff --git a/usr.sbin/bsdconfig/include/messages.subr b/usr.sbin/bsdconfig/include/messages.subr index 1dc8f954aa67..1c558f20653b 100644 --- a/usr.sbin/bsdconfig/include/messages.subr +++ b/usr.sbin/bsdconfig/include/messages.subr @@ -42,7 +42,7 @@ msg_all_desc="All available packages in all categories." msg_always_try_sudo_when_run_as="Always try sudo(8) when run as %s" msg_arabic_desc="Ported software for Arab countries." msg_archivers_desc="Utilities for archiving and unarchiving data." -msg_argentina="Argentina" +msg_armenia="Armenia" msg_assume_network_is_already_configured="Running multi-user, assume that the network is already configured?" msg_assume_yes_to_all_non_critical_dialogs="Assume \"Yes\" answers to all non-critical dialogs" msg_astro_desc="Applications related to astronomy." @@ -92,7 +92,6 @@ msg_couldnt_connect_to_proxy="Couldn't connect to proxy" msg_couldnt_connect_to_server="Couldn't connect to server" msg_couldnt_open_ftp_connection="Couldn't open FTP connection to %s:\n %s." msg_created_path="Created %s" -msg_croatia="Croatia" msg_czech_republic="Czech Republic" msg_databases_desc="Database software." msg_debugging="Debugging" @@ -154,7 +153,6 @@ msg_hostname_variable_not_set="WARNING: hostname variable not set and is a non-o msg_http_direct="HTTP Direct" msg_http_proxy="HTTP Proxy" msg_hungarian_desc="Ported software for the Hungarian market." -msg_hungary="Hungary" msg_iceland="Iceland" msg_install_from_a_dos_partition="Install from a DOS partition" msg_install_from_a_floppy_disk_set="Install from a floppy disk set" @@ -195,6 +193,7 @@ msg_kld_desc="Kernel loadable modules." msg_korea="Korea" msg_korean_desc="Ported software for the Korean market." msg_lang_desc="Computer languages." +msg_latvia="Latvia" msg_length_of_specified_url_is_too_long="Length of specified URL is %u characters. Allowable maximum is %u." msg_linux_desc="Linux programs that can run under binary compatibility." msg_lisp_desc="Software related to the Lisp language." @@ -226,6 +225,7 @@ msg_netherlands="Netherlands" msg_netmask="Netmask" msg_network_configuration="Network Configuration" msg_network_interface_information_required="Network interface information required" +msg_new_zealand="New Zealand" msg_news_desc="USENET News support software." msg_next_page="Next page" msg_nfailed_attempts="%u incorrect password attempts" @@ -298,7 +298,6 @@ msg_please_specify_url_of_freebsd_http_distribution="Please specify the URL of a msg_poland="Poland" msg_polish_desc="Ported software for the Polish market." msg_ports_mgmt_desc="Utilities for managing ports and packages." -msg_portugal="Portugal" msg_portuguese_desc="Ported software for the Portuguese market." msg_previous_page="Previous page" msg_previous_syntax_errors="%s: Not overwriting \`%s' due to previous syntax errors" @@ -323,7 +322,6 @@ msg_review="Review" msg_review_desc="Review/perform pending actions" msg_review_help="Install, Re-Install, or Un-install selected packages and dependencies" msg_reviewing_selected_packages="Reviewing %u selected packages:" -msg_romania="Romania" msg_ruby_desc="Software related to the Ruby language." msg_rubygems_desc="Ports of RubyGems packages." msg_russia="Russia" @@ -340,11 +338,8 @@ msg_select_a_site_thats_close="Select a site that's close!" msg_selected="selected" msg_server_error_when_requesting_url="Server error when requesting %s, you could try an other server" msg_shells_desc="Various shells (tcsh, bash, etc)." -msg_singapore="Singapore" msg_slovak_republic="Slovak Republic" msg_slovenia="Slovenia" -msg_snapshots_server_japan="Snapshots Server Japan" -msg_snapshots_server_sweden="Snapshots Server Sweden" msg_sorry_invalid_url="Sorry, %s is an invalid URL!" msg_sorry_package_was_not_found_in_the_index="Sorry, package %s was not found in the INDEX." msg_sorry_try_again="Sorry, try again." @@ -365,7 +360,6 @@ msg_tk_desc="Tk and packages that depend on it." msg_try_dhcp_configuration="Do you want to try DHCP configuration of the interface?" msg_try_ipv6_configuration="Do you want to try IPv6 configuration of the interface?" msg_try_sudo_only_this_once="Try sudo(8) only this once" -msg_turkey="Turkey" msg_ufs="UFS" msg_uk="UK" msg_ukraine="Ukraine" diff --git a/usr.sbin/bsdconfig/share/media/ftp.subr b/usr.sbin/bsdconfig/share/media/ftp.subr index 638584c25d02..dfdff26bc9a3 100644 --- a/usr.sbin/bsdconfig/share/media/ftp.subr +++ b/usr.sbin/bsdconfig/share/media/ftp.subr @@ -75,14 +75,12 @@ f_dialog_menu_media_ftp() local menu_list=" '$msg_main_site' 'ftp.freebsd.org' 'URL' '$msg_specify_some_other_ftp_site' - '$msg_snapshots_server_japan' - 'snapshots.jp.freebsd.org' - '$msg_snapshots_server_sweden' - 'snapshots.se.freebsd.org' 'IPv6 $msg_main_site' 'ftp.freebsd.org' + ' IPv6 $msg_france' 'ftp4.fr.freebsd.org' + ' IPv6 $msg_france #8' 'ftp8.fr.freebsd.org' ' IPv6 $msg_ireland' 'ftp3.ie.freebsd.org' - ' IPv6 $msg_israel' 'ftp.il.freebsd.org' ' IPv6 $msg_japan' 'ftp2.jp.freebsd.org' + ' IPv6 $msg_sweden' 'ftp4.se.freebsd.org' ' IPv6 $msg_usa' 'ftp4.us.freebsd.org' ' IPv6 $msg_turkey' 'ftp2.tr.freebsd.org' '$msg_primary' 'ftp1.freebsd.org' @@ -92,44 +90,34 @@ f_dialog_menu_media_ftp() ' $msg_primary #5' 'ftp5.freebsd.org' ' $msg_primary #6' 'ftp6.freebsd.org' ' $msg_primary #7' 'ftp7.freebsd.org' - ' $msg_primary #8' 'ftp8.freebsd.org' - ' $msg_primary #9' 'ftp9.freebsd.org' ' $msg_primary #10' 'ftp10.freebsd.org' ' $msg_primary #11' 'ftp11.freebsd.org' ' $msg_primary #12' 'ftp12.freebsd.org' ' $msg_primary #13' 'ftp13.freebsd.org' ' $msg_primary #14' 'ftp14.freebsd.org' - '$msg_argentina' 'ftp.ar.freebsd.org' + '$msg_armenia' 'ftp1.am.freebsd.org' '$msg_australia' 'ftp.au.freebsd.org' ' $msg_australia #2' 'ftp2.au.freebsd.org' ' $msg_australia #3' 'ftp3.au.freebsd.org' '$msg_austria' 'ftp.at.freebsd.org' - ' $msg_austria #2' 'ftp2.at.freebsd.org' - '$msg_brazil' 'ftp.br.freebsd.org' - ' $msg_brazil #2' 'ftp2.br.freebsd.org' + '$msg_brazil' 'ftp2.br.freebsd.org' ' $msg_brazil #3' 'ftp3.br.freebsd.org' ' $msg_brazil #4' 'ftp4.br.freebsd.org' - ' $msg_brazil #5' 'ftp5.br.freebsd.org' - ' $msg_brazil #6' 'ftp6.br.freebsd.org' - ' $msg_brazil #7' 'ftp7.br.freebsd.org' '$msg_canada' 'ftp.ca.freebsd.org' '$msg_china' 'ftp.cn.freebsd.org' - ' $msg_china #2' 'ftp2.cn.freebsd.org' - '$msg_croatia' 'ftp.hr.freebsd.org' '$msg_czech_republic' 'ftp.cz.freebsd.org' '$msg_denmark' 'ftp.dk.freebsd.org' - ' $msg_denmark #2' 'ftp2.dk.freebsd.org' '$msg_estonia' 'ftp.ee.freebsd.org' '$msg_finland' 'ftp.fi.freebsd.org' '$msg_france' 'ftp.fr.freebsd.org' - ' $msg_france #2' 'ftp2.fr.freebsd.org' ' $msg_france #3' 'ftp3.fr.freebsd.org' + ' $msg_france #4' 'ftp4.fr.freebsd.org' ' $msg_france #5' 'ftp5.fr.freebsd.org' ' $msg_france #6' 'ftp6.fr.freebsd.org' + ' $msg_france #7' 'ftp7.fr.freebsd.org' ' $msg_france #8' 'ftp8.fr.freebsd.org' '$msg_germany' 'ftp.de.freebsd.org' ' $msg_germany #2' 'ftp2.de.freebsd.org' - ' $msg_germany #3' 'ftp3.de.freebsd.org' ' $msg_germany #4' 'ftp4.de.freebsd.org' ' $msg_germany #5' 'ftp5.de.freebsd.org' ' $msg_germany #6' 'ftp6.de.freebsd.org' @@ -137,11 +125,8 @@ f_dialog_menu_media_ftp() ' $msg_germany #8' 'ftp8.de.freebsd.org' '$msg_greece' 'ftp.gr.freebsd.org' ' $msg_greece #2' 'ftp2.gr.freebsd.org' - '$msg_hungary' 'ftp.hu.freebsd.org' '$msg_iceland' 'ftp.is.freebsd.org' - '$msg_ireland' 'ftp.ie.freebsd.org' - ' $msg_ireland #2' 'ftp2.ie.freebsd.org' - ' $msg_ireland #3' 'ftp3.ie.freebsd.org' + '$msg_ireland' 'ftp3.ie.freebsd.org' '$msg_israel' 'ftp.il.freebsd.org' '$msg_italy' 'ftp.it.freebsd.org' '$msg_japan' 'ftp.jp.freebsd.org' @@ -155,72 +140,56 @@ f_dialog_menu_media_ftp() ' $msg_japan #9' 'ftp9.jp.freebsd.org' '$msg_korea' 'ftp.kr.freebsd.org' ' $msg_korea #2' 'ftp2.kr.freebsd.org' + '$msg_latvia' 'ftp.lv.freebsd.org' '$msg_lithuania' 'ftp.lt.freebsd.org' '$msg_netherlands' 'ftp.nl.freebsd.org' ' $msg_netherlands #2' 'ftp2.nl.freebsd.org' + '$msg_new_zealand' 'ftp.nz.freebsd.org' '$msg_norway' 'ftp.no.freebsd.org' - ' $msg_norway #3' 'ftp3.no.freebsd.org' '$msg_poland' 'ftp.pl.freebsd.org' ' $msg_poland #2' 'ftp2.pl.freebsd.org' - ' $msg_poland #5' 'ftp5.pl.freebsd.org' - '$msg_portugal' 'ftp.pt.freebsd.org' - ' $msg_portugal #2' 'ftp2.pt.freebsd.org' - ' $msg_portugal #4' 'ftp4.pt.freebsd.org' - '$msg_romania' 'ftp.ro.freebsd.org' '$msg_russia' 'ftp.ru.freebsd.org' ' $msg_russia #2' 'ftp2.ru.freebsd.org' - ' $msg_russia #3' 'ftp3.ru.freebsd.org' ' $msg_russia #4' 'ftp4.ru.freebsd.org' - '$msg_singapore' 'ftp.sg.freebsd.org' + ' $msg_russia #5' 'ftp5.ru.freebsd.org' + ' $msg_russia #6' 'ftp6.ru.freebsd.org' '$msg_slovak_republic' 'ftp.sk.freebsd.org' + ' $msg_slovak_republic #2' 'ftp2.sk.freebsd.org' '$msg_slovenia' 'ftp.si.freebsd.org' - ' $msg_slovenia #2' 'ftp2.si.freebsd.org' '$msg_south_africa' 'ftp.za.freebsd.org' ' $msg_south_africa #2' 'ftp2.za.freebsd.org' - ' $msg_south_africa #3' 'ftp3.za.freebsd.org' ' $msg_south_africa #4' 'ftp4.za.freebsd.org' '$msg_spain' 'ftp.es.freebsd.org' - ' $msg_spain #2' 'ftp2.es.freebsd.org' ' $msg_spain #3' 'ftp3.es.freebsd.org' '$msg_sweden' 'ftp.se.freebsd.org' ' $msg_sweden #2' 'ftp2.se.freebsd.org' ' $msg_sweden #3' 'ftp3.se.freebsd.org' ' $msg_sweden #4' 'ftp4.se.freebsd.org' ' $msg_sweden #5' 'ftp5.se.freebsd.org' + ' $msg_sweden #6' 'ftp6.se.freebsd.org' '$msg_switzerland' 'ftp.ch.freebsd.org' - ' $msg_switzerland #2' 'ftp2.ch.freebsd.org' '$msg_taiwan' 'ftp.tw.freebsd.org' ' $msg_taiwan #2' 'ftp2.tw.freebsd.org' ' $msg_taiwan #3' 'ftp3.tw.freebsd.org' ' $msg_taiwan #4' 'ftp4.tw.freebsd.org' ' $msg_taiwan #6' 'ftp6.tw.freebsd.org' ' $msg_taiwan #11' 'ftp11.tw.freebsd.org' - '$msg_turkey' 'ftp.tr.freebsd.org' - ' $msg_turkey #2' 'ftp2.tr.freebsd.org' '$msg_uk' 'ftp.uk.freebsd.org' ' $msg_uk #2' 'ftp2.uk.freebsd.org' ' $msg_uk #3' 'ftp3.uk.freebsd.org' ' $msg_uk #4' 'ftp4.uk.freebsd.org' ' $msg_uk #5' 'ftp5.uk.freebsd.org' - ' $msg_uk #6' 'ftp6.uk.freebsd.org' '$msg_ukraine' 'ftp.ua.freebsd.org' - ' $msg_ukraine #2' 'ftp2.ua.freebsd.org' - ' $msg_ukraine #5' 'ftp5.ua.freebsd.org' - ' $msg_ukraine #6' 'ftp6.ua.freebsd.org' ' $msg_ukraine #7' 'ftp7.ua.freebsd.org' - ' $msg_ukraine #8' 'ftp8.ua.freebsd.org' '$msg_usa #1' 'ftp1.us.freebsd.org' ' $msg_usa #2' 'ftp2.us.freebsd.org' ' $msg_usa #3' 'ftp3.us.freebsd.org' ' $msg_usa #4' 'ftp4.us.freebsd.org' ' $msg_usa #5' 'ftp5.us.freebsd.org' ' $msg_usa #6' 'ftp6.us.freebsd.org' - ' $msg_usa #7' 'ftp7.us.freebsd.org' ' $msg_usa #8' 'ftp8.us.freebsd.org' - ' $msg_usa #9' 'ftp9.us.freebsd.org' ' $msg_usa #10' 'ftp10.us.freebsd.org' ' $msg_usa #11' 'ftp11.us.freebsd.org' - ' $msg_usa #12' 'ftp12.us.freebsd.org' ' $msg_usa #13' 'ftp13.us.freebsd.org' ' $msg_usa #14' 'ftp14.us.freebsd.org' ' $msg_usa #15' 'ftp15.us.freebsd.org' diff --git a/usr.sbin/bsdinstall/scripts/mirrorselect b/usr.sbin/bsdinstall/scripts/mirrorselect index 30df8309e95c..aa6c97279aa9 100755 --- a/usr.sbin/bsdinstall/scripts/mirrorselect +++ b/usr.sbin/bsdinstall/scripts/mirrorselect @@ -41,7 +41,6 @@ MIRROR=`dialog --backtitle "FreeBSD Installer" \ ftp://ftp.freebsd.org "Main Site"\ ftp://ftp.freebsd.org "IPv6 Main Site"\ ftp://ftp3.ie.freebsd.org "IPv6 Ireland"\ - ftp://ftp.il.freebsd.org "IPv6 Israel"\ ftp://ftp2.jp.freebsd.org "IPv6 Japan"\ ftp://ftp4.se.freebsd.org "IPv6 Sweden"\ ftp://ftp4.us.freebsd.org "IPv6 USA"\ @@ -53,45 +52,34 @@ MIRROR=`dialog --backtitle "FreeBSD Installer" \ ftp://ftp5.freebsd.org "Primary #5"\ ftp://ftp6.freebsd.org "Primary #6"\ ftp://ftp7.freebsd.org "Primary #7"\ - ftp://ftp8.freebsd.org "Primary #8"\ - ftp://ftp9.freebsd.org "Primary #9"\ ftp://ftp10.freebsd.org "Primary #10"\ ftp://ftp11.freebsd.org "Primary #11"\ ftp://ftp12.freebsd.org "Primary #12"\ ftp://ftp13.freebsd.org "Primary #13"\ ftp://ftp14.freebsd.org "Primary #14"\ - ftp://ftp.ar.freebsd.org "Argentina"\ + ftp://ftp1.am.freebsd.org "Armenia"\ ftp://ftp.au.freebsd.org "Australia"\ ftp://ftp2.au.freebsd.org "Australia #2"\ ftp://ftp3.au.freebsd.org "Australia #3"\ ftp://ftp.at.freebsd.org "Austria"\ - ftp://ftp2.at.freebsd.org "Austria #2"\ - ftp://ftp.br.freebsd.org "Brazil"\ ftp://ftp2.br.freebsd.org "Brazil #2"\ ftp://ftp3.br.freebsd.org "Brazil #3"\ ftp://ftp4.br.freebsd.org "Brazil #4"\ - ftp://ftp5.br.freebsd.org "Brazil #5"\ - ftp://ftp6.br.freebsd.org "Brazil #6"\ - ftp://ftp7.br.freebsd.org "Brazil #7"\ ftp://ftp.ca.freebsd.org "Canada"\ ftp://ftp.cn.freebsd.org "China"\ - ftp://ftp2.cn.freebsd.org "China #2"\ - ftp://ftp.hr.freebsd.org "Croatia"\ ftp://ftp.cz.freebsd.org "Czech Republic"\ ftp://ftp.dk.freebsd.org "Denmark"\ - ftp://ftp2.dk.freebsd.org "Denmark #2"\ ftp://ftp.ee.freebsd.org "Estonia"\ ftp://ftp.fi.freebsd.org "Finland"\ ftp://ftp.fr.freebsd.org "France"\ - ftp://ftp2.fr.freebsd.org "IPv6 France #2"\ ftp://ftp3.fr.freebsd.org "France #3"\ ftp://ftp4.fr.freebsd.org "IPv6 France #4"\ ftp://ftp5.fr.freebsd.org "France #5"\ ftp://ftp6.fr.freebsd.org "France #6"\ + ftp://ftp7.fr.freebsd.org "France #7"\ ftp://ftp8.fr.freebsd.org "IPv6 France #8"\ ftp://ftp.de.freebsd.org "Germany"\ ftp://ftp2.de.freebsd.org "Germany #2"\ - ftp://ftp3.de.freebsd.org "Germany #3"\ ftp://ftp4.de.freebsd.org "Germany #4"\ ftp://ftp5.de.freebsd.org "Germany #5"\ ftp://ftp6.de.freebsd.org "Germany #6"\ @@ -99,10 +87,7 @@ MIRROR=`dialog --backtitle "FreeBSD Installer" \ ftp://ftp8.de.freebsd.org "Germany #8"\ ftp://ftp.gr.freebsd.org "Greece"\ ftp://ftp2.gr.freebsd.org "Greece #2"\ - ftp://ftp.hu.freebsd.org "Hungary"\ ftp://ftp.is.freebsd.org "Iceland"\ - ftp://ftp.ie.freebsd.org "Ireland"\ - ftp://ftp2.ie.freebsd.org "Ireland #2"\ ftp://ftp3.ie.freebsd.org "Ireland #3"\ ftp://ftp.il.freebsd.org "Israel"\ ftp://ftp.it.freebsd.org "Italy"\ @@ -117,32 +102,26 @@ MIRROR=`dialog --backtitle "FreeBSD Installer" \ ftp://ftp9.jp.freebsd.org "Japan #9"\ ftp://ftp.kr.freebsd.org "Korea"\ ftp://ftp2.kr.freebsd.org "Korea #2"\ + ftp://ftp.lv.freebsd.org "Latvia"\ ftp://ftp.lt.freebsd.org "Lithuania"\ ftp://ftp.nl.freebsd.org "Netherlands"\ ftp://ftp2.nl.freebsd.org "Netherlands #2"\ + ftp://ftp.nz.freebsd.org "New Zealand"\ ftp://ftp.no.freebsd.org "Norway"\ - ftp://ftp3.no.freebsd.org "Norway #3"\ ftp://ftp.pl.freebsd.org "Poland"\ ftp://ftp2.pl.freebsd.org "Poland #2"\ - ftp://ftp5.pl.freebsd.org "Poland #5"\ - ftp://ftp.pt.freebsd.org "Portugal"\ - ftp://ftp2.pt.freebsd.org "Portugal #2"\ - ftp://ftp4.pt.freebsd.org "Portugal #4"\ - ftp://ftp.ro.freebsd.org "Romania"\ ftp://ftp.ru.freebsd.org "Russia"\ ftp://ftp2.ru.freebsd.org "Russia #2"\ - ftp://ftp3.ru.freebsd.org "Russia #3"\ ftp://ftp4.ru.freebsd.org "Russia #4"\ - ftp://ftp.sg.freebsd.org "Singapore"\ + ftp://ftp5.ru.freebsd.org "Russia #5"\ + ftp://ftp6.ru.freebsd.org "Russia #6"\ ftp://ftp.sk.freebsd.org "Slovak Republic"\ + ftp://ftp2.sk.freebsd.org "Slovak Republic #2"\ ftp://ftp.si.freebsd.org "Slovenia"\ - ftp://ftp2.si.freebsd.org "Slovenia #2"\ ftp://ftp.za.freebsd.org "South Africa"\ ftp://ftp2.za.freebsd.org "South Africa #2"\ - ftp://ftp3.za.freebsd.org "South Africa #3"\ ftp://ftp4.za.freebsd.org "South Africa #4"\ ftp://ftp.es.freebsd.org "Spain"\ - ftp://ftp2.es.freebsd.org "Spain #2"\ ftp://ftp3.es.freebsd.org "Spain #3"\ ftp://ftp.se.freebsd.org "Sweden"\ ftp://ftp2.se.freebsd.org "Sweden #2"\ @@ -151,39 +130,28 @@ MIRROR=`dialog --backtitle "FreeBSD Installer" \ ftp://ftp5.se.freebsd.org "Sweden #5"\ ftp://ftp6.se.freebsd.org "Sweden #6"\ ftp://ftp.ch.freebsd.org "Switzerland"\ - ftp://ftp2.ch.freebsd.org "Switzerland #2"\ ftp://ftp.tw.freebsd.org "Taiwan"\ ftp://ftp2.tw.freebsd.org "Taiwan #2"\ ftp://ftp3.tw.freebsd.org "Taiwan #3"\ ftp://ftp4.tw.freebsd.org "Taiwan #4"\ ftp://ftp6.tw.freebsd.org "Taiwan #6"\ ftp://ftp11.tw.freebsd.org "Taiwan #11"\ - ftp://ftp.tr.freebsd.org "Turkey"\ - ftp://ftp2.tr.freebsd.org "Turkey #2"\ ftp://ftp.uk.freebsd.org "UK"\ ftp://ftp2.uk.freebsd.org "UK #2"\ ftp://ftp3.uk.freebsd.org "UK #3"\ ftp://ftp4.uk.freebsd.org "UK #4"\ ftp://ftp5.uk.freebsd.org "UK #5"\ - ftp://ftp6.uk.freebsd.org "UK #6"\ ftp://ftp.ua.freebsd.org "Ukraine"\ - ftp://ftp2.ua.freebsd.org "Ukraine #2"\ - ftp://ftp5.ua.freebsd.org "Ukraine #5"\ - ftp://ftp6.ua.freebsd.org "Ukraine #6"\ ftp://ftp7.ua.freebsd.org "Ukraine #7"\ - ftp://ftp8.ua.freebsd.org "Ukraine #8"\ ftp://ftp1.us.freebsd.org "USA #1"\ ftp://ftp2.us.freebsd.org "USA #2"\ ftp://ftp3.us.freebsd.org "USA #3"\ ftp://ftp4.us.freebsd.org "USA #4"\ ftp://ftp5.us.freebsd.org "USA #5"\ ftp://ftp6.us.freebsd.org "USA #6"\ - ftp://ftp7.us.freebsd.org "USA #7"\ ftp://ftp8.us.freebsd.org "USA #8"\ - ftp://ftp9.us.freebsd.org "USA #9"\ ftp://ftp10.us.freebsd.org "USA #10"\ ftp://ftp11.us.freebsd.org "USA #11"\ - ftp://ftp12.us.freebsd.org "USA #12"\ ftp://ftp13.us.freebsd.org "USA #13"\ ftp://ftp14.us.freebsd.org "USA #14"\ ftp://ftp15.us.freebsd.org "USA #15"\ diff --git a/usr.sbin/makefs/cd9660.c b/usr.sbin/makefs/cd9660.c index 2b33446d055c..f0e2f3867121 100644 --- a/usr.sbin/makefs/cd9660.c +++ b/usr.sbin/makefs/cd9660.c @@ -230,7 +230,7 @@ cd9660_set_defaults(void) memset(diskStructure.primaryDescriptor.abstract_file_id, 0x20,37); memset(diskStructure.primaryDescriptor.bibliographic_file_id, 0x20,37); - strcpy(diskStructure.primaryDescriptor.system_id,"NetBSD"); + strcpy(diskStructure.primaryDescriptor.system_id, "FreeBSD"); cd9660_defaults_set = 1; @@ -681,7 +681,8 @@ cd9660_finalize_PVD(void) cd9660_set_date(diskStructure.primaryDescriptor.expiration_date, now); */ - memset(diskStructure.primaryDescriptor.expiration_date, '0' ,17); + memset(diskStructure.primaryDescriptor.expiration_date, '0', 16); + diskStructure.primaryDescriptor.expiration_date[16] = 0; cd9660_time_8426( (unsigned char *)diskStructure.primaryDescriptor.effective_date, tim); diff --git a/usr.sbin/makefs/cd9660/iso9660_rrip.c b/usr.sbin/makefs/cd9660/iso9660_rrip.c index 39e0acfe0443..40acf40c9b09 100644 --- a/usr.sbin/makefs/cd9660/iso9660_rrip.c +++ b/usr.sbin/makefs/cd9660/iso9660_rrip.c @@ -1,4 +1,4 @@ -/* $NetBSD: iso9660_rrip.c,v 1.10 2011/05/29 17:07:58 tsutsui Exp $ */ +/* $NetBSD: iso9660_rrip.c,v 1.11 2012/04/29 13:32:21 joerg Exp $ */ /* * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan @@ -419,9 +419,9 @@ cd9660_rrip_initialize_node(cd9660node *node, cd9660node *parent, } else if ((node->node != NULL) && ((strlen(node->node->name) != - (int)node->isoDirRecord->name_len[0]) || + (uint8_t)node->isoDirRecord->name_len[0]) || (memcmp(node->node->name,node->isoDirRecord->name, - (int) node->isoDirRecord->name_len[0]) != 0))) { + (uint8_t)node->isoDirRecord->name_len[0]) != 0))) { cd9660_rrip_NM(node); } @@ -685,7 +685,7 @@ int cd9660node_rrip_tf(struct ISO_SUSP_ATTRIBUTES *p, fsnode *_node) { p->attr.rr_entry.TF.flags[0] = TF_MODIFY | TF_ACCESS | TF_ATTRIBUTES; - p->attr.rr_entry.TF.h.length[0] = 4; + p->attr.rr_entry.TF.h.length[0] = 5; p->attr.rr_entry.TF.h.version[0] = 1; /* diff --git a/usr.sbin/makefs/ffs/ufs_bswap.h b/usr.sbin/makefs/ffs/ufs_bswap.h index c3682556bdf4..6e7cc422cab1 100644 --- a/usr.sbin/makefs/ffs/ufs_bswap.h +++ b/usr.sbin/makefs/ffs/ufs_bswap.h @@ -40,6 +40,8 @@ #include <sys/endian.h> +#include "makefs.h" + /* Macros to access UFS flags */ #ifdef FFS_EI #define UFS_MPNEEDSWAP(mp) (VFSTOUFS(mp)->um_flags & UFS_NEEDSWAP) diff --git a/usr.sbin/pkg/config.c b/usr.sbin/pkg/config.c index 5924d57b5897..142fd1bb7378 100644 --- a/usr.sbin/pkg/config.c +++ b/usr.sbin/pkg/config.c @@ -108,7 +108,7 @@ pkg_get_myabi(char *dest, size_t sz) Elf_Note note; Elf_Scn *scn; char *src, *osname; - const char *abi; + const char *abi, *fpu; GElf_Ehdr elfhdr; GElf_Shdr shdr; int fd, i, ret; @@ -187,13 +187,25 @@ pkg_get_myabi(char *dest, size_t sz) switch (elfhdr.e_machine) { case EM_ARM: + /* FreeBSD doesn't support the hard-float ABI yet */ + fpu = "softfp"; + if ((elfhdr.e_flags & 0xFF000000) != 0) { + /* This is an EABI file, the conformance level is set */ + abi = "eabi"; + } else if (elfhdr.e_ident[EI_OSABI] != ELFOSABI_NONE) { + /* + * EABI executables all have this field set to + * ELFOSABI_NONE, therefore it must be an oabi file. + */ + abi = "oabi"; + } else { + ret = 1; + goto cleanup; + } snprintf(dest + strlen(dest), sz - strlen(dest), ":%s:%s:%s", elf_corres_to_string(endian_corres, (int)elfhdr.e_ident[EI_DATA]), - (elfhdr.e_flags & EF_ARM_NEW_ABI) > 0 ? - "eabi" : "oabi", - (elfhdr.e_flags & EF_ARM_VFP_FLOAT) > 0 ? - "softfp" : "vfp"); + abi, fpu); break; case EM_MIPS: /* diff --git a/usr.sbin/watchdogd/watchdogd.8 b/usr.sbin/watchdogd/watchdogd.8 index b8a550516437..6176a2066741 100644 --- a/usr.sbin/watchdogd/watchdogd.8 +++ b/usr.sbin/watchdogd/watchdogd.8 @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 5, 2013 +.Dd July 27, 2013 .Dt WATCHDOGD 8 .Os .Sh NAME @@ -115,7 +115,7 @@ will terminate. The .Nm utility recognizes the following runtime options: -.Bl -tag -width ".Fl -softtimeout-action Ar action " +.Bl -tag -width 30m .It Fl I Ar file Write the process ID of the .Nm @@ -208,6 +208,96 @@ device for .Bl -tag -width ".Pa /var/run/watchdogd.pid" -compact .It Pa /var/run/watchdogd.pid .El +.Sh EXAMPLES +.Ss Debugging watchdogd and/or your watchdog script. +This is a useful recipe for debugging +.Nm +and your watchdog script. +.Pp +(Note that ^C works oddly because +.Nm +calls +.Xr system 3 +so the +first ^C will terminate the "sleep" command.) +.Pp +Explanation of options used: +.Bl -enum -offset indent -compact +.It +Set Debug on (--debug) +.It +Set the watchdog to trip at 30 seconds. (-t 30) +.It +Use of a softtimeout: +.Bl -enum -offset indent -compact -nested +.It +Use a softtimeout (do not arm the hardware watchdog). +(--softtimeout) +.It +Set the softtimeout action to do both kernel +.Xr printf 9 +and +.Xr log 9 +when it trips. +(--softtimeout-action log,printf) +.El +.It +Use of a pre-timeout: +.Bl -enum -offset indent -compact -nested +.It +Set a pre-timeout of 15 seconds (this will later trigger a panic/dump). +(--pretimeout 15) +.It +Set the action to also kernel +.Xr printf 9 +and +.Xr log 9 +when it trips. +(--pretimeout-action log,printf) +.El +.It +Use of a script: +.Bl -enum -offset indent -compact -nested +.It +Run "sleep 60" as a shell command that acts as the watchdog (-e 'sleep 60') +.It +Warn us when the script takes longer than 1 second to run (-w) +.El +.El +.Bd -literal +watchdogd --debug -t 30 \\ + --softtimeout --softtimeout-action log,printf \\ + --pretimeout 15 --pretimeout-action log,printf \\ + -e 'sleep 60' -w +.Ed +.Ss Production use of example +.Bl -enum -offset indent -compact +.It +Set hard timeout to 120 seconds (-t 120) +.It +Set a panic to happen at 60 seconds (to trigger a +.Xr crash 8 +for dump analysis): +.Bl -enum -offset indent -compact -nested +.It +Use of pre-timeout (--pretimeout 60) +.It +Specify pre-timeout action (--pretimeout-action log,printf,panic ) +.El +.It +Use of a script: +.Bl -enum -offset indent -compact -nested +.It +Run your script (-e '/path/to/your/script 60') +.It +Log if your script takes a longer than 15 seconds to run time. (-w -T 15) +.El +.El +.Bd -literal +watchdogd -t 120 \\ + --pretimeout 60 --pretimeout-action log,printf,panic \\ + -e '/path/to/your/script 60' -w -T 15 +.Ed .Sh SEE ALSO .Xr watchdog 4 , .Xr watchdog 8 , diff --git a/usr.sbin/watchdogd/watchdogd.c b/usr.sbin/watchdogd/watchdogd.c index 5416751d4cc3..9b4440c3b497 100644 --- a/usr.sbin/watchdogd/watchdogd.c +++ b/usr.sbin/watchdogd/watchdogd.c @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include <sys/rtprio.h> #include <sys/stat.h> #include <sys/time.h> +#include <sys/sysctl.h> #include <sys/watchdog.h> #include <err.h> @@ -49,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include <paths.h> #include <signal.h> #include <stdio.h> +#include <stdint.h> #include <stdlib.h> #include <string.h> #include <strings.h> @@ -58,19 +60,24 @@ __FBSDID("$FreeBSD$"); #include <getopt.h> +static long fetchtimeout(int opt, const char *longopt, const char *myoptarg); static void parseargs(int, char *[]); +static int seconds_to_pow2ns(int); static void sighandler(int); static void watchdog_loop(void); static int watchdog_init(void); static int watchdog_onoff(int onoff); static int watchdog_patpat(u_int timeout); static void usage(void); +static int tstotv(struct timeval *tv, struct timespec *ts); +static int tvtohz(struct timeval *tv); static int debugging = 0; static int end_program = 0; static const char *pidfile = _PATH_VARRUN "watchdogd.pid"; static u_int timeout = WD_TO_128SEC; static u_int pretimeout = 0; +static u_int timeout_sec; static u_int passive = 0; static int is_daemon = 0; static int is_dry_run = 0; /* do not arm the watchdog, only @@ -183,6 +190,59 @@ main(int argc, char *argv[]) } } +static void +pow2ns_to_ts(int pow2ns, struct timespec *ts) +{ + uint64_t ns; + + ns = 1ULL << pow2ns; + ts->tv_sec = ns / 1000000000ULL; + ts->tv_nsec = ns % 1000000000ULL; +} + +/* + * Convert a timeout in seconds to N where 2^N nanoseconds is close to + * "seconds". + * + * The kernel expects the timeouts for watchdogs in "2^N nanosecond format". + */ +static u_int +parse_timeout_to_pow2ns(char opt, const char *longopt, const char *myoptarg) +{ + double a; + u_int rv; + struct timespec ts; + struct timeval tv; + int ticks; + char shortopt[] = "- "; + + if (!longopt) + shortopt[1] = opt; + + a = fetchtimeout(opt, longopt, myoptarg); + + if (a == 0) + rv = WD_TO_NEVER; + else + rv = seconds_to_pow2ns(a); + pow2ns_to_ts(rv, &ts); + tstotv(&tv, &ts); + ticks = tvtohz(&tv); + if (debugging) { + printf("Timeout for %s%s " + "is 2^%d nanoseconds " + "(in: %s sec -> out: %jd sec %ld ns -> %d ticks)\n", + longopt ? "-" : "", longopt ? longopt : shortopt, + rv, + myoptarg, (intmax_t)ts.tv_sec, ts.tv_nsec, ticks); + } + if (ticks <= 0) { + errx(1, "Timeout for %s%s is too small, please choose a higher timeout.", longopt ? "-" : "", longopt ? longopt : shortopt); + } + + return (rv); +} + /* * Catch signals and begin shutdown process. */ @@ -513,6 +573,110 @@ timeout_act_str2int(const char *lopt, const char *acts) return rv; } +int +tstotv(struct timeval *tv, struct timespec *ts) +{ + + tv->tv_sec = ts->tv_sec; + tv->tv_usec = ts->tv_nsec / 1000; + return 0; +} + +/* + * Convert a timeval to a number of ticks. + * Mostly copied from the kernel. + */ +int +tvtohz(struct timeval *tv) +{ + register unsigned long ticks; + register long sec, usec; + int hz; + size_t hzsize; + int error; + int tick; + + hzsize = sizeof(hz); + + error = sysctlbyname("kern.hz", &hz, &hzsize, NULL, 0); + if (error) + err(1, "sysctlbyname kern.hz"); + + tick = 1000000 / hz; + + /* + * If the number of usecs in the whole seconds part of the time + * difference fits in a long, then the total number of usecs will + * fit in an unsigned long. Compute the total and convert it to + * ticks, rounding up and adding 1 to allow for the current tick + * to expire. Rounding also depends on unsigned long arithmetic + * to avoid overflow. + * + * Otherwise, if the number of ticks in the whole seconds part of + * the time difference fits in a long, then convert the parts to + * ticks separately and add, using similar rounding methods and + * overflow avoidance. This method would work in the previous + * case but it is slightly slower and assumes that hz is integral. + * + * Otherwise, round the time difference down to the maximum + * representable value. + * + * If ints have 32 bits, then the maximum value for any timeout in + * 10ms ticks is 248 days. + */ + sec = tv->tv_sec; + usec = tv->tv_usec; + if (usec < 0) { + sec--; + usec += 1000000; + } + if (sec < 0) { +#ifdef DIAGNOSTIC + if (usec > 0) { + sec++; + usec -= 1000000; + } + printf("tvotohz: negative time difference %ld sec %ld usec\n", + sec, usec); +#endif + ticks = 1; + } else if (sec <= LONG_MAX / 1000000) + ticks = (sec * 1000000 + (unsigned long)usec + (tick - 1)) + / tick + 1; + else if (sec <= LONG_MAX / hz) + ticks = sec * hz + + ((unsigned long)usec + (tick - 1)) / tick + 1; + else + ticks = LONG_MAX; + if (ticks > INT_MAX) + ticks = INT_MAX; + return ((int)ticks); +} + +static int +seconds_to_pow2ns(int seconds) +{ + uint64_t power; + uint64_t ns; + uint64_t shifted; + + if (seconds <= 0) + errx(1, "seconds %d < 0", seconds); + ns = ((uint64_t)seconds) * 1000000000ULL; + power = flsll(ns); + shifted = 1ULL << power; + if (shifted <= ns) { + power++; + } + if (debugging) { + printf("shifted %lld\n", (long long)shifted); + printf("seconds_to_pow2ns: seconds: %d, ns %lld, power %d\n", + seconds, (long long)ns, (int)power); + } + return (power); +} + + /* * Handle the few command line arguments supported. */ @@ -521,9 +685,7 @@ parseargs(int argc, char *argv[]) { int longindex; int c; - char *p; const char *lopt; - double a; /* * if we end with a 'd' aka 'watchdogd' then we are the daemon program, @@ -565,21 +727,11 @@ parseargs(int argc, char *argv[]) do_syslog = 0; break; case 't': - p = NULL; - errno = 0; - a = strtod(optarg, &p); - if ((p != NULL && *p != '\0') || errno != 0) - errx(EX_USAGE, "-t argument is not a number"); - if (a < 0) - errx(EX_USAGE, "-t argument must be positive"); - - if (a == 0) - timeout = WD_TO_NEVER; - else - timeout = flsll(a * 1e9); - if (debugging) - printf("Timeout is 2^%d nanoseconds\n", - timeout); + timeout_sec = atoi(optarg); + timeout = parse_timeout_to_pow2ns(c, NULL, optarg); + if (debugging) + printf("Timeout is 2^%d nanoseconds\n", + timeout); break; case 'T': carp_thresh_seconds = fetchtimeout(c, "NULL", optarg); @@ -618,4 +770,15 @@ parseargs(int argc, char *argv[]) errx(EX_USAGE, "extra arguments."); if (is_daemon && timeout < WD_TO_1SEC) errx(EX_USAGE, "-t argument is less than one second."); + if (pretimeout_set) { + struct timespec ts; + + pow2ns_to_ts(timeout, &ts); + if (pretimeout >= (uintmax_t)ts.tv_sec) { + errx(EX_USAGE, + "pretimeout (%d) >= timeout (%d -> %ld)\n" + "see manual section TIMEOUT RESOLUTION", + pretimeout, timeout_sec, (long)ts.tv_sec); + } + } } |
