Merge ^/head r285793 through r285923.

This commit is contained in:
Dimitry Andric 2015-07-27 22:20:28 +00:00
commit 5f78ec1c9f
248 changed files with 8534 additions and 2824 deletions

View File

@ -192,7 +192,7 @@ printlong(const DISPLAY *dp)
if (f_numericonly) {
xo_emit("{t:mode/%s}{e:mode_octal/%03o} {t:links/%*u} {td:user/%-*s}{e:user/%ju} {td:group/%-*s}{e:group/%ju} ",
buf, (int) sp->st_mode & ALLPERMS, dp->s_nlink, sp->st_nlink,
dp->s_user, np->user, sp->st_uid, dp->s_group, np->group, sp->st_gid);
dp->s_user, np->user, (uintmax_t)sp->st_uid, dp->s_group, np->group, (uintmax_t)sp->st_gid);
} else {
xo_emit("{t:mode/%s}{e:mode_octal/%03o} {t:links/%*u} {t:user/%-*s} {t:group/%-*s} ",
buf, (int) sp->st_mode & ALLPERMS, dp->s_nlink, sp->st_nlink,
@ -456,7 +456,7 @@ printtime(const char *field, time_t ftime)
snprintf(fmt, sizeof(fmt), "{d:%s/%%hs} ", field);
xo_attr("value", "%ld", (long) ftime);
xo_emit(fmt, longstring);
snprintf(fmt, sizeof(fmt), "{en:%s/%%ld} ", field);
snprintf(fmt, sizeof(fmt), "{en:%s/%%ld}", field);
xo_emit(fmt, (long) ftime);
}
@ -486,7 +486,7 @@ printtype(u_int mode)
xo_emit("{D:=}{e:type/socket}");
return (1);
case S_IFWHT:
xo_emit("{D:%}{e:type/whiteout}");
xo_emit("{D:%%}{e:type/whiteout}");
return (1);
default:
break;

View File

@ -813,7 +813,8 @@ _ELF_DEFINE_EM(EM_KM32, 210, "KM211 KM32 32-bit processor") \
_ELF_DEFINE_EM(EM_KMX32, 211, "KM211 KMX32 32-bit processor") \
_ELF_DEFINE_EM(EM_KMX16, 212, "KM211 KMX16 16-bit processor") \
_ELF_DEFINE_EM(EM_KMX8, 213, "KM211 KMX8 8-bit processor") \
_ELF_DEFINE_EM(EM_KVARC, 214, "KM211 KMX32 KVARC processor")
_ELF_DEFINE_EM(EM_KVARC, 214, "KM211 KMX32 KVARC processor") \
_ELF_DEFINE_EM(EM_RISCV, 243, "RISC-V")
#undef _ELF_DEFINE_EM
#define _ELF_DEFINE_EM(N, V, DESCR) N = V ,

View File

@ -27,6 +27,7 @@
#include <sys/param.h>
#include <sys/queue.h>
#include <ar.h>
#include <assert.h>
#include <ctype.h>
#include <dwarf.h>
#include <err.h>
@ -314,6 +315,7 @@ static const char *dwarf_reg(unsigned int mach, unsigned int reg);
static const char *dwarf_regname(struct readelf *re, unsigned int num);
static struct dumpop *find_dumpop(struct readelf *re, size_t si,
const char *sn, int op, int t);
static int get_ent_count(struct section *s, int *ent_count);
static char *get_regoff_str(struct readelf *re, Dwarf_Half reg,
Dwarf_Addr off);
static const char *get_string(struct readelf *re, int strtab, size_t off);
@ -532,6 +534,7 @@ elf_machine(unsigned int mach)
case EM_ARCA: return "Arca RISC Microprocessor";
case EM_UNICORE: return "Microprocessor series from PKU-Unity Ltd";
case EM_AARCH64: return "AArch64";
case EM_RISCV: return "RISC-V";
default:
snprintf(s_mach, sizeof(s_mach), "<unknown: %#x>", mach);
return (s_mach);
@ -2900,6 +2903,24 @@ dump_shdr(struct readelf *re)
#undef ST_CTL
}
/*
* Return number of entries in the given section. We'd prefer ent_count be a
* size_t *, but libelf APIs already use int for section indices.
*/
static int
get_ent_count(struct section *s, int *ent_count)
{
if (s->entsize == 0) {
warnx("section %s has entry size 0", s->name);
return (0);
} else if (s->sz / s->entsize > INT_MAX) {
warnx("section %s has invalid section count", s->name);
return (0);
}
*ent_count = (int)(s->sz / s->entsize);
return (1);
}
static void
dump_dynamic(struct readelf *re)
{
@ -2928,8 +2949,8 @@ dump_dynamic(struct readelf *re)
/* Determine the actual number of table entries. */
nentries = 0;
jmax = (int) (s->sz / s->entsize);
if (!get_ent_count(s, &jmax))
continue;
for (j = 0; j < jmax; j++) {
if (gelf_getdyn(d, j, &dyn) != &dyn) {
warnx("gelf_getdyn failed: %s",
@ -3175,7 +3196,9 @@ dump_rel(struct readelf *re, struct section *s, Elf_Data *d)
else
printf("%-12s %-12s %-19s %-16s %s\n", REL_HDR);
}
len = d->d_size / s->entsize;
assert(d->d_size == s->sz);
if (!get_ent_count(s, &len))
return;
for (i = 0; i < len; i++) {
if (gelf_getrel(d, i, &r) != &r) {
warnx("gelf_getrel failed: %s", elf_errmsg(-1));
@ -3231,7 +3254,9 @@ dump_rela(struct readelf *re, struct section *s, Elf_Data *d)
else
printf("%-12s %-12s %-19s %-16s %s\n", RELA_HDR);
}
len = d->d_size / s->entsize;
assert(d->d_size == s->sz);
if (!get_ent_count(s, &len))
return;
for (i = 0; i < len; i++) {
if (gelf_getrela(d, i, &r) != &r) {
warnx("gelf_getrel failed: %s", elf_errmsg(-1));
@ -3296,7 +3321,7 @@ dump_symtab(struct readelf *re, int i)
Elf_Data *d;
GElf_Sym sym;
const char *name;
int elferr, stab, j;
int elferr, stab, j, len;
s = &re->sl[i];
stab = s->link;
@ -3309,12 +3334,14 @@ dump_symtab(struct readelf *re, int i)
}
if (d->d_size <= 0)
return;
if (!get_ent_count(s, &len))
return;
printf("Symbol table (%s)", s->name);
printf(" contains %ju entries:\n", s->sz / s->entsize);
printf(" contains %d entries:\n", len);
printf("%7s%9s%14s%5s%8s%6s%9s%5s\n", "Num:", "Value", "Size", "Type",
"Bind", "Vis", "Ndx", "Name");
for (j = 0; (uint64_t)j < s->sz / s->entsize; j++) {
for (j = 0; j < len; j++) {
if (gelf_getsym(d, j, &sym) != &sym) {
warnx("gelf_getsym failed: %s", elf_errmsg(-1));
continue;
@ -3352,7 +3379,7 @@ dump_symtabs(struct readelf *re)
Elf_Data *d;
struct section *s;
uint64_t dyn_off;
int elferr, i;
int elferr, i, len;
/*
* If -D is specified, only dump the symbol table specified by
@ -3377,8 +3404,10 @@ dump_symtabs(struct readelf *re)
}
if (d->d_size <= 0)
return;
if (!get_ent_count(s, &len))
return;
for (i = 0; (uint64_t)i < s->sz / s->entsize; i++) {
for (i = 0; i < len; i++) {
if (gelf_getdyn(d, i, &dyn) != &dyn) {
warnx("gelf_getdyn failed: %s", elf_errmsg(-1));
continue;
@ -3566,7 +3595,8 @@ dump_gnu_hash(struct readelf *re, struct section *s)
maskwords = buf[2];
buf += 4;
ds = &re->sl[s->link];
dynsymcount = ds->sz / ds->entsize;
if (!get_ent_count(ds, &dynsymcount))
return;
nchain = dynsymcount - symndx;
if (d->d_size != 4 * sizeof(uint32_t) + maskwords *
(re->ec == ELFCLASS32 ? sizeof(uint32_t) : sizeof(uint64_t)) +
@ -3995,7 +4025,7 @@ dump_liblist(struct readelf *re)
char tbuf[20];
Elf_Data *d;
Elf_Lib *lib;
int i, j, k, elferr, first;
int i, j, k, elferr, first, len;
for (i = 0; (size_t) i < re->shnum; i++) {
s = &re->sl[i];
@ -4012,8 +4042,10 @@ dump_liblist(struct readelf *re)
if (d->d_size <= 0)
continue;
lib = d->d_buf;
if (!get_ent_count(s, &len))
continue;
printf("\nLibrary list section '%s' ", s->name);
printf("contains %ju entries:\n", s->sz / s->entsize);
printf("contains %d entries:\n", len);
printf("%12s%24s%18s%10s%6s\n", "Library", "Time Stamp",
"Checksum", "Version", "Flags");
for (j = 0; (uint64_t) j < s->sz / s->entsize; j++) {
@ -4398,7 +4430,7 @@ static void
dump_mips_reginfo(struct readelf *re, struct section *s)
{
Elf_Data *d;
int elferr;
int elferr, len;
(void) elf_errno();
if ((d = elf_rawdata(s->scn, NULL)) == NULL) {
@ -4410,9 +4442,10 @@ dump_mips_reginfo(struct readelf *re, struct section *s)
}
if (d->d_size <= 0)
return;
if (!get_ent_count(s, &len))
return;
printf("\nSection '%s' contains %ju entries:\n", s->name,
s->sz / s->entsize);
printf("\nSection '%s' contains %d entries:\n", s->name, len);
dump_mips_odk_reginfo(re, d->d_buf, d->d_size);
}

View File

@ -5433,6 +5433,15 @@ nomatch 32 {
action "kldload -n umodem";
};
nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
match "intclass" "0x02";
match "intsubclass" "0x02";
match "intprotocol" "0xff";
action "kldload -n if_urndis";
};
nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
@ -5576,5 +5585,5 @@ nomatch 32 {
action "kldload -n umass";
};
# 2687 USB entries processed
# 2688 USB entries processed

View File

@ -528,6 +528,8 @@
..
gzip
..
ident
..
join
..
jot

View File

@ -1,3 +1,5 @@
SUBDIR= lib ci co ident merge rcs rcsclean rcsdiff rcsmerge rlog rcsfreeze
# $FreeBSD$
SUBDIR= lib ci co merge rcs rcsclean rcsdiff rcsmerge rlog rcsfreeze
.include <bsd.subdir.mk>

View File

@ -1,8 +0,0 @@
PROG= ident
SRCS= ident.c
CFLAGS+= -I${.CURDIR}/../lib
LDADD= ${LIBRCS}
DPADD= ${LIBRCS}
.include "../../Makefile.inc"
.include <bsd.prog.mk>

View File

@ -1,19 +0,0 @@
# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
gnu/lib/csu \
gnu/lib/libgcc \
gnu/usr.bin/rcs/lib \
include \
include/xlocale \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
.include <dirdeps.mk>
.if ${DEP_RELDIR} == ${_DEP_RELDIR}
# local dependencies - needed for -jN in clean tree
.endif

View File

@ -1,182 +0,0 @@
.de Id
.ds Rv \\$3
.ds Dt \\$4
.ds iD \\$3 \\$4 \\$5 \\$6 \\$7
..
.Id $FreeBSD$
.ds r \&\s-1RCS\s0
.ds u \&\s-1UTC\s0
.if n .ds - \%--
.if t .ds - \(em
.TH IDENT 1 \*(Dt GNU
.SH NAME
ident \- identify RCS keyword strings in files
.SH SYNOPSIS
.B ident
[
.B \-q
] [
.B \-V
] [
.I file
\&.\|.\|. ]
.SH DESCRIPTION
.B ident
searches for all instances of the pattern
.BI $ keyword : "\ text\ " $
in the named files or, if no files are named, the standard input.
.PP
These patterns are normally inserted automatically by the \*r command
.BR co (1),
but can also be inserted manually.
The option
.B \-q
suppresses
the warning given if there are no patterns in a file.
The option
.B \-V
prints
.BR ident 's
version number.
.PP
.B ident
works on text files as well as object files and dumps.
For example, if the C program in
.B f.c
contains
.IP
.ft 3
#include <stdio.h>
.br
static char const rcsid[] =
.br
\&"$\&Id: f.c,v \*(iD $\&";
.br
int main() { return printf(\&"%s\en\&", rcsid) == EOF; }
.ft P
.LP
and
.B f.c
is compiled into
.BR f.o ,
then the command
.IP
.B "ident f.c f.o"
.LP
will output
.nf
.IP
.ft 3
f.c:
$\&Id: f.c,v \*(iD $
f.o:
$\&Id: f.c,v \*(iD $
.ft
.fi
.PP
If a C program defines a string like
.B rcsid
above but does not use it,
.BR lint (1)
may complain, and some C compilers will optimize away the string.
The most reliable solution is to have the program use the
.B rcsid
string, as shown in the example above.
.PP
.B ident
finds all instances of the
.BI $ keyword : "\ text\ " $
pattern, even if
.I keyword
is not actually an \*r-supported keyword.
This gives you information about nonstandard keywords like
.BR $\&XConsortium$ .
.SH KEYWORDS
Here is the list of keywords currently maintained by
.BR co (1).
All times are given in Coordinated Universal Time (\*u,
sometimes called \&\s-1GMT\s0) by default, but if the files
were checked out with
.BR co 's
.BI \-z zone
option, times are given with a numeric time zone indication appended.
.TP
.B $\&Author$
The login name of the user who checked in the revision.
.TP
.B $\&Date$
The date and time the revision was checked in.
.TP
.B $\&Header$
A standard header containing the full pathname of the \*r file, the
revision number, the date and time, the author, the state,
and the locker (if locked).
.TP
.B $\&Id$
Same as
.BR $\&Header$ ,
except that the \*r filename is without a path.
.TP
.B $\&Locker$
The login name of the user who locked the revision (empty if not locked).
.TP
.B $\&Log$
The log message supplied during checkin.
For
.BR ident 's
purposes, this is equivalent to
.BR $\&RCSfile$ .
.TP
.B $\&Name$
The symbolic name used to check out the revision, if any.
.TP
.B $\&RCSfile$
The name of the \*r file without a path.
.TP
.B $\&Revision$
The revision number assigned to the revision.
.TP
.B $\&Source$
The full pathname of the \*r file.
.TP
.B $\&State$
The state assigned to the revision with the
.B \-s
option of
.BR rcs (1)
or
.BR ci (1).
.PP
.BR co (1)
represents the following characters in keyword values by escape sequences
to keep keyword strings well-formed.
.LP
.RS
.nf
.ne 6
.ta \w'newline 'u
\f2char escape sequence\fP
tab \f3\et\fP
newline \f3\en\fP
space \f3\e040
$ \e044
\e \e\e\fP
.fi
.RE
.SH IDENTIFICATION
Author: Walter F. Tichy.
.br
Manual Page Revision: \*(Rv; Release Date: \*(Dt.
.br
Copyright \(co 1982, 1988, 1989 Walter F. Tichy.
.br
Copyright \(co 1990, 1992, 1993 Paul Eggert.
.SH "SEE ALSO"
ci(1), co(1), rcs(1), rcsdiff(1), rcsintro(1), rcsmerge(1), rlog(1),
rcsfile(5)
.br
Walter F. Tichy,
\*r\*-A System for Version Control,
.I "Software\*-Practice & Experience"
.BR 15 ,
7 (July 1985), 637-654.

View File

@ -1,270 +0,0 @@
/* Identify RCS keyword strings in files. */
/* Copyright 1982, 1988, 1989 Walter Tichy
Copyright 1990, 1991, 1992, 1993, 1994, 1995 Paul Eggert
Distributed under license by the Free Software Foundation, Inc.
This file is part of RCS.
RCS is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
RCS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with RCS; see the file COPYING.
If not, write to the Free Software Foundation,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Report problems and direct all questions to:
rcs-bugs@cs.purdue.edu
*/
/*
* Revision 5.9 1995/06/16 06:19:24 eggert
* Update FSF address.
*
* Revision 5.8 1995/06/01 16:23:43 eggert
* (exiterr, reportError): New functions, needed for DOS and OS/2 ports.
* (scanfile): Use them.
*
* Revision 5.7 1994/03/20 04:52:58 eggert
* Remove `exiting' from identExit.
*
* Revision 5.6 1993/11/09 17:40:15 eggert
* Add -V.
*
* Revision 5.5 1993/11/03 17:42:27 eggert
* Test for char == EOF, not char < 0.
*
* Revision 5.4 1992/01/24 18:44:19 eggert
* lint -> RCS_lint
*
* Revision 5.3 1991/09/10 22:15:46 eggert
* Open files with FOPEN_R, not FOPEN_R_WORK,
* because they might be executables, not working files.
*
* Revision 5.2 1991/08/19 03:13:55 eggert
* Report read errors immediately.
*
* Revision 5.1 1991/02/25 07:12:37 eggert
* Don't report empty keywords. Check for I/O errors.
*
* Revision 5.0 1990/08/22 08:12:37 eggert
* Don't limit output to known keywords.
* Remove arbitrary limits and lint. Ansify and Posixate.
*
* Revision 4.5 89/05/01 15:11:54 narten
* changed copyright header to reflect current distribution rules
*
* Revision 4.4 87/10/23 17:09:57 narten
* added exit(0) so exit return code would be non random
*
* Revision 4.3 87/10/18 10:23:55 narten
* Updating version numbers. Changes relative to 1.1 are actually relative
* to 4.1
*
* Revision 1.3 87/07/09 09:20:52 trinkle
* Added check to make sure there is at least one arg before comparing argv[1]
* with "-q". This necessary on machines that don't allow dereferncing null
* pointers (i.e. Suns).
*
* Revision 1.2 87/03/27 14:21:47 jenkins
* Port to suns
*
* Revision 4.1 83/05/10 16:31:02 wft
* Added option -q and input from reading stdin.
* Marker matching is now done with trymatch() (independent of keywords).
*
* Revision 3.4 83/02/18 17:37:49 wft
* removed printing of new line after last file.
*
* Revision 3.3 82/12/04 12:48:55 wft
* Added LOCKER.
*
* Revision 3.2 82/11/28 18:24:17 wft
* removed Suffix; added ungetc to avoid skipping over trailing KDELIM.
*
* Revision 3.1 82/10/13 15:58:51 wft
* fixed type of variables receiving from getc() (char-->int).
*/
#include "rcsbase.h"
static int match P((FILE*));
static int scanfile P((FILE*,char const*,int));
static void reportError P((char const*));
mainProg(identId, "ident", "$FreeBSD$")
/* Ident searches the named files for all occurrences
* of the pattern $@: text $ where @ is a keyword.
*/
{
FILE *fp;
int quiet = 0;
int status = EXIT_SUCCESS;
char const *a;
while ((a = *++argv) && *a=='-')
while (*++a)
switch (*a) {
case 'q':
quiet = 1;
break;
case 'V':
VOID printf("RCS version %s\n", RCS_version_string);
quiet = -1;
break;
default:
VOID fprintf(stderr,
"ident: usage: ident -{qV} [file...]\n"
);
exitmain(EXIT_FAILURE);
break;
}
if (0 <= quiet)
if (!a)
VOID scanfile(stdin, (char*)0, quiet);
else
do {
if (!(fp = fopen(a, FOPEN_RB))) {
reportError(a);
status = EXIT_FAILURE;
} else if (
scanfile(fp, a, quiet) != 0
|| (argv[1] && putchar('\n') == EOF)
)
break;
} while ((a = *++argv));
if (ferror(stdout) || fclose(stdout)!=0) {
reportError("standard output");
status = EXIT_FAILURE;
}
exitmain(status);
}
#if RCS_lint
# define exiterr identExit
#endif
void
exiterr()
{
_exit(EXIT_FAILURE);
}
static void
reportError(s)
char const *s;
{
int e = errno;
VOID fprintf(stderr, "%s error: ", cmdid);
errno = e;
perror(s);
}
static int
scanfile(file, name, quiet)
register FILE *file;
char const *name;
int quiet;
/* Function: scan an open file with descriptor file for keywords.
* Return -1 if there's a write error; exit immediately on a read error.
*/
{
register int c;
if (name) {
VOID printf("%s:\n", name);
if (ferror(stdout))
return -1;
} else
name = "standard input";
c = 0;
while (c != EOF || ! (feof(file)|ferror(file))) {
if (c == KDELIM) {
if ((c = match(file)))
continue;
if (ferror(stdout))
return -1;
quiet = true;
}
c = getc(file);
}
if (ferror(file) || fclose(file) != 0) {
reportError(name);
/*
* The following is equivalent to exit(EXIT_FAILURE), but we invoke
* exiterr to keep lint happy. The DOS and OS/2 ports need exiterr.
*/
VOID fflush(stderr);
VOID fflush(stdout);
exiterr();
}
if (!quiet)
VOID fprintf(stderr, "%s warning: no id keywords in %s\n", cmdid, name);
return 0;
}
static int
match(fp) /* group substring between two KDELIM's; then do pattern match */
register FILE *fp;
{
char line[BUFSIZ];
register int c;
register char * tp;
tp = line;
while ((c = getc(fp)) != VDELIM) {
if (c == EOF && feof(fp) | ferror(fp))
return c;
switch (ctab[c]) {
case LETTER: case Letter: case DIGIT:
*tp++ = c;
if (tp < line+sizeof(line)-4)
break;
/* fall into */
default:
return c ? c : '\n'/* anything but 0 or KDELIM or EOF */;
}
}
if (tp == line)
return c;
*tp++ = c;
if ((c = getc(fp)) != ' ')
return c ? c : '\n';
*tp++ = c;
while( (c = getc(fp)) != KDELIM ) {
if (c == EOF && feof(fp) | ferror(fp))
return c;
switch (ctab[c]) {
default:
*tp++ = c;
if (tp < line+sizeof(line)-2)
break;
/* fall into */
case NEWLN: case UNKN:
return c ? c : '\n';
}
}
if (tp[-1] != ' ')
return c;
*tp++ = c; /*append trailing KDELIM*/
*tp = '\0';
VOID printf(" %c%s\n", KDELIM, line);
return 0;
}

View File

@ -31,7 +31,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd August 7, 2009
.Dd July 25, 2015
.Dt MAC 3
.Os
.Sh NAME
@ -163,14 +163,3 @@ Support for Mandatory Access Control was introduced in
as part of the
.Tn TrustedBSD
Project.
.Sh BUGS
The
.Tn TrustedBSD
MAC Framework and associated policies, interfaces, and
applications are considered to be an experimental feature in
.Fx .
Sites considering production deployment should keep the experimental
status of these services in mind during any deployment process.
See also
.Xr mac 9
for related considerations regarding the kernel framework.

View File

@ -29,7 +29,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd April 19, 2003
.Dd July 25, 2015
.Dt MAC.CONF 5
.Os
.Sh NAME
@ -110,14 +110,3 @@ Support for Mandatory Access Control was introduced in
as part of the
.Tn TrustedBSD
Project.
.Sh BUGS
The
.Tn TrustedBSD
MAC Framework and associated policies, interfaces, and
applications are considered to be an experimental feature in
.Fx .
Sites considering production deployment should keep the experimental
status of these services in mind during any deployment process.
See also
.Xr mac 9
for related considerations regarding the kernel framework.

View File

@ -32,7 +32,7 @@
.\" @(#)system.3 8.1 (Berkeley) 6/4/93
.\" $FreeBSD$
.\"
.Dd June 4, 1993
.Dd July 25, 2015
.Dt SYSTEM 3
.Os
.Sh NAME
@ -87,7 +87,8 @@ failed.
.Xr execve 2 ,
.Xr fork 2 ,
.Xr waitpid 2 ,
.Xr popen 3
.Xr popen 3 ,
.Xr posix_spawn 3
.Sh STANDARDS
The
.Fn system
@ -97,3 +98,14 @@ conforms to
and is expected to be
.St -p1003.2
compatible.
.Sh SECURITY CONSIDERATIONS
The
.Fn system
function is easily misused in a manner that enables a malicious
user to run arbitrary command,
because all meta-characters supported by
.Xr sh 1
would be honored.
User supplied parameters should always be carefully santized
before they appear in
.Fa string.

View File

@ -82,7 +82,7 @@ Dump kernel memory before rebooting; see
.Xr savecore 8
for more information.
.It Dv RB_HALT
the processor is simply halted; no reboot takes place.
The processor is simply halted; no reboot takes place.
This option should be used with caution.
.It Dv RB_POWEROFF
After halting, the shutdown code will do what it can to turn

View File

@ -29,7 +29,7 @@
.\" @(#)shutdown.2 8.1 (Berkeley) 6/4/93
.\" $FreeBSD$
.\"
.Dd March 5, 2007
.Dd July 27, 2015
.Dt SHUTDOWN 2
.Os
.Sh NAME
@ -79,40 +79,26 @@ The following protocol specific actions apply to the use of
based on the properties of the socket associated with the file descriptor
.Fa s .
.Bl -column ".Dv PF_INET6" ".Dv SOCK_STREAM" ".Dv IPPROTO_SCTP"
.It Sy Domain Ta Sy Type Ta Sy Protocol Ta Sy Return value and action
.It Sy Domain Ta Sy Type Ta Sy Protocol Ta Sy Action
.It Dv PF_INET Ta Dv SOCK_DGRAM Ta Dv IPPROTO_SCTP Ta
Return \-1.
The global variable
.Va errno
will be set to
.Er EOPNOTSUPP .
Failure,
as socket is not connected.
.It Dv PF_INET Ta Dv SOCK_DGRAM Ta Dv IPPROTO_UDP Ta
Return 0.
ICMP messages will
.Em not
be generated.
Failure,
as socket is not connected.
.It Dv PF_INET Ta Dv SOCK_STREAM Ta Dv IPPROTO_SCTP Ta
Return 0.
Send queued data and tear down association.
.It Dv PF_INET Ta Dv SOCK_STREAM Ta Dv IPPROTO_TCP Ta
Return 0.
Send queued data, wait for ACK, then send FIN.
.It Dv PF_INET6 Ta Dv SOCK_DGRAM Ta Dv IPPROTO_SCTP Ta
Return \-1.
The global variable
.Va errno
will be set to
.Er EOPNOTSUPP .
Failure,
as socket is not connected.
.It Dv PF_INET6 Ta Dv SOCK_DGRAM Ta Dv IPPROTO_UDP Ta
Return 0.
ICMP messages will
.Em not
be generated.
Failure,
as socket is not connected.
.It Dv PF_INET6 Ta Dv SOCK_STREAM Ta Dv IPPROTO_SCTP Ta
Return 0.
Send queued data and tear down association.
.It Dv PF_INET6 Ta Dv SOCK_STREAM Ta Dv IPPROTO_TCP Ta
Return 0.
Send queued data, wait for ACK, then send FIN.
.El
.\"
@ -131,16 +117,10 @@ argument is not a valid file descriptor.
The
.Fa how
argument is invalid.
.It Bq Er EOPNOTSUPP
The socket associated with the file descriptor
.Fa s
does not support this operation.
.It Bq Er ENOTCONN
The
.Fa s
argument specifies a
.Dv SOCK_STREAM
socket which is not connected.
argument specifies a socket which is not connected.
.It Bq Er ENOTSOCK
The
.Fa s

View File

@ -2,6 +2,6 @@
SHLIB= BIG5
SRCS+= citrus_big5.c
CFLAGS.gcc+= --param max-inline-insns-single=32
CFLAGS.gcc+= --param max-inline-insns-single=64
.include <bsd.lib.mk>

View File

@ -2,6 +2,6 @@
SHLIB= EUC
SRCS+= citrus_euc.c
CFLAGS.gcc+= --param max-inline-insns-single=32
CFLAGS.gcc+= --param max-inline-insns-single=64
.include <bsd.lib.mk>

View File

@ -2,6 +2,6 @@
SHLIB= EUCTW
SRCS+= citrus_euctw.c
CFLAGS.gcc+= --param max-inline-insns-single=32
CFLAGS.gcc+= --param max-inline-insns-single=64
.include <bsd.lib.mk>

View File

@ -2,6 +2,6 @@
SHLIB= UTF1632
SRCS+= citrus_utf1632.c
CFLAGS.gcc+= --param max-inline-insns-single=32
CFLAGS.gcc+= --param max-inline-insns-single=64
.include <bsd.lib.mk>

View File

@ -2,6 +2,6 @@
SHLIB= UTF7
SRCS+= citrus_utf7.c
CFLAGS.gcc+= --param max-inline-insns-single=32
CFLAGS.gcc+= --param max-inline-insns-single=64
.include <bsd.lib.mk>

View File

@ -2,6 +2,6 @@
SHLIB= iconv_std
SRCS+= citrus_iconv_std.c
CFLAGS.gcc+= --param max-inline-insns-single=32
CFLAGS.gcc+= --param max-inline-insns-single=64
.include <bsd.lib.mk>

View File

@ -731,6 +731,8 @@
&hwlist.nsp;
&hwlist.pms;
&hwlist.pst;
&hwlist.siis;

View File

@ -511,6 +511,11 @@
<para revision="285329"><application>OpenSSL</application> has
been updated to version 1.0.1p.</para>
<para revision="285642" contrib="sponsor" sponsor="&dell;">The
&man.ssh.1; utility has been updated to re-implement hostname
canonicalization before locating the host in
<filename>known_hosts</filename>.</para>
</sect2>
<sect2 xml:id="userland-installer">
@ -540,6 +545,24 @@
<para revision="275874">The &man.bsdinstall.8; utility has been
updated to use the new &man.dpv.3; library to display progress
when extracting the &os; distributions.</para>
<para revision="285557" contrib="sponsor"
sponsor="&scaleengine;">Support for detecting and implementing
aligning partitions on 1Mb boundaries has been added to
&man.bsdinstall.8;.</para>
<para revision="285679" contrib="sponsor"
sponsor="&scaleengine;">Support for detecting and implementing
a workaround for various laptops and motherboards that do not
boot properly from <acronym>GPT</acronym>-partitioned disks
has been added to &man.bsdinstall.8;. Additionally, the
<literal>active</literal> flag will be set on the partition
when needed.</para>
<para revision="285679" contrib="sponsor"
sponsor="&scaleengine;">Support for selecting the partitioning
scheme when installing on the <acronym>UFS</acronym>
filesystem has been added to &man.bsdinstall.8;.</para>
</sect2>
<sect2 xml:id="userland-rc">
@ -803,7 +826,19 @@
<para revision="281495" contrib="sponsor" sponsor="&ff;">The
<literal>PAE_TABLES</literal> kernel configuration option has
been added for &os;/&arch.i386;, which instructs &man.pmap.9;
to use <acronym>PAE</acronym> format for page tables.</para>
to use <acronym>PAE</acronym> format for page tables while
maintaining a 32-bit physical address size elsewhere in the
kernel. The use of this option can enhance application-level
security by enabling the creation of <quote>no execute</quote>
mappings on modern &arch.i386; processors. Unlike the
<literal>PAE</literal> option, <literal>PAE_TABLES</literal>
preserves kernel binary interface (<acronym>KBI</acronym>)
compatibility with non-<literal>PAE</literal> kernels,
allowing non-<literal>PAE</literal> kernel modules and drivers
to work with a <literal>PAE_TABLES</literal>-enabled kernel.
Additionally, system limits are tuned for 4GB maximum
<acronym>RAM</acronym>, avoiding kernel virtual address space
(<acronym>KVA</acronym>) exhaustion.</para>
<para revision="282215">The <literal>SIFTR</literal> kernel
configuration has been added, allowing building &man.siftr.4;

View File

@ -19,6 +19,7 @@
<!ENTITY darpa "DARPA">
<!ENTITY darpa_afrl "DARPA, AFRL">
<!ENTITY dell "Dell, Inc.">
<!ENTITY ff "The&nbsp;&os;&nbsp;Foundation">
<!ENTITY ff.url "https://www.FreeBSDFoundation.org/">

View File

@ -31,7 +31,7 @@
.\" @(#)init.8 8.3 (Berkeley) 4/18/94
.\" $FreeBSD$
.\"
.Dd March 14, 2012
.Dd July 24, 2015
.Dt INIT 8
.Os
.Sh NAME
@ -284,6 +284,7 @@ will signal the original
as follows:
.Bl -column Run-level SIGTERM
.It Sy "Run-level Signal Action"
.It Cm 0 Ta Dv SIGUSR1 Ta "Halt"
.It Cm 0 Ta Dv SIGUSR2 Ta "Halt and turn the power off"
.It Cm 1 Ta Dv SIGTERM Ta "Go to single-user mode"
.It Cm 6 Ta Dv SIGINT Ta "Reboot the machine"

View File

@ -476,7 +476,8 @@ main(int argc, char *argv[])
build_iovec(&iov, &iovlen, "errmsg", errmsg, sizeof(errmsg));
if (nmount(iov, iovlen, 0))
err(1, "%s, %s", mntpath, errmsg);
err(1, "nmount: %s%s%s", mntpath, errmsg[0] ? ", " : "",
errmsg);
exit(0);
}

View File

@ -298,6 +298,8 @@ logpage(int argc, char *argv[])
open_dev(argv[optind], &fd, 1, 1);
}
read_controller_data(fd, &cdata);
/*
* The log page attribtues indicate whether or not the controller
* supports the SMART/Health information log page on a per
@ -307,7 +309,6 @@ logpage(int argc, char *argv[])
if (log_page != NVME_LOG_HEALTH_INFORMATION)
errx(1, "log page %d valid only at controller level",
log_page);
read_controller_data(fd, &cdata);
if (cdata.lpa.ns_smart == 0)
errx(1,
"controller does not support per namespace "

View File

@ -107,6 +107,7 @@ MAN= aac.4 \
cxgb.4 \
cxgbe.4 \
cy.4 \
cyapa.4 \
da.4 \
dc.4 \
dcons.4 \
@ -215,6 +216,7 @@ MAN= aac.4 \
ipw.4 \
ipwfw.4 \
isci.4 \
isl.4 \
ismt.4 \
isp.4 \
ispfw.4 \
@ -388,6 +390,7 @@ MAN= aac.4 \
${_pflog.4} \
${_pfsync.4} \
pim.4 \
pms.4 \
polling.4 \
ppbus.4 \
ppc.4 \

View File

@ -26,7 +26,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd October 19, 2013
.Dd July 25, 2015
.Dt CAPSICUM 4
.Os
.Sh NAME
@ -125,7 +125,3 @@ and
.An Kris Kennaway Aq Mt kris@FreeBSD.org
at Google, Inc., and
.An Pawel Jakub Dawidek Aq Mt pawel@dawidek.net .
.Sh BUGS
.Nm
is considered experimental in
.Fx .

200
share/man/man4/cyapa.4 Normal file
View File

@ -0,0 +1,200 @@
.\" Copyright (c) 2015 Michael Gmelin <freebsd@grem.de>
.\" 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$
.\"
.Dd July 25, 2015
.Dt CYAPA 4
.Os
.Sh NAME
.Nm cyapa
.Nd Cypress APA trackpad with I2C interface driver
.Sh SYNOPSIS
To compile this driver into the kernel, place the following lines into
the kernel configuration file:
.Bd -ragged -offset indent
.Cd "device cyapa"
.Cd "device ig4"
.Cd "device smbus"
.Ed
.Pp
Alternatively, to load the driver as a module at boot time, place the following line in
.Xr loader.conf 5 :
.Bd -literal -offset indent
cyapa_load="YES"
ig4_load="YES"
.Ed
.Sh DESCRIPTION
The
.Nm
driver provides support for the Cypress APA trackpad.
It emulates the IntelliMouse PS/2 protocol.
It supports basic mouse ioctls, so that
.Xr moused 8
is supported properly.
.Ss Trackpad layout
.Bd -literal
2/3 1/3
+--------------------+------------+
| | Middle |
| | Button |
| Left | |
| Button +------------+
| | Right |
| | Button |
+--------------------+............|
| Thumb/Button Area | 15%
+---------------------------------+
.Ed
.Ss Trackpad features
.Bl -tag -width 8n
.It Va Two finger scrolling
Use two fingers for Z axis scrolling.
.It Va Button down/second finger
While one finger clicks and holds down the touchpad, the second finger can be
used to move the mouse cursor.
This can be useful for drawing or selecting text.
.It Va Thumb/Button area
The lower 15% of the trackpad will not affect the mouse cursor position.
This allows for high precision clicking, by controlling the cursor with the
index finger and pushing/holding the pad down with the thumb.
.It Va Trackpad button
Push physical button.
The left two thirds of the pad issues a LEFT button event.
The upper right corner issues a MIDDLE button event.
The lower right corner issues a RIGHT button.
Optionally, tap to click can be enabled (see below).
.El
.Sh SYSCTL VARIABLES
These
.Xr sysctl 8
variables are available:
.Bl -tag -width 8n
.It Va debug.cyapa_idle_freq
Scan frequency in idle mode, the default is 1.
.It Va debug.cyapa_slow_freq
Scan frequency in slow mode, the default is 20.
.It Va debug.cyapa_norm_freq
Scan frequency in normal mode, the default is 100.
.It Va debug.cyapa_minpressure
Minimum pressure to detect a finger, the default is 12.
.It Va debug.cyapa_enable_tapclick
Controls tap to click.
Possible values:
.Bl -tag -width 8n
.It 0
Tap to click is disabled.
This is the default value.
.It 1
Tap to click always generates a left mouse button event.
.It 2
Tap to click generates left mouse button event if the left 2/3rds of the pad
are tapped and a right mouse button event otherwise.
.It 3
Tap to click generates mouse button events as if the physical button was
pressed (see
.Sx DESCRIPTION
above).
.El
.It Va debug.cyapa_tapclick_min_ticks
Minimum tap duration in ticks to create a click, the default is 1.
.It Va debug.cyapa_tapclick_max_ticks
Maximum tap duration in ticks to create a click, the default is 8.
.It Va debug.cyapa_move_min_ticks
Minimum ticks before cursor movement occurs, the default is 4.
.It Va debug.cyapa_scroll_wait_ticks
Ticks to wait before starting to scroll, the default is 0.
.It Va debug.cyapa_scroll_stick_ticks
Ticks while preventing cursor movement on single finger after scroll,
the default is 15.
.It Va debug.cyapa_thumbarea_percent
Size of bottom thumb area in percent, the default is 15.
.It Va debug.cyapa_debug
Setting this to a non-zero value enables debug output to console and syslog,
the default is 0.
.It Va debug.cyapa_reset
Setting this to a non-zero value reinitializes the device.
The sysctl resets to zero immediately.
.El
.Sh FILES
.Nm
creates
.Pa /dev/cyapa0 ,
which presents the mouse as an
.Ar IntelliMouse PS/2
device.
It supports
.Xr moused 8
levels 0 through 2, level 1 is used by default.
.Sh EXAMPLES
To use
.Nm
with
.Xr moused 8 ,
add the following lines to the
.Xr rc.conf 5
file:
.Pp
.Dl moused_enable="YES"
.Dl moused_port="/dev/cyapa0"
.Pp
If vertical scrolling is not desired, add
.Pp
.Dl moused_flags="-l0"
.Pp
to
.Xr rc.conf 5 .
.Pp
Enable tap to click for the left and the right mouse button and
disable the thumb area by adding these lines to the
.Xr sysctl.conf 5
file:
.Pp
.Dl debug.cyapa_thumbarea_percent=0
.Dl debug.cyapa_enable_tapclick=2
.Sh SEE ALSO
.Xr ig4 4 ,
.Xr moused 4 ,
.Xr smbus 4 ,
.Xr sysmouse 4
.Sh AUTHORS
.An -nosplit
The original
.Nm
driver was written for DragonFly BSD by
.An Matthew Dillon .
.Pp
It has been ported, modified, and enhanced for
.Fx
by
.An Michael Gmelin Aq Mt freebsd@grem.de .
.Pp
This manual page was written by
.An Michael Gmelin Aq Mt freebsd@grem.de .
.Sh BUGS
The
.Nm
driver detects the device based on its I2C address (0x67).
This might have unforeseen consequences if the initialization sequence
is sent to an unknown device at that address.

104
share/man/man4/isl.4 Normal file
View File

@ -0,0 +1,104 @@
.\" Copyright (c) 2015 Michael Gmelin <freebsd@grem.de>
.\" 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$
.\"
.Dd July 25, 2015
.Dt ISL 4
.Os
.Sh NAME
.Nm isl
.Nd Intersil(TM) I2C ISL29018 sensor driver
.Sh SYNOPSIS
To compile this driver into the kernel, place the following lines into
the kernel configuration file:
.Bd -ragged -offset indent
.Cd "device isl"
.Cd "device ig4"
.Cd "device smbus"
.Ed
.Pp
Alternatively, to load the driver as a module at boot time, place the following line in
.Xr loader.conf 5 :
.Bd -literal -offset indent
isl_load="YES"
ig4_load="YES"
.Ed
.Sh DESCRIPTION
The
.Nm
driver provides access to sensor data provided by the Intersil(TM) I2C
ISL29018 Digital Ambient Light Sensor and Proximity Sensor with Interrupt
Function.
Functionality is basic and provided through the
.Xr sysctl 8
interface.
.Sh SYSCTL VARIABLES
The following
.Xr sysctl 8
variables are available:
.Bl -tag -width "dev.isl.X.resolution"
.It Va dev.isl.X.als
Current ALS (Ambient Light Sensor) readout.
.It Va dev.isl.X.ir
Current IR (InfraRed) sensor readout.
.It Va dev.isl.X.prox
Current proximity sensor readout.
.It Va dev.isl.X.resolution
Current sensor resolution.
.It Va dev.isl.X.range
Current sensor range.
.El
.Sh EXAMPLES
.Ss Ambient light sensor read out
.Bd -literal
$ sysctl dev.isl.0.als
dev.isl.0.als: 64
.Ed
.Ss Automatically adjust brightness
This requires the port
.Pa graphics/intel-backlight
and only works with laptops using a supported Intel(R) GPU.
.Bd -literal
$ pkg install intel-backlight
$ sh /usr/local/share/examples/intel-backlight/isl_backlight.sh
.Ed
.Sh SEE ALSO
.Xr ig4 4 ,
.Xr smbus 4
.Sh AUTHORS
.An -nosplit
The
.Nm
driver was written by
.An Michael Gmelin Aq Mt freebsd@grem.de .
.Pp
This manual page was written by
.An Michael Gmelin Aq Mt freebsd@grem.de .
.Sh BUGS
The
.Nm
driver detects the device based on its I2C address (0x44).
This might have unforeseen consequences if the initialization sequence
is sent to an unknown device at that address.

View File

@ -30,7 +30,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd October 30, 2007
.Dd July 25, 2015
.Dt MAC 4
.Os
.Sh NAME
@ -239,14 +239,6 @@ under DARPA/SPAWAR contract N66001-01-C-8035
.Pq Dq CBOSS ,
as part of the DARPA CHATS research program.
.Sh BUGS
See
.Xr mac 9
concerning appropriateness for production use.
The
.Tn TrustedBSD
MAC Framework is considered experimental in
.Fx .
.Pp
While the MAC Framework design is intended to support the containment of
the root user, not all attack channels are currently protected by entry
point checks.

View File

@ -30,7 +30,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd December 10, 2002
.Dd July 25, 2015
.Dt MAC_IFOFF 4
.Os
.Sh NAME
@ -118,14 +118,6 @@ under DARPA/SPAWAR contract N66001-01-C-8035
.Pq Dq CBOSS ,
as part of the DARPA CHATS research program.
.Sh BUGS
See
.Xr mac 9
concerning appropriateness for production use.
The
.Tn TrustedBSD
MAC Framework is considered experimental in
.Fx .
.Pp
While the MAC Framework design is intended to support the containment of
the root user, not all attack channels are currently protected by entry
point checks.

View File

@ -30,7 +30,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd December 1, 2002
.Dd July 25, 2015
.Dt MAC_MLS 4
.Os
.Sh NAME
@ -236,14 +236,6 @@ Inc.\& under DARPA/SPAWAR contract N66001-01-C-8035
.Pq Dq CBOSS ,
as part of the DARPA CHATS research program.
.Sh BUGS
See
.Xr mac 9
concerning appropriateness for production use.
The
.Tn TrustedBSD
MAC Framework is considered experimental in
.Fx .
.Pp
While the MAC Framework design is intended to support the containment of
the root user, not all attack channels are currently protected by entry
point checks.

View File

@ -30,7 +30,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd December 1, 2002
.Dd July 25, 2015
.Dt MAC_NONE 4
.Os
.Sh NAME
@ -98,14 +98,6 @@ under DARPA/SPAWAR contract N66001-01-C-8035
.Pq Dq CBOSS ,
as part of the DARPA CHATS research program.
.Sh BUGS
See
.Xr mac 9
concerning appropriateness for production use.
The
.Tn TrustedBSD
MAC Framework is considered experimental in
.Fx .
.Pp
While the MAC Framework design is intended to support the containment of
the root user, not all attack channels are currently protected by entry
point checks.

View File

@ -30,7 +30,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd December 9, 2002
.Dd July 25, 2015
.Dt MAC_PARTITION 4
.Os
.Sh NAME
@ -118,14 +118,6 @@ under DARPA/SPAWAR contract N66001-01-C-8035
.Pq Dq CBOSS ,
as part of the DARPA CHATS research program.
.Sh BUGS
See
.Xr mac 9
concerning appropriateness for production use.
The
.Tn TrustedBSD
MAC Framework is considered experimental in
.Fx .
.Pp
While the MAC Framework design is intended to support the containment of
the root user, not all attack channels are currently protected by entry
point checks.

View File

@ -30,7 +30,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd October 6, 2005
.Dd July 25, 2015
.Dt MAC_SEEOTHERUIDS 4
.Os
.Sh NAME
@ -116,14 +116,6 @@ under DARPA/SPAWAR contract N66001-01-C-8035
.Pq Dq CBOSS ,
as part of the DARPA CHATS research program.
.Sh BUGS
See
.Xr mac 9
concerning appropriateness for production use.
The
.Tn TrustedBSD
MAC Framework is considered experimental in
.Fx .
.Pp
While the MAC Framework design is intended to support the containment of
the root user, not all attack channels are currently protected by entry
point checks.

View File

@ -30,7 +30,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd December 1, 2002
.Dd July 25, 2015
.Dt MAC_STUB 4
.Os
.Sh NAME
@ -101,14 +101,6 @@ under DARPA/SPAWAR contract N66001-01-C-8035
.Pq Dq CBOSS ,
as part of the DARPA CHATS research program.
.Sh BUGS
See
.Xr mac 9
concerning appropriateness for production use.
The
.Tn TrustedBSD
MAC Framework is considered experimental in
.Fx .
.Pp
While the MAC Framework design is intended to support the containment of
the root user, not all attack channels are currently protected by entry
point checks.

View File

@ -30,7 +30,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd December 1, 2002
.Dd July 25, 2015
.Dt MAC_TEST 4
.Os
.Sh NAME
@ -102,14 +102,6 @@ under DARPA/SPAWAR contract N66001-01-C-8035
.Pq Dq CBOSS ,
as part of the DARPA CHATS research program.
.Sh BUGS
See
.Xr mac 9
concerning appropriateness for production use.
The
.Tn TrustedBSD
MAC Framework is considered experimental in
.Fx .
.Pp
While the MAC Framework design is intended to support the containment of
the root user, not all attack channels are currently protected by entry
point checks.

128
share/man/man4/pms.4 Normal file
View File

@ -0,0 +1,128 @@
.\" Copyright (c) 2015 Christian Brueffer
.\" 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$
.\"
.Dd July 23, 2015
.Dt PMS 4
.Os
.Sh NAME
.Nm pms
.Nd "PMC-Sierra PM8001/8081/8088/8089/8074/8076/8077 SAS/SATA HBA Controller driver"
.Sh SYNOPSIS
To compile the driver into the kernel,
place the following line in the
kernel configuration file:
.Bd -ragged -offset indent
.Cd "device pms"
.Ed
.Pp
Alternatively, to load the driver as a
module at boot time, place the following line in
.Xr loader.conf 5 :
.Bd -literal -offset indent
pms_load="YES"
.Ed
.Sh DESCRIPTION
The
.Nm
driver provides support for the PMC-Sierra PM8001/8081/8088/8089/8074/8076/8077
range of SAS/SATA HBA controllers.
.Sh HARDWARE
The
.Nm
driver supports the following hardware:
.Pp
.Bl -bullet -compact
.It
Tachyon TS Fibre Channel Card
.It
Tachyon TL Fibre Channel Card
.It
Tachyon XL2 Fibre Channel Card
.It
Tachyon DX2 Fibre Channel Card
.It
Tachyon DX2+ Fibre Channel Card
.It
Tachyon DX4+ Fibre Channel Card
.It
Tachyon QX2 Fibre Channel Card
.It
Tachyon QX4 Fibre Channel Card
.It
Tachyon DE4 Fibre Channel Card
.It
Tachyon QE4 Fibre Channel Card
.It
Tachyon XL10 Fibre Channel Card
.It
PMC Sierra SPC SAS-SATA Card
.It
PMC Sierra SPC-V SAS-SATA Card
.It
PMC Sierra SPC-VE SAS-SATA Card
.It
PMC Sierra SPC-V 16 Port SAS-SATA Card
.It
PMC Sierra SPC-VE 16 Port SAS-SATA Card
.It
PMC Sierra SPC-V SAS-SATA Card 12Gig
.It
PMC Sierra SPC-VE SAS-SATA Card 12Gig
.It
PMC Sierra SPC-V 16 Port SAS-SATA Card 12Gig
.It
PMC Sierra SPC-VE 16 Port SAS-SATA Card 12Gig
.It
Adaptec Hialeah 4/8 Port SAS-SATA HBA Card 6Gig
.It
Adaptec Hialeah 4/8 Port SAS-SATA RAID Card 6Gig
.It
Adaptec Hialeah 8/16 Port SAS-SATA HBA Card 6Gig
.It
Adaptec Hialeah 8/16 Port SAS-SATA RAID Card 6Gig
.It
Adaptec Hialeah 8/16 Port SAS-SATA HBA Encryption Card 6Gig
.It
Adaptec Hialeah 8/16 Port SAS-SATA RAID Encryption Card 6Gig
.It
Adaptec Delray 8 Port SAS-SATA HBA Card 12Gig
.It
Adaptec Delray 8 Port SAS-SATA HBA Encryption Card 12Gig
.It
Adaptec Delray 16 Port SAS-SATA HBA Card 12Gig
.It
Adaptec Delray 16 Port SAS-SATA HBA Encryption Card 12Gig
.El
.Sh SEE ALSO
.Xr cam 4 ,
.Xr camcontrol 8
.Sh HISTORY
The
.Nm
device driver first appeared in
.Fx 10.2 .
.Sh AUTHORS
.An Achim Leubner Aq Mt Achim.Leubner@pmcs.com

View File

@ -29,7 +29,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd August 21, 2013
.Dd July 25, 2015
.Dt PROCDESC 4
.Os
.Sh NAME
@ -85,7 +85,3 @@ at the University of Cambridge, and
and
.An Kris Kennaway Aq Mt kris@FreeBSD.org
at Google, Inc.
.Sh BUGS
.Nm
is considered experimental in
.Fx .

View File

@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd September 11, 2009
.Dd July 23, 2015
.Dt DEVICE.HINTS 5
.Os
.Sh NAME
@ -41,9 +41,8 @@ passed to the kernel.
It contains various variables to control the boot behavior of
the kernel.
These variables are typically
.Dq device hints .
.\" .Dq device hints ,
.\" and other control variables.
.Dq device hints ,
but can include any kernel tunable values.
.Pp
The file contains one variable per line.
Lines starting with the
@ -152,12 +151,11 @@ The following example disables the ACPI driver:
.Bd -literal -offset indent
hint.acpi.0.disabled="1"
.Ed
.\" .Pp
.\" A control variable may look like:
.\" .Pp
.\" .Bd -literal -offset indent
.\" debug.acpi.layer="ACPI_RESOURCES"
.\" .Ed
.Pp
Setting a tunable variable:
.Bd -literal -offset indent
vm.pmap.pg_ps_enabled=1
.Ed
.Sh SEE ALSO
.Xr kenv 1 ,
.Xr loader.conf 5 ,

View File

@ -28,7 +28,7 @@
.\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd June 29, 2012
.Dd July 25, 2015
.Dt PF.CONF 5
.Os
.Sh NAME
@ -2381,8 +2381,10 @@ Once this limit is reached, fragments that would have to be cached
are dropped until other entries time out.
The timeout value can also be adjusted.
.Pp
Currently, only IPv4 fragments are supported and IPv6 fragments
are blocked unconditionally.
When forwarding reassembled IPv6 packets, pf refragments them with
the original maximum fragment size.
This allows the sender to determine the optimal fragment size by
path MTU discovery.
.Sh ANCHORS
Besides the main ruleset,
.Xr pfctl 8

View File

@ -33,7 +33,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd July 10, 2006
.Dd July 25, 2015
.Dt MAC 9
.Os
.Sh NAME
@ -62,14 +62,6 @@ opportunity to modify security behavior at those MAC API entry points.
Both consumers of the API (normal kernel services) and security modules
must be aware of the semantics of the API calls, particularly with respect
to synchronization primitives (such as locking).
.Ss Note on Appropriateness for Production Use
The
.Tn TrustedBSD
MAC Framework included in
.Fx 5.0
is considered experimental, and should not be deployed in production
environments without careful consideration of the risks associated with
the use of experimental operating system features.
.Ss Kernel Objects Supported by the Framework
The MAC framework manages labels on a variety of types of in-kernel
objects, including process credentials, vnodes, devfs_dirents, mount
@ -232,13 +224,6 @@ Additional contributors include:
and
.An Tim Robbins .
.Sh BUGS
See the earlier section in this document concerning appropriateness
for production use.
The
.Tn TrustedBSD
MAC Framework is considered experimental in
.Fx .
.Pp
While the MAC Framework design is intended to support the containment of
the root user, not all attack channels are currently protected by entry
point checks.

View File

@ -32,6 +32,25 @@
#error this file needs sys/cdefs.h as a prerequisite
#endif
/*
* To express interprocessor (as opposed to processor and device) memory
* ordering constraints, use the atomic_*() functions with acquire and release
* semantics rather than the *mb() functions. An architecture's memory
* ordering (or memory consistency) model governs the order in which a
* program's accesses to different locations may be performed by an
* implementation of that architecture. In general, for memory regions
* defined as writeback cacheable, the memory ordering implemented by amd64
* processors preserves the program ordering of a load followed by a load, a
* load followed by a store, and a store followed by a store. Only a store
* followed by a load to a different memory location may be reordered.
* Therefore, except for special cases, like non-temporal memory accesses or
* memory regions defined as write combining, the memory ordering effects
* provided by the sfence instruction in the wmb() function and the lfence
* instruction in the rmb() function are redundant. In contrast, the
* atomic_*() functions with acquire and release semantics do not perform
* redundant instructions for ordinary cases of interprocessor memory
* ordering on any architecture.
*/
#define mb() __asm __volatile("mfence;" : : : "memory")
#define wmb() __asm __volatile("sfence;" : : : "memory")
#define rmb() __asm __volatile("lfence;" : : : "memory")

View File

@ -998,8 +998,11 @@ am335x_lcd_attach(device_t dev)
PWM_PERIOD, PWM_PERIOD) == 0)
sc->sc_backlight = 100;
sc->sc_hdmi_evh = EVENTHANDLER_REGISTER(hdmi_event,
am335x_lcd_hdmi_event, sc, 0);
if (panel_node != 0)
am335x_lcd_configure(sc);
else
sc->sc_hdmi_evh = EVENTHANDLER_REGISTER(hdmi_event,
am335x_lcd_hdmi_event, sc, 0);
return (0);
}

View File

@ -34,8 +34,9 @@
#define PULLTYPESEL (0x01 << 4) /* Pad pullup/pulldown type selection */
#define PULLUDEN (0x01 << 3) /* Pullup/pulldown disabled */
#define PADCONF_OUTPUT (0)
#define PADCONF_OUTPUT (PULLUDEN)
#define PADCONF_OUTPUT_PULLUP (PULLTYPESEL)
#define PADCONF_OUTPUT_PULLDOWN (0)
#define PADCONF_INPUT (RXACTIVE | PULLUDEN)
#define PADCONF_INPUT_PULLUP (RXACTIVE | PULLTYPESEL)
#define PADCONF_INPUT_PULLDOWN (RXACTIVE)

View File

@ -715,8 +715,8 @@ tda19988_start(void *xdev)
/* Default values for RGB 4:4:4 mapping */
tda19988_reg_write(sc, TDA_VIP_CNTRL_0, 0x23);
tda19988_reg_write(sc, TDA_VIP_CNTRL_1, 0x45);
tda19988_reg_write(sc, TDA_VIP_CNTRL_2, 0x01);
tda19988_reg_write(sc, TDA_VIP_CNTRL_1, 0x01);
tda19988_reg_write(sc, TDA_VIP_CNTRL_2, 0x45);
done:
config_intrhook_disestablish(&sc->enum_hook);

View File

@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd December 22, 2014
.Dd July 25, 2015
.Dt LOADER 8
.Os
.Sh NAME
@ -207,12 +207,18 @@ returns an error itself (see
.Op Fl t Ar type
.Ar file Cm ...
.Xc
Loads a kernel, kernel loadable module (kld), or file of opaque
contents tagged as being of the type
Loads a kernel, kernel loadable module (kld), disk image,
or file of opaque contents tagged as being of the type
.Ar type .
Kernel and modules can be either in a.out or ELF format.
Any arguments passed after the name of the file to be loaded
will be passed as arguments to that file.
Use the
.Li md_image
type to make the kernel create a file-backed
.Xr md 4
disk.
This is useful for booting from a temporary rootfs.
Currently, argument passing does not work for the kernel.
.Pp
.It Ic load_geli Xo

View File

@ -39,7 +39,7 @@ bitmap_type="splash_image_data" # and place it on the module_path
##############################################################
### Random number generator configuration ###################
### Random number generator configuration ##################
##############################################################
# See rc.conf(5). The entropy_boot_file config variable must agree with the
@ -53,8 +53,9 @@ entropy_cache_type="/boot/entropy" # Required for the kernel to find
# must not change value even if the
# _name above does change!
##############################################################
### RAM Blacklist configuration #############################
### RAM Blacklist configuration ############################
##############################################################
ram_blacklist_load="NO" # Set this to YES to load a file
@ -64,6 +65,17 @@ ram_blacklist_name="/boot/blacklist.txt" # Set this to the name of the file
ram_blacklist_type="ram_blacklist" # Required for the kernel to find
# the blacklist module
##############################################################
### Initial memory disk settings ###########################
##############################################################
#initmd_load="YES" # The "initmd" prefix is arbitrary.
#initmd_type="md_image" # Create md(4) disk at boot.
#initmd_name="/boot/root.img" # Path to a file containing the image.
#rootdev="ufs:/dev/md0" # Set the root filesystem to md(4) device.
##############################################################
### Loader settings ########################################
##############################################################
@ -161,7 +173,7 @@ module_path="/boot/modules" # Set the module search path
##############################################################
### ATA modules ##############################################
### ATA modules ############################################
##############################################################
ataacard_load="NO" # ACARD
@ -381,6 +393,7 @@ if_xe_load="NO" # Xircom CreditCard PCMCIA
if_xl_load="NO" # 3Com Etherlink XL (3c900, 3c905, 3c905B)
utopia_load="NO" # ATM PHY driver
##############################################################
### Netgraph modules #######################################
##############################################################
@ -422,6 +435,7 @@ ng_tty_load="NO" # Netgraph node type that is also a line
ng_vjc_load="NO" # Van Jacobsen compression netgraph node type
ng_vlan_load="NO" # IEEE 802.1Q VLAN tagging netgraph node type
##############################################################
### Sound modules ##########################################
##############################################################
@ -458,6 +472,7 @@ snd_via82c686_load="NO" # via82c686
snd_vibes_load="NO" # vibes
snd_driver_load="NO" # All sound drivers
##############################################################
### USB modules ############################################
##############################################################
@ -490,6 +505,7 @@ if_ural_load="NO" # Ralink RT2500USB 802.11 wireless adapter
if_zyd_load="NO" # ZyDAS ZD1211(B) USB 802.11 wireless adapter
snd_uaudio_load="NO" # USB audio
##############################################################
### Other modules ##########################################
##############################################################
@ -514,6 +530,7 @@ amdtemp_load="NO" # AMD K8/K10/K11 temperature monitor
tpm_load="NO" # Trusted Platform Module
wbwd_load="NO" # Winbond watchdog
##############################################################
### ACPI settings ##########################################
##############################################################
@ -524,8 +541,9 @@ acpi_dsdt_name="/boot/acpi_dsdt.aml"
# Override DSDT in BIOS by this file
acpi_video_load="NO" # Load the ACPI video extension driver
##############################################################
### TrustedBSD MAC settings ##################################
### TrustedBSD MAC settings ################################
##############################################################
mac_biba_load="NO" # Biba MAC policy
@ -536,6 +554,7 @@ mac_none_load="NO" # Null MAC policy
mac_partition_load="NO" # Partition MAC policy
mac_seeotheruids_load="NO" # UID visbility MAC policy
##############################################################
### Module loading syntax example ##########################
##############################################################

View File

@ -855,12 +855,12 @@ cam_periph_mapmem(union ccb *ccb, struct cam_periph_map_info *mapinfo)
*/
mapinfo->bp[i] = getpbuf(NULL);
/* save the buffer's data address */
mapinfo->bp[i]->b_saveaddr = mapinfo->bp[i]->b_data;
/* put our pointer in the data slot */
mapinfo->bp[i]->b_data = *data_ptrs[i];
/* save the user's data address */
mapinfo->bp[i]->b_caller1 = *data_ptrs[i];
/* set the transfer length, we know it's < MAXPHYS */
mapinfo->bp[i]->b_bufsize = lengths[i];
@ -877,7 +877,7 @@ cam_periph_mapmem(union ccb *ccb, struct cam_periph_map_info *mapinfo)
*/
if (vmapbuf(mapinfo->bp[i], 1) < 0) {
for (j = 0; j < i; ++j) {
*data_ptrs[j] = mapinfo->bp[j]->b_saveaddr;
*data_ptrs[j] = mapinfo->bp[j]->b_caller1;
vunmapbuf(mapinfo->bp[j]);
relpbuf(mapinfo->bp[j], NULL);
}
@ -958,7 +958,7 @@ cam_periph_unmapmem(union ccb *ccb, struct cam_periph_map_info *mapinfo)
for (i = 0; i < numbufs; i++) {
/* Set the user's pointer back to the original value */
*data_ptrs[i] = mapinfo->bp[i]->b_saveaddr;
*data_ptrs[i] = mapinfo->bp[i]->b_caller1;
/* unmap the buffer */
vunmapbuf(mapinfo->bp[i]);

View File

@ -80,6 +80,24 @@ cloudabi_convert_timespec(const struct timespec *in, cloudabi_timestamp_t *out)
return (0);
}
/* Fetches the time value of a clock. */
int
cloudabi_clock_time_get(struct thread *td, cloudabi_clockid_t clock_id,
cloudabi_timestamp_t *ret)
{
struct timespec ts;
int error;
clockid_t clockid;
error = cloudabi_convert_clockid(clock_id, &clockid);
if (error != 0)
return (error);
error = kern_clock_gettime(td, clockid, &ts);
if (error != 0)
return (error);
return (cloudabi_convert_timespec(&ts, ret));
}
int
cloudabi_sys_clock_res_get(struct thread *td,
struct cloudabi_sys_clock_res_get_args *uap)
@ -106,20 +124,10 @@ int
cloudabi_sys_clock_time_get(struct thread *td,
struct cloudabi_sys_clock_time_get_args *uap)
{
struct timespec ts;
cloudabi_timestamp_t cts;
cloudabi_timestamp_t ts;
int error;
clockid_t clockid;
error = cloudabi_convert_clockid(uap->clock_id, &clockid);
if (error != 0)
return (error);
error = kern_clock_gettime(td, clockid, &ts);
if (error != 0)
return (error);
error = cloudabi_convert_timespec(&ts, &cts);
if (error != 0)
return (error);
td->td_retval[0] = cts;
return (0);
error = cloudabi_clock_time_get(td, uap->clock_id, &ts);
td->td_retval[0] = ts;
return (error);
}

View File

@ -46,18 +46,51 @@ int
cloudabi_sys_fd_create1(struct thread *td,
struct cloudabi_sys_fd_create1_args *uap)
{
struct socket_args socket_args = {
.domain = AF_UNIX,
};
/* Not implemented. */
return (ENOSYS);
switch (uap->type) {
case CLOUDABI_FILETYPE_SOCKET_DGRAM:
socket_args.type = SOCK_DGRAM;
return (sys_socket(td, &socket_args));
case CLOUDABI_FILETYPE_SOCKET_SEQPACKET:
socket_args.type = SOCK_SEQPACKET;
return (sys_socket(td, &socket_args));
case CLOUDABI_FILETYPE_SOCKET_STREAM:
socket_args.type = SOCK_STREAM;
return (sys_socket(td, &socket_args));
default:
return (EINVAL);
}
}
int
cloudabi_sys_fd_create2(struct thread *td,
struct cloudabi_sys_fd_create2_args *uap)
{
int fds[2];
int error;
/* Not implemented. */
return (ENOSYS);
switch (uap->type) {
case CLOUDABI_FILETYPE_SOCKET_DGRAM:
error = kern_socketpair(td, AF_UNIX, SOCK_DGRAM, 0, fds);
break;
case CLOUDABI_FILETYPE_SOCKET_SEQPACKET:
error = kern_socketpair(td, AF_UNIX, SOCK_SEQPACKET, 0, fds);
break;
case CLOUDABI_FILETYPE_SOCKET_STREAM:
error = kern_socketpair(td, AF_UNIX, SOCK_STREAM, 0, fds);
break;
default:
return (EINVAL);
}
if (error == 0) {
td->td_retval[0] = fds[0];
td->td_retval[1] = fds[1];
}
return (0);
}
int

View File

@ -28,11 +28,67 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/fcntl.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/namei.h>
#include <sys/syscallsubr.h>
#include <compat/cloudabi/cloudabi_proto.h>
#include <compat/cloudabi/cloudabi_syscalldefs.h>
static MALLOC_DEFINE(M_CLOUDABI_PATH, "cloudabipath", "CloudABI pathnames");
/*
* Copying pathnames from userspace to kernelspace.
*
* Unlike most operating systems, CloudABI doesn't use null-terminated
* pathname strings. Processes always pass pathnames to the kernel by
* providing a base pointer and a length. This has a couple of reasons:
*
* - It makes it easier to use CloudABI in combination with programming
* languages other than C, that may use non-null terminated strings.
* - It allows for calling system calls on individual components of the
* pathname without modifying the input string.
*
* The function below copies in pathname strings and null-terminates it.
* It also ensure that the string itself does not contain any null
* bytes.
*
* TODO(ed): Add an abstraction to vfs_lookup.c that allows us to pass
* in unterminated pathname strings, so we can do away with
* the copying.
*/
static int
copyin_path(const char *uaddr, size_t len, char **result)
{
char *buf;
int error;
if (len >= PATH_MAX)
return (ENAMETOOLONG);
buf = malloc(len + 1, M_CLOUDABI_PATH, M_WAITOK);
error = copyin(uaddr, buf, len);
if (error != 0) {
free(buf, M_CLOUDABI_PATH);
return (error);
}
if (memchr(buf, '\0', len) != NULL) {
free(buf, M_CLOUDABI_PATH);
return (EINVAL);
}
buf[len] = '\0';
*result = buf;
return (0);
}
static void
cloudabi_freestr(char *buf)
{
free(buf, M_CLOUDABI_PATH);
}
int
cloudabi_sys_file_advise(struct thread *td,
struct cloudabi_sys_file_advise_args *uap)
@ -86,9 +142,24 @@ int
cloudabi_sys_file_link(struct thread *td,
struct cloudabi_sys_file_link_args *uap)
{
char *path1, *path2;
int error;
/* Not implemented. */
return (ENOSYS);
error = copyin_path(uap->path1, uap->path1len, &path1);
if (error != 0)
return (error);
error = copyin_path(uap->path2, uap->path2len, &path2);
if (error != 0) {
cloudabi_freestr(path1);
return (error);
}
error = kern_linkat(td, uap->fd1, uap->fd2, path1, path2,
UIO_SYSSPACE, (uap->fd1 & CLOUDABI_LOOKUP_SYMLINK_FOLLOW) != 0 ?
FOLLOW : NOFOLLOW);
cloudabi_freestr(path1);
cloudabi_freestr(path2);
return (error);
}
int
@ -113,18 +184,40 @@ int
cloudabi_sys_file_readlink(struct thread *td,
struct cloudabi_sys_file_readlink_args *uap)
{
char *path;
int error;
/* Not implemented. */
return (ENOSYS);
error = copyin_path(uap->path, uap->pathlen, &path);
if (error != 0)
return (error);
error = kern_readlinkat(td, uap->fd, path, UIO_SYSSPACE,
uap->buf, UIO_USERSPACE, uap->bufsize);
cloudabi_freestr(path);
return (error);
}
int
cloudabi_sys_file_rename(struct thread *td,
struct cloudabi_sys_file_rename_args *uap)
{
char *old, *new;
int error;
/* Not implemented. */
return (ENOSYS);
error = copyin_path(uap->old, uap->oldlen, &old);
if (error != 0)
return (error);
error = copyin_path(uap->new, uap->newlen, &new);
if (error != 0) {
cloudabi_freestr(old);
return (error);
}
error = kern_renameat(td, uap->oldfd, old, uap->newfd, new,
UIO_SYSSPACE);
cloudabi_freestr(old);
cloudabi_freestr(new);
return (error);
}
int
@ -167,16 +260,39 @@ int
cloudabi_sys_file_symlink(struct thread *td,
struct cloudabi_sys_file_symlink_args *uap)
{
char *path1, *path2;
int error;
/* Not implemented. */
return (ENOSYS);
error = copyin_path(uap->path1, uap->path1len, &path1);
if (error != 0)
return (error);
error = copyin_path(uap->path2, uap->path2len, &path2);
if (error != 0) {
cloudabi_freestr(path1);
return (error);
}
error = kern_symlinkat(td, path1, uap->fd, path2, UIO_SYSSPACE);
cloudabi_freestr(path1);
cloudabi_freestr(path2);
return (error);
}
int
cloudabi_sys_file_unlink(struct thread *td,
struct cloudabi_sys_file_unlink_args *uap)
{
char *path;
int error;
/* Not implemented. */
return (ENOSYS);
error = copyin_path(uap->path, uap->pathlen, &path);
if (error != 0)
return (error);
if (uap->flag & CLOUDABI_UNLINK_REMOVEDIR)
error = kern_rmdirat(td, uap->fd, path, UIO_SYSSPACE);
else
error = kern_unlinkat(td, uap->fd, path, UIO_SYSSPACE, 0);
cloudabi_freestr(path);
return (error);
}

File diff suppressed because it is too large Load Diff

View File

@ -26,12 +26,38 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/socket.h>
#include <sys/syscallsubr.h>
#include <sys/sysproto.h>
#include <sys/systm.h>
#include <sys/un.h>
#include <compat/cloudabi/cloudabi_proto.h>
#include <compat/cloudabi/cloudabi_syscalldefs.h>
/* Copies a pathname into a UNIX socket address structure. */
static int
copyin_sockaddr_un(const char *path, size_t pathlen, struct sockaddr_un *sun)
{
int error;
/* Copy in pathname string if there's enough space. */
if (pathlen >= sizeof(sun->sun_path))
return (ENAMETOOLONG);
error = copyin(path, &sun->sun_path, pathlen);
if (error != 0)
return (error);
if (memchr(sun->sun_path, '\0', pathlen) != NULL)
return (EINVAL);
/* Initialize the rest of the socket address. */
sun->sun_path[pathlen] = '\0';
sun->sun_family = AF_UNIX;
sun->sun_len = sizeof(*sun);
return (0);
}
int
cloudabi_sys_sock_accept(struct thread *td,
struct cloudabi_sys_sock_accept_args *uap)
@ -45,18 +71,26 @@ int
cloudabi_sys_sock_bind(struct thread *td,
struct cloudabi_sys_sock_bind_args *uap)
{
struct sockaddr_un sun;
int error;
/* Not implemented. */
return (ENOSYS);
error = copyin_sockaddr_un(uap->path, uap->pathlen, &sun);
if (error != 0)
return (error);
return (kern_bindat(td, uap->fd, uap->s, (struct sockaddr *)&sun));
}
int
cloudabi_sys_sock_connect(struct thread *td,
struct cloudabi_sys_sock_connect_args *uap)
{
struct sockaddr_un sun;
int error;
/* Not implemented. */
return (ENOSYS);
error = copyin_sockaddr_un(uap->path, uap->pathlen, &sun);
if (error != 0)
return (error);
return (kern_connectat(td, uap->fd, uap->s, (struct sockaddr *)&sun));
}
int

View File

@ -29,6 +29,7 @@
#define _CLOUDABI_SYSCALLDEFS_H_
#include <sys/types.h>
#include <sys/stdint.h>
#define alignas _Alignas
#define alignof _Alignof

View File

@ -29,16 +29,30 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/proc.h>
#include <sys/sched.h>
#include <sys/syscallsubr.h>
#include <compat/cloudabi/cloudabi_proto.h>
#include <compat/cloudabi/cloudabi_syscalldefs.h>
int
cloudabi_sys_thread_exit(struct thread *td,
struct cloudabi_sys_thread_exit_args *uap)
{
struct cloudabi_sys_lock_unlock_args cloudabi_sys_lock_unlock_args = {
.lock = uap->lock,
.scope = uap->scope,
};
/* Not implemented. */
return (ENOSYS);
/* Wake up joining thread. */
cloudabi_sys_lock_unlock(td, &cloudabi_sys_lock_unlock_args);
/*
* Attempt to terminate the thread. Terminate the process if
* it's the last thread.
*/
kern_thr_exit(td);
exit1(td, 0, 0);
/* NOTREACHED */
}
int

View File

@ -30,12 +30,33 @@
#include <compat/cloudabi/cloudabi_syscalldefs.h>
struct thread;
struct timespec;
/* Fetches the time value of a clock. */
int cloudabi_clock_time_get(struct thread *, cloudabi_clockid_t,
cloudabi_timestamp_t *);
/* Converts a FreeBSD errno to a CloudABI errno. */
cloudabi_errno_t cloudabi_convert_errno(int);
/* Converts a struct timespec to a CloudABI timestamp. */
int cloudabi_convert_timespec(const struct timespec *, cloudabi_timestamp_t *);
/*
* Blocking futex functions.
*
* These functions are called by CloudABI's polling system calls to
* sleep on a lock or condition variable.
*/
int cloudabi_futex_condvar_wait(struct thread *, cloudabi_condvar_t *,
cloudabi_mflags_t, cloudabi_lock_t *, cloudabi_mflags_t, cloudabi_clockid_t,
cloudabi_timestamp_t, cloudabi_timestamp_t);
int cloudabi_futex_lock_rdlock(struct thread *, cloudabi_lock_t *,
cloudabi_mflags_t, cloudabi_clockid_t, cloudabi_timestamp_t,
cloudabi_timestamp_t);
int cloudabi_futex_lock_wrlock(struct thread *, cloudabi_lock_t *,
cloudabi_mflags_t, cloudabi_clockid_t, cloudabi_timestamp_t,
cloudabi_timestamp_t);
#endif

View File

@ -3,7 +3,7 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
* created from FreeBSD: head/sys/compat/cloudabi64/syscalls.master 285790 2015-07-22 10:04:53Z ed
* created from FreeBSD: head/sys/compat/cloudabi64/syscalls.master 285906 2015-07-27 10:04:06Z ed
*/
#ifndef _CLOUDABI64_SYSPROTO_H_
@ -43,7 +43,7 @@ struct cloudabi_sys_clock_time_get_args {
};
struct cloudabi_sys_condvar_signal_args {
char condvar_l_[PADL_(cloudabi_condvar_t *)]; cloudabi_condvar_t * condvar; char condvar_r_[PADR_(cloudabi_condvar_t *)];
char scope_l_[PADL_(cloudabi_futexscope_t)]; cloudabi_futexscope_t scope; char scope_r_[PADR_(cloudabi_futexscope_t)];
char scope_l_[PADL_(cloudabi_mflags_t)]; cloudabi_mflags_t scope; char scope_r_[PADR_(cloudabi_mflags_t)];
char nwaiters_l_[PADL_(cloudabi_nthreads_t)]; cloudabi_nthreads_t nwaiters; char nwaiters_r_[PADR_(cloudabi_nthreads_t)];
};
struct cloudabi_sys_fd_close_args {
@ -194,7 +194,7 @@ struct cloudabi_sys_file_unlink_args {
};
struct cloudabi_sys_lock_unlock_args {
char lock_l_[PADL_(cloudabi_lock_t *)]; cloudabi_lock_t * lock; char lock_r_[PADR_(cloudabi_lock_t *)];
char scope_l_[PADL_(cloudabi_futexscope_t)]; cloudabi_futexscope_t scope; char scope_r_[PADR_(cloudabi_futexscope_t)];
char scope_l_[PADL_(cloudabi_mflags_t)]; cloudabi_mflags_t scope; char scope_r_[PADR_(cloudabi_mflags_t)];
};
struct cloudabi_sys_mem_advise_args {
char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)];
@ -302,7 +302,7 @@ struct cloudabi64_sys_thread_create_args {
};
struct cloudabi_sys_thread_exit_args {
char lock_l_[PADL_(cloudabi_lock_t *)]; cloudabi_lock_t * lock; char lock_r_[PADR_(cloudabi_lock_t *)];
char scope_l_[PADL_(cloudabi_futexscope_t)]; cloudabi_futexscope_t scope; char scope_r_[PADR_(cloudabi_futexscope_t)];
char scope_l_[PADL_(cloudabi_mflags_t)]; cloudabi_mflags_t scope; char scope_r_[PADR_(cloudabi_mflags_t)];
};
struct cloudabi_sys_thread_tcb_set_args {
char tcb_l_[PADL_(void *)]; void * tcb; char tcb_r_[PADR_(void *)];

View File

@ -3,7 +3,7 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
* created from FreeBSD: head/sys/compat/cloudabi64/syscalls.master 285790 2015-07-22 10:04:53Z ed
* created from FreeBSD: head/sys/compat/cloudabi64/syscalls.master 285906 2015-07-27 10:04:06Z ed
*/
#define CLOUDABI64_SYS_cloudabi_sys_clock_res_get 0

View File

@ -3,7 +3,7 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
* created from FreeBSD: head/sys/compat/cloudabi64/syscalls.master 285790 2015-07-22 10:04:53Z ed
* created from FreeBSD: head/sys/compat/cloudabi64/syscalls.master 285906 2015-07-27 10:04:06Z ed
*/
const char *cloudabi64_syscallnames[] = {

View File

@ -3,7 +3,7 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
* created from FreeBSD: head/sys/compat/cloudabi64/syscalls.master 285790 2015-07-22 10:04:53Z ed
* created from FreeBSD: head/sys/compat/cloudabi64/syscalls.master 285906 2015-07-27 10:04:06Z ed
*/
#include <sys/sysent.h>

View File

@ -30,7 +30,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
case 2: {
struct cloudabi_sys_condvar_signal_args *p = params;
uarg[0] = (intptr_t) p->condvar; /* cloudabi_condvar_t * */
iarg[1] = p->scope; /* cloudabi_futexscope_t */
iarg[1] = p->scope; /* cloudabi_mflags_t */
iarg[2] = p->nwaiters; /* cloudabi_nthreads_t */
*n_args = 3;
break;
@ -297,7 +297,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
case 31: {
struct cloudabi_sys_lock_unlock_args *p = params;
uarg[0] = (intptr_t) p->lock; /* cloudabi_lock_t * */
iarg[1] = p->scope; /* cloudabi_futexscope_t */
iarg[1] = p->scope; /* cloudabi_mflags_t */
*n_args = 2;
break;
}
@ -495,7 +495,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
case 54: {
struct cloudabi_sys_thread_exit_args *p = params;
uarg[0] = (intptr_t) p->lock; /* cloudabi_lock_t * */
iarg[1] = p->scope; /* cloudabi_futexscope_t */
iarg[1] = p->scope; /* cloudabi_mflags_t */
*n_args = 2;
break;
}
@ -551,7 +551,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
p = "cloudabi_condvar_t *";
break;
case 1:
p = "cloudabi_futexscope_t";
p = "cloudabi_mflags_t";
break;
case 2:
p = "cloudabi_nthreads_t";
@ -1033,7 +1033,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
p = "cloudabi_lock_t *";
break;
case 1:
p = "cloudabi_futexscope_t";
p = "cloudabi_mflags_t";
break;
default:
break;
@ -1373,7 +1373,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
p = "cloudabi_lock_t *";
break;
case 1:
p = "cloudabi_futexscope_t";
p = "cloudabi_mflags_t";
break;
default:
break;

View File

@ -21,7 +21,7 @@
2 AUE_NULL STD { void cloudabi_sys_condvar_signal( \
cloudabi_condvar_t *condvar, \
cloudabi_futexscope_t scope, \
cloudabi_mflags_t scope, \
cloudabi_nthreads_t nwaiters); }
3 AUE_NULL STD { void cloudabi_sys_fd_close( \
@ -132,7 +132,7 @@
31 AUE_NULL STD { void cloudabi_sys_lock_unlock( \
cloudabi_lock_t *lock, \
cloudabi_futexscope_t scope); }
cloudabi_mflags_t scope); }
32 AUE_NULL STD { void cloudabi_sys_mem_advise( \
void *addr, size_t len, \
@ -209,6 +209,6 @@
cloudabi64_threadattr_t *attr); }
54 AUE_NULL STD { void cloudabi_sys_thread_exit( \
cloudabi_lock_t *lock, \
cloudabi_futexscope_t scope); }
cloudabi_mflags_t scope); }
55 AUE_NULL STD { void cloudabi_sys_thread_tcb_set(void *tcb); }
56 AUE_NULL STD { void cloudabi_sys_thread_yield(); }

View File

@ -284,6 +284,7 @@ contrib/dev/acpica/components/debugger/dbhistry.c optional acpi acpi_debug
contrib/dev/acpica/components/debugger/dbinput.c optional acpi acpi_debug
contrib/dev/acpica/components/debugger/dbmethod.c optional acpi acpi_debug
contrib/dev/acpica/components/debugger/dbnames.c optional acpi acpi_debug
contrib/dev/acpica/components/debugger/dbobject.c optional acpi acpi_debug
contrib/dev/acpica/components/debugger/dbstats.c optional acpi acpi_debug
contrib/dev/acpica/components/debugger/dbtest.c optional acpi acpi_debug
contrib/dev/acpica/components/debugger/dbutils.c optional acpi acpi_debug
@ -293,7 +294,6 @@ contrib/dev/acpica/components/disassembler/dmcstyle.c optional acpi acpi_debug
contrib/dev/acpica/components/disassembler/dmdeferred.c optional acpi acpi_debug
contrib/dev/acpica/components/disassembler/dmnames.c optional acpi acpi_debug
contrib/dev/acpica/components/disassembler/dmopcode.c optional acpi acpi_debug
contrib/dev/acpica/components/disassembler/dmobject.c optional acpi acpi_debug
contrib/dev/acpica/components/disassembler/dmresrc.c optional acpi acpi_debug
contrib/dev/acpica/components/disassembler/dmresrcl.c optional acpi acpi_debug
contrib/dev/acpica/components/disassembler/dmresrcl2.c optional acpi acpi_debug
@ -302,6 +302,7 @@ contrib/dev/acpica/components/disassembler/dmutils.c optional acpi acpi_debug
contrib/dev/acpica/components/disassembler/dmwalk.c optional acpi acpi_debug
contrib/dev/acpica/components/dispatcher/dsargs.c optional acpi
contrib/dev/acpica/components/dispatcher/dscontrol.c optional acpi
contrib/dev/acpica/components/dispatcher/dsdebug.c optional acpi
contrib/dev/acpica/components/dispatcher/dsfield.c optional acpi
contrib/dev/acpica/components/dispatcher/dsinit.c optional acpi
contrib/dev/acpica/components/dispatcher/dsmethod.c optional acpi
@ -437,6 +438,7 @@ contrib/dev/acpica/components/utilities/utlock.c optional acpi
contrib/dev/acpica/components/utilities/utmath.c optional acpi
contrib/dev/acpica/components/utilities/utmisc.c optional acpi
contrib/dev/acpica/components/utilities/utmutex.c optional acpi
contrib/dev/acpica/components/utilities/utnonansi.c optional acpi
contrib/dev/acpica/components/utilities/utobject.c optional acpi
contrib/dev/acpica/components/utilities/utosi.c optional acpi
contrib/dev/acpica/components/utilities/utownerid.c optional acpi

View File

@ -193,8 +193,8 @@ typedef struct {
struct {
MEMBER(PTR(_Atomic(cloudabi_condvar_t))) condvar;
MEMBER(PTR(_Atomic(cloudabi_lock_t))) lock;
MEMBER(cloudabi_futexscope_t) condvar_scope;
MEMBER(cloudabi_futexscope_t) lock_scope;
MEMBER(cloudabi_mflags_t) condvar_scope;
MEMBER(cloudabi_mflags_t) lock_scope;
} condvar;
// CLOUDABI_EVENTTYPE_FD_READ and CLOUDABI_EVENTTYPE_FD_WRITE:
@ -208,7 +208,7 @@ typedef struct {
// and acquire a read or write lock.
struct {
MEMBER(PTR(_Atomic(cloudabi_lock_t))) lock;
MEMBER(cloudabi_futexscope_t) lock_scope;
MEMBER(cloudabi_mflags_t) lock_scope;
} lock;
// CLOUDABI_EVENTTYPE_PROC_TERMINATE: Wait for a process to terminate.

View File

@ -189,10 +189,6 @@
#define CLOUDABI_FILETYPE_SOCKET_STREAM 0x82
#define CLOUDABI_FILETYPE_SYMBOLIC_LINK 0x90
// Futex object scopes.
#define CLOUDABI_FUTEXSCOPE_GLOBAL 1
#define CLOUDABI_FUTEXSCOPE_PROCESS_LOCAL 2
// Read-write lock related constants.
#define CLOUDABI_LOCK_UNLOCKED 0 // Lock is unlocked.
#define CLOUDABI_LOCK_WRLOCKED 0x40000000 // Lock is write locked.
@ -354,7 +350,6 @@ typedef int64_t cloudabi_filedelta_t; // lseek().
typedef uint64_t cloudabi_filesize_t; // ftruncate(), struct stat::st_size.
typedef uint8_t cloudabi_filetype_t; // struct stat::st_mode.
typedef uint16_t cloudabi_fsflags_t; // file_stat_put().
typedef uint8_t cloudabi_futexscope_t; // Scope of lock or condition variable.
typedef uint64_t cloudabi_inode_t; // struct stat::st_ino.
typedef uint32_t cloudabi_linkcount_t; // struct stat::st_nlink.
typedef uint32_t cloudabi_lock_t; // pthread_{mutex,rwlock}_*().

View File

@ -20,10 +20,10 @@ fulldirs="common compiler components include os_specific"
stripdirs="generate libraries tests tools"
stripfiles="Makefile README accygwin.h acdragonfly.h acdragonflyex.h \
acefi.h acefiex.h achaiku.h acintel.h aclinux.h aclinuxex.h \
acmacosx.h acmsvc.h acnetbsd.h acos2.h acwin.h acwin64.h \
new_table.txt osbsdtbl.c osefitbl.c osefixf.c osfreebsdtbl.c \
oslinuxtbl.c osunixdir.c osunixmap.c oswindir.c oswintbl.c \
oswinxf.c readme.txt utclib.c"
acmacosx.h acmsvc.h acmsvcex.h acnetbsd.h acos2.h acwin.h \
acwin64.h acwinex.h new_table.txt osbsdtbl.c osefitbl.c \
osefixf.c osfreebsdtbl.c oslinuxtbl.c osunixdir.c osunixmap.c \
oswindir.c oswintbl.c oswinxf.c readme.txt utclib.c"
# include files to canonify
src_headers="acapps.h acbuffer.h acclib.h accommon.h acconfig.h \

View File

@ -1,3 +1,86 @@
----------------------------------------
17 July 2015. Summary of changes for version 20150717:
1) ACPICA kernel-resident subsystem:
Improved the partitioning between the Debugger and Disassembler
components. This allows the Debugger to be used standalone within kernel
code without the Disassembler (which is used for single stepping also).
This renames and moves one file, dmobject.c to dbobject.c. Lv Zheng.
Debugger: Implemented a new command to trace the execution of control
methods (Trace). This is especially useful for the in-kernel version of
the debugger when file I/O may not be available for method trace output.
See the ACPICA reference for more information. Lv Zheng.
Moved all C library prototypes (used for the local versions of these
functions when requested) to a new header, acclib.h
Cleaned up the use of non-ANSI C library functions. These functions are
implemented locally in ACPICA. Moved all such functions to a common
source file, utnonansi.c
Debugger: Fixed a problem with the "!!" command (get last command
executed) where the debugger could enter an infinite loop and eventually
crash.
Removed the use of local macros that were used for some of the standard C
library functions to automatically cast input parameters. This mostly
affected the is* functions where the input parameter is defined to be an
int. This required a few modifications to the main ACPICA source code to
provide casting for these functions and eliminate possible compiler
warnings for these parameters.
Across the source code, added additional status/error checking to resolve
issues discovered by static source code analysis tools such as Coverity.
Example Code and Data Size: These are the sizes for the OS-independent
acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The
debug version of the code includes the debug output trace mechanism and
has a much larger code and data size.
Current Release:
Non-Debug Version: 100.9K Code, 24.5K Data, 125.4K Total
Debug Version: 197.8K Code, 81.5K Data, 279.3K Total
Previous Release:
Non-Debug Version: 100.6K Code, 27.6K Data, 128.2K Total
Debug Version: 196.2K Code, 81.0K Data, 277.2K Total
2) iASL Compiler/Disassembler and Tools:
iASL: Fixed a regression where the device map file feature no longer
worked properly when used in conjunction with the disassembler. It only
worked properly with the compiler itself.
iASL: Implemented a new warning for method LocalX variables that are set
but never used (similar to a C compiler such as gcc). This also applies
to ArgX variables that are not defined by the parent method, and are
instead (legally) used as local variables.
iASL/Preprocessor: Finished the pass-through of line numbers from the
preprocessor to the compiler. This ensures that compiler errors/warnings
have the correct original line numbers and filenames, regardless of any
#include files.
iASL/Preprocessor: Fixed a couple of issues with comment handling and the
pass-through of comments to the preprocessor output file (which becomes
the compiler input file). Also fixed a problem with // comments that
appear after a math expression.
iASL: Added support for the TCPA server table to the table compiler and
template generator. (The client table was already previously supported)
iASL/Preprocessor: Added a permanent #define of the symbol "__IASL__" to
identify the iASL compiler.
Cleaned up the use of the macros NEGATIVE and POSITIVE which were defined
multiple times. The new names are ACPI_SIGN_NEGATIVE and
ACPI_SIGN_POSITIVE.
AcpiHelp: Update to expand help messages for the iASL preprocessor
directives.
----------------------------------------
19 June 2015. Summary of changes for version 20150619:

View File

@ -187,6 +187,7 @@ AdInitialize (
AcpiGbl_RootTableList.CurrentTableCount = 0;
AcpiGbl_RootTableList.Tables = LocalTables;
AcpiGbl_PreviousOp = NULL;
return (Status);
}
@ -796,8 +797,8 @@ AdStoreTable (
AcpiTbInitTableDescriptor (TableDesc, ACPI_PTR_TO_PHYSADDR (Table),
ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL, Table);
AcpiTbValidateTable (TableDesc);
return (AE_OK);
Status = AcpiTbValidateTable (TableDesc);
return (Status);
}
@ -892,7 +893,7 @@ AdParseTable (
/* Create the root object */
AcpiGbl_ParseOpRoot = AcpiPsCreateScopeOp ();
AcpiGbl_ParseOpRoot = AcpiPsCreateScopeOp (AmlStart);
if (!AcpiGbl_ParseOpRoot)
{
return (AE_NO_MEMORY);

View File

@ -650,7 +650,7 @@ AcpiGetTagPathname (
/* Get the full pathname to the parent buffer */
RequiredSize = AcpiNsGetPathnameLength (BufferNode);
RequiredSize = AcpiNsBuildNormalizedPath (BufferNode, NULL, 0, FALSE);
if (!RequiredSize)
{
return (NULL);
@ -662,12 +662,8 @@ AcpiGetTagPathname (
return (NULL);
}
Status = AcpiNsBuildExternalPath (BufferNode, RequiredSize, Pathname);
if (ACPI_FAILURE (Status))
{
ACPI_FREE (Pathname);
return (NULL);
}
(void) AcpiNsBuildNormalizedPath (BufferNode, Pathname,
RequiredSize, FALSE);
/*
* Create the full path to the resource and tag by: remove the buffer name,

View File

@ -368,7 +368,7 @@ const ACPI_DMTABLE_DATA AcpiDmTableData[] =
{ACPI_SIG_SPMI, AcpiDmTableInfoSpmi, NULL, NULL, TemplateSpmi},
{ACPI_SIG_SRAT, NULL, AcpiDmDumpSrat, DtCompileSrat, TemplateSrat},
{ACPI_SIG_STAO, NULL, AcpiDmDumpStao, DtCompileStao, TemplateStao},
{ACPI_SIG_TCPA, AcpiDmTableInfoTcpa, NULL, NULL, TemplateTcpa},
{ACPI_SIG_TCPA, NULL, AcpiDmDumpTcpa, DtCompileTcpa, TemplateTcpa},
{ACPI_SIG_TPM2, AcpiDmTableInfoTpm2, NULL, NULL, TemplateTpm2},
{ACPI_SIG_UEFI, AcpiDmTableInfoUefi, NULL, DtCompileUefi, TemplateUefi},
{ACPI_SIG_VRTC, AcpiDmTableInfoVrtc, AcpiDmDumpVrtc, DtCompileVrtc, TemplateVrtc},
@ -500,7 +500,11 @@ AcpiDmDumpDataTable (
if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_FACS))
{
Length = Table->Length;
AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoFacs);
Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoFacs);
if (ACPI_FAILURE (Status))
{
return;
}
}
else if (ACPI_VALIDATE_RSDP_SIG (Table->Signature))
{
@ -561,7 +565,11 @@ AcpiDmDumpDataTable (
{
/* Simple table, just walk the info table */
AcpiDmDumpTable (Length, 0, Table, 0, TableData->TableInfo);
Status = AcpiDmDumpTable (Length, 0, Table, 0, TableData->TableInfo);
if (ACPI_FAILURE (Status))
{
return;
}
}
}
@ -720,6 +728,7 @@ AcpiDmDumpTable (
const AH_TABLE *TableData;
const char *Name;
BOOLEAN LastOutputBlankLine = FALSE;
ACPI_STATUS Status;
char RepairedName[8];
@ -1114,8 +1123,13 @@ AcpiDmDumpTable (
/* Generic Address Structure */
AcpiOsPrintf (STRING_FORMAT, "Generic Address Structure");
AcpiDmDumpTable (TableLength, CurrentOffset, Target,
Status = AcpiDmDumpTable (TableLength, CurrentOffset, Target,
sizeof (ACPI_GENERIC_ADDRESS), AcpiDmTableInfoGas);
if (ACPI_FAILURE (Status))
{
return (Status);
}
AcpiOsPrintf ("\n");
LastOutputBlankLine = TRUE;
break;
@ -1250,8 +1264,13 @@ AcpiDmDumpTable (
AcpiOsPrintf (STRING_FORMAT,
"Hardware Error Notification Structure");
AcpiDmDumpTable (TableLength, CurrentOffset, Target,
Status = AcpiDmDumpTable (TableLength, CurrentOffset, Target,
sizeof (ACPI_HEST_NOTIFY), AcpiDmTableInfoHestNotify);
if (ACPI_FAILURE (Status))
{
return (Status);
}
AcpiOsPrintf ("\n");
LastOutputBlankLine = TRUE;
break;
@ -1275,8 +1294,13 @@ AcpiDmDumpTable (
AcpiOsPrintf (STRING_FORMAT,
"IORT Memory Access Properties");
AcpiDmDumpTable (TableLength, CurrentOffset, Target,
Status = AcpiDmDumpTable (TableLength, CurrentOffset, Target,
sizeof (ACPI_IORT_MEMORY_ACCESS), AcpiDmTableInfoIortAcc);
if (ACPI_FAILURE (Status))
{
return (Status);
}
LastOutputBlankLine = TRUE;
break;

View File

@ -208,11 +208,16 @@ AcpiDmDumpRsdp (
ACPI_TABLE_RSDP *Rsdp = ACPI_CAST_PTR (ACPI_TABLE_RSDP, Table);
UINT32 Length = sizeof (ACPI_RSDP_COMMON);
UINT8 Checksum;
ACPI_STATUS Status;
/* Dump the common ACPI 1.0 portion */
AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoRsdp1);
Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoRsdp1);
if (ACPI_FAILURE (Status))
{
return (Length);
}
/* Validate the first checksum */
@ -229,7 +234,11 @@ AcpiDmDumpRsdp (
if (Rsdp->Revision > 0)
{
Length = Rsdp->Length;
AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoRsdp2);
Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoRsdp2);
if (ACPI_FAILURE (Status))
{
return (Length);
}
/* Validate the extended checksum over entire RSDP */
@ -347,37 +356,59 @@ void
AcpiDmDumpFadt (
ACPI_TABLE_HEADER *Table)
{
ACPI_STATUS Status;
/* Always dump the minimum FADT revision 1 fields (ACPI 1.0) */
AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt1);
Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt1);
if (ACPI_FAILURE (Status))
{
return;
}
/* Check for FADT revision 2 fields (ACPI 1.0B MS extensions) */
if ((Table->Length > ACPI_FADT_V1_SIZE) &&
(Table->Length <= ACPI_FADT_V2_SIZE))
{
AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt2);
Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt2);
if (ACPI_FAILURE (Status))
{
return;
}
}
/* Check for FADT revision 3/4 fields and up (ACPI 2.0+ extended data) */
else if (Table->Length > ACPI_FADT_V2_SIZE)
{
AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt3);
Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt3);
if (ACPI_FAILURE (Status))
{
return;
}
/* Check for FADT revision 5 fields and up (ACPI 5.0+) */
if (Table->Length > ACPI_FADT_V3_SIZE)
{
AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt5);
Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt5);
if (ACPI_FAILURE (Status))
{
return;
}
}
/* Check for FADT revision 6 fields and up (ACPI 6.0+) */
if (Table->Length > ACPI_FADT_V3_SIZE)
{
AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt6);
Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt6);
if (ACPI_FAILURE (Status))
{
return;
}
}
}
@ -1136,7 +1167,7 @@ AcpiDmDumpDrtm (
AcpiDmTableInfoDrtm1);
if (ACPI_FAILURE (Status))
{
return;
return;
}
Offset += ACPI_OFFSET (ACPI_DRTM_RESOURCE_LIST, Resources);
@ -1164,13 +1195,9 @@ AcpiDmDumpDrtm (
DrtmDps = ACPI_ADD_PTR (ACPI_DRTM_DPS_ID, Table, Offset);
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Table->Length, Offset,
(void) AcpiDmDumpTable (Table->Length, Offset,
DrtmDps, sizeof (ACPI_DRTM_DPS_ID),
AcpiDmTableInfoDrtm2);
if (ACPI_FAILURE (Status))
{
return;
}
}
@ -1794,6 +1821,10 @@ AcpiDmDumpIort (
Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
Length, AcpiDmTableInfoIort3a);
if (ACPI_FAILURE (Status))
{
return;
}
NodeOffset = IortSmmu->ContextInterruptOffset;
for (i = 0; i < IortSmmu->ContextInterruptCount; i++)
@ -1801,6 +1832,10 @@ AcpiDmDumpIort (
Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
8, AcpiDmTableInfoIort3b);
if (ACPI_FAILURE (Status))
{
return;
}
NodeOffset += 8;
}
@ -1810,6 +1845,10 @@ AcpiDmDumpIort (
Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
8, AcpiDmTableInfoIort3c);
if (ACPI_FAILURE (Status))
{
return;
}
NodeOffset += 8;
}
}
@ -1830,6 +1869,10 @@ AcpiDmDumpIort (
Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
Length, AcpiDmTableInfoIortMap);
if (ACPI_FAILURE (Status))
{
return;
}
NodeOffset += Length;
}
@ -2004,6 +2047,10 @@ AcpiDmDumpIvrs (
Status = AcpiDmDumpTable (Table->Length, EntryOffset,
DeviceEntry, EntryLength, InfoTable);
if (ACPI_FAILURE (Status))
{
return;
}
EntryOffset += EntryLength;
DeviceEntry = ACPI_ADD_PTR (ACPI_IVRS_DE_HEADER, DeviceEntry,
@ -2687,6 +2734,11 @@ AcpiDmDumpNfit (
Status = AcpiDmDumpTable (Table->Length, Offset + FieldOffset,
&Interleave->LineOffset[i],
sizeof (UINT32), AcpiDmTableInfoNfit2a);
if (ACPI_FAILURE (Status))
{
return;
}
FieldOffset += sizeof (UINT32);
}
break;
@ -2715,6 +2767,11 @@ AcpiDmDumpNfit (
Status = AcpiDmDumpTable (Table->Length, Offset + FieldOffset,
&Hint->HintAddress[i],
sizeof (UINT64), AcpiDmTableInfoNfit6a);
if (ACPI_FAILURE (Status))
{
return;
}
FieldOffset += sizeof (UINT64);
}
break;
@ -3126,7 +3183,7 @@ void
AcpiDmDumpSlic (
ACPI_TABLE_HEADER *Table)
{
AcpiDmDumpTable (Table->Length, sizeof (ACPI_TABLE_HEADER), Table,
(void) AcpiDmDumpTable (Table->Length, sizeof (ACPI_TABLE_HEADER), Table,
Table->Length - sizeof (*Table), AcpiDmTableInfoSlic);
}
@ -3356,6 +3413,77 @@ AcpiDmDumpStao (
}
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpTcpa
*
* PARAMETERS: Table - A TCPA table
*
* RETURN: None
*
* DESCRIPTION: Format the contents of a TCPA.
*
* NOTE: There are two versions of the table with the same signature:
* the client version and the server version. The common
* PlatformClass field is used to differentiate the two types of
* tables.
*
******************************************************************************/
void
AcpiDmDumpTcpa (
ACPI_TABLE_HEADER *Table)
{
UINT32 Offset = sizeof (ACPI_TABLE_TCPA_HDR);
ACPI_TABLE_TCPA_HDR *CommonHeader = ACPI_CAST_PTR (
ACPI_TABLE_TCPA_HDR, Table);
ACPI_TABLE_TCPA_HDR *SubTable = ACPI_ADD_PTR (
ACPI_TABLE_TCPA_HDR, Table, Offset);
ACPI_STATUS Status;
/* Main table */
Status = AcpiDmDumpTable (Table->Length, 0, Table,
0, AcpiDmTableInfoTcpaHdr);
if (ACPI_FAILURE (Status))
{
return;
}
/*
* Examine the PlatformClass field to determine the table type.
* Either a client or server table. Only one.
*/
switch (CommonHeader->PlatformClass)
{
case ACPI_TCPA_CLIENT_TABLE:
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
Table->Length - Offset, AcpiDmTableInfoTcpaClient);
break;
case ACPI_TCPA_SERVER_TABLE:
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
Table->Length - Offset, AcpiDmTableInfoTcpaServer);
break;
default:
AcpiOsPrintf ("\n**** Unknown TCPA Platform Class 0x%X\n",
CommonHeader->PlatformClass);
Status = AE_ERROR;
break;
}
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("\n**** Cannot disassemble TCPA table\n");
}
}
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpVrtc
@ -3497,10 +3625,6 @@ AcpiDmDumpWpbt (
/* Dump the arguments buffer */
AcpiDmDumpTable (Table->Length, 0, Table, ArgumentsLength,
(void) AcpiDmDumpTable (Table->Length, 0, Table, ArgumentsLength,
AcpiDmTableInfoWpbt0);
if (ACPI_FAILURE (Status))
{
return;
}
}

View File

@ -113,7 +113,7 @@
#define ACPI_SPMI_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SPMI,f)
#define ACPI_SRAT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SRAT,f)
#define ACPI_STAO_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_STAO,f)
#define ACPI_TCPA_CLIENT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TCPA_CLIENT,f)
#define ACPI_TCPA_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TCPA_HDR,f)
#define ACPI_TPM2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TPM2,f)
#define ACPI_UEFI_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_UEFI,f)
#define ACPI_WAET_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WAET,f)
@ -230,6 +230,8 @@
#define ACPI_SRAT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_MEM_AFFINITY,f)
#define ACPI_SRAT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_X2APIC_CPU_AFFINITY,f)
#define ACPI_SRAT3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_GICC_AFFINITY,f)
#define ACPI_TCPA_CLIENT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TCPA_CLIENT,f)
#define ACPI_TCPA_SERVER_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TCPA_SERVER,f)
#define ACPI_VRTC0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_VRTC_ENTRY,f)
#define ACPI_WDAT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_WDAT_ENTRY,f)
@ -2613,16 +2615,53 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoStaoStr[] =
*
* TCPA - Trusted Computing Platform Alliance table (Client)
*
* NOTE: There are two versions of the table with the same signature --
* the client version and the server version. The common PlatformClass
* field is used to differentiate the two types of tables.
*
******************************************************************************/
ACPI_DMTABLE_INFO AcpiDmTableInfoTcpa[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoTcpaHdr[] =
{
{ACPI_DMT_UINT16, ACPI_TCPA_OFFSET (PlatformClass), "Platform Class", 0},
ACPI_DMT_TERMINATOR
};
ACPI_DMTABLE_INFO AcpiDmTableInfoTcpaClient[] =
{
{ACPI_DMT_UINT16, ACPI_TCPA_CLIENT_OFFSET (PlatformClass), "Platform Class", 0},
{ACPI_DMT_UINT32, ACPI_TCPA_CLIENT_OFFSET (MinimumLogLength), "Min Event Log Length", 0},
{ACPI_DMT_UINT64, ACPI_TCPA_CLIENT_OFFSET (LogAddress), "Event Log Address", 0},
ACPI_DMT_TERMINATOR
};
ACPI_DMTABLE_INFO AcpiDmTableInfoTcpaServer[] =
{
{ACPI_DMT_UINT16, ACPI_TCPA_SERVER_OFFSET (Reserved), "Reserved", 0},
{ACPI_DMT_UINT64, ACPI_TCPA_SERVER_OFFSET (MinimumLogLength), "Min Event Log Length", 0},
{ACPI_DMT_UINT64, ACPI_TCPA_SERVER_OFFSET (LogAddress), "Event Log Address", 0},
{ACPI_DMT_UINT16, ACPI_TCPA_SERVER_OFFSET (SpecRevision), "Specification Revision", 0},
{ACPI_DMT_UINT8, ACPI_TCPA_SERVER_OFFSET (DeviceFlags), "Device Flags (decoded below)", DT_FLAG},
{ACPI_DMT_FLAG0, ACPI_TCPA_SERVER_OFFSET (DeviceFlags), "Pci Device", 0},
{ACPI_DMT_FLAG1, ACPI_TCPA_SERVER_OFFSET (DeviceFlags), "Bus is Pnp", 0},
{ACPI_DMT_FLAG2, ACPI_TCPA_SERVER_OFFSET (DeviceFlags), "Address Valid", 0},
{ACPI_DMT_UINT8, ACPI_TCPA_SERVER_OFFSET (InterruptFlags), "Interrupt Flags (decoded below)", DT_FLAG},
{ACPI_DMT_FLAG0, ACPI_TCPA_SERVER_OFFSET (InterruptFlags), "Mode", 0},
{ACPI_DMT_FLAG1, ACPI_TCPA_SERVER_OFFSET (InterruptFlags), "Polarity", 0},
{ACPI_DMT_FLAG2, ACPI_TCPA_SERVER_OFFSET (InterruptFlags), "GPE SCI Triggered", 0},
{ACPI_DMT_FLAG3, ACPI_TCPA_SERVER_OFFSET (InterruptFlags), "Global System Interrupt", 0},
{ACPI_DMT_UINT8, ACPI_TCPA_SERVER_OFFSET (GpeNumber), "Gpe Number", 0},
{ACPI_DMT_UINT24, ACPI_TCPA_SERVER_OFFSET (Reserved2[0]), "Reserved", 0},
{ACPI_DMT_UINT32, ACPI_TCPA_SERVER_OFFSET (GlobalInterrupt), "Global Interrupt", 0},
{ACPI_DMT_GAS, ACPI_TCPA_SERVER_OFFSET (Address), "Address", 0},
{ACPI_DMT_UINT32, ACPI_TCPA_SERVER_OFFSET (Reserved3), "Reserved", 0},
{ACPI_DMT_GAS, ACPI_TCPA_SERVER_OFFSET (ConfigAddress), "Configuration Address", 0},
{ACPI_DMT_UINT8, ACPI_TCPA_SERVER_OFFSET (Group), "Pci Group", 0},
{ACPI_DMT_UINT8, ACPI_TCPA_SERVER_OFFSET (Bus), "Pci Bus", 0},
{ACPI_DMT_UINT8, ACPI_TCPA_SERVER_OFFSET (Device), "Pci Device", 0},
{ACPI_DMT_UINT8, ACPI_TCPA_SERVER_OFFSET (Function), "Pci Function", 0},
ACPI_DMT_TERMINATOR
};
/*******************************************************************************
*

View File

@ -177,6 +177,11 @@ FlCheckForAscii (
/* Open file in text mode so file offset is always accurate */
Handle = fopen (Filename, "rb");
if (!Handle)
{
perror ("Could not open input file");
return (AE_ERROR);
}
Status.Line = 1;
Status.Offset = 0;

View File

@ -100,6 +100,10 @@ CmDoCompile (
Event = UtBeginEvent ("Preprocess input file");
if (Gbl_PreprocessFlag)
{
/* Enter compiler name as a #define */
PrAddDefine (ASL_DEFINE, "", FALSE);
/* Preprocessor */
PrDoPreprocess ();

View File

@ -52,6 +52,7 @@
#define AML_DISASSEMBLER_NAME "AML/ASL+ Disassembler"
#define ASL_INVOCATION_NAME "iasl"
#define ASL_CREATOR_ID "INTL"
#define ASL_DEFINE "__IASL__"
#define ASL_COMPLIANCE "Supports ACPI Specification Revision 6.0"
@ -155,12 +156,6 @@
#define ACPI_COMPILER_RESERVED_NAME (ACPI_UINT32_MAX - 3)
/* String to Integer conversion */
#define NEGATIVE 1
#define POSITIVE 0
/* Helper macros for resource tag creation */
#define RsCreateMultiBitField \

View File

@ -546,6 +546,26 @@ FlOpenMiscOutputFiles (
char *Filename;
/* Create/Open a map file if requested */
if (Gbl_MapfileFlag)
{
Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_MAP);
if (!Filename)
{
AslCommonError (ASL_ERROR, ASL_MSG_LISTING_FILENAME,
0, 0, 0, 0, NULL, NULL);
return (AE_ERROR);
}
/* Open the hex file, text mode (closed at compiler exit) */
FlOpenFile (ASL_FILE_MAP_OUTPUT, Filename, "w+t");
AslCompilerSignon (ASL_FILE_MAP_OUTPUT);
AslCompilerFileHeader (ASL_FILE_MAP_OUTPUT);
}
/* All done for disassembler */
if (Gbl_FileType == ASL_INPUT_TYPE_ACPI_TABLE)
@ -812,26 +832,6 @@ FlOpenMiscOutputFiles (
AslCompilerFileHeader (ASL_FILE_NAMESPACE_OUTPUT);
}
/* Create/Open a map file if requested */
if (Gbl_MapfileFlag)
{
Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_MAP);
if (!Filename)
{
AslCommonError (ASL_ERROR, ASL_MSG_LISTING_FILENAME,
0, 0, 0, 0, NULL, NULL);
return (AE_ERROR);
}
/* Open the hex file, text mode (closed at compiler exit) */
FlOpenFile (ASL_FILE_MAP_OUTPUT, Filename, "w+t");
AslCompilerSignon (ASL_FILE_MAP_OUTPUT);
AslCompilerFileHeader (ASL_FILE_MAP_OUTPUT);
}
return (AE_OK);
}

View File

@ -119,8 +119,73 @@ LkIsObjectUsed (
{
ACPI_NAMESPACE_NODE *Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjHandle);
ACPI_NAMESPACE_NODE *Next;
ASL_METHOD_LOCAL *MethodLocals;
ASL_METHOD_LOCAL *MethodArgs;
UINT32 i;
if (Node->Type == ACPI_TYPE_METHOD)
{
if (!Node->Op || !Node->MethodLocals)
{
return (AE_OK);
}
MethodLocals = (ASL_METHOD_LOCAL *) Node->MethodLocals;
MethodArgs = (ASL_METHOD_LOCAL *) Node->MethodArgs;
/*
* Analysis of LocalX variables
*/
for (i = 0; i < ACPI_METHOD_NUM_LOCALS; i++)
{
/* Warn for Locals that are set but never referenced */
if ((MethodLocals[i].Flags & ASL_LOCAL_INITIALIZED) &&
(!(MethodLocals[i].Flags & ASL_LOCAL_REFERENCED)))
{
sprintf (MsgBuffer, "Local%u", i);
AslError (ASL_WARNING, ASL_MSG_LOCAL_NOT_USED,
MethodLocals[i].Op, MsgBuffer);
}
}
/*
* Analysis of ArgX variables (standard method arguments,
* and remaining unused ArgX can also be used as locals)
*/
for (i = 0; i < ACPI_METHOD_NUM_ARGS; i++)
{
if (MethodArgs[i].Flags & ASL_ARG_IS_LOCAL)
{
/* Warn if ArgX is being used as a local, but not referenced */
if ((MethodArgs[i].Flags & ASL_ARG_INITIALIZED) &&
(!(MethodArgs[i].Flags & ASL_ARG_REFERENCED)))
{
sprintf (MsgBuffer, "Arg%u", i);
AslError (ASL_WARNING, ASL_MSG_ARG_AS_LOCAL_NOT_USED,
MethodArgs[i].Op, MsgBuffer);
}
}
else
{
/*
* Remark if a normal method ArgX is not referenced.
* We ignore the predefined methods since often, not
* all arguments are needed or used.
*/
if ((Node->Name.Ascii[0] != '_') &&
(!(MethodArgs[i].Flags & ASL_ARG_REFERENCED)))
{
sprintf (MsgBuffer, "Arg%u", i);
AslError (ASL_REMARK, ASL_MSG_ARG_NOT_USED,
MethodArgs[i].Op, MsgBuffer);
}
}
}
}
/* Referenced flag is set during the namespace xref */
if (Node->Flags & ANOBJ_IS_REFERENCED)

View File

@ -235,7 +235,11 @@ const char *AslCompilerMsgs [] =
/* ASL_MSG_BUFFER_ALLOCATION */ "Could not allocate line buffer",
/* ASL_MSG_MISSING_DEPENDENCY */ "Missing dependency",
/* ASL_MSG_ILLEGAL_FORWARD_REF */ "Illegal forward reference within a method",
/* ASL_MSG_ILLEGAL_METHOD_REF */ "Illegal reference across two methods"
/* ASL_MSG_ILLEGAL_METHOD_REF */ "Illegal reference across two methods",
/* ASL_MSG_LOCAL_NOT_USED */ "Method Local is set but never used",
/* ASL_MSG_ARG_AS_LOCAL_NOT_USED */ "Method Argument (as a local) is set but never used",
/* ASL_MSG_ARG_NOT_USED */ "Method Argument is never used"
};
/* Table compiler */

View File

@ -238,6 +238,9 @@ typedef enum
ASL_MSG_MISSING_DEPENDENCY,
ASL_MSG_ILLEGAL_FORWARD_REF,
ASL_MSG_ILLEGAL_METHOD_REF,
ASL_MSG_LOCAL_NOT_USED,
ASL_MSG_ARG_AS_LOCAL_NOT_USED,
ASL_MSG_ARG_NOT_USED,
/* These messages are used by the Data Table compiler only */

View File

@ -255,7 +255,7 @@ MtMethodAnalysisWalkBegin (
return (AE_ERROR);
}
RegisterNumber = (Op->Asl.AmlOpcode & 0x000F);
RegisterNumber = (Op->Asl.AmlOpcode & 0x0007);
/*
* If the local is being used as a target, mark the local

View File

@ -409,7 +409,7 @@ NsDoOnePathname (
TargetPath.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
Status = AcpiNsHandleToPathname (Node, &TargetPath);
Status = AcpiNsHandleToPathname (Node, &TargetPath, FALSE);
if (ACPI_FAILURE (Status))
{
return (Status);

View File

@ -363,7 +363,7 @@ LsEmitOffsetTableEntry (
/* Get the full pathname to the namespace node */
TargetPath.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
Status = AcpiNsHandleToPathname (Node, &TargetPath);
Status = AcpiNsHandleToPathname (Node, &TargetPath, FALSE);
if (ACPI_FAILURE (Status))
{
return;

View File

@ -789,43 +789,6 @@ OpcEncodePldBuffer (
}
/*******************************************************************************
*
* FUNCTION: OpcStrupr (strupr)
*
* PARAMETERS: SrcString - The source string to convert
*
* RETURN: None
*
* DESCRIPTION: Convert string to uppercase
*
* NOTE: This is not a POSIX function, so it appears here, not in utclib.c
*
******************************************************************************/
static void
OpcStrupr (
char *SrcString)
{
char *String;
if (!SrcString)
{
return;
}
/* Walk entire string, uppercasing the letters */
for (String = SrcString; *String; String++)
{
*String = (char) toupper ((int) *String);
}
return;
}
/*******************************************************************************
*
* FUNCTION: OpcFindName
@ -851,7 +814,7 @@ OpcFindName (
UINT32 i;
OpcStrupr (Name);
AcpiUtStrupr (Name);
for (i = 0, Str = List[0]; Str; i++, Str = List[i])
{
@ -900,13 +863,6 @@ OpcDoPld (
return;
}
Buffer = UtLocalCalloc (ACPI_PLD_BUFFER_SIZE);
if (!Buffer)
{
AslError(ASL_ERROR, ASL_MSG_BUFFER_ALLOCATION, Op, NULL);
return;
}
memset (&PldInfo, 0, sizeof (ACPI_PLD_INFO));
Node = Op->Asl.Child;

View File

@ -655,7 +655,7 @@ OptOptimizeNamePath (
* format -- something we can easily manipulate
*/
TargetPath.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
Status = AcpiNsHandleToPathname (TargetNode, &TargetPath);
Status = AcpiNsHandleToPathname (TargetNode, &TargetPath, FALSE);
if (ACPI_FAILURE (Status))
{
AslCoreSubsystemError (Op, Status, "Getting Target NamePath",
@ -667,7 +667,7 @@ OptOptimizeNamePath (
/* CurrentPath is the path to this scope (where we are in the namespace) */
CurrentPath.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
Status = AcpiNsHandleToPathname (CurrentNode, &CurrentPath);
Status = AcpiNsHandleToPathname (CurrentNode, &CurrentPath, FALSE);
if (ACPI_FAILURE (Status))
{
AslCoreSubsystemError (Op, Status, "Getting Current NamePath",

View File

@ -286,6 +286,11 @@ AslDoOptions (
AcpiGbl_CstyleDisassembly = FALSE;
break;
case 'v':
AcpiGbl_DbOpt_Verbose = TRUE;
break;
default:
printf ("Unknown option: -d%s\n", AcpiGbl_Optarg);

View File

@ -246,6 +246,11 @@ AslDoDisassembly (
return (Status);
}
/* Handle additional output files for disassembler */
Gbl_FileType = ASL_INPUT_TYPE_ACPI_TABLE;
Status = FlOpenMiscOutputFiles (Gbl_OutputFilenamePrefix);
/* This is where the disassembly happens */
AcpiGbl_DbOpt_Disasm = TRUE;
@ -261,13 +266,6 @@ AslDoDisassembly (
AcpiDmUnresolvedWarning (0);
#if 0
/* TBD: Handle additional output files for disassembler */
Status = FlOpenMiscOutputFiles (Gbl_OutputFilenamePrefix);
NsDisplayNamespace ();
#endif
/* Shutdown compiler and ACPICA subsystem */
AeClearErrorLog ();

View File

@ -165,15 +165,6 @@ AcpiEvInitializeRegion (
return (AE_OK);
}
void
AcpiExDoDebugObject (
ACPI_OPERAND_OBJECT *SourceDesc,
UINT32 Level,
UINT32 Index)
{
return;
}
ACPI_STATUS
AcpiExReadDataFromField (
ACPI_WALK_STATE *WalkState,
@ -216,6 +207,60 @@ AcpiExLoadOp (
return (AE_SUPPORT);
}
void
AcpiExDoDebugObject (
ACPI_OPERAND_OBJECT *SourceDesc,
UINT32 Level,
UINT32 Index)
{
return;
}
void
AcpiExStartTraceMethod (
ACPI_NAMESPACE_NODE *MethodNode,
ACPI_OPERAND_OBJECT *ObjDesc,
ACPI_WALK_STATE *WalkState)
{
return;
}
void
AcpiExStopTraceMethod (
ACPI_NAMESPACE_NODE *MethodNode,
ACPI_OPERAND_OBJECT *ObjDesc,
ACPI_WALK_STATE *WalkState)
{
return;
}
void
AcpiExStartTraceOpcode (
ACPI_PARSE_OBJECT *Op,
ACPI_WALK_STATE *WalkState)
{
return;
}
void
AcpiExStopTraceOpcode (
ACPI_PARSE_OBJECT *Op,
ACPI_WALK_STATE *WalkState)
{
return;
}
void
AcpiExTracePoint (
ACPI_TRACE_EVENT_TYPE Type,
BOOLEAN Begin,
UINT8 *Aml,
char *Pathname)
{
return;
}
ACPI_STATUS
AcpiTbFindTable (
char *Signature,

View File

@ -302,5 +302,19 @@ typedef struct acpi_serial_info
} ACPI_SERIAL_INFO;
typedef struct asl_method_local
{
ACPI_PARSE_OBJECT *Op;
UINT8 Flags;
} ASL_METHOD_LOCAL;
/* Values for Flags field above */
#define ASL_LOCAL_INITIALIZED (1)
#define ASL_LOCAL_REFERENCED (1<<1)
#define ASL_ARG_IS_LOCAL (1<<2)
#define ASL_ARG_INITIALIZED (1<<3)
#define ASL_ARG_REFERENCED (1<<4)
#endif /* __ASLTYPES_H */

View File

@ -1008,17 +1008,17 @@ stroul64 (
*/
if (*String == '-')
{
Sign = NEGATIVE;
Sign = ACPI_SIGN_NEGATIVE;
++String;
}
else if (*String == '+')
{
++String;
Sign = POSITIVE;
Sign = ACPI_SIGN_POSITIVE;
}
else
{
Sign = POSITIVE;
Sign = ACPI_SIGN_POSITIVE;
}
/*
@ -1106,7 +1106,7 @@ stroul64 (
/* If a minus sign was present, then "the conversion is negated": */
if (Sign == NEGATIVE)
if (Sign == ACPI_SIGN_NEGATIVE)
{
ReturnValue = (ACPI_UINT32_MAX - ReturnValue) + 1;
}

View File

@ -66,6 +66,10 @@ XfNamespaceLocateEnd (
UINT32 Level,
void *Context);
static ACPI_PARSE_OBJECT *
XfGetParentMethod (
ACPI_PARSE_OBJECT *Op);
static BOOLEAN
XfObjectExists (
char *Name);
@ -280,59 +284,16 @@ XfCheckFieldRange (
}
#ifdef __UNDER_DEVELOPMENT
/*******************************************************************************
*
* FUNCTION: XfIsObjectParental
*
* PARAMETERS: ChildOp - Op to be checked
* PossibleParentOp - Determine if this op is in the family
*
* RETURN: TRUE if ChildOp is a descendent of PossibleParentOp
*
* DESCRIPTION: Determine if an Op is a descendent of another Op. Used to
* detect if a method is declared within another method.
*
******************************************************************************/
static BOOLEAN
XfIsObjectParental (
ACPI_PARSE_OBJECT *ChildOp,
ACPI_PARSE_OBJECT *PossibleParentOp)
{
ACPI_PARSE_OBJECT *ParentOp;
/* Search upwards through the tree for possible parent */
ParentOp = ChildOp;
while (ParentOp)
{
if (ParentOp == PossibleParentOp)
{
return (TRUE);
}
ParentOp = ParentOp->Asl.Parent;
}
return (FALSE);
}
/*******************************************************************************
*
* FUNCTION: XfGetParentMethod
*
* PARAMETERS: Op - Op to be checked
* PARAMETERS: Op - Parse Op to be checked
*
* RETURN: Op for parent method. NULL if object is not within a method.
* RETURN: Control method Op if found. NULL otherwise
*
* DESCRIPTION: Determine if an object is within a control method. Used to
* implement special rules for named references from within a
* control method.
*
* NOTE: It would be better to have the parser set a flag in the Op if possible.
* DESCRIPTION: Find the control method parent of a parse op. Returns NULL if
* the input Op is not within a control method.
*
******************************************************************************/
@ -340,121 +301,23 @@ static ACPI_PARSE_OBJECT *
XfGetParentMethod (
ACPI_PARSE_OBJECT *Op)
{
ACPI_PARSE_OBJECT *ParentOp;
ACPI_PARSE_OBJECT *NextOp;
if (!Op)
NextOp = Op->Asl.Parent;
while (NextOp)
{
return (NULL);
}
if (Op->Asl.ParseOpcode == PARSEOP_METHOD)
{
return (NULL);
}
/* Walk upwards through the parse tree, up to the root if necessary */
ParentOp = Op;
while (ParentOp)
{
if (ParentOp->Asl.ParseOpcode == PARSEOP_METHOD)
if (NextOp->Asl.AmlOpcode == AML_METHOD_OP)
{
return (ParentOp);
return (NextOp);
}
ParentOp = ParentOp->Asl.Parent;
NextOp = NextOp->Asl.Parent;
}
/* Object is not within a method */
return (NULL);
return (NULL); /* No parent method found */
}
/*******************************************************************************
*
* FUNCTION: XfCheckIllegalReference
*
* PARAMETERS: Op - Op referring to the target
* TargetNode - Target of the reference
*
* RETURN: None. Emits error message for an illegal reference
*
* DESCRIPTION: Determine if a named reference is legal. A "named" reference
* is something like: Store(ABCD, ...), where ABCD is an AML
* Nameseg or Namepath.
*
* NOTE: Caller must ensure that the name Op is in fact a reference, and not
* an actual name declaration (creation of a named object).
*
******************************************************************************/
static void
XfCheckIllegalReference (
ACPI_PARSE_OBJECT *Op,
ACPI_NAMESPACE_NODE *TargetNode)
{
ACPI_PARSE_OBJECT *MethodOp1;
ACPI_PARSE_OBJECT *MethodOp2;
ACPI_PARSE_OBJECT *TargetOp;
/*
* Check for an illegal reference to a named object:
*
* 1) References from one control method to another, non-parent
* method are not allowed, they will fail at runtime.
*
* 2) Forward references within a control method are not allowed.
* AML interpreters use a one-pass parse of control methods
* so these forward references will fail at runtime.
*/
TargetOp = TargetNode->Op;
MethodOp1 = XfGetParentMethod (Op);
MethodOp2 = XfGetParentMethod (TargetOp);
/* Are both objects within control method(s)? */
if (!MethodOp1 || !MethodOp2)
{
return;
}
/* Objects not in the same method? */
if (MethodOp1 != MethodOp2)
{
/*
* 1) Cross-method named reference
*
* This is OK if and only if the target reference is within in a
* method that is a parent of current method
*/
if (!XfIsObjectParental (MethodOp1, MethodOp2))
{
AslError (ASL_ERROR, ASL_MSG_ILLEGAL_METHOD_REF, Op,
Op->Asl.ExternalName);
}
}
/*
* 2) Both reference and target are in the same method. Check if this is
* an (illegal) forward reference by examining the exact source code
* location of each (the referenced object and the object declaration).
* This is a bit nasty, yet effective.
*/
else if (Op->Asl.LogicalByteOffset < TargetOp->Asl.LogicalByteOffset)
{
AslError (ASL_ERROR, ASL_MSG_ILLEGAL_FORWARD_REF, Op,
Op->Asl.ExternalName);
}
}
#endif
/*******************************************************************************
*
* FUNCTION: XfNamespaceLocateBegin
@ -496,10 +359,67 @@ XfNamespaceLocateBegin (
UINT8 Message = 0;
const ACPI_OPCODE_INFO *OpInfo;
UINT32 Flags;
ASL_METHOD_LOCAL *MethodLocals = NULL;
ASL_METHOD_LOCAL *MethodArgs = NULL;
int RegisterNumber;
UINT32 i;
ACPI_FUNCTION_TRACE_PTR (XfNamespaceLocateBegin, Op);
if ((Op->Asl.AmlOpcode == AML_METHOD_OP) && Op->Asl.Node)
{
Node = Op->Asl.Node;
/* Support for method LocalX/ArgX analysis */
if (!Node->MethodLocals)
{
/* Create local/arg info blocks */
MethodLocals = UtLocalCalloc (
sizeof (ASL_METHOD_LOCAL) * ACPI_METHOD_NUM_LOCALS);
Node->MethodLocals = MethodLocals;
MethodArgs = UtLocalCalloc (
sizeof (ASL_METHOD_LOCAL) * ACPI_METHOD_NUM_ARGS);
Node->MethodArgs = MethodArgs;
/*
* Get the method argument count
* First, get the name node
*/
NextOp = Op->Asl.Child;
/* Get the NumArguments node */
NextOp = NextOp->Asl.Next;
Node->ArgCount = (UINT8)
(((UINT8) NextOp->Asl.Value.Integer) & 0x07);
/* We will track all posible ArgXs */
for (i = 0; i < ACPI_METHOD_NUM_ARGS; i++)
{
if (i < Node->ArgCount)
{
/* Real Args are always "initialized" */
MethodArgs[i].Flags = ASL_ARG_INITIALIZED;
}
else
{
/* Other ArgXs can be used as locals */
MethodArgs[i].Flags = ASL_ARG_IS_LOCAL;
}
MethodArgs[i].Op = Op;
}
}
}
/*
* If this node is the actual declaration of a name
* [such as the XXXX name in "Method (XXXX)"],
@ -512,10 +432,88 @@ XfNamespaceLocateBegin (
return_ACPI_STATUS (AE_OK);
}
/* We are only interested in opcodes that have an associated name */
OpInfo = AcpiPsGetOpcodeInfo (Op->Asl.AmlOpcode);
/* Check method LocalX variables */
if (OpInfo->Type == AML_TYPE_LOCAL_VARIABLE)
{
/* Find parent method Op */
NextOp = XfGetParentMethod (Op);
if (!NextOp)
{
return_ACPI_STATUS (AE_OK);
}
/* Get method node */
Node = NextOp->Asl.Node;
RegisterNumber = Op->Asl.AmlOpcode & 0x0007; /* 0x60 through 0x67 */
MethodLocals = Node->MethodLocals;
if (Op->Asl.CompileFlags & NODE_IS_TARGET)
{
/* Local is being initialized */
MethodLocals[RegisterNumber].Flags |= ASL_LOCAL_INITIALIZED;
MethodLocals[RegisterNumber].Op = Op;
return_ACPI_STATUS (AE_OK);
}
/* Mark this Local as referenced */
MethodLocals[RegisterNumber].Flags |= ASL_LOCAL_REFERENCED;
MethodLocals[RegisterNumber].Op = Op;
return_ACPI_STATUS (AE_OK);
}
/* Check method ArgX variables */
if (OpInfo->Type == AML_TYPE_METHOD_ARGUMENT)
{
/* Find parent method Op */
NextOp = XfGetParentMethod (Op);
if (!NextOp)
{
return_ACPI_STATUS (AE_OK);
}
/* Get method node */
Node = NextOp->Asl.Node;
/* Get Arg # */
RegisterNumber = Op->Asl.AmlOpcode - AML_ARG0; /* 0x68 through 0x6F */
MethodArgs = Node->MethodArgs;
if (Op->Asl.CompileFlags & NODE_IS_TARGET)
{
/* Arg is being initialized */
MethodArgs[RegisterNumber].Flags |= ASL_ARG_INITIALIZED;
MethodArgs[RegisterNumber].Op = Op;
return_ACPI_STATUS (AE_OK);
}
/* Mark this Arg as referenced */
MethodArgs[RegisterNumber].Flags |= ASL_ARG_REFERENCED;
MethodArgs[RegisterNumber].Op = Op;
return_ACPI_STATUS (AE_OK);
}
/*
* After method ArgX and LocalX, we are only interested in opcodes
* that have an associated name
*/
if ((!(OpInfo->Flags & AML_NAMED)) &&
(!(OpInfo->Flags & AML_CREATE)) &&
(Op->Asl.ParseOpcode != PARSEOP_NAMESTRING) &&
@ -1094,3 +1092,178 @@ XfNamespaceLocateEnd (
return_ACPI_STATUS (AE_OK);
}
#ifdef __UNDER_DEVELOPMENT
/*******************************************************************************
*
* FUNCTION: XfIsObjectParental
*
* PARAMETERS: ChildOp - Op to be checked
* PossibleParentOp - Determine if this op is in the family
*
* RETURN: TRUE if ChildOp is a descendent of PossibleParentOp
*
* DESCRIPTION: Determine if an Op is a descendent of another Op. Used to
* detect if a method is declared within another method.
*
******************************************************************************/
static BOOLEAN
XfIsObjectParental (
ACPI_PARSE_OBJECT *ChildOp,
ACPI_PARSE_OBJECT *PossibleParentOp)
{
ACPI_PARSE_OBJECT *ParentOp;
/* Search upwards through the tree for possible parent */
ParentOp = ChildOp;
while (ParentOp)
{
if (ParentOp == PossibleParentOp)
{
return (TRUE);
}
ParentOp = ParentOp->Asl.Parent;
}
return (FALSE);
}
/*******************************************************************************
*
* FUNCTION: XfGetParentMethod
*
* PARAMETERS: Op - Op to be checked
*
* RETURN: Op for parent method. NULL if object is not within a method.
*
* DESCRIPTION: Determine if an object is within a control method. Used to
* implement special rules for named references from within a
* control method.
*
* NOTE: It would be better to have the parser set a flag in the Op if possible.
*
******************************************************************************/
static ACPI_PARSE_OBJECT *
XfGetParentMethod (
ACPI_PARSE_OBJECT *Op)
{
ACPI_PARSE_OBJECT *ParentOp;
if (!Op)
{
return (NULL);
}
if (Op->Asl.ParseOpcode == PARSEOP_METHOD)
{
return (NULL);
}
/* Walk upwards through the parse tree, up to the root if necessary */
ParentOp = Op;
while (ParentOp)
{
if (ParentOp->Asl.ParseOpcode == PARSEOP_METHOD)
{
return (ParentOp);
}
ParentOp = ParentOp->Asl.Parent;
}
/* Object is not within a method */
return (NULL);
}
/*******************************************************************************
*
* FUNCTION: XfCheckIllegalReference
*
* PARAMETERS: Op - Op referring to the target
* TargetNode - Target of the reference
*
* RETURN: None. Emits error message for an illegal reference
*
* DESCRIPTION: Determine if a named reference is legal. A "named" reference
* is something like: Store(ABCD, ...), where ABCD is an AML
* Nameseg or Namepath.
*
* NOTE: Caller must ensure that the name Op is in fact a reference, and not
* an actual name declaration (creation of a named object).
*
******************************************************************************/
static void
XfCheckIllegalReference (
ACPI_PARSE_OBJECT *Op,
ACPI_NAMESPACE_NODE *TargetNode)
{
ACPI_PARSE_OBJECT *MethodOp1;
ACPI_PARSE_OBJECT *MethodOp2;
ACPI_PARSE_OBJECT *TargetOp;
/*
* Check for an illegal reference to a named object:
*
* 1) References from one control method to another, non-parent
* method are not allowed, they will fail at runtime.
*
* 2) Forward references within a control method are not allowed.
* AML interpreters use a one-pass parse of control methods
* so these forward references will fail at runtime.
*/
TargetOp = TargetNode->Op;
MethodOp1 = XfGetParentMethod (Op);
MethodOp2 = XfGetParentMethod (TargetOp);
/* Are both objects within control method(s)? */
if (!MethodOp1 || !MethodOp2)
{
return;
}
/* Objects not in the same method? */
if (MethodOp1 != MethodOp2)
{
/*
* 1) Cross-method named reference
*
* This is OK if and only if the target reference is within in a
* method that is a parent of current method
*/
if (!XfIsObjectParental (MethodOp1, MethodOp2))
{
AslError (ASL_ERROR, ASL_MSG_ILLEGAL_METHOD_REF, Op,
Op->Asl.ExternalName);
}
}
/*
* 2) Both reference and target are in the same method. Check if this is
* an (illegal) forward reference by examining the exact source code
* location of each (the referenced object and the object declaration).
* This is a bit nasty, yet effective.
*/
else if (Op->Asl.LogicalByteOffset < TargetOp->Asl.LogicalByteOffset)
{
AslError (ASL_ERROR, ASL_MSG_ILLEGAL_FORWARD_REF, Op,
Op->Asl.ExternalName);
}
}
#endif

View File

@ -536,6 +536,10 @@ ACPI_STATUS
DtCompileStao (
void **PFieldList);
ACPI_STATUS
DtCompileTcpa (
void **PFieldList);
ACPI_STATUS
DtCompileUefi (
void **PFieldList);

View File

@ -3120,6 +3120,77 @@ DtCompileStao (
}
/******************************************************************************
*
* FUNCTION: DtCompileTcpa
*
* PARAMETERS: PFieldList - Current field list pointer
*
* RETURN: Status
*
* DESCRIPTION: Compile TCPA.
*
*****************************************************************************/
ACPI_STATUS
DtCompileTcpa (
void **List)
{
DT_FIELD **PFieldList = (DT_FIELD **) List;
DT_SUBTABLE *Subtable;
ACPI_TABLE_TCPA_HDR *TcpaHeader;
DT_SUBTABLE *ParentTable;
ACPI_STATUS Status;
/* Compile the main table */
Status = DtCompileTable (PFieldList, AcpiDmTableInfoTcpaHdr,
&Subtable, TRUE);
if (ACPI_FAILURE (Status))
{
return (Status);
}
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
/*
* Examine the PlatformClass field to determine the table type.
* Either a client or server table. Only one.
*/
TcpaHeader = ACPI_CAST_PTR (ACPI_TABLE_TCPA_HDR, ParentTable->Buffer);
switch (TcpaHeader->PlatformClass)
{
case ACPI_TCPA_CLIENT_TABLE:
Status = DtCompileTable (PFieldList, AcpiDmTableInfoTcpaClient,
&Subtable, TRUE);
break;
case ACPI_TCPA_SERVER_TABLE:
Status = DtCompileTable (PFieldList, AcpiDmTableInfoTcpaServer,
&Subtable, TRUE);
break;
default:
AcpiOsPrintf ("\n**** Unknown TCPA Platform Class 0x%X\n",
TcpaHeader->PlatformClass);
Status = AE_ERROR;
break;
}
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
return (Status);
}
/******************************************************************************
*
* FUNCTION: DtGetGenericTableInfo

View File

@ -1144,13 +1144,19 @@ const unsigned char TemplateStao[] =
const unsigned char TemplateTcpa[] =
{
0x54,0x43,0x50,0x41,0x32,0x00,0x00,0x00, /* 00000000 "TCPA2..." */
0x01,0x67,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".gINTEL " */
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
0x54,0x43,0x50,0x41,0x64,0x00,0x00,0x00, /* 00000000 "TCPAd..." */
0x02,0xFF,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */
0x80,0x31,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 ".1..INTL" */
0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00, /* 00000020 "(.. ...." */
0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
0x00,0x00 /* 00000030 ".." */
0x19,0x06,0x15,0x20,0x01,0x00,0x00,0x00, /* 00000020 "... ...." */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
0x11,0x00,0xFF,0xEE,0xDD,0xCC,0xBB,0xAA, /* 00000030 "........" */
0x02,0x01,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000038 "........" */
0x00,0x00,0x00,0x00,0x01,0x20,0x00,0x03, /* 00000040 "..... .." */
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000048 "........" */
0x00,0x00,0x00,0x00,0x01,0x20,0x00,0x03, /* 00000050 "..... .." */
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */
0x01,0x01,0x01,0x01 /* 00000060 "...." */
};
const unsigned char TemplateTpm2[] =

View File

@ -50,14 +50,22 @@
#define STRING_SETUP strcpy (StringBuffer, PrParsertext);\
PrParserlval.str = StringBuffer
#define YY_NO_INPUT /* No file input, we use strings only */
#define _COMPONENT ACPI_COMPILER
ACPI_MODULE_NAME ("prscanner")
/* Local prototypes */
static char
PrDoCommentType1 (
void);
static char
PrDoCommentType2 (
void);
%}
%option noyywrap
%option nounput
Number [0-9a-fA-F]+
HexNumber 0[xX][0-9a-fA-F]+
@ -66,6 +74,8 @@ NewLine [\n]
Identifier [a-zA-Z][0-9a-zA-Z]*
%%
"/*" { if (!PrDoCommentType1 ()) {yyterminate ();} }
"//" { if (!PrDoCommentType2 ()) {yyterminate ();} }
\( return (EXPOP_PAREN_OPEN);
\) return (EXPOP_PAREN_CLOSE);
@ -151,3 +161,76 @@ PrTerminateLexer (
yy_delete_buffer (LexBuffer);
}
/********************************************************************************
*
* FUNCTION: PrDoCommentType1
*
* PARAMETERS: none
*
* RETURN: none
*
* DESCRIPTION: Process a new legacy comment. Just toss it.
*
******************************************************************************/
static char
PrDoCommentType1 (
void)
{
int c;
Loop:
while (((c = input ()) != '*') && (c != EOF))
{
}
if (c == EOF)
{
return (FALSE);
}
if (((c = input ()) != '/') && (c != EOF))
{
unput (c);
goto Loop;
}
if (c == EOF)
{
return (FALSE);
}
return (TRUE);
}
/********************************************************************************
*
* FUNCTION: PrDoCommentType2
*
* PARAMETERS: none
*
* RETURN: none
*
* DESCRIPTION: Process a new "//" comment. Just toss it.
*
******************************************************************************/
static char
PrDoCommentType2 (
void)
{
int c;
while (((c = input ()) != '\n') && (c != EOF))
{
}
if (c == EOF)
{
return (FALSE);
}
return (TRUE);
}

View File

@ -213,8 +213,11 @@ void
PrParsererror (
char const *Message)
{
sprintf (StringBuffer, "Preprocessor Parser : %s (near line %u)",
Message, Gbl_CurrentLineNumber);
DtError (ASL_ERROR, ASL_MSG_SYNTAX,
NULL, (char *) Message);
NULL, (char *) StringBuffer);
}

View File

@ -120,7 +120,6 @@ static const PR_DIRECTIVE_INFO Gbl_DirectiveInfo[] =
{"include", 0}, /* Argument is not standard format, so just use 0 here */
{"includebuffer", 0}, /* Argument is not standard format, so just use 0 here */
{"line", 1},
{"loadbuffer", 0},
{"pragma", 1},
{"undef", 1},
{"warning", 1},
@ -144,7 +143,7 @@ enum Gbl_DirectiveIndexes
PR_DIRECTIVE_LINE,
PR_DIRECTIVE_PRAGMA,
PR_DIRECTIVE_UNDEF,
PR_DIRECTIVE_WARNING,
PR_DIRECTIVE_WARNING
};
#define ASL_DIRECTIVE_NOT_FOUND -1
@ -328,7 +327,7 @@ PrPreprocessInputFile (
PrGetNextLineInit ();
/* Scan line-by-line. Comments and blank lines are skipped by this function */
/* Scan source line-by-line and process directives. Then write the .i file */
while ((Status = PrGetNextLine (Gbl_Files[ASL_FILE_INPUT].Handle)) != ASL_EOF)
{
@ -478,6 +477,16 @@ PrDoDirective (
return;
}
/*
* Emit a line directive into the preprocessor file (.pre) after
* every matched directive. This is passed through to the compiler
* so that error/warning messages are kept in sync with the
* original source file.
*/
FlPrintFile (ASL_FILE_PREPROCESSOR, "#line %u \"%s\" // #%s\n",
Gbl_CurrentLineNumber, Gbl_Files[ASL_FILE_INPUT].Filename,
Gbl_DirectiveInfo[Directive].Name);
/*
* If we are currently ignoring this block and we encounter a #else or
* #elif, we must ignore their blocks also if the parent block is also
@ -825,6 +834,9 @@ PrDoDirective (
PrError (ASL_WARNING, ASL_MSG_WARNING_DIRECTIVE,
THIS_TOKEN_OFFSET (Token));
Gbl_SourceLine = 0;
Gbl_NextError = Gbl_ErrorLog;
break;
default:
@ -863,7 +875,9 @@ PrDoDirective (
******************************************************************************/
#define PR_NORMAL_TEXT 0
#define PR_WITHIN_COMMENT 1
#define PR_MULTI_LINE_COMMENT 1
#define PR_SINGLE_LINE_COMMENT 2
#define PR_QUOTED_STRING 3
static UINT8 AcpiGbl_LineScanState = PR_NORMAL_TEXT;
@ -904,22 +918,55 @@ PrGetNextLine (
return (ASL_EOF);
}
/* We need to worry about multi-line slash-asterisk comments */
/* Update state machine as necessary */
/* Check for comment open */
if ((AcpiGbl_LineScanState == PR_NORMAL_TEXT) &&
(PreviousChar == '/') && (c == '*'))
switch (AcpiGbl_LineScanState)
{
AcpiGbl_LineScanState = PR_WITHIN_COMMENT;
}
case PR_NORMAL_TEXT:
/* Check for comment close */
/* Check for multi-line comment start */
if ((AcpiGbl_LineScanState == PR_WITHIN_COMMENT) &&
(PreviousChar == '*') && (c == '/'))
{
AcpiGbl_LineScanState = PR_NORMAL_TEXT;
if ((PreviousChar == '/') && (c == '*'))
{
AcpiGbl_LineScanState = PR_MULTI_LINE_COMMENT;
}
/* Check for single-line comment start */
else if ((PreviousChar == '/') && (c == '/'))
{
AcpiGbl_LineScanState = PR_SINGLE_LINE_COMMENT;
}
/* Check for quoted string start */
else if (PreviousChar == '"')
{
AcpiGbl_LineScanState = PR_QUOTED_STRING;
}
break;
case PR_QUOTED_STRING:
if (PreviousChar == '"')
{
AcpiGbl_LineScanState = PR_NORMAL_TEXT;
}
break;
case PR_MULTI_LINE_COMMENT:
/* Check for multi-line comment end */
if ((PreviousChar == '*') && (c == '/'))
{
AcpiGbl_LineScanState = PR_NORMAL_TEXT;
}
break;
case PR_SINGLE_LINE_COMMENT: /* Just ignore text until EOL */
default:
break;
}
/* Always copy the character into line buffer */
@ -933,10 +980,21 @@ PrGetNextLine (
{
/* Handle multi-line comments */
if (AcpiGbl_LineScanState == PR_WITHIN_COMMENT)
if (AcpiGbl_LineScanState == PR_MULTI_LINE_COMMENT)
{
return (ASL_WITHIN_COMMENT);
}
/* End of single-line comment */
if (AcpiGbl_LineScanState == PR_SINGLE_LINE_COMMENT)
{
AcpiGbl_LineScanState = PR_NORMAL_TEXT;
return (AE_OK);
}
/* Blank line */
if (i == 1)
{
return (ASL_BLANK_LINE);

View File

@ -86,6 +86,8 @@ AcpiDbDoOneSleepState (
UINT8 SleepState);
static char *AcpiDbTraceMethodName = NULL;
/*******************************************************************************
*
* FUNCTION: AcpiDbConvertToNode
@ -1226,4 +1228,88 @@ AcpiDbGenerateSci (
#endif /* !ACPI_REDUCED_HARDWARE */
/*******************************************************************************
*
* FUNCTION: AcpiDbTrace
*
* PARAMETERS: EnableArg - ENABLE/AML to enable tracer
* DISABLE to disable tracer
* MethodArg - Method to trace
* OnceArg - Whether trace once
*
* RETURN: None
*
* DESCRIPTION: Control method tracing facility
*
******************************************************************************/
void
AcpiDbTrace (
char *EnableArg,
char *MethodArg,
char *OnceArg)
{
UINT32 DebugLevel = 0;
UINT32 DebugLayer = 0;
UINT32 Flags = 0;
if (EnableArg)
{
AcpiUtStrupr (EnableArg);
}
if (OnceArg)
{
AcpiUtStrupr (OnceArg);
}
if (MethodArg)
{
if (AcpiDbTraceMethodName)
{
ACPI_FREE (AcpiDbTraceMethodName);
AcpiDbTraceMethodName = NULL;
}
AcpiDbTraceMethodName = ACPI_ALLOCATE (strlen (MethodArg) + 1);
if (!AcpiDbTraceMethodName)
{
AcpiOsPrintf ("Failed to allocate method name (%s)\n", MethodArg);
return;
}
strcpy (AcpiDbTraceMethodName, MethodArg);
}
if (!strcmp (EnableArg, "ENABLE") ||
!strcmp (EnableArg, "METHOD") ||
!strcmp (EnableArg, "OPCODE"))
{
if (!strcmp (EnableArg, "ENABLE"))
{
/* Inherit current console settings */
DebugLevel = AcpiGbl_DbConsoleDebugLevel;
DebugLayer = AcpiDbgLayer;
}
else
{
/* Restrict console output to trace points only */
DebugLevel = ACPI_LV_TRACE_POINT;
DebugLayer = ACPI_EXECUTER;
}
Flags = ACPI_TRACE_ENABLED;
if (!strcmp (EnableArg, "OPCODE"))
{
Flags |= ACPI_TRACE_OPCODE;
}
if (OnceArg && !strcmp (OnceArg, "ONCE"))
{
Flags |= ACPI_TRACE_ONESHOT;
}
}
(void) AcpiDebugTrace (AcpiDbTraceMethodName,
DebugLevel, DebugLayer, Flags);
}
#endif /* ACPI_DEBUGGER */

Some files were not shown because too many files have changed in this diff Show More