MFhead@r323635

This commit is contained in:
Enji Cooper 2017-09-16 03:54:20 +00:00
commit 8fcbcc2d74
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/projects/runtime-coverage/; revision=323636
347 changed files with 50435 additions and 16673 deletions

View file

@ -38,6 +38,13 @@
# xargs -n1 | sort | uniq -d;
# done
# 20170913: remove unneeded catman utility
OLD_FILES+=etc/periodic/weekly/330.catman
OLD_FILES+=usr/bin/catman
OLD_FILES+=usr/libexec/catman.local
OLD_FILES+=usr/share/man/man1/catman.1.gz
OLD_FILES+=usr/share/man/man8/catman.local.8.gz
# 20170802: ksyms(4) ioctl interface was removed
OLD_FILES+=usr/include/sys/ksyms.h

View file

@ -51,6 +51,20 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW:
****************************** SPECIAL WARNING: ******************************
20170912:
The default serial number format for CTL LUNs has changed. This will
affect users who use /dev/diskid/* device nodes, or whose FibreChannel
or iSCSI clients care about their LUNs' serial numbers. Users who
require serial number stability should hardcode serial numbers in
/etc/ctl.conf .
20170912:
For 32-bit arm compiled for hard-float support, soft-floating point
binaries now always get their shared libraries from
LD_SOFT_LIBRARY_PATH (in the past, this was only used if
/usr/libsoft also existed). Only users with a hard-float ld.so, but
soft-float everything else should be affected.
20170826:
During boot the geli passphrase will be hidden. To restore previous
behavior see geli(8) configuration options.

View file

@ -28,9 +28,6 @@
#pragma D option quiet
inline int AF_INET = 2;
inline int AF_INET6 = 28;
in_addr_t *ip4a;
in_addr_t *ip4b;
in_addr_t *ip4c;

View file

@ -35,13 +35,13 @@ main(int argc, char **argv)
sigset_t ss;
(void) sigemptyset(&ss);
(void) sigaddset(&ss, SIGINT);
(void) sigaddset(&ss, SIGUSR1);
(void) sigprocmask(SIG_BLOCK, &ss, NULL);
do {
(void) getpid();
(void) sigpending(&ss);
} while (!sigismember(&ss, SIGINT));
} while (!sigismember(&ss, SIGUSR1));
return (0);
}

View file

@ -47,7 +47,7 @@ syscall::getpid:entry
/pid == $1/
{
trace("raised");
raise(SIGINT);
raise(SIGUSR1);
/*
* Wait no more than half a second for the process to die.
*/
@ -55,6 +55,7 @@ syscall::getpid:entry
}
syscall::exit:entry
/pid == $1/
{
exit(0);
}

View file

