1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-14 10:09:48 +00:00

Merged ^/head r283871 through r284187.

This commit is contained in:
Dimitry Andric 2015-06-09 19:14:27 +00:00
commit 3adc74c768
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/projects/clang-trunk/; revision=284188
259 changed files with 9575 additions and 2338 deletions

View File

@ -36,6 +36,15 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11.x IS SLOW:
20141231 entry below for information about prerequisites and upgrading,
if you are not already using 3.5.0 or higher.
20150604:
Generation of legacy formatted entries have been disabled by default
in pwd_mkdb(8), as all base system consumers of the legacy formatted
entries were converted to use the new format by default when the new,
machine independent format have been added and supported since FreeBSD
5.x.
Please see the pwd_mkdb(8) manual page for further details.
20150525:
Clang and llvm have been upgraded to 3.6.1 release. Please see the
20141231 entry below for information about prerequisites and upgrading,

View File

@ -162,14 +162,16 @@ done: argv += optind;
atflag = AT_SYMLINK_NOFOLLOW;
switch (p->fts_info) {
case FTS_D: /* Change it at FTS_DP. */
case FTS_D:
if (!Rflag)
fts_set(ftsp, p, FTS_SKIP);
continue;
break;
case FTS_DNR: /* Warn, chmod. */
warnx("%s: %s", p->fts_path, strerror(p->fts_errno));
rval = 1;
break;
case FTS_DP: /* Already changed at FTS_D. */
continue;
case FTS_ERR: /* Warn, continue. */
case FTS_NS:
warnx("%s: %s", p->fts_path, strerror(p->fts_errno));

View File

@ -32,7 +32,7 @@
.\" @(#)cp.1 8.3 (Berkeley) 4/18/94
.\" $FreeBSD$
.\"
.Dd March 15, 2013
.Dd June 6, 2015
.Dt CP 1
.Os
.Sh NAME
@ -45,7 +45,7 @@
.Op Fl H | Fl L | Fl P
.Oc
.Op Fl f | i | n
.Op Fl alpvx
.Op Fl alpsvx
.Ar source_file target_file
.Nm
.Oo
@ -53,7 +53,7 @@
.Op Fl H | Fl L | Fl P
.Oc
.Op Fl f | i | n
.Op Fl alpvx
.Op Fl alpsvx
.Ar source_file ... target_directory
.Sh DESCRIPTION
In the first synopsis form, the
@ -179,6 +179,8 @@ If the source file has both its set-user-ID and set-group-ID bits on,
and either the user ID or group ID cannot be preserved, neither
the set-user-ID nor set-group-ID bits are preserved in the copy's
permissions.
.It Fl s
Create symbolic links to regular files in a hierarchy instead of copying.
.It Fl v
Cause
.Nm
@ -298,7 +300,10 @@ differ as they copy special files as normal
files while recreating a hierarchy.
.Pp
The
.Fl v
.Fl l,
.Fl s,
.Fl v,
.Fl x
and
.Fl n
options are non-standard and their use in scripts is not recommended.

View File

@ -75,15 +75,15 @@ __FBSDID("$FreeBSD$");
#include "extern.h"
#define STRIP_TRAILING_SLASH(p) { \
while ((p).p_end > (p).p_path + 1 && (p).p_end[-1] == '/') \
*--(p).p_end = 0; \
while ((p).p_end > (p).p_path + 1 && (p).p_end[-1] == '/') \
*--(p).p_end = 0; \
}
static char emptystring[] = "";
PATH_T to = { to.p_path, emptystring, "" };
int fflag, iflag, lflag, nflag, pflag, vflag;
int fflag, iflag, lflag, nflag, pflag, sflag, vflag;
static int Rflag, rflag;
volatile sig_atomic_t info;
@ -102,7 +102,7 @@ main(int argc, char *argv[])
fts_options = FTS_NOCHDIR | FTS_PHYSICAL;
Hflag = Lflag = 0;
while ((ch = getopt(argc, argv, "HLPRafilnprvx")) != -1)
while ((ch = getopt(argc, argv, "HLPRafilnprsvx")) != -1)
switch (ch) {
case 'H':
Hflag = 1;
@ -145,6 +145,9 @@ main(int argc, char *argv[])
rflag = Lflag = 1;
Hflag = 0;
break;
case 's':
sflag = 1;
break;
case 'v':
vflag = 1;
break;
@ -163,6 +166,8 @@ main(int argc, char *argv[])
if (Rflag && rflag)
errx(1, "the -R and -r options may not be specified together");
if (lflag && sflag)
errx(1, "the -l and -s options may not be specified together");
if (rflag)
Rflag = 1;
if (Rflag) {
@ -183,7 +188,7 @@ main(int argc, char *argv[])
if (strlcpy(to.p_path, target, sizeof(to.p_path)) >= sizeof(to.p_path))
errx(1, "%s: name too long", target);
to.p_end = to.p_path + strlen(to.p_path);
if (to.p_path == to.p_end) {
if (to.p_path == to.p_end) {
*to.p_end++ = '.';
*to.p_end = 0;
}
@ -240,10 +245,10 @@ main(int argc, char *argv[])
type = FILE_TO_FILE;
if (have_trailing_slash && type == FILE_TO_FILE) {
if (r == -1)
if (r == -1) {
errx(1, "directory %s does not exist",
to.p_path);
else
to.p_path);
} else
errx(1, "%s is not a directory", to.p_path);
}
} else
@ -294,8 +299,8 @@ copy(char *argv[], enum op type, int fts_options)
/*
* If we are in case (2) or (3) above, we need to append the
* source name to the target name.
*/
* source name to the target name.
*/
if (type != FILE_TO_FILE) {
/*
* Need to remember the roots of traversals to create
@ -374,7 +379,8 @@ copy(char *argv[], enum op type, int fts_options)
mode = curr->fts_statp->st_mode;
if ((mode & (S_ISUID | S_ISGID | S_ISTXT)) ||
((mode | S_IRWXU) & mask) != (mode & mask))
if (chmod(to.p_path, mode & mask) != 0){
if (chmod(to.p_path, mode & mask) !=
0) {
warn("chmod: %s", to.p_path);
rval = 1;
}
@ -382,7 +388,7 @@ copy(char *argv[], enum op type, int fts_options)
continue;
}
/* Not an error but need to remember it happened */
/* Not an error but need to remember it happened. */
if (stat(to.p_path, &to_stat) == -1)
dne = 1;
else {
@ -408,7 +414,7 @@ copy(char *argv[], enum op type, int fts_options)
switch (curr->fts_statp->st_mode & S_IFMT) {
case S_IFLNK:
/* Catch special case of a non-dangling symlink */
/* Catch special case of a non-dangling symlink. */
if ((fts_options & FTS_LOGICAL) ||
((fts_options & FTS_COMFOLLOW) &&
curr->fts_level == 0)) {
@ -433,7 +439,7 @@ copy(char *argv[], enum op type, int fts_options)
* modified by the umask. Trade-off between being
* able to write the directory (if from directory is
* 555) and not causing a permissions race. If the
* umask blocks owner writes, we fail..
* umask blocks owner writes, we fail.
*/
if (dne) {
if (mkdir(to.p_path,
@ -452,7 +458,7 @@ copy(char *argv[], enum op type, int fts_options)
break;
case S_IFBLK:
case S_IFCHR:
if (Rflag) {
if (Rflag && !sflag) {
if (copy_special(curr->fts_statp, !dne))
badcp = rval = 1;
} else {
@ -462,10 +468,10 @@ copy(char *argv[], enum op type, int fts_options)
break;
case S_IFSOCK:
warnx("%s is a socket (not copied).",
curr->fts_path);
curr->fts_path);
break;
case S_IFIFO:
if (Rflag) {
if (Rflag && !sflag) {
if (copy_fifo(curr->fts_statp, !dne))
badcp = rval = 1;
} else {

View File

@ -37,7 +37,7 @@ typedef struct {
} PATH_T;
extern PATH_T to;
extern int fflag, iflag, lflag, nflag, pflag, vflag;
extern int fflag, iflag, lflag, nflag, pflag, sflag, vflag;
extern volatile sig_atomic_t info;
__BEGIN_DECLS

View File

@ -57,15 +57,19 @@ __FBSDID("$FreeBSD$");
#define cp_pct(x, y) ((y == 0) ? 0 : (int)(100.0 * (x) / (y)))
/* Memory strategy threshold, in pages: if physmem is larger then this, use a
* large buffer */
/*
* Memory strategy threshold, in pages: if physmem is larger then this, use a
* large buffer.
*/
#define PHYSPAGES_THRESHOLD (32*1024)
/* Maximum buffer size in bytes - do not allow it to grow larger than this */
/* Maximum buffer size in bytes - do not allow it to grow larger than this. */
#define BUFSIZE_MAX (2*1024*1024)
/* Small (default) buffer size in bytes. It's inefficient for this to be
* smaller than MAXPHYS */
/*
* Small (default) buffer size in bytes. It's inefficient for this to be
* smaller than MAXPHYS.
*/
#define BUFSIZE_SMALL (MAXPHYS)
int
@ -77,13 +81,15 @@ copy_file(const FTSENT *entp, int dne)
ssize_t wcount;
size_t wresid;
off_t wtotal;
int ch, checkch, from_fd = 0, rcount, rval, to_fd = 0;
int ch, checkch, from_fd, rcount, rval, to_fd;
char *bufp;
#ifdef VM_AND_BUFFER_CACHE_SYNCHRONIZED
char *p;
#endif
if ((from_fd = open(entp->fts_path, O_RDONLY, 0)) == -1) {
from_fd = to_fd = -1;
if (!lflag && !sflag &&
(from_fd = open(entp->fts_path, O_RDONLY, 0)) == -1) {
warn("%s", entp->fts_path);
return (1);
}
@ -103,63 +109,65 @@ copy_file(const FTSENT *entp, int dne)
if (nflag) {
if (vflag)
printf("%s not overwritten\n", to.p_path);
(void)close(from_fd);
return (1);
rval = 1;
goto done;
} else if (iflag) {
(void)fprintf(stderr, "overwrite %s? %s",
to.p_path, YESNO);
to.p_path, YESNO);
checkch = ch = getchar();
while (ch != '\n' && ch != EOF)
ch = getchar();
if (checkch != 'y' && checkch != 'Y') {
(void)close(from_fd);
(void)fprintf(stderr, "not overwritten\n");
return (1);
rval = 1;
goto done;
}
}
if (fflag) {
/* remove existing destination file name,
* create a new file */
(void)unlink(to.p_path);
if (!lflag)
to_fd = open(to.p_path, O_WRONLY | O_TRUNC | O_CREAT,
fs->st_mode & ~(S_ISUID | S_ISGID));
} else {
if (!lflag)
/* overwrite existing destination file name */
to_fd = open(to.p_path, O_WRONLY | O_TRUNC, 0);
/*
* Remove existing destination file name create a new
* file.
*/
(void)unlink(to.p_path);
if (!lflag && !sflag) {
to_fd = open(to.p_path,
O_WRONLY | O_TRUNC | O_CREAT,
fs->st_mode & ~(S_ISUID | S_ISGID));
}
} else if (!lflag && !sflag) {
/* Overwrite existing destination file name. */
to_fd = open(to.p_path, O_WRONLY | O_TRUNC, 0);
}
} else {
if (!lflag)
to_fd = open(to.p_path, O_WRONLY | O_TRUNC | O_CREAT,
fs->st_mode & ~(S_ISUID | S_ISGID));
} else if (!lflag && !sflag) {
to_fd = open(to.p_path, O_WRONLY | O_TRUNC | O_CREAT,
fs->st_mode & ~(S_ISUID | S_ISGID));
}
if (to_fd == -1) {
if (!lflag && !sflag && to_fd == -1) {
warn("%s", to.p_path);
(void)close(from_fd);
return (1);
rval = 1;
goto done;
}
rval = 0;
if (!lflag) {
if (!lflag && !sflag) {
/*
* Mmap and write if less than 8M (the limit is so we don't totally
* trash memory on big files. This is really a minor hack, but it
* wins some CPU back.
* Mmap and write if less than 8M (the limit is so we don't
* totally trash memory on big files. This is really a minor
* hack, but it wins some CPU back.
* Some filesystems, such as smbnetfs, don't support mmap,
* so this is a best-effort attempt.
*/
#ifdef VM_AND_BUFFER_CACHE_SYNCHRONIZED
if (S_ISREG(fs->st_mode) && fs->st_size > 0 &&
fs->st_size <= 8 * 1024 * 1024 &&
fs->st_size <= 8 * 1024 * 1024 &&
(p = mmap(NULL, (size_t)fs->st_size, PROT_READ,
MAP_SHARED, from_fd, (off_t)0)) != MAP_FAILED) {
wtotal = 0;
for (bufp = p, wresid = fs->st_size; ;
bufp += wcount, wresid -= (size_t)wcount) {
bufp += wcount, wresid -= (size_t)wcount) {
wcount = write(to_fd, bufp, wresid);
if (wcount <= 0)
break;
@ -204,7 +212,7 @@ copy_file(const FTSENT *entp, int dne)
wtotal = 0;
while ((rcount = read(from_fd, buf, bufsize)) > 0) {
for (bufp = buf, wresid = rcount; ;
bufp += wcount, wresid -= wcount) {
bufp += wcount, wresid -= wcount) {
wcount = write(to_fd, bufp, wresid);
if (wcount <= 0)
break;
@ -230,13 +238,18 @@ copy_file(const FTSENT *entp, int dne)
rval = 1;
}
}
} else {
} else if (lflag) {
if (link(entp->fts_path, to.p_path)) {
warn("%s", to.p_path);
rval = 1;
}
} else if (sflag) {
if (symlink(entp->fts_path, to.p_path)) {
warn("%s", to.p_path);
rval = 1;
}
}
/*
* Don't remove the target even after an error. The target might
* not be a regular file, or its attributes might be important,
@ -244,7 +257,7 @@ copy_file(const FTSENT *entp, int dne)
* to remove it if we created it and its length is 0.
*/
if (!lflag) {
if (!lflag && !sflag) {
if (pflag && setfile(fs, to_fd))
rval = 1;
if (pflag && preserve_fd_acls(from_fd, to_fd) != 0)
@ -255,8 +268,9 @@ copy_file(const FTSENT *entp, int dne)
}
}
(void)close(from_fd);
done:
if (from_fd != -1)
(void)close(from_fd);
return (rval);
}
@ -338,7 +352,7 @@ setfile(struct stat *fs, int fd)
fdval = fd != -1;
islink = !fdval && S_ISLNK(fs->st_mode);
fs->st_mode &= S_ISUID | S_ISGID | S_ISVTX |
S_IRWXU | S_IRWXG | S_IRWXO;
S_IRWXU | S_IRWXG | S_IRWXO;
tspec[0] = fs->st_atim;
tspec[1] = fs->st_mtim;
@ -353,7 +367,7 @@ setfile(struct stat *fs, int fd)
else {
gotstat = 1;
ts.st_mode &= S_ISUID | S_ISGID | S_ISVTX |
S_IRWXU | S_IRWXG | S_IRWXO;
S_IRWXU | S_IRWXG | S_IRWXO;
}
/*
* Changing the ownership probably won't succeed, unless we're root
@ -477,7 +491,7 @@ preserve_dir_acls(struct stat *fs, char *source_dir, char *dest_dir)
return (0);
/*
* If the file is a link we will not follow it
* If the file is a link we will not follow it.
*/
if (S_ISLNK(fs->st_mode)) {
aclgetf = acl_get_link_np;
@ -536,8 +550,10 @@ usage(void)
{
(void)fprintf(stderr, "%s\n%s\n",
"usage: cp [-R [-H | -L | -P]] [-f | -i | -n] [-alpvx] source_file target_file",
" cp [-R [-H | -L | -P]] [-f | -i | -n] [-alpvx] source_file ... "
"target_directory");
"usage: cp [-R [-H | -L | -P]] [-f | -i | -n] [-alpsvx] "
"source_file target_file",
" cp [-R [-H | -L | -P]] [-f | -i | -n] [-alpsvx] "
"source_file ... "
"target_directory");
exit(EX_USAGE);
}

View File

@ -413,9 +413,14 @@ main(int argc, char *argv[])
/*
* If not -F, -P, -d or -l options, follow any symbolic links listed on
* the command line.
* the command line, unless in color mode in which case we need to
* distinguish file type for a symbolic link itself and its target.
*/
if (!f_nofollow && !f_longform && !f_listdir && (!f_type || f_slash))
if (!f_nofollow && !f_longform && !f_listdir && (!f_type || f_slash)
#ifdef COLORLS
&& !f_color
#endif
)
fts_options |= FTS_COMFOLLOW;
/*

View File

@ -156,6 +156,21 @@ typedef struct dt_module {
#define DT_DM_KERNEL 0x2 /* module is associated with a kernel object */
#define DT_DM_PRIMARY 0x4 /* module is a krtld primary kernel object */
#ifdef __FreeBSD__
/*
* A representation of a FreeBSD kernel module, used when checking module
* dependencies. This differs from dt_module_t, which refers to a KLD in the
* case of kernel probes. Since modules can be identified regardless of whether
* they've been compiled into the kernel, we use them to identify DTrace
* modules.
*/
typedef struct dt_kmodule {
struct dt_kmodule *dkm_next; /* hash table entry */
char *dkm_name; /* string name of module */
dt_module_t *dkm_module; /* corresponding KLD module */
} dt_kmodule_t;
#endif
typedef struct dt_provmod {
char *dp_name; /* name of provider module */
struct dt_provmod *dp_next; /* next module */
@ -235,6 +250,9 @@ struct dtrace_hdl {
dt_idhash_t *dt_tls; /* hash table of thread-local identifiers */
dt_list_t dt_modlist; /* linked list of dt_module_t's */
dt_module_t **dt_mods; /* hash table of dt_module_t's */
#ifdef __FreeBSD__
dt_kmodule_t **dt_kmods; /* hash table of dt_kmodule_t's */
#endif
uint_t dt_modbuckets; /* number of module hash buckets */
uint_t dt_nmods; /* number of modules in hash and list */
dt_provmod_t *dt_provmod; /* linked list of provider modules */

View File

@ -37,6 +37,7 @@
#else
#include <sys/param.h>
#include <sys/linker.h>
#include <sys/module.h>
#include <sys/stat.h>
#endif
@ -542,6 +543,22 @@ dt_module_lookup_by_ctf(dtrace_hdl_t *dtp, ctf_file_t *ctfp)
return (ctfp ? ctf_getspecific(ctfp) : NULL);
}
#ifdef __FreeBSD__
dt_kmodule_t *
dt_kmodule_lookup(dtrace_hdl_t *dtp, const char *name)
{
uint_t h = dt_strtab_hash(name, NULL) % dtp->dt_modbuckets;
dt_kmodule_t *dkmp;
for (dkmp = dtp->dt_kmods[h]; dkmp != NULL; dkmp = dkmp->dkm_next) {
if (strcmp(dkmp->dkm_name, name) == 0)
return (dkmp);
}
return (NULL);
}
#endif
static int
dt_module_load_sect(dtrace_hdl_t *dtp, dt_module_t *dmp, ctf_sect_t *ctsp)
{
@ -1124,6 +1141,12 @@ dt_module_update(dtrace_hdl_t *dtp, struct kld_file_stat *k_stat)
char fname[MAXPATHLEN];
struct stat64 st;
int fd, err, bits;
#ifdef __FreeBSD__
struct module_stat ms;
dt_kmodule_t *dkmp;
uint_t h;
int modid;
#endif
dt_module_t *dmp;
const char *s;
@ -1270,6 +1293,33 @@ dt_module_update(dtrace_hdl_t *dtp, struct kld_file_stat *k_stat)
if (dmp->dm_info.objfs_info_primary)
dmp->dm_flags |= DT_DM_PRIMARY;
#ifdef __FreeBSD__
ms.version = sizeof(ms);
for (modid = kldfirstmod(k_stat->id); modid > 0;
modid = modnext(modid)) {
if (modstat(modid, &ms) != 0) {
dt_dprintf("modstat failed for id %d in %s: %s\n",
modid, k_stat->name, strerror(errno));
continue;
}
if (dt_kmodule_lookup(dtp, ms.name) != NULL)
continue;
dkmp = malloc(sizeof (*dkmp));
if (dkmp == NULL) {
dt_dprintf("failed to allocate memory\n");
dt_module_destroy(dtp, dmp);
return;
}
h = dt_strtab_hash(ms.name, NULL) % dtp->dt_modbuckets;
dkmp->dkm_next = dtp->dt_kmods[h];
dkmp->dkm_name = strdup(ms.name);
dkmp->dkm_module = dmp;
dtp->dt_kmods[h] = dkmp;
}
#endif
dt_dprintf("opened %d-bit module %s (%s) [%d]\n",
bits, dmp->dm_name, dmp->dm_file, dmp->dm_modid);
}

View File

@ -44,6 +44,10 @@ extern void dt_module_destroy(dtrace_hdl_t *, dt_module_t *);
extern dt_module_t *dt_module_lookup_by_name(dtrace_hdl_t *, const char *);
extern dt_module_t *dt_module_lookup_by_ctf(dtrace_hdl_t *, ctf_file_t *);
#ifdef __FreeBSD__
extern dt_kmodule_t *dt_kmodule_lookup(dtrace_hdl_t *, const char *);
#endif
extern int dt_module_hasctf(dtrace_hdl_t *, dt_module_t *);
extern ctf_file_t *dt_module_getctf(dtrace_hdl_t *, dt_module_t *);
extern dt_ident_t *dt_module_extern(dtrace_hdl_t *, dt_module_t *,

View File

@ -1178,6 +1178,9 @@ dt_vopen(int version, int flags, int *errp,
#endif
dtp->dt_modbuckets = _dtrace_strbuckets;
dtp->dt_mods = calloc(dtp->dt_modbuckets, sizeof (dt_module_t *));
#ifdef __FreeBSD__
dtp->dt_kmods = calloc(dtp->dt_modbuckets, sizeof (dt_module_t *));
#endif
dtp->dt_provbuckets = _dtrace_strbuckets;
dtp->dt_provs = calloc(dtp->dt_provbuckets, sizeof (dt_provider_t *));
dt_proc_hash_create(dtp);
@ -1199,6 +1202,7 @@ dt_vopen(int version, int flags, int *errp,
if (dtp->dt_mods == NULL || dtp->dt_provs == NULL ||
dtp->dt_procs == NULL || dtp->dt_ld_path == NULL ||
#ifdef __FreeBSD__
dtp->dt_kmods == NULL ||
dtp->dt_objcopy_path == NULL ||
#endif
dtp->dt_cpp_path == NULL || dtp->dt_cpp_argv == NULL)
@ -1621,6 +1625,10 @@ dtrace_close(dtrace_hdl_t *dtp)
dtrace_prog_t *pgp;
dt_xlator_t *dxp;
dt_dirpath_t *dirp;
#ifdef __FreeBSD__
dt_kmodule_t *dkm;
uint_t h;
#endif
int i;
if (dtp->dt_procs != NULL)
@ -1648,6 +1656,15 @@ dtrace_close(dtrace_hdl_t *dtp)
if (dtp->dt_tls != NULL)
dt_idhash_destroy(dtp->dt_tls);
#ifdef __FreeBSD__
for (h = 0; h < dtp->dt_modbuckets; h++)
while ((dkm = dtp->dt_kmods[h]) != NULL) {
dtp->dt_kmods[h] = dkm->dkm_next;
free(dkm->dkm_name);
free(dkm);
}
#endif
while ((dmp = dt_list_next(&dtp->dt_modlist)) != NULL)
dt_module_destroy(dtp, dmp);
@ -1697,6 +1714,9 @@ dtrace_close(dtrace_hdl_t *dtp)
#endif
free(dtp->dt_mods);
#ifdef __FreeBSD__
free(dtp->dt_kmods);
#endif
free(dtp->dt_provs);
free(dtp);
}

View File

@ -278,6 +278,14 @@ dt_pragma_depends(const char *prname, dt_node_t *cnp)
} else if (strcmp(cnp->dn_string, "module") == 0) {
dt_module_t *mp = dt_module_lookup_by_name(dtp, nnp->dn_string);
found = mp != NULL && dt_module_getctf(dtp, mp) != NULL;
#ifdef __FreeBSD__
if (!found) {
dt_kmodule_t *dkmp = dt_kmodule_lookup(dtp,
nnp->dn_string);
found = dkmp != NULL &&
dt_module_getctf(dtp, dkmp->dkm_module) != NULL;
}
#endif
} else if (strcmp(cnp->dn_string, "library") == 0) {
if (yypcb->pcb_cflags & DTRACE_C_CTL) {
assert(dtp->dt_filetag != NULL);

View File

@ -624,11 +624,11 @@ static void check_avoid_default_addr_size(struct check *c, struct node *dt,
if (!reg && !ranges)
return;
if ((node->parent->addr_cells == -1))
if (node->parent->addr_cells == -1)
FAIL(c, "Relying on default #address-cells value for %s",
node->fullpath);
if ((node->parent->size_cells == -1))
if (node->parent->size_cells == -1)
FAIL(c, "Relying on default #size-cells value for %s",
node->fullpath);
}

View File

@ -28,6 +28,7 @@
#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <err.h>
#include <fcntl.h>
#include <stdarg.h>
#include <stdint.h>
@ -35,6 +36,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <zlib.h>
#include "mandoc.h"
#include "mandoc_aux.h"
@ -792,6 +794,27 @@ mparse_readfd(struct mparse *curp, int fd, const char *file)
return(curp->file_status);
}
/*
* hack to avoid depending on gnuzip(1) waiting for upstream proper
* support
*/
static int
gunzip(const char *file)
{
gzFile gz;
char buf[8192];
int r;
gz = gzopen(file, "r");
if (gz == NULL)
err(EXIT_FAILURE, "cannot open %s", file);
while ((r = gzread(gz, buf, sizeof(buf))) > 0)
fwrite(buf, 1, r, stdout);
gzclose(gz);
return (EXIT_SUCCESS);
}
enum mandoclevel
mparse_open(struct mparse *curp, int *fd, const char *file)
{
@ -846,9 +869,7 @@ mparse_open(struct mparse *curp, int *fd, const char *file)
perror("dup");
exit((int)MANDOCLEVEL_SYSERR);
}
execlp("gunzip", "gunzip", "-c", file, NULL);
perror("exec");
exit((int)MANDOCLEVEL_SYSERR);
exit(gunzip(file));
default:
close(pfd[1]);
*fd = pfd[0];

View File

@ -188,13 +188,10 @@ distribute:
.include <bsd.endian.mk>
.if ${TARGET_ENDIANNESS} == "1234"
CAP_MKDB_ENDIAN?= -l
PWD_MKDB_ENDIAN?= -L
.elif ${TARGET_ENDIANNESS} == "4321"
CAP_MKDB_ENDIAN?= -b
PWD_MKDB_ENDIAN?= -B
.else
CAP_MKDB_ENDIAN?=
PWD_MKDB_ENDIAN?=
.endif
.if defined(NO_ROOT)
@ -210,6 +207,8 @@ distribution:
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
${BIN1} ${DESTDIR}/etc; \
cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf; \
services_mkdb ${CAP_MKDB_ENDIAN} -q -o ${DESTDIR}/var/db/services.db \
${DESTDIR}/etc/services; \
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 \
${BIN2} ${DESTDIR}/etc; \
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
@ -220,8 +219,7 @@ distribution:
.if ${MK_TCSH} == "no"
sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
.endif
pwd_mkdb ${PWD_MKDB_ENDIAN} -i -p -d ${DESTDIR}/etc \
${DESTDIR}/etc/master.passwd
pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd
.if defined(NO_ROOT)
( \
echo "./etc/login.conf.db type=file mode=0644 uname=root gname=wheel"; \

View File

@ -150,14 +150,14 @@ main(int argc, char *argv[])
set(tm->tm_min/10, 14);
if (t12) {
if (tm->tm_hour > 12) {
tm->tm_hour -= 12;
mvaddstr(YBASE + 5, XBASE + 52, "PM");
} else {
if (tm->tm_hour < 12) {
if (tm->tm_hour == 0)
tm->tm_hour = 12;
mvaddstr(YBASE + 5, XBASE + 52, "AM");
} else {
if (tm->tm_hour > 12)
tm->tm_hour -= 12;
mvaddstr(YBASE + 5, XBASE + 52, "PM");
}
}

View File

@ -80,7 +80,7 @@ ENTRY(longjmp)
str x1, [sp, #16]
/* Restore the signal mask */
mov x1, #0 /* oset */
mov x2, #0 /* oset */
add x1, x0, #(_JB_SIGMASK * 8) /* set */
mov x0, #3 /* SIG_BLOCK */
bl sigprocmask

View File

@ -113,10 +113,12 @@ and
.Fn strrchr
conform to
.St -isoC .
The
The function
.Fn strchrnul
is a GNU extension .
.Sh History
is a
.Tn GNU
extension.
.Sh HISTORY
The
.Fn strchrnul
function first appeared in glibc 2.1.1 and was added in

View File

@ -334,7 +334,6 @@ devstat_getdevs(kvm_t *kd, struct statinfo *stats)
{
int error;
size_t dssize;
int oldnumdevs;
long oldgeneration;
int retval = 0;
struct devinfo *dinfo;
@ -348,7 +347,6 @@ devstat_getdevs(kvm_t *kd, struct statinfo *stats)
return(-1);
}
oldnumdevs = dinfo->numdevs;
oldgeneration = dinfo->generation;
if (kd == NULL) {

View File

@ -391,7 +391,6 @@ dprompt_add_files(struct dpv_file_node *file_list,
enum dprompt_state dstate;
int estext_lsize;
int estext_rsize;
int estext_size;
int flabel_size;
int hlen;
int lsize;
@ -559,13 +558,11 @@ dprompt_add_files(struct dpv_file_node *file_list,
bg_code = "\\Zr\\Z1"; /* Red */
estext_lsize = fail_lsize;
estext_rsize = fail_rsize;
estext_size = fail_size;
estext = fail;
} else { /* e.g., DPV_STATUS_DONE */
bg_code = "\\Zr\\Z2"; /* Green */
estext_lsize = done_lsize;
estext_rsize = done_rsize;
estext_size = done_size;
estext = done;
}
switch (dstate) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: readline.h,v 1.34 2013/05/28 00:10:34 christos Exp $ */
/* $NetBSD: readline.h,v 1.37 2015/06/02 15:36:45 christos Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -41,9 +41,8 @@
/* typedefs */
typedef int Function(const char *, int);
typedef void VFunction(void);
typedef void VCPFunction(char *);
typedef char *CPFunction(const char *, int);
typedef char **CPPFunction(const char *, int, int);
typedef void rl_vcpfunc_t(char *);
typedef char **rl_completion_func_t(const char *, int, int);
typedef char *rl_compentry_func_t(const char *, int);
typedef int rl_command_func_t(int, int);
@ -110,9 +109,9 @@ extern int max_input_history;
extern char *rl_basic_word_break_characters;
extern char *rl_completer_word_break_characters;
extern char *rl_completer_quote_characters;
extern Function *rl_completion_entry_function;
extern rl_compentry_func_t *rl_completion_entry_function;
extern char *(*rl_completion_word_break_hook)(void);
extern CPPFunction *rl_attempted_completion_function;
extern rl_completion_func_t *rl_attempted_completion_function;
extern int rl_attempted_completion_over;
extern int rl_completion_type;
extern int rl_completion_query_items;
@ -177,7 +176,7 @@ char *filename_completion_function(const char *, int);
char *username_completion_function(const char *, int);
int rl_complete(int, int);
int rl_read_key(void);
char **completion_matches(const char *, CPFunction *);
char **completion_matches(const char *, rl_compentry_func_t *);
void rl_display_match_list(char **, int, int);
int rl_insert(int, int);
@ -186,7 +185,7 @@ void rl_reset_terminal(const char *);
int rl_bind_key(int, rl_command_func_t *);
int rl_newline(int, int);
void rl_callback_read_char(void);
void rl_callback_handler_install(const char *, VCPFunction *);
void rl_callback_handler_install(const char *, rl_vcpfunc_t *);
void rl_callback_handler_remove(void);
void rl_redisplay(void);
int rl_get_previous_history(int, int);
@ -196,7 +195,7 @@ int rl_read_init_file(const char *);
int rl_parse_and_bind(const char *);
int rl_variable_bind(const char *, const char *);
void rl_stuff_char(int);
int rl_add_defun(const char *, Function *, int);
int rl_add_defun(const char *, rl_command_func_t *, int);
HISTORY_STATE *history_get_history_state(void);
void rl_get_screen_size(int *, int *);
void rl_set_screen_size(int, int);

View File

@ -1,4 +1,4 @@
/* $NetBSD: readline.c,v 1.115 2015/04/01 15:23:15 christos Exp $ */
/* $NetBSD: readline.c,v 1.117 2015/06/02 15:35:31 christos Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -31,7 +31,7 @@
#include "config.h"
#if !defined(lint) && !defined(SCCSID)
__RCSID("$NetBSD: readline.c,v 1.115 2015/04/01 15:23:15 christos Exp $");
__RCSID("$NetBSD: readline.c,v 1.117 2015/06/02 15:35:31 christos Exp $");
#endif /* not lint && not SCCSID */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
@ -80,7 +80,7 @@ FILE *rl_outstream = NULL;
int rl_point = 0;
int rl_end = 0;
char *rl_line_buffer = NULL;
VCPFunction *rl_linefunc = NULL;
rl_vcpfunc_t *rl_linefunc = NULL;
int rl_done = 0;
VFunction *rl_event_hook = NULL;
KEYMAP_ENTRY_ARRAY emacs_standard_keymap,
@ -109,9 +109,9 @@ int rl_attempted_completion_over = 0;
char *rl_basic_word_break_characters = break_chars;
char *rl_completer_word_break_characters = NULL;
char *rl_completer_quote_characters = NULL;
Function *rl_completion_entry_function = NULL;
rl_compentry_func_t *rl_completion_entry_function = NULL;
char *(*rl_completion_word_break_hook)(void) = NULL;
CPPFunction *rl_attempted_completion_function = NULL;
rl_completion_func_t *rl_attempted_completion_function = NULL;
Function *rl_pre_input_hook = NULL;
Function *rl_startup1_hook = NULL;
int (*rl_getc_function)(FILE *) = NULL;
@ -162,7 +162,7 @@ int rl_completion_append_character = ' ';
static History *h = NULL;
static EditLine *e = NULL;
static Function *map[256];
static rl_command_func_t *map[256];
static jmp_buf topbuf;
/* internal functions */
@ -1829,9 +1829,11 @@ rl_complete(int ignore __attribute__((__unused__)), int invoking_key)
else
breakchars = rl_basic_word_break_characters;
_rl_update_pos();
/* Just look at how many global variables modify this operation! */
return fn_complete(e,
(CPFunction *)rl_completion_entry_function,
(rl_compentry_func_t *)rl_completion_entry_function,
rl_attempted_completion_function,
ct_decode_string(rl_basic_word_break_characters, &wbreak_conv),
ct_decode_string(breakchars, &sprefix_conv),
@ -1960,7 +1962,7 @@ rl_bind_wrapper(EditLine *el __attribute__((__unused__)), unsigned char c)
_rl_update_pos();
(*map[c])(NULL, c);
(*map[c])(1, c);
/* If rl_done was set by the above call, deal with it here */
if (rl_done)
@ -1970,7 +1972,7 @@ rl_bind_wrapper(EditLine *el __attribute__((__unused__)), unsigned char c)
}
int
rl_add_defun(const char *name, Function *fun, int c)
rl_add_defun(const char *name, rl_command_func_t *fun, int c)
{
char dest[8];
if ((size_t)c >= sizeof(map) / sizeof(map[0]) || c < 0)
@ -2009,7 +2011,7 @@ rl_callback_read_char(void)
}
void
rl_callback_handler_install(const char *prompt, VCPFunction *linefunc)
rl_callback_handler_install(const char *prompt, rl_vcpfunc_t *linefunc)
{
if (e == NULL) {
rl_initialize();

View File

@ -165,7 +165,6 @@ OM_uint32 gss_accept_sec_context(OM_uint32 *minor_status,
struct _gss_mechanism_cred *mc;
gss_cred_id_t acceptor_mc, delegated_mc;
gss_name_t src_mn;
int allocated_ctx;
*minor_status = 0;
if (src_name)
@ -206,11 +205,8 @@ OM_uint32 gss_accept_sec_context(OM_uint32 *minor_status,
free(ctx);
return (GSS_S_BAD_MECH);
}
allocated_ctx = 1;
} else {
} else
m = ctx->gc_mech;
allocated_ctx = 0;
}
if (cred) {
SLIST_FOREACH(mc, &cred->gc_mc, gmc_link)

View File

@ -64,11 +64,10 @@ bsde_rule_to_string(struct mac_bsdextended_rule *rule, char *buf, size_t buflen)
struct statfs *mntbuf;
char *cur, type[sizeof(rule->mbr_object.mbo_type) * CHAR_BIT + 1];
size_t left, len;
int anymode, unknownmode, truncated, numfs, i, notdone;
int anymode, unknownmode, numfs, i, notdone;
cur = buf;
left = buflen;
truncated = 0;
len = snprintf(cur, left, "subject ");
if (len < 0 || len > left)
@ -1216,7 +1215,7 @@ bsde_delete_rule(int rulenum, size_t buflen, char *errstr)
{
struct mac_bsdextended_rule rule;
int name[10];
size_t len, size;
size_t len;
int error;
if (bsde_check_version(buflen, errstr) != 0)
@ -1233,7 +1232,6 @@ bsde_delete_rule(int rulenum, size_t buflen, char *errstr)
name[len] = rulenum;
len++;
size = sizeof(rule);
error = sysctl(name, len, NULL, NULL, &rule, 0);
if (error) {
len = snprintf(errstr, buflen, "%s.%d: %s", MIB ".rules",

View File

@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd October 30, 2012
.Dd June 06, 2015
.Dt PW_UTIL 3
.Os
.Sh NAME
@ -222,7 +222,7 @@ and it is the caller's responsibility to free it with
The
.Fn pw_mkdb
function regenerates the password database by running
.Xr pw_mkdb 8 .
.Xr pwd_mkdb 8 .
If
.Fa user
only the record corresponding to that user will be updated.

View File

@ -51,9 +51,9 @@ ec2ami: cw-ec2 ${CW_EC2_PORTINSTALL}
@echo "--------------------------------------------------------------"
@false
.endif
/usr/local/bin/bsdec2-image-upload ${PUBLISH} \
${.OBJDIR}/ec2.raw \
"${TYPE} ${REVISION}-${BRANCH}-${TARGET}${AMINAMESUFFIX}" \
"${TYPE} ${REVISION}-${BRANCH}-${TARGET}" \
/usr/local/bin/bsdec2-image-upload ${PUBLISH} \
${.OBJDIR}/ec2.raw \
"${TYPE} ${REVISION}-${BRANCH}-${TARGET}${AMINAMESUFFIX}" \
"${TYPE} ${REVISION}-${BRANCH}-${TARGET}" \
${AWSREGION} ${AWSBUCKET} ${AWSKEYFILE}
@touch ${.TARGET}

View File

@ -23,7 +23,7 @@ arm_install_uboot() {
chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}"
chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT}
chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT}
chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/MLO ${FATMOUNT}/MLO
chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/MLO ${FATMOUNT}/MLO
chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/u-boot.img ${FATMOUNT}/u-boot.img
chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr ${FATMOUNT}/ubldr
chroot ${CHROOTDIR} touch ${UFSMOUNT}/firstboot

View File

@ -0,0 +1,39 @@
#!/bin/sh
#
# $FreeBSD$
#
EMBEDDEDBUILD=1
EMBEDDED_TARGET="arm"
EMBEDDED_TARGET_ARCH="armv6"
EMBEDDEDPORTS="sysutils/u-boot-cubox-hummingboard"
KERNEL="IMX6"
WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x12000000"
IMAGE_SIZE="1G"
PART_SCHEME="MBR"
FAT_SIZE="50m -b 16384"
FAT_TYPE="16"
MD_ARGS="-x 63 -y 255"
NODOC=1
export BOARDNAME="CUBOX-HUMMINGBOARD"
arm_install_uboot() {
UBOOT_DIR="/usr/local/share/u-boot/u-boot-cubox-hummingboard"
UBOOT_FILES="u-boot.imx"
FATMOUNT="${DESTDIR%${KERNEL}}/fat"
UFSMOUNT="${DESTDIR%${KERNEL}}/ufs"
chroot ${CHROOTDIR} dd if=${UBOOT_DIR}/${UBOOT_FILES} \
of=/dev/${mddev} bs=512 seek=2
chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}"
chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT}
chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT}
chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr ${FATMOUNT}/ubldr
chroot ${CHROOTDIR} touch ${UFSMOUNT}/firstboot
sync
umount_loop ${CHROOTDIR}/${FATMOUNT}
umount_loop ${CHROOTDIR}/${UFSMOUNT}
chroot ${CHROOTDIR} rmdir ${FATMOUNT}
chroot ${CHROOTDIR} rmdir ${UFSMOUNT}
return 0
}

37
release/arm/GUMSTIX.conf Normal file
View File

@ -0,0 +1,37 @@
#!/bin/sh
#
# $FreeBSD$
#
EMBEDDEDBUILD=1
EMBEDDED_TARGET="arm"
EMBEDDED_TARGET_ARCH="armv6"
EMBEDDEDPORTS="sysutils/u-boot-duovero"
KERNEL="GUMSTIX"
WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x88000000"
IMAGE_SIZE="1G"
PART_SCHEME="MBR"
FAT_SIZE="2m"
FAT_TYPE="12"
MD_ARGS="-x 63 -y 255"
NODOC=1
arm_install_uboot() {
UBOOT_DIR="/usr/local/share/u-boot/u-boot-duovero"
FATMOUNT="${DESTDIR%${KERNEL}}/fat"
UFSMOUNT="${DESTDIR%${KERNEL}}/ufs"
chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}"
chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT}
chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT}
chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/MLO ${FATMOUNT}/MLO
chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/u-boot.img ${FATMOUNT}/u-boot.img
chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr ${FATMOUNT}/ubldr
chroot ${CHROOTDIR} touch ${UFSMOUNT}/firstboot
sync
umount_loop ${CHROOTDIR}/${FATMOUNT}
umount_loop ${CHROOTDIR}/${UFSMOUNT}
chroot ${CHROOTDIR} rmdir ${FATMOUNT}
chroot ${CHROOTDIR} rmdir ${UFSMOUNT}
return 0
}

View File

@ -8,7 +8,7 @@ EMBEDDED_TARGET="arm"
EMBEDDED_TARGET_ARCH="armv6"
EMBEDDEDPORTS="sysutils/u-boot-wandboard"
KERNEL="IMX6"
WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x11000000"
WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x12000000"
IMAGE_SIZE="1G"
PART_SCHEME="MBR"
FAT_SIZE="50m -b 16384"

View File

@ -72,7 +72,7 @@ arm_create_disk() {
chroot ${CHROOTDIR} gpart create -s bsd ${mddev}s2
chroot ${CHROOTDIR} gpart add -t freebsd-ufs -a 64k /dev/${mddev}s2
chroot ${CHROOTDIR} newfs -U -L rootfs /dev/${mddev}s2a
chroot ${CHROOTDIR} tunefs -j enable -N enable /dev/${mddev}s2a
chroot ${CHROOTDIR} tunefs -N enable /dev/${mddev}s2a
return 0
}
@ -80,11 +80,15 @@ arm_create_disk() {
arm_create_user() {
# Create a default user account 'freebsd' with the password 'freebsd',
# and set the default password for the 'root' user to 'root'.
chroot ${CHROOTDIR} /usr/sbin/pw groupadd freebsd -g 1001
chroot ${CHROOTDIR} /usr/sbin/pw useradd freebsd \
chroot ${CHROOTDIR} /usr/sbin/pw -R ${DESTDIR} \
groupadd freebsd -g 1001
chroot ${CHROOTDIR} mkdir -p ${DESTDIR}/home/freebsd
chroot ${CHROOTDIR} /usr/sbin/pw -R ${DESTDIR} \
useradd freebsd \
-m -M 0755 -w yes -n freebsd -u 1001 -g 1001 -G 0 \
-c 'FreeBSD User' -d '/home/freebsd' -s '/bin/csh'
chroot ${CHROOTDIR} /usr/sbin/pw usermod root -w yes
chroot ${CHROOTDIR} /usr/sbin/pw -R ${DESTDIR} \
usermod root -w yes
return 0
}

View File

@ -4,6 +4,5 @@
PROG= badsect
LIBADD= ufs
MAN= badsect.8
WARNS?= 2
.include <bsd.prog.mk>

View File

@ -2566,12 +2566,11 @@ atahpa(struct cam_device *device, int retry_count, int timeout,
struct ata_params *ident_buf;
struct ccb_getdev cgd;
struct ata_set_max_pwd pwd;
int error, confirm, quiet, c, action, actions, setpwd, persist;
int error, confirm, quiet, c, action, actions, persist;
int security, is48bit, pwdsize;
u_int64_t hpasize, maxsize;
actions = 0;
setpwd = 0;
confirm = 0;
quiet = 0;
maxsize = 0;

View File

@ -432,7 +432,7 @@ scsipersist(struct cam_device *device, int argc, char **argv, char *combinedopt,
uint32_t res_len = 0;
unsigned long rel_tgt_port = 0;
uint8_t *res_buf = NULL;
int scope = SPR_LU_SCOPE, res_type = 0, key_set = 0, sa_key_set = 0;
int scope = SPR_LU_SCOPE, res_type = 0;
struct persist_transport_id *id, *id2;
STAILQ_HEAD(, persist_transport_id) transport_id_list;
uint64_t key = 0, sa_key = 0;
@ -510,10 +510,8 @@ scsipersist(struct cam_device *device, int argc, char **argv, char *combinedopt,
}
if (c == 'k') {
key = tmpval;
key_set = 1;
} else {
sa_key = tmpval;
sa_key_set = 1;
}
break;
}

View File

@ -40,7 +40,7 @@ This paper contains the road-map for a stackable "BIO" system in
FreeBSD, which will support these facilities.
.AE
.NH
The miseducation of \f(CW.)struct buf\fP.
The miseducation of \f(CWstruct buf\fP.
.PP
To fully appreciate the topic, I include a little historic overview
of struct buf, it is a most enlightening case of not exactly bit-rot
@ -215,7 +215,7 @@ and Vinum. They all basically do the same: they map I/O requests from
a logical space to a physical space, and the mappings they perform
can be 1:1 or 1:N. \**
.FS
It is interesting to note that Lions in his comments to the \f(CW.)rkaddr\fP
It is interesting to note that Lions in his comments to the \f(CWrkaddr\fP
routine (p. 16-2) writes \fIThe code in this procedure incorporates
a special feature for files which extend over more than one disk
drive. This feature is described in the UPM Section "RK(IV)". Its
@ -258,7 +258,7 @@ limited extent diskslice/label, which
need only the I/O aspect, not the vnode, caching or VM linkage.
.IP
.I
The I/O aspect of struct buf should be put in a separate \f(CW.)struct bio\fP.
The I/O aspect of struct buf should be put in a separate \f(CWstruct bio\fP.
.R
.NH 1
Implications for future struct buf improvements
@ -296,7 +296,7 @@ Anything that could be added to or done with
the I/O aspect of struct buf can also be added to or done
with the I/O aspect if it lives in a new "struct bio".
.NH 1
Implementing a \f(CW.)struct bio\fP
Implementing a \f(CWstruct bio\fP
.PP
The first decision to be made was who got to use the name "struct buf",
and considering the fact that it is the I/O aspect which gets separated

View File

@ -104,7 +104,10 @@ while getopts ac:C:d:e:g:hH:iI:m:p:t: c ; do
console=${OPTARG}
;;
d)
eval "disk_dev${disk_total}=\"${OPTARG}\""
disk_dev=${OPTARG%%,*}
disk_opts=${OPTARG#${disk_dev}}
eval "disk_dev${disk_total}=\"${disk_dev}\""
eval "disk_opts${disk_total}=\"${disk_opts}\""
disk_total=$(($disk_total + 1))
;;
e)
@ -183,16 +186,16 @@ make_and_check_diskdev()
echo "Launching virtual machine \"$vmname\" ..."
virtio_diskdev="$disk_dev0"
first_diskdev="$disk_dev0"
${BHYVECTL} --vm=${vmname} --destroy > /dev/null 2>&1
while [ 1 ]; do
file -s ${virtio_diskdev} | grep "boot sector" > /dev/null
file -s ${first_diskdev} | grep "boot sector" > /dev/null
rc=$?
if [ $rc -ne 0 ]; then
file -s ${virtio_diskdev} | grep ": Unix Fast File sys" > /dev/null
file -s ${first_diskdev} | grep ": Unix Fast File sys" > /dev/null
rc=$?
fi
if [ $rc -ne 0 ]; then
@ -207,14 +210,22 @@ while [ 1 ]; do
echo "is not readable"
exit 1
fi
BOOTDISK=${isofile}
installer_opt="-s 31:0,ahci-cd,${BOOTDISK}"
BOOTDISKS="-d ${isofile}"
installer_opt="-s 31:0,ahci-cd,${isofile}"
else
BOOTDISK=${virtio_diskdev}
BOOTDISKS=""
i=0
while [ $i -lt $disk_total ] ; do
eval "disk=\$disk_dev${i}"
if [ -r ${disk} ] ; then
BOOTDISKS="$BOOTDISKS -d ${disk} "
fi
i=$(($i + 1))
done
installer_opt=""
fi
${LOADER} -c ${console} -m ${memsize} -d ${BOOTDISK} ${loader_opt} \
${LOADER} -c ${console} -m ${memsize} ${BOOTDISKS} ${loader_opt} \
${vmname}
bhyve_exit=$?
if [ $bhyve_exit -ne 0 ]; then
@ -237,8 +248,9 @@ while [ 1 ]; do
i=0
while [ $i -lt $disk_total ] ; do
eval "disk=\$disk_dev${i}"
eval "opts=\$disk_opts${i}"
make_and_check_diskdev "${disk}"
devargs="$devargs -s $nextslot:0,virtio-blk,${disk} "
devargs="$devargs -s $nextslot:0,virtio-blk,${disk}${opts} "
nextslot=$(($nextslot + 1))
i=$(($i + 1))
done

View File

@ -45,6 +45,14 @@ kernel configuration file:
.Cd "device em"
.Ed
.Pp
Optional multiqueue support is available via the following kernel
compile options:
.Bd -ragged -offset indent
.Cd "options EM_MULTIQUEUE"
.Ed
.Pp
Note: Activating EM_MULTIQUEUE support is not supported by Intel.
.Pp
Alternatively, to load the driver as a
module at boot time, place the following line in
.Xr loader.conf 5 :
@ -197,6 +205,18 @@ Tunables can be set at the
prompt before booting the kernel or stored in
.Xr loader.conf 5 .
.Bl -tag -width indent
.It Va hw.em.eee_setting
Disable or enable Energy Efficient Ethernet.
Default 1 (disabled).
.It Va hw.em.msix
Enable or disable MSI-X style interrupts.
Default 1 (enabled).
.It Va hw.em.smart_pwr_down
Enable or disable smart power down features on newer adapters.
Default 0 (disabled).
.It Va hw.em.sbp
Show bad packets when in promiscuous mode.
Default 0 (off).
.It Va hw.em.rxd
Number of receive descriptors allocated by the driver.
The default value is 1024 for adapters newer than 82547,
@ -228,6 +248,11 @@ If
.Va hw.em.tx_int_delay
is non-zero, this tunable limits the maximum delay in which a transmit
interrupt is generated.
.It Va hw.em.num_queues
Number of hardware queues that will be configured on this adapter (maximum of 2)
Defaults to 1.
Only valid with kernel configuration
.Cd "options EM_MULTIQUEUE".
.El
.Sh FILES
.Bl -tag -width /dev/led/em*
@ -287,3 +312,5 @@ You can enable it on an
.Nm
interface using
.Xr ifconfig 8 .
.Pp
Activating EM_MULTIQUEUE support requires MSI-X features.

View File

@ -34,7 +34,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd September 10, 2013
.Dd June 8, 2015
.Dt GEOM 4
.Os
.Sh NAME
@ -52,12 +52,14 @@
.Cd options GEOM_JOURNAL
.Cd options GEOM_LABEL
.Cd options GEOM_LINUX_LVM
.Cd options GEOM_MAP
.Cd options GEOM_MBR
.Cd options GEOM_MIRROR
.Cd options GEOM_MULTIPATH
.Cd options GEOM_NOP
.Cd options GEOM_PART_APM
.Cd options GEOM_PART_BSD
.Cd options GEOM_PART_BSD64
.Cd options GEOM_PART_EBR
.Cd options GEOM_PART_EBR_COMPAT
.Cd options GEOM_PART_GPT
@ -71,6 +73,7 @@
.Cd options GEOM_SHSEC
.Cd options GEOM_STRIPE
.Cd options GEOM_SUNLABEL
.Cd options GEOM_UNCOMPRESS
.Cd options GEOM_UZIP
.Cd options GEOM_VIRSTOR
.Cd options GEOM_VOL

View File

@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd May 17, 2011
.Dd June 8, 2015
.Dt GEOM_MAP 4
.Os
.Sh NAME
@ -36,7 +36,7 @@ To compile this driver into the kernel,
place the following line in your
kernel configuration file:
.Bd -ragged -offset indent
.Cd "device geom_map"
.Cd "options geom_map"
.Ed
.Sh DESCRIPTION
The

View File

@ -29,7 +29,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd November 7, 2014
.Dd June 2, 2015
.Dt GRE 4
.Os
.Sh NAME
@ -117,6 +117,44 @@ ifconfig greN inet 192.168.2.1 192.168.1.1
ifconfig greN inet tunnel B A
route add -net 192.168.1 -netmask 255.255.255.0 192.168.1.1
.Ed
.Pp
In case when internal and external IP addresses are the same,
different routing tables (FIB) should be used.
The default FIB will be applied to IP packets before GRE encapsulation.
After encapsulation GRE interface should set different FIB number to
outgoing packet.
Then different FIB will be applied to such encapsulated packets.
According to this FIB packet should be routed to tunnel endpoint.
.Bd -literal
Host X -- Host A (198.51.100.1) ---tunnel--- Cisco D (203.0.113.1) -- Host E
\\ /
\\ /
+----- Host B ----- Host C -----+
(198.51.100.254)
.Ed
.Pp
On Host A (FreeBSD):
.Pp
First of multiple FIBs should be configured via loader.conf:
.Bd -literal -offset indent
net.fibs=2
net.add_addr_allfibs=0
.Ed
.Pp
Then routes to the gateway and remote tunnel endpoint via this gateway
should be added to the second FIB:
.Bd -literal -offset indent
route add -net 198.51.100.0 -netmask 255.255.255.0 -fib 1 -iface em0
route add -host 203.0.113.1 -fib 1 198.51.100.254
.Ed
.Pp
And GRE tunnel should be configured to change FIB for encapsulated packets:
.Bd -literal -offset indent
ifconfig greN create
ifconfig greN inet 198.51.100.1 203.0.113.1
ifconfig greN inet tunnel 198.51.100.1 203.0.113.1 tunnelfib 1
.Ed
.Pp
.Sh NOTES
The MTU of
.Nm

View File

@ -13,7 +13,9 @@ MAN= crash.8 \
${_uefi.8} \
yp.8
MLINKS= rc.8 rc.atm.8 \
MLINKS= \
nanobsd.8 nanobsd.sh.8 \
rc.8 rc.atm.8 \
rc.8 rc.d.8 \
rc.8 rc.firewall.8 \
rc.8 rc.local.8 \

View File

@ -68,6 +68,7 @@ bf [label="Brendan Fabeny\nbf@FreeBSD.org\n2010/06/02"]
bland [label="Alexander Nedotsukov\nbland@FreeBSD.org\n2003/08/14"]
bmah [label="Bruce A. Mah\nbmah@FreeBSD.org\n2000/08/23"]
bofh [label="Muhammad Moinur Rahman\nbofh@FreeBSD.org\n2014/12/23"]
brnrd [label="Bernard Spil\nbrnrd@FreeBSD.org\n2015/05/24"]
brix [label="Henrik Brix Andersen\nbrix@FreeBSD.org\n2007/10/31"]
brooks [label="Brooks Davies\nbrooks@FreeBSD.org\n2004/05/03"]
bsam [label="Boris Samorodov\nbsam@FreeBSD.org\n2006/07/20"]
@ -224,6 +225,7 @@ trociny [label="Mikolaj Golub\ntrociny@FreeBSD.org\n2013/10/17"]
uqs [label="Ulrich Spoerlein\nuqs@FreeBSD.org\n2012/01/19"]
vd [label="Vasil Dimov\nvd@FreeBSD.org\n2006/01/19"]
vg [label="Veniamin Gvozdikov\nvg@FreeBSD.org\n2013/06/11"]
vsevolod [label="Vsevolod Stakhov\nvsevolod@FreeBSD.org\n2005/07/22"]
wen [label="Wen Heping\nwen@FreeBSD.org\n2010/12/13"]
wg [label="William Grzybowski\nwg@FreeBSD.org\n2013/04/01"]
wxs [label="Wesley Shields\nwxs@FreeBSD.org\n2008/01/03"]
@ -404,6 +406,7 @@ knu -> maho
knu -> nobutaka
knu -> nork
koobs -> brnrd
koobs -> kami
koobs -> xmj
@ -576,6 +579,8 @@ thierry -> riggs
tmclaugh -> itetcu
tmclaugh -> xride
vsevolod -> brnrd
wen -> cs
wen -> culot
wen -> pawel

View File

@ -169,7 +169,7 @@ _LIBS= lib${LIB_PRIVATE}${LIB}.a
lib${LIB_PRIVATE}${LIB}.a: ${OBJS} ${STATICOBJS}
@${ECHO} building static ${LIB} library
@rm -f ${.TARGET}
@${AR} ${ARFLAGS} ${.TARGET} `NM='${NM}' lorder ${OBJS} ${STATICOBJS} | tsort -q` ${ARADD}
${AR} ${ARFLAGS} ${.TARGET} `NM='${NM}' lorder ${OBJS} ${STATICOBJS} | tsort -q` ${ARADD}
${RANLIB} ${RANLIBFLAGS} ${.TARGET}
.endif
@ -183,7 +183,7 @@ NOPATH_FILES+= ${POBJS}
lib${LIB_PRIVATE}${LIB}_p.a: ${POBJS}
@${ECHO} building profiled ${LIB} library
@rm -f ${.TARGET}
@${AR} ${ARFLAGS} ${.TARGET} `NM='${NM}' lorder ${POBJS} | tsort -q` ${ARADD}
${AR} ${ARFLAGS} ${.TARGET} `NM='${NM}' lorder ${POBJS} | tsort -q` ${ARADD}
${RANLIB} ${RANLIBFLAGS} ${.TARGET}
.endif
@ -240,7 +240,7 @@ _LIBS+= lib${LIB_PRIVATE}${LIB}_pic.a
lib${LIB_PRIVATE}${LIB}_pic.a: ${SOBJS}
@${ECHO} building special pic ${LIB} library
@rm -f ${.TARGET}
@${AR} ${ARFLAGS} ${.TARGET} ${SOBJS} ${ARADD}
${AR} ${ARFLAGS} ${.TARGET} ${SOBJS} ${ARADD}
${RANLIB} ${RANLIBFLAGS} ${.TARGET}
.endif

View File

@ -70,3 +70,16 @@ MK_${var}:= no
.for var in ${BROKEN_OPTIONS}
MK_${var}:= no
.endfor
.for vv in ${__DEFAULT_DEPENDENT_OPTIONS}
.if defined(WITH_${vv:H}) && defined(WITHOUT_${vv:H})
MK_${vv:H}?= no
.elif defined(WITH_${vv:H})
MK_${vv:H}?= yes
.elif defined(WITHOUT_${vv:H})
MK_${vv:H}?= no
.else
MK_${vv:H}?= ${MK_${vv:T}}
.endif
.endfor
.undef __DEFAULT_DEPENDENT_OPTIONS

View File

@ -74,6 +74,7 @@ u_int cpu_fxsr; /* SSE enabled */
u_int cpu_mxcsr_mask; /* Valid bits in mxcsr */
u_int cpu_clflush_line_size = 32;
u_int cpu_stdext_feature;
u_int cpu_stdext_feature2;
u_int cpu_max_ext_state_size;
u_int cpu_mon_mwait_flags; /* MONITOR/MWAIT flags (CPUID.05H.ECX) */
u_int cpu_mon_min_size; /* MONITOR minimum range size, bytes */

View File

@ -4844,6 +4844,7 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_t dst_addr, vm_size_t len,
PG_PS_FRAME, &lock))) {
*pde = srcptepaddr & ~PG_W;
pmap_resident_count_inc(dst_pmap, NBPDR / PAGE_SIZE);
atomic_add_long(&pmap_pde_mappings, 1);
} else
dstmpde->wire_count--;
continue;

View File

@ -49,6 +49,7 @@ extern u_int via_feature_rng;
extern u_int via_feature_xcrypt;
extern u_int cpu_clflush_line_size;
extern u_int cpu_stdext_feature;
extern u_int cpu_stdext_feature2;
extern u_int cpu_fxsr;
extern u_int cpu_high;
extern u_int cpu_id;

View File

@ -90,13 +90,12 @@
#define VM_PHYSSEG_MAX 63
/*
* Create three free page pools: VM_FREEPOOL_DEFAULT is the default pool
* Create two free page pools: VM_FREEPOOL_DEFAULT is the default pool
* from which physical pages are allocated and VM_FREEPOOL_DIRECT is
* the pool from which physical pages for page tables and small UMA
* objects are allocated.
*/
#define VM_NFREEPOOL 3
#define VM_FREEPOOL_CACHE 2
#define VM_NFREEPOOL 2
#define VM_FREEPOOL_DEFAULT 0
#define VM_FREEPOOL_DIRECT 1

View File

@ -45,9 +45,9 @@ ENTRY(futex_xchgl)
movq $VM_MAXUSER_ADDRESS-4,%rax
cmpq %rax,%rsi
ja futex_fault
xchgq %rdi,(%rsi)
movq %rdi,(%rdx)
xorq %rax,%rax
xchgl %edi,(%rsi)
movl %edi,(%rdx)
xorl %eax,%eax
movq %rax,PCB_ONFAULT(%r8)
ret
@ -60,9 +60,9 @@ ENTRY(futex_addl)
#ifdef SMP
lock
#endif
xaddq %rdi,(%rsi)
movq %rdi,(%rdx)
xorq %rax,%rax
xaddl %edi,(%rsi)
movl %edi,(%rdx)
xorl %eax,%eax
movq %rax,PCB_ONFAULT(%r8)
ret
@ -72,16 +72,16 @@ ENTRY(futex_orl)
movq $VM_MAXUSER_ADDRESS-4,%rax
cmpq %rax,%rsi
ja futex_fault
movq (%rsi),%rax
1: movq %rax,%rcx
orq %rdi,%rcx
movl (%rsi),%eax
1: movl %eax,%ecx
orl %edi,%ecx
#ifdef SMP
lock
#endif
cmpxchgq %rcx,(%rsi)
cmpxchgl %ecx,(%rsi)
jnz 1b
movq %rax,(%rdx)
xorq %rax,%rax
movl %eax,(%rdx)
xorl %eax,%eax
movq %rax,PCB_ONFAULT(%r8)
ret
@ -91,16 +91,16 @@ ENTRY(futex_andl)
movq $VM_MAXUSER_ADDRESS-4,%rax
cmpq %rax,%rsi
ja futex_fault
movq (%rsi),%rax
1: movq %rax,%rcx
andq %rdi,%rcx
movl (%rsi),%eax
1: movl %eax,%ecx
andl %edi,%ecx
#ifdef SMP
lock
#endif
cmpxchgq %rcx,(%rsi)
cmpxchgl %ecx,(%rsi)
jnz 1b
movq %rax,(%rdx)
xorq %rax,%rax
movl %eax,(%rdx)
xorl %eax,%eax
movq %rax,PCB_ONFAULT(%r8)
ret
@ -110,15 +110,15 @@ ENTRY(futex_xorl)
movq $VM_MAXUSER_ADDRESS-4,%rax
cmpq %rax,%rsi
ja futex_fault
movq (%rsi),%rax
1: movq %rax,%rcx
xorq %rdi,%rcx
movl (%rsi),%eax
1: movl %eax,%ecx
xorl %edi,%ecx
#ifdef SMP
lock
#endif
cmpxchgq %rcx,(%rsi)
cmpxchgl %ecx,(%rsi)
jnz 1b
movq %rax,(%rdx)
xorq %rax,%rax
movl %eax,(%rdx)
xorl %eax,%eax
movq %rax,PCB_ONFAULT(%r8)
ret

View File

@ -102,8 +102,8 @@ static MALLOC_DEFINE(M_SVM_VLAPIC, "svm-vlapic", "svm-vlapic");
/* Per-CPU context area. */
extern struct pcpu __pcpu[];
static uint32_t svm_feature; /* AMD SVM features. */
SYSCTL_UINT(_hw_vmm_svm, OID_AUTO, features, CTLFLAG_RD, &svm_feature, 0,
static uint32_t svm_feature = ~0U; /* AMD SVM features. */
SYSCTL_UINT(_hw_vmm_svm, OID_AUTO, features, CTLFLAG_RDTUN, &svm_feature, 0,
"SVM features advertised by CPUID.8000000AH:EDX");
static int disable_npf_assist;
@ -112,7 +112,7 @@ SYSCTL_INT(_hw_vmm_svm, OID_AUTO, disable_npf_assist, CTLFLAG_RWTUN,
/* Maximum ASIDs supported by the processor */
static uint32_t nasid;
SYSCTL_UINT(_hw_vmm_svm, OID_AUTO, num_asids, CTLFLAG_RD, &nasid, 0,
SYSCTL_UINT(_hw_vmm_svm, OID_AUTO, num_asids, CTLFLAG_RDTUN, &nasid, 0,
"Number of ASIDs supported by this processor");
/* Current ASID generation for each host cpu */
@ -174,9 +174,14 @@ check_svm_features(void)
/* CPUID Fn8000_000A is for SVM */
do_cpuid(0x8000000A, regs);
svm_feature = regs[3];
svm_feature &= regs[3];
nasid = regs[1];
/*
* The number of ASIDs can be configured to be less than what is
* supported by the hardware but not more.
*/
if (nasid == 0 || nasid > regs[1])
nasid = regs[1];
KASSERT(nasid > 1, ("Insufficient ASIDs for guests: %#x", nasid));
/* bhyve requires the Nested Paging feature */

View File

@ -856,10 +856,11 @@ vmx_vminit(struct vm *vm, pmap_t pmap)
* VM exit and entry respectively. It is also restored from the
* host VMCS area on a VM exit.
*
* The TSC MSR is exposed read-only. Writes are disallowed as that
* will impact the host TSC.
* XXX Writes would be implemented with a wrmsr trap, and
* then modifying the TSC offset in the VMCS.
* The TSC MSR is exposed read-only. Writes are disallowed as
* that will impact the host TSC. If the guest does a write
* the "use TSC offsetting" execution control is enabled and the
* difference between the host TSC and the guest TSC is written
* into the TSC offset in the VMCS.
*/
if (guest_msr_rw(vmx, MSR_GSBASE) ||
guest_msr_rw(vmx, MSR_FSBASE) ||
@ -1130,6 +1131,22 @@ vmx_clear_nmi_window_exiting(struct vmx *vmx, int vcpu)
VCPU_CTR0(vmx->vm, vcpu, "Disabling NMI window exiting");
}
int
vmx_set_tsc_offset(struct vmx *vmx, int vcpu, uint64_t offset)
{
int error;
if ((vmx->cap[vcpu].proc_ctls & PROCBASED_TSC_OFFSET) == 0) {
vmx->cap[vcpu].proc_ctls |= PROCBASED_TSC_OFFSET;
vmcs_write(VMCS_PRI_PROC_BASED_CTLS, vmx->cap[vcpu].proc_ctls);
VCPU_CTR0(vmx->vm, vcpu, "Enabling TSC offsetting");
}
error = vmwrite(VMCS_TSC_OFFSET, offset);
return (error);
}
#define NMI_BLOCKING (VMCS_INTERRUPTIBILITY_NMI_BLOCKING | \
VMCS_INTERRUPTIBILITY_MOVSS_BLOCKING)
#define HWINTR_BLOCKING (VMCS_INTERRUPTIBILITY_STI_BLOCKING | \

View File

@ -135,6 +135,8 @@ void vmx_call_isr(uintptr_t entry);
u_long vmx_fix_cr0(u_long cr0);
u_long vmx_fix_cr4(u_long cr4);
int vmx_set_tsc_offset(struct vmx *vmx, int vcpu, uint64_t offset);
extern char vmx_exit_guest[];
#endif

View File

@ -474,6 +474,9 @@ vmx_wrmsr(struct vmx *vmx, int vcpuid, u_int num, uint64_t val, bool *retu)
else
vm_inject_gp(vmx->vm, vcpuid);
break;
case MSR_TSC:
error = vmx_set_tsc_offset(vmx, vcpuid, val - rdtsc());
break;
default:
error = EINVAL;
break;

View File

@ -2342,7 +2342,7 @@ verify_gla(struct vm *vm, int cpuid, uint64_t gla, struct vie *vie)
* instruction
*/
if (vie->base_register == VM_REG_GUEST_RIP)
base += vie->num_valid;
base += vie->num_processed;
}
idx = 0;

View File

@ -26,6 +26,7 @@
*
* $FreeBSD$
*/
#include "assym.s"
#include <machine/acle-compat.h>
#include <machine/asm.h>
@ -33,6 +34,17 @@
#include <machine/armreg.h>
#include <machine/sysreg.h>
#if __ARM_ARCH >= 6
#define GET_PCB(tmp) \
mrc CP15_TPIDRPRW(tmp); \
add tmp, tmp, #(TD_PCB)
#else
.Lcurpcb:
.word _C_LABEL(__pcpu) + PC_CURPCB
#define GET_PCB(tmp) \
ldr tmp, .Lcurpcb
#endif
/*
* Define cache functions used by startup code, which counts on the fact that
* only r0-r3,r12 (ip) are modified and no stack space is used. These functions
@ -208,3 +220,59 @@ ASENTRY_NP(dcache_wbinv_poc_all)
bx lr
#endif /* __ARM_ARCH == 6 */
END(dcache_wbinv_poc_all)
ASENTRY_NP(dcache_wb_pou_checked)
ldr ip, .Lcpuinfo
ldr ip, [ip, #DCACHE_LINE_SIZE]
GET_PCB(r2)
ldr r2, [r2]
adr r3, _C_LABEL(cachebailout)
str r3, [r2, #PCB_ONFAULT]
1:
mcr CP15_DCCMVAC(r0)
add r0, r0, ip
subs r1, r1, ip
bhi 1b
DSB
mov r0, #0
str r0, [r2, #PCB_ONFAULT]
mov r0, #1 /* cannot be faulting address */
RET
.Lcpuinfo:
.word cpuinfo
END(dcache_wb_pou_checked)
ASENTRY_NP(icache_inv_pou_checked)
ldr ip, .Lcpuinfo
ldr ip, [ip, #ICACHE_LINE_SIZE]
GET_PCB(r2)
ldr r2, [r2]
adr r3, _C_LABEL(cachebailout)
str r3, [r2, #PCB_ONFAULT]
1:
mcr CP15_ICIMVAU(r0)
add r0, r0, ip
subs r1, r1, ip
bhi 1b
DSB
ISB
mov r0, #0
str r0, [r2, #PCB_ONFAULT]
mov r0, #1 /* cannot be faulting address */
RET
END(icache_inv_pou_checked)
/* label must be global as trap-v6.c references it */
.global _C_LABEL(cachebailout)
_C_LABEL(cachebailout):
DSB
ISB
mov r1, #0
str r1, [r2, #PCB_ONFAULT]
RET

View File

@ -725,7 +725,6 @@ __start(void)
(unsigned int)(&load_kernel) + 800, sp);
}
#ifdef __ARM_EABI__
/* We need to provide these functions but never call them */
void __aeabi_unwind_cpp_pr0(void);
void __aeabi_unwind_cpp_pr1(void);
@ -737,5 +736,3 @@ void
__aeabi_unwind_cpp_pr0(void)
{
}
#endif

View File

@ -49,6 +49,7 @@
#include "assym.s"
#include "opt_kdtrace.h"
#include <machine/acle-compat.h>
#include <machine/asm.h>
#include <machine/armreg.h>
#include <machine/asmacros.h>
@ -80,7 +81,7 @@ _C_LABEL(dtrace_invop_calltrap_addr):
* NOTE: r13 and r14 are stored separately as a work around for the
* SA110 rev 2 STM^ bug
*/
#ifdef ARM_TP_ADDRESS
#if __ARM_ARCH < 6
#define PUSHFRAME \
sub sp, sp, #4; /* Align the stack */ \
str lr, [sp, #-4]!; /* Push the return address */ \
@ -114,7 +115,7 @@ _C_LABEL(dtrace_invop_calltrap_addr):
* Since the current mode is used, the SVC lr field is ignored.
*/
#ifdef ARM_TP_ADDRESS
#if __ARM_ARCH < 6
#define PULLFRAME \
ldr r0, [sp], #4; /* Get the SPSR from stack */ \
msr spsr_fsxc, r0; \
@ -145,7 +146,7 @@ _C_LABEL(dtrace_invop_calltrap_addr):
* NOTE: r13 and r14 are stored separately as a work around for the
* SA110 rev 2 STM^ bug
*/
#ifdef ARM_TP_ADDRESS
#if __ARM_ARCH < 6
#define PUSHFRAMEINSVC \
stmdb sp, {r0-r3}; /* Save 4 registers */ \
mov r0, lr; /* Save xxx32 r14 */ \
@ -218,7 +219,7 @@ _C_LABEL(dtrace_invop_calltrap_addr):
* exit.
*/
#ifdef ARM_TP_ADDRESS
#if __ARM_ARCH < 6
#define PULLFRAMEFROMSVCANDEXIT \
ldr r0, [sp], #4; /* Get the SPSR from stack */ \
msr spsr_fsxc, r0; /* restore SPSR */ \
@ -237,7 +238,6 @@ _C_LABEL(dtrace_invop_calltrap_addr):
ldmia sp, {sp, lr, pc}^ /* Restore lr and exit */
#endif
#if defined(__ARM_EABI__)
/*
* Unwind hints so we can unwind past functions that use
* PULLFRAMEFROMSVCANDEXIT. They are run in reverse order.
@ -249,9 +249,6 @@ _C_LABEL(dtrace_invop_calltrap_addr):
.pad #(2*4); /* Skip user sp and lr */ \
.save {r0-r12}; /* Restore r0-r12 */ \
.pad #(4) /* Skip spsr */
#else
#define UNWINDSVCFRAME
#endif
#define DO_AST \
ldr r0, [sp]; /* Get the SPSR from stack */ \

View File

@ -38,6 +38,8 @@ __FBSDID("$FreeBSD$");
#include <vm/vm_param.h>
#include <vm/pmap.h>
#include <vm/vm_map.h>
#include <machine/acle-compat.h>
#include <machine/vmparam.h>
#include <machine/armreg.h>
#include <machine/frame.h>
@ -124,7 +126,7 @@ ASSYM(P_FLAG, offsetof(struct proc, p_flag));
ASSYM(SIGF_UC, offsetof(struct sigframe, sf_uc));
#ifdef ARM_TP_ADDRESS
#if __ARM_ARCH < 6
ASSYM(ARM_TP_ADDRESS, ARM_TP_ADDRESS);
ASSYM(ARM_RAS_START, ARM_RAS_START);
ASSYM(ARM_RAS_END, ARM_RAS_END);
@ -133,8 +135,6 @@ ASSYM(ARM_RAS_END, ARM_RAS_END);
#ifdef VFP
ASSYM(PCB_VFPSTATE, offsetof(struct pcb, pcb_vfpstate));
ASSYM(PC_CPU, offsetof(struct pcpu, pc_cpu));
ASSYM(PC_CURPMAP, offsetof(struct pcpu, pc_curpmap));
#endif

View File

@ -741,10 +741,13 @@ get_mcontext(struct thread *td, mcontext_t *mcp, int clear_ret)
struct trapframe *tf = td->td_frame;
__greg_t *gr = mcp->__gregs;
if (clear_ret & GET_MC_CLEAR_RET)
if (clear_ret & GET_MC_CLEAR_RET) {
gr[_REG_R0] = 0;
else
gr[_REG_CPSR] = tf->tf_spsr & ~PSR_C;
} else {
gr[_REG_R0] = tf->tf_r0;
gr[_REG_CPSR] = tf->tf_spsr;
}
gr[_REG_R1] = tf->tf_r1;
gr[_REG_R2] = tf->tf_r2;
gr[_REG_R3] = tf->tf_r3;
@ -760,7 +763,6 @@ get_mcontext(struct thread *td, mcontext_t *mcp, int clear_ret)
gr[_REG_SP] = tf->tf_usr_sp;
gr[_REG_LR] = tf->tf_usr_lr;
gr[_REG_PC] = tf->tf_pc;
gr[_REG_CPSR] = tf->tf_spsr;
return (0);
}
@ -914,9 +916,6 @@ pcpu0_init(void)
#endif
pcpu_init(pcpup, 0, sizeof(struct pcpu));
PCPU_SET(curthread, &thread0);
#ifdef VFP
PCPU_SET(cpu, 0);
#endif
}
#if defined(LINUX_BOOT_ABI)

View File

@ -197,8 +197,6 @@ init_secondary(int cpu)
pc->pc_curpcb = pc->pc_idlethread->td_pcb;
set_curthread(pc->pc_idlethread);
#ifdef VFP
pc->pc_cpu = cpu;
vfp_init();
#endif

View File

@ -5768,6 +5768,7 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_t dst_addr, vm_size_t len,
~PTE1_W;
dst_pmap->pm_stats.resident_count +=
PTE1_SIZE / PAGE_SIZE;
pmap_pte1_mappings++;
}
continue;
} else if (!pte1_is_link(src_pte1))

View File

@ -49,16 +49,6 @@ extern vm_offset_t kernel_vm_end;
static void
stack_capture(struct stack *st, u_int32_t *frame)
{
#if !defined(__ARM_EABI__) && !defined(__clang__)
vm_offset_t callpc;
while (INKERNEL(frame) && (vm_offset_t)frame < kernel_vm_end) {
callpc = frame[FR_SCP];
if (stack_put(st, callpc) == -1)
break;
frame = (u_int32_t *)(frame[FR_RFP]);
}
#endif
}
void

View File

@ -198,20 +198,20 @@ ENTRY(cpu_throw)
str r7, [r6, #PC_CURPCB]
/* We have a new curthread now so make a note it */
str r5, [r6, #PC_CURTHREAD]
#ifndef ARM_TP_ADDRESS
#if __ARM_ARCH >= 6
mcr p15, 0, r5, c13, c0, 4
#endif
/* Set the new tp */
ldr r6, [r5, #(TD_MD + MD_TP)]
#ifdef ARM_TP_ADDRESS
#if __ARM_ARCH >= 6
mcr p15, 0, r6, c13, c0, 3
#else
ldr r4, =ARM_TP_ADDRESS
str r6, [r4]
ldr r6, [r5, #(TD_MD + MD_RAS_START)]
str r6, [r4, #4] /* ARM_RAS_START */
ldr r6, [r5, #(TD_MD + MD_RAS_END)]
str r6, [r4, #8] /* ARM_RAS_END */
#else
mcr p15, 0, r6, c13, c0, 3
#endif
/* Restore all the saved registers and exit */
add r3, r7, #PCB_R4
@ -245,7 +245,7 @@ ENTRY(cpu_switch)
/* We have a new curthread now so make a note it */
GET_PCPU(r7, r2)
str r1, [r7, #PC_CURTHREAD]
#ifndef ARM_TP_ADDRESS
#if __ARM_ARCH >= 6
mcr p15, 0, r1, c13, c0, 4
#endif
@ -259,7 +259,14 @@ ENTRY(cpu_switch)
ldr r2, [r0, #(TD_PCB)]
mov r4, r0 /* Save the old thread. */
#ifdef ARM_TP_ADDRESS
#if __ARM_ARCH >= 6
/*
* Set new tp. No need to store the old one first, userland can't
* change it directly on armv6.
*/
ldr r9, [r1, #(TD_MD + MD_TP)]
mcr p15, 0, r9, c13, c0, 3
#else
/* Store the old tp; userland can change it on armv4. */
ldr r3, =ARM_TP_ADDRESS
ldr r9, [r3]
@ -276,13 +283,6 @@ ENTRY(cpu_switch)
str r9, [r3, #4]
ldr r9, [r1, #(TD_MD + MD_RAS_END)]
str r9, [r3, #8]
#else
/*
* Set new tp. No need to store the old one first, userland can't
* change it directly on armv6.
*/
ldr r9, [r1, #(TD_MD + MD_TP)]
mcr p15, 0, r9, c13, c0, 3
#endif
/* Get the user structure for the new process in r9 */

View File

@ -41,8 +41,13 @@ __FBSDID("$FreeBSD$");
#include <sys/sysproto.h>
#include <sys/syscall.h>
#include <sys/sysent.h>
#include <vm/vm.h>
#include <vm/vm_extern.h>
#include <machine/acle-compat.h>
#include <machine/cpu-v6.h>
#include <machine/sysarch.h>
#include <machine/vmparam.h>
#ifndef _SYS_SYSPROTO_H_
struct sysarch_args {
@ -55,16 +60,89 @@ struct sysarch_args {
static int arm32_sync_icache (struct thread *, void *);
static int arm32_drain_writebuf(struct thread *, void *);
#if __ARM_ARCH >= 6
static int
sync_icache(uintptr_t addr, size_t len)
{
size_t size;
vm_offset_t rv;
/*
* Align starting address to even number because value of "1"
* is used as return value for success.
*/
len += addr & 1;
addr &= ~1;
/* Break whole range to pages. */
do {
size = PAGE_SIZE - (addr & PAGE_MASK);
size = min(size, len);
rv = dcache_wb_pou_checked(addr, size);
if (rv == 1) /* see dcache_wb_pou_checked() */
rv = icache_inv_pou_checked(addr, size);
if (rv != 1) {
if (!useracc((void *)addr, size, VM_PROT_READ)) {
/* Invalid access */
return (rv);
}
/* Valid but unmapped page - skip it. */
}
len -= size;
addr += size;
} while (len > 0);
/* Invalidate branch predictor buffer. */
bpb_inv_all();
return (1);
}
#endif
static int
arm32_sync_icache(struct thread *td, void *args)
{
struct arm_sync_icache_args ua;
int error;
ksiginfo_t ksi;
#if __ARM_ARCH >= 6
vm_offset_t rv;
#endif
if ((error = copyin(args, &ua, sizeof(ua))) != 0)
return (error);
if (ua.len == 0) {
td->td_retval[0] = 0;
return (0);
}
/*
* Validate arguments. Address and length are unsigned,
* so we can use wrapped overflow check.
*/
if (((ua.addr + ua.len) < ua.addr) ||
((ua.addr + ua.len) > VM_MAXUSER_ADDRESS)) {
ksiginfo_init_trap(&ksi);
ksi.ksi_signo = SIGSEGV;
ksi.ksi_code = SEGV_ACCERR;
ksi.ksi_addr = (void *)max(ua.addr, VM_MAXUSER_ADDRESS);
trapsignal(td, &ksi);
return (EINVAL);
}
#if __ARM_ARCH >= 6
rv = sync_icache(ua.addr, ua.len);
if (rv != 1) {
ksiginfo_init_trap(&ksi);
ksi.ksi_signo = SIGSEGV;
ksi.ksi_code = SEGV_MAPERR;
ksi.ksi_addr = (void *)rv;
trapsignal(td, &ksi);
return (EINVAL);
}
#else
cpu_icache_sync_range(ua.addr, ua.len);
#endif
td->td_retval[0] = 0;
return (0);
@ -85,7 +163,7 @@ arm32_set_tp(struct thread *td, void *args)
{
td->td_md.md_tp = (register_t)args;
#ifndef ARM_TP_ADDRESS
#if __ARM_ARCH >= 6
set_tls(args);
#else
*(register_t *)ARM_TP_ADDRESS = (register_t)args;
@ -97,7 +175,7 @@ static int
arm32_get_tp(struct thread *td, void *args)
{
#ifndef ARM_TP_ADDRESS
#if __ARM_ARCH >= 6
td->td_retval[0] = td->td_md.md_tp;
#else
td->td_retval[0] = *(register_t *)ARM_TP_ADDRESS;

View File

@ -67,6 +67,7 @@ __FBSDID("$FreeBSD$");
#endif
extern char fusubailout[];
extern char cachebailout[];
#ifdef DEBUG
int last_fault_code; /* For the benefit of pmap_fault_fixup() */
@ -133,7 +134,7 @@ static const struct abort aborts[] = {
{abort_align, "Alignment Fault"},
{abort_fatal, "Debug Event"},
{NULL, "Access Bit (L1)"},
{abort_icache, "Instruction cache maintenance"},
{NULL, "Instruction cache maintenance"},
{NULL, "Translation Fault (L1)"},
{NULL, "Access Bit (L2)"},
{NULL, "Translation Fault (L2)"},
@ -405,6 +406,24 @@ abort_handler(struct trapframe *tf, int prefetch)
goto out;
}
/*
* Don't pass faulting cache operation to vm_fault(). We don't want
* to handle all vm stuff at this moment.
*/
pcb = td->td_pcb;
if (__predict_false(pcb->pcb_onfault == cachebailout)) {
tf->tf_r0 = far; /* return failing address */
tf->tf_pc = (register_t)pcb->pcb_onfault;
return;
}
/* Handle remaining I cache aborts. */
if (idx == FAULT_ICACHE) {
if (abort_icache(tf, idx, fsr, far, prefetch, td, &ksig))
goto do_trapsignal;
goto out;
}
/*
* At this point, we're dealing with one of the following aborts:
*

View File

@ -199,7 +199,7 @@ vfp_bounce(u_int addr, u_int insn, struct trapframe *frame, int code)
*/
fmxr(fpexc, fpexc | VFPEXC_EN);
curpcb = curthread->td_pcb;
cpu = PCPU_GET(cpu);
cpu = PCPU_GET(cpuid);
if (curpcb->pcb_vfpcpu != cpu || curthread != PCPU_GET(fpcurthread)) {
vfp_restore(&curpcb->pcb_vfpstate);
curpcb->pcb_vfpcpu = cpu;

View File

@ -54,6 +54,8 @@ __FBSDID("$FreeBSD$");
#include <sys/sysctl.h>
#include <sys/sysent.h>
#include <sys/unistd.h>
#include <machine/acle-compat.h>
#include <machine/cpu.h>
#include <machine/frame.h>
#include <machine/pcb.h>
@ -143,10 +145,10 @@ cpu_fork(register struct thread *td1, register struct proc *p2,
/* Setup to release spin count in fork_exit(). */
td2->td_md.md_spinlock_count = 1;
td2->td_md.md_saved_cspr = PSR_SVC32_MODE;;
#ifdef ARM_TP_ADDRESS
td2->td_md.md_tp = *(register_t *)ARM_TP_ADDRESS;
#else
#if __ARM_ARCH >= 6
td2->td_md.md_tp = td1->td_md.md_tp;
#else
td2->td_md.md_tp = *(register_t *)ARM_TP_ADDRESS;
#endif
}
@ -273,10 +275,10 @@ cpu_set_user_tls(struct thread *td, void *tls_base)
td->td_md.md_tp = (register_t)tls_base;
if (td == curthread) {
critical_enter();
#ifdef ARM_TP_ADDRESS
*(register_t *)ARM_TP_ADDRESS = (register_t)tls_base;
#else
#if __ARM_ARCH >= 6
set_tls(tls_base);
#else
*(register_t *)ARM_TP_ADDRESS = (register_t)tls_base;
#endif
critical_exit();
}

View File

@ -427,6 +427,15 @@ bcm_spi_transfer(device_t dev, device_t child, struct spi_command *cmd)
KASSERT(cmd->tx_data_sz == cmd->rx_data_sz,
("TX/RX data sizes should be equal"));
/* Get the proper chip select for this child. */
spibus_get_cs(child, &cs);
if (cs < 0 || cs > 2) {
device_printf(dev,
"Invalid chip select %d requested by %s\n", cs,
device_get_nameunit(child));
return (EINVAL);
}
BCM_SPI_LOCK(sc);
/* If the controller is in use wait until it is available. */
@ -441,16 +450,6 @@ bcm_spi_transfer(device_t dev, device_t child, struct spi_command *cmd)
SPI_CS_CLEAR_RXFIFO | SPI_CS_CLEAR_TXFIFO,
SPI_CS_CLEAR_RXFIFO | SPI_CS_CLEAR_TXFIFO);
/* Get the proper chip select for this child. */
spibus_get_cs(child, &cs);
if (cs < 0 || cs > 2) {
device_printf(dev,
"Invalid chip select %d requested by %s\n", cs,
device_get_nameunit(child));
BCM_SPI_UNLOCK(sc);
return (EINVAL);
}
/* Save a pointer to the SPI command. */
sc->sc_cmd = cmd;
sc->sc_read = 0;
@ -471,8 +470,10 @@ bcm_spi_transfer(device_t dev, device_t child, struct spi_command *cmd)
/* Make sure the SPI engine and interrupts are disabled. */
bcm_spi_modifyreg(sc, SPI_CS, SPI_CS_TA | SPI_CS_INTR | SPI_CS_INTD, 0);
/* Clear the controller flags. */
/* Release the controller and wakeup the next thread waiting for it. */
sc->sc_flags = 0;
wakeup_one(dev);
BCM_SPI_UNLOCK(sc);
/*
* Check for transfer timeout. The SPI controller doesn't
@ -483,8 +484,6 @@ bcm_spi_transfer(device_t dev, device_t child, struct spi_command *cmd)
err = EIO;
}
BCM_SPI_UNLOCK(sc);
return (err);
}

View File

@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$");
#include <vm/vm.h>
#include <vm/vm_extern.h>
#include <vm/vm_kern.h>
#include <vm/pmap.h>
#include <dev/fdt/fdt_common.h>
#include <dev/ofw/openfirm.h>

View File

@ -42,12 +42,11 @@ struct vmspace;
#ifdef VFP
#define PCPU_MD_FIELDS \
unsigned int pc_cpu; \
unsigned int pc_vfpsid; \
unsigned int pc_vfpmvfr0; \
unsigned int pc_vfpmvfr1; \
struct pmap *pc_curpmap; \
char __pad[137]
char __pad[141]
#else
#define PCPU_MD_FIELDS \
char __pad[157]

View File

@ -84,13 +84,12 @@
#define VM_PHYSSEG_SPARSE
/*
* Create two free page pools. Since the ARM kernel virtual address
* Create one free page pool. Since the ARM kernel virtual address
* space does not include a mapping onto the machine's entire physical
* memory, VM_FREEPOOL_DIRECT is defined as an alias for the default
* pool, VM_FREEPOOL_DEFAULT.
*/
#define VM_NFREEPOOL 2
#define VM_FREEPOOL_CACHE 1
#define VM_NFREEPOOL 1
#define VM_FREEPOOL_DEFAULT 0
#define VM_FREEPOOL_DIRECT 0

View File

@ -27,7 +27,7 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
* TPS65217 PMIC companion chip for AM335x SoC sitting on I2C bus
* TI TPS65217 PMIC companion chip for AM335x SoC sitting on I2C bus
*/
#include <sys/param.h>
#include <sys/systm.h>
@ -50,30 +50,10 @@ __FBSDID("$FreeBSD$");
#include <dev/ofw/ofw_bus_subr.h>
#include <arm/ti/am335x/am335x_rtcvar.h>
#include <arm/ti/am335x/tps65217x.h>
#include "iicbus_if.h"
#define TPS65217A 0x7
#define TPS65217B 0xF
#define TPS65217C 0xE
#define TPS65217D 0x6
/* TPS65217 Reisters */
#define TPS65217_CHIPID_REG 0x00
#define TPS65217_INT_REG 0x02
#define TPS65217_INT_PBM (1U << 6)
#define TPS65217_INT_ACM (1U << 5)
#define TPS65217_INT_USBM (1U << 4)
#define TPS65217_INT_PBI (1U << 2)
#define TPS65217_INT_ACI (1U << 1)
#define TPS65217_INT_USBI (1U << 0)
#define TPS65217_STATUS_REG 0x0A
#define TPS65217_STATUS_OFF (1U << 7)
#define TPS65217_STATUS_ACPWR (1U << 3)
#define TPS65217_STATUS_USBPWR (1U << 2)
#define TPS65217_STATUS_BT (1U << 0)
#define MAX_IIC_DATA_SIZE 2
@ -85,6 +65,13 @@ struct am335x_pmic_softc {
void *sc_intrhand;
};
static const char *tps65217_voreg_c[4] = {"4.10V", "4.15V", "4.20V", "4.25V"};
static int am335x_pmic_bootverbose = 0;
TUNABLE_INT("hw.am335x_pmic.bootverbose", &am335x_pmic_bootverbose);
static char am335x_pmic_vo[6];
TUNABLE_STR("hw.am335x_pmic.vo", am335x_pmic_vo, sizeof(am335x_pmic_vo));
static void am335x_pmic_shutdown(void *, int);
static int
@ -120,18 +107,19 @@ static void
am335x_pmic_intr(void *arg)
{
struct am335x_pmic_softc *sc = (struct am335x_pmic_softc *)arg;
uint8_t int_reg, status_reg;
struct tps65217_status_reg status_reg;
struct tps65217_int_reg int_reg;
int rv;
char notify_buf[16];
THREAD_SLEEPING_OK();
rv = am335x_pmic_read(sc->sc_dev, TPS65217_INT_REG, &int_reg, 1);
rv = am335x_pmic_read(sc->sc_dev, TPS65217_INT_REG, (uint8_t *)&int_reg, 1);
if (rv != 0) {
device_printf(sc->sc_dev, "Cannot read interrupt register\n");
THREAD_NO_SLEEPING();
return;
}
rv = am335x_pmic_read(sc->sc_dev, TPS65217_STATUS_REG, &status_reg, 1);
rv = am335x_pmic_read(sc->sc_dev, TPS65217_STATUS_REG, (uint8_t *)&status_reg, 1);
if (rv != 0) {
device_printf(sc->sc_dev, "Cannot read status register\n");
THREAD_NO_SLEEPING();
@ -139,11 +127,11 @@ am335x_pmic_intr(void *arg)
}
THREAD_NO_SLEEPING();
if ((int_reg & TPS65217_INT_PBI) && (status_reg & TPS65217_STATUS_BT))
if (int_reg.pbi && status_reg.pb)
shutdown_nice(RB_POWEROFF);
if (int_reg & TPS65217_INT_ACI) {
if (int_reg.aci) {
snprintf(notify_buf, sizeof(notify_buf), "notify=0x%02x",
(status_reg & TPS65217_STATUS_ACPWR) ? 1 : 0);
status_reg.acpwr ? 1 : 0);
devctl_notify_f("ACPI", "ACAD", "power", notify_buf, M_NOWAIT);
}
}
@ -166,38 +154,121 @@ am335x_pmic_probe(device_t dev)
return (0);
}
static void
am335x_pmic_dump_chgconfig(device_t dev)
{
struct tps65217_chgconfig0_reg reg0;
struct tps65217_chgconfig1_reg reg1;
struct tps65217_chgconfig2_reg reg2;
struct tps65217_chgconfig3_reg reg3;
const char *e_d[] = {"enabled", "disabled"};
const char *d_e[] = {"disabled", "enabled"};
const char *i_a[] = {"inactive", "active"};
const char *f_t[] = {"false", "true"};
const char *timer_c[] = {"4h", "5h", "6h", "8h"};
const char *ntc_type_c[] = {"100k", "10k"};
const char *vprechg_c[] = {"2.9V", "2.5V"};
const char *trange_c[] = {"0-45 C", "0-60 C"};
const char *termif_c[] = {"2.5%", "7.5%", "15%", "18%"};
const char *pchrgt_c[] = {"30 min", "60 min"};
const char *dppmth_c[] = {"3.50V", "3.75V", "4.00V", "4.25V"};
const char *ichrg_c[] = {"300mA", "400mA", "500mA", "700mA"};
am335x_pmic_read(dev, TPS65217_CHGCONFIG0_REG, (uint8_t *)&reg0, 1);
device_printf(dev, " BAT TEMP/NTC ERROR: %s\n", f_t[reg0.battemp]);
device_printf(dev, " Pre-charge timer time-out: %s\n", f_t[reg0.pchgtout]);
device_printf(dev, " Charge timer time-out: %s\n", f_t[reg0.chgtout]);
device_printf(dev, " Charger active: %s\n", f_t[reg0.active]);
device_printf(dev, " Termination current detected: %s\n", f_t[reg0.termi]);
device_printf(dev, " Thermal suspend: %s\n", f_t[reg0.tsusp]);
device_printf(dev, " DPPM active: %s\n", f_t[reg0.dppm]);
device_printf(dev, " Thermal regulation: %s\n", i_a[reg0.treg]);
am335x_pmic_read(dev, TPS65217_CHGCONFIG1_REG, (uint8_t *)&reg1, 1);
device_printf(dev, " Charger: %s\n", d_e[reg1.chg_en]);
device_printf(dev, " Suspend charge: %s\n", i_a[reg1.susp]);
device_printf(dev, " Charge termination: %s\n", e_d[reg1.term]);
device_printf(dev, " Charger reset: %s\n", i_a[reg1.reset]);
device_printf(dev, " NTC TYPE: %s\n", ntc_type_c[reg1.ntc_type]);
device_printf(dev, " Safety timer: %s\n", d_e[reg1.tmr_en]);
device_printf(dev, " Charge safety timer: %s\n", timer_c[reg1.timer]);
am335x_pmic_read(dev, TPS65217_CHGCONFIG2_REG, (uint8_t *)&reg2, 1);
device_printf(dev, " Charge voltage: %s\n", tps65217_voreg_c[reg2.voreg]);
device_printf(dev, " Pre-charge to fast charge transition voltage: %s\n",
vprechg_c[reg2.vprechg]);
device_printf(dev, " Dynamic timer function: %s\n", d_e[reg2.dyntmr]);
am335x_pmic_read(dev, TPS65217_CHGCONFIG3_REG, (uint8_t *)&reg3, 1);
device_printf(dev, " Temperature range for charging: %s\n", trange_c[reg3.trange]);
device_printf(dev, " Termination current factor: %s\n", termif_c[reg3.termif]);
device_printf(dev, " Pre-charge time: %s\n", pchrgt_c[reg3.pchrgt]);
device_printf(dev, " Power path DPPM threshold: %s\n", dppmth_c[reg3.dppmth]);
device_printf(dev, " Charge current: %s\n", ichrg_c[reg3.ichrg]);
}
static void
am335x_pmic_setvo(device_t dev, uint8_t vo)
{
struct tps65217_chgconfig2_reg reg2;
am335x_pmic_read(dev, TPS65217_CHGCONFIG2_REG, (uint8_t *)&reg2, 1);
reg2.voreg = vo;
am335x_pmic_write(dev, TPS65217_CHGCONFIG2_REG, (uint8_t *)&reg2, 1);
}
static void
am335x_pmic_start(void *xdev)
{
struct am335x_pmic_softc *sc;
device_t dev = (device_t)xdev;
uint8_t reg;
struct tps65217_status_reg status_reg;
struct tps65217_chipid_reg chipid_reg;
uint8_t reg, vo;
char name[20];
char pwr[4][11] = {"Unknown", "USB", "AC", "USB and AC"};
char pwr[4][11] = {"Battery", "USB", "AC", "USB and AC"};
int rv;
sc = device_get_softc(dev);
am335x_pmic_read(dev, TPS65217_CHIPID_REG, &reg, 1);
switch (reg>>4) {
am335x_pmic_read(dev, TPS65217_CHIPID_REG, (uint8_t *)&chipid_reg, 1);
switch (chipid_reg.chip) {
case TPS65217A:
sprintf(name, "TPS65217A ver 1.%u", reg & 0xF);
sprintf(name, "TPS65217A ver 1.%u", chipid_reg.rev);
break;
case TPS65217B:
sprintf(name, "TPS65217B ver 1.%u", reg & 0xF);
sprintf(name, "TPS65217B ver 1.%u", chipid_reg.rev);
break;
case TPS65217C:
sprintf(name, "TPS65217C ver 1.%u", reg & 0xF);
sprintf(name, "TPS65217C ver 1.%u", chipid_reg.rev);
break;
case TPS65217D:
sprintf(name, "TPS65217D ver 1.%u", reg & 0xF);
sprintf(name, "TPS65217D ver 1.%u", chipid_reg.rev);
break;
default:
sprintf(name, "Unknown PMIC");
}
am335x_pmic_read(dev, TPS65217_STATUS_REG, &reg, 1);
device_printf(dev, "%s powered by %s\n", name, pwr[(reg>>2)&0x03]);
am335x_pmic_read(dev, TPS65217_STATUS_REG, (uint8_t *)&status_reg, 1);
device_printf(dev, "%s powered by %s\n", name,
pwr[status_reg.usbpwr | (status_reg.acpwr << 1)]);
if (am335x_pmic_vo[0] != '\0') {
for (vo = 0; vo < 4; vo++) {
if (strcmp(tps65217_voreg_c[vo], am335x_pmic_vo) == 0)
break;
}
if (vo == 4) {
device_printf(dev, "WARNING: hw.am335x_pmic.vo=\"%s\""
": unsupported value\n", am335x_pmic_vo);
} else {
am335x_pmic_setvo(dev, vo);
}
}
if (bootverbose || am335x_pmic_bootverbose) {
am335x_pmic_dump_chgconfig(dev);
}
EVENTHANDLER_REGISTER(shutdown_final, am335x_pmic_shutdown, dev,
SHUTDOWN_PRI_LAST);
@ -248,14 +319,15 @@ static void
am335x_pmic_shutdown(void *xdev, int howto)
{
device_t dev;
uint8_t reg;
struct tps65217_status_reg reg;
if (!(howto & RB_POWEROFF))
return;
dev = (device_t)xdev;
am335x_pmic_read(dev, TPS65217_STATUS_REG, (uint8_t *)&reg, 1);
/* Set the OFF bit on status register to start the shutdown sequence. */
reg = TPS65217_STATUS_OFF;
am335x_pmic_write(dev, TPS65217_STATUS_REG, &reg, 1);
reg.off = 1;
am335x_pmic_write(dev, TPS65217_STATUS_REG, (uint8_t *)&reg, 1);
/* Toggle pmic_pwr_enable to shutdown the PMIC. */
am335x_rtc_pmic_pwr_toggle();
}

View File

@ -0,0 +1,114 @@
/*-
* Copyright (c) 2012 Damjan Marion <dmarion@FreeBSD.org>
* Copyright (c) 2015 Maksym Sobolyev <sobomax@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*/
#ifndef __TPS65217X_H__
#define __TPS65217X_H__
/*
* TPS65217 PMIC is a companion chip for AM335x SoC sitting on I2C bus
*/
/* TPS65217 Reisters */
#define TPS65217_CHIPID_REG 0x00
struct tps65217_chipid_reg {
unsigned int rev:4;
unsigned int chip:4;
#define TPS65217A 0x7
#define TPS65217B 0xF
#define TPS65217C 0xE
#define TPS65217D 0x6
} __attribute__((__packed__));
#define TPS65217_INT_REG 0x02
struct tps65217_int_reg {
unsigned int usbi:1;
unsigned int aci:1;
unsigned int pbi:1;
unsigned int reserved3:1;
unsigned int usbm:1;
unsigned int acm:1;
unsigned int pbm:1;
unsigned int reserved7:1;
} __attribute__((__packed__));
#define TPS65217_STATUS_REG 0x0A
struct tps65217_status_reg {
unsigned int pb:1;
unsigned int reserved1:1;
unsigned int usbpwr:1;
unsigned int acpwr:1;
unsigned int reserved4:3;
unsigned int off:1;
} __attribute__((__packed__));
#define TPS65217_CHGCONFIG0_REG 0x03
struct tps65217_chgconfig0_reg {
unsigned int battemp:1;
unsigned int pchgtout:1;
unsigned int chgtout:1;
unsigned int active:1;
unsigned int termi:1;
unsigned int tsusp:1;
unsigned int dppm:1;
unsigned int treg:1;
} __attribute__((__packed__));
#define TPS65217_CHGCONFIG1_REG 0x04
struct tps65217_chgconfig1_reg {
unsigned int chg_en:1;
unsigned int susp:1;
unsigned int term:1;
unsigned int reset:1;
unsigned int ntc_type:1;
unsigned int tmr_en:1;
unsigned int timer:2;
} __attribute__((__packed__));
#define TPS65217_CHGCONFIG2_REG 0x05
struct tps65217_chgconfig2_reg {
unsigned int reserved:4;
unsigned int voreg:2;
#define TPS65217_VO_410V 0b00
#define TPS65217_VO_415V 0b01
#define TPS65217_VO_420V 0b10
#define TPS65217_VO_425V 0b11
unsigned int vprechg:1;
unsigned int dyntmr:1;
} __attribute__((__packed__));
#define TPS65217_CHGCONFIG3_REG 0x06
struct tps65217_chgconfig3_reg {
unsigned int trange:1;
unsigned int termif:2;
unsigned int pchrgt:1;
unsigned int dppmth:2;
unsigned int ichrg:2;
} __attribute__((__packed__));
#endif /* __TPS65217X_H__ */

View File

@ -33,6 +33,9 @@ __FBSDID("$FreeBSD$");
.text
.macro save_registers el
.if \el == 1
mov x18, sp
.endif
stp x28, x29, [sp, #-16]!
stp x26, x27, [sp, #-16]!
stp x24, x25, [sp, #-16]!
@ -51,22 +54,20 @@ __FBSDID("$FreeBSD$");
mrs x10, elr_el1
mrs x11, spsr_el1
.if \el == 0
mrs x12, sp_el0
.else
mov x12, sp
mrs x18, sp_el0
.endif
stp x10, x11, [sp, #-16]!
stp x12, lr, [sp, #-16]!
stp x18, lr, [sp, #-16]!
mrs x18, tpidr_el1
.endm
.macro restore_registers el
ldp x12, lr, [sp], #16
msr daifset, #2 /* Disable interrupts, x18 may change
* in the interrupt exception handler */
ldp x18, lr, [sp], #16
ldp x10, x11, [sp], #16
.if \el == 0
msr sp_el0, x12
.else
mov sp, x12
msr sp_el0, x18
.endif
msr spsr_el1, x11
msr elr_el1, x10
@ -89,6 +90,10 @@ __FBSDID("$FreeBSD$");
ldp x24, x25, [sp], #16
ldp x26, x27, [sp], #16
ldp x28, x29, [sp], #16
.if \el == 1
mov sp, x18
mrs x18, tpidr_el1
.endif
.endm
.macro do_ast

View File

@ -75,13 +75,12 @@
#define VM_PHYSSEG_MAX 64
/*
* Create three free page pools: VM_FREEPOOL_DEFAULT is the default pool
* Create two free page pools: VM_FREEPOOL_DEFAULT is the default pool
* from which physical pages are allocated and VM_FREEPOOL_DIRECT is
* the pool from which physical pages for small UMA objects are
* allocated.
*/
#define VM_NFREEPOOL 3
#define VM_FREEPOOL_CACHE 2
#define VM_NFREEPOOL 2
#define VM_FREEPOOL_DEFAULT 0
#define VM_FREEPOOL_DIRECT 1

View File

@ -1437,12 +1437,12 @@ also builtins
abort" Unable to load a kernel!"
;
: load_xen ( -- )
: load_xen ( -- flag )
s" xen_kernel" getenv dup -1 <> if
1 1 load
1 1 load ( c-addr/u flag N -- flag )
else
drop
0
0 ( -1 -- flag )
then
;

View File

@ -65,10 +65,11 @@ struct fs_ops *file_system[] = {
&host_fsops,
&ufs_fsops,
&cd9660_fsops,
&gzipfs_fsops,
#if defined(USERBOOT_ZFS_SUPPORT)
&zfs_fsops,
#endif
&gzipfs_fsops,
&bzipfs_fsops,
NULL
};

View File

@ -1255,6 +1255,10 @@ dnode_read(const spa_t *spa, const dnode_phys_t *dnode, off_t offset, void *buf,
ibn = bn >> ((nlevels - i - 1) * ibshift);
ibn &= ((1 << ibshift) - 1);
bp = indbp[ibn];
if (BP_IS_HOLE(&bp)) {
memset(dnode_cache_buf, 0, bsize);
break;
}
rc = zio_read(spa, &bp, dnode_cache_buf);
if (rc)
return (rc);

View File

@ -5011,9 +5011,9 @@ ctl_disable_lun(struct ctl_be_lun *be_lun)
lun->lun);
mtx_lock(&softc->ctl_lock);
if (retval != 0) {
printf("ctl_alloc_lun: FETD %s port %d returned error "
printf("%s: FETD %s port %d returned error "
"%d for lun_disable on target %ju lun %jd\n",
port->port_name, port->targ_port, retval,
__func__, port->port_name, port->targ_port, retval,
(uintmax_t)lun->target.id, (intmax_t)lun->lun);
}
}

View File

@ -1657,16 +1657,24 @@ ctlfe_onoffline(void *arg, int online)
* down to the SIM. Otherwise, record what the SIM
* has reported.
*/
if ((bus_softc->port.wwnn != 0)
&& (bus_softc->port.wwpn != 0)) {
if (bus_softc->port.wwnn != 0 && bus_softc->port.wwnn
!= ccb->knob.xport_specific.fc.wwnn) {
ccb->knob.xport_specific.fc.wwnn =
bus_softc->port.wwnn;
ccb->knob.xport_specific.fc.wwpn =
bus_softc->port.wwpn;
bus_softc->port.wwnn;
set_wwnn = 1;
} else {
ctl_port_set_wwns(&bus_softc->port,
true, ccb->knob.xport_specific.fc.wwnn,
false, 0);
}
if (bus_softc->port.wwpn != 0 && bus_softc->port.wwpn
!= ccb->knob.xport_specific.fc.wwpn) {
ccb->knob.xport_specific.fc.wwpn =
bus_softc->port.wwpn;
set_wwnn = 1;
} else {
ctl_port_set_wwns(&bus_softc->port,
false, 0,
true, ccb->knob.xport_specific.fc.wwpn);
}
#endif /* RANDOM_WWNN */

View File

@ -29,6 +29,8 @@
#ifndef _OPENSOLARIS_SYS_NVPAIR_H_
#define _OPENSOLARIS_SYS_NVPAIR_H_
#ifdef _KERNEL
/*
* Some of the symbols in the Illumos nvpair library conflict with symbols
* provided by nv(9), so we use this preprocessor hack to avoid the conflict.
@ -254,6 +256,8 @@
#define nvpair_unpack illumos_nvpair_unpack
#define nvpair_unpack_descriptor illumos_nvpair_unpack_descriptor
#endif /* _KERNEL */
#include_next <sys/nvpair.h>
#endif

View File

@ -1025,20 +1025,16 @@ linprocfs_doprocmaps(PFS_FILL_ARGS)
ino = 0;
if (lobj) {
off = IDX_TO_OFF(lobj->size);
if (lobj->type == OBJT_VNODE) {
vp = lobj->handle;
if (vp)
vref(vp);
}
else
vp = NULL;
vp = vm_object_vnode(lobj);
if (vp != NULL)
vref(vp);
if (lobj != obj)
VM_OBJECT_RUNLOCK(lobj);
flags = obj->flags;
ref_count = obj->ref_count;
shadow_count = obj->shadow_count;
VM_OBJECT_RUNLOCK(obj);
if (vp) {
if (vp != NULL) {
vn_fullpath(td, vp, &name, &freename);
vn_lock(vp, LK_SHARED | LK_RETRY);
VOP_GETATTR(vp, &vat, td->td_ucred);

View File

@ -219,6 +219,18 @@ void
linux_proc_exec(void *arg __unused, struct proc *p, struct image_params *imgp)
{
struct thread *td = curthread;
struct thread *othertd;
/*
* In a case of execing from linux binary properly detach
* other threads from the user space.
*/
if (__predict_false(SV_PROC_ABI(p) == SV_ABI_LINUX)) {
FOREACH_THREAD_IN_PROC(p, othertd) {
if (td != othertd)
(p->p_sysent->sv_thread_detach)(othertd);
}
}
/*
* In a case of execing to linux binary we create linux

View File

@ -787,6 +787,7 @@ linux_accept_common(struct thread *td, int s, l_uintptr_t addr,
/* XXX: */
bsd_args.name = (struct sockaddr * __restrict)PTRIN(addr);
bsd_args.anamelen = PTRIN(namelen);/* XXX */
bsd_args.flags = 0;
error = linux_set_socket_flags(flags, &bsd_args.flags);
if (error != 0)
return (error);

View File

@ -156,6 +156,7 @@ options GEOM_GATE # Userland services.
options GEOM_JOURNAL # Journaling.
options GEOM_LABEL # Providers labelization.
options GEOM_LINUX_LVM # Linux LVM2 volumes
options GEOM_MAP # Map based partitioning
options GEOM_MBR # DOS/MBR partitioning
options GEOM_MIRROR # Disk mirroring.
options GEOM_MULTIPATH # Disk multipath
@ -176,6 +177,7 @@ options GEOM_RAID3 # RAID3 functionality.
options GEOM_SHSEC # Shared secret.
options GEOM_STRIPE # Disk striping.
options GEOM_SUNLABEL # Sun/Solaris partitioning
options GEOM_UNCOMPRESS # Read-only compressed disks (lzma, zip)
options GEOM_UZIP # Read-only compressed disks
options GEOM_VINUM # Vinum logical volume manager
options GEOM_VIRSTOR # Virtual storage.
@ -2980,6 +2982,9 @@ options RANDOM_DEBUG # Debugging messages
# Module to enable execution of application via emulators like QEMU
options IMAGACT_BINMISC
# Intel em(4) driver
options EM_MULTIQUEUE # Activate multiqueue features/disable MSI-X
# zlib I/O stream support
# This enables support for compressed core dumps.
options GZIO

View File

@ -2561,6 +2561,7 @@ dev/usb/template/usb_template_msc.c optional usb_template
dev/usb/template/usb_template_mtp.c optional usb_template
dev/usb/template/usb_template_phone.c optional usb_template
dev/usb/template/usb_template_serialnet.c optional usb_template
dev/usb/template/usb_template_midi.c optional usb_template
#
# USB video drivers
#

View File

@ -108,6 +108,7 @@ GEOM_JOURNAL opt_geom.h
GEOM_LABEL opt_geom.h
GEOM_LABEL_GPT opt_geom.h
GEOM_LINUX_LVM opt_geom.h
GEOM_MAP opt_geom.h
GEOM_MBR opt_geom.h
GEOM_MIRROR opt_geom.h
GEOM_MULTIPATH opt_geom.h
@ -940,3 +941,6 @@ RCTL opt_global.h
RANDOM_YARROW opt_random.h
RANDOM_FORTUNA opt_random.h
RANDOM_DEBUG opt_random.h
# Intel em(4) driver
EM_MULTIQUEUE opt_em.h

View File

@ -43,6 +43,7 @@
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acuuid.h>
#define _COMPONENT ACPI_UTILITIES
ACPI_MODULE_NAME ("ahuuids")
@ -52,44 +53,36 @@
*/
const AH_UUID AcpiUuids[] =
{
{"PCI Host Bridge Device",
"33db4d5b-1ff7-401c-9657-7441c03dd766"},
{"[Controllers]", NULL},
{"GPIO Controller", UUID_GPIO_CONTROLLER},
{"USB Controller", UUID_USB_CONTROLLER},
{"SATA Controller", UUID_SATA_CONTROLLER},
{"Platform-wide Capabilities",
"0811b06e-4a27-44f9-8d60-3cbbc22e7b48"},
{"[Devices]", NULL},
{"PCI Host Bridge Device", UUID_PCI_HOST_BRIDGE},
{"HID I2C Device", UUID_I2C_DEVICE},
{"Power Button Device", UUID_POWER_BUTTON},
{"Dynamic Enumeration",
"d8c1a3a6-be9b-4c9b-91bf-c3cb81fc5daf"},
{"[Interfaces]", NULL},
{"Device Labeling Interface", UUID_DEVICE_LABELING},
{"Physical Presence Interface", UUID_PHYSICAL_PRESENCE},
{"GPIO Controller",
"4f248f40-d5e2-499f-834c-27758ea1cd3f"},
{"[Non-volatile DIMM and NFIT table]", NULL},
{"Volatile Memory Region", UUID_VOLATILE_MEMORY},
{"Persistent Memory Region", UUID_PERSISTENT_MEMORY},
{"NVDIMM Control Region", UUID_CONTROL_REGION},
{"NVDIMM Data Region", UUID_DATA_REGION},
{"Volatile Virtual Disk", UUID_VOLATILE_VIRTUAL_DISK},
{"Volatile Virtual CD", UUID_VOLATILE_VIRTUAL_CD},
{"Persistent Virtual Disk", UUID_PERSISTENT_VIRTUAL_DISK},
{"Persistent Virtual CD", UUID_PERSISTENT_VIRTUAL_CD},
{"Battery Thermal Limit",
"4c2067e3-887d-475c-9720-4af1d3ed602e"},
{"Thermal Extensions",
"14d399cd-7a27-4b18-8fb4-7cb7b9f4e500"},
{"USB Controller",
"ce2ee385-00e6-48cb-9f05-2edb927c4899"},
{"HID I2C Device",
"3cdff6f7-4267-4555-ad05-b30a3d8938de"},
{"Power Button Device",
"dfbcf3c5-e7a5-44e6-9c1f-29c76f6e059c"},
{"Device Labeling Interface",
"e5c937d0-3553-4d7a-9117-ea4d19c3434d"},
{"SATA Controller",
"e4db149b-fcfe-425b-a6d8-92357d78fc7f"},
{"Physical Presence Interface",
"3dddfaa6-361b-4eb4-a424-8d10089d1653"},
{"Device Properties for _DSD",
"daffd814-6eba-4d8c-8a91-bc9bbf4aa301"},
{"[Miscellaneous]", NULL},
{"Platform-wide Capabilities", UUID_PLATFORM_CAPABILITIES},
{"Dynamic Enumeration", UUID_DYNAMIC_ENUMERATION},
{"Battery Thermal Limit", UUID_BATTERY_THERMAL_LIMIT},
{"Thermal Extensions", UUID_THERMAL_EXTENSIONS},
{"Device Properties for _DSD", UUID_DEVICE_PROPERTIES},
{NULL, NULL}
};
@ -120,6 +113,13 @@ AcpiAhMatchUuid (
for (Info = AcpiUuids; Info->Description; Info++)
{
/* Null string means desciption is a UUID class */
if (!Info->String)
{
continue;
}
AcpiUtConvertStringToUuid (Info->String, UuidBuffer);
if (!ACPI_MEMCMP (Data, UuidBuffer, UUID_BUFFER_LENGTH))

View File

@ -50,15 +50,41 @@
* Note2: This file is standalone and should remain that way.
*/
/* NFIT/NVDIMM */
/* Controllers */
#define UUID_GPIO_CONTROLLER "4f248f40-d5e2-499f-834c-27758ea1cd3f"
#define UUID_USB_CONTROLLER "ce2ee385-00e6-48cb-9f05-2edb927c4899"
#define UUID_SATA_CONTROLLER "e4db149b-fcfe-425b-a6d8-92357d78fc7f"
/* Devices */
#define UUID_PCI_HOST_BRIDGE "33db4d5b-1ff7-401c-9657-7441c03dd766"
#define UUID_I2C_DEVICE "3cdff6f7-4267-4555-ad05-b30a3d8938de"
#define UUID_POWER_BUTTON "dfbcf3c5-e7a5-44e6-9c1f-29c76f6e059c"
/* Interfaces */
#define UUID_DEVICE_LABELING "e5c937d0-3553-4d7a-9117-ea4d19c3434d"
#define UUID_PHYSICAL_PRESENCE "3dddfaa6-361b-4eb4-a424-8d10089d1653"
/* NVDIMM - NFIT table */
#define UUID_VOLATILE_MEMORY "7305944f-fdda-44e3-b16c-3f22d252e5d0"
#define UUID_PERSISTENT_MEMORY "66f0d379-b4f3-4074-ac43-0d3318b78cdb"
#define UUID_CONTROL_REGION "92f701f6-13b4-405d-910b-299367e8234c"
#define UUID_DATA_REGION "91af0530-5d86-470e-a6b0-0a2db9408249"
#define UUID_VOLATILE_VIRTUAL_DISK "77ab535a-45fc-624b-5560-f7b281d1f96e"
#define UUID_VOLATILE_VIRTUAL_CD "3d5abd30-4175-87ce-6d64-d2ade523c4bb"
#define UUID_PERSISTENT_VIRTUAL_DISK "5cea02c9-4d07-69d3-269f-4496fbe096f9"
#define UUID_PERSISTENT_VIRTUAL_CD "08018188-42cd-bb48-100f-5387d53ded3d"
/* Miscellaneous */
#define UUID_PLATFORM_CAPABILITIES "0811b06e-4a27-44f9-8d60-3cbbc22e7b48"
#define UUID_DYNAMIC_ENUMERATION "d8c1a3a6-be9b-4c9b-91bf-c3cb81fc5daf"
#define UUID_BATTERY_THERMAL_LIMIT "4c2067e3-887d-475c-9720-4af1d3ed602e"
#define UUID_THERMAL_EXTENSIONS "14d399cd-7a27-4b18-8fb4-7cb7b9f4e500"
#define UUID_DEVICE_PROPERTIES "daffd814-6eba-4d8c-8a91-bc9bbf4aa301"
#define UUID_VOLATILE_MEMORY "4F940573-DAFD-E344-B16C-3F22D252E5D0"
#define UUID_PERSISTENT_MEMORY "79D3F066-F3B4-7440-AC43-0D3318B78CDB"
#define UUID_CONTROL_REGION "F601F792-B413-5D40-910B-299367E8234C"
#define UUID_DATA_REGION "3005AF91-865D-0E47-A6B0-0A2DB9408249"
#define UUID_VOLATILE_VIRTUAL_DISK "5A53AB77-FC45-4B62-5560-F7B281D1F96E"
#define UUID_VOLATILE_VIRTUAL_CD "30BD5A3D-7541-CE87-6D64-D2ADE523C4BB"
#define UUID_PERSISTENT_VIRTUAL_DISK "C902EA5C-074D-69D3-269F-4496FBE096F9"
#define UUID_PERSISTENT_VIRTUAL_CD "88810108-CD42-48BB-100F-5387D53DED3D"
#endif /* __AUUID_H__ */

View File

@ -578,7 +578,7 @@ enum ahci_err_type {
#define AHCI_Q_RESTORE_CAP 0x00080000
#define AHCI_Q_BIT_STRING \
"\021" \
"\020" \
"\001NOFORCE" \
"\002NOPMP" \
"\003NONCQ" \

View File

@ -93,6 +93,11 @@ ahd_compose_id(u_int device, u_int vendor, u_int subdevice, u_int subvendor)
#define ID_AIC7902_PCI_REV_A4 0x3
#define ID_AIC7902_PCI_REV_B0 0x10
#define SUBID_HP 0x0E11
#define DEVICE8081 0x8081
#define DEVICE8088 0x8088
#define DEVICE8089 0x8089
#define ADAPTECVENDORID 0x9005
#define SUBVENDOR9005 0x9005
#define DEVID_9005_HOSTRAID(id) ((id) & 0x80)
@ -292,6 +297,15 @@ ahd_find_pci_device(aic_dev_softc_t pci)
device = aic_pci_read_config(pci, PCIR_DEVICE, /*bytes*/2);
subvendor = aic_pci_read_config(pci, PCIR_SUBVEND_0, /*bytes*/2);
subdevice = aic_pci_read_config(pci, PCIR_SUBDEV_0, /*bytes*/2);
if ((vendor == ADAPTECVENDORID) && (subvendor == SUBVENDOR9005)) {
if ((device == DEVICE8081) || (device == DEVICE8088) ||
(device == DEVICE8089)) {
printf("Controller device ID conflict with PMC Adaptec HBA\n");
return (NULL);
}
}
full_id = ahd_compose_id(device,
vendor,
subdevice,

View File

@ -297,7 +297,7 @@ alloc_nm_rxq_hwq(struct port_info *pi, struct sge_nm_rxq *nm_rxq, int cong)
(fl_pad ? F_FW_IQ_CMD_FL0PADEN : 0) |
(black_hole == 2 ? F_FW_IQ_CMD_FL0PACKEN : 0));
c.fl0dcaen_to_fl0cidxfthresh =
htobe16(V_FW_IQ_CMD_FL0FBMIN(X_FETCHBURSTMIN_64B) |
htobe16(V_FW_IQ_CMD_FL0FBMIN(X_FETCHBURSTMIN_128B) |
V_FW_IQ_CMD_FL0FBMAX(X_FETCHBURSTMAX_512B));
c.fl0size = htobe16(na->num_rx_desc / 8 + spg_len / EQ_ESIZE);
c.fl0addr = htobe64(nm_rxq->fl_ba);

View File

@ -51,9 +51,7 @@ struct drm_file;
#include <sys/conf.h>
#include <sys/sglist.h>
#include <sys/stat.h>
#if __FreeBSD_version >= 700000
#include <sys/priv.h>
#endif
#include <sys/proc.h>
#include <sys/lock.h>
#include <sys/fcntl.h>
@ -94,11 +92,7 @@ struct drm_file;
#include <sys/mman.h>
#include <sys/rman.h>
#include <sys/memrange.h>
#if __FreeBSD_version >= 800004
#include <dev/agp/agpvar.h>
#else /* __FreeBSD_version >= 800004 */
#include <pci/agpvar.h>
#endif /* __FreeBSD_version >= 800004 */
#include <sys/agpio.h>
#include <sys/mutex.h>
#include <dev/pci/pcivar.h>
@ -227,11 +221,7 @@ enum {
#define PAGE_ALIGN(addr) round_page(addr)
/* DRM_SUSER returns true if the user is superuser */
#if __FreeBSD_version >= 700000
#define DRM_SUSER(p) (priv_check(p, PRIV_DRIVER) == 0)
#else
#define DRM_SUSER(p) (suser(p) == 0)
#endif
#define DRM_AGP_FIND_DEVICE() agp_find_device()
#define DRM_MTRR_WC MDF_WRITECOMBINE
#define jiffies ticks

View File

@ -38,50 +38,15 @@ __FBSDID("$FreeBSD$");
#include "dev/drm/drmP.h"
#if __FreeBSD_version >= 800004
#include <dev/agp/agpreg.h>
#else /* __FreeBSD_version >= 800004 */
#include <pci/agpreg.h>
#endif /* __FreeBSD_version >= 800004 */
#include <dev/pci/pcireg.h>
/* Returns 1 if AGP or 0 if not. */
static int
drm_device_find_capability(struct drm_device *dev, int cap)
{
#if __FreeBSD_version >= 602102
return (pci_find_cap(dev->device, cap, NULL) == 0);
#else
/* Code taken from agp.c. IWBNI that was a public interface. */
u_int32_t status;
u_int8_t ptr, next;
/*
* Check the CAP_LIST bit of the PCI status register first.
*/
status = pci_read_config(dev->device, PCIR_STATUS, 2);
if (!(status & 0x10))
return 0;
/*
* Traverse the capabilities list.
*/
for (ptr = pci_read_config(dev->device, AGP_CAPPTR, 1);
ptr != 0;
ptr = next) {
u_int32_t capid = pci_read_config(dev->device, ptr, 4);
next = AGP_CAPID_GET_NEXT_PTR(capid);
/*
* If this capability entry ID is cap, then we are done.
*/
if (AGP_CAPID_GET_CAP_ID(capid) == cap)
return 1;
}
return 0;
#endif
}
int drm_device_is_agp(struct drm_device *dev)

View File

@ -1066,15 +1066,9 @@ int drm_mapbufs(struct drm_device *dev, void *data, struct drm_file *file_priv)
}
vaddr = round_page((vm_offset_t)vms->vm_daddr + MAXDSIZ);
#if __FreeBSD_version >= 600023
retcode = vm_mmap(&vms->vm_map, &vaddr, size, PROT_READ | PROT_WRITE,
VM_PROT_ALL, MAP_SHARED | MAP_NOSYNC, OBJT_DEVICE,
retcode = vm_mmap(&vms->vm_map, &vaddr, size, VM_PROT_READ |
VM_PROT_WRITE, VM_PROT_ALL, MAP_SHARED | MAP_NOSYNC, OBJT_DEVICE,
dev->devnode, foff);
#else
retcode = vm_mmap(&vms->vm_map, &vaddr, size, PROT_READ | PROT_WRITE,
VM_PROT_ALL, MAP_SHARED | MAP_NOSYNC,
SLIST_FIRST(&dev->devnode->si_hlist), foff);
#endif
if (retcode)
goto done;

View File

@ -161,19 +161,8 @@ int drm_probe(device_t kdev, drm_pci_id_list_t *idlist)
{
drm_pci_id_list_t *id_entry;
int vendor, device;
#if __FreeBSD_version < 700010
device_t realdev;
if (!strcmp(device_get_name(kdev), "drmsub"))
realdev = device_get_parent(kdev);
else
realdev = kdev;
vendor = pci_get_vendor(realdev);
device = pci_get_device(realdev);
#else
vendor = pci_get_vendor(kdev);
device = pci_get_device(kdev);
#endif
if (pci_get_class(kdev) != PCIC_DISPLAY
|| pci_get_subclass(kdev) != PCIS_DISPLAY_VGA)
@ -200,14 +189,7 @@ int drm_attach(device_t kdev, drm_pci_id_list_t *idlist)
unit = device_get_unit(kdev);
dev = device_get_softc(kdev);
#if __FreeBSD_version < 700010
if (!strcmp(device_get_name(kdev), "drmsub"))
dev->device = device_get_parent(kdev);
else
dev->device = kdev;
#else
dev->device = kdev;
#endif
dev->devnode = make_dev(&drm_cdevsw,
0,
DRM_DEV_UID,
@ -216,11 +198,7 @@ int drm_attach(device_t kdev, drm_pci_id_list_t *idlist)
"dri/card%d", unit);
dev->devnode->si_drv1 = dev;
#if __FreeBSD_version >= 700053
dev->pci_domain = pci_get_domain(dev->device);
#else
dev->pci_domain = 0;
#endif
dev->pci_bus = pci_get_bus(dev->device);
dev->pci_slot = pci_get_slot(dev->device);
dev->pci_func = pci_get_function(dev->device);

View File

@ -175,15 +175,9 @@ int drm_irq_install(struct drm_device *dev)
DRM_UNLOCK();
/* Install handler */
#if __FreeBSD_version >= 700031
retcode = bus_setup_intr(dev->device, dev->irqr,
INTR_TYPE_TTY | INTR_MPSAFE,
NULL, drm_irq_handler_wrap, dev, &dev->irqh);
#else
retcode = bus_setup_intr(dev->device, dev->irqr,
INTR_TYPE_TTY | INTR_MPSAFE,
drm_irq_handler_wrap, dev, &dev->irqh);
#endif
if (retcode != 0)
goto err;

View File

@ -147,19 +147,11 @@ static device_method_t i915_methods[] = {
};
static driver_t i915_driver = {
#if __FreeBSD_version >= 700010
"drm",
#else
"drmsub",
#endif
i915_methods,
sizeof(struct drm_device)
};
extern devclass_t drm_devclass;
#if __FreeBSD_version >= 700010
DRIVER_MODULE(i915, vgapci, i915_driver, drm_devclass, 0, 0);
#else
DRIVER_MODULE(i915, agp, i915_driver, drm_devclass, 0, 0);
#endif
MODULE_DEPEND(i915, drm, 1, 1, 1);

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