MFC
This commit is contained in:
commit
5519971c21
2
Makefile
2
Makefile
@ -19,7 +19,7 @@
|
||||
# kernel - buildkernel + installkernel.
|
||||
# kernel-toolchain - Builds the subset of world necessary to build a kernel
|
||||
# doxygen - Build API documentation of the kernel, needs doxygen.
|
||||
# update - Convenient way to update your source tree (cvs).
|
||||
# update - Convenient way to update your source tree(s).
|
||||
# check-old - List obsolete directories/files/libraries.
|
||||
# check-old-dirs - List obsolete directories.
|
||||
# check-old-files - List obsolete files.
|
||||
|
@ -12,6 +12,7 @@
|
||||
# -DNO_KERNELOBJ do not run ${MAKE} obj in ${MAKE} buildkernel
|
||||
# -DNO_PORTSUPDATE do not update ports in ${MAKE} update
|
||||
# -DNO_DOCUPDATE do not update doc in ${MAKE} update
|
||||
# -DNO_WWWUPDATE do not update www in ${MAKE} update
|
||||
# -DNO_CTF do not run the DTrace CTF conversion tools on built objects
|
||||
# LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list
|
||||
# TARGET="machine" to crossbuild world for a different machine type
|
||||
@ -904,7 +905,7 @@ doxygen:
|
||||
#
|
||||
# update
|
||||
#
|
||||
# Update the source tree, by running cvsup and/or running cvs to update to the
|
||||
# Update the source tree(s), by running cvsup/cvs/svn to update to the
|
||||
# latest copy.
|
||||
#
|
||||
update:
|
||||
@ -927,6 +928,9 @@ update:
|
||||
.if defined(DOCSUPFILE) && !defined(NO_DOCUPDATE)
|
||||
@${SUP} ${SUPFLAGS} ${DOCSUPFILE}
|
||||
.endif
|
||||
.if defined(WWWSUPFILE) && !defined(NO_WWWUPDATE)
|
||||
@${SUP} ${SUPFLAGS} ${WWWSUPFILE}
|
||||
.endif
|
||||
.endif
|
||||
.if defined(CVS_UPDATE)
|
||||
@cd ${.CURDIR} ; \
|
||||
|
12
UPDATING
12
UPDATING
@ -52,6 +52,18 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9.x IS SLOW:
|
||||
20110513:
|
||||
Support for sun4v architecture is officially dropped
|
||||
|
||||
20110503:
|
||||
Several KPI breaking changes have been committed to the mii(4) layer,
|
||||
the PHY drivers and consequently some Ethernet drivers using mii(4).
|
||||
This means that miibus.ko and the modules of the affected Ethernet
|
||||
drivers need to be recompiled.
|
||||
|
||||
Note to kernel developers: Given that the OUI bit reversion problem
|
||||
was fixed as part of these changes all mii(4) commits related to OUIs,
|
||||
i.e. to sys/dev/mii/miidevs, PHY driver probing and vendor specific
|
||||
handling, no longer can be merged verbatim to stable/8 and previous
|
||||
branches.
|
||||
|
||||
20110430:
|
||||
Users of the Atheros AR71xx SoC code now need to add 'device ar71xx_pci'
|
||||
into their kernel configurations along with 'device pci'.
|
||||
|
@ -140,7 +140,7 @@ evalcmd(int argc, char **argv)
|
||||
STPUTC('\0', concat);
|
||||
p = grabstackstr(concat);
|
||||
}
|
||||
evalstring(p, builtin_flags & EV_TESTED);
|
||||
evalstring(p, builtin_flags);
|
||||
} else
|
||||
exitstatus = 0;
|
||||
return exitstatus;
|
||||
@ -386,6 +386,14 @@ evalcase(union node *n, int flags)
|
||||
for (cp = n->ncase.cases ; cp && evalskip == 0 ; cp = cp->nclist.next) {
|
||||
for (patp = cp->nclist.pattern ; patp ; patp = patp->narg.next) {
|
||||
if (casematch(patp, arglist.list->text)) {
|
||||
while (cp->nclist.next &&
|
||||
cp->type == NCLISTFALLTHRU) {
|
||||
if (evalskip != 0)
|
||||
break;
|
||||
evaltree(cp->nclist.body,
|
||||
flags & ~EV_EXIT);
|
||||
cp = cp->nclist.next;
|
||||
}
|
||||
if (evalskip == 0) {
|
||||
evaltree(cp->nclist.body, flags);
|
||||
}
|
||||
@ -886,14 +894,13 @@ evalcommand(union node *cmd, int flags, struct backcmd *backcmd)
|
||||
}
|
||||
|
||||
/* Fork off a child process if necessary. */
|
||||
if (cmd->ncmd.backgnd
|
||||
|| ((cmdentry.cmdtype == CMDNORMAL || cmdentry.cmdtype == CMDUNKNOWN)
|
||||
if (((cmdentry.cmdtype == CMDNORMAL || cmdentry.cmdtype == CMDUNKNOWN)
|
||||
&& ((flags & EV_EXIT) == 0 || have_traps()))
|
||||
|| ((flags & EV_BACKCMD) != 0
|
||||
&& (cmdentry.cmdtype != CMDBUILTIN ||
|
||||
!safe_builtin(cmdentry.u.index, argc, argv)))) {
|
||||
jp = makejob(cmd, 1);
|
||||
mode = cmd->ncmd.backgnd;
|
||||
mode = FORK_FG;
|
||||
if (flags & EV_BACKCMD) {
|
||||
mode = FORK_NOJOB;
|
||||
if (pipe(pip) < 0)
|
||||
@ -908,6 +915,7 @@ evalcommand(union node *cmd, int flags, struct backcmd *backcmd)
|
||||
dup2(pip[1], 1);
|
||||
close(pip[1]);
|
||||
}
|
||||
flags &= ~EV_BACKCMD;
|
||||
}
|
||||
flags |= EV_EXIT;
|
||||
}
|
||||
@ -1059,8 +1067,7 @@ evalcommand(union node *cmd, int flags, struct backcmd *backcmd)
|
||||
backcmd->fd = pip[0];
|
||||
close(pip[1]);
|
||||
backcmd->jp = jp;
|
||||
} else
|
||||
exitstatus = 0;
|
||||
}
|
||||
|
||||
out:
|
||||
if (lastarg)
|
||||
|
@ -50,6 +50,7 @@ TPIPE 0 "|"
|
||||
TLP 0 "("
|
||||
TRP 1 ")"
|
||||
TENDCASE 1 ";;"
|
||||
TFALLTHRU 1 ";&"
|
||||
TREDIR 0 redirection
|
||||
TWORD 0 word
|
||||
TIF 0 "if"
|
||||
|
@ -56,7 +56,6 @@ NSEMI nbinary # two commands separated by a semicolon
|
||||
|
||||
NCMD ncmd # a simple command
|
||||
type int
|
||||
backgnd int # set to run command in background
|
||||
args nodeptr # the arguments
|
||||
redirect nodeptr # list of file redirections
|
||||
|
||||
@ -96,12 +95,13 @@ NCASE ncase # a case statement
|
||||
expr nodeptr # the word to switch on
|
||||
cases nodeptr # the list of cases (NCLIST nodes)
|
||||
|
||||
NCLIST nclist # a case
|
||||
NCLIST nclist # a case ending with ;;
|
||||
type int
|
||||
next nodeptr # the next case in list
|
||||
pattern nodeptr # list of patterns for this case
|
||||
body nodeptr # code to execute for this case
|
||||
|
||||
NCLISTFALLTHRU nclist # a case ending with ;&
|
||||
|
||||
NDEFUN narg # define a function. The "next" field contains
|
||||
# the body of the function.
|
||||
|
@ -62,8 +62,9 @@ struct shparam {
|
||||
#define privileged optlist[15].val
|
||||
#define Tflag optlist[16].val
|
||||
#define Pflag optlist[17].val
|
||||
#define hflag optlist[18].val
|
||||
|
||||
#define NOPTS 18
|
||||
#define NOPTS 19
|
||||
|
||||
struct optent {
|
||||
const char *name;
|
||||
@ -91,6 +92,7 @@ struct optent optlist[NOPTS] = {
|
||||
{ "privileged", 'p', 0 },
|
||||
{ "trapsasync", 'T', 0 },
|
||||
{ "physical", 'P', 0 },
|
||||
{ "trackall", 'h', 0 },
|
||||
};
|
||||
#else
|
||||
extern struct optent optlist[NOPTS];
|
||||
|
@ -240,8 +240,8 @@ list(int nlflag, int erflag)
|
||||
n2 = andor();
|
||||
tok = readtoken();
|
||||
if (tok == TBACKGND) {
|
||||
if (n2->type == NCMD || n2->type == NPIPE) {
|
||||
n2->ncmd.backgnd = 1;
|
||||
if (n2->type == NPIPE) {
|
||||
n2->npipe.backgnd = 1;
|
||||
} else if (n2->type == NREDIR) {
|
||||
n2->type = NBACKGND;
|
||||
} else {
|
||||
@ -542,10 +542,13 @@ TRACE(("expecting DO got %s %s\n", tokname[got], got == TWORD ? wordtext : ""));
|
||||
|
||||
checkkwd = CHKNL | CHKKWD | CHKALIAS;
|
||||
if ((t = readtoken()) != TESAC) {
|
||||
if (t != TENDCASE)
|
||||
synexpect(TENDCASE);
|
||||
if (t == TENDCASE)
|
||||
;
|
||||
else if (t == TFALLTHRU)
|
||||
cp->type = NCLISTFALLTHRU;
|
||||
else
|
||||
checkkwd = CHKNL | CHKKWD, readtoken();
|
||||
synexpect(TENDCASE);
|
||||
checkkwd = CHKNL | CHKKWD, readtoken();
|
||||
}
|
||||
cpp = &cp->nclist.next;
|
||||
}
|
||||
@ -686,7 +689,6 @@ simplecmd(union node **rpp, union node *redir)
|
||||
*rpp = NULL;
|
||||
n = (union node *)stalloc(sizeof (struct ncmd));
|
||||
n->type = NCMD;
|
||||
n->ncmd.backgnd = 0;
|
||||
n->ncmd.args = args;
|
||||
n->ncmd.redirect = redir;
|
||||
return n;
|
||||
@ -931,8 +933,11 @@ xxreadtoken(void)
|
||||
pungetc();
|
||||
RETURN(TPIPE);
|
||||
case ';':
|
||||
if (pgetc() == ';')
|
||||
c = pgetc();
|
||||
if (c == ';')
|
||||
RETURN(TENDCASE);
|
||||
else if (c == '&')
|
||||
RETURN(TFALLTHRU);
|
||||
pungetc();
|
||||
RETURN(TSEMI);
|
||||
case '(':
|
||||
|
13
bin/sh/sh.1
13
bin/sh/sh.1
@ -32,7 +32,7 @@
|
||||
.\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd June 15, 2011
|
||||
.Dd June 18, 2011
|
||||
.Dt SH 1
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -241,6 +241,10 @@ tested, all commands of the function are considered to be tested as
|
||||
well.
|
||||
.It Fl f Li noglob
|
||||
Disable pathname expansion.
|
||||
.It Fl h Li trackall
|
||||
A do-nothing option for
|
||||
.Tn POSIX
|
||||
compliance.
|
||||
.It Fl I Li ignoreeof
|
||||
Ignore
|
||||
.Dv EOF Ap s
|
||||
@ -372,7 +376,7 @@ The following is a list of valid operators:
|
||||
.It Control operators:
|
||||
.Bl -column "XXX" "XXX" "XXX" "XXX" "XXX" -offset center -compact
|
||||
.It Li & Ta Li && Ta Li ( Ta Li ) Ta Li \en
|
||||
.It Li ;; Ta Li ; Ta Li | Ta Li ||
|
||||
.It Li ;; Ta Li ;& Ta Li ; Ta Li | Ta Li ||
|
||||
.El
|
||||
.It Redirection operators:
|
||||
.Bl -column "XXX" "XXX" "XXX" "XXX" "XXX" -offset center -compact
|
||||
@ -990,6 +994,11 @@ described later),
|
||||
separated by
|
||||
.Ql \&|
|
||||
characters.
|
||||
If the selected list is terminated by the control operator
|
||||
.Ql ;&
|
||||
instead of
|
||||
.Ql ;; ,
|
||||
execution continues with the next list.
|
||||
The exit code of the
|
||||
.Ic case
|
||||
command is the exit code of the last command executed in the list or
|
||||
|
13
bin/sh/var.c
13
bin/sh/var.c
@ -612,6 +612,12 @@ showvarscmd(int argc __unused, char **argv __unused)
|
||||
|
||||
qsort(vars, n, sizeof(*vars), var_compare);
|
||||
for (i = 0; i < n; i++) {
|
||||
/*
|
||||
* Skip improper variable names so the output remains usable as
|
||||
* shell input.
|
||||
*/
|
||||
if (!isassignment(vars[i]))
|
||||
continue;
|
||||
s = strchr(vars[i], '=');
|
||||
s++;
|
||||
outbin(vars[i], s - vars[i], out1);
|
||||
@ -683,6 +689,13 @@ exportcmd(int argc, char **argv)
|
||||
for (vp = *vpp ; vp ; vp = vp->next) {
|
||||
if (vp->flags & flag) {
|
||||
if (values) {
|
||||
/*
|
||||
* Skip improper variable names
|
||||
* so the output remains usable
|
||||
* as shell input.
|
||||
*/
|
||||
if (!isassignment(vp->text))
|
||||
continue;
|
||||
out1str(cmdname);
|
||||
out1c(' ');
|
||||
}
|
||||
|
@ -45,6 +45,7 @@
|
||||
#include <assert.h>
|
||||
#include <libgen.h>
|
||||
#include <limits.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <dt_impl.h>
|
||||
|
||||
@ -811,15 +812,14 @@ dt_basename(char *str)
|
||||
ulong_t
|
||||
dt_popc(ulong_t x)
|
||||
{
|
||||
#ifdef _ILP32
|
||||
#if defined(_ILP32)
|
||||
x = x - ((x >> 1) & 0x55555555UL);
|
||||
x = (x & 0x33333333UL) + ((x >> 2) & 0x33333333UL);
|
||||
x = (x + (x >> 4)) & 0x0F0F0F0FUL;
|
||||
x = x + (x >> 8);
|
||||
x = x + (x >> 16);
|
||||
return (x & 0x3F);
|
||||
#endif
|
||||
#ifdef _LP64
|
||||
#elif defined(_LP64)
|
||||
x = x - ((x >> 1) & 0x5555555555555555ULL);
|
||||
x = (x & 0x3333333333333333ULL) + ((x >> 2) & 0x3333333333333333ULL);
|
||||
x = (x + (x >> 4)) & 0x0F0F0F0F0F0F0F0FULL;
|
||||
@ -827,6 +827,8 @@ dt_popc(ulong_t x)
|
||||
x = x + (x >> 16);
|
||||
x = x + (x >> 32);
|
||||
return (x & 0x7F);
|
||||
#else
|
||||
/* This should be a #warning but for now ignore error. Err: "need td_popc() implementation" */
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -958,7 +960,7 @@ dtrace_uaddr2str(dtrace_hdl_t *dtp, pid_t pid,
|
||||
P = dt_proc_grab(dtp, pid, PGRAB_RDONLY | PGRAB_FORCE, 0);
|
||||
|
||||
if (P == NULL) {
|
||||
(void) snprintf(c, sizeof (c), "0x%llx", addr);
|
||||
(void) snprintf(c, sizeof (c), "0x%jx", (uintmax_t)addr);
|
||||
return (dt_string2str(c, str, nbytes));
|
||||
}
|
||||
|
||||
@ -976,10 +978,10 @@ dtrace_uaddr2str(dtrace_hdl_t *dtp, pid_t pid,
|
||||
(void) snprintf(c, sizeof (c), "%s`%s", obj, name);
|
||||
}
|
||||
} else if (Pobjname(P, addr, objname, sizeof (objname)) != 0) {
|
||||
(void) snprintf(c, sizeof (c), "%s`0x%llx",
|
||||
dt_basename(objname), addr);
|
||||
(void) snprintf(c, sizeof (c), "%s`0x%jx",
|
||||
dt_basename(objname), (uintmax_t)addr);
|
||||
} else {
|
||||
(void) snprintf(c, sizeof (c), "0x%llx", addr);
|
||||
(void) snprintf(c, sizeof (c), "0x%jx", (uintmax_t)addr);
|
||||
}
|
||||
|
||||
dt_proc_unlock(dtp, P);
|
||||
|
@ -3240,7 +3240,7 @@ coff_compute_section_file_positions (bfd * abfd)
|
||||
incremented in coff_set_section_contents. This is right for
|
||||
SVR3.2. */
|
||||
if (strcmp (current->name, _LIB) == 0)
|
||||
bfd_set_section_vma (abfd, current, 0);
|
||||
(void) bfd_set_section_vma (abfd, current, 0);
|
||||
#endif
|
||||
|
||||
previous = current;
|
||||
|
@ -231,7 +231,7 @@ bfd_fopen (const char *filename, const char *target, const char *mode, int fd)
|
||||
then it may have been opened with special flags that make it
|
||||
unsafe to close and reopen the file. */
|
||||
if (fd == -1)
|
||||
bfd_set_cacheable (nbfd, TRUE);
|
||||
(void) bfd_set_cacheable (nbfd, TRUE);
|
||||
|
||||
return nbfd;
|
||||
}
|
||||
|
@ -607,7 +607,7 @@ pe_ILF_make_a_section (pe_ILF_vars * vars,
|
||||
|
||||
bfd_set_section_flags (vars->abfd, sec, flags | extra_flags);
|
||||
|
||||
bfd_set_section_alignment (vars->abfd, sec, 2);
|
||||
(void) bfd_set_section_alignment (vars->abfd, sec, 2);
|
||||
|
||||
/* Check that we will not run out of space. */
|
||||
BFD_ASSERT (vars->data + size < vars->bim->buffer + vars->bim->size);
|
||||
|
@ -1636,7 +1636,7 @@ obj_elf_init_stab_section (segT seg)
|
||||
|
||||
/* Force the section to align to a longword boundary. Without this,
|
||||
UnixWare ar crashes. */
|
||||
bfd_set_section_alignment (stdoutput, seg, 2);
|
||||
(void) bfd_set_section_alignment (stdoutput, seg, 2);
|
||||
|
||||
/* Make space for this first symbol. */
|
||||
p = frag_more (12);
|
||||
|
@ -146,7 +146,7 @@ frag_new (int old_frags_var_max_size
|
||||
|
||||
/* This will align the obstack so the next struct we allocate on it
|
||||
will begin at a correct boundary. */
|
||||
obstack_finish (&frchain_now->frch_obstack);
|
||||
(void) obstack_finish (&frchain_now->frch_obstack);
|
||||
frchP = frchain_now;
|
||||
know (frchP);
|
||||
former_last_fragP = frchP->frch_last;
|
||||
|
@ -67,7 +67,7 @@ subseg_change (register segT seg, register int subseg)
|
||||
{
|
||||
seginfo = xcalloc (1, sizeof (*seginfo));
|
||||
seginfo->bfd_section = seg;
|
||||
bfd_set_section_userdata (stdoutput, seg, seginfo);
|
||||
(void) bfd_set_section_userdata (stdoutput, seg, seginfo);
|
||||
}
|
||||
}
|
||||
|
||||
@ -169,7 +169,7 @@ subseg_get (const char *segname, int force_new)
|
||||
secptr->output_section = secptr;
|
||||
seginfo = xcalloc (1, sizeof (*seginfo));
|
||||
seginfo->bfd_section = secptr;
|
||||
bfd_set_section_userdata (stdoutput, secptr, seginfo);
|
||||
(void) bfd_set_section_userdata (stdoutput, secptr, seginfo);
|
||||
}
|
||||
return secptr;
|
||||
}
|
||||
|
@ -1112,9 +1112,9 @@ exp_get_fill (etree_type *tree, fill_type *def, char *name)
|
||||
fill = xmalloc (4 + sizeof (*fill) - 1);
|
||||
val = expld.result.value;
|
||||
fill->data[0] = (val >> 24) & 0xff;
|
||||
fill->data[1] = (val >> 16) & 0xff;
|
||||
fill->data[2] = (val >> 8) & 0xff;
|
||||
fill->data[3] = (val >> 0) & 0xff;
|
||||
__PAST_END(fill->data, 1) = (val >> 16) & 0xff;
|
||||
__PAST_END(fill->data, 2) = (val >> 8) & 0xff;
|
||||
__PAST_END(fill->data, 3) = (val >> 0) & 0xff;
|
||||
fill->size = 4;
|
||||
}
|
||||
return fill;
|
||||
|
@ -54,6 +54,9 @@ extern char *strrchr ();
|
||||
/* for MAXPATHLEN */
|
||||
#ifdef HAVE_SYS_PARAM_H
|
||||
#include <sys/param.h>
|
||||
#ifndef __PAST_END
|
||||
# define __PAST_END(array, offset) (((typeof(*(array)) *)(array))[offset])
|
||||
#endif
|
||||
#endif
|
||||
#ifdef PATH_MAX
|
||||
# define LD_PATHMAX PATH_MAX
|
||||
|
@ -3203,7 +3203,7 @@ ckprefix (void)
|
||||
rex_used = 0;
|
||||
while (1)
|
||||
{
|
||||
FETCH_DATA (the_info, codep + 1);
|
||||
(void) FETCH_DATA (the_info, codep + 1);
|
||||
newrex = 0;
|
||||
switch (*codep)
|
||||
{
|
||||
@ -3606,7 +3606,7 @@ print_insn (bfd_vma pc, disassemble_info *info)
|
||||
insn_codep = codep;
|
||||
sizeflag = priv.orig_sizeflag;
|
||||
|
||||
FETCH_DATA (info, codep + 1);
|
||||
(void) FETCH_DATA (info, codep + 1);
|
||||
two_source_ops = (*codep == 0x62) || (*codep == 0xc8);
|
||||
|
||||
if (((prefixes & PREFIX_FWAIT)
|
||||
@ -3628,7 +3628,7 @@ print_insn (bfd_vma pc, disassemble_info *info)
|
||||
if (*codep == 0x0f)
|
||||
{
|
||||
unsigned char threebyte;
|
||||
FETCH_DATA (info, codep + 2);
|
||||
(void) FETCH_DATA (info, codep + 2);
|
||||
threebyte = *++codep;
|
||||
dp = &dis386_twobyte[threebyte];
|
||||
need_modrm = twobyte_has_modrm[*codep];
|
||||
@ -3639,7 +3639,7 @@ print_insn (bfd_vma pc, disassemble_info *info)
|
||||
codep++;
|
||||
if (dp->name == NULL && dp->op[0].bytemode == IS_3BYTE_OPCODE)
|
||||
{
|
||||
FETCH_DATA (info, codep + 2);
|
||||
(void) FETCH_DATA (info, codep + 2);
|
||||
op = *codep++;
|
||||
switch (threebyte)
|
||||
{
|
||||
@ -3724,7 +3724,7 @@ print_insn (bfd_vma pc, disassemble_info *info)
|
||||
}
|
||||
else if (need_modrm)
|
||||
{
|
||||
FETCH_DATA (info, codep + 1);
|
||||
(void) FETCH_DATA (info, codep + 1);
|
||||
modrm.mod = (*codep >> 6) & 3;
|
||||
modrm.reg = (*codep >> 3) & 7;
|
||||
modrm.rm = *codep & 7;
|
||||
@ -4890,7 +4890,7 @@ OP_E (int bytemode, int sizeflag)
|
||||
if (base == 4)
|
||||
{
|
||||
havesib = 1;
|
||||
FETCH_DATA (the_info, codep + 1);
|
||||
(void) FETCH_DATA (the_info, codep + 1);
|
||||
index = (*codep >> 3) & 7;
|
||||
if (address_mode == mode_64bit || index != 0x4)
|
||||
/* When INDEX == 0x4 in 32 bit mode, SCALE is ignored. */
|
||||
@ -5147,7 +5147,7 @@ get64 (void)
|
||||
unsigned int a;
|
||||
unsigned int b;
|
||||
|
||||
FETCH_DATA (the_info, codep + 8);
|
||||
(void) FETCH_DATA (the_info, codep + 8);
|
||||
a = *codep++ & 0xff;
|
||||
a |= (*codep++ & 0xff) << 8;
|
||||
a |= (*codep++ & 0xff) << 16;
|
||||
@ -5169,7 +5169,7 @@ get32 (void)
|
||||
{
|
||||
bfd_signed_vma x = 0;
|
||||
|
||||
FETCH_DATA (the_info, codep + 4);
|
||||
(void) FETCH_DATA (the_info, codep + 4);
|
||||
x = *codep++ & (bfd_signed_vma) 0xff;
|
||||
x |= (*codep++ & (bfd_signed_vma) 0xff) << 8;
|
||||
x |= (*codep++ & (bfd_signed_vma) 0xff) << 16;
|
||||
@ -5182,7 +5182,7 @@ get32s (void)
|
||||
{
|
||||
bfd_signed_vma x = 0;
|
||||
|
||||
FETCH_DATA (the_info, codep + 4);
|
||||
(void) FETCH_DATA (the_info, codep + 4);
|
||||
x = *codep++ & (bfd_signed_vma) 0xff;
|
||||
x |= (*codep++ & (bfd_signed_vma) 0xff) << 8;
|
||||
x |= (*codep++ & (bfd_signed_vma) 0xff) << 16;
|
||||
@ -5198,7 +5198,7 @@ get16 (void)
|
||||
{
|
||||
int x = 0;
|
||||
|
||||
FETCH_DATA (the_info, codep + 2);
|
||||
(void) FETCH_DATA (the_info, codep + 2);
|
||||
x = *codep++ & 0xff;
|
||||
x |= (*codep++ & 0xff) << 8;
|
||||
return x;
|
||||
@ -6018,7 +6018,7 @@ OP_3DNowSuffix (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
|
||||
{
|
||||
const char *mnemonic;
|
||||
|
||||
FETCH_DATA (the_info, codep + 1);
|
||||
(void) FETCH_DATA (the_info, codep + 1);
|
||||
/* AMD 3DNow! instructions are specified by an opcode suffix in the
|
||||
place where an 8-bit immediate would normally go. ie. the last
|
||||
byte of the instruction. */
|
||||
@ -6054,7 +6054,7 @@ OP_SIMD_Suffix (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
|
||||
{
|
||||
unsigned int cmp_type;
|
||||
|
||||
FETCH_DATA (the_info, codep + 1);
|
||||
(void) FETCH_DATA (the_info, codep + 1);
|
||||
obufp = obuf + strlen (obuf);
|
||||
cmp_type = *codep++ & 0xff;
|
||||
if (cmp_type < 8)
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: dialog.h,v 1.223 2011/03/02 10:04:09 tom Exp $
|
||||
* $Id: dialog.h,v 1.224 2011/06/13 14:29:42 tom Exp $
|
||||
*
|
||||
* dialog.h -- common declarations for all dialog modules
|
||||
*
|
||||
@ -44,7 +44,10 @@
|
||||
#include <signal.h> /* fork() etc. */
|
||||
#include <math.h> /* sqrt() */
|
||||
|
||||
#undef ERR /* header conflict with Solaris xpg4 */
|
||||
/* header conflict with Solaris xpg4 versus <sys/regset.h> */
|
||||
#if defined(ERR) && (ERR == 13)
|
||||
#undef ERR
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_NCURSESW_NCURSES_H)
|
||||
#include <ncursesw/ncurses.h>
|
||||
|
@ -830,7 +830,7 @@ dump_cfg_bb_info (FILE *file, basic_block bb)
|
||||
else
|
||||
fprintf (file, ", ");
|
||||
first = false;
|
||||
fprintf (file, bb_bitnames[i]);
|
||||
fputs (bb_bitnames[i], file);
|
||||
}
|
||||
if (!first)
|
||||
fprintf (file, ")");
|
||||
|
@ -109,13 +109,14 @@ extern void output_addr_const (FILE *, rtx);
|
||||
|
||||
/* Output a string of assembler code, substituting numbers, strings
|
||||
and fixed syntactic prefixes. */
|
||||
#if GCC_VERSION >= 3004
|
||||
#if GCC_VERSION >= 3004 && !defined(__clang__)
|
||||
#define ATTRIBUTE_ASM_FPRINTF(m, n) __attribute__ ((__format__ (__asm_fprintf__, m, n))) ATTRIBUTE_NONNULL(m)
|
||||
/* This is a magic identifier which allows GCC to figure out the type
|
||||
of HOST_WIDE_INT for %wd specifier checks. You must issue this
|
||||
typedef before using the __asm_fprintf__ format attribute. */
|
||||
typedef HOST_WIDE_INT __gcc_host_wide_int__;
|
||||
#else
|
||||
/* FIXME(benl): what about %wd? */
|
||||
#define ATTRIBUTE_ASM_FPRINTF(m, n) ATTRIBUTE_NONNULL(m)
|
||||
#endif
|
||||
|
||||
|
@ -22,6 +22,11 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
#ifndef GCC_RTL_H
|
||||
#define GCC_RTL_H
|
||||
|
||||
#include <sys/param.h>
|
||||
#ifndef __PAST_END
|
||||
# define __PAST_END(array, offset) (((typeof(*(array)) *)(array))[offset])
|
||||
#endif
|
||||
|
||||
#include "statistics.h"
|
||||
#include "machmode.h"
|
||||
#include "input.h"
|
||||
@ -565,12 +570,12 @@ extern void rtvec_check_failed_bounds (rtvec, int, const char *, int,
|
||||
|
||||
#define RTL_CHECK1(RTX, N, C1) ((RTX)->u.fld[N])
|
||||
#define RTL_CHECK2(RTX, N, C1, C2) ((RTX)->u.fld[N])
|
||||
#define RTL_CHECKC1(RTX, N, C) ((RTX)->u.fld[N])
|
||||
#define RTL_CHECKC1(RTX, N, C) __PAST_END((RTX)->u.fld, N)
|
||||
#define RTL_CHECKC2(RTX, N, C1, C2) ((RTX)->u.fld[N])
|
||||
#define RTVEC_ELT(RTVEC, I) ((RTVEC)->elem[I])
|
||||
#define RTVEC_ELT(RTVEC, I) __PAST_END((RTVEC)->elem, I)
|
||||
#define XWINT(RTX, N) ((RTX)->u.hwint[N])
|
||||
#define XCWINT(RTX, N, C) ((RTX)->u.hwint[N])
|
||||
#define XCMWINT(RTX, N, C, M) ((RTX)->u.hwint[N])
|
||||
#define XCMWINT(RTX, N, C, M) __PAST_END((RTX)->u.hwint, N)
|
||||
#define XCNMWINT(RTX, N, C, M) ((RTX)->u.hwint[N])
|
||||
#define XCNMPRV(RTX, C, M) (&(RTX)->u.rv)
|
||||
#define BLOCK_SYMBOL_CHECK(RTX) (&(RTX)->u.block_sym)
|
||||
|
@ -22,6 +22,11 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
#ifndef GCC_TREE_H
|
||||
#define GCC_TREE_H
|
||||
|
||||
#include <sys/param.h>
|
||||
#ifndef __PAST_END
|
||||
# define __PAST_END(array, offset) (((typeof(*(array)) *)(array))[offset])
|
||||
#endif
|
||||
|
||||
#include "hashtab.h"
|
||||
#include "machmode.h"
|
||||
#include "input.h"
|
||||
@ -830,12 +835,12 @@ extern void omp_clause_range_check_failed (const tree, const char *, int,
|
||||
#define TREE_RANGE_CHECK(T, CODE1, CODE2) (T)
|
||||
#define EXPR_CHECK(T) (T)
|
||||
#define NON_TYPE_CHECK(T) (T)
|
||||
#define TREE_VEC_ELT_CHECK(T, I) ((T)->vec.a[I])
|
||||
#define TREE_OPERAND_CHECK(T, I) ((T)->exp.operands[I])
|
||||
#define TREE_OPERAND_CHECK_CODE(T, CODE, I) ((T)->exp.operands[I])
|
||||
#define TREE_VEC_ELT_CHECK(T, I) __PAST_END((T)->vec.a, I)
|
||||
#define TREE_OPERAND_CHECK(T, I) __PAST_END((T)->exp.operands, I)
|
||||
#define TREE_OPERAND_CHECK_CODE(T, CODE, I) __PAST_END((T)->exp.operands, I)
|
||||
#define TREE_RTL_OPERAND_CHECK(T, CODE, I) (*(rtx *) &((T)->exp.operands[I]))
|
||||
#define PHI_NODE_ELT_CHECK(T, i) ((T)->phi.a[i])
|
||||
#define OMP_CLAUSE_ELT_CHECK(T, i) ((T)->omp_clause.ops[i])
|
||||
#define OMP_CLAUSE_ELT_CHECK(T, i) __PAST_END((T)->omp_clause.ops, i)
|
||||
#define OMP_CLAUSE_RANGE_CHECK(T, CODE1, CODE2) (T)
|
||||
#define OMP_CLAUSE_SUBCODE_CHECK(T, CODE) (T)
|
||||
|
||||
|
@ -246,7 +246,7 @@ Gen_Perf::change (List_Node *prior, List_Node *curr)
|
||||
{
|
||||
if (option[DEBUG])
|
||||
{
|
||||
fprintf (stderr, " by changing asso_value['%c'] (char #%zd) to %d\n",
|
||||
fprintf (stderr, " by changing asso_value['%c'] (char #%td) to %d\n",
|
||||
*p, p - union_set + 1, asso_values[(unsigned char)(*p)]);
|
||||
fflush (stderr);
|
||||
}
|
||||
|
@ -1441,7 +1441,7 @@ Key_List::output_lookup_array (void)
|
||||
|
||||
if (option[DEBUG])
|
||||
fprintf (stderr,
|
||||
"dup_ptr[%zd]: hash_value = %d, index = %d, count = %d\n",
|
||||
"dup_ptr[%td]: hash_value = %d, index = %d, count = %d\n",
|
||||
dup_ptr - duplicates,
|
||||
dup_ptr->hash_value, dup_ptr->index, dup_ptr->count);
|
||||
|
||||
|
@ -38,6 +38,7 @@ ddb_enable="NO" # Set to YES to load ddb scripts at boot.
|
||||
ddb_config="/etc/ddb.conf" # ddb(8) config file.
|
||||
devd_enable="YES" # Run devd, to trigger programs on device tree changes.
|
||||
devd_flags="" # Additional flags for devd(8).
|
||||
#kld_list="" # Kernel modules to load after local disks are mounted
|
||||
kldxref_enable="NO" # Build linker.hints files with kldxref(8).
|
||||
kldxref_clobber="NO" # Overwrite old linker.hints at boot.
|
||||
kldxref_module_path="" # Override kern.module_path. A ';'-delimited list.
|
||||
|
@ -6,7 +6,7 @@ FILES= 999.local
|
||||
|
||||
# NB: keep these sorted by MK_* knobs
|
||||
|
||||
.if ${MK_ACCT} != "no"
|
||||
.if ${MK_UTMPX} != "no"
|
||||
FILES+= 200.accounting
|
||||
.endif
|
||||
|
||||
|
@ -18,7 +18,7 @@ FILES= DAEMON FILESYSTEMS LOGIN NETWORKING SERVERS \
|
||||
ip6addrctl ipfilter ipfs ipfw ipmon \
|
||||
ipnat ipsec ipxrouted \
|
||||
jail \
|
||||
kadmind kerberos keyserv kldxref kpasswdd \
|
||||
kadmind kerberos keyserv kld kldxref kpasswdd \
|
||||
ldconfig local localpkg lockd lpd \
|
||||
mixer motd mountcritlocal mountcritremote mountlate \
|
||||
mdconfig mdconfig2 mountd moused mroute6d mrouted msgs \
|
||||
|
53
etc/rc.d/kld
Executable file
53
etc/rc.d/kld
Executable file
@ -0,0 +1,53 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Copyright (c) 2011 Douglas Barton
|
||||
# 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$
|
||||
#
|
||||
# PROVIDE: kld
|
||||
# REQUIRE: FILESYSTEMS
|
||||
# KEYWORD: nojail
|
||||
|
||||
. /etc/rc.subr
|
||||
|
||||
name="kld"
|
||||
|
||||
start_cmd="${name}_start"
|
||||
stop_cmd=':'
|
||||
|
||||
kld_start()
|
||||
{
|
||||
[ -n "$kld_list" ] || return
|
||||
|
||||
local _kld
|
||||
|
||||
echo 'Loading kernel modules:'
|
||||
for _kld in $kld_list ; do
|
||||
load_kld -e ${_kld}.ko $_kld
|
||||
done
|
||||
}
|
||||
|
||||
load_rc_config $name
|
||||
run_rc_command "$1"
|
@ -28,7 +28,7 @@
|
||||
#
|
||||
|
||||
# PROVIDE: var
|
||||
# REQUIRE: FILESYSTEMS
|
||||
# REQUIRE: FILESYSTEMS kld
|
||||
|
||||
. /etc/rc.subr
|
||||
|
||||
|
12
etc/rc.subr
12
etc/rc.subr
@ -1062,7 +1062,7 @@ load_rc_config()
|
||||
|
||||
# Set defaults if defined.
|
||||
for _var in $rcvar $rcvars; do
|
||||
_defval=`eval echo "\\\$${_var}_defval"`
|
||||
eval _defval=\$${_var}_defval
|
||||
if [ -n "$_defval" ]; then
|
||||
eval : \${$_var:=\$${_var}_defval}
|
||||
fi
|
||||
@ -1070,9 +1070,9 @@ load_rc_config()
|
||||
|
||||
# check obsolete rc.conf variables
|
||||
for _var in $rcvars_obsolete; do
|
||||
_v=`eval echo \\$$_var`
|
||||
_msg=`eval echo \\$${_var}_obsolete_msg`
|
||||
_new=`eval echo \\$${_var}_newvar`
|
||||
eval _v=\$$_var
|
||||
eval _msg=\$${_var}_obsolete_msg
|
||||
eval _new=\$${_var}_newvar
|
||||
case $_v in
|
||||
"")
|
||||
;;
|
||||
@ -1744,7 +1744,7 @@ check_kern_features()
|
||||
local _v
|
||||
|
||||
[ -n "$1" ] || return 1;
|
||||
_v=`eval echo "\\$_rc_cache_kern_features_$1"`
|
||||
eval _v=\$_rc_cache_kern_features_$1
|
||||
[ -n "$_v" ] && return "$_v";
|
||||
|
||||
if ${SYSCTL_N} kern.features.$1 > /dev/null 2>&1; then
|
||||
@ -1765,7 +1765,7 @@ check_kern_features()
|
||||
_echoonce()
|
||||
{
|
||||
local _var _msg _mode
|
||||
_var=`eval echo \\$$1`
|
||||
eval _var=\$$1
|
||||
_msg=$2
|
||||
_mode=$3
|
||||
|
||||
|
@ -37,6 +37,7 @@ static char sccsid[] = "@(#)bt_split.c 8.10 (Berkeley) 1/9/95";
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
|
||||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
@ -482,7 +483,7 @@ bt_rroot(BTREE *t, PAGE *h, PAGE *l, PAGE *r)
|
||||
WR_RINTERNAL(dest,
|
||||
l->flags & P_RLEAF ? NEXTINDEX(l) : rec_total(l), l->pgno);
|
||||
|
||||
h->linp[1] = h->upper -= NRINTERNAL;
|
||||
__PAST_END(h->linp, 1) = h->upper -= NRINTERNAL;
|
||||
dest = (char *)h + h->upper;
|
||||
WR_RINTERNAL(dest,
|
||||
r->flags & P_RLEAF ? NEXTINDEX(r) : rec_total(r), r->pgno);
|
||||
@ -534,7 +535,7 @@ bt_broot(BTREE *t, PAGE *h, PAGE *l, PAGE *r)
|
||||
case P_BLEAF:
|
||||
bl = GETBLEAF(r, 0);
|
||||
nbytes = NBINTERNAL(bl->ksize);
|
||||
h->linp[1] = h->upper -= nbytes;
|
||||
__PAST_END(h->linp, 1) = h->upper -= nbytes;
|
||||
dest = (char *)h + h->upper;
|
||||
WR_BINTERNAL(dest, bl->ksize, r->pgno, 0);
|
||||
memmove(dest, bl->bytes, bl->ksize);
|
||||
@ -550,7 +551,7 @@ bt_broot(BTREE *t, PAGE *h, PAGE *l, PAGE *r)
|
||||
case P_BINTERNAL:
|
||||
bi = GETBINTERNAL(r, 0);
|
||||
nbytes = NBINTERNAL(bi->ksize);
|
||||
h->linp[1] = h->upper -= nbytes;
|
||||
__PAST_END(h->linp, 1) = h->upper -= nbytes;
|
||||
dest = (char *)h + h->upper;
|
||||
memmove(dest, bi, nbytes);
|
||||
((BINTERNAL *)dest)->pgno = r->pgno;
|
||||
|
@ -28,7 +28,7 @@
|
||||
.\" @(#)mpool.3 8.1 (Berkeley) 6/4/93
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd February 25, 1999
|
||||
.Dd June 17, 2011
|
||||
.Dt MPOOL 3
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -147,7 +147,14 @@ is returned and
|
||||
is set.
|
||||
The
|
||||
.Fa flags
|
||||
argument is not currently used.
|
||||
argument is specified by
|
||||
.Em or Ns 'ing
|
||||
any of the following values:
|
||||
.Bl -tag -width indent
|
||||
.It Dv MPOOL_IGNOREPIN
|
||||
The page returned is not pinned;
|
||||
page will otherwise be pinned on return.
|
||||
.El
|
||||
.Pp
|
||||
The
|
||||
.Fn mpool_put
|
||||
|
@ -1,33 +1,22 @@
|
||||
.\" $OpenBSD: basename.3,v 1.20 2007/05/31 19:19:28 jmc Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com>
|
||||
.\" 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. The name of the author may not be used to endorse or promote products
|
||||
.\" derived from this software without specific prior written permission.
|
||||
.\" 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.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED ``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 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.
|
||||
.\" 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: basename.3,v 1.12 2000/04/18 03:01:25 aaron Exp $
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd October 6, 2009
|
||||
.Dd March 31, 2010
|
||||
.Dt BASENAME 3
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -42,8 +31,7 @@
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Fn basename
|
||||
function
|
||||
returns the last component from the pathname pointed to by
|
||||
function returns the last component from the pathname pointed to by
|
||||
.Fa path ,
|
||||
deleting any trailing
|
||||
.Sq \&/
|
||||
@ -111,4 +99,15 @@ function first appeared in
|
||||
and
|
||||
.Fx 4.2 .
|
||||
.Sh AUTHORS
|
||||
.An "Todd C. Miller" Aq Todd.Miller@courtesan.com
|
||||
.An Todd C. Miller
|
||||
.Sh CAVEATS
|
||||
.Fn basename
|
||||
returns a pointer to internal static storage space that will be overwritten
|
||||
by subsequent calls.
|
||||
.Pp
|
||||
Other vendor implementations of
|
||||
.Fn basename
|
||||
may modify the contents of the string passed to
|
||||
.Fn basename ;
|
||||
this should be taken into account when writing code which calls this function
|
||||
if portability is desired.
|
||||
|
@ -1,35 +1,21 @@
|
||||
/* $OpenBSD: basename.c,v 1.14 2005/08/08 08:05:33 espie Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com>
|
||||
* All rights reserved.
|
||||
* Copyright (c) 1997, 2004 Todd C. Miller <Todd.Miller@courtesan.com>
|
||||
*
|
||||
* 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. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
* 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.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED ``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 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.
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#if 0
|
||||
#ifndef lint
|
||||
static char rcsid[] = "$OpenBSD: basename.c,v 1.4 1999/05/30 17:10:30 espie Exp $";
|
||||
#endif /* not lint */
|
||||
#endif
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
@ -40,27 +26,28 @@ __FBSDID("$FreeBSD$");
|
||||
#include <sys/param.h>
|
||||
|
||||
char *
|
||||
basename_r(path, bname)
|
||||
const char *path;
|
||||
char *bname;
|
||||
basename_r(const char *path, char *bname)
|
||||
{
|
||||
const char *endp, *startp;
|
||||
size_t len;
|
||||
|
||||
/* Empty or NULL string gets treated as "." */
|
||||
if (path == NULL || *path == '\0') {
|
||||
(void)strcpy(bname, ".");
|
||||
return(bname);
|
||||
bname[0] = '.';
|
||||
bname[1] = '\0';
|
||||
return (bname);
|
||||
}
|
||||
|
||||
/* Strip trailing slashes */
|
||||
/* Strip any trailing slashes */
|
||||
endp = path + strlen(path) - 1;
|
||||
while (endp > path && *endp == '/')
|
||||
endp--;
|
||||
|
||||
/* All slashes becomes "/" */
|
||||
if (endp == path && *endp == '/') {
|
||||
(void)strcpy(bname, "/");
|
||||
return(bname);
|
||||
bname[0] = '/';
|
||||
bname[1] = '\0';
|
||||
return (bname);
|
||||
}
|
||||
|
||||
/* Find the start of the base */
|
||||
@ -68,18 +55,18 @@ basename_r(path, bname)
|
||||
while (startp > path && *(startp - 1) != '/')
|
||||
startp--;
|
||||
|
||||
if (endp - startp + 2 > MAXPATHLEN) {
|
||||
len = endp - startp + 1;
|
||||
if (len >= MAXPATHLEN) {
|
||||
errno = ENAMETOOLONG;
|
||||
return(NULL);
|
||||
return (NULL);
|
||||
}
|
||||
(void)strncpy(bname, startp, endp - startp + 1);
|
||||
bname[endp - startp + 1] = '\0';
|
||||
return(bname);
|
||||
memcpy(bname, startp, len);
|
||||
bname[len] = '\0';
|
||||
return (bname);
|
||||
}
|
||||
|
||||
char *
|
||||
basename(path)
|
||||
const char *path;
|
||||
basename(const char *path)
|
||||
{
|
||||
static char *bname = NULL;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: ftw.c,v 1.4 2004/07/07 16:05:23 millert Exp $ */
|
||||
/* $OpenBSD: ftw.c,v 1.5 2005/08/08 08:05:34 espie Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2003, 2004 Todd C. Miller <Todd.Miller@courtesan.com>
|
||||
@ -20,12 +20,6 @@
|
||||
* Materiel Command, USAF, under agreement number F39502-99-1-0512.
|
||||
*/
|
||||
|
||||
#if 0
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
static const char rcsid[] = "$OpenBSD: ftw.c,v 1.4 2004/07/07 16:05:23 millert Exp $";
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
#endif
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
|
@ -34,7 +34,7 @@
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd March 24, 2008
|
||||
.Dd June 17, 2011
|
||||
.Dt POSIX_SPAWN 3
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -384,29 +384,28 @@ the child process exits with exit status 127).
|
||||
.It
|
||||
If the
|
||||
.Fa file_actions
|
||||
argument is not NULL, and specifies any close, dup2, or open actions to be
|
||||
argument is not NULL, and specifies any dup2 or open actions to be
|
||||
performed, and if
|
||||
.Fn posix_spawn
|
||||
or
|
||||
.Fn posix_spawnp
|
||||
fails for any of the reasons that would cause
|
||||
.Fn close ,
|
||||
.Fn dup2 ,
|
||||
.Fn dup2
|
||||
or
|
||||
.Fn open
|
||||
to fail, an error value is returned as described by
|
||||
.Fn close ,
|
||||
.Fn dup2 ,
|
||||
.Fn dup2
|
||||
and
|
||||
.Fn open ,
|
||||
respectively (or, if the error occurs after the calling process successfully
|
||||
returns, the child process exits with exit status 127). An open file action
|
||||
may, by itself, result in any of the errors described by
|
||||
.Fn close
|
||||
or
|
||||
.Fn dup2 ,
|
||||
in addition to those described by
|
||||
.Fn open .
|
||||
This implementation ignores any errors from
|
||||
.Fn close ,
|
||||
including trying to close a descriptor that is not open.
|
||||
.El
|
||||
.Sh SEE ALSO
|
||||
.Xr close 2 ,
|
||||
@ -443,7 +442,13 @@ The
|
||||
and
|
||||
.Fn posix_spawnp
|
||||
functions conform to
|
||||
.St -p1003.1-2001 .
|
||||
.St -p1003.1-2001 ,
|
||||
except that they ignore all errors from
|
||||
.Fn close .
|
||||
A future update of the Standard is expected to require that these functions
|
||||
not fail because a file descriptor to be closed (via
|
||||
.Fn posix_spawn_file_actions_addclose )
|
||||
is not open.
|
||||
.Sh HISTORY
|
||||
The
|
||||
.Fn posix_spawn
|
||||
|
@ -337,7 +337,9 @@ _citrus_mapper_open(struct _citrus_mapper_area *__restrict ma,
|
||||
goto quit;
|
||||
|
||||
/* open mapper */
|
||||
UNLOCK;
|
||||
ret = mapper_open(ma, &cm, module, variable);
|
||||
WLOCK;
|
||||
if (ret)
|
||||
goto quit;
|
||||
cm->cm_key = strdup(mapname);
|
||||
|
@ -85,7 +85,7 @@ _iconv_open(const char *out, const char *in, struct _citrus_iconv *prealloc)
|
||||
errno = ENOMEM;
|
||||
return ((iconv_t)-1);
|
||||
}
|
||||
|
||||
|
||||
p = out_truncated;
|
||||
while (*p != 0) {
|
||||
if (p[0] == '/' && p[1] == '/') {
|
||||
|
@ -32,7 +32,7 @@
|
||||
.\" From: @(#)send.2 8.2 (Berkeley) 2/21/94
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd December 15, 2006
|
||||
.Dd June 18, 2011
|
||||
.Dt SCTP_OPT_INFO 3
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -76,14 +76,30 @@ socket options.
|
||||
.Pp
|
||||
.Dv SCTP_PRIMARY_ADDR
|
||||
.Pp
|
||||
.Dv SCTP_SET_PEER_PRIMARY_ADDR
|
||||
.Dv SCTP_PEER_ADDR_PARAMS
|
||||
.Pp
|
||||
.Dv SCTP_DEFAULT_SEND_PARAM
|
||||
.Pp
|
||||
.Dv SCTP_MAX_SEG
|
||||
.Pp
|
||||
.Dv SCTP_AUTH_ACTIVE_KEY
|
||||
.Pp
|
||||
.Dv SCTP_DELAYED_SACK
|
||||
.Pp
|
||||
.Dv SCTP_MAX_BURST
|
||||
.Pp
|
||||
.Dv SCTP_CONTEXT
|
||||
.Pp
|
||||
.Dv SCTP_EVENT
|
||||
.Pp
|
||||
.Dv SCTP_DEFAULT_SNDINFO
|
||||
.Pp
|
||||
.Dv SCTP_DEFAULT_PRINFO
|
||||
.Pp
|
||||
.Dv SCTP_STATUS
|
||||
.Pp
|
||||
.Dv SCTP_GET_PEER_ADDR_INFO
|
||||
.Pp
|
||||
.Dv SCTP_AUTH_ACTIVE_KEY
|
||||
.Pp
|
||||
.Dv SCTP_PEER_AUTH_CHUNKS
|
||||
.Pp
|
||||
.Dv SCTP_LOCAL_AUTH_CHUNKS
|
||||
@ -115,3 +131,14 @@ is not a socket.
|
||||
.Sh SEE ALSO
|
||||
.Xr getsockopt 2 ,
|
||||
.Xr sctp 4
|
||||
.Sh BUGS
|
||||
Because the structure used for
|
||||
.Fa arg
|
||||
of the
|
||||
.Dv SCTP_MAX_BURST
|
||||
socket option has changed in FreeBSD 9.0 and higher,
|
||||
using
|
||||
.Dv SCTP_MAX_BURST
|
||||
as
|
||||
.Fa opt
|
||||
is only supported in FreeBSD 9.0 and higher.
|
||||
|
@ -365,9 +365,6 @@ sctp_opt_info(int sd, sctp_assoc_t id, int opt, void *arg, socklen_t * size)
|
||||
case SCTP_DEFAULT_SEND_PARAM:
|
||||
((struct sctp_assocparams *)arg)->sasoc_assoc_id = id;
|
||||
break;
|
||||
case SCTP_SET_PEER_PRIMARY_ADDR:
|
||||
((struct sctp_setpeerprim *)arg)->sspp_assoc_id = id;
|
||||
break;
|
||||
case SCTP_PRIMARY_ADDR:
|
||||
((struct sctp_setprim *)arg)->ssp_assoc_id = id;
|
||||
break;
|
||||
@ -407,6 +404,15 @@ sctp_opt_info(int sd, sctp_assoc_t id, int opt, void *arg, socklen_t * size)
|
||||
case SCTP_EVENT:
|
||||
((struct sctp_event *)arg)->se_assoc_id = id;
|
||||
break;
|
||||
case SCTP_DEFAULT_SNDINFO:
|
||||
((struct sctp_sndinfo *)arg)->snd_assoc_id = id;
|
||||
break;
|
||||
case SCTP_DEFAULT_PRINFO:
|
||||
((struct sctp_default_prinfo *)arg)->pr_assoc_id = id;
|
||||
break;
|
||||
case SCTP_MAX_BURST:
|
||||
((struct sctp_assoc_value *)arg)->assoc_id = id;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -942,6 +948,12 @@ sctp_recvv(int sd,
|
||||
struct sctp_rcvinfo *rcvinfo;
|
||||
struct sctp_nxtinfo *nxtinfo;
|
||||
|
||||
if (((info != NULL) && (infolen == NULL)) |
|
||||
((info == NULL) && (infolen != NULL) && (*infolen != 0)) ||
|
||||
((info != NULL) && (infotype == NULL))) {
|
||||
errno = EINVAL;
|
||||
return (-1);
|
||||
}
|
||||
if (infotype) {
|
||||
*infotype = SCTP_RECVV_NOINFO;
|
||||
}
|
||||
@ -1017,16 +1029,22 @@ sctp_sendv(int sd,
|
||||
{
|
||||
ssize_t ret;
|
||||
int i;
|
||||
size_t addr_len;
|
||||
struct sctp_sendv_spa *spa_info;
|
||||
socklen_t addr_len;
|
||||
struct msghdr msg;
|
||||
in_port_t port;
|
||||
struct sctp_sendv_spa *spa_info;
|
||||
struct cmsghdr *cmsg;
|
||||
char *cmsgbuf;
|
||||
struct sockaddr *addr;
|
||||
struct sockaddr_in *addr_in;
|
||||
struct sockaddr_in6 *addr_in6;
|
||||
|
||||
if ((addrcnt < 0) || (iovcnt < 0)) {
|
||||
if ((addrcnt < 0) ||
|
||||
(iovcnt < 0) ||
|
||||
((addrs == NULL) && (addrcnt > 0)) ||
|
||||
((addrs != NULL) && (addrcnt == 0)) ||
|
||||
((iov == NULL) && (iovcnt > 0)) ||
|
||||
((iov != NULL) && (iovcnt == 0))) {
|
||||
errno = EINVAL;
|
||||
return (-1);
|
||||
}
|
||||
@ -1042,8 +1060,15 @@ sctp_sendv(int sd,
|
||||
msg.msg_controllen = 0;
|
||||
cmsg = (struct cmsghdr *)cmsgbuf;
|
||||
switch (infotype) {
|
||||
case SCTP_SENDV_NOINFO:
|
||||
if ((infolen != 0) || (info != NULL)) {
|
||||
free(cmsgbuf);
|
||||
errno = EINVAL;
|
||||
return (-1);
|
||||
}
|
||||
break;
|
||||
case SCTP_SENDV_SNDINFO:
|
||||
if (infolen < sizeof(struct sctp_sndinfo)) {
|
||||
if ((info == NULL) || (infolen < sizeof(struct sctp_sndinfo))) {
|
||||
free(cmsgbuf);
|
||||
errno = EINVAL;
|
||||
return (-1);
|
||||
@ -1056,7 +1081,7 @@ sctp_sendv(int sd,
|
||||
cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct sctp_sndinfo)));
|
||||
break;
|
||||
case SCTP_SENDV_PRINFO:
|
||||
if (infolen < sizeof(struct sctp_prinfo)) {
|
||||
if ((info == NULL) || (infolen < sizeof(struct sctp_prinfo))) {
|
||||
free(cmsgbuf);
|
||||
errno = EINVAL;
|
||||
return (-1);
|
||||
@ -1069,7 +1094,7 @@ sctp_sendv(int sd,
|
||||
cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct sctp_prinfo)));
|
||||
break;
|
||||
case SCTP_SENDV_AUTHINFO:
|
||||
if (infolen < sizeof(struct sctp_authinfo)) {
|
||||
if ((info == NULL) || (infolen < sizeof(struct sctp_authinfo))) {
|
||||
free(cmsgbuf);
|
||||
errno = EINVAL;
|
||||
return (-1);
|
||||
@ -1082,7 +1107,7 @@ sctp_sendv(int sd,
|
||||
cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct sctp_authinfo)));
|
||||
break;
|
||||
case SCTP_SENDV_SPA:
|
||||
if (infolen < sizeof(struct sctp_sendv_spa)) {
|
||||
if ((info == NULL) || (infolen < sizeof(struct sctp_sendv_spa))) {
|
||||
free(cmsgbuf);
|
||||
errno = EINVAL;
|
||||
return (-1);
|
||||
@ -1119,52 +1144,71 @@ sctp_sendv(int sd,
|
||||
return (-1);
|
||||
}
|
||||
addr = addrs;
|
||||
if (addrcnt == 1) {
|
||||
msg.msg_name = addr;
|
||||
msg.msg_name = NULL;
|
||||
msg.msg_namelen = 0;
|
||||
|
||||
for (i = 0; i < addrcnt; i++) {
|
||||
switch (addr->sa_family) {
|
||||
case AF_INET:
|
||||
msg.msg_namelen = sizeof(struct sockaddr_in);
|
||||
addr_len = (socklen_t) sizeof(struct sockaddr_in);
|
||||
addr_in = (struct sockaddr_in *)addr;
|
||||
if (addr_in->sin_len != addr_len) {
|
||||
free(cmsgbuf);
|
||||
errno = EINVAL;
|
||||
return (-1);
|
||||
}
|
||||
if (i == 0) {
|
||||
port = addr_in->sin_port;
|
||||
} else {
|
||||
if (port == addr_in->sin_port) {
|
||||
cmsg->cmsg_level = IPPROTO_SCTP;
|
||||
cmsg->cmsg_type = SCTP_DSTADDRV4;
|
||||
cmsg->cmsg_len = CMSG_LEN(sizeof(struct in_addr));
|
||||
memcpy(CMSG_DATA(cmsg), &addr_in->sin_addr, sizeof(struct in_addr));
|
||||
msg.msg_controllen += CMSG_SPACE(sizeof(struct in_addr));
|
||||
cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct in_addr)));
|
||||
} else {
|
||||
free(cmsgbuf);
|
||||
errno = EINVAL;
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case AF_INET6:
|
||||
msg.msg_namelen = sizeof(struct sockaddr_in6);
|
||||
addr_len = (socklen_t) sizeof(struct sockaddr_in6);
|
||||
addr_in6 = (struct sockaddr_in6 *)addr;
|
||||
if (addr_in6->sin6_len != addr_len) {
|
||||
free(cmsgbuf);
|
||||
errno = EINVAL;
|
||||
return (-1);
|
||||
}
|
||||
if (i == 0) {
|
||||
port = addr_in6->sin6_port;
|
||||
} else {
|
||||
if (port == addr_in6->sin6_port) {
|
||||
cmsg->cmsg_level = IPPROTO_SCTP;
|
||||
cmsg->cmsg_type = SCTP_DSTADDRV6;
|
||||
cmsg->cmsg_len = CMSG_LEN(sizeof(struct in6_addr));
|
||||
memcpy(CMSG_DATA(cmsg), &addr_in6->sin6_addr, sizeof(struct in6_addr));
|
||||
msg.msg_controllen += CMSG_SPACE(sizeof(struct in6_addr));
|
||||
cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct in6_addr)));
|
||||
} else {
|
||||
free(cmsgbuf);
|
||||
errno = EINVAL;
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
free(cmsgbuf);
|
||||
errno = EINVAL;
|
||||
return (-1);
|
||||
}
|
||||
} else {
|
||||
msg.msg_name = NULL;
|
||||
msg.msg_namelen = 0;
|
||||
for (i = 0; i < addrcnt; i++) {
|
||||
switch (addr->sa_family) {
|
||||
case AF_INET:
|
||||
addr_len = sizeof(struct sockaddr_in);
|
||||
addr_in = (struct sockaddr_in *)addr;
|
||||
cmsg->cmsg_level = IPPROTO_SCTP;
|
||||
cmsg->cmsg_type = SCTP_DSTADDRV4;
|
||||
cmsg->cmsg_len = CMSG_LEN(sizeof(struct in_addr));
|
||||
memcpy(CMSG_DATA(cmsg), &addr_in->sin_addr, sizeof(struct in_addr));
|
||||
msg.msg_controllen += CMSG_SPACE(sizeof(struct in_addr));
|
||||
cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct in_addr)));
|
||||
break;
|
||||
case AF_INET6:
|
||||
addr_len = sizeof(struct sockaddr_in6);
|
||||
addr_in6 = (struct sockaddr_in6 *)addr;
|
||||
cmsg->cmsg_level = IPPROTO_SCTP;
|
||||
cmsg->cmsg_type = SCTP_DSTADDRV6;
|
||||
cmsg->cmsg_len = CMSG_LEN(sizeof(struct in6_addr));
|
||||
memcpy(CMSG_DATA(cmsg), &addr_in6->sin6_addr, sizeof(struct in6_addr));
|
||||
msg.msg_controllen += CMSG_SPACE(sizeof(struct in6_addr));
|
||||
cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct in6_addr)));
|
||||
break;
|
||||
default:
|
||||
free(cmsgbuf);
|
||||
errno = EINVAL;
|
||||
return (-1);
|
||||
}
|
||||
addr = (struct sockaddr *)((caddr_t)addr + addr_len);
|
||||
if (i == 0) {
|
||||
msg.msg_name = addr;
|
||||
msg.msg_namelen = addr_len;
|
||||
}
|
||||
addr = (struct sockaddr *)((caddr_t)addr + addr_len);
|
||||
}
|
||||
if (msg.msg_controllen == 0) {
|
||||
msg.msg_control = NULL;
|
||||
|
@ -66,6 +66,19 @@ the
|
||||
.Fa status
|
||||
area contains termination information about the process that exited
|
||||
as defined below.
|
||||
The
|
||||
.Fn wait
|
||||
call is the same as
|
||||
.Fn wait4
|
||||
with a
|
||||
.Fa wpid
|
||||
value of -1,
|
||||
with an
|
||||
.Fa options
|
||||
value of zero,
|
||||
and a
|
||||
.Fa rusage
|
||||
value of zero.
|
||||
.Pp
|
||||
The
|
||||
.Fn wait4
|
||||
|
@ -191,7 +191,7 @@ procstat_getprocs(struct procstat *procstat, int what, int arg,
|
||||
len = *count * sizeof(*p);
|
||||
p = malloc(len);
|
||||
if (p == NULL) {
|
||||
warnx("malloc(%zd)", len);
|
||||
warnx("malloc(%zu)", len);
|
||||
goto fail;
|
||||
}
|
||||
bcopy(p0, p, len);
|
||||
@ -213,7 +213,7 @@ procstat_getprocs(struct procstat *procstat, int what, int arg,
|
||||
}
|
||||
p = malloc(len);
|
||||
if (p == NULL) {
|
||||
warnx("malloc(%zd)", len);
|
||||
warnx("malloc(%zu)", len);
|
||||
goto fail;
|
||||
}
|
||||
error = sysctl(name, 4, p, &len, NULL, 0);
|
||||
@ -229,7 +229,7 @@ procstat_getprocs(struct procstat *procstat, int what, int arg,
|
||||
*count = len / sizeof(*p);
|
||||
return (p);
|
||||
} else {
|
||||
warnx("unknown access method");
|
||||
warnx("unknown access method: %d", procstat->type);
|
||||
return (NULL);
|
||||
}
|
||||
fail:
|
||||
@ -271,11 +271,11 @@ procstat_freefiles(struct procstat *procstat, struct filestat_list *head)
|
||||
}
|
||||
free(head);
|
||||
if (procstat->vmentries != NULL) {
|
||||
free (procstat->vmentries);
|
||||
free(procstat->vmentries);
|
||||
procstat->vmentries = NULL;
|
||||
}
|
||||
if (procstat->files != NULL) {
|
||||
free (procstat->files);
|
||||
free(procstat->files);
|
||||
procstat->files = NULL;
|
||||
}
|
||||
}
|
||||
@ -426,7 +426,7 @@ procstat_getfiles_kvm(struct procstat *procstat, struct kinfo_proc *kp, int mmap
|
||||
nfiles = filed.fd_lastfile + 1;
|
||||
ofiles = malloc(nfiles * sizeof(struct file *));
|
||||
if (ofiles == NULL) {
|
||||
warn("malloc(%zd)", nfiles * sizeof(struct file *));
|
||||
warn("malloc(%zu)", nfiles * sizeof(struct file *));
|
||||
goto do_mmapped;
|
||||
}
|
||||
if (!kvm_read_all(kd, (unsigned long)filed.fd_ofiles, ofiles,
|
||||
@ -522,7 +522,8 @@ procstat_getfiles_kvm(struct procstat *procstat, struct kinfo_proc *kp, int mmap
|
||||
fflags = 0;
|
||||
if (prot & VM_PROT_READ)
|
||||
fflags = PS_FST_FFLAG_READ;
|
||||
if (prot & VM_PROT_WRITE)
|
||||
if ((vmentry.eflags & MAP_ENTRY_COW) == 0 &&
|
||||
prot & VM_PROT_WRITE)
|
||||
fflags |= PS_FST_FFLAG_WRITE;
|
||||
|
||||
/*
|
||||
@ -696,7 +697,8 @@ procstat_getfiles_sysctl(struct procstat *procstat, struct kinfo_proc *kp, int m
|
||||
fflags = 0;
|
||||
if (kve->kve_protection & KVME_PROT_READ)
|
||||
fflags = PS_FST_FFLAG_READ;
|
||||
if (kve->kve_protection & KVME_PROT_WRITE)
|
||||
if ((kve->kve_flags & KVME_FLAG_COW) == 0 &&
|
||||
kve->kve_protection & KVME_PROT_WRITE)
|
||||
fflags |= PS_FST_FFLAG_WRITE;
|
||||
offset = kve->kve_offset;
|
||||
refcount = kve->kve_ref_count;
|
||||
@ -726,7 +728,7 @@ procstat_get_pipe_info(struct procstat *procstat, struct filestat *fst,
|
||||
} else if (procstat->type == PROCSTAT_SYSCTL) {
|
||||
return (procstat_get_pipe_info_sysctl(fst, ps, errbuf));
|
||||
} else {
|
||||
warnx("unknow access method: %d", procstat->type);
|
||||
warnx("unknown access method: %d", procstat->type);
|
||||
snprintf(errbuf, _POSIX2_LINE_MAX, "error");
|
||||
return (1);
|
||||
}
|
||||
@ -790,7 +792,7 @@ procstat_get_pts_info(struct procstat *procstat, struct filestat *fst,
|
||||
} else if (procstat->type == PROCSTAT_SYSCTL) {
|
||||
return (procstat_get_pts_info_sysctl(fst, pts, errbuf));
|
||||
} else {
|
||||
warnx("unknow access method: %d", procstat->type);
|
||||
warnx("unknown access method: %d", procstat->type);
|
||||
snprintf(errbuf, _POSIX2_LINE_MAX, "error");
|
||||
return (1);
|
||||
}
|
||||
@ -852,7 +854,7 @@ procstat_get_vnode_info(struct procstat *procstat, struct filestat *fst,
|
||||
} else if (procstat->type == PROCSTAT_SYSCTL) {
|
||||
return (procstat_get_vnode_info_sysctl(fst, vn, errbuf));
|
||||
} else {
|
||||
warnx("unknow access method: %d", procstat->type);
|
||||
warnx("unknown access method: %d", procstat->type);
|
||||
snprintf(errbuf, _POSIX2_LINE_MAX, "error");
|
||||
return (1);
|
||||
}
|
||||
@ -1059,7 +1061,7 @@ procstat_get_socket_info(struct procstat *procstat, struct filestat *fst,
|
||||
} else if (procstat->type == PROCSTAT_SYSCTL) {
|
||||
return (procstat_get_socket_info_sysctl(fst, sock, errbuf));
|
||||
} else {
|
||||
warnx("unknow access method: %d", procstat->type);
|
||||
warnx("unknown access method: %d", procstat->type);
|
||||
snprintf(errbuf, _POSIX2_LINE_MAX, "error");
|
||||
return (1);
|
||||
}
|
||||
@ -1283,7 +1285,7 @@ vntype2psfsttype(int type)
|
||||
static char *
|
||||
getmnton(kvm_t *kd, struct mount *m)
|
||||
{
|
||||
static struct mount mnt;
|
||||
struct mount mnt;
|
||||
static struct mtab {
|
||||
struct mtab *next;
|
||||
struct mount *m;
|
||||
@ -1302,7 +1304,7 @@ getmnton(kvm_t *kd, struct mount *m)
|
||||
err(1, NULL);
|
||||
mt->m = m;
|
||||
bcopy(&mnt.mnt_stat.f_mntonname[0], &mt->mntonname[0], MNAMELEN);
|
||||
mnt.mnt_stat.f_mntonname[MNAMELEN] = '\0';
|
||||
mt->mntonname[MNAMELEN] = '\0';
|
||||
mt->next = mhead;
|
||||
mhead = mt;
|
||||
return (mt->mntonname);
|
||||
|
@ -15,7 +15,7 @@ NO_PIC=
|
||||
INCS= stand.h
|
||||
MAN= libstand.3
|
||||
|
||||
WARNS?= 2
|
||||
WARNS?= 0
|
||||
|
||||
CFLAGS+= -ffreestanding -Wformat
|
||||
CFLAGS+= -I${.CURDIR}
|
||||
|
@ -110,7 +110,7 @@ Free(void *ptr, const char *file, int line)
|
||||
return;
|
||||
}
|
||||
if (*((signed char *)res + res->ga_Bytes - 1) != -2)
|
||||
panic("free: guard2 fail @ %p + %d from %s:%d", ptr, res->ga_Bytes - MALLOCALIGN, file, line);
|
||||
panic("free: guard2 fail @ %p + %zu from %s:%d", ptr, res->ga_Bytes - MALLOCALIGN, file, line);
|
||||
*((signed char *)res + res->ga_Bytes - 1) = -1;
|
||||
#endif
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
# $FreeBSD$
|
||||
|
||||
SRCS+= pthread_md.c
|
||||
SRCS+= _umtx_op_err.S pthread_md.c
|
||||
|
@ -50,10 +50,6 @@ struct tcb {
|
||||
void *tcb_spare[1];
|
||||
};
|
||||
|
||||
register struct tcb *_tp __asm("%g7");
|
||||
|
||||
#define _tcb (_tp)
|
||||
|
||||
/*
|
||||
* The tcb constructors.
|
||||
*/
|
||||
@ -64,26 +60,25 @@ void _tcb_dtor(struct tcb *);
|
||||
static __inline void
|
||||
_tcb_set(struct tcb *tcb)
|
||||
{
|
||||
_tp = tcb;
|
||||
|
||||
__asm __volatile("mov %0, %%g7" : : "r" (tcb));
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the current tcb.
|
||||
*/
|
||||
static __inline struct tcb *
|
||||
_tcb_get(void)
|
||||
{
|
||||
return (_tcb);
|
||||
}
|
||||
register struct tcb *tp __asm("%g7");
|
||||
|
||||
extern struct pthread *_thr_initial;
|
||||
return (tp);
|
||||
}
|
||||
|
||||
static __inline struct pthread *
|
||||
_get_curthread(void)
|
||||
{
|
||||
if (_thr_initial)
|
||||
return (_tcb->tcb_thread);
|
||||
return (NULL);
|
||||
|
||||
return (_tcb_get()->tcb_thread);
|
||||
}
|
||||
|
||||
#define HAS__UMTX_OP_ERR 1
|
||||
|
||||
#endif /* _PTHREAD_MD_H_ */
|
||||
|
38
lib/libthr/arch/sparc64/sparc64/_umtx_op_err.S
Normal file
38
lib/libthr/arch/sparc64/sparc64/_umtx_op_err.S
Normal file
@ -0,0 +1,38 @@
|
||||
/*-
|
||||
* Copyright (c) 2011 Marius Strobl <marius@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 <machine/asm.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/syscall.h>
|
||||
|
||||
#include <machine/utrap.h>
|
||||
|
||||
ENTRY(_umtx_op_err)
|
||||
mov SYS__umtx_op, %g1
|
||||
retl
|
||||
ta %xcc, ST_SYSCALL
|
||||
END(_umtx_op_err)
|
@ -24,10 +24,11 @@
|
||||
* 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/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <rtld_tls.h>
|
||||
|
||||
@ -37,13 +38,11 @@ struct tcb *
|
||||
_tcb_ctor(struct pthread *thread, int initial)
|
||||
{
|
||||
struct tcb *tcb;
|
||||
void *oldtls;
|
||||
|
||||
if (initial)
|
||||
oldtls = _tp;
|
||||
tcb = _tcb_get();
|
||||
else
|
||||
oldtls = NULL;
|
||||
tcb = _rtld_allocate_tls(oldtls, sizeof(struct tcb), 16);
|
||||
tcb = _rtld_allocate_tls(NULL, sizeof(struct tcb), 16);
|
||||
if (tcb)
|
||||
tcb->tcb_thread = thread;
|
||||
return (tcb);
|
||||
@ -52,5 +51,6 @@ _tcb_ctor(struct pthread *thread, int initial)
|
||||
void
|
||||
_tcb_dtor(struct tcb *tcb)
|
||||
{
|
||||
|
||||
_rtld_free_tls(tcb, sizeof(struct tcb), 16);
|
||||
}
|
||||
|
@ -409,7 +409,6 @@ init_main_thread(struct pthread *thread)
|
||||
|
||||
thread->cancel_enable = 1;
|
||||
thread->cancel_async = 0;
|
||||
thr_set_name(thread->tid, "initial thread");
|
||||
|
||||
/* Initialize the mutex queue: */
|
||||
TAILQ_INIT(&thread->mutexq);
|
||||
|
@ -82,7 +82,7 @@ __ieee754_rem_pio2l(long double x, long double *y)
|
||||
u.e = x;
|
||||
expsign = u.xbits.expsign;
|
||||
ex = expsign & 0x7fff;
|
||||
if (ex < BIAS + 25 || ex == BIAS + 25 && u.bits.manh < 0xc90fdaa2) {
|
||||
if (ex < BIAS + 25 || (ex == BIAS + 25 && u.bits.manh < 0xc90fdaa2)) {
|
||||
/* |x| ~< 2^25*(pi/2), medium size */
|
||||
/* Use a specialized rint() to get fn. Assume round-to-nearest. */
|
||||
fn = x*invpio2+0x1.8p63;
|
||||
|
@ -928,8 +928,8 @@ digest_dynamic1(Obj_Entry *obj, int early, const Elf_Dyn **dyn_rpath,
|
||||
obj->textrel = true;
|
||||
if (dynp->d_un.d_val & DF_BIND_NOW)
|
||||
obj->bind_now = true;
|
||||
if (dynp->d_un.d_val & DF_STATIC_TLS)
|
||||
;
|
||||
/*if (dynp->d_un.d_val & DF_STATIC_TLS)
|
||||
;*/
|
||||
break;
|
||||
#ifdef __mips__
|
||||
case DT_MIPS_LOCAL_GOTNO:
|
||||
@ -958,8 +958,8 @@ digest_dynamic1(Obj_Entry *obj, int early, const Elf_Dyn **dyn_rpath,
|
||||
obj->z_noopen = true;
|
||||
if ((dynp->d_un.d_val & DF_1_ORIGIN) && trust)
|
||||
obj->z_origin = true;
|
||||
if (dynp->d_un.d_val & DF_1_GLOBAL)
|
||||
/* XXX */;
|
||||
/*if (dynp->d_un.d_val & DF_1_GLOBAL)
|
||||
XXX ;*/
|
||||
if (dynp->d_un.d_val & DF_1_BIND_NOW)
|
||||
obj->bind_now = true;
|
||||
if (dynp->d_un.d_val & DF_1_NODELETE)
|
||||
|
@ -126,7 +126,7 @@ it is advisable to enclose
|
||||
in quotes.
|
||||
.It Cm scripts
|
||||
List currently defined scripts.
|
||||
.It Cm unset Ar scriptname
|
||||
.It Cm unscript Ar scriptname
|
||||
Delete the script named
|
||||
.Ar scriptname .
|
||||
.El
|
||||
|
@ -927,6 +927,7 @@ gpart_restore(struct gctl_req *req, unsigned int fl __unused)
|
||||
gctl_ro_param(r, "size", -1, argv[3]);
|
||||
if (rl != 0 && label != NULL)
|
||||
gctl_ro_param(r, "label", -1, argv[4]);
|
||||
gctl_ro_param(r, "alignment", -1, GPART_AUTOFILL);
|
||||
gctl_ro_param(r, "arg0", -1, s);
|
||||
error = gpart_autofill(r);
|
||||
if (error != 0)
|
||||
|
@ -726,11 +726,13 @@ init_remote(struct hast_resource *res, struct proto_conn **inp,
|
||||
(void)hast_activemap_flush(res);
|
||||
}
|
||||
nv_free(nvin);
|
||||
#ifdef notyet
|
||||
/* Setup directions. */
|
||||
if (proto_send(out, NULL, 0) == -1)
|
||||
pjdlog_errno(LOG_WARNING, "Unable to set connection direction");
|
||||
if (proto_recv(in, NULL, 0) == -1)
|
||||
pjdlog_errno(LOG_WARNING, "Unable to set connection direction");
|
||||
#endif
|
||||
pjdlog_info("Connected to %s.", res->hr_remoteaddr);
|
||||
if (inp != NULL && outp != NULL) {
|
||||
*inp = in;
|
||||
|
@ -183,9 +183,11 @@ init_remote(struct hast_resource *res, struct nv *nvin)
|
||||
unsigned char *map;
|
||||
size_t mapsize;
|
||||
|
||||
#ifdef notyet
|
||||
/* Setup direction. */
|
||||
if (proto_send(res->hr_remoteout, NULL, 0) == -1)
|
||||
pjdlog_errno(LOG_WARNING, "Unable to set connection direction");
|
||||
#endif
|
||||
|
||||
map = NULL;
|
||||
mapsize = 0;
|
||||
@ -351,9 +353,11 @@ init_remote(struct hast_resource *res, struct nv *nvin)
|
||||
if (map != NULL)
|
||||
free(map);
|
||||
nv_free(nvout);
|
||||
#ifdef notyet
|
||||
/* Setup direction. */
|
||||
if (proto_recv(res->hr_remotein, NULL, 0) == -1)
|
||||
pjdlog_errno(LOG_WARNING, "Unable to set connection direction");
|
||||
#endif
|
||||
if (res->hr_secondary_localcnt > res->hr_primary_remotecnt &&
|
||||
res->hr_primary_localcnt > res->hr_secondary_remotecnt) {
|
||||
/* Exit on split-brain. */
|
||||
|
@ -21,6 +21,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/sockio.h>
|
||||
#include <sys/sysctl.h>
|
||||
@ -3567,7 +3568,7 @@ ipfw_add(char *av[])
|
||||
}
|
||||
if (lookup_key[j] <= 0)
|
||||
errx(EX_USAGE, "format: cannot lookup on %s", *av);
|
||||
c->d[1] = j; // i converted to option
|
||||
__PAST_END(c->d, 1) = j; // i converted to option
|
||||
av++;
|
||||
cmd->arg1 = strtoul(*av, &p, 0);
|
||||
if (p && *p)
|
||||
|
@ -315,14 +315,19 @@ static int
|
||||
estimate_redir_addr(int *ac, char ***av)
|
||||
{
|
||||
size_t space = sizeof(struct cfg_redir);
|
||||
char *sep;
|
||||
char *sep = **av;
|
||||
u_int c = 0;
|
||||
|
||||
if ((sep = strtok(**av, ",")) != NULL) {
|
||||
space += sizeof(struct cfg_spool);
|
||||
while ((sep = strtok(NULL, ",")) != NULL)
|
||||
space += sizeof(struct cfg_spool);
|
||||
while ((sep = strchr(sep, ',')) != NULL) {
|
||||
c++;
|
||||
sep++;
|
||||
}
|
||||
|
||||
if (c > 0)
|
||||
c++;
|
||||
|
||||
space += c * sizeof(struct cfg_spool);
|
||||
|
||||
return (space);
|
||||
}
|
||||
|
||||
@ -370,14 +375,19 @@ static int
|
||||
estimate_redir_port(int *ac, char ***av)
|
||||
{
|
||||
size_t space = sizeof(struct cfg_redir);
|
||||
char *sep;
|
||||
char *sep = **av;
|
||||
u_int c = 0;
|
||||
|
||||
if ((sep = strtok(**av, ",")) != NULL) {
|
||||
space += sizeof(struct cfg_spool);
|
||||
while ((sep = strtok(NULL, ",")) != NULL)
|
||||
space += sizeof(struct cfg_spool);
|
||||
while ((sep = strchr(sep, ',')) != NULL) {
|
||||
c++;
|
||||
sep++;
|
||||
}
|
||||
|
||||
if (c > 0)
|
||||
c++;
|
||||
|
||||
space += c * sizeof(struct cfg_spool);
|
||||
|
||||
return (space);
|
||||
}
|
||||
|
||||
@ -465,10 +475,10 @@ setup_redir_port(char *buf, int *ac, char ***av)
|
||||
* Extract remote address and optionally port.
|
||||
*/
|
||||
/*
|
||||
* NB: isalpha(**av) => we've to check that next parameter is really an
|
||||
* NB: isdigit(**av) => we've to check that next parameter is really an
|
||||
* option for this redirect entry, else stop here processing arg[cv].
|
||||
*/
|
||||
if (*ac != 0 && !isalpha(***av)) {
|
||||
if (*ac != 0 && isdigit(***av)) {
|
||||
if ((sep = strchr(**av, ':')) != NULL) {
|
||||
if (StrToAddrAndPortRange(**av, &r->raddr, protoName,
|
||||
&portRange) != 0)
|
||||
@ -584,7 +594,7 @@ setup_redir_proto(char *buf, int *ac, char ***av)
|
||||
r->raddr.s_addr = INADDR_ANY;
|
||||
} else {
|
||||
/* see above in setup_redir_port() */
|
||||
if (!isalpha(***av)) {
|
||||
if (isdigit(***av)) {
|
||||
StrToAddr(**av, &r->paddr);
|
||||
(*av)++; (*ac)--;
|
||||
|
||||
@ -592,7 +602,7 @@ setup_redir_proto(char *buf, int *ac, char ***av)
|
||||
* Extract optional remote address.
|
||||
*/
|
||||
/* see above in setup_redir_port() */
|
||||
if (*ac != 0 && !isalpha(***av)) {
|
||||
if (*ac != 0 && isdigit(***av)) {
|
||||
StrToAddr(**av, &r->raddr);
|
||||
(*av)++; (*ac)--;
|
||||
}
|
||||
@ -774,6 +784,9 @@ ipfw_config_nat(int ac, char **av)
|
||||
av1++; ac1--;
|
||||
len += estimate_redir_port(&ac1, &av1);
|
||||
av1 += 2; ac1 -= 2;
|
||||
/* Skip optional remoteIP/port */
|
||||
if (ac1 != 0 && isdigit(**av1))
|
||||
av1++; ac1--;
|
||||
break;
|
||||
case TOK_REDIR_PROTO:
|
||||
if (ac1 < 2)
|
||||
@ -781,6 +794,11 @@ ipfw_config_nat(int ac, char **av)
|
||||
"not enough arguments");
|
||||
len += sizeof(struct cfg_redir);
|
||||
av1 += 2; ac1 -= 2;
|
||||
/* Skip optional remoteIP/port */
|
||||
if (ac1 != 0 && isdigit(**av1))
|
||||
av1++; ac1--;
|
||||
if (ac1 != 0 && isdigit(**av1))
|
||||
av1++; ac1--;
|
||||
break;
|
||||
default:
|
||||
errx(EX_DATAERR, "unrecognised option ``%s''", av1[-1]);
|
||||
|
@ -188,6 +188,7 @@
|
||||
#SUPFILE= /usr/share/examples/cvsup/standard-supfile
|
||||
#PORTSSUPFILE= /usr/share/examples/cvsup/ports-supfile
|
||||
#DOCSUPFILE= /usr/share/examples/cvsup/doc-supfile
|
||||
#WWWSUPFILE= /usr/share/examples/cvsup/www-supfile
|
||||
#
|
||||
# top(1) uses a hash table for the user names. The size of this hash
|
||||
# can be tuned to match the number of local users. The table size should
|
||||
|
@ -668,16 +668,20 @@ and
|
||||
A few Hardware/OEM vendors tend to screw up BIOS settings, thus
|
||||
rendering the
|
||||
.Nm
|
||||
driver useless, which usually results in a state where the
|
||||
driver useless.
|
||||
This usually results in a state where the
|
||||
.Nm
|
||||
driver seems to attach and work, but without any sound. Some of
|
||||
that cases can be solved by tuning loader.conf variables. But before
|
||||
trying to fix problem that way, make sure that problem is really exists
|
||||
and the PCM audio device you are using really corresponds to expected
|
||||
driver seems to attach and work, but no sound is played.
|
||||
Some cases can be solved by tuning
|
||||
.Pa loader.conf
|
||||
variables.
|
||||
Before trying to fix problem that way, make sure that there really is a problem
|
||||
and that the PCM audio device in use really corresponds to the expected
|
||||
audio connector.
|
||||
.Pp
|
||||
Some vendors use non-standardized General Purpose I/O (GPIO) pins of codec
|
||||
to control external amplifiers. In some cases setting proper combination of
|
||||
GPIO bits may be needed to make sound work on specific device.
|
||||
Some vendors use non-standardized General Purpose I/O (GPIO) pins of the codec
|
||||
to control external amplifiers.
|
||||
In some cases setting a combination of GPIO bits may be needed to make
|
||||
sound work on a specific device.
|
||||
.Pp
|
||||
HDMI and DisplayPort audio may also require support from video driver.
|
||||
|
@ -24,7 +24,7 @@
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd December 15, 2009
|
||||
.Dd June 16, 2011
|
||||
.Dt MAKE.CONF 5
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -181,7 +181,11 @@ options.
|
||||
.Pq Vt bool
|
||||
Set this to use
|
||||
.Xr cvs 1
|
||||
to update your ports with
|
||||
to update your
|
||||
.Pa src , ports
|
||||
and
|
||||
.Pa doc
|
||||
trees with
|
||||
.Dq Li "make update" .
|
||||
.It Va CXXFLAGS
|
||||
.Pq Vt str
|
||||
@ -202,8 +206,8 @@ The documentation
|
||||
.Ar supfile
|
||||
to use when doing a
|
||||
.Dq Li "make update" .
|
||||
This defaults to
|
||||
.Pa /usr/share/examples/cvsup/doc\-supfile .
|
||||
For example,
|
||||
.Pa /usr/share/examples/cvsup/doc-supfile .
|
||||
.It Va INSTALL
|
||||
.Pq Vt str
|
||||
the default install command.
|
||||
@ -259,14 +263,18 @@ Set this to not update the doc tree during
|
||||
.Pq Vt bool
|
||||
Set this to not update the ports tree during
|
||||
.Dq Li "make update" .
|
||||
.It Va NO_WWWUPDATE
|
||||
.Pq Vt bool
|
||||
Set this to not update the www tree during
|
||||
.Dq Li "make update" .
|
||||
.It Va PORTSSUPFILE
|
||||
.Pq Vt str
|
||||
The ports
|
||||
.Ar supfile
|
||||
to use when doing a
|
||||
.Dq Li "make update" .
|
||||
This defaults to
|
||||
.Pa /usr/share/examples/cvsup/ports\-supfile .
|
||||
For example,
|
||||
.Pa /usr/share/examples/cvsup/ports-supfile .
|
||||
.It Va SUP
|
||||
.Pq Vt str
|
||||
The location of the
|
||||
@ -281,24 +289,20 @@ The first
|
||||
.Ar supfile
|
||||
to use when doing a
|
||||
.Dq Li "make update" .
|
||||
This defaults to
|
||||
.Pa /usr/share/examples/cvsup/standard\-supfile .
|
||||
For example,
|
||||
.Pa /usr/share/examples/cvsup/standard-supfile .
|
||||
.It Va SUPFILE1
|
||||
.Pq Vt str
|
||||
The second
|
||||
.Ar supfile
|
||||
to use when doing a
|
||||
.Dq Li "make update" .
|
||||
This defaults to
|
||||
.Pa /usr/share/examples/cvsup/secure\-supfile .
|
||||
.It Va SUPFILE2
|
||||
.Pq Vt str
|
||||
The third
|
||||
.Ar supfile
|
||||
to use when doing a
|
||||
.Dq Li "make update" .
|
||||
This defaults to
|
||||
.Pa /usr/share/examples/cvsup/secure\-supfile .
|
||||
.It Va SUPFLAGS
|
||||
.Pq Vt str
|
||||
The flag for the
|
||||
@ -315,16 +319,28 @@ The hostname of the sup server to use when doing
|
||||
.Pq Vt bool
|
||||
Set this to use
|
||||
.Xr cvsup 1
|
||||
to update your ports with
|
||||
to update your
|
||||
.Pa src , ports , doc
|
||||
and
|
||||
.Pa www
|
||||
trees with
|
||||
.Dq Li "make update" .
|
||||
.It Va SVN_UPDATE
|
||||
.Pq Vt bool
|
||||
Set this to use
|
||||
.Xr svn 1
|
||||
to update your
|
||||
.Pa src
|
||||
tree with
|
||||
.Dq Li "make update" .
|
||||
.It Va WWWSUPFILE
|
||||
.Pq Vt str
|
||||
The www
|
||||
.Ar supfile
|
||||
to use when doing a
|
||||
.Dq Li "make update"
|
||||
This defaults to
|
||||
.Pa /usr/share/examples/cvsup/www\-supfile .
|
||||
.Dq Li "make update" .
|
||||
For example,
|
||||
.Pa /usr/share/examples/cvsup/www-supfile .
|
||||
.El
|
||||
.Ss "BUILDING THE KERNEL"
|
||||
The following list provides a name and short description for variables
|
||||
@ -730,6 +746,7 @@ filter, or both.
|
||||
.Bl -tag -width ".Pa /usr/share/examples/etc/make.conf" -compact
|
||||
.It Pa /etc/make.conf
|
||||
.It Pa /usr/doc/Makefile
|
||||
.It Pa /usr/ports/Makefile
|
||||
.It Pa /usr/share/examples/etc/make.conf
|
||||
.It Pa /usr/share/mk/sys.mk
|
||||
.It Pa /usr/src/Makefile
|
||||
|
@ -24,7 +24,7 @@
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd April 27, 2011
|
||||
.Dd June 18, 2011
|
||||
.Dt RC.CONF 5
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -196,6 +196,14 @@ Configuration file for
|
||||
.Xr ddb 8 .
|
||||
Default
|
||||
.Pa /etc/ddb.conf .
|
||||
.It Va kld_list
|
||||
.Pq Vt str
|
||||
A list of kernel modules to load right after the local
|
||||
disks are mounted.
|
||||
Loading modules at this point in the boot process is
|
||||
much faster than doing it via
|
||||
.Pa /boot/loader.conf
|
||||
for those modules not necessary for mounting local disk.
|
||||
.It Va kldxref_enable
|
||||
.Pq Vt bool
|
||||
Set to
|
||||
|
@ -1,7 +1,7 @@
|
||||
.\" DO NOT EDIT-- this file is automatically generated.
|
||||
.\" from FreeBSD: head/tools/build/options/makeman 221733 2011-05-10 13:01:11Z ru
|
||||
.\" $FreeBSD$
|
||||
.Dd May 22, 2011
|
||||
.Dd June 17, 2011
|
||||
.Dt SRC.CONF 5
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -78,11 +78,11 @@ The following list provides a name and short description for variables
|
||||
that can be used for source builds.
|
||||
.Bl -tag -width indent
|
||||
.It Va WITHOUT_ACCT
|
||||
.\" from FreeBSD: head/tools/build/options/WITHOUT_ACCT 221540 2011-05-06 19:13:03Z ru
|
||||
.\" from FreeBSD: head/tools/build/options/WITHOUT_ACCT 223201 2011-06-17 20:47:44Z ed
|
||||
Set to not build process accounting tools such as
|
||||
.Xr ac 8
|
||||
.Xr accton 8
|
||||
and
|
||||
.Xr accton 8 .
|
||||
.Xr sa 8 .
|
||||
.It Va WITHOUT_ACPI
|
||||
.\" from FreeBSD: head/tools/build/options/WITHOUT_ACPI 156932 2006-03-21 07:50:50Z ru
|
||||
Set to not build
|
||||
@ -225,8 +225,8 @@ Set to not build the boot blocks and loader.
|
||||
Set to not build the BSD licensed version of cpio based on
|
||||
.Xr libarchive 3 .
|
||||
.It Va WITH_BSD_GREP
|
||||
.\" from FreeBSD: head/tools/build/options/WITH_BSD_GREP 211701 2010-08-23 10:04:26Z gabor
|
||||
Build BSD-licensed grep instead of GNU grep.
|
||||
.\" from FreeBSD: head/tools/build/options/WITH_BSD_GREP 222273 2011-05-25 01:04:12Z obrien
|
||||
Install BSD-licensed grep as '[ef]grep' instead of GNU grep.
|
||||
.It Va WITHOUT_BSNMP
|
||||
.\" from FreeBSD: head/tools/build/options/WITHOUT_BSNMP 183306 2008-09-23 16:15:42Z sam
|
||||
Set to not build or install
|
||||
@ -916,6 +916,17 @@ When set, it also enforces the following options:
|
||||
.It Va WITHOUT_USB
|
||||
.\" from FreeBSD: head/tools/build/options/WITHOUT_USB 156932 2006-03-21 07:50:50Z ru
|
||||
Set to not build USB-related programs and libraries.
|
||||
.It Va WITHOUT_UTMPX
|
||||
.\" from FreeBSD: head/tools/build/options/WITHOUT_UTMPX 223209 2011-06-17 21:30:21Z ed
|
||||
Set to not build user accounting tools such as
|
||||
.Xr last 1 ,
|
||||
.Xr users 1 ,
|
||||
.Xr who 1 ,
|
||||
.Xr wtmpcvt 1 ,
|
||||
.Xr ac 8 ,
|
||||
.Xr lastlogin 8
|
||||
and
|
||||
.Xr utxrm 8 .
|
||||
.It Va WITHOUT_WIRELESS
|
||||
.\" from FreeBSD: head/tools/build/options/WITHOUT_WIRELESS 183242 2008-09-21 22:02:26Z sam
|
||||
Set to not build programs used for 802.11 wireless networks; especially
|
||||
|
@ -24,7 +24,7 @@
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd March 18, 2011
|
||||
.Dd June 16, 2011
|
||||
.Dt BUILD 7
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -517,6 +517,10 @@ target.
|
||||
If set, the update process does not update the Ports tree as part of the
|
||||
.Dq make update
|
||||
target.
|
||||
.It Va NO_WWWUPDATE
|
||||
If set, the update process does not update the www tree as part of the
|
||||
.Dq make update
|
||||
target.
|
||||
.El
|
||||
.Pp
|
||||
Builds under directory
|
||||
|
@ -860,6 +860,22 @@ MLINKS+=\
|
||||
mbuf.9 mtod.9 \
|
||||
mbuf.9 M_TRAILINGSPACE.9 \
|
||||
mbuf.9 M_WRITABLE.9
|
||||
MLINKS+=\
|
||||
mbuf_tags.9 m_tag_alloc.9 \
|
||||
mbuf_tags.9 m_tag_copy.9 \
|
||||
mbuf_tags.9 m_tag_copy_chain.9 \
|
||||
mbuf_tags.9 m_tag_delete.9 \
|
||||
mbuf_tags.9 m_tag_delete_chain.9 \
|
||||
mbuf_tags.9 m_tag_delete_nonpersistent.9 \
|
||||
mbuf_tags.9 m_tag_find.9 \
|
||||
mbuf_tags.9 m_tag_first.9 \
|
||||
mbuf_tags.9 m_tag_free.9 \
|
||||
mbuf_tags.9 m_tag_get.9 \
|
||||
mbuf_tags.9 m_tag_init.9 \
|
||||
mbuf_tags.9 m_tag_locate.9 \
|
||||
mbuf_tags.9 m_tag_next.9 \
|
||||
mbuf_tags.9 m_tag_prepend.9 \
|
||||
mbuf_tags.9 m_tag_unlink.9
|
||||
MLINKS+=MD5.9 MD5Init.9 \
|
||||
MD5.9 MD5Transform.9
|
||||
MLINKS+=mdchain.9 md_append_record.9 \
|
||||
|
@ -28,7 +28,7 @@
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd May 23, 2006
|
||||
.Dd June 18, 2011
|
||||
.Dt DEVICE_GET_SYSCTL 9
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -49,7 +49,7 @@ This node can be accessed with the
|
||||
.Fn device_get_sysctl_tree
|
||||
function.
|
||||
The context for the node can be obtained with the
|
||||
.Fn device_get_sysctl_ctl
|
||||
.Fn device_get_sysctl_ctx
|
||||
function.
|
||||
.Sh SEE ALSO
|
||||
.Xr device 9
|
||||
|
@ -989,9 +989,11 @@
|
||||
0x0B Armature
|
||||
0x0C Multiple Point Digitizer
|
||||
0x0D Free Space Wand
|
||||
0x0E Device Configuration
|
||||
0x20 Stylus
|
||||
0x21 Puck
|
||||
0x22 Finger
|
||||
0x23 Device Settings
|
||||
0x30 Tip Pressure
|
||||
0x31 Barrel Pressure
|
||||
0x32 In Range
|
||||
@ -1015,6 +1017,14 @@
|
||||
0x44 Barrel Switch
|
||||
0x45 Eraser
|
||||
0x46 Tablet Pick
|
||||
0x47 Touch Valid
|
||||
0x48 Width
|
||||
0x49 Height
|
||||
0x51 Contact Identifier
|
||||
0x52 Device Mode
|
||||
0x53 Device Identifier
|
||||
0x54 Contact Count
|
||||
0x55 Contact Count Maximum
|
||||
|
||||
15 Physical Interface Device
|
||||
0x00 Undefined
|
||||
|
@ -383,6 +383,7 @@ __DEFAULT_YES_OPTIONS = \
|
||||
TEXTPROC \
|
||||
TOOLCHAIN \
|
||||
USB \
|
||||
UTMPX \
|
||||
WIRELESS \
|
||||
WPA_SUPPLICANT_EAPOL \
|
||||
ZFS \
|
||||
|
@ -79,8 +79,20 @@ ia32_osigcode:
|
||||
jmp 1b
|
||||
|
||||
|
||||
/*
|
||||
* The lcall $7,$0 emulator cannot use the call gate that does an
|
||||
* inter-privilege transition. The reason is that the call gate
|
||||
* does not disable interrupts, and, before the swapgs is
|
||||
* executed, we would have a window where the ring 0 code is
|
||||
* executed with the wrong gsbase.
|
||||
*
|
||||
* Instead, reflect the lcall $7,$0 back to ring 3 trampoline
|
||||
* which sets up the frame for int $0x80.
|
||||
*/
|
||||
ALIGN_TEXT
|
||||
lcall_tramp:
|
||||
cmpl $SYS_vfork,%eax
|
||||
je 2f
|
||||
pushl %ebp
|
||||
movl %esp,%ebp
|
||||
pushl 0x24(%ebp) /* arg 6 */
|
||||
@ -91,8 +103,19 @@ lcall_tramp:
|
||||
pushl 0x10(%ebp) /* arg 1 */
|
||||
pushl 0xc(%ebp) /* gap */
|
||||
int $0x80
|
||||
leave
|
||||
leavel
|
||||
1:
|
||||
lretl
|
||||
2:
|
||||
/*
|
||||
* vfork handling is special and relies on the libc stub saving
|
||||
* the return ip in %ecx. If vfork failed, then there is no
|
||||
* child which can corrupt the frame created by call gate.
|
||||
*/
|
||||
int $0x80
|
||||
jb 1b
|
||||
addl $8,%esp
|
||||
jmpl *%ecx
|
||||
#endif
|
||||
|
||||
ALIGN_TEXT
|
||||
|
@ -196,7 +196,7 @@ static int
|
||||
__elfN(obj_loadimage)(struct preloaded_file *fp, elf_file_t ef, u_int64_t off)
|
||||
{
|
||||
Elf_Ehdr *hdr;
|
||||
Elf_Shdr *shdr;
|
||||
Elf_Shdr *shdr, *cshdr, *lshdr;
|
||||
vm_offset_t firstaddr, lastaddr;
|
||||
int i, nsym, res, ret, shdrbytes, symstrindex;
|
||||
|
||||
@ -294,12 +294,35 @@ __elfN(obj_loadimage)(struct preloaded_file *fp, elf_file_t ef, u_int64_t off)
|
||||
/* Clear the whole area, including bss regions. */
|
||||
kern_bzero(firstaddr, lastaddr - firstaddr);
|
||||
|
||||
/* Now read it all in. */
|
||||
for (i = 0; i < hdr->e_shnum; i++) {
|
||||
if (shdr[i].sh_addr == 0 || shdr[i].sh_type == SHT_NOBITS)
|
||||
continue;
|
||||
if (kern_pread(ef->fd, (vm_offset_t)shdr[i].sh_addr,
|
||||
shdr[i].sh_size, (off_t)shdr[i].sh_offset) != 0) {
|
||||
/* Figure section with the lowest file offset we haven't loaded yet. */
|
||||
for (cshdr = NULL; /* none */; /* none */)
|
||||
{
|
||||
/*
|
||||
* Find next section to load. The complexity of this loop is
|
||||
* O(n^2), but with the number of sections being typically
|
||||
* small, we do not care.
|
||||
*/
|
||||
lshdr = cshdr;
|
||||
|
||||
for (i = 0; i < hdr->e_shnum; i++) {
|
||||
if (shdr[i].sh_addr == 0 ||
|
||||
shdr[i].sh_type == SHT_NOBITS)
|
||||
continue;
|
||||
/* Skip sections that were loaded already. */
|
||||
if (lshdr != NULL &&
|
||||
lshdr->sh_offset >= shdr[i].sh_offset)
|
||||
continue;
|
||||
/* Find section with smallest offset. */
|
||||
if (cshdr == lshdr ||
|
||||
cshdr->sh_offset > shdr[i].sh_offset)
|
||||
cshdr = &shdr[i];
|
||||
}
|
||||
|
||||
if (cshdr == lshdr)
|
||||
break;
|
||||
|
||||
if (kern_pread(ef->fd, (vm_offset_t)cshdr->sh_addr,
|
||||
cshdr->sh_size, (off_t)cshdr->sh_offset) != 0) {
|
||||
printf("\nelf" __XSTRING(__ELF_WORD_SIZE)
|
||||
"_obj_loadimage: read failed\n");
|
||||
goto out;
|
||||
|
@ -61,7 +61,7 @@ biosacpi_detect(void)
|
||||
return;
|
||||
|
||||
/* export values from the RSDP */
|
||||
sprintf(buf, "%p", VTOP(rsdp));
|
||||
sprintf(buf, "%u", VTOP(rsdp));
|
||||
setenv("hint.acpi.0.rsdp", buf, 1);
|
||||
revision = rsdp->Revision;
|
||||
if (revision == 0)
|
||||
|
@ -818,7 +818,7 @@ adagetattr(struct bio *bp)
|
||||
int ret = -1;
|
||||
struct cam_periph *periph;
|
||||
|
||||
if (bp->bio_disk == NULL || bp->bio_disk->d_drv1)
|
||||
if (bp->bio_disk == NULL || bp->bio_disk->d_drv1 == NULL)
|
||||
return ENXIO;
|
||||
periph = (struct cam_periph *)bp->bio_disk->d_drv1;
|
||||
if (periph->path == NULL)
|
||||
|
@ -65,7 +65,7 @@ typedef long ctf_id_t;
|
||||
* filling in ctf_sect_t structures and passing them to ctf_bufopen():
|
||||
*/
|
||||
typedef struct ctf_sect {
|
||||
char *cts_name; /* section name (if any) */
|
||||
const char *cts_name; /* section name (if any) */
|
||||
ulong_t cts_type; /* section type (ELF SHT_... value) */
|
||||
ulong_t cts_flags; /* section flags (ELF SHF_... value) */
|
||||
#if defined(sun)
|
||||
|
@ -1416,6 +1416,19 @@ freebsd32_pwrite(struct thread *td, struct freebsd32_pwrite_args *uap)
|
||||
return (pwrite(td, &ap));
|
||||
}
|
||||
|
||||
#ifdef COMPAT_43
|
||||
int
|
||||
ofreebsd32_lseek(struct thread *td, struct ofreebsd32_lseek_args *uap)
|
||||
{
|
||||
struct lseek_args nuap;
|
||||
|
||||
nuap.fd = uap->fd;
|
||||
nuap.offset = uap->offset;
|
||||
nuap.whence = uap->whence;
|
||||
return (lseek(td, &nuap));
|
||||
}
|
||||
#endif
|
||||
|
||||
int
|
||||
freebsd32_lseek(struct thread *td, struct freebsd32_lseek_args *uap)
|
||||
{
|
||||
|
@ -3,7 +3,7 @@
|
||||
*
|
||||
* DO NOT EDIT-- this file is automatically generated.
|
||||
* $FreeBSD$
|
||||
* created from FreeBSD
|
||||
* created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 223166 2011-06-16 22:05:56Z kib
|
||||
*/
|
||||
|
||||
#ifndef _FREEBSD32_SYSPROTO_H_
|
||||
@ -690,6 +690,11 @@ int freebsd32_posix_fallocate(struct thread *, struct freebsd32_posix_fallocate_
|
||||
#if !defined(PAD64_REQUIRED) && defined(__powerpc__)
|
||||
#define PAD64_REQUIRED
|
||||
#endif
|
||||
struct ofreebsd32_lseek_args {
|
||||
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
|
||||
char offset_l_[PADL_(int)]; int offset; char offset_r_[PADR_(int)];
|
||||
char whence_l_[PADL_(int)]; int whence; char whence_r_[PADR_(int)];
|
||||
};
|
||||
struct ofreebsd32_stat_args {
|
||||
char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
|
||||
char ub_l_[PADL_(struct ostat32 *)]; struct ostat32 * ub; char ub_r_[PADR_(struct ostat32 *)];
|
||||
@ -747,6 +752,7 @@ struct ofreebsd32_getdirentries_args {
|
||||
#ifdef PAD64_REQUIRED
|
||||
#else
|
||||
#endif
|
||||
int ofreebsd32_lseek(struct thread *, struct ofreebsd32_lseek_args *);
|
||||
int ofreebsd32_stat(struct thread *, struct ofreebsd32_stat_args *);
|
||||
int ofreebsd32_lstat(struct thread *, struct ofreebsd32_lstat_args *);
|
||||
int ofreebsd32_sigaction(struct thread *, struct ofreebsd32_sigaction_args *);
|
||||
@ -923,6 +929,7 @@ int freebsd7_freebsd32_shmctl(struct thread *, struct freebsd7_freebsd32_shmctl_
|
||||
|
||||
#define FREEBSD32_SYS_AUE_freebsd32_wait4 AUE_WAIT4
|
||||
#define FREEBSD32_SYS_AUE_freebsd4_freebsd32_getfsstat AUE_GETFSSTAT
|
||||
#define FREEBSD32_SYS_AUE_ofreebsd32_lseek AUE_LSEEK
|
||||
#define FREEBSD32_SYS_AUE_freebsd32_recvmsg AUE_RECVMSG
|
||||
#define FREEBSD32_SYS_AUE_freebsd32_sendmsg AUE_SENDMSG
|
||||
#define FREEBSD32_SYS_AUE_freebsd32_recvfrom AUE_RECVFROM
|
||||
|
@ -3,7 +3,7 @@
|
||||
*
|
||||
* DO NOT EDIT-- this file is automatically generated.
|
||||
* $FreeBSD$
|
||||
* created from FreeBSD
|
||||
* created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 223166 2011-06-16 22:05:56Z kib
|
||||
*/
|
||||
|
||||
#define FREEBSD32_SYS_syscall 0
|
||||
@ -25,7 +25,7 @@
|
||||
#define FREEBSD32_SYS_chown 16
|
||||
#define FREEBSD32_SYS_break 17
|
||||
#define FREEBSD32_SYS_freebsd4_freebsd32_getfsstat 18
|
||||
/* 19 is obsolete olseek */
|
||||
/* 19 is old freebsd32_lseek */
|
||||
#define FREEBSD32_SYS_getpid 20
|
||||
#define FREEBSD32_SYS_mount 21
|
||||
#define FREEBSD32_SYS_unmount 22
|
||||
|
@ -3,7 +3,7 @@
|
||||
*
|
||||
* DO NOT EDIT-- this file is automatically generated.
|
||||
* $FreeBSD$
|
||||
* created from FreeBSD
|
||||
* created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 223166 2011-06-16 22:05:56Z kib
|
||||
*/
|
||||
|
||||
const char *freebsd32_syscallnames[] = {
|
||||
@ -29,7 +29,7 @@ const char *freebsd32_syscallnames[] = {
|
||||
"chown", /* 16 = chown */
|
||||
"break", /* 17 = break */
|
||||
"compat4.freebsd32_getfsstat", /* 18 = freebsd4 freebsd32_getfsstat */
|
||||
"obs_olseek", /* 19 = obsolete olseek */
|
||||
"compat.freebsd32_lseek", /* 19 = old freebsd32_lseek */
|
||||
"getpid", /* 20 = getpid */
|
||||
"mount", /* 21 = mount */
|
||||
"unmount", /* 22 = unmount */
|
||||
|
@ -3,7 +3,7 @@
|
||||
*
|
||||
* DO NOT EDIT-- this file is automatically generated.
|
||||
* $FreeBSD$
|
||||
* created from FreeBSD
|
||||
* created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 223166 2011-06-16 22:05:56Z kib
|
||||
*/
|
||||
|
||||
#include "opt_compat.h"
|
||||
@ -66,7 +66,7 @@ struct sysent freebsd32_sysent[] = {
|
||||
{ AS(chown_args), (sy_call_t *)chown, AUE_CHOWN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 16 = chown */
|
||||
{ AS(obreak_args), (sy_call_t *)obreak, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 17 = break */
|
||||
{ compat4(AS(freebsd4_freebsd32_getfsstat_args),freebsd32_getfsstat), AUE_GETFSSTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 18 = freebsd4 freebsd32_getfsstat */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 19 = obsolete olseek */
|
||||
{ compat(AS(ofreebsd32_lseek_args),freebsd32_lseek), AUE_LSEEK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 19 = old freebsd32_lseek */
|
||||
{ 0, (sy_call_t *)getpid, AUE_GETPID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 20 = getpid */
|
||||
{ AS(mount_args), (sy_call_t *)mount, AUE_MOUNT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 21 = mount */
|
||||
{ AS(unmount_args), (sy_call_t *)unmount, AUE_UMOUNT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 22 = unmount */
|
||||
|
@ -89,7 +89,8 @@
|
||||
18 AUE_GETFSSTAT COMPAT4 { int freebsd32_getfsstat( \
|
||||
struct statfs32 *buf, long bufsize, \
|
||||
int flags); }
|
||||
19 AUE_LSEEK OBSOL olseek
|
||||
19 AUE_LSEEK COMPAT { int freebsd32_lseek(int fd, int offset, \
|
||||
int whence); }
|
||||
20 AUE_GETPID NOPROTO { pid_t getpid(void); }
|
||||
21 AUE_MOUNT NOPROTO { int mount(char *type, char *path, \
|
||||
int flags, caddr_t data); }
|
||||
|
@ -1049,6 +1049,15 @@ linprocfs_doproccmdline(PFS_FILL_ARGS)
|
||||
PROC_UNLOCK(p);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
/*
|
||||
* Mimic linux behavior and pass only processes with usermode
|
||||
* address space as valid. Return zero silently otherwize.
|
||||
*/
|
||||
if (p->p_vmspace == &vmspace0) {
|
||||
PROC_UNLOCK(p);
|
||||
return (0);
|
||||
}
|
||||
if (p->p_args != NULL) {
|
||||
sbuf_bcpy(sb, p->p_args->ar_args, p->p_args->ar_length);
|
||||
PROC_UNLOCK(p);
|
||||
@ -1073,6 +1082,15 @@ linprocfs_doprocenviron(PFS_FILL_ARGS)
|
||||
PROC_UNLOCK(p);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
/*
|
||||
* Mimic linux behavior and pass only processes with usermode
|
||||
* address space as valid. Return zero silently otherwize.
|
||||
*/
|
||||
if (p->p_vmspace == &vmspace0) {
|
||||
PROC_UNLOCK(p);
|
||||
return (0);
|
||||
}
|
||||
PROC_UNLOCK(p);
|
||||
|
||||
ret = linprocfs_doargv(td, p, sb, ps_string_env);
|
||||
|
@ -151,6 +151,7 @@ static ACPI_STATUS acpi_sleep_disable(struct acpi_softc *sc);
|
||||
static ACPI_STATUS acpi_EnterSleepState(struct acpi_softc *sc, int state);
|
||||
static void acpi_shutdown_final(void *arg, int howto);
|
||||
static void acpi_enable_fixed_events(struct acpi_softc *sc);
|
||||
static BOOLEAN acpi_has_hid(ACPI_HANDLE handle);
|
||||
static int acpi_wake_sleep_prep(ACPI_HANDLE handle, int sstate);
|
||||
static int acpi_wake_run_prep(ACPI_HANDLE handle, int sstate);
|
||||
static int acpi_wake_prep_walk(int sstate);
|
||||
@ -1855,6 +1856,13 @@ acpi_probe_child(ACPI_HANDLE handle, UINT32 level, void *context, void **status)
|
||||
break;
|
||||
if (acpi_parse_prw(handle, &prw) == 0)
|
||||
AcpiSetupGpeForWake(handle, prw.gpe_handle, prw.gpe_bit);
|
||||
|
||||
/*
|
||||
* Ignore devices that do not have a _HID or _CID. They should
|
||||
* be discovered by other buses (e.g. the PCI bus driver).
|
||||
*/
|
||||
if (!acpi_has_hid(handle))
|
||||
break;
|
||||
/* FALLTHROUGH */
|
||||
case ACPI_TYPE_PROCESSOR:
|
||||
case ACPI_TYPE_THERMAL:
|
||||
@ -2042,6 +2050,30 @@ acpi_BatteryIsPresent(device_t dev)
|
||||
return (present);
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns true if a device has at least one valid device ID.
|
||||
*/
|
||||
static BOOLEAN
|
||||
acpi_has_hid(ACPI_HANDLE h)
|
||||
{
|
||||
ACPI_DEVICE_INFO *devinfo;
|
||||
BOOLEAN ret;
|
||||
|
||||
if (h == NULL ||
|
||||
ACPI_FAILURE(AcpiGetObjectInfo(h, &devinfo)))
|
||||
return (FALSE);
|
||||
|
||||
ret = FALSE;
|
||||
if ((devinfo->Valid & ACPI_VALID_HID) != 0)
|
||||
ret = TRUE;
|
||||
else if ((devinfo->Valid & ACPI_VALID_CID) != 0)
|
||||
if (devinfo->CompatibleIdList.Count > 0)
|
||||
ret = TRUE;
|
||||
|
||||
AcpiOsFree(devinfo);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
/*
|
||||
* Match a HID string against a handle
|
||||
*/
|
||||
|
@ -209,38 +209,24 @@ acpi_pci_update_device(ACPI_HANDLE handle, device_t pci_child)
|
||||
device_t child;
|
||||
|
||||
/*
|
||||
* Lookup and remove the unused device that acpi0 creates when it walks
|
||||
* the namespace creating devices.
|
||||
* Occasionally a PCI device may show up as an ACPI device
|
||||
* with a _HID. (For example, the TabletPC TC1000 has a
|
||||
* second PCI-ISA bridge that has a _HID for an
|
||||
* acpi_sysresource device.) In that case, leave ACPI-CA's
|
||||
* device data pointing at the ACPI-enumerated device.
|
||||
*/
|
||||
child = acpi_get_device(handle);
|
||||
if (child != NULL) {
|
||||
if (device_is_alive(child)) {
|
||||
/*
|
||||
* The TabletPC TC1000 has a second PCI-ISA bridge
|
||||
* that has a _HID for an acpi_sysresource device.
|
||||
* In that case, leave ACPI-CA's device data pointing
|
||||
* at the ACPI-enumerated device.
|
||||
*/
|
||||
device_printf(child,
|
||||
"Conflicts with PCI device %d:%d:%d\n",
|
||||
pci_get_bus(pci_child), pci_get_slot(pci_child),
|
||||
pci_get_function(pci_child));
|
||||
return;
|
||||
}
|
||||
KASSERT(device_get_parent(child) ==
|
||||
devclass_get_device(devclass_find("acpi"), 0),
|
||||
("%s: child (%s)'s parent is not acpi0", __func__,
|
||||
acpi_name(handle)));
|
||||
device_delete_child(device_get_parent(child), child);
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Update ACPI-CA to use the PCI enumerated device_t for this handle.
|
||||
*/
|
||||
status = AcpiDetachData(handle, acpi_fake_objhandler);
|
||||
if (ACPI_FAILURE(status))
|
||||
printf("WARNING: Unable to detach object data from %s - %s\n",
|
||||
acpi_name(handle), AcpiFormatException(status));
|
||||
status = AcpiAttachData(handle, acpi_fake_objhandler, pci_child);
|
||||
if (ACPI_FAILURE(status))
|
||||
printf("WARNING: Unable to attach object data to %s - %s\n",
|
||||
|
@ -170,13 +170,15 @@ static int igb_detach(device_t);
|
||||
static int igb_shutdown(device_t);
|
||||
static int igb_suspend(device_t);
|
||||
static int igb_resume(device_t);
|
||||
static void igb_start(struct ifnet *);
|
||||
static void igb_start_locked(struct tx_ring *, struct ifnet *ifp);
|
||||
#if __FreeBSD_version >= 800000
|
||||
static int igb_mq_start(struct ifnet *, struct mbuf *);
|
||||
static int igb_mq_start_locked(struct ifnet *,
|
||||
struct tx_ring *, struct mbuf *);
|
||||
static void igb_qflush(struct ifnet *);
|
||||
static void igb_deferred_mq_start(void *, int);
|
||||
#else
|
||||
static void igb_start(struct ifnet *);
|
||||
static void igb_start_locked(struct tx_ring *, struct ifnet *ifp);
|
||||
#endif
|
||||
static int igb_ioctl(struct ifnet *, u_long, caddr_t);
|
||||
static void igb_init(void *);
|
||||
@ -693,6 +695,8 @@ igb_detach(device_t dev)
|
||||
return (EBUSY);
|
||||
}
|
||||
|
||||
ether_ifdetach(adapter->ifp);
|
||||
|
||||
if (adapter->led_dev != NULL)
|
||||
led_destroy(adapter->led_dev);
|
||||
|
||||
@ -724,8 +728,6 @@ igb_detach(device_t dev)
|
||||
if (adapter->vlan_detach != NULL)
|
||||
EVENTHANDLER_DEREGISTER(vlan_unconfig, adapter->vlan_detach);
|
||||
|
||||
ether_ifdetach(adapter->ifp);
|
||||
|
||||
callout_drain(&adapter->timer);
|
||||
|
||||
igb_free_pci_resources(adapter);
|
||||
@ -784,14 +786,27 @@ igb_resume(device_t dev)
|
||||
{
|
||||
struct adapter *adapter = device_get_softc(dev);
|
||||
struct ifnet *ifp = adapter->ifp;
|
||||
#if __FreeBSD_version >= 800000
|
||||
struct tx_ring *txr = adapter->tx_rings;
|
||||
#endif
|
||||
|
||||
IGB_CORE_LOCK(adapter);
|
||||
igb_init_locked(adapter);
|
||||
igb_init_manageability(adapter);
|
||||
|
||||
if ((ifp->if_flags & IFF_UP) &&
|
||||
(ifp->if_drv_flags & IFF_DRV_RUNNING))
|
||||
(ifp->if_drv_flags & IFF_DRV_RUNNING)) {
|
||||
#if __FreeBSD_version < 800000
|
||||
igb_start(ifp);
|
||||
#else
|
||||
for (int i = 0; i < adapter->num_queues; i++, txr++) {
|
||||
IGB_TX_LOCK(txr);
|
||||
if (!drbr_empty(ifp, txr->br))
|
||||
igb_mq_start_locked(ifp, txr, NULL);
|
||||
IGB_TX_UNLOCK(txr);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
IGB_CORE_UNLOCK(adapter);
|
||||
|
||||
@ -799,6 +814,7 @@ igb_resume(device_t dev)
|
||||
}
|
||||
|
||||
|
||||
#if __FreeBSD_version < 800000
|
||||
/*********************************************************************
|
||||
* Transmit entry point
|
||||
*
|
||||
@ -875,7 +891,7 @@ igb_start(struct ifnet *ifp)
|
||||
return;
|
||||
}
|
||||
|
||||
#if __FreeBSD_version >= 800000
|
||||
#else /* __FreeBSD_version >= 800000 */
|
||||
/*
|
||||
** Multiqueue Transmit driver
|
||||
**
|
||||
@ -900,7 +916,7 @@ igb_mq_start(struct ifnet *ifp, struct mbuf *m)
|
||||
IGB_TX_UNLOCK(txr);
|
||||
} else {
|
||||
err = drbr_enqueue(ifp, txr->br, m);
|
||||
taskqueue_enqueue(que->tq, &que->que_task);
|
||||
taskqueue_enqueue(que->tq, &txr->txq_task);
|
||||
}
|
||||
|
||||
return (err);
|
||||
@ -960,6 +976,22 @@ igb_mq_start_locked(struct ifnet *ifp, struct tx_ring *txr, struct mbuf *m)
|
||||
return (err);
|
||||
}
|
||||
|
||||
/*
|
||||
* Called from a taskqueue to drain queued transmit packets.
|
||||
*/
|
||||
static void
|
||||
igb_deferred_mq_start(void *arg, int pending)
|
||||
{
|
||||
struct tx_ring *txr = arg;
|
||||
struct adapter *adapter = txr->adapter;
|
||||
struct ifnet *ifp = adapter->ifp;
|
||||
|
||||
IGB_TX_LOCK(txr);
|
||||
if (!drbr_empty(ifp, txr->br))
|
||||
igb_mq_start_locked(ifp, txr, NULL);
|
||||
IGB_TX_UNLOCK(txr);
|
||||
}
|
||||
|
||||
/*
|
||||
** Flush all ring buffers
|
||||
*/
|
||||
@ -978,7 +1010,7 @@ igb_qflush(struct ifnet *ifp)
|
||||
}
|
||||
if_qflush(ifp);
|
||||
}
|
||||
#endif /* __FreeBSD_version >= 800000 */
|
||||
#endif /* __FreeBSD_version < 800000 */
|
||||
|
||||
/*********************************************************************
|
||||
* Ioctl entry point
|
||||
@ -2180,6 +2212,7 @@ igb_allocate_legacy(struct adapter *adapter)
|
||||
{
|
||||
device_t dev = adapter->dev;
|
||||
struct igb_queue *que = adapter->queues;
|
||||
struct tx_ring *txr = adapter->tx_rings;
|
||||
int error, rid = 0;
|
||||
|
||||
/* Turn off all interrupts */
|
||||
@ -2198,6 +2231,10 @@ igb_allocate_legacy(struct adapter *adapter)
|
||||
return (ENXIO);
|
||||
}
|
||||
|
||||
#if __FreeBSD_version >= 800000
|
||||
TASK_INIT(&txr->txq_task, 0, igb_deferred_mq_start, txr);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Try allocating a fast interrupt and the associated deferred
|
||||
* processing contexts.
|
||||
@ -2268,9 +2305,13 @@ igb_allocate_msix(struct adapter *adapter)
|
||||
*/
|
||||
if (adapter->num_queues > 1)
|
||||
bus_bind_intr(dev, que->res, i);
|
||||
#if __FreeBSD_version >= 800000
|
||||
TASK_INIT(&que->txr->txq_task, 0, igb_deferred_mq_start,
|
||||
que->txr);
|
||||
#endif
|
||||
/* Make tasklet for deferred handling */
|
||||
TASK_INIT(&que->que_task, 0, igb_handle_que, que);
|
||||
que->tq = taskqueue_create_fast("igb_que", M_NOWAIT,
|
||||
que->tq = taskqueue_create("igb_que", M_NOWAIT,
|
||||
taskqueue_thread_enqueue, &que->tq);
|
||||
taskqueue_start_threads(&que->tq, 1, PI_NET, "%s que",
|
||||
device_get_nameunit(adapter->dev));
|
||||
@ -2477,13 +2518,24 @@ igb_free_pci_resources(struct adapter *adapter)
|
||||
else
|
||||
(adapter->msix != 0) ? (rid = 1):(rid = 0);
|
||||
|
||||
que = adapter->queues;
|
||||
if (adapter->tag != NULL) {
|
||||
taskqueue_drain(que->tq, &adapter->link_task);
|
||||
bus_teardown_intr(dev, adapter->res, adapter->tag);
|
||||
adapter->tag = NULL;
|
||||
}
|
||||
if (adapter->res != NULL)
|
||||
bus_release_resource(dev, SYS_RES_IRQ, rid, adapter->res);
|
||||
|
||||
for (int i = 0; i < adapter->num_queues; i++, que++) {
|
||||
if (que->tq != NULL) {
|
||||
#if __FreeBSD_version >= 800000
|
||||
taskqueue_drain(que->tq, &que->txr->txq_task);
|
||||
#endif
|
||||
taskqueue_drain(que->tq, &que->que_task);
|
||||
taskqueue_free(que->tq);
|
||||
}
|
||||
}
|
||||
mem:
|
||||
if (adapter->msix)
|
||||
pci_release_msi(dev);
|
||||
@ -2744,10 +2796,11 @@ igb_setup_interface(device_t dev, struct adapter *adapter)
|
||||
ifp->if_softc = adapter;
|
||||
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
|
||||
ifp->if_ioctl = igb_ioctl;
|
||||
ifp->if_start = igb_start;
|
||||
#if __FreeBSD_version >= 800000
|
||||
ifp->if_transmit = igb_mq_start;
|
||||
ifp->if_qflush = igb_qflush;
|
||||
#else
|
||||
ifp->if_start = igb_start;
|
||||
#endif
|
||||
IFQ_SET_MAXLEN(&ifp->if_snd, adapter->num_tx_desc - 1);
|
||||
ifp->if_snd.ifq_drv_maxlen = adapter->num_tx_desc - 1;
|
||||
|
@ -297,6 +297,7 @@ struct tx_ring {
|
||||
struct buf_ring *br;
|
||||
#endif
|
||||
bus_dma_tag_t txtag;
|
||||
struct task txq_task;
|
||||
|
||||
u32 bytes;
|
||||
u32 packets;
|
||||
|
@ -800,24 +800,36 @@ cbb_power(device_t brdev, int volts)
|
||||
* We have a shortish timeout of 500ms here. Some bridges do
|
||||
* not generate a POWER_CYCLE event for 16-bit cards. In
|
||||
* those cases, we have to cope the best we can, and having
|
||||
* only a short delay is better than the alternatives.
|
||||
* only a short delay is better than the alternatives. Others
|
||||
* raise the power cycle a smidge before it is really ready.
|
||||
* We deal with those below.
|
||||
*/
|
||||
sane = 10;
|
||||
while (!(cbb_get(sc, CBB_SOCKET_STATE) & CBB_STATE_POWER_CYCLE) &&
|
||||
cnt == sc->powerintr && sane-- > 0)
|
||||
msleep(&sc->powerintr, &sc->mtx, 0, "-", hz / 20);
|
||||
mtx_unlock(&sc->mtx);
|
||||
|
||||
/*
|
||||
* Relax for 100ms. Some bridges appear to assert this signal
|
||||
* right away, but before the card has stabilized. Other
|
||||
* cards need need more time to cope up reliabily.
|
||||
* Experiments with troublesome setups show this to be a
|
||||
* "cheap" way to enhance reliabilty. We need not do this for
|
||||
* "off" since we don't touch the card after we turn it off.
|
||||
*/
|
||||
pause("cbbPwr", min(hz / 10, 1));
|
||||
|
||||
/*
|
||||
* The TOPIC95B requires a little bit extra time to get its
|
||||
* act together, so delay for an additional 100ms. Also as
|
||||
* documented below, it doesn't seem to set the POWER_CYCLE
|
||||
* bit, so don't whine if it never came on.
|
||||
*/
|
||||
if (sc->chipset == CB_TOPIC95) {
|
||||
if (sc->chipset == CB_TOPIC95)
|
||||
pause("cbb95B", hz / 10);
|
||||
} else if (sane <= 0) {
|
||||
else if (sane <= 0)
|
||||
device_printf(sc->dev, "power timeout, doom?\n");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -210,6 +210,7 @@ static const struct usb_device_id udav_devs[] = {
|
||||
{USB_VPI(USB_VENDOR_SHANTOU, USB_PRODUCT_SHANTOU_ADM8515, 0)},
|
||||
/* Kontron AG USB Ethernet */
|
||||
{USB_VPI(USB_VENDOR_KONTRON, USB_PRODUCT_KONTRON_DM9601, 0)},
|
||||
{USB_VPI(USB_VENDOR_KONTRON, USB_PRODUCT_KONTRON_JP1082, 0)},
|
||||
};
|
||||
|
||||
static void
|
||||
|
@ -2014,6 +2014,7 @@ product KODAK DC280 0x0130 Digital Science DC280
|
||||
|
||||
/* Kontron AG products */
|
||||
product KONTRON DM9601 0x8101 USB Ethernet
|
||||
product KONTRON JP1082 0x9700 USB Ethernet
|
||||
|
||||
/* Konica Corp. Products */
|
||||
product KONICA CAMERA 0x0720 Digital Color Camera
|
||||
|
@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$");
|
||||
*/
|
||||
|
||||
#include "opt_inet6.h"
|
||||
#include "opt_kdtrace.h"
|
||||
#include "opt_kgssapi.h"
|
||||
#include "opt_nfs.h"
|
||||
|
||||
@ -64,6 +65,28 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#include <fs/nfs/nfsport.h>
|
||||
|
||||
#ifdef KDTRACE_HOOKS
|
||||
#include <sys/dtrace_bsd.h>
|
||||
|
||||
dtrace_nfsclient_nfs23_start_probe_func_t
|
||||
dtrace_nfscl_nfs234_start_probe;
|
||||
|
||||
dtrace_nfsclient_nfs23_done_probe_func_t
|
||||
dtrace_nfscl_nfs234_done_probe;
|
||||
|
||||
/*
|
||||
* Registered probes by RPC type.
|
||||
*/
|
||||
uint32_t nfscl_nfs2_start_probes[NFS_NPROCS + 1];
|
||||
uint32_t nfscl_nfs2_done_probes[NFS_NPROCS + 1];
|
||||
|
||||
uint32_t nfscl_nfs3_start_probes[NFS_NPROCS + 1];
|
||||
uint32_t nfscl_nfs3_done_probes[NFS_NPROCS + 1];
|
||||
|
||||
uint32_t nfscl_nfs4_start_probes[NFS_NPROCS + 1];
|
||||
uint32_t nfscl_nfs4_done_probes[NFS_NPROCS + 1];
|
||||
#endif
|
||||
|
||||
NFSSTATESPINLOCK;
|
||||
NFSREQSPINLOCK;
|
||||
extern struct nfsstats newnfsstats;
|
||||
@ -568,6 +591,29 @@ newnfs_request(struct nfsrv_descript *nd, struct nfsmount *nmp,
|
||||
if ((nd->nd_flag & ND_NFSV4) && procnum == NFSV4PROC_COMPOUND)
|
||||
MALLOC(rep, struct nfsreq *, sizeof(struct nfsreq),
|
||||
M_NFSDREQ, M_WAITOK);
|
||||
#ifdef KDTRACE_HOOKS
|
||||
if (dtrace_nfscl_nfs234_start_probe != NULL) {
|
||||
uint32_t probe_id;
|
||||
int probe_procnum;
|
||||
|
||||
if (nd->nd_flag & ND_NFSV4) {
|
||||
probe_id =
|
||||
nfscl_nfs4_start_probes[nd->nd_procnum];
|
||||
probe_procnum = nd->nd_procnum;
|
||||
} else if (nd->nd_flag & ND_NFSV3) {
|
||||
probe_id = nfscl_nfs3_start_probes[procnum];
|
||||
probe_procnum = procnum;
|
||||
} else {
|
||||
probe_id =
|
||||
nfscl_nfs2_start_probes[nd->nd_procnum];
|
||||
probe_procnum = procnum;
|
||||
}
|
||||
if (probe_id != 0)
|
||||
(dtrace_nfscl_nfs234_start_probe)
|
||||
(probe_id, vp, nd->nd_mreq, cred,
|
||||
probe_procnum);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
trycnt = 0;
|
||||
tryagain:
|
||||
@ -762,6 +808,27 @@ newnfs_request(struct nfsrv_descript *nd, struct nfsmount *nmp,
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef KDTRACE_HOOKS
|
||||
if (nmp != NULL && dtrace_nfscl_nfs234_done_probe != NULL) {
|
||||
uint32_t probe_id;
|
||||
int probe_procnum;
|
||||
|
||||
if (nd->nd_flag & ND_NFSV4) {
|
||||
probe_id = nfscl_nfs4_done_probes[nd->nd_procnum];
|
||||
probe_procnum = nd->nd_procnum;
|
||||
} else if (nd->nd_flag & ND_NFSV3) {
|
||||
probe_id = nfscl_nfs3_done_probes[procnum];
|
||||
probe_procnum = procnum;
|
||||
} else {
|
||||
probe_id = nfscl_nfs2_done_probes[nd->nd_procnum];
|
||||
probe_procnum = procnum;
|
||||
}
|
||||
if (probe_id != 0)
|
||||
(dtrace_nfscl_nfs234_done_probe)(probe_id, vp,
|
||||
nd->nd_mreq, cred, probe_procnum, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
m_freem(nd->nd_mreq);
|
||||
AUTH_DESTROY(auth);
|
||||
if (rep != NULL)
|
||||
|
@ -267,6 +267,7 @@
|
||||
* NFS_V3NPROCS is one greater than the last V3 op and NFS_NPROCS is
|
||||
* one greater than the last number.
|
||||
*/
|
||||
#ifndef NFS_V3NPROCS
|
||||
#define NFS_V3NPROCS 22
|
||||
|
||||
#define NFSPROC_LOOKUPP 22
|
||||
@ -293,6 +294,7 @@
|
||||
* Must be defined as one higher than the last Proc# above.
|
||||
*/
|
||||
#define NFSV4_NPROCS 41
|
||||
#endif /* NFS_V3NPROCS */
|
||||
|
||||
/*
|
||||
* Stats structure
|
||||
@ -358,7 +360,9 @@ struct ext_nfsstats {
|
||||
/*
|
||||
* Define NFS_NPROCS as NFSV4_NPROCS for the experimental kernel code.
|
||||
*/
|
||||
#ifndef NFS_NPROCS
|
||||
#define NFS_NPROCS NFSV4_NPROCS
|
||||
#endif
|
||||
|
||||
#include <fs/nfs/nfskpiport.h>
|
||||
#include <fs/nfs/nfsdport.h>
|
||||
|
@ -225,6 +225,48 @@
|
||||
#define NFSPROC_PATHCONF 20
|
||||
#define NFSPROC_COMMIT 21
|
||||
|
||||
/*
|
||||
* The lower numbers -> 21 are used by NFSv2 and v3. These define higher
|
||||
* numbers used by NFSv4.
|
||||
* NFS_V3NPROCS is one greater than the last V3 op and NFS_NPROCS is
|
||||
* one greater than the last number.
|
||||
*/
|
||||
#ifndef NFS_V3NPROCS
|
||||
#define NFS_V3NPROCS 22
|
||||
|
||||
#define NFSPROC_LOOKUPP 22
|
||||
#define NFSPROC_SETCLIENTID 23
|
||||
#define NFSPROC_SETCLIENTIDCFRM 24
|
||||
#define NFSPROC_LOCK 25
|
||||
#define NFSPROC_LOCKU 26
|
||||
#define NFSPROC_OPEN 27
|
||||
#define NFSPROC_CLOSE 28
|
||||
#define NFSPROC_OPENCONFIRM 29
|
||||
#define NFSPROC_LOCKT 30
|
||||
#define NFSPROC_OPENDOWNGRADE 31
|
||||
#define NFSPROC_RENEW 32
|
||||
#define NFSPROC_PUTROOTFH 33
|
||||
#define NFSPROC_RELEASELCKOWN 34
|
||||
#define NFSPROC_DELEGRETURN 35
|
||||
#define NFSPROC_RETDELEGREMOVE 36
|
||||
#define NFSPROC_RETDELEGRENAME1 37
|
||||
#define NFSPROC_RETDELEGRENAME2 38
|
||||
#define NFSPROC_GETACL 39
|
||||
#define NFSPROC_SETACL 40
|
||||
|
||||
/*
|
||||
* Must be defined as one higher than the last Proc# above.
|
||||
*/
|
||||
#define NFSV4_NPROCS 41
|
||||
#endif /* NFS_V3NPROCS */
|
||||
|
||||
/*
|
||||
* Define NFS_NPROCS as NFSV4_NPROCS for the experimental kernel code.
|
||||
*/
|
||||
#ifndef NFS_NPROCS
|
||||
#define NFS_NPROCS NFSV4_NPROCS
|
||||
#endif
|
||||
|
||||
/*
|
||||
* NFSPROC_NOOP is a fake op# that can't be the same as any V2/3/4 Procedure
|
||||
* or Operation#. Since the NFS V4 Op #s go higher, use NFSV4OP_NOPS, which
|
||||
|
@ -35,6 +35,8 @@
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include "opt_kdtrace.h"
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/bio.h>
|
||||
@ -55,6 +57,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <fs/nfsclient/nfsmount.h>
|
||||
#include <fs/nfsclient/nfs.h>
|
||||
#include <fs/nfsclient/nfsnode.h>
|
||||
#include <fs/nfsclient/nfs_kdtrace.h>
|
||||
|
||||
extern int newnfs_directio_allow_mmap;
|
||||
extern struct nfsstats newnfsstats;
|
||||
@ -399,6 +402,7 @@ nfs_bioread_check_cons(struct vnode *vp, struct thread *td, struct ucred *cred)
|
||||
goto out;
|
||||
}
|
||||
np->n_attrstamp = 0;
|
||||
KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp);
|
||||
error = VOP_GETATTR(vp, &vattr, cred);
|
||||
if (error)
|
||||
goto out;
|
||||
@ -915,6 +919,7 @@ ncl_write(struct vop_write_args *ap)
|
||||
#endif
|
||||
flush_and_restart:
|
||||
np->n_attrstamp = 0;
|
||||
KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp);
|
||||
error = ncl_vinvalbuf(vp, V_SAVE, td, 1);
|
||||
if (error)
|
||||
return (error);
|
||||
@ -928,6 +933,7 @@ ncl_write(struct vop_write_args *ap)
|
||||
*/
|
||||
if (ioflag & IO_APPEND) {
|
||||
np->n_attrstamp = 0;
|
||||
KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp);
|
||||
error = VOP_GETATTR(vp, &vattr, cred);
|
||||
if (error)
|
||||
return (error);
|
||||
@ -1748,6 +1754,7 @@ ncl_doio(struct vnode *vp, struct buf *bp, struct ucred *cr, struct thread *td,
|
||||
mtx_lock(&np->n_mtx);
|
||||
np->n_flag |= NWRITEERR;
|
||||
np->n_attrstamp = 0;
|
||||
KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp);
|
||||
mtx_unlock(&np->n_mtx);
|
||||
}
|
||||
bp->b_dirtyoff = bp->b_dirtyend = 0;
|
||||
|
600
sys/fs/nfsclient/nfs_clkdtrace.c
Normal file
600
sys/fs/nfsclient/nfs_clkdtrace.c
Normal file
@ -0,0 +1,600 @@
|
||||
/*-
|
||||
* Copyright (c) 2009 Robert N. M. Watson
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software was developed at the University of Cambridge Computer
|
||||
* Laboratory with support from a grant from Google, Inc.
|
||||
*
|
||||
* 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 <sys/systm.h>
|
||||
#include <sys/conf.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/module.h>
|
||||
|
||||
#include <sys/dtrace.h>
|
||||
#include <sys/dtrace_bsd.h>
|
||||
|
||||
#include <fs/nfs/nfsproto.h>
|
||||
|
||||
#include <fs/nfsclient/nfs_kdtrace.h>
|
||||
|
||||
/*
|
||||
* dtnfscl is a DTrace provider that tracks the intent to perform RPCs
|
||||
* in the NFS client, as well as acess to and maintenance of the access and
|
||||
* attribute caches. This is not quite the same as RPCs, because NFS may
|
||||
* issue multiple RPC transactions in the event that authentication fails,
|
||||
* there's a jukebox error, or none at all if the access or attribute cache
|
||||
* hits. However, it cleanly represents the logical layer between RPC
|
||||
* transmission and vnode/vfs operations, providing access to state linking
|
||||
* the two.
|
||||
*/
|
||||
|
||||
static int dtnfsclient_unload(void);
|
||||
static void dtnfsclient_getargdesc(void *, dtrace_id_t, void *,
|
||||
dtrace_argdesc_t *);
|
||||
static void dtnfsclient_provide(void *, dtrace_probedesc_t *);
|
||||
static void dtnfsclient_destroy(void *, dtrace_id_t, void *);
|
||||
static void dtnfsclient_enable(void *, dtrace_id_t, void *);
|
||||
static void dtnfsclient_disable(void *, dtrace_id_t, void *);
|
||||
static void dtnfsclient_load(void *);
|
||||
|
||||
static dtrace_pattr_t dtnfsclient_attr = {
|
||||
{ DTRACE_STABILITY_STABLE, DTRACE_STABILITY_STABLE, DTRACE_CLASS_COMMON },
|
||||
{ DTRACE_STABILITY_PRIVATE, DTRACE_STABILITY_PRIVATE, DTRACE_CLASS_UNKNOWN },
|
||||
{ DTRACE_STABILITY_PRIVATE, DTRACE_STABILITY_PRIVATE, DTRACE_CLASS_UNKNOWN },
|
||||
{ DTRACE_STABILITY_STABLE, DTRACE_STABILITY_STABLE, DTRACE_CLASS_COMMON },
|
||||
{ DTRACE_STABILITY_STABLE, DTRACE_STABILITY_STABLE, DTRACE_CLASS_COMMON },
|
||||
};
|
||||
|
||||
/*
|
||||
* Description of NFSv4, NFSv3 and (optional) NFSv2 probes for a procedure.
|
||||
*/
|
||||
struct dtnfsclient_rpc {
|
||||
char *nr_v4_name;
|
||||
char *nr_v3_name; /* Or NULL if none. */
|
||||
char *nr_v2_name; /* Or NULL if none. */
|
||||
|
||||
/*
|
||||
* IDs for the start and done cases, for NFSv2, NFSv3 and NFSv4.
|
||||
*/
|
||||
uint32_t nr_v2_id_start, nr_v2_id_done;
|
||||
uint32_t nr_v3_id_start, nr_v3_id_done;
|
||||
uint32_t nr_v4_id_start, nr_v4_id_done;
|
||||
};
|
||||
|
||||
/*
|
||||
* This table is indexed by NFSv3 procedure number, but also used for NFSv2
|
||||
* procedure names and NFSv4 operations.
|
||||
*/
|
||||
static struct dtnfsclient_rpc dtnfsclient_rpcs[NFS_NPROCS + 1] = {
|
||||
{ "null", "null", "null" },
|
||||
{ "getattr", "getattr", "getattr" },
|
||||
{ "setattr", "setattr", "setattr" },
|
||||
{ "lookup", "lookup", "lookup" },
|
||||
{ "access", "access", "noop" },
|
||||
{ "readlink", "readlink", "readlink" },
|
||||
{ "read", "read", "read" },
|
||||
{ "write", "write", "write" },
|
||||
{ "create", "create", "create" },
|
||||
{ "mkdir", "mkdir", "mkdir" },
|
||||
{ "symlink", "symlink", "symlink" },
|
||||
{ "mknod", "mknod" },
|
||||
{ "remove", "remove", "remove" },
|
||||
{ "rmdir", "rmdir", "rmdir" },
|
||||
{ "rename", "rename", "rename" },
|
||||
{ "link", "link", "link" },
|
||||
{ "readdir", "readdir", "readdir" },
|
||||
{ "readdirplus", "readdirplus" },
|
||||
{ "fsstat", "fsstat", "statfs" },
|
||||
{ "fsinfo", "fsinfo" },
|
||||
{ "pathconf", "pathconf" },
|
||||
{ "commit", "commit" },
|
||||
{ "lookupp" },
|
||||
{ "setclientid" },
|
||||
{ "setclientidcfrm" },
|
||||
{ "lock" },
|
||||
{ "locku" },
|
||||
{ "open" },
|
||||
{ "close" },
|
||||
{ "openconfirm" },
|
||||
{ "lockt" },
|
||||
{ "opendowngrade" },
|
||||
{ "renew" },
|
||||
{ "putrootfh" },
|
||||
{ "releaselckown" },
|
||||
{ "delegreturn" },
|
||||
{ "retdelegremove" },
|
||||
{ "retdelegrename1" },
|
||||
{ "retdelegrename2" },
|
||||
{ "getacl" },
|
||||
{ "setacl" },
|
||||
{ "noop", "noop", "noop" }
|
||||
};
|
||||
|
||||
/*
|
||||
* Module name strings.
|
||||
*/
|
||||
static char *dtnfsclient_accesscache_str = "accesscache";
|
||||
static char *dtnfsclient_attrcache_str = "attrcache";
|
||||
static char *dtnfsclient_nfs2_str = "nfs2";
|
||||
static char *dtnfsclient_nfs3_str = "nfs3";
|
||||
static char *dtnfsclient_nfs4_str = "nfs4";
|
||||
|
||||
/*
|
||||
* Function name strings.
|
||||
*/
|
||||
static char *dtnfsclient_flush_str = "flush";
|
||||
static char *dtnfsclient_load_str = "load";
|
||||
static char *dtnfsclient_get_str = "get";
|
||||
|
||||
/*
|
||||
* Name strings.
|
||||
*/
|
||||
static char *dtnfsclient_done_str = "done";
|
||||
static char *dtnfsclient_hit_str = "hit";
|
||||
static char *dtnfsclient_miss_str = "miss";
|
||||
static char *dtnfsclient_start_str = "start";
|
||||
|
||||
static dtrace_pops_t dtnfsclient_pops = {
|
||||
dtnfsclient_provide,
|
||||
NULL,
|
||||
dtnfsclient_enable,
|
||||
dtnfsclient_disable,
|
||||
NULL,
|
||||
NULL,
|
||||
dtnfsclient_getargdesc,
|
||||
NULL,
|
||||
NULL,
|
||||
dtnfsclient_destroy
|
||||
};
|
||||
|
||||
static dtrace_provider_id_t dtnfsclient_id;
|
||||
|
||||
/*
|
||||
* Most probes are generated from the above RPC table, but for access and
|
||||
* attribute caches, we have specific IDs we recognize and handle specially
|
||||
* in various spots.
|
||||
*/
|
||||
extern uint32_t nfscl_accesscache_flush_done_id;
|
||||
extern uint32_t nfscl_accesscache_get_hit_id;
|
||||
extern uint32_t nfscl_accesscache_get_miss_id;
|
||||
extern uint32_t nfscl_accesscache_load_done_id;
|
||||
|
||||
extern uint32_t nfscl_attrcache_flush_done_id;
|
||||
extern uint32_t nfscl_attrcache_get_hit_id;
|
||||
extern uint32_t nfscl_attrcache_get_miss_id;
|
||||
extern uint32_t nfscl_attrcache_load_done_id;
|
||||
|
||||
/*
|
||||
* When tracing on a procedure is enabled, the DTrace ID for an RPC event is
|
||||
* stored in one of these two NFS client-allocated arrays; 0 indicates that
|
||||
* the event is not being traced so probes should not be called.
|
||||
*
|
||||
* For simplicity, we allocate both v2, v3 and v4 arrays as NFS_NPROCS + 1, and
|
||||
* the v2, v3 arrays are simply sparse.
|
||||
*/
|
||||
extern uint32_t nfscl_nfs2_start_probes[NFS_NPROCS + 1];
|
||||
extern uint32_t nfscl_nfs2_done_probes[NFS_NPROCS + 1];
|
||||
|
||||
extern uint32_t nfscl_nfs3_start_probes[NFS_NPROCS + 1];
|
||||
extern uint32_t nfscl_nfs3_done_probes[NFS_NPROCS + 1];
|
||||
|
||||
extern uint32_t nfscl_nfs4_start_probes[NFS_NPROCS + 1];
|
||||
extern uint32_t nfscl_nfs4_done_probes[NFS_NPROCS + 1];
|
||||
|
||||
/*
|
||||
* Look up a DTrace probe ID to see if it's associated with a "done" event --
|
||||
* if so, we will return a fourth argument type of "int".
|
||||
*/
|
||||
static int
|
||||
dtnfs234_isdoneprobe(dtrace_id_t id)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < NFS_NPROCS + 1; i++) {
|
||||
if (dtnfsclient_rpcs[i].nr_v4_id_done == id ||
|
||||
dtnfsclient_rpcs[i].nr_v3_id_done == id ||
|
||||
dtnfsclient_rpcs[i].nr_v2_id_done == id)
|
||||
return (1);
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
static void
|
||||
dtnfsclient_getargdesc(void *arg, dtrace_id_t id, void *parg,
|
||||
dtrace_argdesc_t *desc)
|
||||
{
|
||||
const char *p = NULL;
|
||||
|
||||
if (id == nfscl_accesscache_flush_done_id ||
|
||||
id == nfscl_attrcache_flush_done_id ||
|
||||
id == nfscl_attrcache_get_miss_id) {
|
||||
switch (desc->dtargd_ndx) {
|
||||
case 0:
|
||||
p = "struct vnode *";
|
||||
break;
|
||||
default:
|
||||
desc->dtargd_ndx = DTRACE_ARGNONE;
|
||||
break;
|
||||
}
|
||||
} else if (id == nfscl_accesscache_get_hit_id ||
|
||||
id == nfscl_accesscache_get_miss_id) {
|
||||
switch (desc->dtargd_ndx) {
|
||||
case 0:
|
||||
p = "struct vnode *";
|
||||
break;
|
||||
case 1:
|
||||
p = "uid_t";
|
||||
break;
|
||||
case 2:
|
||||
p = "uint32_t";
|
||||
break;
|
||||
default:
|
||||
desc->dtargd_ndx = DTRACE_ARGNONE;
|
||||
break;
|
||||
}
|
||||
} else if (id == nfscl_accesscache_load_done_id) {
|
||||
switch (desc->dtargd_ndx) {
|
||||
case 0:
|
||||
p = "struct vnode *";
|
||||
break;
|
||||
case 1:
|
||||
p = "uid_t";
|
||||
break;
|
||||
case 2:
|
||||
p = "uint32_t";
|
||||
break;
|
||||
case 3:
|
||||
p = "int";
|
||||
break;
|
||||
default:
|
||||
desc->dtargd_ndx = DTRACE_ARGNONE;
|
||||
break;
|
||||
}
|
||||
} else if (id == nfscl_attrcache_get_hit_id) {
|
||||
switch (desc->dtargd_ndx) {
|
||||
case 0:
|
||||
p = "struct vnode *";
|
||||
break;
|
||||
case 1:
|
||||
p = "struct vattr *";
|
||||
break;
|
||||
default:
|
||||
desc->dtargd_ndx = DTRACE_ARGNONE;
|
||||
break;
|
||||
}
|
||||
} else if (id == nfscl_attrcache_load_done_id) {
|
||||
switch (desc->dtargd_ndx) {
|
||||
case 0:
|
||||
p = "struct vnode *";
|
||||
break;
|
||||
case 1:
|
||||
p = "struct vattr *";
|
||||
break;
|
||||
case 2:
|
||||
p = "int";
|
||||
break;
|
||||
default:
|
||||
desc->dtargd_ndx = DTRACE_ARGNONE;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
switch (desc->dtargd_ndx) {
|
||||
case 0:
|
||||
p = "struct vnode *";
|
||||
break;
|
||||
case 1:
|
||||
p = "struct mbuf *";
|
||||
break;
|
||||
case 2:
|
||||
p = "struct ucred *";
|
||||
break;
|
||||
case 3:
|
||||
p = "int";
|
||||
break;
|
||||
case 4:
|
||||
if (dtnfs234_isdoneprobe(id)) {
|
||||
p = "int";
|
||||
break;
|
||||
}
|
||||
/* FALLSTHROUGH */
|
||||
default:
|
||||
desc->dtargd_ndx = DTRACE_ARGNONE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (p != NULL)
|
||||
strlcpy(desc->dtargd_native, p, sizeof(desc->dtargd_native));
|
||||
}
|
||||
|
||||
static void
|
||||
dtnfsclient_provide(void *arg, dtrace_probedesc_t *desc)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (desc != NULL)
|
||||
return;
|
||||
|
||||
/*
|
||||
* Register access cache probes.
|
||||
*/
|
||||
if (dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_accesscache_str,
|
||||
dtnfsclient_flush_str, dtnfsclient_done_str) == 0) {
|
||||
nfscl_accesscache_flush_done_id = dtrace_probe_create(
|
||||
dtnfsclient_id, dtnfsclient_accesscache_str,
|
||||
dtnfsclient_flush_str, dtnfsclient_done_str, 0, NULL);
|
||||
}
|
||||
if (dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_accesscache_str,
|
||||
dtnfsclient_get_str, dtnfsclient_hit_str) == 0) {
|
||||
nfscl_accesscache_get_hit_id = dtrace_probe_create(
|
||||
dtnfsclient_id, dtnfsclient_accesscache_str,
|
||||
dtnfsclient_get_str, dtnfsclient_hit_str, 0, NULL);
|
||||
}
|
||||
if (dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_accesscache_str,
|
||||
dtnfsclient_get_str, dtnfsclient_miss_str) == 0) {
|
||||
nfscl_accesscache_get_miss_id = dtrace_probe_create(
|
||||
dtnfsclient_id, dtnfsclient_accesscache_str,
|
||||
dtnfsclient_get_str, dtnfsclient_miss_str, 0, NULL);
|
||||
}
|
||||
if (dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_accesscache_str,
|
||||
dtnfsclient_load_str, dtnfsclient_done_str) == 0) {
|
||||
nfscl_accesscache_load_done_id = dtrace_probe_create(
|
||||
dtnfsclient_id, dtnfsclient_accesscache_str,
|
||||
dtnfsclient_load_str, dtnfsclient_done_str, 0, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Register attribute cache probes.
|
||||
*/
|
||||
if (dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_attrcache_str,
|
||||
dtnfsclient_flush_str, dtnfsclient_done_str) == 0) {
|
||||
nfscl_attrcache_flush_done_id = dtrace_probe_create(
|
||||
dtnfsclient_id, dtnfsclient_attrcache_str,
|
||||
dtnfsclient_flush_str, dtnfsclient_done_str, 0, NULL);
|
||||
}
|
||||
if (dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_attrcache_str,
|
||||
dtnfsclient_get_str, dtnfsclient_hit_str) == 0) {
|
||||
nfscl_attrcache_get_hit_id = dtrace_probe_create(
|
||||
dtnfsclient_id, dtnfsclient_attrcache_str,
|
||||
dtnfsclient_get_str, dtnfsclient_hit_str, 0, NULL);
|
||||
}
|
||||
if (dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_attrcache_str,
|
||||
dtnfsclient_get_str, dtnfsclient_miss_str) == 0) {
|
||||
nfscl_attrcache_get_miss_id = dtrace_probe_create(
|
||||
dtnfsclient_id, dtnfsclient_attrcache_str,
|
||||
dtnfsclient_get_str, dtnfsclient_miss_str, 0, NULL);
|
||||
}
|
||||
if (dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_attrcache_str,
|
||||
dtnfsclient_load_str, dtnfsclient_done_str) == 0) {
|
||||
nfscl_attrcache_load_done_id = dtrace_probe_create(
|
||||
dtnfsclient_id, dtnfsclient_attrcache_str,
|
||||
dtnfsclient_load_str, dtnfsclient_done_str, 0, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Register NFSv2 RPC procedures; note sparseness check for each slot
|
||||
* in the NFSv3, NFSv4 procnum-indexed array.
|
||||
*/
|
||||
for (i = 0; i < NFS_NPROCS + 1; i++) {
|
||||
if (dtnfsclient_rpcs[i].nr_v2_name != NULL &&
|
||||
dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_nfs2_str,
|
||||
dtnfsclient_rpcs[i].nr_v2_name, dtnfsclient_start_str) ==
|
||||
0) {
|
||||
dtnfsclient_rpcs[i].nr_v2_id_start =
|
||||
dtrace_probe_create(dtnfsclient_id,
|
||||
dtnfsclient_nfs2_str,
|
||||
dtnfsclient_rpcs[i].nr_v2_name,
|
||||
dtnfsclient_start_str, 0,
|
||||
&nfscl_nfs2_start_probes[i]);
|
||||
}
|
||||
if (dtnfsclient_rpcs[i].nr_v2_name != NULL &&
|
||||
dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_nfs2_str,
|
||||
dtnfsclient_rpcs[i].nr_v2_name, dtnfsclient_done_str) ==
|
||||
0) {
|
||||
dtnfsclient_rpcs[i].nr_v2_id_done =
|
||||
dtrace_probe_create(dtnfsclient_id,
|
||||
dtnfsclient_nfs2_str,
|
||||
dtnfsclient_rpcs[i].nr_v2_name,
|
||||
dtnfsclient_done_str, 0,
|
||||
&nfscl_nfs2_done_probes[i]);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Register NFSv3 RPC procedures; note sparseness check for each slot
|
||||
* in the NFSv4 procnum-indexed array.
|
||||
*/
|
||||
for (i = 0; i < NFS_NPROCS + 1; i++) {
|
||||
if (dtnfsclient_rpcs[i].nr_v3_name != NULL &&
|
||||
dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_nfs3_str,
|
||||
dtnfsclient_rpcs[i].nr_v3_name, dtnfsclient_start_str) ==
|
||||
0) {
|
||||
dtnfsclient_rpcs[i].nr_v3_id_start =
|
||||
dtrace_probe_create(dtnfsclient_id,
|
||||
dtnfsclient_nfs3_str,
|
||||
dtnfsclient_rpcs[i].nr_v3_name,
|
||||
dtnfsclient_start_str, 0,
|
||||
&nfscl_nfs3_start_probes[i]);
|
||||
}
|
||||
if (dtnfsclient_rpcs[i].nr_v3_name != NULL &&
|
||||
dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_nfs3_str,
|
||||
dtnfsclient_rpcs[i].nr_v3_name, dtnfsclient_done_str) ==
|
||||
0) {
|
||||
dtnfsclient_rpcs[i].nr_v3_id_done =
|
||||
dtrace_probe_create(dtnfsclient_id,
|
||||
dtnfsclient_nfs3_str,
|
||||
dtnfsclient_rpcs[i].nr_v3_name,
|
||||
dtnfsclient_done_str, 0,
|
||||
&nfscl_nfs3_done_probes[i]);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Register NFSv4 RPC procedures.
|
||||
*/
|
||||
for (i = 0; i < NFS_NPROCS + 1; i++) {
|
||||
if (dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_nfs4_str,
|
||||
dtnfsclient_rpcs[i].nr_v4_name, dtnfsclient_start_str) ==
|
||||
0) {
|
||||
dtnfsclient_rpcs[i].nr_v4_id_start =
|
||||
dtrace_probe_create(dtnfsclient_id,
|
||||
dtnfsclient_nfs4_str,
|
||||
dtnfsclient_rpcs[i].nr_v4_name,
|
||||
dtnfsclient_start_str, 0,
|
||||
&nfscl_nfs4_start_probes[i]);
|
||||
}
|
||||
if (dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_nfs4_str,
|
||||
dtnfsclient_rpcs[i].nr_v4_name, dtnfsclient_done_str) ==
|
||||
0) {
|
||||
dtnfsclient_rpcs[i].nr_v4_id_done =
|
||||
dtrace_probe_create(dtnfsclient_id,
|
||||
dtnfsclient_nfs4_str,
|
||||
dtnfsclient_rpcs[i].nr_v4_name,
|
||||
dtnfsclient_done_str, 0,
|
||||
&nfscl_nfs4_done_probes[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
dtnfsclient_destroy(void *arg, dtrace_id_t id, void *parg)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
dtnfsclient_enable(void *arg, dtrace_id_t id, void *parg)
|
||||
{
|
||||
uint32_t *p = parg;
|
||||
void *f = dtrace_probe;
|
||||
|
||||
if (id == nfscl_accesscache_flush_done_id)
|
||||
dtrace_nfscl_accesscache_flush_done_probe = f;
|
||||
else if (id == nfscl_accesscache_get_hit_id)
|
||||
dtrace_nfscl_accesscache_get_hit_probe = f;
|
||||
else if (id == nfscl_accesscache_get_miss_id)
|
||||
dtrace_nfscl_accesscache_get_miss_probe = f;
|
||||
else if (id == nfscl_accesscache_load_done_id)
|
||||
dtrace_nfscl_accesscache_load_done_probe = f;
|
||||
else if (id == nfscl_attrcache_flush_done_id)
|
||||
dtrace_nfscl_attrcache_flush_done_probe = f;
|
||||
else if (id == nfscl_attrcache_get_hit_id)
|
||||
dtrace_nfscl_attrcache_get_hit_probe = f;
|
||||
else if (id == nfscl_attrcache_get_miss_id)
|
||||
dtrace_nfscl_attrcache_get_miss_probe = f;
|
||||
else if (id == nfscl_attrcache_load_done_id)
|
||||
dtrace_nfscl_attrcache_load_done_probe = f;
|
||||
else
|
||||
*p = id;
|
||||
}
|
||||
|
||||
static void
|
||||
dtnfsclient_disable(void *arg, dtrace_id_t id, void *parg)
|
||||
{
|
||||
uint32_t *p = parg;
|
||||
|
||||
if (id == nfscl_accesscache_flush_done_id)
|
||||
dtrace_nfscl_accesscache_flush_done_probe = NULL;
|
||||
else if (id == nfscl_accesscache_get_hit_id)
|
||||
dtrace_nfscl_accesscache_get_hit_probe = NULL;
|
||||
else if (id == nfscl_accesscache_get_miss_id)
|
||||
dtrace_nfscl_accesscache_get_miss_probe = NULL;
|
||||
else if (id == nfscl_accesscache_load_done_id)
|
||||
dtrace_nfscl_accesscache_load_done_probe = NULL;
|
||||
else if (id == nfscl_attrcache_flush_done_id)
|
||||
dtrace_nfscl_attrcache_flush_done_probe = NULL;
|
||||
else if (id == nfscl_attrcache_get_hit_id)
|
||||
dtrace_nfscl_attrcache_get_hit_probe = NULL;
|
||||
else if (id == nfscl_attrcache_get_miss_id)
|
||||
dtrace_nfscl_attrcache_get_miss_probe = NULL;
|
||||
else if (id == nfscl_attrcache_load_done_id)
|
||||
dtrace_nfscl_attrcache_load_done_probe = NULL;
|
||||
else
|
||||
*p = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
dtnfsclient_load(void *dummy)
|
||||
{
|
||||
|
||||
if (dtrace_register("nfscl", &dtnfsclient_attr,
|
||||
DTRACE_PRIV_USER, NULL, &dtnfsclient_pops, NULL,
|
||||
&dtnfsclient_id) != 0)
|
||||
return;
|
||||
|
||||
dtrace_nfscl_nfs234_start_probe =
|
||||
(dtrace_nfsclient_nfs23_start_probe_func_t)dtrace_probe;
|
||||
dtrace_nfscl_nfs234_done_probe =
|
||||
(dtrace_nfsclient_nfs23_done_probe_func_t)dtrace_probe;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
dtnfsclient_unload()
|
||||
{
|
||||
|
||||
dtrace_nfscl_nfs234_start_probe = NULL;
|
||||
dtrace_nfscl_nfs234_done_probe = NULL;
|
||||
|
||||
return (dtrace_unregister(dtnfsclient_id));
|
||||
}
|
||||
|
||||
static int
|
||||
dtnfsclient_modevent(module_t mod __unused, int type, void *data __unused)
|
||||
{
|
||||
int error = 0;
|
||||
|
||||
switch (type) {
|
||||
case MOD_LOAD:
|
||||
break;
|
||||
|
||||
case MOD_UNLOAD:
|
||||
break;
|
||||
|
||||
case MOD_SHUTDOWN:
|
||||
break;
|
||||
|
||||
default:
|
||||
error = EOPNOTSUPP;
|
||||
break;
|
||||
}
|
||||
|
||||
return (error);
|
||||
}
|
||||
|
||||
SYSINIT(dtnfsclient_load, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY,
|
||||
dtnfsclient_load, NULL);
|
||||
SYSUNINIT(dtnfsclient_unload, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY,
|
||||
dtnfsclient_unload, NULL);
|
||||
|
||||
DEV_MODULE(dtnfscl, dtnfsclient_modevent, NULL);
|
||||
MODULE_VERSION(dtnfscl, 1);
|
||||
MODULE_DEPEND(dtnfscl, dtrace, 1, 1, 1);
|
||||
MODULE_DEPEND(dtnfscl, opensolaris, 1, 1, 1);
|
||||
MODULE_DEPEND(dtnfscl, nfscl, 1, 1, 1);
|
||||
MODULE_DEPEND(dtnfscl, nfscommon, 1, 1, 1);
|
@ -35,6 +35,8 @@
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include "opt_kdtrace.h"
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/fcntl.h>
|
||||
@ -53,6 +55,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <fs/nfsclient/nfsnode.h>
|
||||
#include <fs/nfsclient/nfsmount.h>
|
||||
#include <fs/nfsclient/nfs.h>
|
||||
#include <fs/nfsclient/nfs_kdtrace.h>
|
||||
|
||||
#include <nfs/nfs_lock.h>
|
||||
|
||||
@ -300,7 +303,9 @@ ncl_invalcaches(struct vnode *vp)
|
||||
mtx_lock(&np->n_mtx);
|
||||
for (i = 0; i < NFS_ACCESSCACHESIZE; i++)
|
||||
np->n_accesscache[i].stamp = 0;
|
||||
KDTRACE_NFS_ACCESSCACHE_FLUSH_DONE(vp);
|
||||
np->n_attrstamp = 0;
|
||||
KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp);
|
||||
mtx_unlock(&np->n_mtx);
|
||||
}
|
||||
|
||||
|
@ -34,6 +34,8 @@
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include "opt_kdtrace.h"
|
||||
|
||||
/*
|
||||
* generally, I don't like #includes inside .h files, but it seems to
|
||||
* be the easiest way to handle the port.
|
||||
@ -43,6 +45,26 @@ __FBSDID("$FreeBSD$");
|
||||
#include <netinet/if_ether.h>
|
||||
#include <net/if_types.h>
|
||||
|
||||
#include <fs/nfsclient/nfs_kdtrace.h>
|
||||
|
||||
#ifdef KDTRACE_HOOKS
|
||||
dtrace_nfsclient_attrcache_flush_probe_func_t
|
||||
dtrace_nfscl_attrcache_flush_done_probe;
|
||||
uint32_t nfscl_attrcache_flush_done_id;
|
||||
|
||||
dtrace_nfsclient_attrcache_get_hit_probe_func_t
|
||||
dtrace_nfscl_attrcache_get_hit_probe;
|
||||
uint32_t nfscl_attrcache_get_hit_id;
|
||||
|
||||
dtrace_nfsclient_attrcache_get_miss_probe_func_t
|
||||
dtrace_nfscl_attrcache_get_miss_probe;
|
||||
uint32_t nfscl_attrcache_get_miss_id;
|
||||
|
||||
dtrace_nfsclient_attrcache_load_probe_func_t
|
||||
dtrace_nfscl_attrcache_load_done_probe;
|
||||
uint32_t nfscl_attrcache_load_done_id;
|
||||
#endif /* !KDTRACE_HOOKS */
|
||||
|
||||
extern u_int32_t newnfs_true, newnfs_false, newnfs_xdrneg1;
|
||||
extern struct vop_vector newnfs_vnodeops;
|
||||
extern struct vop_vector newnfs_fifoops;
|
||||
@ -407,6 +429,7 @@ nfscl_loadattrcache(struct vnode **vpp, struct nfsvattr *nap, void *nvaper,
|
||||
*/
|
||||
vap->va_size = np->n_size;
|
||||
np->n_attrstamp = 0;
|
||||
KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp);
|
||||
} else if (np->n_flag & NMODIFIED) {
|
||||
/*
|
||||
* We've modified the file: Use the larger
|
||||
@ -439,9 +462,11 @@ nfscl_loadattrcache(struct vnode **vpp, struct nfsvattr *nap, void *nvaper,
|
||||
* We detect this by for the mtime moving back. We invalidate the
|
||||
* attrcache when this happens.
|
||||
*/
|
||||
if (timespeccmp(&mtime_save, &vap->va_mtime, >))
|
||||
if (timespeccmp(&mtime_save, &vap->va_mtime, >)) {
|
||||
/* Size changed or mtime went backwards */
|
||||
np->n_attrstamp = 0;
|
||||
KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp);
|
||||
}
|
||||
if (vaper != NULL) {
|
||||
NFSBCOPY((caddr_t)vap, (caddr_t)vaper, sizeof(*vap));
|
||||
if (np->n_flag & NCHG) {
|
||||
@ -451,6 +476,10 @@ nfscl_loadattrcache(struct vnode **vpp, struct nfsvattr *nap, void *nvaper,
|
||||
vaper->va_mtime = np->n_mtim;
|
||||
}
|
||||
}
|
||||
#ifdef KDTRACE_HOOKS
|
||||
if (np->n_attrstamp != 0)
|
||||
KDTRACE_NFS_ATTRCACHE_LOAD_DONE(vp, vap, 0);
|
||||
#endif
|
||||
NFSUNLOCKNODE(np);
|
||||
return (0);
|
||||
}
|
||||
|
@ -35,6 +35,8 @@
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include "opt_kdtrace.h"
|
||||
|
||||
/*
|
||||
* These functions support the macros and help fiddle mbuf chains for
|
||||
* the nfs op functions. They do things like create the rpc header and
|
||||
@ -68,6 +70,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <fs/nfsclient/nfsnode.h>
|
||||
#include <fs/nfsclient/nfsmount.h>
|
||||
#include <fs/nfsclient/nfs.h>
|
||||
#include <fs/nfsclient/nfs_kdtrace.h>
|
||||
|
||||
#include <netinet/in.h>
|
||||
|
||||
@ -238,6 +241,7 @@ ncl_getattrcache(struct vnode *vp, struct vattr *vaper)
|
||||
#ifdef NFS_ACDEBUG
|
||||
mtx_unlock(&Giant); /* ncl_printf() */
|
||||
#endif
|
||||
KDTRACE_NFS_ATTRCACHE_GET_MISS(vp);
|
||||
return( ENOENT);
|
||||
}
|
||||
newnfsstats.attrcache_hits++;
|
||||
@ -267,6 +271,7 @@ ncl_getattrcache(struct vnode *vp, struct vattr *vaper)
|
||||
#ifdef NFS_ACDEBUG
|
||||
mtx_unlock(&Giant); /* ncl_printf() */
|
||||
#endif
|
||||
KDTRACE_NFS_ATTRCACHE_GET_HIT(vp, vap);
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$");
|
||||
* vnode op calls for Sun NFS version 2, 3 and 4
|
||||
*/
|
||||
|
||||
#include "opt_kdtrace.h"
|
||||
#include "opt_inet.h"
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -70,6 +71,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <fs/nfsclient/nfsnode.h>
|
||||
#include <fs/nfsclient/nfsmount.h>
|
||||
#include <fs/nfsclient/nfs.h>
|
||||
#include <fs/nfsclient/nfs_kdtrace.h>
|
||||
|
||||
#include <net/if.h>
|
||||
#include <netinet/in.h>
|
||||
@ -77,6 +79,24 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#include <nfs/nfs_lock.h>
|
||||
|
||||
#ifdef KDTRACE_HOOKS
|
||||
#include <sys/dtrace_bsd.h>
|
||||
|
||||
dtrace_nfsclient_accesscache_flush_probe_func_t
|
||||
dtrace_nfscl_accesscache_flush_done_probe;
|
||||
uint32_t nfscl_accesscache_flush_done_id;
|
||||
|
||||
dtrace_nfsclient_accesscache_get_probe_func_t
|
||||
dtrace_nfscl_accesscache_get_hit_probe,
|
||||
dtrace_nfscl_accesscache_get_miss_probe;
|
||||
uint32_t nfscl_accesscache_get_hit_id;
|
||||
uint32_t nfscl_accesscache_get_miss_id;
|
||||
|
||||
dtrace_nfsclient_accesscache_load_probe_func_t
|
||||
dtrace_nfscl_accesscache_load_done_probe;
|
||||
uint32_t nfscl_accesscache_load_done_id;
|
||||
#endif /* !KDTRACE_HOOKS */
|
||||
|
||||
/* Defs */
|
||||
#define TRUE 1
|
||||
#define FALSE 0
|
||||
@ -298,9 +318,15 @@ nfs34_access_otw(struct vnode *vp, int wmode, struct thread *td,
|
||||
mtx_unlock(&np->n_mtx);
|
||||
if (retmode != NULL)
|
||||
*retmode = rmode;
|
||||
KDTRACE_NFS_ACCESSCACHE_LOAD_DONE(vp, cred->cr_uid, rmode, 0);
|
||||
} else if (NFS_ISV4(vp)) {
|
||||
error = nfscl_maperr(td, error, (uid_t)0, (gid_t)0);
|
||||
}
|
||||
#ifdef KDTRACE_HOOKS
|
||||
if (error != 0)
|
||||
KDTRACE_NFS_ACCESSCACHE_LOAD_DONE(vp, cred->cr_uid, 0,
|
||||
error);
|
||||
#endif
|
||||
return (error);
|
||||
}
|
||||
|
||||
@ -397,6 +423,14 @@ nfs_access(struct vop_access_args *ap)
|
||||
}
|
||||
}
|
||||
mtx_unlock(&np->n_mtx);
|
||||
#ifdef KDTRACE_HOOKS
|
||||
if (gotahit != 0)
|
||||
KDTRACE_NFS_ACCESSCACHE_GET_HIT(vp,
|
||||
ap->a_cred->cr_uid, mode);
|
||||
else
|
||||
KDTRACE_NFS_ACCESSCACHE_GET_MISS(vp,
|
||||
ap->a_cred->cr_uid, mode);
|
||||
#endif
|
||||
if (gotahit == 0) {
|
||||
/*
|
||||
* Either a no, or a don't know. Go to the wire.
|
||||
@ -507,6 +541,7 @@ nfs_open(struct vop_open_args *ap)
|
||||
}
|
||||
mtx_lock(&np->n_mtx);
|
||||
np->n_attrstamp = 0;
|
||||
KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp);
|
||||
if (vp->v_type == VDIR)
|
||||
np->n_direofoffset = 0;
|
||||
mtx_unlock(&np->n_mtx);
|
||||
@ -692,8 +727,10 @@ nfs_close(struct vop_close_args *ap)
|
||||
* is the cause of some caching/coherency issue that might
|
||||
* crop up.)
|
||||
*/
|
||||
if (VFSTONFS(vp->v_mount)->nm_negnametimeo == 0)
|
||||
if (VFSTONFS(vp->v_mount)->nm_negnametimeo == 0) {
|
||||
np->n_attrstamp = 0;
|
||||
KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp);
|
||||
}
|
||||
if (np->n_flag & NWRITEERR) {
|
||||
np->n_flag &= ~NWRITEERR;
|
||||
error = np->n_error;
|
||||
@ -949,6 +986,7 @@ nfs_setattrrpc(struct vnode *vp, struct vattr *vap, struct ucred *cred,
|
||||
np->n_accesscache[i].stamp = 0;
|
||||
np->n_flag |= NDELEGMOD;
|
||||
mtx_unlock(&np->n_mtx);
|
||||
KDTRACE_NFS_ACCESSCACHE_FLUSH_DONE(vp);
|
||||
}
|
||||
error = nfsrpc_setattr(vp, vap, NULL, cred, td, &nfsva, &attrflag,
|
||||
NULL);
|
||||
@ -1030,6 +1068,7 @@ nfs_lookup(struct vop_lookup_args *ap)
|
||||
!(newnp->n_flag & NMODIFIED)) {
|
||||
mtx_lock(&newnp->n_mtx);
|
||||
newnp->n_attrstamp = 0;
|
||||
KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(newvp);
|
||||
mtx_unlock(&newnp->n_mtx);
|
||||
}
|
||||
if (nfscl_nodeleg(newvp, 0) == 0 ||
|
||||
@ -1233,6 +1272,7 @@ nfs_lookup(struct vop_lookup_args *ap)
|
||||
*/
|
||||
mtx_lock(&np->n_mtx);
|
||||
np->n_attrstamp = 0;
|
||||
KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(newvp);
|
||||
mtx_unlock(&np->n_mtx);
|
||||
}
|
||||
}
|
||||
@ -1412,8 +1452,10 @@ nfs_mknodrpc(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp,
|
||||
dnp = VTONFS(dvp);
|
||||
mtx_lock(&dnp->n_mtx);
|
||||
dnp->n_flag |= NMODIFIED;
|
||||
if (!dattrflag)
|
||||
if (!dattrflag) {
|
||||
dnp->n_attrstamp = 0;
|
||||
KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(dvp);
|
||||
}
|
||||
mtx_unlock(&dnp->n_mtx);
|
||||
return (error);
|
||||
}
|
||||
@ -1566,8 +1608,10 @@ nfs_create(struct vop_create_args *ap)
|
||||
}
|
||||
mtx_lock(&dnp->n_mtx);
|
||||
dnp->n_flag |= NMODIFIED;
|
||||
if (!dattrflag)
|
||||
if (!dattrflag) {
|
||||
dnp->n_attrstamp = 0;
|
||||
KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(dvp);
|
||||
}
|
||||
mtx_unlock(&dnp->n_mtx);
|
||||
return (error);
|
||||
}
|
||||
@ -1630,6 +1674,7 @@ nfs_remove(struct vop_remove_args *ap)
|
||||
mtx_lock(&np->n_mtx);
|
||||
np->n_attrstamp = 0;
|
||||
mtx_unlock(&np->n_mtx);
|
||||
KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp);
|
||||
return (error);
|
||||
}
|
||||
|
||||
@ -1678,8 +1723,10 @@ nfs_removerpc(struct vnode *dvp, struct vnode *vp, char *name,
|
||||
(void) nfscl_loadattrcache(&dvp, &dnfsva, NULL, NULL, 0, 1);
|
||||
mtx_lock(&dnp->n_mtx);
|
||||
dnp->n_flag |= NMODIFIED;
|
||||
if (!dattrflag)
|
||||
if (!dattrflag) {
|
||||
dnp->n_attrstamp = 0;
|
||||
KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(dvp);
|
||||
}
|
||||
mtx_unlock(&dnp->n_mtx);
|
||||
if (error && NFS_ISV4(dvp))
|
||||
error = nfscl_maperr(td, error, (uid_t)0, (gid_t)0);
|
||||
@ -1857,6 +1904,7 @@ nfs_renamerpc(struct vnode *fdvp, struct vnode *fvp, char *fnameptr,
|
||||
} else {
|
||||
fdnp->n_attrstamp = 0;
|
||||
mtx_unlock(&fdnp->n_mtx);
|
||||
KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(fdvp);
|
||||
}
|
||||
mtx_lock(&tdnp->n_mtx);
|
||||
tdnp->n_flag |= NMODIFIED;
|
||||
@ -1866,6 +1914,7 @@ nfs_renamerpc(struct vnode *fdvp, struct vnode *fvp, char *fnameptr,
|
||||
} else {
|
||||
tdnp->n_attrstamp = 0;
|
||||
mtx_unlock(&tdnp->n_mtx);
|
||||
KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(tdvp);
|
||||
}
|
||||
if (error && NFS_ISV4(fdvp))
|
||||
error = nfscl_maperr(td, error, (uid_t)0, (gid_t)0);
|
||||
@ -1908,6 +1957,7 @@ nfs_link(struct vop_link_args *ap)
|
||||
} else {
|
||||
tdnp->n_attrstamp = 0;
|
||||
mtx_unlock(&tdnp->n_mtx);
|
||||
KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(tdvp);
|
||||
}
|
||||
if (attrflag)
|
||||
(void) nfscl_loadattrcache(&vp, &nfsva, NULL, NULL, 0, 1);
|
||||
@ -1916,6 +1966,7 @@ nfs_link(struct vop_link_args *ap)
|
||||
mtx_lock(&np->n_mtx);
|
||||
np->n_attrstamp = 0;
|
||||
mtx_unlock(&np->n_mtx);
|
||||
KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp);
|
||||
}
|
||||
/*
|
||||
* If negative lookup caching is enabled, I might as well
|
||||
@ -2002,6 +2053,7 @@ nfs_symlink(struct vop_symlink_args *ap)
|
||||
} else {
|
||||
dnp->n_attrstamp = 0;
|
||||
mtx_unlock(&dnp->n_mtx);
|
||||
KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(dvp);
|
||||
}
|
||||
return (error);
|
||||
}
|
||||
@ -2037,6 +2089,7 @@ nfs_mkdir(struct vop_mkdir_args *ap)
|
||||
} else {
|
||||
dnp->n_attrstamp = 0;
|
||||
mtx_unlock(&dnp->n_mtx);
|
||||
KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(dvp);
|
||||
}
|
||||
if (nfhp) {
|
||||
ret = nfscl_nget(dvp->v_mount, dvp, nfhp, cnp, cnp->cn_thread,
|
||||
@ -2105,6 +2158,7 @@ nfs_rmdir(struct vop_rmdir_args *ap)
|
||||
} else {
|
||||
dnp->n_attrstamp = 0;
|
||||
mtx_unlock(&dnp->n_mtx);
|
||||
KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(dvp);
|
||||
}
|
||||
|
||||
cache_purge(dvp);
|
||||
@ -2946,12 +3000,14 @@ nfs_advlock(struct vop_advlock_args *ap)
|
||||
if (ap->a_op == F_SETLK) {
|
||||
if ((np->n_flag & NMODIFIED) == 0) {
|
||||
np->n_attrstamp = 0;
|
||||
KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp);
|
||||
ret = VOP_GETATTR(vp, &va, cred);
|
||||
}
|
||||
if ((np->n_flag & NMODIFIED) || ret ||
|
||||
np->n_change != va.va_filerev) {
|
||||
(void) ncl_vinvalbuf(vp, V_SAVE, td, 1);
|
||||
np->n_attrstamp = 0;
|
||||
KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp);
|
||||
ret = VOP_GETATTR(vp, &va, cred);
|
||||
if (!ret) {
|
||||
np->n_mtime = va.va_mtime;
|
||||
|
120
sys/fs/nfsclient/nfs_kdtrace.h
Normal file
120
sys/fs/nfsclient/nfs_kdtrace.h
Normal file
@ -0,0 +1,120 @@
|
||||
/*-
|
||||
* Copyright (c) 2009 Robert N. M. Watson
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software was developed at the University of Cambridge Computer
|
||||
* Laboratory with support from a grant from Google, Inc.
|
||||
*
|
||||
* 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 _NFSCL_NFS_KDTRACE_H_
|
||||
#define _NFSCL_NFS_KDTRACE_H_
|
||||
|
||||
#ifdef KDTRACE_HOOKS
|
||||
#include <sys/dtrace_bsd.h>
|
||||
|
||||
/*
|
||||
* Definitions for NFS access cache probes.
|
||||
*/
|
||||
extern uint32_t nfscl_accesscache_flush_done_id;
|
||||
extern uint32_t nfscl_accesscache_get_hit_id;
|
||||
extern uint32_t nfscl_accesscache_get_miss_id;
|
||||
extern uint32_t nfscl_accesscache_load_done_id;
|
||||
|
||||
#define KDTRACE_NFS_ACCESSCACHE_FLUSH_DONE(vp) do { \
|
||||
if (dtrace_nfscl_accesscache_flush_done_probe != NULL) \
|
||||
(dtrace_nfscl_accesscache_flush_done_probe)( \
|
||||
nfscl_accesscache_flush_done_id, (vp)); \
|
||||
} while (0)
|
||||
|
||||
#define KDTRACE_NFS_ACCESSCACHE_GET_HIT(vp, uid, mode) do { \
|
||||
if (dtrace_nfscl_accesscache_get_hit_probe != NULL) \
|
||||
(dtrace_nfscl_accesscache_get_hit_probe)( \
|
||||
nfscl_accesscache_get_hit_id, (vp), (uid), \
|
||||
(mode)); \
|
||||
} while (0)
|
||||
|
||||
#define KDTRACE_NFS_ACCESSCACHE_GET_MISS(vp, uid, mode) do { \
|
||||
if (dtrace_nfscl_accesscache_get_miss_probe != NULL) \
|
||||
(dtrace_nfscl_accesscache_get_miss_probe)( \
|
||||
nfscl_accesscache_get_miss_id, (vp), (uid), \
|
||||
(mode)); \
|
||||
} while (0)
|
||||
|
||||
#define KDTRACE_NFS_ACCESSCACHE_LOAD_DONE(vp, uid, rmode, error) do { \
|
||||
if (dtrace_nfscl_accesscache_load_done_probe != NULL) \
|
||||
(dtrace_nfscl_accesscache_load_done_probe)( \
|
||||
nfscl_accesscache_load_done_id, (vp), (uid), \
|
||||
(rmode), (error)); \
|
||||
} while (0)
|
||||
|
||||
/*
|
||||
* Definitions for NFS attribute cache probes.
|
||||
*/
|
||||
extern uint32_t nfscl_attrcache_flush_done_id;
|
||||
extern uint32_t nfscl_attrcache_get_hit_id;
|
||||
extern uint32_t nfscl_attrcache_get_miss_id;
|
||||
extern uint32_t nfscl_attrcache_load_done_id;
|
||||
|
||||
#define KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp) do { \
|
||||
if (dtrace_nfscl_attrcache_flush_done_probe != NULL) \
|
||||
(dtrace_nfscl_attrcache_flush_done_probe)( \
|
||||
nfscl_attrcache_flush_done_id, (vp)); \
|
||||
} while (0)
|
||||
|
||||
#define KDTRACE_NFS_ATTRCACHE_GET_HIT(vp, vap) do { \
|
||||
if (dtrace_nfscl_attrcache_get_hit_probe != NULL) \
|
||||
(dtrace_nfscl_attrcache_get_hit_probe)( \
|
||||
nfscl_attrcache_get_hit_id, (vp), (vap)); \
|
||||
} while (0)
|
||||
|
||||
#define KDTRACE_NFS_ATTRCACHE_GET_MISS(vp) do { \
|
||||
if (dtrace_nfscl_attrcache_get_miss_probe != NULL) \
|
||||
(dtrace_nfscl_attrcache_get_miss_probe)( \
|
||||
nfscl_attrcache_get_miss_id, (vp)); \
|
||||
} while (0)
|
||||
|
||||
#define KDTRACE_NFS_ATTRCACHE_LOAD_DONE(vp, vap, error) do { \
|
||||
if (dtrace_nfscl_attrcache_load_done_probe != NULL) \
|
||||
(dtrace_nfscl_attrcache_load_done_probe)( \
|
||||
nfscl_attrcache_load_done_id, (vp), (vap), \
|
||||
(error)); \
|
||||
} while (0)
|
||||
|
||||
#else /* !KDTRACE_HOOKS */
|
||||
|
||||
#define KDTRACE_NFS_ACCESSCACHE_FLUSH_DONE(vp)
|
||||
#define KDTRACE_NFS_ACCESSCACHE_GET_HIT(vp, uid, mode)
|
||||
#define KDTRACE_NFS_ACCESSCACHE_GET_MISS(vp, uid, mode)
|
||||
#define KDTRACE_NFS_ACCESSCACHE_LOAD_DONE(vp, uid, rmode, error)
|
||||
|
||||
#define KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp)
|
||||
#define KDTRACE_NFS_ATTRCACHE_GET_HIT(vp, vap)
|
||||
#define KDTRACE_NFS_ATTRCACHE_GET_MISS(vp)
|
||||
#define KDTRACE_NFS_ATTRCACHE_LOAD_DONE(vp, vap, error)
|
||||
|
||||
#endif /* KDTRACE_HOOKS */
|
||||
|
||||
#endif /* !_NFSCL_NFS_KDTRACE_H_ */
|
@ -51,21 +51,21 @@ __FBSDID("$FreeBSD$");
|
||||
#define MAX_BPAGES 1024
|
||||
|
||||
struct bus_dma_tag {
|
||||
bus_dma_tag_t parent;
|
||||
bus_size_t alignment;
|
||||
bus_size_t boundary;
|
||||
bus_addr_t lowaddr;
|
||||
bus_addr_t highaddr;
|
||||
bus_dma_tag_t parent;
|
||||
bus_size_t alignment;
|
||||
bus_size_t boundary;
|
||||
bus_addr_t lowaddr;
|
||||
bus_addr_t highaddr;
|
||||
bus_dma_filter_t *filter;
|
||||
void *filterarg;
|
||||
bus_size_t maxsize;
|
||||
u_int nsegments;
|
||||
bus_size_t maxsegsz;
|
||||
int flags;
|
||||
int ref_count;
|
||||
int map_count;
|
||||
bus_dma_lock_t *lockfunc;
|
||||
void *lockfuncarg;
|
||||
void *filterarg;
|
||||
bus_size_t maxsize;
|
||||
u_int nsegments;
|
||||
bus_size_t maxsegsz;
|
||||
int flags;
|
||||
int ref_count;
|
||||
int map_count;
|
||||
bus_dma_lock_t *lockfunc;
|
||||
void *lockfuncarg;
|
||||
bus_dma_segment_t *segments;
|
||||
};
|
||||
|
||||
@ -90,27 +90,27 @@ static int total_deferred;
|
||||
|
||||
SYSCTL_NODE(_hw, OID_AUTO, busdma, CTLFLAG_RD, 0, "Busdma parameters");
|
||||
SYSCTL_INT(_hw_busdma, OID_AUTO, free_bpages, CTLFLAG_RD, &free_bpages, 0,
|
||||
"Free bounce pages");
|
||||
"Free bounce pages");
|
||||
SYSCTL_INT(_hw_busdma, OID_AUTO, reserved_bpages, CTLFLAG_RD, &reserved_bpages,
|
||||
0, "Reserved bounce pages");
|
||||
0, "Reserved bounce pages");
|
||||
SYSCTL_INT(_hw_busdma, OID_AUTO, active_bpages, CTLFLAG_RD, &active_bpages, 0,
|
||||
"Active bounce pages");
|
||||
"Active bounce pages");
|
||||
SYSCTL_INT(_hw_busdma, OID_AUTO, total_bpages, CTLFLAG_RD, &total_bpages, 0,
|
||||
"Total bounce pages");
|
||||
"Total bounce pages");
|
||||
SYSCTL_INT(_hw_busdma, OID_AUTO, total_bounced, CTLFLAG_RD, &total_bounced, 0,
|
||||
"Total bounce requests");
|
||||
SYSCTL_INT(_hw_busdma, OID_AUTO, total_deferred, CTLFLAG_RD, &total_deferred, 0,
|
||||
"Total bounce requests that were deferred");
|
||||
"Total bounce requests");
|
||||
SYSCTL_INT(_hw_busdma, OID_AUTO, total_deferred, CTLFLAG_RD, &total_deferred,
|
||||
0, "Total bounce requests that were deferred");
|
||||
|
||||
struct bus_dmamap {
|
||||
struct bp_list bpages;
|
||||
int pagesneeded;
|
||||
int pagesreserved;
|
||||
bus_dma_tag_t dmat;
|
||||
void *buf; /* unmapped buffer pointer */
|
||||
bus_size_t buflen; /* unmapped buffer length */
|
||||
struct bp_list bpages;
|
||||
int pagesneeded;
|
||||
int pagesreserved;
|
||||
bus_dma_tag_t dmat;
|
||||
void *buf; /* unmapped buffer pointer */
|
||||
bus_size_t buflen; /* unmapped buffer length */
|
||||
bus_dmamap_callback_t *callback;
|
||||
void *callback_arg;
|
||||
void *callback_arg;
|
||||
STAILQ_ENTRY(bus_dmamap) links;
|
||||
};
|
||||
|
||||
@ -121,12 +121,12 @@ static struct bus_dmamap nobounce_dmamap;
|
||||
static void init_bounce_pages(void *dummy);
|
||||
static int alloc_bounce_pages(bus_dma_tag_t dmat, u_int numpages);
|
||||
static int reserve_bounce_pages(bus_dma_tag_t dmat, bus_dmamap_t map,
|
||||
int commit);
|
||||
int commit);
|
||||
static bus_addr_t add_bounce_page(bus_dma_tag_t dmat, bus_dmamap_t map,
|
||||
vm_offset_t vaddr, bus_size_t size);
|
||||
vm_offset_t vaddr, bus_size_t size);
|
||||
static void free_bounce_page(bus_dma_tag_t dmat, struct bounce_page *bpage);
|
||||
static __inline int run_filter(bus_dma_tag_t dmat, bus_addr_t paddr,
|
||||
bus_size_t len);
|
||||
bus_size_t len);
|
||||
|
||||
/*
|
||||
* Return true if a match is made.
|
||||
@ -144,16 +144,14 @@ run_filter(bus_dma_tag_t dmat, bus_addr_t paddr, bus_size_t len)
|
||||
|
||||
retval = 0;
|
||||
bndy = dmat->boundary;
|
||||
|
||||
do {
|
||||
if (((paddr > dmat->lowaddr && paddr <= dmat->highaddr)
|
||||
|| ((paddr & (dmat->alignment - 1)) != 0)
|
||||
|| ((paddr & bndy) != ((paddr + len) & bndy)))
|
||||
&& (dmat->filter == NULL
|
||||
|| (*dmat->filter)(dmat->filterarg, paddr) != 0))
|
||||
if (((paddr > dmat->lowaddr && paddr <= dmat->highaddr) ||
|
||||
(paddr & (dmat->alignment - 1)) != 0 ||
|
||||
(paddr & bndy) != ((paddr + len) & bndy)) &&
|
||||
(dmat->filter == NULL ||
|
||||
(*dmat->filter)(dmat->filterarg, paddr) != 0))
|
||||
retval = 1;
|
||||
|
||||
dmat = dmat->parent;
|
||||
dmat = dmat->parent;
|
||||
} while (retval == 0 && dmat != NULL);
|
||||
return (retval);
|
||||
}
|
||||
@ -195,16 +193,16 @@ dflt_lock(void *arg, bus_dma_lock_op_t op)
|
||||
}
|
||||
|
||||
#define BUS_DMA_MIN_ALLOC_COMP BUS_DMA_BUS4
|
||||
|
||||
/*
|
||||
* Allocate a device specific dma_tag.
|
||||
*/
|
||||
int
|
||||
bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment,
|
||||
bus_size_t boundary, bus_addr_t lowaddr,
|
||||
bus_addr_t highaddr, bus_dma_filter_t *filter,
|
||||
void *filterarg, bus_size_t maxsize, int nsegments,
|
||||
bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc,
|
||||
void *lockfuncarg, bus_dma_tag_t *dmat)
|
||||
bus_size_t boundary, bus_addr_t lowaddr, bus_addr_t highaddr,
|
||||
bus_dma_filter_t *filter, void *filterarg, bus_size_t maxsize,
|
||||
int nsegments, bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc,
|
||||
void *lockfuncarg, bus_dma_tag_t *dmat)
|
||||
{
|
||||
bus_dma_tag_t newtag;
|
||||
int error = 0;
|
||||
@ -250,7 +248,7 @@ bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment,
|
||||
newtag->boundary = parent->boundary;
|
||||
else if (parent->boundary != 0)
|
||||
newtag->boundary = MIN(parent->boundary,
|
||||
newtag->boundary);
|
||||
newtag->boundary);
|
||||
if (newtag->filter == NULL) {
|
||||
/*
|
||||
* Short circuit looking at our parent directly
|
||||
@ -279,7 +277,7 @@ bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment,
|
||||
/* Performed initial allocation */
|
||||
newtag->flags |= BUS_DMA_MIN_ALLOC_COMP;
|
||||
}
|
||||
|
||||
|
||||
if (error != 0) {
|
||||
free(newtag, M_DEVBUF);
|
||||
} else {
|
||||
@ -347,7 +345,7 @@ bus_dmamap_create(bus_dma_tag_t dmat, int flags, bus_dmamap_t *mapp)
|
||||
int maxpages;
|
||||
|
||||
*mapp = (bus_dmamap_t)malloc(sizeof(**mapp), M_DEVBUF,
|
||||
M_NOWAIT | M_ZERO);
|
||||
M_NOWAIT | M_ZERO);
|
||||
if (*mapp == NULL)
|
||||
return (ENOMEM);
|
||||
|
||||
@ -408,7 +406,7 @@ bus_dmamap_destroy(bus_dma_tag_t dmat, bus_dmamap_t map)
|
||||
*/
|
||||
int
|
||||
bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddr, int flags,
|
||||
bus_dmamap_t *mapp)
|
||||
bus_dmamap_t *mapp)
|
||||
{
|
||||
int mflags;
|
||||
|
||||
@ -430,7 +428,7 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddr, int flags,
|
||||
if (flags & BUS_DMA_ZERO)
|
||||
mflags |= M_ZERO;
|
||||
|
||||
/*
|
||||
/*
|
||||
* XXX:
|
||||
* (dmat->alignment < dmat->maxsize) is just a quick hack; the exact
|
||||
* alignment guarantees of malloc need to be nailed down, and the
|
||||
@ -489,15 +487,9 @@ bus_dmamem_free(bus_dma_tag_t dmat, void *vaddr, bus_dmamap_t map)
|
||||
* first indicates if this is the first invocation of this function.
|
||||
*/
|
||||
static int
|
||||
_bus_dmamap_load_buffer(bus_dma_tag_t dmat,
|
||||
bus_dmamap_t map,
|
||||
void *buf, bus_size_t buflen,
|
||||
struct thread *td,
|
||||
int flags,
|
||||
bus_addr_t *lastaddrp,
|
||||
bus_dma_segment_t *segs,
|
||||
int *segp,
|
||||
int first)
|
||||
_bus_dmamap_load_buffer(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf,
|
||||
bus_size_t buflen, struct thread *td, int flags, bus_addr_t *lastaddrp,
|
||||
bus_dma_segment_t *segs, int *segp, int first)
|
||||
{
|
||||
bus_size_t sgsize;
|
||||
bus_addr_t curaddr, lastaddr, baddr, bmask;
|
||||
@ -607,7 +599,7 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dmat,
|
||||
if (curaddr == lastaddr &&
|
||||
(segs[seg].ds_len + sgsize) <= dmat->maxsegsz &&
|
||||
(dmat->boundary == 0 ||
|
||||
(segs[seg].ds_addr & bmask) == (curaddr & bmask)))
|
||||
(segs[seg].ds_addr & bmask) == (curaddr & bmask)))
|
||||
segs[seg].ds_len += sgsize;
|
||||
else {
|
||||
if (++seg >= dmat->nsegments)
|
||||
@ -636,11 +628,11 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dmat,
|
||||
*/
|
||||
int
|
||||
bus_dmamap_load(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf,
|
||||
bus_size_t buflen, bus_dmamap_callback_t *callback,
|
||||
void *callback_arg, int flags)
|
||||
bus_size_t buflen, bus_dmamap_callback_t *callback, void *callback_arg,
|
||||
int flags)
|
||||
{
|
||||
bus_addr_t lastaddr = 0;
|
||||
int error, nsegs = 0;
|
||||
bus_addr_t lastaddr = 0;
|
||||
int error, nsegs = 0;
|
||||
|
||||
if (map != NULL) {
|
||||
flags |= BUS_DMA_WAITOK;
|
||||
@ -666,10 +658,8 @@ bus_dmamap_load(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf,
|
||||
* Like _bus_dmamap_load(), but for mbufs.
|
||||
*/
|
||||
int
|
||||
bus_dmamap_load_mbuf(bus_dma_tag_t dmat, bus_dmamap_t map,
|
||||
struct mbuf *m0,
|
||||
bus_dmamap_callback2_t *callback, void *callback_arg,
|
||||
int flags)
|
||||
bus_dmamap_load_mbuf(bus_dma_tag_t dmat, bus_dmamap_t map, struct mbuf *m0,
|
||||
bus_dmamap_callback2_t *callback, void *callback_arg, int flags)
|
||||
{
|
||||
int nsegs, error;
|
||||
|
||||
@ -686,9 +676,8 @@ bus_dmamap_load_mbuf(bus_dma_tag_t dmat, bus_dmamap_t map,
|
||||
for (m = m0; m != NULL && error == 0; m = m->m_next) {
|
||||
if (m->m_len > 0) {
|
||||
error = _bus_dmamap_load_buffer(dmat, map,
|
||||
m->m_data, m->m_len,
|
||||
NULL, flags, &lastaddr,
|
||||
dmat->segments, &nsegs, first);
|
||||
m->m_data, m->m_len, NULL, flags,
|
||||
&lastaddr, dmat->segments, &nsegs, first);
|
||||
first = 0;
|
||||
}
|
||||
}
|
||||
@ -707,9 +696,8 @@ bus_dmamap_load_mbuf(bus_dma_tag_t dmat, bus_dmamap_t map,
|
||||
}
|
||||
|
||||
int
|
||||
bus_dmamap_load_mbuf_sg(bus_dma_tag_t dmat, bus_dmamap_t map,
|
||||
struct mbuf *m0, bus_dma_segment_t *segs,
|
||||
int *nsegs, int flags)
|
||||
bus_dmamap_load_mbuf_sg(bus_dma_tag_t dmat, bus_dmamap_t map, struct mbuf *m0,
|
||||
bus_dma_segment_t *segs, int *nsegs, int flags)
|
||||
{
|
||||
int error;
|
||||
|
||||
@ -726,9 +714,8 @@ bus_dmamap_load_mbuf_sg(bus_dma_tag_t dmat, bus_dmamap_t map,
|
||||
for (m = m0; m != NULL && error == 0; m = m->m_next) {
|
||||
if (m->m_len > 0) {
|
||||
error = _bus_dmamap_load_buffer(dmat, map,
|
||||
m->m_data, m->m_len,
|
||||
NULL, flags, &lastaddr,
|
||||
segs, nsegs, first);
|
||||
m->m_data, m->m_len, NULL, flags,
|
||||
&lastaddr, segs, nsegs, first);
|
||||
first = 0;
|
||||
}
|
||||
}
|
||||
@ -744,10 +731,8 @@ bus_dmamap_load_mbuf_sg(bus_dma_tag_t dmat, bus_dmamap_t map,
|
||||
* Like _bus_dmamap_load(), but for uios.
|
||||
*/
|
||||
int
|
||||
bus_dmamap_load_uio(bus_dma_tag_t dmat, bus_dmamap_t map,
|
||||
struct uio *uio,
|
||||
bus_dmamap_callback2_t *callback, void *callback_arg,
|
||||
int flags)
|
||||
bus_dmamap_load_uio(bus_dma_tag_t dmat, bus_dmamap_t map, struct uio *uio,
|
||||
bus_dmamap_callback2_t *callback, void *callback_arg, int flags)
|
||||
{
|
||||
bus_addr_t lastaddr;
|
||||
int nsegs, error, first, i;
|
||||
@ -826,8 +811,7 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus_dmamap_t map, bus_dmasync_op_t op)
|
||||
if (op & BUS_DMASYNC_PREWRITE) {
|
||||
while (bpage != NULL) {
|
||||
bcopy((void *)bpage->datavaddr,
|
||||
(void *)bpage->vaddr,
|
||||
bpage->datacount);
|
||||
(void *)bpage->vaddr, bpage->datacount);
|
||||
bpage = STAILQ_NEXT(bpage, links);
|
||||
}
|
||||
total_bounced++;
|
||||
@ -836,8 +820,7 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus_dmamap_t map, bus_dmasync_op_t op)
|
||||
if (op & BUS_DMASYNC_POSTREAD) {
|
||||
while (bpage != NULL) {
|
||||
bcopy((void *)bpage->vaddr,
|
||||
(void *)bpage->datavaddr,
|
||||
bpage->datacount);
|
||||
(void *)bpage->datavaddr, bpage->datacount);
|
||||
bpage = STAILQ_NEXT(bpage, links);
|
||||
}
|
||||
total_bounced++;
|
||||
@ -870,15 +853,11 @@ alloc_bounce_pages(bus_dma_tag_t dmat, u_int numpages)
|
||||
struct bounce_page *bpage;
|
||||
|
||||
bpage = (struct bounce_page *)malloc(sizeof(*bpage), M_DEVBUF,
|
||||
M_NOWAIT | M_ZERO);
|
||||
|
||||
M_NOWAIT | M_ZERO);
|
||||
if (bpage == NULL)
|
||||
break;
|
||||
bpage->vaddr = (vm_offset_t)contigmalloc(PAGE_SIZE, M_DEVBUF,
|
||||
M_NOWAIT, 0ul,
|
||||
dmat->lowaddr,
|
||||
PAGE_SIZE,
|
||||
dmat->boundary);
|
||||
M_NOWAIT, 0ul, dmat->lowaddr, PAGE_SIZE, dmat->boundary);
|
||||
if (bpage->vaddr == 0) {
|
||||
free(bpage, M_DEVBUF);
|
||||
break;
|
||||
@ -914,7 +893,7 @@ reserve_bounce_pages(bus_dma_tag_t dmat, bus_dmamap_t map, int commit)
|
||||
|
||||
static bus_addr_t
|
||||
add_bounce_page(bus_dma_tag_t dmat, bus_dmamap_t map, vm_offset_t vaddr,
|
||||
bus_size_t size)
|
||||
bus_size_t size)
|
||||
{
|
||||
struct bounce_page *bpage;
|
||||
|
||||
@ -974,8 +953,8 @@ free_bounce_page(bus_dma_tag_t dmat, struct bounce_page *bpage)
|
||||
if ((map = STAILQ_FIRST(&bounce_map_waitinglist)) != NULL) {
|
||||
if (reserve_bounce_pages(map->dmat, map, 1) == 0) {
|
||||
STAILQ_REMOVE_HEAD(&bounce_map_waitinglist, links);
|
||||
STAILQ_INSERT_TAIL(&bounce_map_callbacklist,
|
||||
map, links);
|
||||
STAILQ_INSERT_TAIL(&bounce_map_callbacklist, map,
|
||||
links);
|
||||
busdma_swi_pending = 1;
|
||||
total_deferred++;
|
||||
swi_sched(vm_ih, 0);
|
||||
@ -997,7 +976,7 @@ busdma_swi(void)
|
||||
dmat = map->dmat;
|
||||
(dmat->lockfunc)(dmat->lockfuncarg, BUS_DMA_LOCK);
|
||||
bus_dmamap_load(map->dmat, map, map->buf, map->buflen,
|
||||
map->callback, map->callback_arg, /*flags*/0);
|
||||
map->callback, map->callback_arg, /*flags*/0);
|
||||
(dmat->lockfunc)(dmat->lockfuncarg, BUS_DMA_UNLOCK);
|
||||
mtx_lock(&bounce_lock);
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user