@ -45,7 +45,7 @@ main(int argc, char **argv)
sigemptyset(&sa.sa_mask);
sa.sa_flags = 0;
(void) sigaction(SIGINT, &sa, NULL);
(void) sigaction(SIGUSR1, &sa, NULL);
for (;;) {
(void) getpid();

View file

@ -47,7 +47,7 @@ syscall::getpid:return
/pid == $1/
{
trace("raised");
raise(SIGINT);
raise(SIGUSR1);
/*
* Wait no more than half a second for the process to die.
*/
@ -55,6 +55,7 @@ syscall::getpid:return
}
syscall::exit:entry
/pid == $1/
{
exit(0);
}

View file

@ -45,7 +45,7 @@ main(int argc, char **argv)
sigemptyset(&sa.sa_mask);
sa.sa_flags = 0;
(void) sigaction(SIGINT, &sa, NULL);
(void) sigaction(SIGUSR1, &sa, NULL);
for (;;) {
(void) getpid();

View file

@ -47,7 +47,7 @@ syscall::getpid:entry
/pid == $1/
{
trace("raised");
raise(SIGINT);
raise(SIGUSR1);
/*
* Wait no more than half a second for the process to die.
*/
@ -55,6 +55,7 @@ syscall::getpid:entry
}
syscall::exit:entry
/pid == $1/
{
exit(0);
}

View file

@ -19,14 +19,15 @@
.\" information: Portions Copyright [yyyy] [name of copyright owner]
.\"
.\" Copyright (c) 2010, Sun Microsystems, Inc. All Rights Reserved.
.\" Copyright 2011, Nexenta Systems, Inc. All Rights Reserved.
.\" Copyright (c) 2011, Justin T. Gibbs <gibbs@FreeBSD.org>
.\" Copyright (c) 2013 by Delphix. All Rights Reserved.
.\" Copyright (c) 2012, Glen Barber <gjb@FreeBSD.org>
.\" Copyright (c) 2013 by Delphix. All Rights Reserved.
.\" Copyright 2017 Nexenta Systems, Inc.
.\" Copyright (c) 2017 Datto Inc.
.\"
.\" $FreeBSD$
.\"
.Dd July 26, 2014
.Dd September 08, 2017
.Dt ZPOOL 8
.Os
.Sh NAME
@ -153,7 +154,7 @@
.Op Ar new_device
.Nm
.Cm scrub
.Op Fl s
.Op Fl s | Fl p
.Ar pool ...
.Nm
.Cm set
@ -1543,43 +1544,54 @@ manner.
.It Xo
.Nm
.Cm scrub
.Op Fl s
.Op Fl s | Fl p
.Ar pool ...
.Xc
.Pp
Begins a scrub. The scrub examines all data in the specified pools to verify
that it checksums correctly. For replicated (mirror or
.No raidz )
devices,
.Tn ZFS
automatically repairs any damage discovered during the scrub. The
.Qq Nm Cm status
Begins a scrub or resumes a paused scrub.
The scrub examines all data in the specified pools to verify that it checksums
correctly.
For replicated
.Pq mirror or raidz
devices, ZFS automatically repairs any damage discovered during the scrub.
The
.Nm zpool Cm status
command reports the progress of the scrub and summarizes the results of the
scrub upon completion.
.Pp
Scrubbing and resilvering are very similar operations. The difference is that
resilvering only examines data that
.Tn ZFS
knows to be out of date (for example, when attaching a new device to a mirror
or replacing an existing device), whereas scrubbing examines all data to
discover silent errors due to hardware faults or disk failure.
Scrubbing and resilvering are very similar operations.
The difference is that resilvering only examines data that ZFS knows to be out
of date
.Po
for example, when attaching a new device to a mirror or replacing an existing
device
.Pc ,
whereas scrubbing examines all data to discover silent errors due to hardware
faults or disk failure.
.Pp
Because scrubbing and resilvering are
.Tn I/O Ns -intensive
operations,
.Tn ZFS
only allows one at a time. If a scrub is already in progress, the
.Qq Nm Cm scrub
command returns an error. To start a new scrub, you have to stop the old scrub
with the
.Qq Nm Cm scrub Fl s
command first. If a resilver is in progress,
.Tn ZFS
does not allow a scrub to be started until the resilver completes.
.Bl -tag -width indent
Because scrubbing and resilvering are I/O-intensive operations, ZFS only allows
one at a time.
If a scrub is paused, the
.Nm zpool Cm scrub
resumes it.
If a resilver is in progress, ZFS does not allow a scrub to be started until the
resilver completes.
.Bl -tag -width Ds
.It Fl s
Stop scrubbing.
.El
.Bl -tag -width Ds
.It Fl p
Pause scrubbing.
Scrub pause state and progress are periodically synced to disk.
If the system is restarted or pool is exported during a paused scrub,
even after import, scrub will remain paused until it is resumed.
Once resumed the scrub will pick up from the place where it was last
checkpointed to disk.
To resume a paused scrub issue
.Nm zpool Cm scrub
again.
.El
.It Xo
.Nm
.Cm set

View file

@ -27,6 +27,7 @@
* Copyright (c) 2013 by Prasad Joshi (sTec). All rights reserved.
* Copyright 2016 Igor Kozhukhov <ikozhukhov@gmail.com>.
* Copyright 2016 Nexenta Systems, Inc.
* Copyright (c) 2017 Datto Inc.
*/
#include <solaris.h>
@ -252,7 +253,7 @@ get_usage(zpool_help_t idx)
case HELP_REOPEN:
return (gettext("\treopen <pool>\n"));
case HELP_SCRUB:
return (gettext("\tscrub [-s] <pool> ...\n"));
return (gettext("\tscrub [-s | -p] <pool> ...\n"));
case HELP_STATUS:
return (gettext("\tstatus [-vx] [-T d|u] [pool] ... [interval "
"[count]]\n"));
@ -3825,6 +3826,7 @@ typedef struct scrub_cbdata {
int cb_type;
int cb_argc;
char **cb_argv;
pool_scrub_cmd_t cb_scrub_cmd;
} scrub_cbdata_t;
int
@ -3842,15 +3844,16 @@ scrub_callback(zpool_handle_t *zhp, void *data)
return (1);
}
err = zpool_scan(zhp, cb->cb_type);
err = zpool_scan(zhp, cb->cb_type, cb->cb_scrub_cmd);
return (err != 0);
}
/*
* zpool scrub [-s] <pool> ...
* zpool scrub [-s | -p] <pool> ...
*
* -s Stop. Stops any in-progress scrub.
* -p Pause. Pause in-progress scrub.
*/
int
zpool_do_scrub(int argc, char **argv)
@ -3859,13 +3862,17 @@ zpool_do_scrub(int argc, char **argv)
scrub_cbdata_t cb;
cb.cb_type = POOL_SCAN_SCRUB;
cb.cb_scrub_cmd = POOL_SCRUB_NORMAL;
/* check options */
while ((c = getopt(argc, argv, "s")) != -1) {
while ((c = getopt(argc, argv, "sp")) != -1) {
switch (c) {
case 's':
cb.cb_type = POOL_SCAN_NONE;
break;
case 'p':
cb.cb_scrub_cmd = POOL_SCRUB_PAUSE;
break;
case '?':
(void) fprintf(stderr, gettext("invalid option '%c'\n"),
optopt);
@ -3873,6 +3880,13 @@ zpool_do_scrub(int argc, char **argv)
}
}
if (cb.cb_type == POOL_SCAN_NONE &&
cb.cb_scrub_cmd == POOL_SCRUB_PAUSE) {
(void) fprintf(stderr, gettext("invalid option combination: "
"-s and -p are mutually exclusive\n"));
usage(B_FALSE);
}
cb.cb_argc = argc;
cb.cb_argv = argv;
argc -= optind;
@ -3901,7 +3915,7 @@ typedef struct status_cbdata {
void
print_scan_status(pool_scan_stat_t *ps)
{
time_t start, end;
time_t start, end, pause;
uint64_t elapsed, mins_left, hours_left;
uint64_t pass_exam, examined, total;
uint_t rate;
@ -3919,6 +3933,7 @@ print_scan_status(pool_scan_stat_t *ps)
start = ps->pss_start_time;
end = ps->pss_end_time;
pause = ps->pss_pass_scrub_pause;
zfs_nicenum(ps->pss_processed, processed_buf, sizeof (processed_buf));
assert(ps->pss_func == POOL_SCAN_SCRUB ||
@ -3961,8 +3976,17 @@ print_scan_status(pool_scan_stat_t *ps)
* Scan is in progress.
*/
if (ps->pss_func == POOL_SCAN_SCRUB) {
(void) printf(gettext("scrub in progress since %s"),
ctime(&start));
if (pause == 0) {
(void) printf(gettext("scrub in progress since %s"),
ctime(&start));
} else {
char buf[32];
struct tm *p = localtime(&pause);
(void) strftime(buf, sizeof (buf), "%a %b %e %T %Y", p);
(void) printf(gettext("scrub paused since %s\n"), buf);
(void) printf(gettext("\tscrub started on %s"),
ctime(&start));
}
} else if (ps->pss_func == POOL_SCAN_RESILVER) {
(void) printf(gettext("resilver in progress since %s"),
ctime(&start));
@ -3974,6 +3998,7 @@ print_scan_status(pool_scan_stat_t *ps)
/* elapsed time for this pass */
elapsed = time(NULL) - ps->pss_pass_start;
elapsed -= ps->pss_pass_scrub_spent_paused;
elapsed = elapsed ? elapsed : 1;
pass_exam = ps->pss_pass_exam ? ps->pss_pass_exam : 1;
rate = pass_exam / elapsed;
@ -3983,19 +4008,25 @@ print_scan_status(pool_scan_stat_t *ps)
zfs_nicenum(examined, examined_buf, sizeof (examined_buf));
zfs_nicenum(total, total_buf, sizeof (total_buf));
zfs_nicenum(rate, rate_buf, sizeof (rate_buf));
/*
* do not print estimated time if hours_left is more than 30 days
* or we have a paused scrub
*/
(void) printf(gettext(" %s scanned out of %s at %s/s"),
examined_buf, total_buf, rate_buf);
if (hours_left < (30 * 24)) {
(void) printf(gettext(", %lluh%um to go\n"),
(u_longlong_t)hours_left, (uint_t)(mins_left % 60));
if (pause == 0) {
zfs_nicenum(rate, rate_buf, sizeof (rate_buf));
(void) printf(gettext("\t%s scanned out of %s at %s/s"),
examined_buf, total_buf, rate_buf);
if (hours_left < (30 * 24)) {
(void) printf(gettext(", %lluh%um to go\n"),
(u_longlong_t)hours_left, (uint_t)(mins_left % 60));
} else {
(void) printf(gettext(
", (scan is slow, no estimated time)\n"));
}
} else {
(void) printf(gettext(
", (scan is slow, no estimated time)\n"));
(void) printf(gettext("\t%s scanned out of %s\n"),
examined_buf, total_buf);
}
if (ps->pss_func == POOL_SCAN_RESILVER) {

View file

@ -1109,7 +1109,7 @@ dt_vopen(int version, int flags, int *errp,
*/
if (err == ENOENT && modfind("dtraceall") < 0) {
kldload("dtraceall"); /* ignore the error */
dtfd = open("/dev/dtrace/dtrace", O_RDWR);
dtfd = open("/dev/dtrace/dtrace", O_RDWR | O_CLOEXEC);
err = errno;
}
#endif

View file

@ -28,6 +28,7 @@
* Copyright (c) 2013 Steven Hartland. All rights reserved.
* Copyright (c) 2014 Integros [integros.com]
* Copyright 2016 Nexenta Systems, Inc.
* Copyright (c) 2017 Datto Inc.
*/
#ifndef _LIBZFS_H
@ -129,6 +130,7 @@ typedef enum zfs_error {
EZFS_DIFF, /* general failure of zfs diff */
EZFS_DIFFDATA, /* bad zfs diff data */
EZFS_POOLREADONLY, /* pool is in read-only mode */
EZFS_SCRUB_PAUSED, /* scrub currently paused */
EZFS_UNKNOWN
} zfs_error_t;
@ -241,7 +243,7 @@ typedef struct splitflags {
/*
* Functions to manipulate pool and vdev state
*/
extern int zpool_scan(zpool_handle_t *, pool_scan_func_t);
extern int zpool_scan(zpool_handle_t *, pool_scan_func_t, pool_scrub_cmd_t);
extern int zpool_clear(zpool_handle_t *, const char *, nvlist_t *);
extern int zpool_reguid(zpool_handle_t *);
extern int zpool_reopen(zpool_handle_t *);

View file

@ -20,9 +20,11 @@
*/
/*
* Copyright 2015 Nexenta Systems, Inc. All rights reserved.
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014 by Delphix. All rights reserved.
* Copyright 2016 Igor Kozhukhov <ikozhukhov@gmail.com>
* Copyright 2017 RackTop Systems.
*/
/*
@ -87,7 +89,7 @@ zfs_share_type_t zfs_is_shared_proto(zfs_handle_t *, char **,
zfs_share_proto_t);
/*
* The share protocols table must be in the same order as the zfs_share_prot_t
* The share protocols table must be in the same order as the zfs_share_proto_t
* enum in libzfs_impl.h
*/
typedef struct {
@ -872,7 +874,7 @@ unshare_one(libzfs_handle_t *hdl, const char *name, const char *mountpoint,
/* make sure libshare initialized */
if ((err = zfs_init_libshare(hdl, SA_INIT_SHARE_API)) != SA_OK) {
free(mntpt); /* don't need the copy anymore */
return (zfs_error_fmt(hdl, EZFS_SHARENFSFAILED,
return (zfs_error_fmt(hdl, proto_table[proto].p_unshare_err,
dgettext(TEXT_DOMAIN, "cannot unshare '%s': %s"),
name, _sa_errorstr(err)));
}
@ -883,12 +885,13 @@ unshare_one(libzfs_handle_t *hdl, const char *name, const char *mountpoint,
if (share != NULL) {
err = zfs_sa_disable_share(share, proto_table[proto].p_name);
if (err != SA_OK) {
return (zfs_error_fmt(hdl, EZFS_UNSHARENFSFAILED,
return (zfs_error_fmt(hdl,
proto_table[proto].p_unshare_err,
dgettext(TEXT_DOMAIN, "cannot unshare '%s': %s"),
name, _sa_errorstr(err)));
}
} else {
return (zfs_error_fmt(hdl, EZFS_UNSHARENFSFAILED,
return (zfs_error_fmt(hdl, proto_table[proto].p_unshare_err,
dgettext(TEXT_DOMAIN, "cannot unshare '%s': not found"),
name));
}

View file

@ -25,6 +25,7 @@
* Copyright (c) 2013, Joyent, Inc. All rights reserved.
* Copyright 2016 Nexenta Systems, Inc.
* Copyright 2016 Igor Kozhukhov <ikozhukhov@gmail.com>
* Copyright (c) 2017 Datto Inc.
*/
#include <sys/types.h>
@ -1841,22 +1842,39 @@ zpool_import_props(libzfs_handle_t *hdl, nvlist_t *config, const char *newname,
* Scan the pool.
*/
int
zpool_scan(zpool_handle_t *zhp, pool_scan_func_t func)
zpool_scan(zpool_handle_t *zhp, pool_scan_func_t func, pool_scrub_cmd_t cmd)
{
zfs_cmd_t zc = { 0 };
char msg[1024];
int err;
libzfs_handle_t *hdl = zhp->zpool_hdl;
(void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
zc.zc_cookie = func;
zc.zc_flags = cmd;
if (zfs_ioctl(hdl, ZFS_IOC_POOL_SCAN, &zc) == 0 ||
(errno == ENOENT && func != POOL_SCAN_NONE))
if (zfs_ioctl(hdl, ZFS_IOC_POOL_SCAN, &zc) == 0)
return (0);
err = errno;
/* ECANCELED on a scrub means we resumed a paused scrub */
if (err == ECANCELED && func == POOL_SCAN_SCRUB &&
cmd == POOL_SCRUB_NORMAL)
return (0);
if (err == ENOENT && func != POOL_SCAN_NONE && cmd == POOL_SCRUB_NORMAL)
return (0);
if (func == POOL_SCAN_SCRUB) {
(void) snprintf(msg, sizeof (msg),
dgettext(TEXT_DOMAIN, "cannot scrub %s"), zc.zc_name);
if (cmd == POOL_SCRUB_PAUSE) {
(void) snprintf(msg, sizeof (msg), dgettext(TEXT_DOMAIN,
"cannot pause scrubbing %s"), zc.zc_name);
} else {
assert(cmd == POOL_SCRUB_NORMAL);
(void) snprintf(msg, sizeof (msg), dgettext(TEXT_DOMAIN,
"cannot scrub %s"), zc.zc_name);
}
} else if (func == POOL_SCAN_NONE) {
(void) snprintf(msg, sizeof (msg),
dgettext(TEXT_DOMAIN, "cannot cancel scrubbing %s"),
@ -1865,7 +1883,7 @@ zpool_scan(zpool_handle_t *zhp, pool_scan_func_t func)
assert(!"unexpected result");
}
if (errno == EBUSY) {
if (err == EBUSY) {
nvlist_t *nvroot;
pool_scan_stat_t *ps = NULL;
uint_t psc;
@ -1874,14 +1892,18 @@ zpool_scan(zpool_handle_t *zhp, pool_scan_func_t func)
ZPOOL_CONFIG_VDEV_TREE, &nvroot) == 0);
(void) nvlist_lookup_uint64_array(nvroot,
ZPOOL_CONFIG_SCAN_STATS, (uint64_t **)&ps, &psc);
if (ps && ps->pss_func == POOL_SCAN_SCRUB)
return (zfs_error(hdl, EZFS_SCRUBBING, msg));
else
if (ps && ps->pss_func == POOL_SCAN_SCRUB) {
if (cmd == POOL_SCRUB_PAUSE)
return (zfs_error(hdl, EZFS_SCRUB_PAUSED, msg));
else
return (zfs_error(hdl, EZFS_SCRUBBING, msg));
} else {
return (zfs_error(hdl, EZFS_RESILVERING, msg));
} else if (errno == ENOENT) {
}
} else if (err == ENOENT) {
return (zfs_error(hdl, EZFS_NO_SCRUB, msg));
} else {
return (zpool_standard_error(hdl, errno, msg));
return (zpool_standard_error(hdl, err, msg));
}
}

View file

@ -24,6 +24,7 @@
* Copyright (c) 2013, Joyent, Inc. All rights reserved.
* Copyright (c) 2011, 2015 by Delphix. All rights reserved.
* Copyright 2016 Igor Kozhukhov <ikozhukhov@gmail.com>
* Copyright (c) 2017 Datto Inc.
*/
/*
@ -224,6 +225,9 @@ libzfs_error_description(libzfs_handle_t *hdl)
case EZFS_POSTSPLIT_ONLINE:
return (dgettext(TEXT_DOMAIN, "disk was split from this pool "
"into a new one"));
case EZFS_SCRUB_PAUSED:
return (dgettext(TEXT_DOMAIN, "scrub is paused; "
"use 'zpool scrub' to resume"));
case EZFS_SCRUBBING:
return (dgettext(TEXT_DOMAIN, "currently scrubbing; "
"use 'zpool scrub -s' to cancel current scrub"));

View file

@ -735,11 +735,9 @@ static char ce_suffix[CE_IGNORE][2] = { "", "\n", "\n", "" };
void
vpanic(const char *fmt, va_list adx)
{
(void) fprintf(stderr, "error: ");
(void) vfprintf(stderr, fmt, adx);
(void) fprintf(stderr, "\n");
abort(); /* think of it as a "user-level crash dump" */
char buf[512];
(void) vsnprintf(buf, 512, fmt, adx);
assfail(buf, NULL, 0);
}
void

View file

@ -26,7 +26,7 @@ ATOMIC_SRCS= opensolaris_atomic.c
LIB= zpool
ZFS_COMMON_SRCS= ${ZFS_COMMON_OBJS:C/.o$/.c/} vdev_file.c trim_map.c
ZFS_COMMON_SRCS= ${ZFS_COMMON_OBJS:C/.o$/.c/} trim_map.c
ZFS_SHARED_SRCS= ${ZFS_SHARED_OBJS:C/.o$/.c/}
KERNEL_SRCS= kernel.c taskq.c util.c
LIST_SRCS= list.c

View file

@ -1141,7 +1141,9 @@ note_type_freebsd_core(unsigned int nt)
case 14: return "NT_PROCSTAT_OSREL";
case 15: return "NT_PROCSTAT_PSSTRINGS";
case 16: return "NT_PROCSTAT_AUXV";
case 17: return "NT_PTLWPINFO";
case 0x202: return "NT_X86_XSTATE (x86 XSAVE extended state)";
case 0x400: return "NT_ARM_VFP (arm VFP registers)";
default: return (note_type_unknown(nt));
}
}
@ -2693,6 +2695,9 @@ dump_arch_dyn_val(struct readelf *re, GElf_Dyn *dyn)
case DT_MIPS_TIME_STAMP:
printf(" %s\n", timestamp(dyn->d_un.d_val));
break;
default:
printf("\n");
break;
}
break;
default:

View file

@ -126,6 +126,12 @@ extern Cell *rlengthloc; /* RLENGTH */
#define FTOUPPER 12
#define FTOLOWER 13
#define FFLUSH 14
#define FAND 15
#define FFOR 16
#define FXOR 17
#define FCOMPL 18
#define FLSHIFT 19
#define FRSHIFT 20
/* Node: parse tree is made of nodes, with Cell's at bottom */

View file

@ -47,9 +47,11 @@ Keyword keywords[] ={ /* keep sorted: binary searched */
{ "BEGIN", XBEGIN, XBEGIN },
{ "END", XEND, XEND },
{ "NF", VARNF, VARNF },
{ "and", FAND, BLTIN },
{ "atan2", FATAN, BLTIN },
{ "break", BREAK, BREAK },
{ "close", CLOSE, CLOSE },
{ "compl", FCOMPL, BLTIN },
{ "continue", CONTINUE, CONTINUE },
{ "cos", FCOS, BLTIN },
{ "delete", DELETE, DELETE },
@ -69,13 +71,16 @@ Keyword keywords[] ={ /* keep sorted: binary searched */
{ "int", FINT, BLTIN },
{ "length", FLENGTH, BLTIN },
{ "log", FLOG, BLTIN },
{ "lshift", FLSHIFT, BLTIN },
{ "match", MATCHFCN, MATCHFCN },
{ "next", NEXT, NEXT },
{ "nextfile", NEXTFILE, NEXTFILE },
{ "or", FFOR, BLTIN },
{ "print", PRINT, PRINT },
{ "printf", PRINTF, PRINTF },
{ "rand", FRAND, BLTIN },
{ "return", RETURN, RETURN },
{ "rshift", FRSHIFT, BLTIN },
{ "sin", FSIN, BLTIN },
{ "split", SPLIT, SPLIT },
{ "sprintf", SPRINTF, SPRINTF },
@ -87,6 +92,7 @@ Keyword keywords[] ={ /* keep sorted: binary searched */
{ "tolower", FTOLOWER, BLTIN },
{ "toupper", FTOUPPER, BLTIN },
{ "while", WHILE, WHILE },
{ "xor", FXOR, BLTIN },
};
#define RET(x) { if(dbg)printf("lex %s\n", tokname(x)); return(x); }

View file

@ -1476,7 +1476,7 @@ Cell *bltin(Node **a, int n) /* builtin functions. a[0] is type, a[1] is arg lis
{
Cell *x, *y;
Awkfloat u;
int t;
int t, i;
Awkfloat tmp;
char *p, *buf;
Node *nextarg;
@ -1516,6 +1516,76 @@ Cell *bltin(Node **a, int n) /* builtin functions. a[0] is type, a[1] is arg lis
nextarg = nextarg->nnext;
}
break;
case FCOMPL:
u = ~((int)getfval(x));
break;
case FAND:
if (nextarg == NULL) {
WARNING("and requires two arguments; returning 0");
u = 0;
break;
}
i = ((int)getfval(x));
while (nextarg != NULL) {
y = execute(nextarg);
i &= (int)getfval(y);
tempfree(y);
nextarg = nextarg->nnext;
}
u = i;
break;
case FFOR:
if (nextarg == NULL) {
WARNING("or requires two arguments; returning 0");
u = 0;
break;
}
i = ((int)getfval(x));
while (nextarg != NULL) {
y = execute(nextarg);
i |= (int)getfval(y);
tempfree(y);
nextarg = nextarg->nnext;
}
u = i;
break;
case FXOR:
if (nextarg == NULL) {
WARNING("xor requires two arguments; returning 0");
u = 0;
break;
}
i = ((int)getfval(x));
while (nextarg != NULL) {
y = execute(nextarg);
i ^= (int)getfval(y);
tempfree(y);
nextarg = nextarg->nnext;
}
u = i;
break;
case FLSHIFT:
if (nextarg == NULL) {
WARNING("lshift requires two arguments; returning 0");
u = 0;
break;
}
y = execute(a[1]->nnext);
u = ((int)getfval(x)) << ((int)getfval(y));
tempfree(y);
nextarg = nextarg->nnext;
break;
case FRSHIFT:
if (nextarg == NULL) {
WARNING("rshift requires two arguments; returning 0");
u = 0;
break;
}
y = execute(a[1]->nnext);
u = ((int)getfval(x)) >> ((int)getfval(y));
tempfree(y);
nextarg = nextarg->nnext;
break;
case FSYSTEM:
fflush(stdout); /* in case something is buffered already */
u = (Awkfloat) system(getsval(x)) / 256; /* 256 is unix-dep */

View file

@ -494,7 +494,7 @@ int ZEXPORT deflateResetKeep (strm)
s->wrap == 2 ? crc32(0L, Z_NULL, 0) :
#endif
adler32(0L, Z_NULL, 0);
s->last_flush = Z_NO_FLUSH;
s->last_flush = -2;
_tr_init(s);
@ -587,12 +587,12 @@ int ZEXPORT deflateParams(strm, level, strategy)
func = configuration_table[s->level].func;
if ((strategy != s->strategy || func != configuration_table[level].func) &&
s->high_water) {
s->last_flush != -2) {
/* Flush the last buffer: */
int err = deflate(strm, Z_BLOCK);
if (err == Z_STREAM_ERROR)
return err;
if (strm->avail_out == 0)
if (strm->avail_in || (s->strstart - s->block_start) + s->lookahead)
return Z_BUF_ERROR;
}
if (s->level != level) {

View file

@ -712,11 +712,12 @@ ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
used to switch between compression and straight copy of the input data, or
to switch to a different kind of input data requiring a different strategy.
If the compression approach (which is a function of the level) or the
strategy is changed, and if any input has been consumed in a previous
deflate() call, then the input available so far is compressed with the old
level and strategy using deflate(strm, Z_BLOCK). There are three approaches
for the compression levels 0, 1..3, and 4..9 respectively. The new level
and strategy will take effect at the next call of deflate().
strategy is changed, and if there have been any deflate() calls since the
state was initialized or reset, then the input available so far is
compressed with the old level and strategy using deflate(strm, Z_BLOCK).
There are three approaches for the compression levels 0, 1..3, and 4..9
respectively. The new level and strategy will take effect at the next call
of deflate().
If a deflate(strm, Z_BLOCK) is performed by deflateParams(), and it does
not have enough output space to complete, then the parameter change will not

View file

@ -181,9 +181,6 @@ weekly_locate_enable="YES" # Update locate weekly
# 320.whatis
weekly_whatis_enable="YES" # Update whatis weekly
# 330.catman
weekly_catman_enable="NO" # Preformat man pages
# 340.noid
weekly_noid_enable="NO" # Find unowned files
weekly_noid_dirs="/" # Look here

View file

@ -1,58 +0,0 @@
#!/bin/sh -
#
# $FreeBSD$
#
# If there is a global system configuration file, suck it in.
#
if [ -r /etc/defaults/periodic.conf ]
then
. /etc/defaults/periodic.conf
source_periodic_confs
fi
case "$weekly_catman_enable" in
[Yy][Ee][Ss])
if [ ! -d /usr/share/man/cat1 ]
then
echo '$weekly_catman_enable is set but /usr/share/man/cat1' \
"doesn't exist"
rc=2
else
echo ""
echo "Reformatting manual pages:"
MANPATH=`/usr/bin/manpath -q`
if [ $? = 0 ]
then
if [ -z "${MANPATH}" ]
then
echo "manpath failed to find any manpath directories"
rc=3
else
man_locales=`/usr/bin/manpath -qL`
rc=0
# Preformat original, non-localized manpages
echo /usr/libexec/catman.local -r "$MANPATH" |
su -fm man || rc=3
# Preformat localized manpages.
if [ -n "$man_locales" ]
then
for i in $man_locales
do
echo /usr/libexec/catman.local -Lr \
"$MANPATH" | LC_ALL=$i su -fm man || rc=3
done
fi
fi
else
rc=3
fi
fi;;
*) rc=0;;
esac
exit $rc

View file

@ -13,7 +13,7 @@ FILES+= 310.locate
.endif
.if ${MK_MAN_UTILS} != "no"
FILES+= 320.whatis 330.catman
FILES+= 320.whatis
.endif
.include <bsd.prog.mk>

View file

@ -9,7 +9,6 @@ DEFAULT_VECTOR= bfd_elf64_x86_64_freebsd_vec
SRCS+= elf64-x86-64.c \
efi-app-x86_64.c \
efi-app-ia32.c \
elf64.c \
elf64-gen.c \
elf64-target.h \

View file

@ -18,7 +18,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd December 21, 2015
.Dd September 13, 2017
.Dt GETADDRINFO 3
.Os
.Sh NAME
@ -351,6 +351,17 @@ pointer should be a
.Li addrinfo
structure created by a call to
.Fn getaddrinfo .
.Sh IMPLEMENTATION NOTES
The behavior of
.Li freeadrinfo(NULL)
is left unspecified by both
.St -susv4
and
.Dv "RFC 3493" .
The current implementation ignores a
.Dv NULL
argument for compatibility with programs that rely on the implementation
details of other operating systems.
.Sh RETURN VALUES
.Fn getaddrinfo
returns zero on success or one of the error codes listed in

View file

@ -35,7 +35,7 @@
* in the source code. This is because RFC2553 is silent about which error
* code must be returned for which situation.
* - freeaddrinfo(NULL). RFC2553 is silent about it. XNET 5.2 says it is
* invalid. current code - SEGV on freeaddrinfo(NULL)
* invalid. Current code accepts NULL to be compatible with other OSes.
*
* Note:
* - The code filters out AFs that are not supported by the kernel,
@ -359,14 +359,13 @@ freeaddrinfo(struct addrinfo *ai)
{
struct addrinfo *next;
do {
while (ai != NULL) {
next = ai->ai_next;
if (ai->ai_canonname)
free(ai->ai_canonname);
free(ai->ai_canonname);
/* no need to free(ai->ai_addr) */
free(ai);
ai = next;
} while (ai);
}
}
static int

View file

@ -28,7 +28,7 @@
.\" @(#)open.2 8.2 (Berkeley) 11/16/93
.\" $FreeBSD$
.\"
.Dd November 22, 2016
.Dd September 15, 2017
.Dt OPEN 2
.Os
.Sh NAME
@ -487,7 +487,9 @@ is specified and the process is in capability mode.
was called and the process is in capability mode.
.It Bq Er ENOTCAPABLE
.Fa path
is an absolute path or contained "..".
is an absolute path or contained a ".." component leading to a
directory outside of the directory hierarchy specified by
.Fa fd .
.El
.Sh SEE ALSO
.Xr chmod 2 ,

View file

@ -2,7 +2,7 @@
.\" $NetBSD: ptrace.2,v 1.2 1995/02/27 12:35:37 cgd Exp $
.\"
.\" This file is in the public domain.
.Dd June 11, 2017
.Dd September 14, 2017
.Dt PTRACE 2
.Os
.Sh NAME
@ -762,6 +762,28 @@ The
.Fa data
argument is ignored.
.El
.Sh ARM MACHINE-SPECIFIC REQUESTS
.Bl -tag -width "Dv PT_SETVFPREGS"
.It Dv PT_GETVFPREGS
Return the thread's
.Dv VFP
machine state in the buffer pointed to by
.Fa addr .
.Pp
The
.Fa data
argument is ignored.
.It Dv PT_SETVFPREGS
Set the thread's
.Dv VFP
machine state from the buffer pointed to by
.Fa addr .
.Pp
The
.Fa data
argument is ignored.
.El
.Pp
.Sh x86 MACHINE-SPECIFIC REQUESTS
.Bl -tag -width "Dv PT_GETXSTATE_INFO"
.It Dv PT_GETXMMREGS

View file

@ -28,7 +28,7 @@
.\" @(#)rename.2 8.1 (Berkeley) 6/4/93
.\" $FreeBSD$
.\"
.Dd April 10, 2008
.Dd September 15, 2017
.Dt RENAME 2
.Os
.Sh NAME
@ -252,6 +252,9 @@ The
.Fa to
argument
is a directory and is not empty.
.It Bq Er ECAPMODE
.Fn rename
was called and the process is in capability mode.
.El
.Pp
In addition to the errors returned by the
@ -288,6 +291,26 @@ argument is not an absolute path and
is neither
.Dv AT_FDCWD
nor a file descriptor associated with a directory.
.It Bq Er ECAPMODE
.Dv AT_FDCWD
is specified and the process is in capability mode.
.It Bq Er ENOTCAPABLE
.Fa path
is an absolute path or contained a ".." component leading to a directory
outside of the directory hierarchy specified by
.Fa fromfd
or
.Fa tofd .
.It Bq Er ENOTCAPABLE
The
.Fa fromfd
file descriptor lacks the
.Dv CAP_RENAMEAT_SOURCE
right, or the
.Fa tofd
file descriptor lacks the
.Dv CAP_RENAMEAT_TARGET
right.
.El
.Sh SEE ALSO
.Xr chflags 2 ,

View file

@ -7,6 +7,8 @@ LIB= edit
SHLIB_MAJOR= 7
SHLIBDIR?= /lib
WARNS?= 3
OSRCS= chared.c common.c el.c eln.c emacs.c fcns.c filecomplete.c help.c \
hist.c keymacro.c map.c chartype.c \
parse.c prompt.c read.c refresh.c search.c sig.c terminal.c tty.c vi.c
@ -41,8 +43,6 @@ CFLAGS+= -I. -I${.CURDIR} -I${.CURDIR}/edit -DWIDECHAR
#CFLAGS+= -DDEBUG_TTY -DDEBUG_KEY -DDEBUG_READ -DDEBUG -DDEBUG_REFRESH
#CFLAGS+= -DDEBUG_PASTE -DDEBUG_EDIT
WARNS?= 1
SUBDIR= edit/readline
AHDR= vi.h emacs.h common.h

View file

@ -223,6 +223,7 @@ ct_mbrtowc(wchar_t *wc, const char *s, size_t n)
size_t
ct_mbrtowc(wchar_t *wc, const char *s, size_t n)
{
if (s == NULL)
return 0;
if (n == 0)

View file

@ -225,8 +225,13 @@ efi_get_next_variable_name(efi_guid_t **guid, char **name)
if (efi_open_dev() == -1)
return -1;
/*
* Always allocate enough for an extra NUL on the end, but don't tell
* the IOCTL about it so we can NUL terminate the name before converting
* it to UTF8.
*/
if (buf == NULL)
buf = malloc(buflen);
buf = malloc(buflen + sizeof(efi_char));
again:
efi_var_reset(&var);
@ -244,21 +249,23 @@ efi_get_next_variable_name(efi_guid_t **guid, char **name)
rv = ioctl(efi_fd, EFIIOC_VAR_NEXT, &var);
if (rv == 0 && var.name == NULL) {
/*
* oops, too little space. Try again.
* Variable name not long enough, so allocate more space for the
* name and try again. As above, mind the NUL we add.
*/
void *new = realloc(buf, buflen);
buflen = var.namesize;
void *new = realloc(buf, var.namesize + sizeof(efi_char));
if (new == NULL) {
rv = -1;
errno = ENOMEM;
goto done;
}
buflen = var.namesize;
buf = new;
goto again;
}
if (rv == 0) {
*name = NULL; /* XXX */
free(*name); /* Free last name, to avoid leaking */
*name = NULL; /* Force ucs2_to_utf8 to malloc new space */
var.name[var.namesize / sizeof(efi_char)] = 0; /* EFI doesn't NUL terminate */
rv = ucs2_to_utf8(var.name, name);
if (rv != 0)
@ -269,9 +276,11 @@ efi_get_next_variable_name(efi_guid_t **guid, char **name)
errout:
/* XXX The linux interface expects name to be a static buffer -- fix or leak memory? */
/* XXX for the moment, we free just before we'd leak, but still leak last one */
done:
if (errno == ENOENT) {
if (rv != 0 && errno == ENOENT) {
errno = 0;
free(*name); /* Free last name, to avoid leaking */
return 0;
}

View file

@ -467,6 +467,7 @@ tftp_open(const char *path, struct open_file *f)
if (res) {
free(tftpfile->path);
free(tftpfile->pkt);
free(tftpfile);
return (res);
}

View file

@ -3,7 +3,5 @@
SCRIPTS= makewhatis.local.sh
MAN= makewhatis.local.8
SCRIPTSDIR= ${LIBEXECDIR}
LINKS= ${SCRIPTSDIR}/makewhatis.local ${SCRIPTSDIR}/catman.local
MLINKS= makewhatis.local.8 catman.local.8
.include <bsd.prog.mk>

View file

@ -27,22 +27,19 @@
.Dt MAKEWHATIS.LOCAL 8
.Os
.Sh NAME
.Nm makewhatis.local , catman.local
.Nd start makewhatis or catman for local file systems
.Nm makewhatis.local
.Nd start makewhatis for local file systems
.Sh SYNOPSIS
.Nm /usr/libexec/makewhatis.local
.Op options
.Ar directories ...
.Nm /usr/libexec/catman.local
.Op options
.Ar directories ...
.Sh DESCRIPTION
The
.Nm
utility starts
.Xr makewhatis 1
only for file systems physically mounted on the system
where the
where
.Nm
is being executed.
Running makewhatis
@ -53,25 +50,14 @@ your NFS server -- all NFS clients start makewhatis at the same time!
So use this wrapper for
.Xr cron 8
instead of calling makewhatis directly.
The
.Nm catman.local
utility is using for same purposes as
.Nm
but for
.Xr catman 1 .
.Sh FILES
.Bl -tag -width /etc/periodic/weekly/320.whatis.XXX -compact
.It Pa /etc/periodic/weekly/320.whatis
run
.Nm
every week
.It Pa /etc/periodic/weekly/330.catman
run
.Nm catman.local
every week
.El
.Sh SEE ALSO
.Xr catman 1 ,
.Xr find 1 ,
.Xr makewhatis 1 ,
.Xr cron 8 ,

View file

@ -31,8 +31,6 @@
# /usr may kill your NFS server -- all clients start makewhatis at the same
# time! So use this wrapper instead calling makewhatis directly.
#
# PS: this wrapper works also for catman(1)
#
# $FreeBSD$
PATH=/bin:/usr/bin:$PATH; export PATH

View file

@ -18,11 +18,18 @@ __FBSDID("$FreeBSD$");
#include "rtld.h"
#include "paths.h"
#ifdef __ARM_FP
/*
* On processors that have hard floating point supported, we also support
* running soft float binaries. If we're being built with hard float support,
* check the ELF headers to make sure that this is a hard float binary. If it is
* a soft float binary, force the dynamic linker to use the alternative soft
* float path.
*/
void
arm_abi_variant_hook(Elf_Auxinfo **aux_info)
{
Elf_Word ehdr;
struct stat sb;
/*
* If we're running an old kernel that doesn't provide any data fail
@ -39,17 +46,6 @@ arm_abi_variant_hook(Elf_Auxinfo **aux_info)
if ((ehdr & EF_ARM_VFP_FLOAT) != 0)
return;
/*
* If there's no /usr/libsoft, then we don't have a system with both
* hard and soft float. In that case, hope for the best and just
* return. Such systems are required to have all soft or all hard
* float ABI binaries and libraries. This is, at best, a transition
* compatibility hack. Once we're fully hard-float, this should
* be removed.
*/
if (stat("/usr/libsoft", &sb) != 0 || !S_ISDIR(sb.st_mode))
return;
/*
* This is a soft float ABI binary. We need to use the soft float
* settings.
@ -60,6 +56,7 @@ arm_abi_variant_hook(Elf_Auxinfo **aux_info)
ld_standard_library_path = SOFT_STANDARD_LIBRARY_PATH;
ld_env_prefix = LD_SOFT_;
}
#endif
void
init_pltgot(Obj_Entry *obj)

View file

@ -31,6 +31,7 @@
#include <sys/types.h>
#include <machine/atomic.h>
#include <machine/acle-compat.h>
struct Struct_Obj_Entry;
@ -74,7 +75,11 @@ extern void *__tls_get_addr(tls_index *ti);
extern void arm_abi_variant_hook(Elf_Auxinfo **);
#ifdef __ARM_FP
#define md_abi_variant_hook(x) arm_abi_variant_hook(x)
#define RTLD_VARIANT_ENV_NAMES
#else
#define md_abi_variant_hook(x)
#endif
#endif

View file

@ -67,29 +67,6 @@ __FBSDID("$FreeBSD$");
#define GOT1_RESERVED_FOR_RTLD(got) ((got)[1] & GOT1_MASK)
#endif
void
init_pltgot(Obj_Entry *obj)
{
if (obj->pltgot != NULL) {
obj->pltgot[0] = (Elf_Addr) &_rtld_bind_start;
if (GOT1_RESERVED_FOR_RTLD(obj->pltgot))
obj->pltgot[1] = (Elf_Addr) obj | GOT1_MASK;
}
}
int
do_copy_relocations(Obj_Entry *dstobj)
{
/* Do nothing */
return 0;
}
void _rtld_relocate_nonplt_self(Elf_Dyn *, Elf_Addr);
/*
* It is possible for the compiler to emit relocations for unaligned data.
* We handle this situation with these inlines.
*/
#ifdef __mips_n64
/*
* ELF64 MIPS encodes the relocs uniquely. The first 32-bits of info contain
@ -110,6 +87,86 @@ void _rtld_relocate_nonplt_self(Elf_Dyn *, Elf_Addr);
#define Elf_Sxword Elf32_Sword
#endif
void _rtld_pltbind_start(void);
void
init_pltgot(Obj_Entry *obj)
{
if (obj->pltgot != NULL) {
obj->pltgot[0] = (Elf_Addr) &_rtld_bind_start;
if (GOT1_RESERVED_FOR_RTLD(obj->pltgot))
obj->pltgot[1] = (Elf_Addr) obj | GOT1_MASK;
}
if (obj->mips_pltgot != NULL) {
obj->mips_pltgot[0] = (Elf_Addr) &_rtld_pltbind_start;
obj->mips_pltgot[1] = (Elf_Addr) obj;
}
}
int
do_copy_relocations(Obj_Entry *dstobj)
{
const Obj_Entry *srcobj, *defobj;
const Elf_Rel *rellim;
const Elf_Rel *rel;
const Elf_Sym *srcsym;
const Elf_Sym *dstsym;
const void *srcaddr;
const char *name;
void *dstaddr;
SymLook req;
size_t size;
int res;
/*
* COPY relocs are invalid outside of the main program
*/
assert(dstobj->mainprog);
rellim = (const Elf_Rel *)((caddr_t)dstobj->rel + dstobj->relsize);
for (rel = dstobj->rel; rel < rellim; rel++) {
if (ELF_R_TYPE(rel->r_info) != R_MIPS_COPY)
continue;
dstaddr = (void *)(dstobj->relocbase + rel->r_offset);
dstsym = dstobj->symtab + ELF_R_SYM(rel->r_info);
name = dstobj->strtab + dstsym->st_name;
size = dstsym->st_size;
symlook_init(&req, name);
req.ventry = fetch_ventry(dstobj, ELF_R_SYM(rel->r_info));
req.flags = SYMLOOK_EARLY;
for (srcobj = globallist_next(dstobj); srcobj != NULL;
srcobj = globallist_next(srcobj)) {
res = symlook_obj(&req, srcobj);
if (res == 0) {
srcsym = req.sym_out;
defobj = req.defobj_out;
break;
}
}
if (srcobj == NULL) {
_rtld_error(
"Undefined symbol \"%s\" referenced from COPY relocation in %s",
name, dstobj->path);
return (-1);
}
srcaddr = (const void *)(defobj->relocbase + srcsym->st_value);
memcpy(dstaddr, srcaddr, size);
}
return (0);
}
void _rtld_relocate_nonplt_self(Elf_Dyn *, Elf_Addr);
/*
* It is possible for the compiler to emit relocations for unaligned data.
* We handle this situation with these inlines.
*/
static __inline Elf_Sxword
load_ptr(void *where, size_t len)
{
@ -475,6 +532,20 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags,
break;
}
case R_TYPE(COPY):
/*
* These are deferred until all other relocations have
* been done. All we do here is make sure that the
* COPY relocation is not in a shared library. They
* are allowed only in executable files.
*/
if (!obj->mainprog) {
_rtld_error("%s: Unexpected R_MIPS_COPY "
"relocation in shared library", obj->path);
return (-1);
}
break;
#ifdef __mips_n64
case R_TYPE(TLS_DTPMOD64):
#else
@ -581,23 +652,25 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags,
int
reloc_plt(Obj_Entry *obj)
{
#if 0
const Elf_Rel *rellim;
const Elf_Rel *rel;
dbg("reloc_plt obj:%p pltrel:%p sz:%s", obj, obj->pltrel, (int)obj->pltrelsize);
dbg("gottable %p num syms:%s", obj->pltgot, obj->symtabno );
dbg("*****************************************************");
rellim = (const Elf_Rel *)((char *)obj->pltrel +
obj->pltrelsize);
for (rel = obj->pltrel; rel < rellim; rel++) {
rellim = (const Elf_Rel *)((char *)obj->pltrel + obj->pltrelsize);
for (rel = obj->pltrel; rel < rellim; rel++) {
Elf_Addr *where;
where = (Elf_Addr *)(obj->relocbase + rel->r_offset);
*where += (Elf_Addr )obj->relocbase;
switch (ELF_R_TYPE(rel->r_info)) {
case R_MIPS_JUMP_SLOT:
where = (Elf_Addr *)(obj->relocbase + rel->r_offset);
*where += (Elf_Addr )obj->relocbase;
break;
default:
_rtld_error("Unknown relocation type %u in PLT",
(unsigned int)ELF_R_TYPE(rel->r_info));
return (-1);
}
}
#endif
/* PLT fixups were done above in the GOT relocation. */
return (0);
}
@ -607,9 +680,34 @@ reloc_plt(Obj_Entry *obj)
int
reloc_jmpslots(Obj_Entry *obj, int flags, RtldLockState *lockstate)
{
/* Do nothing */
obj->jmpslots_done = true;
const Obj_Entry *defobj;
const Elf_Rel *rellim;
const Elf_Rel *rel;
const Elf_Sym *def;
rellim = (const Elf_Rel *)((char *)obj->pltrel + obj->pltrelsize);
for (rel = obj->pltrel; rel < rellim; rel++) {
Elf_Addr *where;
switch (ELF_R_TYPE(rel->r_info)) {
case R_MIPS_JUMP_SLOT:
def = find_symdef(ELF_R_SYM(rel->r_info), obj,
&defobj, SYMLOOK_IN_PLT | flags, NULL, lockstate);
if (def == NULL) {
dbg("reloc_jmpslots: sym not found");
return (-1);
}
where = (Elf_Addr *)(obj->relocbase + rel->r_offset);
*where = (Elf_Addr)(defobj->relocbase + def->st_value);
break;
default:
_rtld_error("Unknown relocation type %u in PLT",
(unsigned int)ELF_R_TYPE(rel->r_info));
return (-1);
}
}
return (0);
}
@ -635,9 +733,11 @@ reloc_jmpslot(Elf_Addr *where, Elf_Addr target, const Obj_Entry *defobj,
const Obj_Entry *obj, const Elf_Rel *rel)
{
/* Do nothing */
assert(ELF_R_TYPE(rel->r_info) == R_MIPS_JUMP_SLOT);
return target;
if (*where != target && !ld_bind_not)
*where = target;
return (target);
}
void

View file

@ -100,30 +100,46 @@ END(rtld_start)
#define XCALLFRAME_A4 (0*SZREG)
#endif
/*
* Trampoline for "old" PLT stubs which use .got entries.
*/
.globl _rtld_bind_start
.ent _rtld_bind_start
_rtld_bind_start:
.frame sp, XCALLFRAME_SIZ, $15
.cfi_startproc simple
.cfi_register ra, $15
move v1, gp /* save old GP */
#if defined(__mips_o32) || defined(__mips_o64)
PTR_ADDU t9, 8 /* modify T9 to point at .cpload */
#endif
SETUP_GP
PTR_SUBU sp, XCALLFRAME_SIZ /* save arguments and sp value in stack */
.cfi_def_cfa sp, XCALLFRAME_SIZ
SETUP_GP64(XCALLFRAME_GP, _rtld_bind_start)
SAVE_GP(XCALLFRAME_GP)
#if defined(__mips_n32) || defined(__mips_n64)
REG_S a4, XCALLFRAME_A4(sp)
.cfi_rel_offset a4, XCALLFRAME_A4
REG_S a5, XCALLFRAME_A5(sp)
.cfi_rel_offset a5, XCALLFRAME_A5
REG_S a6, XCALLFRAME_A6(sp)
.cfi_rel_offset a6, XCALLFRAME_A6
REG_S a7, XCALLFRAME_A7(sp)
.cfi_rel_offset a7, XCALLFRAME_A7
#endif
REG_S a0, XCALLFRAME_A0(sp)
.cfi_rel_offset a0, XCALLFRAME_A0
REG_S a1, XCALLFRAME_A1(sp)
.cfi_rel_offset a1, XCALLFRAME_A1
REG_S a2, XCALLFRAME_A2(sp)
.cfi_rel_offset a2, XCALLFRAME_A2
REG_S a3, XCALLFRAME_A3(sp)
.cfi_rel_offset a3, XCALLFRAME_A3
REG_S $15, XCALLFRAME_RA(sp) /* ra is in t7/t3 */
.cfi_rel_offset ra, XCALLFRAME_RA
REG_S s0, XCALLFRAME_S0(sp)
.cfi_rel_offset s0, XCALLFRAME_S0
move s0, sp
move a0, v1 /* old GP */
@ -147,20 +163,122 @@ _rtld_bind_start:
move sp, s0
REG_L ra, XCALLFRAME_RA(sp)
.cfi_restore ra
REG_L s0, XCALLFRAME_S0(sp)
.cfi_restore s0
REG_L a0, XCALLFRAME_A0(sp)
.cfi_restore a0
REG_L a1, XCALLFRAME_A1(sp)
.cfi_restore a1
REG_L a2, XCALLFRAME_A2(sp)
.cfi_restore a2
REG_L a3, XCALLFRAME_A3(sp)
.cfi_restore a3
#if defined(__mips_n32) || defined(__mips_n64)
REG_L a4, XCALLFRAME_A4(sp)
.cfi_restore a4
REG_L a5, XCALLFRAME_A5(sp)
.cfi_restore a5
REG_L a6, XCALLFRAME_A6(sp)
.cfi_restore a6
REG_L a7, XCALLFRAME_A7(sp)
.cfi_restore a7
#endif
RESTORE_GP64
PTR_ADDU sp, XCALLFRAME_SIZ
move t9, v0
jr t9
nop
.cfi_endproc
END(_rtld_bind_start)
/*
* Trampoline for PLT stubs using .pltrel entries and .got.plt.
*/
.globl _rtld_pltbind_start
.ent _rtld_pltbind_start
_rtld_pltbind_start:
.frame sp, XCALLFRAME_SIZ, $15
.cfi_startproc simple
.cfi_register ra, $15
#if defined(__mips_o32)
move v1, gp /* save pointer to .got.plt */
#else
move v1, t2 /* save pointer to .got.plt */
#endif
#if defined(__mips_o32) || defined(__mips_o64)
PTR_ADDU t9, 8 /* modify T9 to point at .cpload */
#endif
SETUP_GP
PTR_SUBU sp, XCALLFRAME_SIZ /* save arguments and sp value in stack */
.cfi_def_cfa sp, XCALLFRAME_SIZ
SETUP_GP64(XCALLFRAME_GP, _rtld_pltbind_start)
SAVE_GP(XCALLFRAME_GP)
#if defined(__mips_n32) || defined(__mips_n64)
REG_S a4, XCALLFRAME_A4(sp)
.cfi_rel_offset a4, XCALLFRAME_A4
REG_S a5, XCALLFRAME_A5(sp)
.cfi_rel_offset a5, XCALLFRAME_A5
REG_S a6, XCALLFRAME_A6(sp)
.cfi_rel_offset a6, XCALLFRAME_A6
REG_S a7, XCALLFRAME_A7(sp)
.cfi_rel_offset a7, XCALLFRAME_A7
#endif
REG_S a0, XCALLFRAME_A0(sp)
.cfi_rel_offset a0, XCALLFRAME_A0
REG_S a1, XCALLFRAME_A1(sp)
.cfi_rel_offset a1, XCALLFRAME_A1
REG_S a2, XCALLFRAME_A2(sp)
.cfi_rel_offset a2, XCALLFRAME_A2
REG_S a3, XCALLFRAME_A3(sp)
.cfi_rel_offset a3, XCALLFRAME_A3
REG_S $15, XCALLFRAME_RA(sp) /* ra is in t7/t3 */
.cfi_rel_offset ra, XCALLFRAME_RA
REG_S s0, XCALLFRAME_S0(sp)
.cfi_rel_offset s0, XCALLFRAME_S0
move s0, sp
move a0, v1 /* .got.plt */
#if defined(__mips_n64)
ld a0, 8(a0) /* object = .got.plt[1] */
sll a1, t8, 4 /* PLT entry index to .rel.plt offset */
#else
lw a0, 4(a0) /* object = .got.plt[1] */
sll a1, t8, 3 /* PLT entry index to .rel.plt offset */
#endif
PTR_LA t9, _C_LABEL(_rtld_bind)
jalr t9
nop
move sp, s0
REG_L ra, XCALLFRAME_RA(sp)
.cfi_restore ra
REG_L s0, XCALLFRAME_S0(sp)
.cfi_restore s0
REG_L a0, XCALLFRAME_A0(sp)
.cfi_restore a0
REG_L a1, XCALLFRAME_A1(sp)
.cfi_restore a1
REG_L a2, XCALLFRAME_A2(sp)
.cfi_restore a2
REG_L a3, XCALLFRAME_A3(sp)
.cfi_restore a3
#if defined(__mips_n32) || defined(__mips_n64)
REG_L a4, XCALLFRAME_A4(sp)
.cfi_restore a4
REG_L a5, XCALLFRAME_A5(sp)
.cfi_restore a5
REG_L a6, XCALLFRAME_A6(sp)
.cfi_restore a6
REG_L a7, XCALLFRAME_A7(sp)
.cfi_restore a7
#endif
RESTORE_GP64
PTR_ADDU sp, XCALLFRAME_SIZ
move t9, v0
jr t9
nop
.cfi_endproc
END(_rtld_pltbind_start)

View file

@ -1257,6 +1257,12 @@ digest_dynamic1(Obj_Entry *obj, int early, const Elf_Dyn **dyn_rpath,
case DT_MIPS_RLD_MAP:
*((Elf_Addr *)(dynp->d_un.d_ptr)) = (Elf_Addr) &r_debug;
break;
case DT_MIPS_PLTGOT:
obj->mips_pltgot = (Elf_Addr *) (obj->relocbase +
dynp->d_un.d_ptr);
break;
#endif
#ifdef __powerpc64__

View file

@ -187,6 +187,7 @@ typedef struct Struct_Obj_Entry {
Elf_Word local_gotno; /* Number of local GOT entries */
Elf_Word symtabno; /* Number of dynamic symbols */
Elf_Word gotsym; /* First dynamic symbol in GOT */
Elf_Addr *mips_pltgot; /* Second PLT GOT */
#endif
#ifdef __powerpc64__
Elf_Addr glink; /* GLINK PLT call stub section */

View file

@ -32,7 +32,7 @@ fi
echo '/dev/ufs/FreeBSD_Install / ufs ro,noatime 1 1' > ${1}/etc/fstab
echo 'root_rw_mount="NO"' > ${1}/etc/rc.conf.local
makefs -B little -o label=FreeBSD_Install ${2}.part ${1}
makefs -B little -o label=FreeBSD_Install -o version=2 ${2}.part ${1}
rm ${1}/etc/fstab
rm ${1}/etc/rc.conf.local

View file

@ -9,7 +9,7 @@ EMBEDDED_TARGET_ARCH="armv6"
EMBEDDEDPORTS="sysutils/u-boot-beaglebone"
KERNEL="BEAGLEBONE"
WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x88000000"
IMAGE_SIZE="1G"
IMAGE_SIZE="1536M"
PART_SCHEME="MBR"
FAT_SIZE="2m"
FAT_TYPE="12"

View file

@ -9,7 +9,7 @@ EMBEDDED_TARGET_ARCH="armv6"
EMBEDDEDPORTS="sysutils/u-boot-cubieboard"
KERNEL="ALLWINNER_UP"
WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x42000000"
IMAGE_SIZE="1G"
IMAGE_SIZE="1536M"
PART_SCHEME="MBR"
FAT_SIZE="32m -b 1m"
FAT_TYPE="16"

View file

@ -9,7 +9,7 @@ EMBEDDED_TARGET_ARCH="armv6"
EMBEDDEDPORTS="sysutils/u-boot-duovero"
KERNEL="GUMSTIX"
WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x88000000"
IMAGE_SIZE="1G"
IMAGE_SIZE="1536M"
PART_SCHEME="MBR"
FAT_SIZE="2m"
FAT_TYPE="12"

View file

@ -9,7 +9,7 @@ EMBEDDED_TARGET_ARCH="armv6"
EMBEDDEDPORTS="sysutils/u-boot-pandaboard"
KERNEL="PANDABOARD"
WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x88000000"
IMAGE_SIZE="1G"
IMAGE_SIZE="1536M"
PART_SCHEME="MBR"
FAT_SIZE="2m"
FAT_TYPE="12"

View file

@ -9,7 +9,7 @@ EMBEDDED_TARGET_ARCH="armv6"
EMBEDDEDPORTS="sysutils/u-boot-rpi"
KERNEL="RPI-B"
WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x2000000"
IMAGE_SIZE="1G"
IMAGE_SIZE="1536M"
PART_SCHEME="MBR"
FAT_SIZE="17m"
FAT_TYPE="16"

View file

@ -10,7 +10,7 @@ EMBEDDED_TARGET_ARCH="aarch64"
EMBEDDEDPORTS="sysutils/u-boot-rpi3 security/ca_root_nss"
KERNEL="GENERIC"
WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x42000000"
IMAGE_SIZE="2G"
IMAGE_SIZE="2560M"
PART_SCHEME="MBR"
FAT_SIZE="50m -b 1m"
FAT_TYPE="16"

View file

@ -32,7 +32,7 @@ fi
echo '/dev/ufs/FreeBSD_Install / ufs ro,noatime 1 1' > ${1}/etc/fstab
echo 'root_rw_mount="NO"' > ${1}/etc/rc.conf.local
makefs -B little -o label=FreeBSD_Install ${2}.part ${1}
makefs -B little -o label=FreeBSD_Install -o version=2 ${2}.part ${1}
rm ${1}/etc/fstab
rm ${1}/etc/rc.conf.local

View file

@ -32,7 +32,7 @@ fi
echo '/dev/ufs/FreeBSD_Install / ufs ro,noatime 1 1' > ${1}/etc/fstab
echo 'root_rw_mount="NO"' > ${1}/etc/rc.conf.local
makefs -B little -o label=FreeBSD_Install ${2}.part ${1}
makefs -B little -o label=FreeBSD_Install -o version=2 ${2}.part ${1}
rm ${1}/etc/fstab
rm ${1}/etc/rc.conf.local

View file

@ -37,7 +37,7 @@ fi
echo '/dev/da0s3 / ufs ro,noatime 1 1' > ${1}/etc/fstab
echo 'root_rw_mount="NO"' > ${1}/etc/rc.conf.local
rm -f ${tempfile}
makefs -B big ${tempfile} ${1}
makefs -B big -o version=2 ${tempfile} ${1}
rm ${1}/etc/fstab
rm ${1}/etc/rc.conf.local

View file

@ -253,6 +253,7 @@ MAN= aac.4 \
led.4 \
lge.4 \
${_linux.4} \
liquidio.4 \
lm75.4 \
lmc.4 \
lo.4 \

View file

@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd April 12, 2017
.Dd August 28, 2017
.Dt ALTQ 4
.Os
.Sh NAME
@ -152,6 +152,7 @@ They have been applied to the following hardware drivers:
.Xr ixgbe 4 ,
.Xr jme 4 ,
.Xr le 4 ,
.Xr liquidio 4 ,
.Xr msk 4 ,
.Xr mxge 4 ,
.Xr my 4 ,

133
share/man/man4/liquidio.4 Normal file
View file

@ -0,0 +1,133 @@
.\" BSD LICENSE
.\"
.\" Copyright(c) 2017 Cavium, Inc.. All rights reserved.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\"
.\" * Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" * 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.
.\" * Neither the name of Cavium, Inc. nor the names of its
.\" contributors may be used to endorse or promote products derived
.\" from this software without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
.\" OWNER(S) OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
.\" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\" $FreeBSD$
.\"
.Dd August 17, 2017
.Dt LIQUIDIO 4
.Os
.Sh NAME
.Nm liquidio
.Nd "Cavium 10Gb/25Gb Ethernet driver for the FreeBSD operating system"
.Sh SYNOPSIS
To compile this driver into the kernel,
place the following line in your
kernel configuration file:
.Bd -ragged -offset indent
.Cd "device lio"
.Ed
.Pp
Alternatively, to load the driver as a
module at boot time, place the following line in
.Xr loader.conf 5 :
.Bd -literal -offset indent
if_lio_load="YES"
.Ed
.Sh DESCRIPTION
The
.Nm
driver provides support for 23XX 10Gb/25Gb Ethernet adapters.
The driver supports Jumbo Frames, Transmit/Receive checksum
offload, TCP segmentation offload (TSO), Large Receive Offload (LRO),
VLAN tag insertion/extraction, VLAN checksum offload,
VLAN TSO, and Receive Side Steering (RSS)
.Pp
Support for Jumbo Frames is provided via the interface MTU setting.
Selecting an MTU larger than 1500 bytes with the
.Xr ifconfig 8
utility configures the adapter to receive and transmit Jumbo Frames.
The maximum MTU size for Jumbo Frames is 16000.
.Pp
For more information on configuring this device, see ifconfig(8).
.Sh HARDWARE
The
.Nm
driver supports the following cards:
.Pp
.Bl -bullet -compact
.It
LiquidIO II CN2350 210SV/225SV
.It
LiquidIO II CN2360 210SV/225SV
.El
.Sh LOADER TUBABLES
Tunables can be set at the
.Xr loader 8
prompt before booting the kernel or stored in
.Xr loader.conf 5 .
.Pp
.Bl -tag -width indent
.It Va hw.lio.fw_type
.Pp
String that specifies type of firmware to be loaded.
Default is "nic". Use "none" to load firmware from flash.
.It Va hw.lio.num_queues_per_pf0
.Pp
Unsigned integers that specify number of queues per PF0.
Valid range is 0 to 64.
Use 0 to derive autoconfigures based on the number of
cpus with a max of 8
.It Va hw.lio.num_queues_per_pf1
.Pp
Unsigned integers that specify number of queues per PF1.
Valid range is 0 to 64.
Use 0 to derive autoconfigures based on the number of
cpus with a max of 8
.It Va hw.lio.console_bitmask
.Pp
Bitmask indicating which consoles have debug output
redirected to syslog.
.It Va hw.lio.rss
.Pp
To enable/disable driver RSS support
.It Va hw.lio.hwlro
.Pp
To enable/disable hardware LRO
.Sh SUPPORT
For general information and support,
go to the Cavium support website at:
.Pa http://support.cavium.com .
.Sh SEE ALSO
.Xr altq 4 ,
.Xr arp 4 ,
.Xr netintro 4 ,
.Xr ng_ether 4 ,
.Xr vlan 4 ,
.Xr ifconfig 8
.Sh HISTORY
The
.Nm
device driver first appeared in
.Fx 12.0 .
.Sh AUTHORS
The
.Nm
driver was written by
.An Derek Chickles Aq Mt derek.chickles@cavium.com .

View file

@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd June 3, 2016
.Dd September 13, 2017
.Dt SIBA 4
.Os
.Sh NAME
@ -75,7 +75,7 @@ The
device driver first appeared in
.Fx 8.0 .
The driver was rewritten for
.Fx 11.0 .
.Fx 11.0
to support the common Broadcom
.Xr bhnd 4
bus interface.

View file

@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd June 8, 2016
.Dd August 28, 2017
.Dt VLAN 4
.Os
.Sh NAME
@ -135,6 +135,7 @@ in hardware:
.Xr ixgb 4 ,
.Xr ixgbe 4 ,
.Xr jme 4 ,
.Xr liquidio 4 ,
.Xr msk 4 ,
.Xr mxge 4 ,
.Xr nxge 4 ,

View file

@ -593,15 +593,6 @@ if you want to run
This script regenerates the database used by the
.Xr apropos 1
command.
.It Va weekly_catman_enable
.Pq Vt bool
Set to
.Dq Li YES
if you want to run
.Pa /usr/libexec/catman.local .
This script processes all out of date manual pages, speeding up the
.Xr man 1
command at the expense of disk space.
.It Va weekly_noid_enable
.Pq Vt bool
Set to

View file

@ -4453,7 +4453,6 @@ configuration file.
.It Pa /etc/rc.conf.local
.El
.Sh SEE ALSO
.Xr catman 1 ,
.Xr chmod 1 ,
.Xr gdb 1 ,
.Xr info 1 ,

View file

@ -1069,7 +1069,6 @@ Only the uncompressed versions will be installed.
.It Va WITHOUT_MAN_UTILS
Set to not build utilities for manual pages,
.Xr apropos 1 ,
.Xr catman 1 ,
.Xr makewhatis 1 ,
.Xr man 1 ,
.Xr whatis 1 ,

View file

@ -43,6 +43,7 @@ node [color=lightblue2, style=filled, bgcolor=black];
ache [label="Andrey Chernov\nache@FreeBSD.org\n1994/11/15"]
acm [label="Jose Alonso Cardenas Marquez\nacm@FreeBSD.org\n2006/07/18"]
adamw [label="Adam Weinberger\nadamw@FreeBSD.org\n2002/10/16"]
adridg [label="Adriaan de Groot\nadridg@FreeBSD.org\n2017/09/08"]
ahze [label="Michael Johnson\nahze@FreeBSD.org\n2004/10/29"]
ak [label="Alex Kozlov\nak@FreeBSD.org\n2012/02/29"]
ale [label="Alex Dupre\nale@FreeBSD.org\n2004/01/12"]
@ -148,6 +149,7 @@ lawrance [label="Sam Lawrance\nlawrance@FreeBSD.org\n2005/04/11\n2007/02/21"]
lbr [label="Lars Balker Rasmussen\nlbr@FreeBSD.org\n2006/04/30"]
leeym [label="Yen-Ming Lee\nleeym@FreeBSD.org\n2002/08/14"]
ler [label="Larry Rosenman\nler@FreeBSD.org\n2017/01/09"]
leres [label="Craig Leres\nleres@FreeBSD.org\n2017/10/10"]
lev [label="Lev Serebryakov\nlev@FreeBSD.org\n2003/06/17"]
lifanov [label="Nikolai Lifanov\nlifanov@FreeBSD.org\n2016/12/11"]
linimon [label="Mark Linimon\nlinimon@FreeBSD.org\n2003/10/23"]
@ -467,6 +469,8 @@ lawrance -> itetcu
leeym -> clsung
ler -> leres
lifanov -> ultima
lioux -> pat
@ -501,6 +505,7 @@ mat -> thierry
mat -> tobik
mat -> woodsb02
matthew -> leres
matthew -> lifanov
matthew -> ultima
@ -575,6 +580,7 @@ pi -> tz
rafan -> chinsan
rakuco -> adridg
rakuco -> alonso
rakuco -> tcberner
@ -642,6 +648,8 @@ tabthorpe -> rene
tabthorpe -> zi
tabthorpe -> gblach
tcberner -> adridg
thierry -> jadawin
thierry -> riggs

View file

@ -222,6 +222,7 @@ kensmith [label="Ken Smith\nkensmith@FreeBSD.org\n2004/01/23"]
kevans [label="Kyle Evans\nkevans@FreeBSD.org\n2017/06/20"]
kevlo [label="Kevin Lo\nkevlo@FreeBSD.org\n2006/07/23"]
kib [label="Konstantin Belousov\nkib@FreeBSD.org\n2006/06/03"]
kibab [label="Ilya Bakulin\nkibab@FreeBSD.org\n2017/09/02"]
kmacy [label="Kip Macy\nkmacy@FreeBSD.org\n2005/06/01"]
kp [label="Kristof Provost\nkp@FreeBSD.org\n2015/03/22"]
landonf [label="Landon Fuller\nlandonf@FreeBSD.org\n2016/05/31"]
@ -525,6 +526,7 @@ imp -> furuta
imp -> joe
imp -> jon
imp -> keichii
imp -> kibab
imp -> mb
imp -> mr
imp -> neel

View file

@ -131,11 +131,6 @@ CWARNFLAGS+= -Wno-error=address \
-Wno-error=unused-value
.endif
# GCC 5.3.0
.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 50300
CWARNFLAGS+= -Wno-error=strict-overflow
.endif
# GCC 6.1.0
.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 60100
CWARNFLAGS+= -Wno-error=misleading-indentation \

View file

@ -62,7 +62,6 @@ __DEFAULT_YES_OPTIONS = \
BOOTPARAMD \
BOOTPD \
BSD_CPIO \
BSD_GREP_FASTMATCH \
BSDINSTALL \
BSNMP \
BZIP2 \
@ -175,6 +174,7 @@ __DEFAULT_YES_OPTIONS = \
__DEFAULT_NO_OPTIONS = \
BSD_GREP \
BSD_GREP_FASTMATCH \
CLANG_EXTRAS \
DTRACE_TESTS \
GNU_GREP_COMPAT \

View file

@ -4,7 +4,7 @@
include MINIMAL
ident MMCCAM
ident GENERIC-MMCCAM
# Access GPT-formatted and labeled root volume
options GEOM_PART_GPT
@ -28,9 +28,9 @@ device virtio_balloon # VirtIO Memory Balloon device
device pass
device scbus
device da
device mmccam
options MMCCAM
options MMCCAM
# Add CAMDEBUG stuff
options CAMDEBUG
options CAM_DEBUG_FLAGS=(CAM_DEBUG_INFO|CAM_DEBUG_PROBE|CAM_DEBUG_PERIPH|CAM_DEBUG_TRACE)
options CAMDEBUG
options CAM_DEBUG_FLAGS=(CAM_DEBUG_INFO|CAM_DEBUG_PROBE|CAM_DEBUG_PERIPH)

View file

@ -195,6 +195,9 @@ struct a10_gpio_softc {
#define A10_GPIO_GP_INT_STA 0x214
#define A10_GPIO_GP_INT_DEB 0x218
static int a10_gpio_pin_get(device_t dev, uint32_t pin, unsigned int *value);
static int a10_gpio_pin_set(device_t dev, uint32_t pin, unsigned int value);
#define A10_GPIO_WRITE(_sc, _off, _val) \
bus_space_write_4(_sc->sc_bst, _sc->sc_bsh, _off, _val)
#define A10_GPIO_READ(_sc, _off) \
@ -316,29 +319,44 @@ a10_gpio_set_drv(struct a10_gpio_softc *sc, uint32_t pin, uint32_t drive)
static int
a10_gpio_pin_configure(struct a10_gpio_softc *sc, uint32_t pin, uint32_t flags)
{
u_int val;
int err = 0;
/* Must be called with lock held. */
A10_GPIO_LOCK_ASSERT(sc);
if (pin > sc->padconf->npins)
return (EINVAL);
/* Manage input/output. */
if (flags & (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT)) {
if (flags & GPIO_PIN_OUTPUT)
err = a10_gpio_set_function(sc, pin, A10_GPIO_OUTPUT);
else
if (flags & GPIO_PIN_INPUT) {
err = a10_gpio_set_function(sc, pin, A10_GPIO_INPUT);
} else if (flags & GPIO_PIN_OUTPUT) {
if (flags & GPIO_PIN_PRESET_LOW) {
a10_gpio_pin_set(sc->sc_dev, pin, 0);
} else if (flags & GPIO_PIN_PRESET_HIGH) {
a10_gpio_pin_set(sc->sc_dev, pin, 1);
} else {
/* Read the pin and preset output to current state. */
err = a10_gpio_set_function(sc, pin, A10_GPIO_INPUT);
if (err == 0) {
a10_gpio_pin_get(sc->sc_dev, pin, &val);
a10_gpio_pin_set(sc->sc_dev, pin, val);
}
}
if (err == 0)
err = a10_gpio_set_function(sc, pin, A10_GPIO_OUTPUT);
}
if (err)
return (err);
/* Manage Pull-up/pull-down. */
if (flags & (GPIO_PIN_PULLUP | GPIO_PIN_PULLDOWN)) {
if (flags & GPIO_PIN_PULLUP)
a10_gpio_set_pud(sc, pin, A10_GPIO_PULLUP);
else
a10_gpio_set_pud(sc, pin, A10_GPIO_PULLDOWN);
} else
if (flags & GPIO_PIN_PULLUP)
a10_gpio_set_pud(sc, pin, A10_GPIO_PULLUP);
else if (flags & GPIO_PIN_PULLDOWN)
a10_gpio_set_pud(sc, pin, A10_GPIO_PULLDOWN);
else
a10_gpio_set_pud(sc, pin, A10_GPIO_NONE);
return (0);
@ -525,6 +543,73 @@ a10_gpio_pin_toggle(device_t dev, uint32_t pin)
return (0);
}
static int
a10_gpio_pin_access_32(device_t dev, uint32_t first_pin, uint32_t clear_pins,
uint32_t change_pins, uint32_t *orig_pins)
{
struct a10_gpio_softc *sc;
uint32_t bank, data, pin;
sc = device_get_softc(dev);
if (first_pin > sc->padconf->npins)
return (EINVAL);
/*
* We require that first_pin refers to the first pin in a bank, because
* this API is not about convenience, it's for making a set of pins
* change simultaneously (required) with reasonably high performance
* (desired); we need to do a read-modify-write on a single register.
*/
bank = sc->padconf->pins[first_pin].port;
pin = sc->padconf->pins[first_pin].pin;
if (pin != 0)
return (EINVAL);
A10_GPIO_LOCK(sc);
data = A10_GPIO_READ(sc, A10_GPIO_GP_DAT(bank));
if ((clear_pins | change_pins) != 0)
A10_GPIO_WRITE(sc, A10_GPIO_GP_DAT(bank),
(data & ~clear_pins) ^ change_pins);
A10_GPIO_UNLOCK(sc);
if (orig_pins != NULL)
*orig_pins = data;
return (0);
}
static int
a10_gpio_pin_config_32(device_t dev, uint32_t first_pin, uint32_t num_pins,
uint32_t *pin_flags)
{
struct a10_gpio_softc *sc;
uint32_t bank, pin;
int err;
sc = device_get_softc(dev);
if (first_pin > sc->padconf->npins)
return (EINVAL);
bank = sc->padconf->pins[first_pin].port;
if (sc->padconf->pins[first_pin].pin != 0)
return (EINVAL);
/*
* The configuration for a bank of pins is scattered among several
* registers; we cannot g'tee to simultaneously change the state of all
* the pins in the flags array. So just loop through the array
* configuring each pin for now. If there was a strong need, it might
* be possible to support some limited simultaneous config, such as
* adjacent groups of 8 pins that line up the same as the config regs.
*/
for (err = 0, pin = first_pin; err == 0 && pin < num_pins; ++pin) {
if (pin_flags[pin] & (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT))
err = a10_gpio_pin_configure(sc, pin, pin_flags[pin]);
}
return (err);
}
static int
aw_find_pinnum_by_name(struct a10_gpio_softc *sc, const char *pinname)
{
@ -780,6 +865,8 @@ static device_method_t a10_gpio_methods[] = {
DEVMETHOD(gpio_pin_get, a10_gpio_pin_get),
DEVMETHOD(gpio_pin_set, a10_gpio_pin_set),
DEVMETHOD(gpio_pin_toggle, a10_gpio_pin_toggle),
DEVMETHOD(gpio_pin_access_32, a10_gpio_pin_access_32),
DEVMETHOD(gpio_pin_config_32, a10_gpio_pin_config_32),
DEVMETHOD(gpio_map_gpios, a10_gpio_map_gpios),
/* ofw_bus interface */

View file

@ -45,9 +45,14 @@ __FBSDID("$FreeBSD$");
#include <machine/elf.h>
#include <machine/md_var.h>
#ifdef VFP
#include <machine/vfp.h>
#endif
static boolean_t elf32_arm_abi_supported(struct image_params *);
u_long elf_hwcap;
struct sysentvec elf32_freebsd_sysvec = {
.sv_size = SYS_MAXSYSCALL,
.sv_table = sysent,
@ -86,6 +91,7 @@ struct sysentvec elf32_freebsd_sysvec = {
.sv_schedtail = NULL,
.sv_thread_detach = NULL,
.sv_trap = NULL,
.sv_hwcap = &elf_hwcap,
};
INIT_SYSENTVEC(elf32_sysvec, &elf32_freebsd_sysvec);
@ -124,9 +130,19 @@ elf32_arm_abi_supported(struct image_params *imgp)
}
void
elf32_dump_thread(struct thread *td __unused, void *dst __unused,
size_t *off __unused)
elf32_dump_thread(struct thread *td, void *dst, size_t *off)
{
#ifdef VFP
mcontext_vfp_t vfp;
if (dst != NULL) {
get_vfpcontext(td, &vfp);
*off = elf32_populate_note(NT_ARM_VFP, &vfp, dst, sizeof(vfp),
NULL);
} else
*off = elf32_populate_note(NT_ARM_VFP, NULL, NULL, sizeof(vfp),
NULL);
#endif
}
/*

View file

@ -405,39 +405,41 @@ exec_setregs(struct thread *td, struct image_params *imgp, u_long stack)
/*
* Get machine VFP context.
*/
static void
void
get_vfpcontext(struct thread *td, mcontext_vfp_t *vfp)
{
struct pcb *curpcb;
struct pcb *pcb;
curpcb = curthread->td_pcb;
critical_enter();
vfp_store(&curpcb->pcb_vfpstate, false);
memcpy(vfp->mcv_reg, curpcb->pcb_vfpstate.reg,
pcb = td->td_pcb;
if (td == curthread) {
critical_enter();
vfp_store(&pcb->pcb_vfpstate, false);
critical_exit();
} else
MPASS(TD_IS_SUSPENDED(td));
memcpy(vfp->mcv_reg, pcb->pcb_vfpstate.reg,
sizeof(vfp->mcv_reg));
vfp->mcv_fpscr = curpcb->pcb_vfpstate.fpscr;
critical_exit();
vfp->mcv_fpscr = pcb->pcb_vfpstate.fpscr;
}
/*
* Set machine VFP context.
*/
static void
void
set_vfpcontext(struct thread *td, mcontext_vfp_t *vfp)
{
struct pcb *curpcb;
struct pcb *pcb;
curpcb = curthread->td_pcb;
critical_enter();
vfp_discard(td);
memcpy(curpcb->pcb_vfpstate.reg, vfp->mcv_reg,
sizeof(curpcb->pcb_vfpstate.reg));
curpcb->pcb_vfpstate.fpscr = vfp->mcv_fpscr;
critical_exit();
pcb = td->td_pcb;
if (td == curthread) {
critical_enter();
vfp_discard(td);
critical_exit();
} else
MPASS(TD_IS_SUSPENDED(td));
memcpy(pcb->pcb_vfpstate.reg, vfp->mcv_reg,
sizeof(pcb->pcb_vfpstate.reg));
pcb->pcb_vfpstate.fpscr = vfp->mcv_fpscr;
}
#endif

View file

@ -0,0 +1,63 @@
/*-
* Copyright (c) 2017 John Baldwin <jhb@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <sys/proc.h>
#include <sys/ptrace.h>
#ifdef VFP
#include <machine/vfp.h>
#endif
int
cpu_ptrace(struct thread *td, int req, void *addr, int data)
{
#ifdef VFP
mcontext_vfp_t vfp;
#endif
int error;
switch (req) {
#ifdef VFP
case PT_GETVFPREGS:
get_vfpcontext(td, &vfp);
error = copyout(&vfp, addr, sizeof(vfp));
break;
case PT_SETVFPREGS:
error = copyin(addr, &vfp, sizeof(vfp));
if (error == 0)
set_vfpcontext(td, &vfp);
break;
#endif
default:
error = EINVAL;
}
return (error);
}

View file

@ -33,9 +33,11 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/proc.h>
#include <sys/imgact_elf.h>
#include <sys/kernel.h>
#include <machine/armreg.h>
#include <machine/elf.h>
#include <machine/frame.h>
#include <machine/md_var.h>
#include <machine/pcb.h>
@ -115,6 +117,7 @@ vfp_init(void)
vfp_exists = 1;
is_d32 = 0;
PCPU_SET(vfpsid, fpsid); /* save the fpsid */
elf_hwcap |= HWCAP_VFP;
vfp_arch =
(fpsid & VFPSID_SUBVERSION2_MASK) >> VFPSID_SUBVERSION_OFF;
@ -122,9 +125,13 @@ vfp_init(void)
if (vfp_arch >= VFP_ARCH3) {
tmp = fmrx(mvfr0);
PCPU_SET(vfpmvfr0, tmp);
elf_hwcap |= HWCAP_VFPv3;
if ((tmp & VMVFR0_RB_MASK) == 2)
if ((tmp & VMVFR0_RB_MASK) == 2) {
elf_hwcap |= HWCAP_VFPD32;
is_d32 = 1;
} else
elf_hwcap |= HWCAP_VFPv3D16;
tmp = fmrx(mvfr1);
PCPU_SET(vfpmvfr1, tmp);

View file

@ -160,8 +160,8 @@ at91_twi_attach(device_t dev)
if ((sc->iicbus = device_add_child(dev, "iicbus", -1)) == NULL)
device_printf(dev, "could not allocate iicbus instance\n");
/* probe and attach the iicbus */
bus_generic_attach(dev);
/* Probe and attach the iicbus when interrupts are available. */
config_intrhook_oneshot((ich_func_t)bus_generic_attach, dev);
out:
if (err)
at91_twi_deactivate(dev);

View file

@ -309,7 +309,10 @@ bcm_bsc_attach(device_t dev)
return (ENXIO);
}
return (bus_generic_attach(dev));
/* Probe and attach the iicbus when interrupts are available. */
config_intrhook_oneshot((ich_func_t)bus_generic_attach, dev);
return (0);
}
static int

View file

@ -685,4 +685,6 @@ static driver_t bcm_sdhci_driver = {
DRIVER_MODULE(sdhci_bcm, simplebus, bcm_sdhci_driver, bcm_sdhci_devclass,
NULL, NULL);
MODULE_DEPEND(sdhci_bcm, sdhci, 1, 1, 1);
#ifndef MMCCAM
MMC_DECLARE_BRIDGE(sdhci_bcm);
#endif

View file

@ -6,16 +6,18 @@
#
# $FreeBSD$
#NO_UNIVERSE
include BEAGLEBONE
options MMCCAM
# Add CAMDEBUG stuff
options CAMDEBUG
options CAM_DEBUG_FLAGS=(CAM_DEBUG_INFO|CAM_DEBUG_PROBE|CAM_DEBUG_PERIPH|CAM_DEBUG_TRACE)
options CAM_DEBUG_FLAGS=(CAM_DEBUG_INFO|CAM_DEBUG_PROBE|CAM_DEBUG_PERIPH)
# pass(4) device
device pass
device mmccam
options MMCCAM
nodevice mmc
nodevice mmcsd

23
sys/arm/conf/IMX6-MMCCAM Normal file
View file

@ -0,0 +1,23 @@
#
# IMX6-MMCCAM
#
# Custom kernel for IMX6 plus MMCCAM as opposed to the prior MMC stack. It is
# present to keep it building in tree since it wouldn't work in LINT.
#
# $FreeBSD$
#NO_UNIVERSE
include IMX6
options MMCCAM
# Add CAMDEBUG stuff
options CAMDEBUG
options CAM_DEBUG_FLAGS=(CAM_DEBUG_INFO|CAM_DEBUG_PROBE|CAM_DEBUG_PERIPH)
# pass(4) device
device pass
nodevice mmc
nodevice mmcsd

View file

@ -667,6 +667,72 @@ imx51_gpio_pin_toggle(device_t dev, uint32_t pin)
return (0);
}
static int
imx51_gpio_pin_access_32(device_t dev, uint32_t first_pin, uint32_t clear_pins,
uint32_t change_pins, uint32_t *orig_pins)
{
struct imx51_gpio_softc *sc;
if (first_pin != 0)
return (EINVAL);
sc = device_get_softc(dev);
if (orig_pins != NULL)
*orig_pins = READ4(sc, IMX_GPIO_PSR_REG);
if ((clear_pins | change_pins) != 0) {
mtx_lock_spin(&sc->sc_mtx);
WRITE4(sc, IMX_GPIO_DR_REG,
(READ4(sc, IMX_GPIO_DR_REG) & ~clear_pins) ^ change_pins);
mtx_unlock_spin(&sc->sc_mtx);
}
return (0);
}
static int
imx51_gpio_pin_config_32(device_t dev, uint32_t first_pin, uint32_t num_pins,
uint32_t *pin_flags)
{
struct imx51_gpio_softc *sc;
u_int i;
uint32_t bit, drclr, drset, flags, oeclr, oeset, pads;
sc = device_get_softc(dev);
if (first_pin != 0 || num_pins > sc->gpio_npins)
return (EINVAL);
drclr = drset = oeclr = oeset = 0;
pads = READ4(sc, IMX_GPIO_PSR_REG);
for (i = 0; i < num_pins; ++i) {
bit = 1u << i;
flags = pin_flags[i];
if (flags & GPIO_PIN_INPUT) {
oeclr |= bit;
} else if (flags & GPIO_PIN_OUTPUT) {
oeset |= bit;
if (flags & GPIO_PIN_PRESET_LOW)
drclr |= bit;
else if (flags & GPIO_PIN_PRESET_HIGH)
drset |= bit;
else /* Drive whatever it's now pulled to. */
drset |= pads & bit;
}
}
mtx_lock_spin(&sc->sc_mtx);
WRITE4(sc, IMX_GPIO_DR_REG,
(READ4(sc, IMX_GPIO_DR_REG) & ~drclr) | drset);
WRITE4(sc, IMX_GPIO_OE_REG,
(READ4(sc, IMX_GPIO_OE_REG) & ~oeclr) | oeset);
mtx_unlock_spin(&sc->sc_mtx);
return (0);
}
static int
imx51_gpio_probe(device_t dev)
{
@ -790,6 +856,8 @@ static device_method_t imx51_gpio_methods[] = {
DEVMETHOD(gpio_pin_get, imx51_gpio_pin_get),
DEVMETHOD(gpio_pin_set, imx51_gpio_pin_set),
DEVMETHOD(gpio_pin_toggle, imx51_gpio_pin_toggle),
DEVMETHOD(gpio_pin_access_32, imx51_gpio_pin_access_32),
DEVMETHOD(gpio_pin_config_32, imx51_gpio_pin_config_32),
{0, 0},
};

View file

@ -443,7 +443,8 @@ i2c_attach(device_t dev)
/* We don't do a hardware reset here because iicbus_attach() does it. */
bus_generic_attach(dev);
/* Probe and attach the iicbus when interrupts are available. */
config_intrhook_oneshot((ich_func_t)bus_generic_attach, dev);
return (0);
}

View file

@ -85,8 +85,9 @@ __ElfType(Auxinfo);
#define AT_TIMEKEEP 22 /* Pointer to timehands. */
#define AT_STACKPROT 23 /* Initial stack protection. */
#define AT_EHDRFLAGS 24 /* e_flags field from elf hdr */
#define AT_HWCAP 25 /* CPU feature flags. */
#define AT_COUNT 25 /* Count of defined aux entry types. */
#define AT_COUNT 26 /* Count of defined aux entry types. */
#define R_ARM_COUNT 33 /* Count of defined relocation types. */
@ -114,4 +115,10 @@ __ElfType(Auxinfo);
#define ET_DYN_LOAD_ADDR 0x12000
/* Flags passed in AT_HWCAP. */
#define HWCAP_VFP 0x00000040
#define HWCAP_VFPv3 0x00000200
#define HWCAP_VFPv3D16 0x00000400
#define HWCAP_VFPD32 0x00080000
#endif /* !_MACHINE_ELF_H_ */

View file

@ -38,6 +38,7 @@ extern char sigcode[];
extern int szsigcode;
extern uint32_t *vm_page_dump;
extern int vm_page_dump_size;
extern u_long elf_hwcap;
extern int (*_arm_memcpy)(void *, void *, int, int);
extern int (*_arm_bzero)(void *, int, int);

View file

@ -4,5 +4,20 @@
#ifndef _MACHINE_PTRACE_H_
#define _MACHINE_PTRACE_H_
#define __HAVE_PTRACE_MACHDEP
/*
* Must match mcontext_vfp_t. Note that mcontext_vfp_t does not
* include explicit padding.
*/
struct vfpreg {
__uint64_t vfp_reg[32];
__uint32_t vfp_scr;
__uint32_t vfp_pad0;
};
#define PT_GETVFPREGS (PT_FIRSTMACH + 0)
#define PT_SETVFPREGS (PT_FIRSTMACH + 1)
#endif /* !_MACHINE_PTRACE_H */

View file

@ -142,6 +142,8 @@ struct vfp_state {
};
#ifdef _KERNEL
void get_vfpcontext(struct thread *, mcontext_vfp_t *);
void set_vfpcontext(struct thread *, mcontext_vfp_t *);
void vfp_init(void);
void vfp_store(struct vfp_state *, boolean_t);
void vfp_discard(struct thread *);

View file

@ -272,11 +272,7 @@ am335x_get_revision(void)
static void
ti_cpu_ident(void *dummy)
{
phandle_t root;
root = OF_finddevice("/");
if (!ofw_bus_node_is_compatible(root, "ti,omap4") &&
!ofw_bus_node_is_compatible(root, "ti,am33xx"))
if (!ti_soc_is_supported())
return;
switch(ti_chip()) {
case CHIP_OMAP_4:

View file

@ -80,4 +80,10 @@ static __inline int ti_chip(void)
uint32_t ti_revision(void);
static __inline bool ti_soc_is_supported(void)
{
return (_ti_chip != -1);
}
#endif /* _TI_CPUID_H_ */

View file

@ -37,11 +37,6 @@
* incorporate that sometime in the future. The idea being that for transaction
* larger than a certain size the DMA engine is used, for anything less the
* normal interrupt/fifo driven option is used.
*
*
* WARNING: This driver uses mtx_sleep and interrupts to perform transactions,
* which means you can't do a transaction during startup before the interrupts
* have been enabled. Hint - the freebsd function config_intrhook_establish().
*/
#include <sys/cdefs.h>
@ -909,8 +904,8 @@ ti_i2c_attach(device_t dev)
goto out;
}
/* Probe and attach the iicbus */
bus_generic_attach(dev);
/* Probe and attach the iicbus when interrupts are available. */
config_intrhook_oneshot((ich_func_t)bus_generic_attach, dev);
out:
if (err) {

View file

@ -67,6 +67,7 @@ __FBSDID("$FreeBSD$");
#include <dev/fdt/fdt_pinctrl.h>
#include "ti_scm.h"
#include "ti_cpuid.h"
static struct resource_spec ti_scm_res_spec[] = {
{ SYS_RES_MEMORY, 0, RF_ACTIVE }, /* Control memory window */
@ -86,6 +87,10 @@ static struct ti_scm_softc *ti_scm_sc;
static int
ti_scm_probe(device_t dev)
{
if (!ti_soc_is_supported())
return (ENXIO);
if (!ofw_bus_status_okay(dev))
return (ENXIO);

View file

@ -282,6 +282,9 @@ print_cpu_features(u_int cpu)
case ID_AA64ISAR0_SHA2_BASE:
printf("%sSHA2", SEP_STR);
break;
case ID_AA64ISAR0_SHA2_512:
printf("%sSHA2+SHA512", SEP_STR);
break;
default:
printf("%sUnknown SHA2", SEP_STR);
break;
@ -298,6 +301,50 @@ print_cpu_features(u_int cpu)
break;
}
switch (ID_AA64ISAR0_SHA3(cpu_desc[cpu].id_aa64isar0)) {
case ID_AA64ISAR0_SHA3_NONE:
break;
case ID_AA64ISAR0_SHA3_IMPL:
printf("%sSHA3", SEP_STR);
break;
default:
printf("%sUnknown SHA3", SEP_STR);
break;
}
switch (ID_AA64ISAR0_SM3(cpu_desc[cpu].id_aa64isar0)) {
case ID_AA64ISAR0_SM3_NONE:
break;
case ID_AA64ISAR0_SM3_IMPL:
printf("%sSM3", SEP_STR);
break;
default:
printf("%sUnknown SM3", SEP_STR);
break;
}
switch (ID_AA64ISAR0_SM4(cpu_desc[cpu].id_aa64isar0)) {
case ID_AA64ISAR0_SM4_NONE:
break;
case ID_AA64ISAR0_SM4_IMPL:
printf("%sSM4", SEP_STR);
break;
default:
printf("%sUnknown SM4", SEP_STR);
break;
}
switch (ID_AA64ISAR0_DP(cpu_desc[cpu].id_aa64isar0)) {
case ID_AA64ISAR0_DP_NONE:
break;
case ID_AA64ISAR0_DP_IMPL:
printf("%sDotProd", SEP_STR);
break;
default:
printf("%sUnknown DP", SEP_STR);
break;
}
if ((cpu_desc[cpu].id_aa64isar0 & ~ID_AA64ISAR0_MASK) != 0)
printf("%s%#lx", SEP_STR,
cpu_desc[cpu].id_aa64isar0 & ~ID_AA64ISAR0_MASK);
@ -310,6 +357,83 @@ print_cpu_features(u_int cpu)
printed = 0;
printf(" Instruction Set Attributes 1 = <");
switch (ID_AA64ISAR1_GPI(cpu_desc[cpu].id_aa64isar1)) {
case ID_AA64ISAR1_GPI_NONE:
break;
case ID_AA64ISAR1_GPI_IMPL:
printf("%sImpl GenericAuth", SEP_STR);
break;
default:
printf("%sUnknown GenericAuth", SEP_STR);
break;
}
switch (ID_AA64ISAR1_GPA(cpu_desc[cpu].id_aa64isar1)) {
case ID_AA64ISAR1_GPA_NONE:
break;
case ID_AA64ISAR1_GPA_IMPL:
printf("%sPrince GenericAuth", SEP_STR);
break;
default:
printf("%sUnknown GenericAuth", SEP_STR);
break;
}
switch (ID_AA64ISAR1_LRCPC(cpu_desc[cpu].id_aa64isar1)) {
case ID_AA64ISAR1_LRCPC_NONE:
break;
case ID_AA64ISAR1_LRCPC_IMPL:
printf("%sRCpc", SEP_STR);
break;
default:
printf("%sUnknown RCpc", SEP_STR);
break;
}
switch (ID_AA64ISAR1_FCMA(cpu_desc[cpu].id_aa64isar1)) {
case ID_AA64ISAR1_FCMA_NONE:
break;
case ID_AA64ISAR1_FCMA_IMPL:
printf("%sFCMA", SEP_STR);
break;
default:
printf("%sUnknown FCMA", SEP_STR);
break;
}
switch (ID_AA64ISAR1_JSCVT(cpu_desc[cpu].id_aa64isar1)) {
case ID_AA64ISAR1_JSCVT_NONE:
break;
case ID_AA64ISAR1_JSCVT_IMPL:
printf("%sJS Conv", SEP_STR);
break;
default:
printf("%sUnknown JS Conv", SEP_STR);
break;
}
switch (ID_AA64ISAR1_API(cpu_desc[cpu].id_aa64isar1)) {
case ID_AA64ISAR1_API_NONE:
break;
case ID_AA64ISAR1_API_IMPL:
printf("%sImpl AddrAuth", SEP_STR);
break;
default:
printf("%sUnknown Impl AddrAuth", SEP_STR);
break;
}
switch (ID_AA64ISAR1_APA(cpu_desc[cpu].id_aa64isar1)) {
case ID_AA64ISAR1_APA_NONE:
break;
case ID_AA64ISAR1_APA_IMPL:
printf("%sPrince AddrAuth", SEP_STR);
break;
default:
printf("%sUnknown Prince AddrAuth", SEP_STR);
break;
}
switch (ID_AA64ISAR1_DPB(cpu_desc[cpu].id_aa64isar1)) {
case ID_AA64ISAR1_DPB_NONE:
break;
@ -688,6 +812,29 @@ print_cpu_features(u_int cpu)
printed = 0;
printf(" Memory Model Features 2 = <");
switch (ID_AA64MMFR2_NV(cpu_desc[cpu].id_aa64mmfr2)) {
case ID_AA64MMFR2_NV_NONE:
break;
case ID_AA64MMFR2_NV_IMPL:
printf("%sNestedVirt", SEP_STR);
break;
default:
printf("%sUnknown NestedVirt", SEP_STR);
break;
}
switch (ID_AA64MMFR2_CCIDX(cpu_desc[cpu].id_aa64mmfr2)) {
case ID_AA64MMFR2_CCIDX_32:
printf("%s32b CCIDX", SEP_STR);
break;
case ID_AA64MMFR2_CCIDX_64:
printf("%s64b CCIDX", SEP_STR);
break;
default:
printf("%sUnknown CCIDX", SEP_STR);
break;
}
switch (ID_AA64MMFR2_VA_RANGE(cpu_desc[cpu].id_aa64mmfr2)) {
case ID_AA64MMFR2_VA_RANGE_48:
printf("%s48b VA", SEP_STR);
@ -897,11 +1044,7 @@ identify_cpu(void)
cpu_desc[cpu].id_aa64isar1 = READ_SPECIALREG(ID_AA64ISAR1_EL1);
cpu_desc[cpu].id_aa64mmfr0 = READ_SPECIALREG(ID_AA64MMFR0_EL1);
cpu_desc[cpu].id_aa64mmfr1 = READ_SPECIALREG(ID_AA64MMFR1_EL1);
#ifdef NOTYET
cpu_desc[cpu].id_aa64mmfr2 = READ_SPECIALREG(ID_AA64MMFR2_EL1);
#else
cpu_desc[cpu].id_aa64mmfr2 = 0;
#endif
cpu_desc[cpu].id_aa64pfr0 = READ_SPECIALREG(ID_AA64PFR0_EL1);
cpu_desc[cpu].id_aa64pfr1 = READ_SPECIALREG(ID_AA64PFR1_EL1);

View file

@ -77,6 +77,7 @@ __FBSDID("$FreeBSD$");
#include <machine/md_var.h>
#include <machine/pcb.h>
#include <machine/reg.h>
#include <machine/undefined.h>
#include <machine/vmparam.h>
#ifdef VFP
@ -162,6 +163,7 @@ static void
cpu_startup(void *dummy)
{
undef_init();
identify_cpu();
vm_ksubmap_init(&kmi);

View file

@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$");
#include <machine/frame.h>
#include <machine/pcb.h>
#include <machine/pcpu.h>
#include <machine/undefined.h>
#ifdef KDTRACE_HOOKS
#include <sys/dtrace_bsd.h>
@ -332,6 +333,10 @@ do_el1h_sync(struct thread *td, struct trapframe *frame)
panic("No debugger in kernel.\n");
#endif
break;
case EXCP_UNKNOWN:
if (undef_insn(1, frame))
break;
/* FALLTHROUGH */
default:
print_registers(frame);
panic("Unknown kernel exception %x esr_el1 %lx\n", exception,
@ -341,20 +346,6 @@ do_el1h_sync(struct thread *td, struct trapframe *frame)
td->td_frame = oframe;
}
/*
* The attempted execution of an instruction bit pattern that has no allocated
* instruction results in an exception with an unknown reason.
*/
static void
el0_excp_unknown(struct trapframe *frame, uint64_t far)
{
struct thread *td;
td = curthread;
call_trapsignal(td, SIGILL, ILL_ILLTRP, (void *)far);
userret(td, frame);
}
void
do_el0_sync(struct thread *td, struct trapframe *frame)
{
@ -399,7 +390,9 @@ do_el0_sync(struct thread *td, struct trapframe *frame)
data_abort(td, frame, esr, far, 1);
break;
case EXCP_UNKNOWN:
el0_excp_unknown(frame, far);
if (!undef_insn(0, frame))
call_trapsignal(td, SIGILL, ILL_ILLTRP, (void *)far);
userret(td, frame);
break;
case EXCP_SP_ALIGN:
call_trapsignal(td, SIGBUS, BUS_ADRALN, (void *)frame->tf_sp);

145
sys/arm64/arm64/undefined.c Normal file
View file

@ -0,0 +1,145 @@
/*-
* Copyright (c) 2017 Andrew Turner
* All rights reserved.
*
* This software was developed by SRI International and the University of
* Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237
* ("CTSRD"), as part of the DARPA CRASH research programme.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/queue.h>
#include <machine/frame.h>
#include <machine/undefined.h>
MALLOC_DEFINE(M_UNDEF, "undefhandler", "Undefined instruction handler data");
struct undef_handler {
LIST_ENTRY(undef_handler) uh_link;
undef_handler_t uh_handler;
};
/*
* Create two undefined instruction handler lists, one for userspace, one for
* the kernel. This allows us to handle instructions that will trap
*/
LIST_HEAD(, undef_handler) undef_handlers[2];
/*
* Work around a bug in QEMU prior to 2.5.1 where reading unknown ID
* registers would raise an exception when they should return 0.
*/
static int
id_aa64mmfr2_handler(vm_offset_t va, uint32_t insn, struct trapframe *frame,
uint32_t esr)
{
int reg;
#define MRS_MASK 0xfff00000
#define MRS_VALUE 0xd5300000
#define MRS_REGISTER(insn) ((insn) & 0x1f)
#define MRS_ID_AA64MMFR2_EL0_MASK (MRS_MASK | 0x000fffe0)
#define MRS_ID_AA64MMFR2_EL0_VALUE (MRS_VALUE | 0x00080740)
/* mrs xn, id_aa64mfr2_el1 */
if ((insn & MRS_ID_AA64MMFR2_EL0_MASK) == MRS_ID_AA64MMFR2_EL0_VALUE) {
reg = MRS_REGISTER(insn);
frame->tf_elr += INSN_SIZE;
if (reg < nitems(frame->tf_x)) {
frame->tf_x[reg] = 0;
} else if (reg == 30) {
frame->tf_lr = 0;
}
/* If reg is 32 then write to xzr, i.e. do nothing */
return (1);
}
return (0);
}
void
undef_init(void)
{
LIST_INIT(&undef_handlers[0]);
LIST_INIT(&undef_handlers[1]);
install_undef_handler(false, id_aa64mmfr2_handler);
}
void *
install_undef_handler(bool user, undef_handler_t func)
{
struct undef_handler *uh;
uh = malloc(sizeof(*uh), M_UNDEF, M_WAITOK);
uh->uh_handler = func;
LIST_INSERT_HEAD(&undef_handlers[user ? 0 : 1], uh, uh_link);
return (uh);
}
void
remove_undef_handler(void *handle)
{
struct undef_handler *uh;
uh = handle;
LIST_REMOVE(uh, uh_link);
free(handle, M_UNDEF);
}
int
undef_insn(u_int el, struct trapframe *frame)
{
struct undef_handler *uh;
uint32_t insn;
int ret;
KASSERT(el < 2, ("Invalid exception level %u", el));
if (el == 0) {
ret = fueword32((uint32_t *)frame->tf_elr, &insn);
if (ret != 0)
panic("Unable to read userspace faulting instruction");
} else {
insn = *(uint32_t *)frame->tf_elr;
}
LIST_FOREACH(uh, &undef_handlers[el], uh_link) {
ret = uh->uh_handler(frame->tf_elr, insn, frame, frame->tf_esr);
if (ret)
return (1);
}
return (0);
}

View file

@ -119,6 +119,7 @@ options PCI_HP # PCI-Express native HotPlug
options PCI_IOV # PCI SR-IOV support
# Ethernet NICs
device mdio
device mii
device miibus # MII bus support
device awg # Allwinner EMAC Gigabit Ethernet
@ -126,6 +127,7 @@ device axgbe # AMD Opteron A1100 integrated NIC
device em # Intel PRO/1000 Gigabit Ethernet Family
device ix # Intel 10Gb Ethernet Family
device msk # Marvell/SysKonnect Yukon II Gigabit Ethernet
device neta # Marvell Armada 370/38x/XP/3700 NIC
device smc # SMSC LAN91C111
device vnic # Cavium ThunderX NIC
device al_eth # Annapurna Alpine Ethernet NIC
@ -147,6 +149,7 @@ device dwmmc
# Serial (COM) ports
device uart # Generic UART driver
device uart_mvebu # Armada 3700 UART driver
device uart_ns8250 # ns8250-type UART driver
device uart_snps
device pl011
@ -158,7 +161,9 @@ device aw_usbphy # Allwinner USB PHY
device dwcotg # DWC OTG controller
device ohci # OHCI USB interface
device ehci # EHCI USB interface (USB 2.0)
device ehci_mv # Marvell EHCI USB interface
device xhci # XHCI PCI->USB interface (USB 3.0)
device xhci_mv # Marvell XHCI USB interface
device usb # USB Bus (required)
device ukbd # Keyboard
device umass # Disks/Mass storage - Requires scbus and da

View file

@ -0,0 +1,22 @@
#
# GENERIC-MMCCAM
#
# Custom kernel for arm64 plus MMCCAM as opposed to the prior MMC stack. It is
# present to keep it building in tree since it wouldn't work in LINT.
#
# $FreeBSD$
#NO_UNIVERSE
include GENERIC
# Add CAMDEBUG stuff
options CAMDEBUG
options CAM_DEBUG_FLAGS=(CAM_DEBUG_INFO|CAM_DEBUG_PROBE|CAM_DEBUG_PERIPH)
# pass(4) device
device pass
options MMCCAM
nodevice mmc
nodevice mmcsd

View file

@ -205,7 +205,7 @@
#define ID_AA64DFR0_PMS_VER_V1 (0x1ul << ID_AA64DFR0_PMS_VER_SHIFT)
/* ID_AA64ISAR0_EL1 */
#define ID_AA64ISAR0_MASK 0xf0fffff0
#define ID_AA64ISAR0_MASK 0x0000fffff0fffff0ul
#define ID_AA64ISAR0_AES_SHIFT 4
#define ID_AA64ISAR0_AES_MASK (0xf << ID_AA64ISAR0_AES_SHIFT)
#define ID_AA64ISAR0_AES(x) ((x) & ID_AA64ISAR0_AES_MASK)
@ -222,6 +222,7 @@
#define ID_AA64ISAR0_SHA2(x) ((x) & ID_AA64ISAR0_SHA2_MASK)
#define ID_AA64ISAR0_SHA2_NONE (0x0 << ID_AA64ISAR0_SHA2_SHIFT)
#define ID_AA64ISAR0_SHA2_BASE (0x1 << ID_AA64ISAR0_SHA2_SHIFT)
#define ID_AA64ISAR0_SHA2_512 (0x2 << ID_AA64ISAR0_SHA2_SHIFT)
#define ID_AA64ISAR0_CRC32_SHIFT 16
#define ID_AA64ISAR0_CRC32_MASK (0xf << ID_AA64ISAR0_CRC32_SHIFT)
#define ID_AA64ISAR0_CRC32(x) ((x) & ID_AA64ISAR0_CRC32_MASK)
@ -237,14 +238,69 @@
#define ID_AA64ISAR0_RDM(x) ((x) & ID_AA64ISAR0_RDM_MASK)
#define ID_AA64ISAR0_RDM_NONE (0x0 << ID_AA64ISAR0_RDM_SHIFT)
#define ID_AA64ISAR0_RDM_IMPL (0x1 << ID_AA64ISAR0_RDM_SHIFT)
#define ID_AA64ISAR0_SHA3_SHIFT 32
#define ID_AA64ISAR0_SHA3_MASK (0xful << ID_AA64ISAR0_SHA3_SHIFT)
#define ID_AA64ISAR0_SHA3(x) ((x) & ID_AA64ISAR0_SHA3_MASK)
#define ID_AA64ISAR0_SHA3_NONE (0x0ul << ID_AA64ISAR0_SHA3_SHIFT)
#define ID_AA64ISAR0_SHA3_IMPL (0x1ul << ID_AA64ISAR0_SHA3_SHIFT)
#define ID_AA64ISAR0_SM3_SHIFT 36
#define ID_AA64ISAR0_SM3_MASK (0xful << ID_AA64ISAR0_SM3_SHIFT)
#define ID_AA64ISAR0_SM3(x) ((x) & ID_AA64ISAR0_SM3_MASK)
#define ID_AA64ISAR0_SM3_NONE (0x0ul << ID_AA64ISAR0_SM3_SHIFT)
#define ID_AA64ISAR0_SM3_IMPL (0x1ul << ID_AA64ISAR0_SM3_SHIFT)
#define ID_AA64ISAR0_SM4_SHIFT 40
#define ID_AA64ISAR0_SM4_MASK (0xful << ID_AA64ISAR0_SM4_SHIFT)
#define ID_AA64ISAR0_SM4(x) ((x) & ID_AA64ISAR0_SM4_MASK)
#define ID_AA64ISAR0_SM4_NONE (0x0ul << ID_AA64ISAR0_SM4_SHIFT)
#define ID_AA64ISAR0_SM4_IMPL (0x1ul << ID_AA64ISAR0_SM4_SHIFT)
#define ID_AA64ISAR0_DP_SHIFT 48
#define ID_AA64ISAR0_DP_MASK (0xful << ID_AA64ISAR0_DP_SHIFT)
#define ID_AA64ISAR0_DP(x) ((x) & ID_AA64ISAR0_DP_MASK)
#define ID_AA64ISAR0_DP_NONE (0x0ul << ID_AA64ISAR0_DP_SHIFT)
#define ID_AA64ISAR0_DP_IMPL (0x1ul << ID_AA64ISAR0_DP_SHIFT)
/* ID_AA64ISAR1_EL1 */
#define ID_AA64ISAR1_MASK 0x0000000f
#define ID_AA64ISAR1_MASK 0xffffffff
#define ID_AA64ISAR1_DPB_SHIFT 0
#define ID_AA64ISAR1_DPB_MASK (0xf << ID_AA64ISAR1_DPB_SHIFT)
#define ID_AA64ISAR1_DPB(x) ((x) & ID_AA64ISAR1_DPB_MASK)
#define ID_AA64ISAR1_DPB_NONE (0x0 << ID_AA64ISAR1_DPB_SHIFT)
#define ID_AA64ISAR1_DPB_IMPL (0x1 << ID_AA64ISAR1_DPB_SHIFT)
#define ID_AA64ISAR1_APA_SHIFT 4
#define ID_AA64ISAR1_APA_MASK (0xf << ID_AA64ISAR1_APA_SHIFT)
#define ID_AA64ISAR1_APA(x) ((x) & ID_AA64ISAR1_APA_MASK)
#define ID_AA64ISAR1_APA_NONE (0x0 << ID_AA64ISAR1_APA_SHIFT)
#define ID_AA64ISAR1_APA_IMPL (0x1 << ID_AA64ISAR1_APA_SHIFT)
#define ID_AA64ISAR1_API_SHIFT 8
#define ID_AA64ISAR1_API_MASK (0xf << ID_AA64ISAR1_API_SHIFT)
#define ID_AA64ISAR1_API(x) ((x) & ID_AA64ISAR1_API_MASK)
#define ID_AA64ISAR1_API_NONE (0x0 << ID_AA64ISAR1_API_SHIFT)
#define ID_AA64ISAR1_API_IMPL (0x1 << ID_AA64ISAR1_API_SHIFT)
#define ID_AA64ISAR1_JSCVT_SHIFT 12
#define ID_AA64ISAR1_JSCVT_MASK (0xf << ID_AA64ISAR1_JSCVT_SHIFT)
#define ID_AA64ISAR1_JSCVT(x) ((x) & ID_AA64ISAR1_JSCVT_MASK)
#define ID_AA64ISAR1_JSCVT_NONE (0x0 << ID_AA64ISAR1_JSCVT_SHIFT)
#define ID_AA64ISAR1_JSCVT_IMPL (0x1 << ID_AA64ISAR1_JSCVT_SHIFT)
#define ID_AA64ISAR1_FCMA_SHIFT 16
#define ID_AA64ISAR1_FCMA_MASK (0xf << ID_AA64ISAR1_FCMA_SHIFT)
#define ID_AA64ISAR1_FCMA(x) ((x) & ID_AA64ISAR1_FCMA_MASK)
#define ID_AA64ISAR1_FCMA_NONE (0x0 << ID_AA64ISAR1_FCMA_SHIFT)
#define ID_AA64ISAR1_FCMA_IMPL (0x1 << ID_AA64ISAR1_FCMA_SHIFT)
#define ID_AA64ISAR1_LRCPC_SHIFT 20
#define ID_AA64ISAR1_LRCPC_MASK (0xf << ID_AA64ISAR1_LRCPC_SHIFT)
#define ID_AA64ISAR1_LRCPC(x) ((x) & ID_AA64ISAR1_LRCPC_MASK)
#define ID_AA64ISAR1_LRCPC_NONE (0x0 << ID_AA64ISAR1_LRCPC_SHIFT)
#define ID_AA64ISAR1_LRCPC_IMPL (0x1 << ID_AA64ISAR1_LRCPC_SHIFT)
#define ID_AA64ISAR1_GPA_SHIFT 24
#define ID_AA64ISAR1_GPA_MASK (0xf << ID_AA64ISAR1_GPA_SHIFT)
#define ID_AA64ISAR1_GPA(x) ((x) & ID_AA64ISAR1_GPA_MASK)
#define ID_AA64ISAR1_GPA_NONE (0x0 << ID_AA64ISAR1_GPA_SHIFT)
#define ID_AA64ISAR1_GPA_IMPL (0x1 << ID_AA64ISAR1_GPA_SHIFT)
#define ID_AA64ISAR1_GPI_SHIFT 28
#define ID_AA64ISAR1_GPI_MASK (0xf << ID_AA64ISAR1_GPI_SHIFT)
#define ID_AA64ISAR1_GPI(x) ((x) & ID_AA64ISAR1_GPI_MASK)
#define ID_AA64ISAR1_GPI_NONE (0x0 << ID_AA64ISAR1_GPI_SHIFT)
#define ID_AA64ISAR1_GPI_IMPL (0x1 << ID_AA64ISAR1_GPI_SHIFT)
/* ID_AA64MMFR0_EL1 */
#define ID_AA64MMFR0_MASK 0xffffffff
@ -342,7 +398,7 @@
/* ID_AA64MMFR2_EL1 */
#define ID_AA64MMFR2_EL1 S3_0_C0_C7_2
#define ID_AA64MMFR2_MASK 0x000fffff
#define ID_AA64MMFR2_MASK 0x0fffffff
#define ID_AA64MMFR2_CNP_SHIFT 0
#define ID_AA64MMFR2_CNP_MASK (0xf << ID_AA64MMFR2_CNP_SHIFT)
#define ID_AA64MMFR2_CNP(x) ((x) & ID_AA64MMFR2_CNP_MASK)
@ -368,6 +424,16 @@
#define ID_AA64MMFR2_VA_RANGE(x) ((x) & ID_AA64MMFR2_VA_RANGE_MASK)
#define ID_AA64MMFR2_VA_RANGE_48 (0x0 << ID_AA64MMFR2_VA_RANGE_SHIFT)
#define ID_AA64MMFR2_VA_RANGE_52 (0x1 << ID_AA64MMFR2_VA_RANGE_SHIFT)
#define ID_AA64MMFR2_CCIDX_SHIFT 20
#define ID_AA64MMFR2_CCIDX_MASK (0xf << ID_AA64MMFR2_CCIDX_SHIFT)
#define ID_AA64MMFR2_CCIDX(x) ((x) & ID_AA64MMFR2_CCIDX_MASK)
#define ID_AA64MMFR2_CCIDX_32 (0x0 << ID_AA64MMFR2_CCIDX_SHIFT)
#define ID_AA64MMFR2_CCIDX_64 (0x1 << ID_AA64MMFR2_CCIDX_SHIFT)
#define ID_AA64MMFR2_NV_SHIFT 24
#define ID_AA64MMFR2_NV_MASK (0xf << ID_AA64MMFR2_NV_SHIFT)
#define ID_AA64MMFR2_NV(x) ((x) & ID_AA64MMFR2_NV_MASK)
#define ID_AA64MMFR2_NV_NONE (0x0 << ID_AA64MMFR2_NV_SHIFT)
#define ID_AA64MMFR2_NV_IMPL (0x1 << ID_AA64MMFR2_NV_SHIFT)
/* ID_AA64PFR0_EL1 */
#define ID_AA64PFR0_MASK 0x0000000ffffffffful

View file

@ -90,8 +90,10 @@ __ElfType(Auxinfo);
#define AT_PAGESIZESLEN 21 /* Number of pagesizes. */
#define AT_TIMEKEEP 22 /* Pointer to timehands. */
#define AT_STACKPROT 23 /* Initial stack protection. */
#define AT_EHDRFLAGS 24 /* e_flags field from elf hdr */
#define AT_HWCAP 25 /* CPU feature flags. */
#define AT_COUNT 24 /* Count of defined aux entry types. */
#define AT_COUNT 26 /* Count of defined aux entry types. */
/* Define "machine" characteristics */
#define ELF_TARG_CLASS ELFCLASS64

View file

@ -0,0 +1,44 @@
/*-
* Copyright (c) 2017 Andrew Turner
* All rights reserved.
*
* This software was developed by SRI International and the University of
* Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237
* ("CTSRD"), as part of the DARPA CRASH research programme.
*
* 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 _MACHINE__UNDEFINED_H_
#define _MACHINE__UNDEFINED_H_
typedef int (*undef_handler_t)(vm_offset_t, uint32_t, struct trapframe *,
uint32_t);
void undef_init(void);
void *install_undef_handler(bool, undef_handler_t);
void remove_undef_handler(void *);
int undef_insn(u_int, struct trapframe *);
#endif

View file

@ -487,6 +487,11 @@ That happens before entering single-user mode or multi-user
mode (but after executing the
.Va init_script
if enabled).
This functionality has generally been eclipsed by rerooting.
See
.Xr reboot 8
.Fl r
for details.
.It Va init_path
Sets the list of binaries which the kernel will try to run as the initial
process.
@ -508,6 +513,11 @@ if the script terminates with a non-zero exit code,
or if a SIGTERM is delivered to the
.Xr init 8
process (PID 1).
This functionality has generally been eclipsed by rerooting.
See
.Xr reboot 8
.Fl r
for details.
.It Va init_shell
Defines the shell binary to be used for executing the various shell scripts.
The default is

View file

@ -127,7 +127,6 @@ boot1.o: ${.CURDIR}/../../common/ufsread.c
# created by generate-fat.sh
.include "${.CURDIR}/Makefile.fat"
BOOT1_MAXSIZE?= 131072
boot1.efifat: boot1.efi
@set -- `ls -l ${.ALLSRC}`; \
@ -137,9 +136,7 @@ boot1.efifat: boot1.efi
exit 1; \
fi
echo ${.OBJDIR}
uudecode ${.CURDIR}/fat-${MACHINE}.tmpl.bz2.uu
mv fat-${MACHINE}.tmpl.bz2 ${.TARGET}.bz2
bzip2 -f -d ${.TARGET}.bz2
xz -d -c ${.CURDIR}/fat-${MACHINE}.tmpl.xz > ${.TARGET}
${DD} if=${.ALLSRC} of=${.TARGET} seek=${BOOT1_OFFSET} conv=notrunc
CLEANFILES= boot1.efi boot1.efifat

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