Merge ^/head r294777 through r294960.

This commit is contained in:
dim 2016-01-27 22:52:20 +00:00
commit aef1771e36
388 changed files with 179308 additions and 149815 deletions

View File

@ -2841,8 +2841,11 @@ Do not actually receive the stream. This can be useful in conjunction with the
option to verify the name the receive operation would use.
.It Fl o Sy origin Ns = Ns Ar snapshot
Forces the stream to be received as a clone of the given snapshot.
This is only valid if the stream is an incremental stream whose source
is the same as the provided origin.
If the stream is a full send stream, this will create the filesystem
described by the stream as a clone of the specified snapshot. Which
snapshot was specified will not affect the success or failure of the
receive, as long as the snapshot does exist. If the stream is an
incremental send stream, all the normal verification will be performed.
.It Fl F
Force a rollback of the file system to the most recent snapshot before
performing the receive operation. If receiving an incremental replication

View File

@ -26,6 +26,7 @@
* Copyright (c) 2012 Pawel Jakub Dawidek <pawel@dawidek.net>.
* All rights reserved.
* Copyright (c) 2013 Steven Hartland. All rights reserved.
* Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved.
*/
#include <assert.h>
@ -67,7 +68,7 @@ extern void zfs_setprop_error(libzfs_handle_t *, zfs_prop_t, int, char *);
static int zfs_receive_impl(libzfs_handle_t *, const char *, const char *,
recvflags_t *, int, const char *, nvlist_t *, avl_tree_t *, char **, int,
uint64_t *);
uint64_t *, const char *);
static int guid_to_name(libzfs_handle_t *, const char *,
uint64_t, boolean_t, char *);
@ -2602,6 +2603,7 @@ zfs_receive_package(libzfs_handle_t *hdl, int fd, const char *destname,
nvlist_t *stream_nv = NULL;
avl_tree_t *stream_avl = NULL;
char *fromsnap = NULL;
char *sendsnap = NULL;
char *cp;
char tofs[ZFS_MAXNAMELEN];
char sendfs[ZFS_MAXNAMELEN];
@ -2750,8 +2752,16 @@ zfs_receive_package(libzfs_handle_t *hdl, int fd, const char *destname,
*/
(void) strlcpy(sendfs, drr->drr_u.drr_begin.drr_toname,
ZFS_MAXNAMELEN);
if ((cp = strchr(sendfs, '@')) != NULL)
if ((cp = strchr(sendfs, '@')) != NULL) {
*cp = '\0';
/*
* Find the "sendsnap", the final snapshot in a replication
* stream. zfs_receive_one() handles certain errors
* differently, depending on if the contained stream is the
* last one or not.
*/
sendsnap = (cp + 1);
}
/* Finally, receive each contained stream */
do {
@ -2764,7 +2774,7 @@ zfs_receive_package(libzfs_handle_t *hdl, int fd, const char *destname,
*/
error = zfs_receive_impl(hdl, destname, NULL, flags, fd,
sendfs, stream_nv, stream_avl, top_zfs, cleanup_fd,
action_handlep);
action_handlep, sendsnap);
if (error == ENODATA) {
error = 0;
break;
@ -2930,7 +2940,7 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
const char *originsnap, recvflags_t *flags, dmu_replay_record_t *drr,
dmu_replay_record_t *drr_noswap, const char *sendfs, nvlist_t *stream_nv,
avl_tree_t *stream_avl, char **top_zfs, int cleanup_fd,
uint64_t *action_handlep)
uint64_t *action_handlep, const char *finalsnap)
{
zfs_cmd_t zc = { 0 };
time_t begin_time;
@ -2947,6 +2957,7 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
nvlist_t *snapprops_nvlist = NULL;
zprop_errflags_t prop_errflags;
boolean_t recursive;
char *snapname = NULL;
begin_time = time(NULL);
@ -2957,7 +2968,6 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
ENOENT);
if (stream_avl != NULL) {
char *snapname;
nvlist_t *fs = fsavl_find(stream_avl, drrb->drr_toguid,
&snapname);
nvlist_t *props;
@ -3313,7 +3323,21 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
ZPROP_N_MORE_ERRORS) == 0) {
trunc_prop_errs(intval);
break;
} else {
} else if (snapname == NULL || finalsnap == NULL ||
strcmp(finalsnap, snapname) == 0 ||
strcmp(nvpair_name(prop_err),
zfs_prop_to_name(ZFS_PROP_REFQUOTA)) != 0) {
/*
* Skip the special case of, for example,
* "refquota", errors on intermediate
* snapshots leading up to a final one.
* That's why we have all of the checks above.
*
* See zfs_ioctl.c's extract_delay_props() for
* a list of props which can fail on
* intermediate snapshots, but shouldn't
* affect the overall receive.
*/
(void) snprintf(tbuf, sizeof (tbuf),
dgettext(TEXT_DOMAIN,
"cannot receive %s property on %s"),
@ -3498,7 +3522,7 @@ static int
zfs_receive_impl(libzfs_handle_t *hdl, const char *tosnap,
const char *originsnap, recvflags_t *flags, int infd, const char *sendfs,
nvlist_t *stream_nv, avl_tree_t *stream_avl, char **top_zfs, int cleanup_fd,
uint64_t *action_handlep)
uint64_t *action_handlep, const char *finalsnap)
{
int err;
dmu_replay_record_t drr, drr_noswap;
@ -3594,10 +3618,11 @@ zfs_receive_impl(libzfs_handle_t *hdl, const char *tosnap,
if ((cp = strchr(nonpackage_sendfs, '@')) != NULL)
*cp = '\0';
sendfs = nonpackage_sendfs;
VERIFY(finalsnap == NULL);
}
return (zfs_receive_one(hdl, infd, tosnap, originsnap, flags,
&drr, &drr_noswap, sendfs, stream_nv, stream_avl, top_zfs,
cleanup_fd, action_handlep));
cleanup_fd, action_handlep, finalsnap));
} else {
assert(DMU_GET_STREAM_HDRTYPE(drrb->drr_versioninfo) ==
DMU_COMPOUNDSTREAM);
@ -3632,7 +3657,7 @@ zfs_receive(libzfs_handle_t *hdl, const char *tosnap, nvlist_t *props,
VERIFY(cleanup_fd >= 0);
err = zfs_receive_impl(hdl, tosnap, originsnap, flags, infd, NULL, NULL,
stream_avl, &top_zfs, cleanup_fd, &action_handle);
stream_avl, &top_zfs, cleanup_fd, &action_handle, NULL);
VERIFY(0 == close(cleanup_fd));

View File

@ -45,10 +45,10 @@ struct tcp_index {
};
static uint64_t tcp_tick;
static uint64_t tcp_stats_tick;
static struct tcpstat tcpstat;
static struct xinpgen *xinpgen;
static size_t xinpgen_len;
static u_int tcp_count;
static u_int tcp_total;
static u_int oidnum;
@ -64,13 +64,9 @@ tcp_compare(const void *p1, const void *p2)
}
static int
fetch_tcp(void)
fetch_tcp_stats(void)
{
size_t len;
struct xinpgen *ptr;
struct xtcpcb *tp;
struct tcp_index *oid;
in_addr_t inaddr;
len = sizeof(tcpstat);
if (sysctlbyname("net.inet.tcp.stats", &tcpstat, &len, NULL, 0) == -1) {
@ -82,6 +78,20 @@ fetch_tcp(void)
return (-1);
}
tcp_stats_tick = get_ticks();
return (0);
}
static int
fetch_tcp(void)
{
size_t len;
struct xinpgen *ptr;
struct xtcpcb *tp;
struct tcp_index *oid;
in_addr_t inaddr;
len = 0;
if (sysctlbyname("net.inet.tcp.pcblist", NULL, &len, NULL, 0) == -1) {
syslog(LOG_ERR, "net.inet.tcp.pcblist: %m");
@ -102,7 +112,6 @@ fetch_tcp(void)
tcp_tick = get_ticks();
tcp_count = 0;
tcp_total = 0;
for (ptr = (struct xinpgen *)(void *)((char *)xinpgen + xinpgen->xig_len);
ptr->xig_len > sizeof(struct xinpgen);
@ -114,10 +123,6 @@ fetch_tcp(void)
if (tp->xt_inp.inp_vflag & INP_IPV4)
tcp_total++;
if (tp->xt_tp.t_state == TCPS_ESTABLISHED ||
tp->xt_tp.t_state == TCPS_CLOSE_WAIT)
tcp_count++;
}
if (oidnum < tcp_total) {
@ -184,8 +189,8 @@ op_tcp(struct snmp_context *ctx __unused, struct snmp_value *value,
abort();
}
if (tcp_tick < this_tick)
if (fetch_tcp() == -1)
if (tcp_stats_tick < this_tick)
if (fetch_tcp_stats() == -1)
return (SNMP_ERR_GENERR);
switch (value->var.subs[sub - 1]) {
@ -226,7 +231,8 @@ op_tcp(struct snmp_context *ctx __unused, struct snmp_value *value,
break;
case LEAF_tcpCurrEstab:
value->v.uint32 = tcp_count;
value->v.uint32 = tcpstat.tcps_states[TCPS_ESTABLISHED] +
tcpstat.tcps_states[TCPS_CLOSE_WAIT];
break;
case LEAF_tcpInSegs:

View File

@ -206,7 +206,8 @@ ATF_TC_BODY(mincore_resid, tc)
"might be low on memory");
#ifdef __FreeBSD__
ATF_REQUIRE(mlock(addr, npgs * page) == 0);
ATF_REQUIRE_MSG(mlock(addr, npgs * page) == 0, "mlock failed: %s",
strerror(errno));
#endif
ATF_REQUIRE(check_residency(addr, npgs) == npgs);
ATF_REQUIRE(munmap(addr, npgs * page) == 0);

View File

@ -47,12 +47,89 @@ __RCSID("$NetBSD: t_mlock.c,v 1.5 2014/02/26 20:49:26 martin Exp $");
#include <unistd.h>
#ifdef __FreeBSD__
#include <limits.h>
#define _KMEMUSER
#include <machine/vmparam.h>
#endif
static long page = 0;
#ifdef __FreeBSD__
#define VM_MAX_WIRED "vm.max_wired"
static void
vm_max_wired_sysctl(int *old_value, int *new_value)
{
size_t old_len;
size_t new_len = (new_value == NULL ? 0 : sizeof(int));
if (old_value == NULL)
printf("Setting the new value to %d\n", *new_value);
else {
ATF_REQUIRE_MSG(sysctlbyname(VM_MAX_WIRED, NULL, &old_len,
new_value, new_len) == 0,
"sysctlbyname(%s) failed: %s", VM_MAX_WIRED, strerror(errno));
}
ATF_REQUIRE_MSG(sysctlbyname(VM_MAX_WIRED, old_value, &old_len,
new_value, new_len) == 0,
"sysctlbyname(%s) failed: %s", VM_MAX_WIRED, strerror(errno));
if (old_value != NULL)
printf("Saved the old value (%d)\n", *old_value);
}
static void
set_vm_max_wired(int new_value)
{
FILE *fp;
int old_value;
fp = fopen(VM_MAX_WIRED, "w");
if (fp == NULL) {
atf_tc_skip("could not open %s for writing: %s",
VM_MAX_WIRED, strerror(errno));
return;
}
vm_max_wired_sysctl(&old_value, NULL);
ATF_REQUIRE_MSG(fprintf(fp, "%d", old_value) > 0,
"saving %s failed", VM_MAX_WIRED);
fclose(fp);
vm_max_wired_sysctl(NULL, &new_value);
}
static void
restore_vm_max_wired(void)
{
FILE *fp;
int saved_max_wired;
fp = fopen(VM_MAX_WIRED, "r");
if (fp == NULL) {
perror("fopen failed\n");
return;
}
if (fscanf(fp, "%d", &saved_max_wired) != 1) {
perror("fscanf failed\n");
fclose(fp);
return;
}
fclose(fp);
printf("old value in %s: %d\n", VM_MAX_WIRED, saved_max_wired);
if (saved_max_wired == 0) /* This will cripple the test host */
return;
vm_max_wired_sysctl(NULL, &saved_max_wired);
}
#endif
ATF_TC(mlock_clip);
ATF_TC_HEAD(mlock_clip, tc)
{
@ -78,11 +155,19 @@ ATF_TC_BODY(mlock_clip, tc)
free(buf);
}
#ifdef __FreeBSD__
ATF_TC_WITH_CLEANUP(mlock_err);
#else
ATF_TC(mlock_err);
#endif
ATF_TC_HEAD(mlock_err, tc)
{
atf_tc_set_md_var(tc, "descr",
"Test error conditions in mlock(2) and munlock(2)");
#ifdef __FreeBSD__
atf_tc_set_md_var(tc, "require.config", "allow_sysctl_side_effects");
atf_tc_set_md_var(tc, "require.user", "root");
#endif
}
ATF_TC_BODY(mlock_err, tc)
@ -99,6 +184,8 @@ ATF_TC_BODY(mlock_err, tc)
if ((uintptr_t)VM_MIN_ADDRESS > 0)
null_errno = EINVAL; /* NULL is not inside user VM */
#endif
/* Set max_wired really really high to avoid EAGAIN */
set_vm_max_wired(INT_MAX);
#else
if (sysctlbyname("vm.minaddress", &vmin, &len, NULL, 0) != 0)
atf_tc_fail("failed to read vm.minaddress");
@ -139,6 +226,14 @@ ATF_TC_BODY(mlock_err, tc)
ATF_REQUIRE_ERRNO(ENOMEM, munlock(invalid_ptr, page) == -1);
}
#ifdef __FreeBSD__
ATF_TC_CLEANUP(mlock_err, tc)
{
restore_vm_max_wired();
}
#endif
ATF_TC(mlock_limits);
ATF_TC_HEAD(mlock_limits, tc)
{
@ -200,10 +295,18 @@ ATF_TC_BODY(mlock_limits, tc)
free(buf);
}
#ifdef __FreeBSD__
ATF_TC_WITH_CLEANUP(mlock_mmap);
#else
ATF_TC(mlock_mmap);
#endif
ATF_TC_HEAD(mlock_mmap, tc)
{
atf_tc_set_md_var(tc, "descr", "Test mlock(2)-mmap(2) interaction");
#ifdef __FreeBSD__
atf_tc_set_md_var(tc, "require.config", "allow_sysctl_side_effects");
atf_tc_set_md_var(tc, "require.user", "root");
#endif
}
ATF_TC_BODY(mlock_mmap, tc)
@ -215,6 +318,11 @@ ATF_TC_BODY(mlock_mmap, tc)
#endif
void *buf;
#ifdef __FreeBSD__
/* Set max_wired really really high to avoid EAGAIN */
set_vm_max_wired(INT_MAX);
#endif
/*
* Make a wired RW mapping and check that mlock(2)
* does not fail for the (already locked) mapping.
@ -248,11 +356,27 @@ ATF_TC_BODY(mlock_mmap, tc)
ATF_REQUIRE(munmap(buf, page) == 0);
}
#ifdef __FreeBSD__
ATF_TC_CLEANUP(mlock_mmap, tc)
{
restore_vm_max_wired();
}
#endif
#ifdef __FreeBSD__
ATF_TC_WITH_CLEANUP(mlock_nested);
#else
ATF_TC(mlock_nested);
#endif
ATF_TC_HEAD(mlock_nested, tc)
{
atf_tc_set_md_var(tc, "descr",
"Test that consecutive mlock(2) calls succeed");
#ifdef __FreeBSD__
atf_tc_set_md_var(tc, "require.config", "allow_sysctl_side_effects");
atf_tc_set_md_var(tc, "require.user", "root");
#endif
}
ATF_TC_BODY(mlock_nested, tc)
@ -260,6 +384,11 @@ ATF_TC_BODY(mlock_nested, tc)
const size_t maxiter = 100;
void *buf;
#ifdef __FreeBSD__
/* Set max_wired really really high to avoid EAGAIN */
set_vm_max_wired(INT_MAX);
#endif
buf = malloc(page);
ATF_REQUIRE(buf != NULL);
@ -270,6 +399,14 @@ ATF_TC_BODY(mlock_nested, tc)
free(buf);
}
#ifdef __FreeBSD__
ATF_TC_CLEANUP(mlock_nested, tc)
{
restore_vm_max_wired();
}
#endif
ATF_TP_ADD_TCS(tp)
{

View File

@ -70,7 +70,15 @@ recurse_body()
echo -e "cod\ndover sole\nhaddock\nhalibut\npilchard" > recurse/d/fish
echo -e "cod\nhaddock\nplaice" > recurse/a/f/favourite-fish
# Begin FreeBSD
if true; then
atf_check -o file:"$(atf_get_srcdir)/d_recurse.out" -x "grep -r haddock recurse | sort"
else
# End FreeBSD
atf_check -o file:"$(atf_get_srcdir)/d_recurse.out" grep -r haddock recurse
# Begin FreeBSD
fi
# End FreeBSD
}
atf_test_case recurse_symlink

View File

@ -117,6 +117,7 @@
- PasswordAuthentication defaults to "no".
- VersionAddendum defaults to "FreeBSD-YYYYMMDD".
- PrivilegeSeparation defaults to "sandbox".
- UseDNS defaults to "yes".
2) Modified client-side defaults

View File

@ -320,7 +320,7 @@ fill_default_server_options(ServerOptions *options)
if (options->max_sessions == -1)
options->max_sessions = DEFAULT_SESSIONS_MAX;
if (options->use_dns == -1)
options->use_dns = 0;
options->use_dns = 1;
if (options->client_alive_interval == -1)
options->client_alive_interval = 0;
if (options->client_alive_count_max == -1)

View File

@ -115,7 +115,7 @@
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS no
#UseDNS yes
#PidFile /var/run/sshd.pid
#MaxStartups 10:30:100
#PermitTunnel no

View File

@ -1541,8 +1541,8 @@ the resolved host name for the remote IP address maps back to the
very same IP address.
.Pp
If this option is set to
.Dq no
(the default) then only addresses and not host names may be used in
.Dq no ,
then only addresses and not host names may be used in
.Pa ~/.ssh/known_hosts
.Cm from
and
@ -1550,6 +1550,8 @@ and
.Cm Match
.Cm Host
directives.
The default is
.Dq yes .
.It Cm UseLogin
Specifies whether
.Xr login 1

View File

@ -368,6 +368,8 @@ ntp_db_leapfile="/var/db/ntpd.leap-seconds.list"
# Working copy (updated weekly) leapfile
ntp_leapfile_sources="https://www.ietf.org/timezones/data/leap-seconds.list"
# Source from which to fetch leapfile
ntp_leapfile_fetch_opts="-mq" # Options to use for ntp leapfile fetch,
# e.g. --no-verify-peer
ntp_leapfile_expiry_days=30 # Check for new leapfile 30 days prior to
# expiry.
ntp_leapfile_fetch_verbose="NO" # Be verbose during NTP leapfile fetch

View File

@ -29,6 +29,7 @@ dialer:*:68:
network:*:69:
audit:*:77:
www:*:80:
_ypldap:*:160:
hast:*:845:
nogroup:*:65533:
nobody:*:65534:

View File

@ -22,6 +22,6 @@ uucp:*:66:66::0:0:UUCP pseudo-user:/var/spool/uucppublic:/usr/local/libexec/uucp
pop:*:68:6::0:0:Post Office Owner:/nonexistent:/usr/sbin/nologin
auditdistd:*:78:77::0:0:Auditdistd unprivileged user:/var/empty:/usr/sbin/nologin
www:*:80:80::0:0:World Wide Web Owner:/nonexistent:/usr/sbin/nologin
_ypldap:*:93:93::0:0:YP Ldap unprivileged user:/var/empty:/usr/sbin/nologin
_ypldap:*:160:160::0:0:YP Ldap unprivileged user:/var/empty:/usr/sbin/nologin
hast:*:845:845::0:0:HAST unprivileged user:/var/empty:/usr/sbin/nologin
nobody:*:65534:65534::0:0:Unprivileged user:/nonexistent:/usr/sbin/nologin

View File

@ -105,7 +105,7 @@ ntpd_fetch_leapfile() {
$verbose Within ntp leapfile expiry limit, initiating fetch
for url in $ntp_leapfile_sources ; do
$verbose fetching $url
fetch -mqo $ntp_tmp_leapfile $url && break
fetch $ntp_leapfile_fetch_opts -o $ntp_tmp_leapfile $url && break
done
ntp_ver_no_tmp=$(get_ntp_leapfile_ver $ntp_tmp_leapfile)
if [ "$ntp_ver_no_tmp" -gt "$ntp_ver_no_db" ]; then

View File

@ -58,8 +58,10 @@ LIB2FUNCS+= _fixuns${mode}si
.endfor
# Likewise double-word routines.
.if ${TARGET_CPUARCH} != "aarch64" && ${TARGET_CPUARCH} != "arm"
# These are implemented in an ARM specific file but will not be filtered out
.if ${TARGET_CPUARCH} != "aarch64" && ${TARGET_CPUARCH} != "arm" && \
${TARGET_CPUARCH} != "riscv64"
# These are implemented in an ARM specific file but will not be filtered out.
# RISCVTODO: can't compile
.for mode in sf df xf tf
LIB2FUNCS+= _fix${mode}di _fixuns${mode}di
LIB2FUNCS+= _floatdi${mode} _floatundi${mode}
@ -209,7 +211,7 @@ COMMONHDRS+= unwind.h
HIDE = -fvisibility=hidden -DHIDE_EXPORTS
CC_T = ${CC} -c ${CFLAGS} ${HIDE} -fPIC
CC_P = ${CC} -c ${CFLAGS} ${HIDE} -p -fPIC
CC_S = ${CC} -c ${CFLAGS} ${PICFLAG} -DSHARED
CC_S = ${CC} -c ${CFLAGS} ${SHARED_CFLAGS} ${PICFLAG} -DSHARED
#-----------------------------------------------------------------------
#
@ -322,7 +324,10 @@ EH_OBJS_T = ${LIB2ADDEHSTATIC:R:S/$/.o/}
EH_OBJS_P = ${LIB2ADDEHSTATIC:R:S/$/.po/}
EH_OBJS_S = ${LIB2ADDEHSHARED:R:S/$/.So/}
EH_CFLAGS = -fexceptions -D__GLIBC__=3 -DElfW=__ElfN
.if ${TARGET_CPUARCH} != "riscv64"
# RISCVTODO: unwinding support
SOBJS += ${EH_OBJS_S}
.endif
.for _src in ${LIB2ADDEHSTATIC:M*.c}
${_src:R:S/$/.o/}: ${_src} ${COMMONHDRS}

View File

@ -173,7 +173,7 @@ CFLAGS+= -I${SRCTOP}/lib/libutil
# Same issue with libm
MSUN_ARCH_SUBDIR != ${MAKE} -B -C ${SRCTOP}/lib/msun -V ARCH_SUBDIR
# unfortunately msun/src contains both private and public headers
CFLAGS+= -I${SRCTOP}/lib/msun/${MSUN_ARCH_SUBDIR}
CFLAGS+= -I${SRCTOP}/lib/msun/${MSUN_ARCH_SUBDIR}
.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
CFLAGS+= -I${SRCTOP}/lib/msun/x86
.endif

View File

@ -12,7 +12,7 @@ SRCS+= base64.c ether_addr.c eui64.c \
getproto.c getprotoent.c getprotoname.c getservent.c \
if_indextoname.c if_nameindex.c if_nametoindex.c \
ip6opt.c linkaddr.c map_v4v6.c name6.c ntoh.c \
nsdispatch.c nslexer.c nsparser.y nss_compat.c \
nsdispatch.c nslexer.l nsparser.y nss_compat.c \
rcmd.c rcmdsh.c recv.c rthdr.c sctp_sys_calls.c send.c \
sockatmark.c sourcefilter.c vars.c
@ -34,13 +34,8 @@ CFLAGS+=-I${LIBC_SRCTOP}/resolv
YFLAGS+=-p_nsyy
LFLAGS+=-P_nsyy
CLEANFILES+=nslexer.c nslexer.c.*
nslexer.c: nslexer.l nsparser.h
${LEX} ${LFLAGS} -o${.TARGET}.tmp1 ${.IMPSRC}
sed -e '/YY_BUF_SIZE/s/16384/1024/' ${.TARGET}.tmp1 >${.TARGET}.tmp2
rm -f ${.TARGET}.tmp1
mv -f ${.TARGET}.tmp2 ${.TARGET}
CFLAGS.nslexer.c= -DYY_BUF_SIZE=1024
CFLAGS+= ${CFLAGS.${.IMPSRC:T}}
MAN+= byteorder.3 ethers.3 eui64.3 \
getaddrinfo.3 gai_strerror.3 gethostbyname.3 \

View File

@ -31,7 +31,7 @@
.\" @(#)revoke.2 8.1 (Berkeley) 6/4/93
.\" $FreeBSD$
.\"
.Dd June 4, 1993
.Dd Jan 25, 2016
.Dt REVOKE 2
.Os
.Sh NAME
@ -59,7 +59,8 @@ and a
system call will succeed.
If the file is a special file for a device which is open,
the device close function
is called as if all open references to the file had been closed.
is called as if all open references to the file had been closed
using a special close method which does not block.
.Pp
Access to a file may be revoked only by its owner or the super user.
The
@ -104,3 +105,6 @@ The
.Fn revoke
system call first appeared in
.Bx 4.3 Reno .
.Sh BUGS
The non-blocking close method is only correctly implemented for
terminal devices.

View File

@ -110,8 +110,8 @@ struct devinfo_dev {
struct devinfo_rman {
devinfo_handle_t dm_handle; /* resource manager handle */
u_long dm_start; /* resource start */
u_long dm_size; /* resource size */
rman_res_t dm_start; /* resource start */
rman_res_t dm_size; /* resource size */
char *dm_desc; /* resource description */
};
@ -119,8 +119,8 @@ struct devinfo_res {
devinfo_handle_t dr_handle; /* resource handle */
devinfo_handle_t dr_rman; /* resource manager handle */
devinfo_handle_t dr_device; /* owning device */
u_long dr_start; /* region start */
u_long dr_size; /* region size */
rman_res_t dr_start; /* region start */
rman_res_t dr_size; /* region size */
};
.Ed
.Pp

View File

@ -56,8 +56,8 @@ struct devinfo_dev {
struct devinfo_rman {
devinfo_handle_t dm_handle; /* resource manager handle */
unsigned long dm_start; /* resource start */
unsigned long dm_size; /* resource size */
rman_res_t dm_start; /* resource start */
rman_res_t dm_size; /* resource size */
char *dm_desc; /* resource description */
};
@ -67,8 +67,8 @@ struct devinfo_res {
devinfo_handle_t dr_rman; /* resource manager handle */
devinfo_handle_t dr_device; /* owning device */
unsigned long dr_start; /* region start */
unsigned long dr_size; /* region size */
rman_res_t dr_start; /* region start */
rman_res_t dr_size; /* region size */
/* XXX add flags */
};

View File

@ -261,6 +261,13 @@ dialog_spawn_gauge(char *init_prompt, pid_t *pid)
errx(EXIT_FAILURE, "Out of memory?!");
sprintf(dargv[n++], "--title");
dargv[n++] = title;
} else {
if ((dargv[n] = malloc(8)) == NULL)
errx(EXIT_FAILURE, "Out of memory?!");
sprintf(dargv[n++], "--title");
if ((dargv[n] = malloc(1)) == NULL)
errx(EXIT_FAILURE, "Out of memory?!");
*dargv[n++] = '\0';
}
if (backtitle != NULL) {
if ((dargv[n] = malloc(12)) == NULL)

View File

@ -55,7 +55,6 @@ extern int dheight, dwidth;
__BEGIN_DECLS
uint8_t dialog_prompt_nlstate(const char *_prompt);
void dialog_gauge_free(void);
void dialog_maxsize_free(void);
char *dialog_prompt_lastline(char *_prompt, uint8_t _nlstate);
int dialog_maxcols(void);

View File

@ -1,4 +1,4 @@
.\" Copyright (c) 2013-2015 Devin Teske
.\" Copyright (c) 2013-2016 Devin Teske
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd Oct 22, 2015
.Dd Jan 26, 2016
.Dt DPV 3
.Os
.Sh NAME
@ -64,6 +64,7 @@ argument contains the following properties for configuring global display
features:
.Bd -literal -offset indent
struct dpv_config {
uint8_t keep_tite; /* Cleaner exit for scripts */
enum dpv_display display_type; /* Def. DPV_DISPLAY_LIBDIALOG */
enum dpv_output output_type; /* Default DPV_OUTPUT_NONE */
int debug; /* Enable debug on stderr */

View File

@ -1,5 +1,5 @@
/*-
* Copyright (c) 2013-2014 Devin Teske <dteske@FreeBSD.org>
* Copyright (c) 2013-2016 Devin Teske <dteske@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -69,6 +69,7 @@ long long dpv_overall_read = 0;
static char pathbuf[PATH_MAX];
/* Extra display information */
uint8_t keep_tite = FALSE; /* dpv_config.keep_tite */
uint8_t no_labels = FALSE; /* dpv_config.options & DPV_NO_LABELS */
uint8_t wide = FALSE; /* dpv_config.options & DPV_WIDE_MODE */
char *aprompt = NULL; /* dpv_config.aprompt */
@ -150,6 +151,7 @@ dpv(struct dpv_config *config, struct dpv_file_node *file_list)
dialog_updates_per_second = DIALOG_UPDATES_PER_SEC;
display_limit = DISPLAY_LIMIT_DEFAULT;
display_type = DPV_DISPLAY_LIBDIALOG;
keep_tite = FALSE;
label_size = LABEL_SIZE_DEFAULT;
msg_done = NULL;
msg_fail = NULL;
@ -193,6 +195,7 @@ dpv(struct dpv_config *config, struct dpv_file_node *file_list)
dialog_updates_per_second = config->dialog_updates_per_second;
display_limit = config->display_limit;
display_type = config->display_type;
keep_tite = config->keep_tite;
label_size = config->label_size;
msg_done = (char *)config->msg_done;
msg_fail = (char *)config->msg_fail;
@ -695,7 +698,7 @@ dpv(struct dpv_config *config, struct dpv_file_node *file_list)
close(dialog_out);
waitpid(pid, (int *)NULL, 0);
}
if (!dpv_interrupt)
if (!keep_tite && !dpv_interrupt)
printf("\n");
} else
warnx("%s: %lli overall read", __func__, dpv_overall_read);

View File

@ -1,5 +1,5 @@
/*-
* Copyright (c) 2013-2014 Devin Teske <dteske@FreeBSD.org>
* Copyright (c) 2013-2016 Devin Teske <dteske@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -97,6 +97,7 @@ struct dpv_file_node {
* Anatomy of config option to pass as dpv() config argument
*/
struct dpv_config {
uint8_t keep_tite; /* Prevent visually distracting exit */
enum dpv_display display_type; /* Display (default TYPE_LIBDIALOG) */
enum dpv_output output_type; /* Output (default TYPE_NONE) */
int debug; /* Enable debugging output on stderr */

View File

@ -1,5 +1,5 @@
/*-
* Copyright (c) 2013-2014 Devin Teske <dteske@FreeBSD.org>
* Copyright (c) 2013-2016 Devin Teske <dteske@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -38,6 +38,7 @@ extern uint8_t debug;
extern unsigned int dpv_nfiles;
/* Extra display information */
extern uint8_t keep_tite;
extern uint8_t no_labels;
extern uint8_t wide;
extern char *msg_done, *msg_fail, *msg_pending;

View File

@ -4,11 +4,14 @@
LIB= sysdecode
SRCS= ioctl.c utrace.c
SRCS= ioctl.c syscallnames.c utrace.c
INCS= sysdecode.h
CFLAGS+= -I${.CURDIR}/../../sys
MAN+= sysdecode.3 \
sysdecode_ioctlname.3 \
sysdecode_syscallnames.3 \
sysdecode_utrace.3
CLEANFILES= ioctl.c
@ -23,6 +26,10 @@ CFLAGS+=-DPF
# Workaround duplicate declarations in <netinet/ip_compat.h>
CFLAGS.gcc.ioctl.c+= -Wno-redundant-decls
# Workaround warning for unused ssi_cables[] in <dev/lmc/if_lmc.h>
CFLAGS.gcc.ioctl.c+= -Wno-unused
CFLAGS.gcc+= ${CFLAGS.gcc.${.IMPSRC}}
ioctl.c: mkioctls

View File

@ -0,0 +1,105 @@
/*-
* Copyright (c) 2015 John H. 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$");
/*
* Map system call codes to names for the supported ABIs on each
* platform. Rather than regnerating system call name tables locally
* during the build, use the generated tables in the kernel source
* tree.
*/
#include <sys/param.h>
#include <stdio.h>
#include <sysdecode.h>
static
#include <kern/syscalls.c>
#if defined(__amd64__) || defined(__powerpc64__)
static
#include <compat/freebsd32/freebsd32_syscalls.c>
#endif
#if defined(__amd64__) || defined(__i386__)
static
#ifdef __amd64__
#include <amd64/linux/linux_syscalls.c>
#else
#include <i386/linux/linux_syscalls.c>
#endif
#endif
#ifdef __amd64__
static
#include <amd64/linux32/linux32_syscalls.c>
#endif
#if defined(__amd64__) || defined(__aarch64__)
static
#include <compat/cloudabi64/cloudabi64_syscalls.c>
#endif
const char *
sysdecode_syscallname(enum sysdecode_abi abi, unsigned int code)
{
switch (abi) {
case FREEBSD:
if (code < nitems(syscallnames))
return (syscallnames[code]);
break;
#if defined(__amd64__) || defined(__powerpc64__)
case FREEBSD32:
if (code < nitems(freebsd32_syscallnames))
return (freebsd32_syscallnames[code]);
break;
#endif
#if defined(__amd64__) || defined(__i386__)
case LINUX:
if (code < nitems(linux_syscallnames))
return (linux_syscallnames[code]);
break;
#endif
#ifdef __amd64__
case LINUX32:
if (code < nitems(linux32_syscallnames))
return (linux32_syscallnames[code]);
break;
#endif
#if defined(__amd64__) || defined(__aarch64__)
case CLOUDABI64:
if (code < nitems(cloudabi64_syscallnames))
return (cloudabi64_syscallnames[code]);
break;
#endif
default:
break;
}
return (NULL);
}

View File

@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd December 10, 2015
.Dd January 24, 2016
.Dt SYSDECODE 3
.Os
.Sh NAME
@ -38,8 +38,34 @@ The
.Nm
library includes several functions that provide descriptive names of
values associated with system calls.
.Ss Supported ABIs
Some functions in this library provide ABI-specific descriptions.
The supported ABIs are named by the
.Vt enum sysdecode_abi
enumeration.
.Pp
.Bl -tag -width "Li UNKNOWN_ABI" -compact
.It Li FREEBSD
Native FreeBSD binaries.
Supported on all platforms.
.It Li FREEBSD32
32-bit FreeBSD binaries.
Supported on amd64 and powerpc64.
.It Li LINUX
Linux binaries of the same platform.
Supported on amd64 and i386.
.It Li LINUX32
32-bit Linux binaries.
Supported on amd64.
.It Li CLOUDABI64
64-bit CloudABI binaries.
Supported on aarch64 and amd64.
.It Li UNKNOWN_ABI
A placeholder for use when the ABI is not known.
.El
.Sh SEE ALSO
.Xr sysdecode_ioctlname 3 ,
.Xr sysdecode_syscallnames 3 ,
.Xr sysdecode_utrace 3
.Sh HISTORY
The

View File

@ -29,7 +29,17 @@
#ifndef __SYSDECODE_H__
#define __SYSDECODE_H__
enum sysdecode_abi {
UNKNOWN_ABI = 0,
FREEBSD,
FREEBSD32,
LINUX,
LINUX32,
CLOUDABI64
};
const char *sysdecode_ioctlname(unsigned long _val);
const char *sysdecode_syscallname(enum sysdecode_abi _abi, unsigned int _code);
int sysdecode_utrace(FILE *_fp, void *_buf, size_t _len);
#endif /* !__SYSDECODE_H__ */

View File

@ -0,0 +1,67 @@
.\"
.\" Copyright (c) 2016 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.
.\"
.\" $FreeBSD$
.\"
.Dd January 24, 2016
.Dt sysdecode_syscallnames 3
.Os
.Sh NAME
.Nm sysdecode_syscallnames
.Nd lookup name of system calls
.Sh LIBRARY
.Lb libsysdecode
.Sh SYNOPSIS
.Ft const char *
.Fn sysdecode_syscallnames "enum sysdecode_abi abi" "unsigned int code"
.Sh DESCRIPTION
This function returns a pointer to the name of a system call identified by
.Fa code
for the process ABI
.Fa abi .
If
.Fa code
specifies an unknown system call or
.Fa abi
is an unsupported ABI,
.Nm
returns
.Dv NULL .
.Pp
For the list of supported ABIs,
see
.Xr sysdecode 3 .
.Sh RETURN VALUES
The
.Nm
function returns a pointer to a string on success or
.Dv NULL
if either
.Fa code
or
.Fa ABI
is invalid .
.Sh SEE ALSO
.Xr sysdecode 3

View File

@ -0,0 +1,92 @@
/*-
* Copyright (c) 2005 David Xu <davidxu@freebsd.org>
* Copyright (c) 2015 Ruslan Bukin <br@bsdpad.com>
* All rights reserved.
*
* Portions of this software were 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.
*
* Portions of this software were developed by the University of Cambridge
* Computer Laboratory as part of the CTSRD Project, with support from the
* UK Higher Education Innovation Fund (HEIF).
*
* 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$
*/
/*
* Machine-dependent thread prototypes/definitions.
*/
#ifndef _PTHREAD_MD_H_
#define _PTHREAD_MD_H_
#include <sys/types.h>
#include <stddef.h>
#define CPU_SPINWAIT
#define DTV_OFFSET offsetof(struct tcb, tcb_dtv)
#define TP_OFFSET 0x10
/*
* Variant I tcb. The structure layout is fixed, don't blindly
* change it!
*/
struct tcb {
void *tcb_dtv;
struct pthread *tcb_thread;
};
/* Called from the thread to set its private data. */
static __inline void
_tcb_set(struct tcb *tcb)
{
__asm __volatile("mv tp, %0" :: "r"((uint8_t *)tcb + TP_OFFSET));
}
/*
* Get the current tcb.
*/
static __inline struct tcb *
_tcb_get(void)
{
register uint8_t *_tp;
__asm __volatile("mv %0, tp" : "=r"(_tp));
return ((struct tcb *)(_tp - TP_OFFSET));
}
extern struct pthread *_thr_initial;
static __inline struct pthread *
_get_curthread(void)
{
if (_thr_initial)
return (_tcb_get()->tcb_thread);
return (NULL);
}
#endif /* _PTHREAD_MD_H_ */

View File

@ -0,0 +1,104 @@
/*-
* Copyright (c) 2015 Ruslan Bukin <br@bsdpad.com>
* All rights reserved.
*
* Portions of this software were 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.
*
* Portions of this software were developed by the University of Cambridge
* Computer Laboratory as part of the CTSRD Project, with support from the
* UK Higher Education Innovation Fund (HEIF).
*
* 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 <string.h>
#include <thread_db.h>
#include "libpthread_db.h"
void
pt_reg_to_ucontext(const struct reg *r, ucontext_t *uc)
{
mcontext_t *mc;
mc = &uc->uc_mcontext;
memcpy(mc->mc_gpregs.gp_t, r->t, sizeof(mc->mc_gpregs.gp_t));
memcpy(mc->mc_gpregs.gp_s, r->s, sizeof(mc->mc_gpregs.gp_s));
memcpy(mc->mc_gpregs.gp_a, r->a, sizeof(mc->mc_gpregs.gp_a));
mc->mc_gpregs.gp_ra = r->ra;
mc->mc_gpregs.gp_sp = r->sp;
mc->mc_gpregs.gp_gp = r->gp;
mc->mc_gpregs.gp_tp = r->tp;
mc->mc_gpregs.gp_sepc = r->sepc;
mc->mc_gpregs.gp_sstatus = r->sstatus;
}
void
pt_ucontext_to_reg(const ucontext_t *uc, struct reg *r)
{
const mcontext_t *mc;
mc = &uc->uc_mcontext;
memcpy(r->t, mc->mc_gpregs.gp_t, sizeof(mc->mc_gpregs.gp_t));
memcpy(r->s, mc->mc_gpregs.gp_s, sizeof(mc->mc_gpregs.gp_s));
memcpy(r->a, mc->mc_gpregs.gp_a, sizeof(mc->mc_gpregs.gp_a));
r->ra = mc->mc_gpregs.gp_ra;
r->sp = mc->mc_gpregs.gp_sp;
r->gp = mc->mc_gpregs.gp_gp;
r->tp = mc->mc_gpregs.gp_tp;
r->sepc = mc->mc_gpregs.gp_sepc;
r->sstatus = mc->mc_gpregs.gp_sstatus;
}
void
pt_fpreg_to_ucontext(const struct fpreg *r __unused, ucontext_t *uc __unused)
{
/* RISCVTODO */
}
void
pt_ucontext_to_fpreg(const ucontext_t *uc __unused, struct fpreg *r __unused)
{
/* RISCVTODO */
}
void
pt_md_init(void)
{
}
int
pt_reg_sstep(struct reg *reg __unused, int step __unused)
{
return (0);
}

52
lib/msun/riscv/fenv.c Normal file
View File

@ -0,0 +1,52 @@
/*-
* Copyright (c) 2004 David Schultz <das@FreeBSD.ORG>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*/
#define __fenv_static
#include "fenv.h"
#ifdef __GNUC_GNU_INLINE__
#error "This file must be compiled with C99 'inline' semantics"
#endif
/*
* Hopefully the system ID byte is immutable, so it's valid to use
* this as a default environment.
*/
const fenv_t __fe_dfl_env = 0;
extern inline int feclearexcept(int __excepts);
extern inline int fegetexceptflag(fexcept_t *__flagp, int __excepts);
extern inline int fesetexceptflag(const fexcept_t *__flagp, int __excepts);
extern inline int feraiseexcept(int __excepts);
extern inline int fetestexcept(int __excepts);
extern inline int fegetround(void);
extern inline int fesetround(int __round);
extern inline int fegetenv(fenv_t *__envp);
extern inline int feholdexcept(fenv_t *__envp);
extern inline int fesetenv(const fenv_t *__envp);
extern inline int feupdateenv(const fenv_t *__envp);

View File

@ -3533,11 +3533,9 @@ dl_iterate_phdr(__dl_iterate_hdr_callback callback, void *param)
TAILQ_INSERT_AFTER(&obj_list, obj, &marker, next);
rtld_fill_dl_phdr_info(obj, &phdr_info);
lock_release(rtld_bind_lock, &bind_lockstate);
lock_release(rtld_phdr_lock, &phdr_lockstate);
error = callback(&phdr_info, sizeof phdr_info, param);
wlock_acquire(rtld_phdr_lock, &phdr_lockstate);
rlock_acquire(rtld_bind_lock, &bind_lockstate);
obj = globallist_next(&marker);
TAILQ_REMOVE(&obj_list, &marker, next);
@ -3551,9 +3549,9 @@ dl_iterate_phdr(__dl_iterate_hdr_callback callback, void *param)
if (error == 0) {
rtld_fill_dl_phdr_info(&obj_rtld, &phdr_info);
lock_release(rtld_bind_lock, &bind_lockstate);
lock_release(rtld_phdr_lock, &phdr_lockstate);
error = callback(&phdr_info, sizeof(phdr_info), param);
}
lock_release(rtld_phdr_lock, &phdr_lockstate);
return (error);
}

View File

@ -0,0 +1,254 @@
/* $FreeBSD$ */
/* opensslconf.h */
/* RISCVTODO: generate from opensslconf.h.in by Configure. */
#ifdef __cplusplus
extern "C" {
#endif
/* OpenSSL was configured with the following options: */
#ifndef OPENSSL_DOING_MAKEDEPEND
#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
# define OPENSSL_NO_EC_NISTP_64_GCC_128
#endif
#ifndef OPENSSL_NO_GMP
# define OPENSSL_NO_GMP
#endif
#ifndef OPENSSL_NO_JPAKE
# define OPENSSL_NO_JPAKE
#endif
#ifndef OPENSSL_NO_KRB5
# define OPENSSL_NO_KRB5
#endif
#ifndef OPENSSL_NO_LIBUNBOUND
# define OPENSSL_NO_LIBUNBOUND
#endif
#ifndef OPENSSL_NO_MD2
# define OPENSSL_NO_MD2
#endif
#ifndef OPENSSL_NO_SCTP
# define OPENSSL_NO_SCTP
#endif
#ifndef OPENSSL_NO_SSL_TRACE
# define OPENSSL_NO_SSL_TRACE
#endif
#ifndef OPENSSL_NO_SSL2
# define OPENSSL_NO_SSL2
#endif
#ifndef OPENSSL_NO_STORE
# define OPENSSL_NO_STORE
#endif
#ifndef OPENSSL_NO_UNIT_TEST
# define OPENSSL_NO_UNIT_TEST
#endif
#endif /* OPENSSL_DOING_MAKEDEPEND */
#ifndef OPENSSL_THREADS
# define OPENSSL_THREADS
#endif
#ifndef OPENSSL_NO_ASM
# define OPENSSL_NO_ASM
#endif
#ifndef OPENSSL_NO_STATIC_ENGINE
# define OPENSSL_NO_STATIC_ENGINE
#endif
/* The OPENSSL_NO_* macros are also defined as NO_* if the application
asks for it. This is a transient feature that is provided for those
who haven't had the time to do the appropriate changes in their
applications. */
#ifdef OPENSSL_ALGORITHM_DEFINES
# if defined(OPENSSL_NO_EC_NISTP_64_GCC_128) && !defined(NO_EC_NISTP_64_GCC_128)
# define NO_EC_NISTP_64_GCC_128
# endif
# if defined(OPENSSL_NO_GMP) && !defined(NO_GMP)
# define NO_GMP
# endif
# if defined(OPENSSL_NO_JPAKE) && !defined(NO_JPAKE)
# define NO_JPAKE
# endif
# if defined(OPENSSL_NO_KRB5) && !defined(NO_KRB5)
# define NO_KRB5
# endif
# if defined(OPENSSL_NO_LIBUNBOUND) && !defined(NO_LIBUNBOUND)
# define NO_LIBUNBOUND
# endif
# if defined(OPENSSL_NO_MD2) && !defined(NO_MD2)
# define NO_MD2
# endif
# if defined(OPENSSL_NO_SCTP) && !defined(NO_SCTP)
# define NO_SCTP
# endif
# if defined(OPENSSL_NO_SSL_TRACE) && !defined(NO_SSL_TRACE)
# define NO_SSL_TRACE
# endif
# if defined(OPENSSL_NO_SSL2) && !defined(NO_SSL2)
# define NO_SSL2
# endif
# if defined(OPENSSL_NO_STORE) && !defined(NO_STORE)
# define NO_STORE
# endif
# if defined(OPENSSL_NO_UNIT_TEST) && !defined(NO_UNIT_TEST)
# define NO_UNIT_TEST
# endif
#endif
/* crypto/opensslconf.h.in */
/* Generate 80386 code? */
#undef I386_ONLY
#if !(defined(VMS) || defined(__VMS)) /* VMS uses logical names instead */
#if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR)
#define ENGINESDIR "/usr/lib/engines"
#define OPENSSLDIR "/etc/ssl"
#endif
#endif
#undef OPENSSL_UNISTD
#define OPENSSL_UNISTD <unistd.h>
#undef OPENSSL_EXPORT_VAR_AS_FUNCTION
#if defined(HEADER_IDEA_H) && !defined(IDEA_INT)
#define IDEA_INT unsigned int
#endif
#if defined(HEADER_MD2_H) && !defined(MD2_INT)
#define MD2_INT unsigned int
#endif
#if defined(HEADER_RC2_H) && !defined(RC2_INT)
/* I need to put in a mod for the alpha - eay */
#define RC2_INT unsigned int
#endif
#if defined(HEADER_RC4_H)
#if !defined(RC4_INT)
/* using int types make the structure larger but make the code faster
* on most boxes I have tested - up to %20 faster. */
/*
* I don't know what does "most" mean, but declaring "int" is a must on:
* - Intel P6 because partial register stalls are very expensive;
* - elder Alpha because it lacks byte load/store instructions;
*/
#define RC4_INT unsigned int
#endif
#if !defined(RC4_CHUNK)
/*
* This enables code handling data aligned at natural CPU word
* boundary. See crypto/rc4/rc4_enc.c for further details.
*/
#undef RC4_CHUNK
#endif
#endif
#if (defined(HEADER_NEW_DES_H) || defined(HEADER_DES_H)) && !defined(DES_LONG)
/* If this is set to 'unsigned int' on a DEC Alpha, this gives about a
* %20 speed up (longs are 8 bytes, int's are 4). */
#ifndef DES_LONG
#define DES_LONG unsigned int
#endif
#endif
#if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H)
#define CONFIG_HEADER_BN_H
#undef BN_LLONG
/* Should we define BN_DIV2W here? */
/* Only one for the following should be defined */
#define SIXTY_FOUR_BIT_LONG
#undef SIXTY_FOUR_BIT
#undef THIRTY_TWO_BIT
#endif
#if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H)
#define CONFIG_HEADER_RC4_LOCL_H
/* if this is defined data[i] is used instead of *data, this is a %20
* speedup on x86 */
#define RC4_INDEX
#endif
#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H)
#define CONFIG_HEADER_BF_LOCL_H
#undef BF_PTR
#endif /* HEADER_BF_LOCL_H */
#if defined(HEADER_DES_LOCL_H) && !defined(CONFIG_HEADER_DES_LOCL_H)
#define CONFIG_HEADER_DES_LOCL_H
#ifndef DES_DEFAULT_OPTIONS
/* the following is tweaked from a config script, that is why it is a
* protected undef/define */
#ifndef DES_PTR
#define DES_PTR
#endif
/* This helps C compiler generate the correct code for multiple functional
* units. It reduces register dependancies at the expense of 2 more
* registers */
#ifndef DES_RISC1
#define DES_RISC1
#endif
#ifndef DES_RISC2
#undef DES_RISC2
#endif
#if defined(DES_RISC1) && defined(DES_RISC2)
#error YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
#endif
/* Unroll the inner loop, this sometimes helps, sometimes hinders.
* Very mucy CPU dependant */
#ifndef DES_UNROLL
#define DES_UNROLL
#endif
/* These default values were supplied by
* Peter Gutman <pgut001@cs.auckland.ac.nz>
* They are only used if nothing else has been defined */
#if !defined(DES_PTR) && !defined(DES_RISC1) && !defined(DES_RISC2) && !defined(DES_UNROLL)
/* Special defines which change the way the code is built depending on the
CPU and OS. For SGI machines you can use _MIPS_SZLONG (32 or 64) to find
even newer MIPS CPU's, but at the moment one size fits all for
optimization options. Older Sparc's work better with only UNROLL, but
there's no way to tell at compile time what it is you're running on */
#if defined( sun ) /* Newer Sparc's */
# define DES_PTR
# define DES_RISC1
# define DES_UNROLL
#elif defined( __ultrix ) /* Older MIPS */
# define DES_PTR
# define DES_RISC2
# define DES_UNROLL
#elif defined( __osf1__ ) /* Alpha */
# define DES_PTR
# define DES_RISC2
#elif defined ( _AIX ) /* RS6000 */
/* Unknown */
#elif defined( __hpux ) /* HP-PA */
/* Unknown */
#elif defined( __aux ) /* 68K */
/* Unknown */
#elif defined( __dgux ) /* 88K (but P6 in latest boxes) */
# define DES_UNROLL
#elif defined( __sgi ) /* Newer MIPS */
# define DES_PTR
# define DES_RISC2
# define DES_UNROLL
#elif defined(i386) || defined(__i386__) /* x86 boxes, should be gcc */
# define DES_PTR
# define DES_RISC1
# define DES_UNROLL
#endif /* Systems-specific speed defines */
#endif
#endif /* DES_DEFAULT_OPTIONS */
#endif /* HEADER_DES_LOCL_H */
#ifdef __cplusplus
}
#endif

View File

@ -41,7 +41,8 @@
.In sys/rman.h
.In machine/resource.h
.Ft int
.Fn bus_adjust_resource "device_t dev" "int type" "struct resource *r" "u_long start" "u_long end"
.Fo bus_adjust_resource
.Fa "device_t dev" "int type" "struct resource *r" "rman_res_t start" "rman_res_t end"
.Sh DESCRIPTION
This function is used to ask the parent bus to adjust the resource range
assigned to an allocated resource.

View File

@ -43,7 +43,10 @@
.In sys/rman.h
.In machine/resource.h
.Ft struct resource *
.Fn bus_alloc_resource "device_t dev" "int type" "int *rid" "u_long start" "u_long end" "u_long count" "u_int flags"
.Fo bus_alloc_resource
.Fa "device_t dev" "int type" "int *rid" "rman_res_t start" "rman_res_t end"
.Fa "rman_res_t count" "u_int flags"
.Fc
.Ft struct resource *
.Fn bus_alloc_resource_any "device_t dev" "int type" "int *rid" "u_int flags"
.Sh DESCRIPTION

View File

@ -44,7 +44,7 @@
.In sys/rman.h
.Ft int
.Fo bus_get_resource
.Fa "device_t dev" "int type" "int rid" "u_long *startp" "u_long *countp"
.Fa "device_t dev" "int type" "int rid" "rman_res_t *startp" "rman_res_t *countp"
.Fc
.Sh DESCRIPTION
The

View File

@ -43,7 +43,7 @@
.In machine/resource.h
.Ft int
.Fo bus_set_resource
.Fa "device_t dev" "int type" "int rid" "u_long start" "u_long count"
.Fa "device_t dev" "int type" "int rid" "rman_res_t start" "rman_res_t count"
.Fc
.Sh DESCRIPTION
The

View File

@ -41,7 +41,7 @@
.Nd Modular Congestion Control
.Sh SYNOPSIS
.In netinet/tcp.h
.In netinet/tcp_cc.h
.In netinet/cc/cc.h
.In netinet/cc/cc_module.h
.Fn DECLARE_CC_MODULE "ccname" "ccalgo"
.Fn CCV "ccv" "what"

View File

@ -65,7 +65,7 @@
.Ft int
.Fn rman_activate_resource "struct resource *r"
.Ft int
.Fn rman_adjust_resource "struct resource *r" "u_long start" "u_long end"
.Fn rman_adjust_resource "struct resource *r" "rman_res_t start" "rman_res_t end"
.Ft int
.Fn rman_await_resource "struct resource *r" "int pri2" "int timo"
.Ft int
@ -79,32 +79,32 @@
.Ft int
.Fn rman_is_region_manager "struct resource *r" "struct rman *rm"
.Ft int
.Fn rman_manage_region "struct rman *rm" "u_long start" "u_long end"
.Fn rman_manage_region "struct rman *rm" "rman_res_t start" "rman_res_t end"
.Ft int
.Fn rman_first_free_region "struct rman *rm" "u_long *start" "u_long *end"
.Fn rman_first_free_region "struct rman *rm" "rman_res_t *start" "rman_res_t *end"
.Ft int
.Fn rman_last_free_region "struct rman *rm" "u_long *start" "u_long *end"
.Fn rman_last_free_region "struct rman *rm" "rman_res_t *start" "rman_res_t *end"
.Ft int
.Fn rman_release_resource "struct resource *r"
.Ft "struct resource *"
.Fo rman_reserve_resource
.Fa "struct rman *rm" "u_long start" "u_long end" "u_long count"
.Fa "struct rman *rm" "rman_res_t start" "rman_res_t end" "rman_res_t count"
.Fa "u_int flags" "struct device *dev"
.Fc
.Ft "struct resource *"
.Fo rman_reserve_resource_bound
.Fa "struct rman *rm" "u_long start" "u_long end" "u_long count"
.Fa "u_long bound" "u_int flags" "struct device *dev"
.Fa "struct rman *rm" "rman_res_t start" "rman_res_t end" "rman_res_t count"
.Fa "rman_res_t bound" "u_int flags" "struct device *dev"
.Fc
.Ft uint32_t
.Fn rman_make_alignment_flags "uint32_t size"
.Ft u_long
.Ft rman_res_t
.Fn rman_get_start "struct resource *r"
.Ft u_long
.Ft rman_res_t
.Fn rman_get_end "struct resource *r"
.Ft "struct device *"
.Fn rman_get_device "struct resource *r"
.Ft u_long
.Ft rman_res_t
.Fn rman_get_size "struct resource *r"
.Ft u_int
.Fn rman_get_flags "struct resource *r"

View File

@ -288,7 +288,7 @@ sephe [label="Sepherosa Ziehau\nsephe@FreeBSD.org\n2007/03/28"]
sepotvin [label="Stephane E. Potvin\nsepotvin@FreeBSD.org\n2007/02/15"]
simon [label="Simon L. Nielsen\nsimon@FreeBSD.org\n2006/03/07"]
sjg [label="Simon J. Gerraty\nsjg@FreeBSD.org\n2012/10/23"]
skra [label="Svatopluk Kraus\nslm@FreeBSD.org\n2015/10/28"]
skra [label="Svatopluk Kraus\nskra@FreeBSD.org\n2015/10/28"]
slm [label="Stephen McConnell\nslm@FreeBSD.org\n2014/05/07"]
smh [label="Steven Hartland\nsmh@FreeBSD.org\n2012/11/12"]
sobomax [label="Maxim Sobolev\nsobomax@FreeBSD.org\n2001/07/25"]

View File

@ -56,7 +56,9 @@ _MKDEPCC+= ${DEPFLAGS}
.endif
MKDEPCMD?= CC='${_MKDEPCC}' mkdep
DEPENDFILE?= .depend
.if ${MK_DIRDEPS_BUILD} == "no"
.MAKE.DEPENDFILE= ${DEPENDFILE}
.endif
DEPENDFILES= ${DEPENDFILE}
# Keep `tags' here, before SRCS are mangled below for `depend'.
@ -108,8 +110,8 @@ ${_YC} y.tab.h: ${_YSRC}
CLEANFILES+= y.tab.c y.tab.h
.elif !empty(YFLAGS:M-d)
.for _YH in ${_YC:R}.h
${_YH}: ${_YC}
${_YC}: ${_YSRC}
.ORDER: ${_YC} ${_YH}
${_YC} ${_YH}: ${_YSRC}
${YACC} ${YFLAGS} -o ${_YC} ${.ALLSRC}
SRCS+= ${_YH}
CLEANFILES+= ${_YH}

View File

@ -119,7 +119,7 @@ x.$p= PROG_CXX=$p
$p ${p}_p: .PHONY .MAKE
(cd ${.CURDIR} && \
DEPENDFILE=.depend.$p \
NO_SUBDIR=1 ${MAKE} -f ${MAKEFILE} _RECURSING_PROGS= \
NO_SUBDIR=1 ${MAKE} -f ${MAKEFILE} _RECURSING_PROGS=t \
PROG=$p ${x.$p})
# Pseudo targets for PROG, such as 'install'.
@ -127,7 +127,7 @@ $p ${p}_p: .PHONY .MAKE
$p.$t: .PHONY .MAKE
(cd ${.CURDIR} && \
DEPENDFILE=.depend.$p \
NO_SUBDIR=1 ${MAKE} -f ${MAKEFILE} _RECURSING_PROGS= \
NO_SUBDIR=1 ${MAKE} -f ${MAKEFILE} _RECURSING_PROGS=t \
PROG=$p ${x.$p} ${@:E})
.endfor
.endfor

View File

@ -1,192 +0,0 @@
# $FreeBSD$
begin 644 gallant.fnt
M5D9.5#`P,#(,%@``````OP````(`````````````````````````````````
M```````````````````````````````````````````````&``8`!@`&``8`
M!@`&``8`!@`&``8```````8`!@```````````````````!F`&8`9@!F`&8`9
M@````````````````````````````````````````````S`#,`,P!F`?\!_P
M#,`,P!F`&8!_P'_`,P!F`&8````````````````````&`!^`/\!FX&9@9@`^
M`!^`!\`&8`9@9F!_P#^`!@```````````````````#A@1,!$P$6`.8`#``,`
M!@`,``P`&<`:(#(@,B!AP```````````````````!P`/@!C`&,`8P`^`'@`^
M`'<`8V!AX&'`88`_X!Y@```````````````````,`!X`'@`&``8`#``8`!``
M``````````````````````````````````````#``8`#@`,`!P`&``8`!@`&
M``8`!P`#``.``8``P```````````````````,``8`!P`#``.``8`!@`&``8`
M!@`.``P`'``8`#````````````````````````````````\`!@!F8';@&8``
M`!F`=N!F8`8`#P`````````````````````````````````&``8`!@`&`'_@
M?^`&``8`!@`&````````````````````````````````````````````````
M````#``>`!X`!@`&``P`&``0``````````````````````````````!_X'_@
M```````````````````````````````````````````````````````````,
M`!X`'@`,`````````````````````&``P`#``8`!@`,``P`&``P`#``8`!@`
M,``P`&`````````````````````'``^`$8`0P##`,,`PP##`,,`PP##`,(`8
M@!\`#@````````````````````(`!@`.`!X`-@`&``8`!@`&``8`!@`&``8`
M!@`_P```````````````````'P`_@&'`0,``P`#``,`!@`,`!@`,`!@`,"!_
MX'_@```````````````````/@!_`(.!`8`!@`.`'P`_``.``8`!@0&!@0#^`
M'P````````````````````&``X`#@`6`!8`)@`F`$8`1@"&`/^!_X`&``8`!
M@```````````````````#\`/P!``$``@`#^`,<``X`!@`&``8$!@8&`PP!^`
M```````````````````'``P`&``P`#``8`!G@&_`<.!@8&!@8&!P0#^`'P``
M`````````````````!_@/^!@0`!``,``@`"``8`!``$``P`"``(`!@`$````
M````````````````#P`1@##`,,`PP!B`#0`&``L`$8`PP##`,,`8@`\`````
M```````````````/@!'`(.!@8&!@8&!PX#]@'F``8`#``,`!@`<`/```````
M```````````````````````````,`!X`'@`,```````,`!X`'@`,````````
M````````````````````````````#``>`!X`#```````#``>`!X`!@`&``P`
M&``0`````````````````````&`!P`<`'@!X`'@`'@`'``'``&``````````
M````````````````````````````?\!_P`````!_P'_`````````````````
M`````````````````````&``.``>``>``>`!X`>`'@`X`&``````````````
M```````/`!^`.<`@P`#``,`!@`,`!@`,``P```````P`#```````````````
M``````````````^`/\`P8&!@9R!OH&R@;*!GX&``,``_X`_@````````````
M```````&``8`"P`+``D`$8`1@!"`/\`@P"!`0&!`8.#P````````````````
M`````/\`8(!@P&#`8,!A@'^`8,!@8&!@8&!@8&#`_X``````````````````
M````#\`08"`@(`!@`&``8`!@`&``8``@`#`@&$`/@```````````````````
M``#_`&'`8,!@8&!@8&!@8&!@8&!@8&!@8$!A@/X`````````````````````
M`'_`,$`P0#``,``P@#^`,(`P`#``,``P(#`@?^``````````````````````
M?\`P0#!`,``P`#"`/X`P@#``,``P`#``,`!X```````````````````````/
MP!!@("`@`&``8`!@`&``8?!@8"!@,&`88`^``````````````````````/#P
M8&!@8&!@8&!@8'_@8&!@8&!@8&!@8&!@\/``````````````````````'X`&
M``8`!@`&``8`!@`&``8`!@`&``8`!@`?@``````````````````````?@`8`
M!@`&``8`!@`&``8`!@`&``8`!@`&``8`!@`&``0`.``P`````````/#@88!C
M`&8`;`!X`'@`?`!N`&<`8X!AP&#@\'``````````````````````>``P`#``
M,``P`#``,``P`#``,``P`#`@,"!_X`````````````````````#@<&#@<.!P
MX'#@66!98%E@36!.8$Y@1&!$8.3P`````````````````````,!P8"!P('@@
M6"!,($8@1R!#($&@0.!`X$!@X#``````````````````````#P`1P"#`(&!@
M8&!@8&!@8&!@8&`@0#!`&(`/``````````````````````!_@##`,&`P8#!@
M,,`W@#``,``P`#``,``P`'@```````````````````````\`$<`@P"!@8&!@
M8&!@8&!@8&!@,$`X0!^`#@`?`".0`>``````````````_P!A@&#`8,!@P&"`
M?P!\`&X`9P!C@&'`8.#P<``````````````````````?X#!@8"!@('``/``>
M``>``<``X$!@0&!@P'^``````````````````````'_@1B`&``8`!@`&``8`
M!@`&``8`!@`&``8`'X``````````````````````\'!@(&`@8"!@(&`@8"!@
M(&`@8"!@('!`/\`?@`````````````````````#@X&!`,(`P@#"`&0`9`!D`
M#``.``X`!``$``0``````````````````````/[P9B!F(&8@=B!W0#-`-T`[
MP#N`&8`9@!F`&8``````````````````````\'!@(#!`.(`8@`T`!@`&``L`
M$8`1P"#`0&#@\`````````````````````#P<&`@,$`8@!B`#0`&``8`!@`&
M``8`!@`&``\``````````````````````#_@(,``P`&``8`#``,`!@`&``P`
M#``8`!@@/^````````````````````?`!\`&``8`!@`&``8`!@`&``8`!@`&
M``8`!\`'P```````````````````8`!@`#``,``8`!@`#``,``8``P`#``&`
M`8``P`#```````````````````!\`'P`#``,``P`#``,``P`#``,``P`#``,
M`'P`?`````````````````````0`#@`;`#&`8,``````````````````````
M````````````````````````````````````````````````````````````
M``````#_X/_@```````````!``,`!@`&``>`!X`#````````````````````
M```````````````````````````````````/@!C`$,`#P!S`,,`PP##`.<`>
MX```````````````````(`!@`.``8`!@`&>`;\!PX&!@8&!@8&!@<&!XP$^`
M````````````````````````````````'X`QP"#`8`!@`&``8`!P0##`'X``
M``````````````````!@`.``8`!@`&`/8#'@(.!@8&!@8&!@8'#@.6`><```
M``````````````````````````````\`,,!@8&!@?^!@`&``,``88`^`````
M```````````````#@`3`!,`,``P`#``,`!^`#``,``P`#``,``P`'@``````
M```````````````````````````?(#'@8,!@P&#`,8`_`&``?\`_X"!@0"!`
M('_`/X``````$``P`'``,``P`#>`.<`PP##`,,`PP##`,,`PP'G@````````
M``````````````8`!@``````'@`&``8`!@`&``8`!@`&``8`'X``````````
M`````````````,``P``````#P`#``,``P`#``,``P`#``,``P"#`,,`X@!\`
M#@``````8`#@`&``8`!@`&'`8P!F`'P`>`!\`&X`9P!C@/'@````````````
M```````>``8`!@`&``8`!@`&``8`!@`&``8`!@`&``8`'X``````````````
M``````````````````#=P&[@9F!F8&9@9F!F8&9@9F#O<```````````````
M`````````````````">`><`PP##`,,`PP##`,,`PP'G@````````````````
M````````````````#X`1P"#@8&!@8&!@8&!P0#B`'P``````````````````
M``````````````#O@''`8.!@8&!@8&!@8&!`<(!_`&``8`!@`&``\```````
M``````````````\@$>`@X&!@8&!@8&!@<&`XX!_@`&``8`!@`&``\```````
M````````````<X`TP#C`,``P`#``,``P`#``>```````````````````````
M```````````?P##`,$`X`!X`!X`!P"#`,,`_@```````````````````````
M``0`!``,`'_`#``,``P`#``,``P`#"`.0`>`````````````````````````
M````````>>`PP##`,,`PP##`,,`PP#G`'F``````````````````````````
M``````#P<&`@,$`P0!B`&(`-``T`!@`&````````````````````````````
M`````/]P9B!F(&8@-T`[0#M`&8`9@!F`````````````````````````````
M````^/!P0#B`'0`.``<`"X`1P"#@\?``````````````````````````````
M``#P\&`@,$`P0!B`&(`-``T`!@`&``0`#``(`'@`<```````````````````
M`'_@8.!!P`.`!P`.`!P`."!P8'_@```````````````````!P`,``P`!@`&`
M`8`#``<``P`!@`&``8`#``,``<````````````````````8`!@`&``8`!@`&
M``8`!@`&``8`!@`&``8`!@`&``8`!@`&``8`!@``````.``,``P`&``8`!@`
M#``.``P`&``8`!@`#``,`#@`````````````````````````````````````
M````'"`^8#;`9\!#@```````````````````JJ!54*J@55"JH%50JJ!54*J@
M55"JH%50JJ!54*J@55"JH%50JJ!54*J@55`````````&``8```````8`!@`&
M``8`!@`&``8`!@`&``8`!@````````````````````$``0`#``(`'P`W@"6`
M9`!L`&@`>(`Y@!\`$``P`"``(``````````&``P`$``0`#``,``P`#X`?``8
M`!@`&``8`#\@/^`QP```````````````````````````8"!W0#N`$<`PP##`
M.(`=P"[@0&```````````````````````````/!P8"`P0!B`&(`-``8`/\`&
M`#_`!@`&``8`#P````````````````````8`!@`&``8`!@`&``8`!@`&````
M```&``8`!@`&``8`!@`&``8`!@``````#^`88#`@."`>`!^`,<!@X'!@.,`?
M@`>`0<!`P&&`?P```````````!F`&8``````````````````````````````
M````````````````````````````````#P`0@"!`+T!9H%F@6"!8(%F@6:`O
M0"!`$(`/```````````````````````.`!\`$X`/@!F`,8`_P![``````#_@
M?\`````````````````````````````````````````"(`1`"(`1`#,`&8`,
MP`9@````````````````````````````````````````?^!_X`!@`&``8`!@
M````````````````````````````````````````````````'X`?@```````
M``````````````````````````\`$(`@0#]`6:!9H%^@6R!;(%F@.<`@0!"`
M#P``````````````/\`_P```````````````````````````````````````
M````````````````````#@`7`".`88!A@'$`.@`<````````````````````
M```````````````````````````&``8`!@`&`'_@?^`&``8`!@`&````?^!_
MX```````````````````#@`?`!,``P`&``P`&``?`!\`````````````````
M```````````````````.`!\`$P`#``8``P`3`!\`#@``````````````````
M``````````.`#P`<````````````````````````````````````````````
M``````````````````````````!YX##`,,`PP##`,,`PP##`.<`^8#``,``P
M`#``8``````````?P#[`?L!^P'[`/L`>P`;`!L`&P`;`!L`&P`;`````````
M````````````````````````````````!@`/``\`!@``````````````````
M``````````````````````````````````````````````````(``P`!@`F`
M!P`````````&``X`#@`&``8`!@`&``8`#P``````````````````````````
M``````````<`"X`1P##`,,`X@!T`#@``````/^!_P```````````````````
M`````````````````````&8`,P`9@`S`"(`1`"(`1```````````````````
M`!@`.``X`!@`&"`88!C`&8`_0`;`#<`9P#+`9,!'X`#``,``````````````
M&``X`#@`&``8(!A@&,`9@#_`!^`/8!I@,,!A@$,``^`#X``````````````X
M`'P`3``,`!@@#&!,P'V`.T`&P`W`&<`RP&3`1^``P`#`````````````````
M```#``,```````,``P`&``P`&``P`#``,$`YP!^`#P```````````!P`#P`#
M@`8`!@`+``L`"0`1@!&`$(`_P"#`($!`8$!@X/```````````````X`/`!P`
M!@`&``L`"P`)`!&`$8`0@#_`(,`@0$!@0&#@\``````````````&``\`&8`&
M``8`"P`+``D`$8`1@!"`/\`@P"!`0&!`8.#P``````````````S`'X`S``8`
M!@`+``L`"0`1@!&`$(`_P"#`($!`8$!@X/``````````````&8`9@```!@`&
M``L`"P`)`!&`$8`0@#_`(,`@0$!@0&#@\``````````````&``\`&8`/``8`
M"P`+``D`$8`1@!"`/\`@P"!`0&!`8.#P``````````````````````_@#B`6
M(!8`%@`60"?`)D`^`"8`1@!&$$80Y_``````````````````````#\`08"`@
M(`!@`&``8`!@`&``8``@`#`@&$`/@`(``P`!@`F`!P`<``\``X!_P#!`,$`P
M`#``,(`_@#"`,``P`#``,"`P('_@``````````````.`#P`<`'_`,$`P0#``
M,``P@#^`,(`P`#``,``P(#`@?^``````````````!@`/`!F`?\`P0#!`,``P
M`#"`/X`P@#``,``P`#`@,"!_X``````````````9@!F```!_P#!`,$`P`#``
M,(`_@#"`,``P`#``,"`P('_@`````````````!P`#P`#@!^`!@`&``8`!@`&
M``8`!@`&``8`!@`&``8`'X```````````````X`/`!P`'X`&``8`!@`&``8`
M!@`&``8`!@`&``8`!@`?@``````````````&``\`&8`?@`8`!@`&``8`!@`&
M``8`!@`&``8`!@`&`!^``````````````!F`&8```!^`!@`&``8`!@`&``8`
M!@`&``8`!@`&``8`'X``````````````````````_P!AP&#`8&!@8&!@^&#X
M8&!@8&!@8&!`88#^```````````````,P!^`,P#`<&`@<"!X(%@@3"!&($<@
M0R!!H$#@0.!`8.`P`````````````!P`#P`#@`\`$<`@P"!@8&!@8&!@8&!@
M8&!@($`P0!B`#P```````````````X`/`!P`#P`1P"#`(&!@8&!@8&!@8&!@
M8&`@0#!`&(`/```````````````&``\`&8`/`!'`(,`@8&!@8&!@8&!@8&!@
M8"!`,$`8@`\```````````````S`'X`S``\`$<`@P"!@8&!@8&!@8&!@8&!@
M($`P0!B`#P``````````````&8`9@```#P`1P"#`(&!@8&!@8&!@8&!@8&`@
M0#!`&(`/`````````````````````````````````&!@,,`9@`\`!@`/`!F`
M,,!@8```````````````````````8`_`$<`AP"'@8V!C8&9@;&!L8'A@.$`P
M0#B`;P``````````````'``/``.`\'!@(&`@8"!@(&`@8"!@(&`@8"!@('!`
M/\`?@``````````````#@`\`'`#P<&`@8"!@(&`@8"!@(&`@8"!@(&`@<$`_
MP!^```````````````8`#P`9@/!P8"!@(&`@8"!@(&`@8"!@(&`@8"!P0#_`
M'X``````````````&8`9@```\'!@(&`@8"!@(&`@8"!@(&`@8"!@('!`/\`?
M@``````````````#@`\`'`#P<&`@,$`8@!B`#0`&``8`!@`&``8`!@`&``\`
M`````````````````````'@`,``P`#^`,,`P8#!@,&`P8##`/X`P`#``>```
M``````````````````\`&8`9@#&`,8`S@#8`-@`V`#.`,<`PX#1@-F!WP```
M```````````````````<``\``X````^`&,`0P`/`',`PP##`,,`YP![@````
M``````````````````.`#P`<````#X`8P!#``\`<P##`,,`PP#G`'N``````
M````````````````!@`/`!F````/@!C`$,`#P!S`,,`PP##`.<`>X```````
M```````````````,P!^`,P````^`&,`0P`/`',`PP##`,,`YP![@````````
M`````````````!F`&8``````#X`8P!#``\`<P##`,,`PP#G`'N``````````
M```````&``\`&8`/``8````/@!C`$,`#P!S`,,`PP##`.<`>X```````````
M`````````````````````!^`-D`F8`Y@/^!F`&8`9@!G8#_`````````````
M````````````````````'X`QP"#`8`!@`&``8`!P0##`'X`"``,``8`)@`<`
M````````'``/``.````/`##`8&!@8'_@8`!@`#``&&`/@```````````````
M```````#@`\`'`````\`,,!@8&!@?^!@`&``,``88`^`````````````````
M``````8`#P`9@```#P`PP&!@8&!_X&``8``P`!A@#X``````````````````
M````&8`9@``````/`##`8&!@8'_@8`!@`#``&&`/@```````````````````
M```<``\``X```!X`!@`&``8`!@`&``8`!@`&`!^`````````````````````
M``.`#P`<````'@`&``8`!@`&``8`!@`&``8`'X``````````````````````
M!@`/`!F````>``8`!@`&``8`!@`&``8`!@`?@``````````````````````9
M@!F``````!X`!@`&``8`!@`&``8`!@`&`!^````````````````````PP!^`
M!@`?`#&``<`/P!#@(.!@8&!@8&!P0#B`'P``````````````````````#,`?
M@#,````G@'G`,,`PP##`,,`PP##`,,!YX``````````````````````<``\`
M`X````^`$<`@X&!@8&!@8&!@<$`X@!\```````````````````````.`#P`<
M````#X`1P"#@8&!@8&!@8&!P0#B`'P``````````````````````!@`/`!F`
M```/@!'`(.!@8&!@8&!@8'!`.(`?```````````````````````,P!^`,P``
M``^`$<`@X&!@8&!@8&!@<$`X@!\``````````````````````!F`&8``````
M#X`1P"#@8&!@8&!@8&!P0#B`'P`````````````````````````````````&
M``8``````'_@?^``````!@`&``````````````````````````````````_@
M$<`AX&-@9F!F8&Q@>$`X@'\``````````````````````!P`#P`#@```>>`P
MP##`,,`PP##`,,`PP#G`'F```````````````````````X`/`!P```!YX##`
M,,`PP##`,,`PP##`.<`>8``````````````````````&``\`&8```'G@,,`P
MP##`,,`PP##`,,`YP!Y@`````````````````````!F`&8``````>>`PP##`
M,,`PP##`,,`PP#G`'F```````````````````````X`/`!P```#P\&`@,$`P
M0!B`&(`-``T`!@`&``0`#``(`'@`<```````X`!@`&``8`!@`&^`<<!@X&!@
M8&!@8&!@8$!P@'\`8`!@`&``8`#P`````````!F`&8``````\/!@(#!`,$`8
E@!B`#0`-``8`!@`$``P`"`!X`'``````(````%\```"A`&``7@``
`
end

226
share/vt/fonts/gallant.hex Normal file
View File

@ -0,0 +1,226 @@
# $FreeBSD$
# Width: 12
# Height: 22
0000:000000007fe07fe07fe07fe07fe07fe07fe07fe07fe07fe07fe07fe07fe07fe07fe000000000000000000000
0001:000000000000000000000000000006000f001f803fc07fe07fe03fc01f800f00060000000000000000000000
0002:00000000000000000000000055402aa055402aa055402aa055402aa055402aa0554000000000000000000000
0003:000000000000000000004400440044007c0044004400440003e0008000800080008000800080000000000000
0004:000000000000000000007c0040004000780040004000400003e00200020003c0020002000200000000000000
0005:00000000000000000000380044004000400040004400380003c00220022003c0028002400220000000000000
0006:000000000000000000004000400040004000400040007c0003e00200020003c0020002000200000000000000
0007:000000000e00170023806180618071003a001c00000000000000000000000000000000000000000000000000
0008:0000000000000000000006000600060006007fe07fe0060006000600060000007fe07fe00000000000000000
0009:0000000000000000000044006400640054004c004c00440002000200020002000200020003e0000000000000
000a:00000000000000000000440044004400280028001000100003e0008000800080008000800080000000000000
000b:0600060006000600060006000600060006000600fe00fe000000000000000000000000000000000000000000
000c:0000000000000000000000000000000000000000fe00fe000600060006000600060006000600060006000600
000d:000000000000000000000000000000000000000007f007f00600060006000600060006000600060006000600
000e:060006000600060006000600060006000600060007f007f00000000000000000000000000000000000000000
000f:0600060006000600060006000600060006000600fff0fff00600060006000600060006000600060006000600
0010:0000fff0fff00000000000000000000000000000000000000000000000000000000000000000000000000000
0011:000000000000000000000000fff0fff000000000000000000000000000000000000000000000000000000000
0012:0000000000000000000000000000000000000000fff0fff00000000000000000000000000000000000000000
0013:00000000000000000000000000000000000000000000000000000000fff0fff0000000000000000000000000
0014:0000000000000000000000000000000000000000000000000000000000000000000000000000fff0fff00000
0015:060006000600060006000600060006000600060007f007f00600060006000600060006000600060006000600
0016:0600060006000600060006000600060006000600fe00fe000600060006000600060006000600060006000600
0017:0600060006000600060006000600060006000600fff0fff00000000000000000000000000000000000000000
0018:0000000000000000000000000000000000000000fff0fff00600060006000600060006000600060006000600
0019:0600060006000600060006000600060006000600060006000600060006000600060006000600060006000600
001a:00000000000000000000000000e007801e00780078001e00078000e000007fe07fe000000000000000000000
001b:00000000000000000000000070001e00078001e001e007801e00700000007fe07fe000000000000000000000
001c:00000000000000000000000000003fe07fc019801980198019803180318031c060c000000000000000000000
001d:000000000000000000000000004000c001807fc07fc006000c007fc07fc03000600040000000000000000000
001e:000006000c00100010003000300030003e007c0018001800180018003f203fe031c000000000000000000000
001f:0000000000000000000000000000000000000000000006000600000000000000000000000000000000000000
0020:0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0021:0000000006000600060006000600060006000600060006000600000000000600060000000000000000000000
0022:0000000019801980198019801980198000000000000000000000000000000000000000000000000000000000
0023:0000000003300330033006601ff01ff00cc00cc0198019807fc07fc033006600660000000000000000000000
0024:0000000006001f803fc066e0666066003e001f8007c00660066066607fc03f80060000000000000000000000
0025:00000000386044c044c0458039800300030006000c000c0019c01a203220322061c000000000000000000000
0026:0000000007000f8018c018c018c00f801e003e007700636061e061c061803fe01e6000000000000000000000
0027:000000000c001e001e00060006000c0018001000000000000000000000000000000000000000000000000000
0028:0000000000c0018003800300070006000600060006000600070003000380018000c000000000000000000000
0029:00000000300018001c000c000e00060006000600060006000e000c001c001800300000000000000000000000
002a:0000000000000000000000000f000600666076e019800000198076e0666006000f0000000000000000000000
002b:000000000000000000000000000006000600060006007fe07fe0060006000600060000000000000000000000
002c:000000000000000000000000000000000000000000000000000000000c001e001e00060006000c0018001000
002d:000000000000000000000000000000000000000000007fe07fe0000000000000000000000000000000000000
002e:00000000000000000000000000000000000000000000000000000c001e001e000c0000000000000000000000
002f:00000000006000c000c0018001800300030006000c000c001800180030003000600000000000000000000000
0030:0000000007000f80118010c030c030c030c030c030c030c030c0308018801f000e0000000000000000000000
0031:00000000020006000e001e0036000600060006000600060006000600060006003fc000000000000000000000
0032:000000001f003f8061c040c000c000c000c00180030006000c00180030207fe07fe000000000000000000000
0033:000000000f801fc020e04060006000e007c00fc000e000600060406060403f801f0000000000000000000000
0034:0000000001800380038005800580098009801180118021803fe07fe001800180018000000000000000000000
0035:000000000fc00fc01000100020003f8031c000e00060006000604060606030c01f8000000000000000000000
0036:0000000007000c00180030003000600067806fc070e060606060606070403f801f0000000000000000000000
0037:000000001fe03fe06040004000c0008000800180010001000300020002000600040000000000000000000000
0038:000000000f00118030c030c030c018800d0006000b00118030c030c030c018800f0000000000000000000000
0039:000000000f8011c020e060606060606070e03f601e60006000c000c0018007003c0000000000000000000000
003a:00000000000000000000000000000c001e001e000c00000000000c001e001e000c0000000000000000000000
003b:000000000000000000000000000000000c001e001e000c00000000000c001e001e00060006000c0018001000
003c:0000000000000000000000000000006001c007001e00780078001e00070001c0006000000000000000000000
003d:0000000000000000000000000000000000007fc07fc0000000007fc07fc00000000000000000000000000000
003e:0000000000000000000000000000600038001e00078001e001e007801e003800600000000000000000000000
003f:000000000f001f8039c020c000c000c00180030006000c000c00000000000c000c0000000000000000000000
0040:000000000000000000000f803fc03060606067206fa06ca06ca067e0600030003fe00fe00000000000000000
0041:000000000000060006000b000b0009001180118010803fc020c0204040604060e0f000000000000000000000
0042:000000000000ff00608060c060c060c061807f8060c0606060606060606060c0ff8000000000000000000000
0043:0000000000000fc01060202020006000600060006000600060002000302018400f8000000000000000000000
0044:000000000000ff0061c060c06060606060606060606060606060606060406180fe0000000000000000000000
0045:0000000000007fc0304030403000300030803f803080300030003000302030207fe000000000000000000000
0046:0000000000007fc0304030403000300030803f80308030003000300030003000780000000000000000000000
0047:0000000000000fc0106020202000600060006000600061f060602060306018600f8000000000000000000000
0048:000000000000f0f0606060606060606060607fe0606060606060606060606060f0f000000000000000000000
0049:0000000000001f800600060006000600060006000600060006000600060006001f8000000000000000000000
004a:0000000000001f80060006000600060006000600060006000600060006000600060006000600040038003000
004b:000000000000f0e06180630066006c00780078007c006e006700638061c060e0f07000000000000000000000
004c:00000000000078003000300030003000300030003000300030003000302030207fe000000000000000000000
004d:000000000000e07060e070e070e070e05960596059604d604e604e6044604460e4f000000000000000000000
004e:000000000000c07060207020782058204c2046204720432041a040e040e04060e03000000000000000000000
004f:0000000000000f0011c020c020606060606060606060606060602040304018800f0000000000000000000000
0050:0000000000007f8030c030603060306030c03780300030003000300030003000780000000000000000000000
0051:0000000000000f0011c020c02060606060606060606060606060304038401f800e001f00239001e000000000
0052:000000000000ff00618060c060c060c060807f007c006e006700638061c060e0f07000000000000000000000
0053:0000000000001fe030606020602070003c001e00078001c000e04060406060c07f8000000000000000000000
0054:0000000000007fe04620060006000600060006000600060006000600060006001f8000000000000000000000
0055:000000000000f070602060206020602060206020602060206020602070403fc01f8000000000000000000000
0056:000000000000e0e060403080308030801900190019000c000e000e0004000400040000000000000000000000
0057:000000000000fef066206620662076207740334037403bc03b80198019801980198000000000000000000000
0058:000000000000f07060203040388018800d00060006000b00118011c020c04060e0f000000000000000000000
0059:000000000000f07060203040188018800d0006000600060006000600060006000f0000000000000000000000
005a:0000000000003fe020c000c00180018003000300060006000c000c00180018203fe000000000000000000000
005b:0000000007c007c00600060006000600060006000600060006000600060007c007c000000000000000000000
005c:000000006000600030003000180018000c000c000600030003000180018000c000c000000000000000000000
005d:000000007c007c000c000c000c000c000c000c000c000c000c000c000c007c007c0000000000000000000000
005e:0000000004000e001b00318060c0000000000000000000000000000000000000000000000000000000000000
005f:000000000000000000000000000000000000000000000000000000000000000000000000ffe0ffe000000000
0060:0000000001000300060006000780078003000000000000000000000000000000000000000000000000000000
0061:00000000000000000000000000000f8018c010c003c01cc030c030c030c039c01ee000000000000000000000
0062:0000000020006000e0006000600067806fc070e06060606060606060706078c04f8000000000000000000000
0063:00000000000000000000000000001f8031c020c06000600060006000704030c01f8000000000000000000000
0064:00000000006000e00060006000600f6031e020e0606060606060606070e039601e7000000000000000000000
0065:00000000000000000000000000000f0030c0606060607fe060006000300018600f8000000000000000000000
0066:00000000038004c004c00c000c000c000c001f800c000c000c000c000c000c001e0000000000000000000000
0067:00000000000000000000000000001f2031e060c060c060c031803f0060007fc03fe02060402040207fc03f80
0068:0000000010003000700030003000378039c030c030c030c030c030c030c030c079e000000000000000000000
0069:00000000000006000600000000001e00060006000600060006000600060006001f8000000000000000000000
006a:00000000000000c000c00000000003c000c000c000c000c000c000c000c000c000c020c030c038801f000e00
006b:000000006000e00060006000600061c0630066007c0078007c006e0067006380f1e000000000000000000000
006c:000000001e0006000600060006000600060006000600060006000600060006001f8000000000000000000000
006d:0000000000000000000000000000ddc06ee06660666066606660666066606660ef7000000000000000000000
006e:0000000000000000000000000000278079c030c030c030c030c030c030c030c079e000000000000000000000
006f:00000000000000000000000000000f8011c020e06060606060606060704038801f0000000000000000000000
0070:0000000000000000000000000000ef8071c060e06060606060606060604070807f006000600060006000f000
0071:00000000000000000000000000000f2011e020e06060606060606060706038e01fe0006000600060006000f0
0072:0000000000000000000000000000738034c038c0300030003000300030003000780000000000000000000000
0073:00000000000000000000000000001fc030c0304038001e00078001c020c030c03f8000000000000000000000
0074:0000000000000000040004000c007fc00c000c000c000c000c000c000c200e40078000000000000000000000
0075:000000000000000000000000000079e030c030c030c030c030c030c030c039c01e6000000000000000000000
0076:0000000000000000000000000000f070602030403040188018800d000d000600060000000000000000000000
0077:0000000000000000000000000000ff7066206620662037403b403b4019801980198000000000000000000000
0078:0000000000000000000000000000f8f0704038801d000e0007000b8011c020e0f1f000000000000000000000
0079:0000000000000000000000000000f0f0602030403040188018800d000d000600060004000c00080078007000
007a:00000000000000000000000000007fe060e041c0038007000e001c00382070607fe000000000000000000000
007b:0000000001c0030003000180018001800300070003000180018001800300030001c000000000000000000000
007c:0000000006000600060006000600060006000600060006000600060006000600060006000600060006000600
007d:0000000038000c000c001800180018000c000e000c001800180018000c000c00380000000000000000000000
007e:00000000000000000000000000000000000000001c203e6036c067c043800000000000000000000000000000
007f:aaa05550aaa05550aaa05550aaa05550aaa05550aaa05550aaa05550aaa05550aaa05550aaa05550aaa05550
00a1:0000000000000600060000000000060006000600060006000600060006000600060006000000000000000000
00a2:00000000000001000100030002001f003780258064006c006800788039801f00100030002000200000000000
00a3:000006000c00100010003000300030003e007c0018001800180018003f203fe031c000000000000000000000
00a4:00000000000000000000602077403b8011c030c030c038801dc02ee040600000000000000000000000000000
00a5:000000000000f07060203040188018800d0006003fc006003fc00600060006000f0000000000000000000000
00a6:0000000006000600060006000600060006000600060000000000060006000600060006000600060006000600
00a7:000000000fe01860302038201e001f8031c060e0706038c01f80078041c040c061807f000000000000000000
00a8:1980198000000000000000000000000000000000000000000000000000000000000000000000000000000000
00a9:0000000000000f00108020402f4059a059a05820582059a059a02f40204010800f0000000000000000000000
00aa:0000000000000e001f0013800f80198031803fc01ec0000000003fe07fc00000000000000000000000000000
00ab:000000000000000000000000000000000220044008801100330019800cc00660000000000000000000000000
00ac:0000000000000000000000000000000000007fe07fe000600060006000600000000000000000000000000000
00ad:000000000000000000000000000000000000000000001f801f80000000000000000000000000000000000000
00ae:0000000000000f00108020403f4059a059a05fa05b205b2059a039c0204010800f0000000000000000000000
00af:3fc03fc000000000000000000000000000000000000000000000000000000000000000000000000000000000
00b0:000000000e00170023806180618071003a001c00000000000000000000000000000000000000000000000000
00b1:0000000000000000000006000600060006007fe07fe0060006000600060000007fe07fe00000000000000000
00b2:0000000000000e001f001300030006000c0018001f001f000000000000000000000000000000000000000000
00b3:0000000000000e001f00130003000600030013001f000e000000000000000000000000000000000000000000
00b4:03800f001c000000000000000000000000000000000000000000000000000000000000000000000000000000
00b5:000000000000000000000000000079e030c030c030c030c030c030c030c039c03e6030003000300030006000
00b6:0000000000001fc03ec07ec07ec07ec03ec01ec006c006c006c006c006c006c006c000000000000000000000
00b7:000000000000000000000000000000000000000006000f000f00060000000000000000000000000000000000
00b8:0000000000000000000000000000000000000000000000000000000000000000000002000300018009800700
00b9:00000000000006000e000e00060006000600060006000f000000000000000000000000000000000000000000
00ba:00000000000007000b8011c030c030c038801d000e00000000003fe07fc00000000000000000000000000000
00bb:000000000000000000000000000000006600330019800cc00880110022004400000000000000000000000000
00bc:000018003800380018001820186018c019803f4006c00dc019c032c064c047e000c000c00000000000000000
00bd:000018003800380018001820186018c019803fc007e00f601a6030c06180430003e003e00000000000000000
00be:000038007c004c000c0018200c604cc07d803b4006c00dc019c032c064c047e000c000c00000000000000000
00bf:00000000000003000300000000000300030006000c00180030003000304039c01f800f000000000000000000
00c0:1c000f000380060006000b000b0009001180118010803fc020c0204040604060e0f000000000000000000000
00c1:03800f001c00060006000b000b0009001180118010803fc020c0204040604060e0f000000000000000000000
00c2:06000f001980060006000b000b0009001180118010803fc020c0204040604060e0f000000000000000000000
00c3:0cc01f803300060006000b000b0009001180118010803fc020c0204040604060e0f000000000000000000000
00c4:198019800000060006000b000b0009001180118010803fc020c0204040604060e0f000000000000000000000
00c5:06000f0019800f0006000b000b0009001180118010803fc020c0204040604060e0f000000000000000000000
00c6:0000000000000fe00e20162016001600164027c026403e002600460046104610e7f000000000000000000000
00c7:0000000000000fc01060202020006000600060006000600060002000302018400f8002000300018009800700
00c8:1c000f0003807fc0304030403000300030803f803080300030003000302030207fe000000000000000000000
00c9:03800f001c007fc0304030403000300030803f803080300030003000302030207fe000000000000000000000
00ca:06000f0019807fc0304030403000300030803f803080300030003000302030207fe000000000000000000000
00cb:1980198000007fc0304030403000300030803f803080300030003000302030207fe000000000000000000000
00cc:1c000f0003801f800600060006000600060006000600060006000600060006001f8000000000000000000000
00cd:03800f001c001f800600060006000600060006000600060006000600060006001f8000000000000000000000
00ce:06000f0019801f800600060006000600060006000600060006000600060006001f8000000000000000000000
00cf:1980198000001f800600060006000600060006000600060006000600060006001f8000000000000000000000
00d0:000000000000ff0061c060c0606060606060f860f86060606060606060406180fe0000000000000000000000
00d1:0cc01f803300c07060207020782058204c2046204720432041a040e040e04060e03000000000000000000000
00d2:1c000f0003800f0011c020c020606060606060606060606060602040304018800f0000000000000000000000
00d3:03800f001c000f0011c020c020606060606060606060606060602040304018800f0000000000000000000000
00d4:06000f0019800f0011c020c020606060606060606060606060602040304018800f0000000000000000000000
00d5:0cc01f8033000f0011c020c020606060606060606060606060602040304018800f0000000000000000000000
00d6:1980198000000f0011c020c020606060606060606060606060602040304018800f0000000000000000000000
00d7:0000000000000000000000000000606030c019800f0006000f00198030c06060000000000000000000000000
00d8:0000000000600fc011c021c021e06360636066606c606c6078603840304038806f0000000000000000000000
00d9:1c000f000380f070602060206020602060206020602060206020602070403fc01f8000000000000000000000
00da:03800f001c00f070602060206020602060206020602060206020602070403fc01f8000000000000000000000
00db:06000f001980f070602060206020602060206020602060206020602070403fc01f8000000000000000000000
00dc:198019800000f070602060206020602060206020602060206020602070403fc01f8000000000000000000000
00dd:03800f001c00f07060203040188018800d0006000600060006000600060006000f0000000000000000000000
00de:0000000000007800300030003f8030c0306030603060306030c03f8030003000780000000000000000000000
00df:000000000f0019801980318031803380360036003600338031c030e03460366077c000000000000000000000
00e0:0000000000001c000f00038000000f8018c010c003c01cc030c030c030c039c01ee000000000000000000000
00e1:00000000000003800f001c0000000f8018c010c003c01cc030c030c030c039c01ee000000000000000000000
00e2:00000000000006000f00198000000f8018c010c003c01cc030c030c030c039c01ee000000000000000000000
00e3:0000000000000cc01f80330000000f8018c010c003c01cc030c030c030c039c01ee000000000000000000000
00e4:00000000000019801980000000000f8018c010c003c01cc030c030c030c039c01ee000000000000000000000
00e5:000006000f0019800f00060000000f8018c010c003c01cc030c030c030c039c01ee000000000000000000000
00e6:00000000000000000000000000001f80364026600e603fe066006600660067603fc000000000000000000000
00e7:00000000000000000000000000001f8031c020c06000600060006000704030c01f8002000300018009800700
00e8:0000000000001c000f00038000000f0030c0606060607fe060006000300018600f8000000000000000000000
00e9:00000000000003800f001c0000000f0030c0606060607fe060006000300018600f8000000000000000000000
00ea:00000000000006000f00198000000f0030c0606060607fe060006000300018600f8000000000000000000000
00eb:00000000000019801980000000000f0030c0606060607fe060006000300018600f8000000000000000000000
00ec:0000000000001c000f00038000001e00060006000600060006000600060006001f8000000000000000000000
00ed:00000000000003800f001c0000001e00060006000600060006000600060006001f8000000000000000000000
00ee:00000000000006000f00198000001e00060006000600060006000600060006001f8000000000000000000000
00ef:00000000000019801980000000001e00060006000600060006000600060006001f8000000000000000000000
00f0:0000000030c01f8006001f00318001c00fc010e020e0606060606060704038801f0000000000000000000000
00f1:0000000000000cc01f8033000000278079c030c030c030c030c030c030c030c079e000000000000000000000
00f2:0000000000001c000f00038000000f8011c020e06060606060606060704038801f0000000000000000000000
00f3:00000000000003800f001c0000000f8011c020e06060606060606060704038801f0000000000000000000000
00f4:00000000000006000f00198000000f8011c020e06060606060606060704038801f0000000000000000000000
00f5:0000000000000cc01f80330000000f8011c020e06060606060606060704038801f0000000000000000000000
00f6:00000000000019801980000000000f8011c020e06060606060606060704038801f0000000000000000000000
00f7:000000000000000000000000000006000600000000007fe07fe0000000000600060000000000000000000000
00f8:00000000000000000000000000000fe011c021e06360666066606c60784038807f0000000000000000000000
00f9:0000000000001c000f000380000079e030c030c030c030c030c030c030c039c01e6000000000000000000000
00fa:00000000000003800f001c00000079e030c030c030c030c030c030c030c039c01e6000000000000000000000
00fb:00000000000006000f001980000079e030c030c030c030c030c030c030c039c01e6000000000000000000000
00fc:000000000000198019800000000079e030c030c030c030c030c030c030c039c01e6000000000000000000000
00fd:00000000000003800f001c000000f0f0602030403040188018800d000d000600060004000c00080078007000
00fe:00000000e00060006000600060006f8071c060e06060606060606060604070807f006000600060006000f000
00ff:0000000000001980198000000000f0f0602030403040188018800d000d000600060004000c00080078007000

View File

@ -389,7 +389,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
/* Allocate space for the signal handler context. */
if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack &&
SIGISMEMBER(psp->ps_sigonstack, sig)) {
sp = td->td_sigstk.ss_sp + td->td_sigstk.ss_size;
sp = (char *)td->td_sigstk.ss_sp + td->td_sigstk.ss_size;
#if defined(COMPAT_43)
td->td_sigstk.ss_flags |= SS_ONSTACK;
#endif

View File

@ -354,7 +354,7 @@ ia32_osendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
/* Allocate space for the signal handler context. */
if ((td->td_pflags & TDP_ALTSTACK) && !oonstack &&
SIGISMEMBER(psp->ps_sigonstack, sig)) {
fp = (struct ia32_sigframe3 *)(td->td_sigstk.ss_sp +
fp = (struct ia32_sigframe3 *)((uintptr_t)td->td_sigstk.ss_sp +
td->td_sigstk.ss_size - sizeof(sf));
td->td_sigstk.ss_flags |= SS_ONSTACK;
} else
@ -488,7 +488,7 @@ freebsd4_ia32_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
/* Allocate space for the signal handler context. */
if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack &&
SIGISMEMBER(psp->ps_sigonstack, sig)) {
sfp = (struct ia32_sigframe4 *)(td->td_sigstk.ss_sp +
sfp = (struct ia32_sigframe4 *)((uintptr_t)td->td_sigstk.ss_sp +
td->td_sigstk.ss_size - sizeof(sf));
} else
sfp = (struct ia32_sigframe4 *)regs->tf_rsp - 1;
@ -622,7 +622,7 @@ ia32_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
/* Allocate space for the signal handler context. */
if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack &&
SIGISMEMBER(psp->ps_sigonstack, sig))
sp = td->td_sigstk.ss_sp + td->td_sigstk.ss_size;
sp = (char *)td->td_sigstk.ss_sp + td->td_sigstk.ss_size;
else
sp = (char *)regs->tf_rsp;
if (xfpusave != NULL) {

View File

@ -271,6 +271,7 @@ elf_linux_fixup(register_t **stack_base, struct image_params *imgp)
Elf_Addr *pos;
struct ps_strings *arginfo;
struct proc *p;
int issetugid;
p = imgp->proc;
arginfo = (struct ps_strings *)p->p_sysent->sv_psstrings;
@ -281,6 +282,7 @@ elf_linux_fixup(register_t **stack_base, struct image_params *imgp)
args = (Elf64_Auxargs *)imgp->auxargs;
pos = base + (imgp->args->argc + imgp->args->envc + 2);
issetugid = p->p_flag & P_SUGID ? 1 : 0;
AUXARGS_ENTRY(pos, LINUX_AT_SYSINFO_EHDR,
imgp->proc->p_sysent->sv_shared_page_base);
AUXARGS_ENTRY(pos, LINUX_AT_HWCAP, cpu_feature);
@ -296,7 +298,7 @@ elf_linux_fixup(register_t **stack_base, struct image_params *imgp)
AUXARGS_ENTRY(pos, AT_EUID, imgp->proc->p_ucred->cr_svuid);
AUXARGS_ENTRY(pos, AT_GID, imgp->proc->p_ucred->cr_rgid);
AUXARGS_ENTRY(pos, AT_EGID, imgp->proc->p_ucred->cr_svgid);
AUXARGS_ENTRY(pos, LINUX_AT_SECURE, 0);
AUXARGS_ENTRY(pos, LINUX_AT_SECURE, issetugid);
AUXARGS_ENTRY(pos, LINUX_AT_PLATFORM, PTROUT(linux_platform));
AUXARGS_ENTRY(pos, LINUX_AT_RANDOM, imgp->canary);
if (imgp->execpathp != 0)
@ -628,7 +630,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
/* Allocate space for the signal handler context. */
if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack &&
SIGISMEMBER(psp->ps_sigonstack, sig)) {
sp = td->td_sigstk.ss_sp + td->td_sigstk.ss_size -
sp = (caddr_t)td->td_sigstk.ss_sp + td->td_sigstk.ss_size -
sizeof(struct l_rt_sigframe);
} else
sp = (caddr_t)regs->tf_rsp - sizeof(struct l_rt_sigframe) - 128;

View File

@ -230,6 +230,7 @@ elf_linux_fixup(register_t **stack_base, struct image_params *imgp)
Elf32_Addr *base;
Elf32_Addr *pos;
struct linux32_ps_strings *arginfo;
int issetugid;
arginfo = (struct linux32_ps_strings *)LINUX32_PS_STRINGS;
@ -239,6 +240,7 @@ elf_linux_fixup(register_t **stack_base, struct image_params *imgp)
args = (Elf32_Auxargs *)imgp->auxargs;
pos = base + (imgp->args->argc + imgp->args->envc + 2);
issetugid = imgp->proc->p_flag & P_SUGID ? 1 : 0;
AUXARGS_ENTRY_32(pos, LINUX_AT_SYSINFO_EHDR,
imgp->proc->p_sysent->sv_shared_page_base);
AUXARGS_ENTRY_32(pos, LINUX_AT_SYSINFO, linux32_vsyscall);
@ -261,7 +263,7 @@ elf_linux_fixup(register_t **stack_base, struct image_params *imgp)
AUXARGS_ENTRY_32(pos, AT_FLAGS, args->flags);
AUXARGS_ENTRY_32(pos, AT_ENTRY, args->entry);
AUXARGS_ENTRY_32(pos, AT_BASE, args->base);
AUXARGS_ENTRY_32(pos, LINUX_AT_SECURE, 0);
AUXARGS_ENTRY_32(pos, LINUX_AT_SECURE, issetugid);
AUXARGS_ENTRY_32(pos, AT_UID, imgp->proc->p_ucred->cr_ruid);
AUXARGS_ENTRY_32(pos, AT_EUID, imgp->proc->p_ucred->cr_svuid);
AUXARGS_ENTRY_32(pos, AT_GID, imgp->proc->p_ucred->cr_rgid);
@ -313,7 +315,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
*/
if ((td->td_pflags & TDP_ALTSTACK) && !oonstack &&
SIGISMEMBER(psp->ps_sigonstack, sig)) {
fp = (struct l_rt_sigframe *)(td->td_sigstk.ss_sp +
fp = (struct l_rt_sigframe *)((uintptr_t)td->td_sigstk.ss_sp +
td->td_sigstk.ss_size - sizeof(struct l_rt_sigframe));
} else
fp = (struct l_rt_sigframe *)regs->tf_rsp - 1;
@ -458,7 +460,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
*/
if ((td->td_pflags & TDP_ALTSTACK) && !oonstack &&
SIGISMEMBER(psp->ps_sigonstack, sig)) {
fp = (struct l_sigframe *)(td->td_sigstk.ss_sp +
fp = (struct l_sigframe *)((uintptr_t)td->td_sigstk.ss_sp +
td->td_sigstk.ss_size - sizeof(struct l_sigframe));
} else
fp = (struct l_sigframe *)regs->tf_rsp - 1;

View File

@ -296,7 +296,7 @@ sendsig(catcher, ksi, mask)
/* Allocate and validate space for the signal handler context. */
if ((td->td_pflags & TDP_ALTSTACK) != 0 && !(onstack) &&
SIGISMEMBER(psp->ps_sigonstack, sig)) {
fp = (struct sigframe *)(td->td_sigstk.ss_sp +
fp = (struct sigframe *)((uintptr_t)td->td_sigstk.ss_sp +
td->td_sigstk.ss_size);
#if defined(COMPAT_43)
td->td_sigstk.ss_flags |= SS_ONSTACK;

View File

@ -82,7 +82,7 @@ static int nexus_attach(device_t);
static int nexus_print_child(device_t, device_t);
static device_t nexus_add_child(device_t, u_int, const char *, int);
static struct resource *nexus_alloc_resource(device_t, device_t, int, int *,
u_long, u_long, u_long, u_int);
rman_res_t, rman_res_t, rman_res_t, u_int);
static int nexus_activate_resource(device_t, device_t, int, int,
struct resource *);
#ifdef ARM_INTRNG
@ -212,7 +212,7 @@ nexus_add_child(device_t bus, u_int order, const char *name, int unit)
*/
static struct resource *
nexus_alloc_resource(device_t bus, device_t child, int type, int *rid,
u_long start, u_long end, u_long count, u_int flags)
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct resource *rv;
struct rman *rm;

View File

@ -3799,14 +3799,19 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot,
* is set. Do it now, before the mapping is stored and made
* valid for hardware table walk. If done later, there is a race
* for other threads of current process in lazy loading case.
* Don't do it for kernel memory which is mapped with exec
* permission even if the memory isn't going to hold executable
* code. The only time when icache sync is needed is after
* kernel module is loaded and the relocation info is processed.
* And it's done in elf_cpu_load_file().
*
* QQQ: (1) Does it exist any better way where
* or how to sync icache?
* (2) Now, we do it on a page basis.
*/
if ((prot & VM_PROT_EXECUTE) &&
(m->md.pat_mode == PTE2_ATTR_WB_WA) &&
((opa != pa) || (opte2 & PTE2_NX)))
if ((prot & VM_PROT_EXECUTE) && pmap != kernel_pmap &&
m->md.pat_mode == PTE2_ATTR_WB_WA &&
(opa != pa || (opte2 & PTE2_NX)))
cache_icache_sync_fresh(va, pa, PAGE_SIZE);
npte2 |= PTE2_A;
@ -4405,7 +4410,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, vm_page_t m,
l2prot |= PTE2_U | PTE2_NG;
if ((prot & VM_PROT_EXECUTE) == 0)
l2prot |= PTE2_NX;
else if (m->md.pat_mode == PTE2_ATTR_WB_WA) {
else if (m->md.pat_mode == PTE2_ATTR_WB_WA && pmap != kernel_pmap) {
/*
* Sync icache if exec permission and attribute PTE2_ATTR_WB_WA
* is set. QQQ: For more info, see comments in pmap_enter().
@ -4476,7 +4481,7 @@ pmap_enter_pte1(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot)
l1prot |= PTE1_U | PTE1_NG;
if ((prot & VM_PROT_EXECUTE) == 0)
l1prot |= PTE1_NX;
else if (m->md.pat_mode == PTE2_ATTR_WB_WA) {
else if (m->md.pat_mode == PTE2_ATTR_WB_WA && pmap != kernel_pmap) {
/*
* Sync icache if exec permission and attribute PTE2_ATTR_WB_WA
* is set. QQQ: For more info, see comments in pmap_enter().
@ -6146,7 +6151,7 @@ pmap_fault(pmap_t pmap, vm_offset_t far, uint32_t fsr, int idx, bool usermode)
__func__, pmap, pmap->pm_pt1, far);
panic("%s: pm_pt1 abort", __func__);
}
return (EFAULT);
return (KERN_INVALID_ADDRESS);
}
if (__predict_false(IN_RANGE2(far, PT2MAP, PT2MAP_SIZE))) {
/*
@ -6162,7 +6167,7 @@ pmap_fault(pmap_t pmap, vm_offset_t far, uint32_t fsr, int idx, bool usermode)
__func__, pmap, PT2MAP, far);
panic("%s: PT2MAP abort", __func__);
}
return (EFAULT);
return (KERN_INVALID_ADDRESS);
}
/*
@ -6182,7 +6187,7 @@ pmap_fault(pmap_t pmap, vm_offset_t far, uint32_t fsr, int idx, bool usermode)
if (!pte2_cmpset(pte2p, pte2, pte2 | PTE2_A)) {
goto pte2_seta;
}
return (0);
return (KERN_SUCCESS);
}
}
if (idx == FAULT_ACCESS_L1) {
@ -6193,7 +6198,7 @@ pmap_fault(pmap_t pmap, vm_offset_t far, uint32_t fsr, int idx, bool usermode)
if (!pte1_cmpset(pte1p, pte1, pte1 | PTE1_A)) {
goto pte1_seta;
}
return (0);
return (KERN_SUCCESS);
}
}
@ -6217,7 +6222,7 @@ pmap_fault(pmap_t pmap, vm_offset_t far, uint32_t fsr, int idx, bool usermode)
goto pte2_setrw;
}
tlb_flush(trunc_page(far));
return (0);
return (KERN_SUCCESS);
}
}
if ((fsr & FSR_WNR) && (idx == FAULT_PERM_L1)) {
@ -6230,7 +6235,7 @@ pmap_fault(pmap_t pmap, vm_offset_t far, uint32_t fsr, int idx, bool usermode)
goto pte1_setrw;
}
tlb_flush(pte1_trunc(far));
return (0);
return (KERN_SUCCESS);
}
}
@ -6269,7 +6274,7 @@ pmap_fault(pmap_t pmap, vm_offset_t far, uint32_t fsr, int idx, bool usermode)
}
}
#endif
return (EAGAIN);
return (KERN_FAILURE);
}
/* !!!! REMOVE !!!! */

View File

@ -3446,14 +3446,10 @@ pmap_extract_locked(pmap_t pmap, vm_offset_t va)
pte = ptep[l2pte_index(va)];
if (pte == 0)
return (0);
switch (pte & L2_TYPE_MASK) {
case L2_TYPE_L:
if ((pte & L2_TYPE_MASK) == L2_TYPE_L)
pa = (pte & L2_L_FRAME) | (va & L2_L_OFFSET);
break;
default:
else
pa = (pte & L2_S_FRAME) | (va & L2_S_OFFSET);
break;
}
}
return (pa);
}
@ -3515,20 +3511,15 @@ pmap_extract_and_hold(pmap_t pmap, vm_offset_t va, vm_prot_t prot)
PMAP_UNLOCK(pmap);
return (NULL);
} else {
switch (pte & L2_TYPE_MASK) {
case L2_TYPE_L:
if ((pte & L2_TYPE_MASK) == L2_TYPE_L)
panic("extract and hold section mapping");
break;
default:
else
pa = (pte & L2_S_FRAME) | (va & L2_S_OFFSET);
break;
}
if (vm_page_pa_tryrelock(pmap, pa & PG_FRAME, &paddr))
goto retry;
m = PHYS_TO_VM_PAGE(pa);
vm_page_hold(m);
}
}
PMAP_UNLOCK(pmap);
@ -3567,14 +3558,10 @@ pmap_dump_kextract(vm_offset_t va, pt2_entry_t *pte2p)
pa = 0;
goto out;
}
switch (pte & L2_TYPE_MASK) {
case L2_TYPE_L:
if ((pte & L2_TYPE_MASK) == L2_TYPE_L)
pa = (pte & L2_L_FRAME) | (va & L2_L_OFFSET);
break;
default:
else
pa = (pte & L2_S_FRAME) | (va & L2_S_OFFSET);
break;
}
}
out:
if (pte2p != NULL)

View File

@ -2787,18 +2787,14 @@ pmap_kremove(vm_offset_t va)
pte = &l2b->l2b_kva[l2pte_index(va)];
opte = *pte;
if (l2pte_valid(opte)) {
/* pa = vtophs(va) taken from pmap_extract() */
switch (opte & L2_TYPE_MASK) {
case L2_TYPE_L:
/* pa = vtophs(va) taken from pmap_extract() */
if ((opte & L2_TYPE_MASK) == L2_TYPE_L)
pa = (opte & L2_L_FRAME) | (va & L2_L_OFFSET);
break;
default:
else
pa = (opte & L2_S_FRAME) | (va & L2_S_OFFSET);
break;
}
/* note: should never have to remove an allocation
* before the pvzone is initialized.
*/
/* note: should never have to remove an allocation
* before the pvzone is initialized.
*/
rw_wlock(&pvh_global_lock);
PMAP_LOCK(pmap_kernel());
if (pvzone != NULL && (m = vm_phys_paddr_to_vm_page(pa)) &&
@ -3645,14 +3641,10 @@ pmap_extract_locked(pmap_t pmap, vm_offset_t va)
pte = ptep[l2pte_index(va)];
if (pte == 0)
return (0);
switch (pte & L2_TYPE_MASK) {
case L2_TYPE_L:
if ((pte & L2_TYPE_MASK) == L2_TYPE_L)
pa = (pte & L2_L_FRAME) | (va & L2_L_OFFSET);
break;
default:
else
pa = (pte & L2_S_FRAME) | (va & L2_S_OFFSET);
break;
}
}
return (pa);
}
@ -3717,15 +3709,10 @@ pmap_extract_and_hold(pmap_t pmap, vm_offset_t va, vm_prot_t prot)
return (NULL);
}
if (pte & L2_S_PROT_W || (prot & VM_PROT_WRITE) == 0) {
switch (pte & L2_TYPE_MASK) {
case L2_TYPE_L:
if ((pte & L2_TYPE_MASK) == L2_TYPE_L)
pa = (pte & L2_L_FRAME) | (va & L2_L_OFFSET);
break;
default:
else
pa = (pte & L2_S_FRAME) | (va & L2_S_OFFSET);
break;
}
if (vm_page_pa_tryrelock(pmap, pa & PG_FRAME, &paddr))
goto retry;
m = PHYS_TO_VM_PAGE(pa);
@ -3769,14 +3756,10 @@ pmap_dump_kextract(vm_offset_t va, pt2_entry_t *pte2p)
pa = 0;
goto out;
}
switch (pte & L2_TYPE_MASK) {
case L2_TYPE_L:
if ((pte & L2_TYPE_MASK) == L2_TYPE_L)
pa = (pte & L2_L_FRAME) | (va & L2_L_OFFSET);
break;
default:
else
pa = (pte & L2_S_FRAME) | (va & L2_S_OFFSET);
break;
}
}
out:
if (pte2p != NULL)

View File

@ -336,14 +336,10 @@ abort_handler(struct trapframe *tf, int prefetch)
#ifdef ARM_NEW_PMAP
rv = pmap_fault(PCPU_GET(curpmap), far, fsr, idx, usermode);
if (rv == 0) {
if (rv == KERN_SUCCESS)
return;
} else if (rv == EFAULT) {
call_trapsignal(td, SIGSEGV, SEGV_MAPERR, far);
userret(td, tf);
return;
}
if (rv == KERN_INVALID_ADDRESS)
goto nogo;
#endif
/*
* Now, when we handled imprecise and debug aborts, the rest of
@ -452,7 +448,6 @@ abort_handler(struct trapframe *tf, int prefetch)
*/
/* fusubailout is used by [fs]uswintr to avoid page faulting. */
pcb = td->td_pcb;
if (__predict_false(pcb->pcb_onfault == fusubailout)) {
tf->tf_r0 = EFAULT;
tf->tf_pc = (register_t)pcb->pcb_onfault;

View File

@ -147,7 +147,7 @@ at91_attach(device_t dev)
static struct resource *
at91_alloc_resource(device_t dev, device_t child, int type, int *rid,
u_long start, u_long end, u_long count, u_int flags)
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct at91_softc *sc = device_get_softc(dev);
struct resource_list_entry *rle;
@ -255,7 +255,7 @@ at91_activate_resource(device_t bus, device_t child, int type, int rid,
struct resource *r)
{
#if 0
u_long p;
rman_res_t p;
int error;
if (type == SYS_RES_MEMORY) {

View File

@ -408,7 +408,7 @@ econa_attach(device_t dev)
static struct resource *
econa_alloc_resource(device_t dev, device_t child, int type, int *rid,
u_long start, u_long end, u_long count, u_int flags)
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct econa_softc *sc = device_get_softc(dev);
struct resource_list_entry *rle;

View File

@ -100,7 +100,7 @@ static int localbus_attach(device_t);
static int localbus_print_child(device_t, device_t);
static struct resource *localbus_alloc_resource(device_t, device_t, int,
int *, u_long, u_long, u_long, u_int);
int *, rman_res_t, rman_res_t, rman_res_t, u_int);
static struct resource_list *localbus_get_resource_list(device_t, device_t);
static ofw_bus_get_devinfo_t localbus_get_devinfo;
@ -332,7 +332,7 @@ localbus_print_child(device_t dev, device_t child)
static struct resource *
localbus_alloc_resource(device_t bus, device_t child, int type, int *rid,
u_long start, u_long end, u_long count, u_int flags)
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct localbus_devinfo *di;
struct resource_list_entry *rle;

View File

@ -332,7 +332,7 @@ static int mv_pcib_probe(device_t);
static int mv_pcib_attach(device_t);
static struct resource *mv_pcib_alloc_resource(device_t, device_t, int, int *,
u_long, u_long, u_long, u_int);
rman_res_t, rman_res_t, rman_res_t, u_int);
static int mv_pcib_release_resource(device_t, device_t, int, int,
struct resource *);
static int mv_pcib_read_ivar(device_t, device_t, int, uintptr_t *);
@ -830,7 +830,7 @@ mv_pcib_init_all_bars(struct mv_pcib_softc *sc, int bus, int slot,
static struct resource *
mv_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid,
u_long start, u_long end, u_long count, u_int flags)
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct mv_pcib_softc *sc = device_get_softc(dev);
struct rman *rm = NULL;

View File

@ -305,7 +305,7 @@ versatile_pci_write_ivar(device_t dev, device_t child, int which,
static struct resource *
versatile_pci_alloc_resource(device_t bus, device_t child, int type, int *rid,
u_long start, u_long end, u_long count, u_int flags)
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct versatile_pci_softc *sc = device_get_softc(bus);

View File

@ -409,7 +409,7 @@ i81342_attach(device_t dev)
static struct resource *
i81342_alloc_resource(device_t dev, device_t child, int type, int *rid,
u_long start, u_long end, u_long count, u_int flags)
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct i81342_softc *sc = device_get_softc(dev);
struct resource *rv;

View File

@ -328,7 +328,7 @@ i81342_pci_write_config(device_t dev, u_int bus, u_int slot, u_int func,
static struct resource *
i81342_pci_alloc_resource(device_t bus, device_t child, int type, int *rid,
u_long start, u_long end, u_long count, u_int flags)
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct i81342_pci_softc *sc = device_get_softc(bus);
struct resource *rv;
@ -383,7 +383,7 @@ static int
i81342_pci_activate_resource(device_t bus, device_t child, int type, int rid,
struct resource *r)
{
u_long p;
bus_space_handle_t p;
int error;
if (type == SYS_RES_MEMORY) {

View File

@ -91,7 +91,7 @@ obio_attach(device_t dev)
static struct resource *
obio_alloc_resource(device_t bus, device_t child, int type, int *rid,
u_long start, u_long end, u_long count, u_int flags)
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct resource *rv;
struct rman *rm;

View File

@ -282,7 +282,7 @@ ata_avila_intr(void *xsc)
static struct resource *
ata_avila_alloc_resource(device_t dev, device_t child, int type, int *rid,
u_long start, u_long end, u_long count, u_int flags)
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct ata_avila_softc *sc = device_get_softc(dev);

View File

@ -496,7 +496,7 @@ getvbase(uint32_t hwbase, uint32_t size, uint32_t *vbase)
static struct resource *
ixp425_alloc_resource(device_t dev, device_t child, int type, int *rid,
u_long start, u_long end, u_long count, u_int flags)
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct ixp425_softc *sc = device_get_softc(dev);
const struct hwvtrans *vtrans;

View File

@ -269,7 +269,7 @@ ixppcib_teardown_intr(device_t dev, device_t child, struct resource *vec,
static struct resource *
ixppcib_alloc_resource(device_t bus, device_t child, int type, int *rid,
u_long start, u_long end, u_long count, u_int flags)
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct ixppcib_softc *sc = device_get_softc(bus);
struct rman *rmanp;

View File

@ -50,14 +50,14 @@ static int pxa_read_ivar(device_t, device_t, int, uintptr_t *);
static struct resource_list * pxa_get_resource_list(device_t, device_t);
static struct resource * pxa_alloc_resource(device_t, device_t, int,
int *, u_long, u_long, u_long, u_int);
int *, rman_res_t, rman_res_t, rman_res_t, u_int);
static int pxa_release_resource(device_t, device_t, int,
int, struct resource *);
static int pxa_activate_resource(device_t, device_t,
int, int, struct resource *);
static struct resource * pxa_alloc_gpio_irq(device_t, device_t, int,
int *, u_long, u_long, u_long, u_int);
int *, rman_res_t, rman_res_t, rman_res_t, u_int);
struct obio_device {
const char *od_name;
@ -224,7 +224,7 @@ pxa_get_resource_list(device_t dev, device_t child)
static struct resource *
pxa_alloc_resource(device_t dev, device_t child, int type, int *rid,
u_long start, u_long end, u_long count, u_int flags)
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct obio_softc *sc;
struct obio_device *od;
@ -351,7 +351,7 @@ DRIVER_MODULE(pxa, nexus, pxa_driver, pxa_devclass, 0, 0);
static struct resource *
pxa_alloc_gpio_irq(device_t dev, device_t child, int type, int *rid,
u_long start, u_long end, u_long count, u_int flags)
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct obio_softc *sc;
struct obio_device *od;

View File

@ -70,7 +70,7 @@ static int pxa_smi_print_child(device_t, device_t);
static int pxa_smi_read_ivar(device_t, device_t, int, uintptr_t *);
static struct resource * pxa_smi_alloc_resource(device_t, device_t,
int, int *, u_long, u_long, u_long, u_int);
int, int *, rman_res_t, rman_res_t, rman_res_t, u_int);
static int pxa_smi_release_resource(device_t, device_t,
int, int, struct resource *);
static int pxa_smi_activate_resource(device_t, device_t,
@ -176,7 +176,7 @@ pxa_smi_read_ivar(device_t dev, device_t child, int which, uintptr_t *result)
static struct resource *
pxa_smi_alloc_resource(device_t dev, device_t child, int type, int *rid,
u_long start, u_long end, u_long count, u_int flags)
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct pxa_smi_softc *sc;
struct smi_ivars *smid;

View File

@ -54,7 +54,7 @@ static int gic_v3_fdt_probe(device_t);
static int gic_v3_fdt_attach(device_t);
static struct resource *gic_v3_ofw_bus_alloc_res(device_t, device_t, int, int *,
u_long, u_long, u_long, u_int);
rman_res_t, rman_res_t, rman_res_t, u_int);
static const struct ofw_bus_devinfo *gic_v3_ofw_get_devinfo(device_t, device_t);
static device_method_t gic_v3_fdt_methods[] = {
@ -174,7 +174,7 @@ gic_v3_ofw_get_devinfo(device_t bus __unused, device_t child)
static struct resource *
gic_v3_ofw_bus_alloc_res(device_t bus, device_t child, int type, int *rid,
u_long start, u_long end, u_long count, u_int flags)
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct gic_v3_ofw_devinfo *di;
struct resource_list_entry *rle;

View File

@ -527,7 +527,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
/* Allocate and validate space for the signal handler context. */
if ((td->td_pflags & TDP_ALTSTACK) != 0 && !onstack &&
SIGISMEMBER(psp->ps_sigonstack, sig)) {
fp = (struct sigframe *)(td->td_sigstk.ss_sp +
fp = (struct sigframe *)((uintptr_t)td->td_sigstk.ss_sp +
td->td_sigstk.ss_size);
#if defined(COMPAT_43)
td->td_sigstk.ss_flags |= SS_ONSTACK;

View File

@ -99,13 +99,14 @@ static device_attach_t nexus_acpi_attach;
static int nexus_print_child(device_t, device_t);
static device_t nexus_add_child(device_t, u_int, const char *, int);
static struct resource *nexus_alloc_resource(device_t, device_t, int, int *,
u_long, u_long, u_long, u_int);
rman_res_t, rman_res_t, rman_res_t, u_int);
static int nexus_activate_resource(device_t, device_t, int, int,
struct resource *);
static int nexus_config_intr(device_t dev, int irq, enum intr_trigger trig,
enum intr_polarity pol);
static struct resource_list *nexus_get_reslist(device_t, device_t);
static int nexus_set_resource(device_t, device_t, int, int, u_long, u_long);
static int nexus_set_resource(device_t, device_t, int, int,
rman_res_t, rman_res_t);
static int nexus_deactivate_resource(device_t, device_t, int, int,
struct resource *);
@ -201,7 +202,7 @@ nexus_add_child(device_t bus, u_int order, const char *name, int unit)
*/
static struct resource *
nexus_alloc_resource(device_t bus, device_t child, int type, int *rid,
u_long start, u_long end, u_long count, u_int flags)
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct nexus_device *ndev = DEVTONX(child);
struct resource *rv;
@ -332,7 +333,7 @@ nexus_get_reslist(device_t dev, device_t child)
static int
nexus_set_resource(device_t dev, device_t child, int type, int rid,
u_long start, u_long count)
rman_res_t start, rman_res_t count)
{
struct nexus_device *ndev = DEVTONX(child);
struct resource_list *rl = &ndev->nx_resources;

View File

@ -186,7 +186,7 @@ cpu_set_upcall_kse(struct thread *td, void (*entry)(void *), void *arg,
{
struct trapframe *tf = td->td_frame;
tf->tf_sp = STACKALIGN(stack->ss_sp + stack->ss_size);
tf->tf_sp = STACKALIGN((uintptr_t)stack->ss_sp + stack->ss_size);
tf->tf_elr = (register_t)entry;
tf->tf_x[0] = (register_t)arg;
}

View File

@ -110,7 +110,7 @@ SYSCTL_INT(_hw, OID_AUTO, thunder_pcie_max_vfs, CTLFLAG_RWTUN,
/* Forward prototypes */
static struct resource *thunder_pcie_alloc_resource(device_t,
device_t, int, int *, u_long, u_long, u_long, u_int);
device_t, int, int *, rman_res_t, rman_res_t, rman_res_t, u_int);
static int thunder_pcie_attach(device_t);
static int thunder_pcie_identify_pcib(device_t);
static int thunder_pcie_maxslots(device_t);
@ -431,7 +431,7 @@ thunder_pcie_release_resource(device_t dev, device_t child, int type, int rid,
static struct resource *
thunder_pcie_alloc_resource(device_t dev, device_t child, int type, int *rid,
u_long start, u_long end, u_long count, u_int flags)
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct thunder_pcie_softc *sc = device_get_softc(dev);
struct rman *rm = NULL;
@ -519,7 +519,7 @@ static int
thunder_pcie_identify_pcib(device_t dev)
{
struct thunder_pcie_softc *sc;
u_long start;
rman_res_t start;
sc = device_get_softc(dev);
start = bus_get_resource_start(dev, SYS_RES_MEMORY, 0);

View File

@ -126,7 +126,7 @@ struct thunder_pem_softc {
};
static struct resource * thunder_pem_alloc_resource(device_t, device_t, int,
int *, u_long, u_long, u_long, u_int);
int *, rman_res_t, rman_res_t, rman_res_t, u_int);
static int thunder_pem_attach(device_t);
static int thunder_pem_detach(device_t);
static uint64_t thunder_pem_config_reg_read(struct thunder_pem_softc *, int);
@ -230,7 +230,7 @@ static int
thunder_pem_identify(device_t dev)
{
struct thunder_pem_softc *sc;
u_long start;
rman_res_t start;
sc = device_get_softc(dev);
start = rman_get_start(sc->reg);
@ -426,7 +426,7 @@ thunder_pem_write_config(device_t dev, u_int bus, u_int slot,
static struct resource *
thunder_pem_alloc_resource(device_t dev, device_t child, int type, int *rid,
u_long start, u_long end, u_long count, u_int flags)
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct thunder_pem_softc *sc = device_get_softc(dev);
struct rman *rm = NULL;

View File

@ -31,9 +31,9 @@
#define PATH_DOTCONFIG "/boot.config"
#define PATH_CONFIG "/boot/config"
#define PATH_BOOT3 "/boot/loader"
#define PATH_LOADER "/boot/loader"
#define PATH_LOADER_EFI "/boot/loader.efi"
#define PATH_LOADER_ZFS "/boot/zfsloader"
#define PATH_KERNEL "/boot/kernel/kernel"
#endif /* _PATHS_H_ */

View File

@ -58,7 +58,7 @@ void ficlTextOut(FICL_VM *pVM, char *msg, int fNewline)
IGNORE(pVM);
while(*msg != 0)
putchar(*(msg++));
putchar((unsigned char)*(msg++));
if (fNewline)
putchar('\n');

View File

@ -235,7 +235,7 @@ main(void)
*/
if (!kname) {
kname = PATH_BOOT3;
kname = PATH_LOADER;
if (autoboot && !keyhit(3*SECOND)) {
load();
kname = PATH_KERNEL;

View File

@ -178,7 +178,7 @@ main(void)
if (autoboot && keyhit(3)) {
if (*kname == '\0')
memcpy(kname, PATH_BOOT3, sizeof(PATH_BOOT3));
memcpy(kname, PATH_LOADER, sizeof(PATH_LOADER));
break;
}
autoboot = 0;
@ -190,7 +190,7 @@ main(void)
*/
if (*kname != '\0')
load();
memcpy(kname, PATH_BOOT3, sizeof(PATH_BOOT3));
memcpy(kname, PATH_LOADER, sizeof(PATH_LOADER));
load();
memcpy(kname, PATH_KERNEL, sizeof(PATH_KERNEL));
load();

View File

@ -546,12 +546,12 @@ main(void)
}
/*
* Try to exec stage 3 boot loader. If interrupted by a keypress,
* Try to exec /boot/loader. If interrupted by a keypress,
* or in case of failure, try to load a kernel directly instead.
*/
if (autoboot && !*kname) {
memcpy(kname, PATH_BOOT3, sizeof(PATH_BOOT3));
memcpy(kname, PATH_LOADER_ZFS, sizeof(PATH_LOADER_ZFS));
if (!keyhit(3)) {
load();
memcpy(kname, PATH_KERNEL, sizeof(PATH_KERNEL));

View File

@ -132,7 +132,7 @@ static struct dsk {
} dsk;
static char cmd[512], cmddup[512], knamebuf[1024];
static const char *kname;
static uint32_t opts;
uint32_t opts;
#if 0
static int comspeed = SIOSPD;
#endif
@ -248,7 +248,7 @@ main(u_int argc, const char *argv[], const char *envv[], uint64_t memsize)
*/
if (!kname) {
kname = PATH_BOOT3;
kname = PATH_LOADER;
if (autoboot && !keyhit(3*SECOND)) {
boot_fromfs();
kname = PATH_KERNEL;

View File

@ -104,7 +104,7 @@ static struct dsk {
} dsk;
static char cmd[512], cmddup[512], knamebuf[1024];
static const char *kname;
static uint32_t opts;
uint32_t opts;
static struct bootinfo bootinfo;
#if SERIAL
static int comspeed = SIOSPD;
@ -374,7 +374,7 @@ main(void)
*/
if (!kname) {
kname = PATH_BOOT3;
kname = PATH_LOADER;
if (autoboot && !keyhit(3*SECOND)) {
load();
kname = PATH_KERNEL;

View File

@ -5567,10 +5567,12 @@ arc_fini(void)
multilist_destroy(&arc_mru_ghost->arcs_list[ARC_BUFC_METADATA]);
multilist_destroy(&arc_mfu->arcs_list[ARC_BUFC_METADATA]);
multilist_destroy(&arc_mfu_ghost->arcs_list[ARC_BUFC_METADATA]);
multilist_destroy(&arc_l2c_only->arcs_list[ARC_BUFC_METADATA]);
multilist_destroy(&arc_mru->arcs_list[ARC_BUFC_DATA]);
multilist_destroy(&arc_mru_ghost->arcs_list[ARC_BUFC_DATA]);
multilist_destroy(&arc_mfu->arcs_list[ARC_BUFC_DATA]);
multilist_destroy(&arc_mfu_ghost->arcs_list[ARC_BUFC_DATA]);
multilist_destroy(&arc_l2c_only->arcs_list[ARC_BUFC_DATA]);
buf_fini();

View File

@ -1789,6 +1789,7 @@ dmu_objset_find_dp(dsl_pool_t *dp, uint64_t ddobj,
* thread suffices. For now, stay single threaded.
*/
dmu_objset_find_dp_impl(dcp);
mutex_destroy(&err_lock);
return (error);
}
@ -1800,6 +1801,8 @@ dmu_objset_find_dp(dsl_pool_t *dp, uint64_t ddobj,
INT_MAX, 0);
if (tq == NULL) {
kmem_free(dcp, sizeof (*dcp));
mutex_destroy(&err_lock);
return (SET_ERROR(ENOMEM));
}
dcp->dc_tq = tq;

View File

@ -158,6 +158,14 @@ dump_record(dmu_sendarg_t *dsp, void *payload, int payload_len)
return (0);
}
/*
* Fill in the drr_free struct, or perform aggregation if the previous record is
* also a free record, and the two are adjacent.
*
* Note that we send free records even for a full send, because we want to be
* able to receive a full send as a clone, which requires a list of all the free
* and freeobject records that were generated on the source.
*/
static int
dump_free(dmu_sendarg_t *dsp, uint64_t object, uint64_t offset,
uint64_t length)
@ -181,15 +189,6 @@ dump_free(dmu_sendarg_t *dsp, uint64_t object, uint64_t offset,
(object == dsp->dsa_last_data_object &&
offset > dsp->dsa_last_data_offset));
/*
* If we are doing a non-incremental send, then there can't
* be any data in the dataset we're receiving into. Therefore
* a free record would simply be a no-op. Save space by not
* sending it to begin with.
*/
if (!dsp->dsa_incremental)
return (0);
if (length != -1ULL && offset + length < offset)
length = -1ULL;
@ -368,10 +367,6 @@ dump_freeobjects(dmu_sendarg_t *dsp, uint64_t firstobj, uint64_t numobjs)
{
struct drr_freeobjects *drrfo = &(dsp->dsa_drr->drr_u.drr_freeobjects);
/* See comment in dump_free(). */
if (!dsp->dsa_incremental)
return (0);
/*
* If there is a pending op, but it's not PENDING_FREEOBJECTS,
* push it out, since free block aggregation can only be done for
@ -776,6 +771,7 @@ dmu_send_impl(void *tag, dsl_pool_t *dp, dsl_dataset_t *to_ds,
drr->drr_u.drr_begin.drr_toguid = dsl_dataset_phys(to_ds)->ds_guid;
if (dsl_dataset_phys(to_ds)->ds_flags & DS_FLAG_CI_DATASET)
drr->drr_u.drr_begin.drr_flags |= DRR_FLAG_CI_DATA;
drr->drr_u.drr_begin.drr_flags |= DRR_FLAG_FREERECORDS;
if (ancestor_zb != NULL) {
drr->drr_u.drr_begin.drr_fromguid =
@ -799,7 +795,6 @@ dmu_send_impl(void *tag, dsl_pool_t *dp, dsl_dataset_t *to_ds,
dsp->dsa_off = off;
dsp->dsa_toguid = dsl_dataset_phys(to_ds)->ds_guid;
dsp->dsa_pending_op = PENDING_NONE;
dsp->dsa_incremental = (ancestor_zb != NULL);
dsp->dsa_featureflags = featureflags;
dsp->dsa_resume_object = resumeobj;
dsp->dsa_resume_offset = resumeoff;
@ -1321,7 +1316,7 @@ dmu_recv_begin_check(void *arg, dmu_tx_t *tx)
/* target fs already exists; recv into temp clone */
/* Can't recv a clone into an existing fs */
if (flags & DRR_FLAG_CLONE) {
if (flags & DRR_FLAG_CLONE || drba->drba_origin) {
dsl_dataset_rele(ds, FTAG);
return (SET_ERROR(EINVAL));
}
@ -1340,6 +1335,15 @@ dmu_recv_begin_check(void *arg, dmu_tx_t *tx)
drba->drba_origin))
return (SET_ERROR(ENOENT));
/*
* If we're receiving a full send as a clone, and it doesn't
* contain all the necessary free records and freeobject
* records, reject it.
*/
if (fromguid == 0 && drba->drba_origin &&
!(flags & DRR_FLAG_FREERECORDS))
return (SET_ERROR(EINVAL));
/* Open the parent of tofs */
ASSERT3U(strlen(tofs), <, MAXNAMELEN);
(void) strlcpy(buf, tofs, strrchr(tofs, '/') - tofs + 1);
@ -1379,7 +1383,8 @@ dmu_recv_begin_check(void *arg, dmu_tx_t *tx)
dsl_dataset_rele(ds, FTAG);
return (SET_ERROR(EINVAL));
}
if (dsl_dataset_phys(origin)->ds_guid != fromguid) {
if (dsl_dataset_phys(origin)->ds_guid != fromguid &&
fromguid != 0) {
dsl_dataset_rele(origin, FTAG);
dsl_dataset_rele(ds, FTAG);
return (SET_ERROR(ENODEV));
@ -1709,6 +1714,20 @@ struct receive_writer_arg {
uint64_t bytes_read; /* bytes read when current record created */
};
struct objlist {
list_t list; /* List of struct receive_objnode. */
/*
* Last object looked up. Used to assert that objects are being looked
* up in ascending order.
*/
uint64_t last_lookup;
};
struct receive_objnode {
list_node_t node;
uint64_t object;
};
struct receive_arg {
objset_t *os;
kthread_t *td;
@ -1727,12 +1746,7 @@ struct receive_arg {
int err;
boolean_t byteswap;
/* Sorted list of objects not to issue prefetches for. */
list_t ignore_obj_list;
};
struct receive_ign_obj_node {
list_node_t node;
uint64_t object;
struct objlist ignore_objlist;
};
typedef struct guid_map_entry {
@ -2068,13 +2082,14 @@ receive_freeobjects(struct receive_writer_arg *rwa,
struct drr_freeobjects *drrfo)
{
uint64_t obj;
int next_err = 0;
if (drrfo->drr_firstobj + drrfo->drr_numobjs < drrfo->drr_firstobj)
return (SET_ERROR(EINVAL));
for (obj = drrfo->drr_firstobj;
obj < drrfo->drr_firstobj + drrfo->drr_numobjs;
(void) dmu_object_next(rwa->os, &obj, FALSE, 0)) {
obj < drrfo->drr_firstobj + drrfo->drr_numobjs && next_err == 0;
next_err = dmu_object_next(rwa->os, &obj, FALSE, 0)) {
int err;
if (dmu_object_info(rwa->os, obj, NULL) != 0)
@ -2084,7 +2099,8 @@ receive_freeobjects(struct receive_writer_arg *rwa,
if (err != 0)
return (err);
}
if (next_err != ESRCH)
return (next_err);
return (0);
}
@ -2414,6 +2430,66 @@ receive_read_payload_and_next_header(struct receive_arg *ra, int len, void *buf)
return (0);
}
static void
objlist_create(struct objlist *list)
{
list_create(&list->list, sizeof (struct receive_objnode),
offsetof(struct receive_objnode, node));
list->last_lookup = 0;
}
static void
objlist_destroy(struct objlist *list)
{
for (struct receive_objnode *n = list_remove_head(&list->list);
n != NULL; n = list_remove_head(&list->list)) {
kmem_free(n, sizeof (*n));
}
list_destroy(&list->list);
}
/*
* This function looks through the objlist to see if the specified object number
* is contained in the objlist. In the process, it will remove all object
* numbers in the list that are smaller than the specified object number. Thus,
* any lookup of an object number smaller than a previously looked up object
* number will always return false; therefore, all lookups should be done in
* ascending order.
*/
static boolean_t
objlist_exists(struct objlist *list, uint64_t object)
{
struct receive_objnode *node = list_head(&list->list);
ASSERT3U(object, >=, list->last_lookup);
list->last_lookup = object;
while (node != NULL && node->object < object) {
VERIFY3P(node, ==, list_remove_head(&list->list));
kmem_free(node, sizeof (*node));
node = list_head(&list->list);
}
return (node != NULL && node->object == object);
}
/*
* The objlist is a list of object numbers stored in ascending order. However,
* the insertion of new object numbers does not seek out the correct location to
* store a new object number; instead, it appends it to the list for simplicity.
* Thus, any users must take care to only insert new object numbers in ascending
* order.
*/
static void
objlist_insert(struct objlist *list, uint64_t object)
{
struct receive_objnode *node = kmem_zalloc(sizeof (*node), KM_SLEEP);
node->object = object;
#ifdef ZFS_DEBUG
struct receive_objnode *last_object = list_tail(&list->list);
uint64_t last_objnum = (last_object != NULL ? last_object->object : 0);
ASSERT3U(node->object, >, last_objnum);
#endif
list_insert_tail(&list->list, node);
}
/*
* Issue the prefetch reads for any necessary indirect blocks.
*
@ -2436,13 +2512,7 @@ static void
receive_read_prefetch(struct receive_arg *ra,
uint64_t object, uint64_t offset, uint64_t length)
{
struct receive_ign_obj_node *node = list_head(&ra->ignore_obj_list);
while (node != NULL && node->object < object) {
VERIFY3P(node, ==, list_remove_head(&ra->ignore_obj_list));
kmem_free(node, sizeof (*node));
node = list_head(&ra->ignore_obj_list);
}
if (node == NULL || node->object > object) {
if (!objlist_exists(&ra->ignore_objlist, object)) {
dmu_prefetch(ra->os, object, 1, offset, length,
ZIO_PRIORITY_SYNC_READ);
}
@ -2475,18 +2545,7 @@ receive_read_record(struct receive_arg *ra)
*/
if (err == ENOENT ||
(err == 0 && doi.doi_data_block_size != drro->drr_blksz)) {
struct receive_ign_obj_node *node =
kmem_zalloc(sizeof (*node),
KM_SLEEP);
node->object = drro->drr_object;
#ifdef ZFS_DEBUG
struct receive_ign_obj_node *last_object =
list_tail(&ra->ignore_obj_list);
uint64_t last_objnum = (last_object != NULL ?
last_object->object : 0);
ASSERT3U(node->object, >, last_objnum);
#endif
list_insert_tail(&ra->ignore_obj_list, node);
objlist_insert(&ra->ignore_objlist, drro->drr_object);
err = 0;
}
return (err);
@ -2704,7 +2763,6 @@ resume_check(struct receive_arg *ra, nvlist_t *begin_nvl)
return (0);
}
/*
* Read in the stream's records, one by one, and apply them to the pool. There
* are two threads involved; the thread that calls this function will spin up a
@ -2739,8 +2797,7 @@ dmu_recv_stream(dmu_recv_cookie_t *drc, struct file *fp, offset_t *voffp,
sizeof (ra.bytes_read), 1, &ra.bytes_read);
}
list_create(&ra.ignore_obj_list, sizeof (struct receive_ign_obj_node),
offsetof(struct receive_ign_obj_node, node));
objlist_create(&ra.ignore_objlist);
/* these were verified in dmu_recv_begin */
ASSERT3U(DMU_GET_STREAM_HDRTYPE(drc->drc_drrb->drr_versioninfo), ==,
@ -2894,12 +2951,7 @@ dmu_recv_stream(dmu_recv_cookie_t *drc, struct file *fp, offset_t *voffp,
}
*voffp = ra.voff;
for (struct receive_ign_obj_node *n =
list_remove_head(&ra.ignore_obj_list); n != NULL;
n = list_remove_head(&ra.ignore_obj_list)) {
kmem_free(n, sizeof (*n));
}
list_destroy(&ra.ignore_obj_list);
objlist_destroy(&ra.ignore_objlist);
return (err);
}

View File

@ -1440,11 +1440,24 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t *tx)
dsl_scan_setup_sync(&func, tx);
}
/*
* Only process scans in sync pass 1.
*/
if (spa_sync_pass(dp->dp_spa) > 1)
return;
/*
* If the spa is shutting down, then stop scanning. This will
* ensure that the scan does not dirty any new data during the
* shutdown phase.
*/
if (spa_shutting_down(spa))
return;
/*
* If the scan is inactive due to a stalled async destroy, try again.
*/
if ((!scn->scn_async_stalled && !dsl_scan_active(scn)) ||
spa_sync_pass(dp->dp_spa) > 1)
if (!scn->scn_async_stalled && !dsl_scan_active(scn))
return;
scn->scn_visited_this_txg = 0;

View File

@ -547,10 +547,9 @@ sa_find_sizes(sa_os_t *sa, sa_bulk_attr_t *attr_desc, int attr_count,
{
int var_size = 0;
int i;
int j = -1;
int full_space;
int hdrsize;
boolean_t done = B_FALSE;
int extra_hdrsize;
if (buftype == SA_BONUS && sa->sa_force_spill) {
*total = 0;
@ -561,10 +560,9 @@ sa_find_sizes(sa_os_t *sa, sa_bulk_attr_t *attr_desc, int attr_count,
*index = -1;
*total = 0;
*will_spill = B_FALSE;
if (buftype == SA_BONUS)
*will_spill = B_FALSE;
extra_hdrsize = 0;
hdrsize = (SA_BONUSTYPE_FROM_DB(db) == DMU_OT_ZNODE) ? 0 :
sizeof (sa_hdr_phys_t);
@ -576,8 +574,8 @@ sa_find_sizes(sa_os_t *sa, sa_bulk_attr_t *attr_desc, int attr_count,
*total = P2ROUNDUP(*total, 8);
*total += attr_desc[i].sa_length;
if (done)
goto next;
if (*will_spill)
continue;
is_var_sz = (SA_REGISTERED_LEN(sa, attr_desc[i].sa_attr) == 0);
if (is_var_sz) {
@ -585,21 +583,28 @@ sa_find_sizes(sa_os_t *sa, sa_bulk_attr_t *attr_desc, int attr_count,
}
if (is_var_sz && var_size > 1) {
if (P2ROUNDUP(hdrsize + sizeof (uint16_t), 8) +
/*
* Don't worry that the spill block might overflow.
* It will be resized if needed in sa_build_layouts().
*/
if (buftype == SA_SPILL ||
P2ROUNDUP(hdrsize + sizeof (uint16_t), 8) +
*total < full_space) {
/*
* Account for header space used by array of
* optional sizes of variable-length attributes.
* Record the index in case this increase needs
* to be reversed due to spill-over.
* Record the extra header size in case this
* increase needs to be reversed due to
* spill-over.
*/
hdrsize += sizeof (uint16_t);
j = i;
if (*index != -1)
extra_hdrsize += sizeof (uint16_t);
} else {
done = B_TRUE;
*index = i;
if (buftype == SA_BONUS)
*will_spill = B_TRUE;
ASSERT(buftype == SA_BONUS);
if (*index == -1)
*index = i;
*will_spill = B_TRUE;
continue;
}
}
@ -614,22 +619,15 @@ sa_find_sizes(sa_os_t *sa, sa_bulk_attr_t *attr_desc, int attr_count,
(*total + P2ROUNDUP(hdrsize, 8)) >
(full_space - sizeof (blkptr_t))) {
*index = i;
done = B_TRUE;
}
next:
if ((*total + P2ROUNDUP(hdrsize, 8)) > full_space &&
buftype == SA_BONUS)
*will_spill = B_TRUE;
}
/*
* j holds the index of the last variable-sized attribute for
* which hdrsize was increased. Reverse the increase if that
* attribute will be relocated to the spill block.
*/
if (*will_spill && j == *index)
hdrsize -= sizeof (uint16_t);
if (*will_spill)
hdrsize -= extra_hdrsize;
hdrsize = P2ROUNDUP(hdrsize, 8);
return (hdrsize);

View File

@ -6768,16 +6768,10 @@ spa_sync(spa_t *spa, uint64_t txg)
if (svdcount == SPA_DVAS_PER_BP)
break;
}
error = vdev_config_sync(svd, svdcount, txg, B_FALSE);
if (error != 0)
error = vdev_config_sync(svd, svdcount, txg,
B_TRUE);
error = vdev_config_sync(svd, svdcount, txg);
} else {
error = vdev_config_sync(rvd->vdev_child,
rvd->vdev_children, txg, B_FALSE);
if (error != 0)
error = vdev_config_sync(rvd->vdev_child,
rvd->vdev_children, txg, B_TRUE);
rvd->vdev_children, txg);
}
if (error == 0)

View File

@ -21,7 +21,7 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2015 by Delphix. All rights reserved.
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
* Copyright 2015 Nexenta Systems, Inc. All rights reserved.
* Copyright 2013 Martin Matuska <mm@FreeBSD.org>. All rights reserved.
* Copyright (c) 2014 Spectra Logic Corporation, All rights reserved.
* Copyright 2013 Saso Kiselkov. All rights reserved.
@ -449,14 +449,16 @@ spa_config_tryenter(spa_t *spa, int locks, void *tag, krw_t rw)
if (rw == RW_READER) {
if (scl->scl_writer || scl->scl_write_wanted) {
mutex_exit(&scl->scl_lock);
spa_config_exit(spa, locks ^ (1 << i), tag);
spa_config_exit(spa, locks & ((1 << i) - 1),
tag);
return (0);
}
} else {
ASSERT(scl->scl_writer != curthread);
if (!refcount_is_zero(&scl->scl_count)) {
mutex_exit(&scl->scl_lock);
spa_config_exit(spa, locks ^ (1 << i), tag);
spa_config_exit(spa, locks & ((1 << i) - 1),
tag);
return (0);
}
scl->scl_writer = curthread;

View File

@ -25,7 +25,7 @@
/*
* Copyright (c) 2012, Joyent, Inc. All rights reserved.
* Copyright (c) 2012, Martin Matuska <mm@FreeBSD.org>. All rights reserved.
* Copyright (c) 2013, 2014 by Delphix. All rights reserved.
* Copyright (c) 2013, 2015 by Delphix. All rights reserved.
*/
#ifndef _SYS_DMU_IMPL_H
@ -296,7 +296,6 @@ typedef struct dmu_sendarg {
uint64_t dsa_toguid;
int dsa_err;
dmu_pendop_t dsa_pending_op;
boolean_t dsa_incremental;
uint64_t dsa_featureflags;
uint64_t dsa_last_data_object;
uint64_t dsa_last_data_offset;

View File

@ -127,8 +127,7 @@ extern void vdev_queue_register_lastoffset(vdev_t *vd, zio_t *zio);
extern void vdev_config_dirty(vdev_t *vd);
extern void vdev_config_clean(vdev_t *vd);
extern int vdev_config_sync(vdev_t **svd, int svdcount, uint64_t txg,
boolean_t);
extern int vdev_config_sync(vdev_t **svd, int svdcount, uint64_t txg);
extern void vdev_state_dirty(vdev_t *vd);
extern void vdev_state_clean(vdev_t *vd);

View File

@ -20,7 +20,7 @@
*/
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2014 by Delphix. All rights reserved.
* Copyright (c) 2012, 2015 by Delphix. All rights reserved.
*/
#ifndef _SYS_ZFS_IOCTL_H
@ -126,6 +126,16 @@ typedef enum dmu_send_resume_token_version {
#define DRR_FLAG_CLONE (1<<0)
#define DRR_FLAG_CI_DATA (1<<1)
/*
* This send stream, if it is a full send, includes the FREE and FREEOBJECT
* records that are created by the sending process. This means that the send
* stream can be received as a clone, even though it is not an incremental.
* This is not implemented as a feature flag, because the receiving side does
* not need to have implemented it to receive this stream; it is fully backwards
* compatible. We need a flag, though, because full send streams without it
* cannot necessarily be received as a clone correctly.
*/
#define DRR_FLAG_FREERECORDS (1<<2)
/*
* flags in the drr_checksumflags field in the DRR_WRITE and

View File

@ -602,7 +602,8 @@ vdev_inuse(vdev_t *vd, uint64_t crtxg, vdev_labeltype_t reason,
* read-only. Instead we look to see if the pools is marked
* read-only in the namespace and set the state to active.
*/
if ((spa = spa_by_guid(pool_guid, device_guid)) != NULL &&
if (state != POOL_STATE_SPARE && state != POOL_STATE_L2CACHE &&
(spa = spa_by_guid(pool_guid, device_guid)) != NULL &&
spa_mode(spa) == FREAD)
state = POOL_STATE_ACTIVE;
@ -1193,15 +1194,16 @@ vdev_label_sync_list(spa_t *spa, int l, uint64_t txg, int flags)
* at any time, you can just call it again, and it will resume its work.
*/
int
vdev_config_sync(vdev_t **svd, int svdcount, uint64_t txg, boolean_t tryhard)
vdev_config_sync(vdev_t **svd, int svdcount, uint64_t txg)
{
spa_t *spa = svd[0]->vdev_spa;
uberblock_t *ub = &spa->spa_uberblock;
vdev_t *vd;
zio_t *zio;
int error;
int error = 0;
int flags = ZIO_FLAG_CONFIG_WRITER | ZIO_FLAG_CANFAIL;
retry:
/*
* Normally, we don't want to try too hard to write every label and
* uberblock. If there is a flaky disk, we don't want the rest of the
@ -1209,8 +1211,11 @@ vdev_config_sync(vdev_t **svd, int svdcount, uint64_t txg, boolean_t tryhard)
* single label out, we should retry with ZIO_FLAG_TRYHARD before
* bailing out and declaring the pool faulted.
*/
if (tryhard)
if (error != 0) {
if ((flags & ZIO_FLAG_TRYHARD) != 0)
return (error);
flags |= ZIO_FLAG_TRYHARD;
}
ASSERT(ub->ub_txg <= txg);
@ -1254,7 +1259,7 @@ vdev_config_sync(vdev_t **svd, int svdcount, uint64_t txg, boolean_t tryhard)
* are committed to stable storage before the uberblock update.
*/
if ((error = vdev_label_sync_list(spa, 0, txg, flags)) != 0)
return (error);
goto retry;
/*
* Sync the uberblocks to all vdevs in svd[].
@ -1272,7 +1277,7 @@ vdev_config_sync(vdev_t **svd, int svdcount, uint64_t txg, boolean_t tryhard)
* to the new uberblocks.
*/
if ((error = vdev_uberblock_sync_list(svd, svdcount, ub, flags)) != 0)
return (error);
goto retry;
/*
* Sync out odd labels for every dirty vdev. If the system dies
@ -1285,7 +1290,7 @@ vdev_config_sync(vdev_t **svd, int svdcount, uint64_t txg, boolean_t tryhard)
* stable storage before the next transaction group begins.
*/
if ((error = vdev_label_sync_list(spa, 1, txg, flags)) != 0)
return (error);
goto retry;;
trim_thread_wakeup(spa);

View File

@ -25,6 +25,7 @@
* All rights reserved.
* Copyright 2013 Martin Matuska <mm@FreeBSD.org>. All rights reserved.
* Copyright 2014 Xin Li <delphij@FreeBSD.org>. All rights reserved.
* Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved.
* Copyright 2015 Nexenta Systems, Inc. All rights reserved.
* Copyright (c) 2014, Joyent, Inc. All rights reserved.
* Copyright (c) 2011, 2015 by Delphix. All rights reserved.
@ -1339,7 +1340,7 @@ get_nvlist(uint64_t nvl, uint64_t size, int iflag, nvlist_t **nvp)
if ((error = ddi_copyin((void *)(uintptr_t)nvl, packed, size,
iflag)) != 0) {
kmem_free(packed, size);
return (error);
return (SET_ERROR(EFAULT));
}
if ((error = nvlist_unpack(packed, size, &list, 0)) != 0) {
@ -4177,6 +4178,56 @@ props_reduce(nvlist_t *props, nvlist_t *origprops)
}
}
/*
* Extract properties that cannot be set PRIOR to the receipt of a dataset.
* For example, refquota cannot be set until after the receipt of a dataset,
* because in replication streams, an older/earlier snapshot may exceed the
* refquota. We want to receive the older/earlier snapshot, but setting
* refquota pre-receipt will set the dsl's ACTUAL quota, which will prevent
* the older/earlier snapshot from being received (with EDQUOT).
*
* The ZFS test "zfs_receive_011_pos" demonstrates such a scenario.
*
* libzfs will need to be judicious handling errors encountered by props
* extracted by this function.
*/
static nvlist_t *
extract_delay_props(nvlist_t *props)
{
nvlist_t *delayprops;
nvpair_t *nvp, *tmp;
static const zfs_prop_t delayable[] = { ZFS_PROP_REFQUOTA, 0 };
int i;
VERIFY(nvlist_alloc(&delayprops, NV_UNIQUE_NAME, KM_SLEEP) == 0);
for (nvp = nvlist_next_nvpair(props, NULL); nvp != NULL;
nvp = nvlist_next_nvpair(props, nvp)) {
/*
* strcmp() is safe because zfs_prop_to_name() always returns
* a bounded string.
*/
for (i = 0; delayable[i] != 0; i++) {
if (strcmp(zfs_prop_to_name(delayable[i]),
nvpair_name(nvp)) == 0) {
break;
}
}
if (delayable[i] != 0) {
tmp = nvlist_prev_nvpair(props, nvp);
VERIFY(nvlist_add_nvpair(delayprops, nvp) == 0);
VERIFY(nvlist_remove_nvpair(props, nvp) == 0);
nvp = tmp;
}
}
if (nvlist_empty(delayprops)) {
nvlist_free(delayprops);
delayprops = NULL;
}
return (delayprops);
}
#ifdef DEBUG
static boolean_t zfs_ioc_recv_inject_err;
#endif
@ -4213,6 +4264,7 @@ zfs_ioc_recv(zfs_cmd_t *zc)
offset_t off;
nvlist_t *props = NULL; /* sent properties */
nvlist_t *origprops = NULL; /* existing properties */
nvlist_t *delayprops = NULL; /* sent properties applied post-receive */
char *origin = NULL;
char *tosnap;
char tofs[ZFS_MAXNAMELEN];
@ -4298,21 +4350,12 @@ zfs_ioc_recv(zfs_cmd_t *zc)
props_error = dsl_prop_set_hasrecvd(tofs);
if (props_error == 0) {
delayprops = extract_delay_props(props);
(void) zfs_set_prop_nvlist(tofs, ZPROP_SRC_RECEIVED,
props, errors);
}
}
if (zc->zc_nvlist_dst_size != 0 &&
(nvlist_smush(errors, zc->zc_nvlist_dst_size) != 0 ||
put_nvlist(zc, errors) != 0)) {
/*
* Caller made zc->zc_nvlist_dst less than the minimum expected
* size or supplied an invalid address.
*/
props_error = SET_ERROR(EINVAL);
}
off = fp->f_offset;
error = dmu_recv_stream(&drc, fp, &off, zc->zc_cleanup_fd,
&zc->zc_action_handle);
@ -4337,6 +4380,40 @@ zfs_ioc_recv(zfs_cmd_t *zc)
} else {
error = dmu_recv_end(&drc, NULL);
}
/* Set delayed properties now, after we're done receiving. */
if (delayprops != NULL && error == 0) {
(void) zfs_set_prop_nvlist(tofs, ZPROP_SRC_RECEIVED,
delayprops, errors);
}
}
if (delayprops != NULL) {
/*
* Merge delayed props back in with initial props, in case
* we're DEBUG and zfs_ioc_recv_inject_err is set (which means
* we have to make sure clear_received_props() includes
* the delayed properties).
*
* Since zfs_ioc_recv_inject_err is only in DEBUG kernels,
* using ASSERT() will be just like a VERIFY.
*/
ASSERT(nvlist_merge(props, delayprops, 0) == 0);
nvlist_free(delayprops);
}
/*
* Now that all props, initial and delayed, are set, report the prop
* errors to the caller.
*/
if (zc->zc_nvlist_dst_size != 0 &&
(nvlist_smush(errors, zc->zc_nvlist_dst_size) != 0 ||
put_nvlist(zc, errors) != 0)) {
/*
* Caller made zc->zc_nvlist_dst less than the minimum expected
* size or supplied an invalid address.
*/
props_error = SET_ERROR(EINVAL);
}
zc->zc_cookie = off - fp->f_offset;

View File

@ -2009,12 +2009,9 @@ zfs_remove(vnode_t *dvp, char *name, cred_t *cr, caller_context_t *ct,
dmu_tx_hold_zap(tx, zfsvfs->z_unlinkedobj, FALSE, NULL);
/*
* Mark this transaction as typically resulting in a net free of
* space, unless object removal will be delayed indefinitely
* (due to active holds on the vnode due to the file being open).
* Mark this transaction as typically resulting in a net free of space
*/
if (may_delete_now)
dmu_tx_mark_netfree(tx);
dmu_tx_mark_netfree(tx);
error = dmu_tx_assign(tx, waited ? TXG_WAITED : TXG_NOWAIT);
if (error) {

View File

@ -1175,13 +1175,13 @@ zfs_zget(zfsvfs_t *zfsvfs, uint64_t obj_num, znode_t **zpp)
*zpp = zp;
err = 0;
}
sa_buf_rele(db, NULL);
/* Don't let the vnode disappear after ZFS_OBJ_HOLD_EXIT. */
if (err == 0)
VN_HOLD(vp);
mutex_exit(&zp->z_lock);
sa_buf_rele(db, NULL);
ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num);
if (err == 0) {

View File

@ -1217,6 +1217,8 @@ zio_write_bp_init(zio_t *zio)
zio->io_pipeline |= ZIO_STAGE_DDT_WRITE;
return (ZIO_PIPELINE_CONTINUE);
}
zio->io_bp_override = NULL;
BP_ZERO(bp);
}
if (!BP_IS_HOLE(bp) && bp->blk_birth == zio->io_txg) {

View File

@ -35,6 +35,8 @@
#include <sys/types.h>
#include <machine/atomic.h>
#define ATOMIC_INIT(x) { .counter = (x) }
typedef struct {
volatile int counter;
} atomic_t;

View File

@ -467,10 +467,40 @@ bitmap_release_region(unsigned long *bitmap, int pos, int order)
__reg_op(bitmap, pos, order, REG_OP_RELEASE);
}
#define for_each_set_bit(bit, addr, size) \
for ((bit) = find_first_bit((addr), (size)); \
(bit) < (size); \
(bit) = find_next_bit((addr), (size), (bit) + 1))
static inline unsigned
bitmap_weight(unsigned long *bitmap, unsigned nbits)
{
unsigned bit;
unsigned retval = 0;
for_each_set_bit(bit, bitmap, nbits)
retval++;
return (retval);
}
static inline int
bitmap_equal(const unsigned long *pa,
const unsigned long *pb, unsigned bits)
{
unsigned x;
unsigned y = bits / BITS_PER_LONG;
for (x = 0; x != y; x++) {
if (pa[x] != pb[x])
return (0);
}
y = bits % BITS_PER_LONG;
if (y != 0) {
if ((pa[x] ^ pb[x]) & BITMAP_LAST_WORD_MASK(y))
return (0);
}
return (1);
}
#endif /* _LINUX_BITOPS_H_ */

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