Large diffs are not rendered by default.

@@ -10,6 +10,7 @@ arm/broadcom/bcm2835/bcm2835_gpio.c optional gpio
arm/broadcom/bcm2835/bcm2835_intr.c standard
arm/broadcom/bcm2835/bcm2835_machdep.c standard
arm/broadcom/bcm2835/bcm2835_mbox.c standard
arm/broadcom/bcm2835/bcm2835_rng.c optional random
arm/broadcom/bcm2835/bcm2835_sdhci.c optional sdhci
arm/broadcom/bcm2835/bcm2835_spi.c optional bcm2835_spi
arm/broadcom/bcm2835/bcm2835_vcio.c standard
@@ -36,6 +36,10 @@ CFLAGS+= -I${.CURDIR}/../../common

# Handle FreeBSD specific %b and %D printf format specifiers
CFLAGS+= ${FORMAT_EXTENSIONS}

# Do not use TERM_EMU on arm and arm64 as it doesn't behave well with serial console
.if ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "aarch64"
CFLAGS+= -DTERM_EMU
.endif

.include <bsd.lib.mk>
@@ -396,6 +396,14 @@
};
};

rng {
compatible = "broadcom,bcm2835-rng",
"broadcom,bcm2708-rng";
reg = <0x104000 0x20>;
interrupts = <69>;
interrupt-parent = <&intc>;
};

bsc0 {
#address-cells = <1>;
#size-cells = <0>;
@@ -389,6 +389,14 @@
};
};

rng {
compatible = "broadcom,bcm2835-rng",
"broadcom,bcm2708-rng";
reg = <0x104000 0x20>;
interrupts = <69>;
interrupt-parent = <&intc>;
};

bsc0 {
#address-cells = <1>;
#size-cells = <0>;
@@ -1534,21 +1534,18 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
hw->phy.type = ixgbe_phy_sfp_intel;
break;
default:
if (cable_tech & IXGBE_SFF_DA_PASSIVE_CABLE)
hw->phy.type =
ixgbe_phy_sfp_passive_unknown;
else if (cable_tech & IXGBE_SFF_DA_ACTIVE_CABLE)
hw->phy.type =
ixgbe_phy_sfp_active_unknown;
else
hw->phy.type = ixgbe_phy_sfp_unknown;
hw->phy.type = ixgbe_phy_sfp_unknown;
break;
}
}

/* Allow any DA cable vendor */
if (cable_tech & (IXGBE_SFF_DA_PASSIVE_CABLE |
IXGBE_SFF_DA_ACTIVE_CABLE)) {
IXGBE_SFF_DA_ACTIVE_CABLE)) {
if (cable_tech & IXGBE_SFF_DA_PASSIVE_CABLE)
hw->phy.type = ixgbe_phy_sfp_passive_unknown;
else if (cable_tech & IXGBE_SFF_DA_ACTIVE_CABLE)
hw->phy.type = ixgbe_phy_sfp_active_unknown;
status = IXGBE_SUCCESS;
goto out;
}
@@ -232,19 +232,11 @@ nvd_dump(void *arg, void *virt, vm_offset_t phys, off_t offset, size_t len)
{
struct nvd_disk *ndisk;
struct disk *dp;
int error;

dp = arg;
ndisk = dp->d_drv1;

if (len > 0) {
if ((error = nvme_ns_dump(ndisk->ns, virt, offset, len)) != 0)
return (error);
} else {
/* XXX sync to stable storage */
}

return (0);
return (nvme_ns_dump(ndisk->ns, virt, offset, len));
}

static void
@@ -153,7 +153,7 @@ nvme_ns_cmd_flush(struct nvme_namespace *ns, nvme_cb_fn_t cb_fn, void *cb_arg)
}

/* Timeout = 1 sec */
#define NVD_DUMP_TIMEOUT 100000
#define NVD_DUMP_TIMEOUT 200000

int
nvme_ns_dump(struct nvme_namespace *ns, void *virt, off_t offset, size_t len)
@@ -171,22 +171,21 @@ nvme_ns_dump(struct nvme_namespace *ns, void *virt, off_t offset, size_t len)
return (ENOMEM);

cmd = &req->cmd;
cmd->opc = NVME_OPC_WRITE;
cmd->nsid = ns->id;

lba = offset / nvme_ns_get_sector_size(ns);
lba_count = len / nvme_ns_get_sector_size(ns);

*(uint64_t *)&cmd->cdw10 = lba;
cmd->cdw12 = lba_count - 1;
if (len > 0) {
lba = offset / nvme_ns_get_sector_size(ns);
lba_count = len / nvme_ns_get_sector_size(ns);
nvme_ns_write_cmd(cmd, ns->id, lba, lba_count);
} else
nvme_ns_flush_cmd(cmd, ns->id);

nvme_ctrlr_submit_io_request(ns->ctrlr, req);
if (req->qpair == NULL)
return (ENXIO);

i = 0;
while ((i++ < NVD_DUMP_TIMEOUT) && (status.done == FALSE)) {
DELAY(10);
DELAY(5);
nvme_qpair_process_completions(req->qpair);
}

@@ -416,10 +416,10 @@ vt_fb_init(struct vt_device *vd)
int err;

info = vd->vd_softc;
vd->vd_height = MIN(VT_FB_DEFAULT_HEIGHT, info->fb_height);
vd->vd_height = MIN(VT_FB_MAX_HEIGHT, info->fb_height);
margin = (info->fb_height - vd->vd_height) >> 1;
vd->vd_transpose = margin * info->fb_stride;
vd->vd_width = MIN(VT_FB_DEFAULT_WIDTH, info->fb_width);
vd->vd_width = MIN(VT_FB_MAX_WIDTH, info->fb_width);
margin = (info->fb_width - vd->vd_width) >> 1;
vd->vd_transpose += margin * (info->fb_bpp / NBBY);
vd->vd_video_dev = info->fb_video_dev;
@@ -377,11 +377,11 @@ void vt_upgrade(struct vt_device *vd);
#define PIXEL_WIDTH(w) ((w) / 8)
#define PIXEL_HEIGHT(h) ((h) / 16)

#ifndef VT_FB_DEFAULT_WIDTH
#define VT_FB_DEFAULT_WIDTH 2048
#ifndef VT_FB_MAX_WIDTH
#define VT_FB_MAX_WIDTH 4096
#endif
#ifndef VT_FB_DEFAULT_HEIGHT
#define VT_FB_DEFAULT_HEIGHT 1200
#ifndef VT_FB_MAX_HEIGHT
#define VT_FB_MAX_HEIGHT 2400
#endif

/* name argument is not used yet. */
@@ -181,8 +181,8 @@ static void vt_resume_handler(void *priv);

SET_DECLARE(vt_drv_set, struct vt_driver);

#define _VTDEFH MAX(100, PIXEL_HEIGHT(VT_FB_DEFAULT_HEIGHT))
#define _VTDEFW MAX(200, PIXEL_WIDTH(VT_FB_DEFAULT_WIDTH))
#define _VTDEFH MAX(100, PIXEL_HEIGHT(VT_FB_MAX_HEIGHT))
#define _VTDEFW MAX(200, PIXEL_WIDTH(VT_FB_MAX_WIDTH))

struct terminal vt_consterm;
static struct vt_window vt_conswindow;
@@ -1050,7 +1050,7 @@ callout_reset_sbt_on(struct callout *c, sbintime_t sbt, sbintime_t precision,
*/
if (c->c_lock != NULL && !cc_exec_cancel(cc, direct))
cancelled = cc_exec_cancel(cc, direct) = true;
if (cc_exec_waiting(cc, direct)) {
if (cc_exec_waiting(cc, direct) || cc_exec_drain(cc, direct)) {
/*
* Someone has called callout_drain to kill this
* callout. Don't reschedule.
@@ -1166,7 +1166,7 @@ _callout_stop_safe(struct callout *c, int flags, void (*drain)(void *))
struct callout_cpu *cc, *old_cc;
struct lock_class *class;
int direct, sq_locked, use_lock;
int cancelled, not_on_a_list;
int not_on_a_list;

if ((flags & CS_DRAIN) != 0)
WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, c->c_lock,
@@ -1234,17 +1234,47 @@ _callout_stop_safe(struct callout *c, int flags, void (*drain)(void *))
panic("migration should not happen");
#endif
}

if ((drain != NULL) && (c->c_iflags & CALLOUT_PENDING) &&
(cc_exec_curr(cc, direct) != c)) {
/*
* This callout is executing and we are draining.
* The only way this can happen is if its also
* been rescheduled to run on one thread *and* asked to drain
* on this thread (at the same time it is waiting to execute).
*/
if ((c->c_iflags & CALLOUT_PROCESSED) == 0) {
if (cc_exec_next(cc) == c)
cc_exec_next(cc) = LIST_NEXT(c, c_links.le);
LIST_REMOVE(c, c_links.le);
} else {
TAILQ_REMOVE(&cc->cc_expireq, c, c_links.tqe);
}
c->c_iflags &= ~CALLOUT_PENDING;
c->c_flags &= ~CALLOUT_ACTIVE;
}
/*
* If the callout is running, try to stop it or drain it.
* If the callout isn't pending, it's not on the queue, so
* don't attempt to remove it from the queue. We can try to
* stop it by other means however.
*/
if (cc_exec_curr(cc, direct) == c) {
if (!(c->c_iflags & CALLOUT_PENDING)) {
/*
* Succeed we to stop it or not, we must clear the
* active flag - this is what API users expect.
* If it wasn't on the queue and it isn't the current
* callout, then we can't stop it, so just bail.
* It probably has already been run (if locking
* is properly done). You could get here if the caller
* calls stop twice in a row for example. The second
* call would fall here without CALLOUT_ACTIVE set.
*/
c->c_flags &= ~CALLOUT_ACTIVE;

if (cc_exec_curr(cc, direct) != c) {
CTR3(KTR_CALLOUT, "failed to stop %p func %p arg %p",
c, c->c_func, c->c_arg);
CC_UNLOCK(cc);
if (sq_locked)
sleepq_release(&cc_exec_waiting(cc, direct));
return (-1);
}
if ((flags & CS_DRAIN) != 0) {
/*
* The current callout is running (or just
@@ -1278,7 +1308,6 @@ _callout_stop_safe(struct callout *c, int flags, void (*drain)(void *))
old_cc = cc;
goto again;
}

/*
* Migration could be cancelled here, but
* as long as it is still not sure when it
@@ -1362,27 +1391,21 @@ _callout_stop_safe(struct callout *c, int flags, void (*drain)(void *))
cc_exec_drain(cc, direct) = drain;
}
CC_UNLOCK(cc);
if (drain)
return(0);
return ((flags & CS_EXECUTING) != 0);
}
CTR3(KTR_CALLOUT, "failed to stop %p func %p arg %p",
c, c->c_func, c->c_arg);
if (drain) {
cc_exec_drain(cc, direct) = drain;
}
KASSERT(!sq_locked, ("sleepqueue chain still locked"));
cancelled = ((flags & CS_EXECUTING) != 0);
} else
cancelled = 1;

if (sq_locked)
sleepq_release(&cc_exec_waiting(cc, direct));

if ((c->c_iflags & CALLOUT_PENDING) == 0) {
CTR3(KTR_CALLOUT, "failed to stop %p func %p arg %p",
c, c->c_func, c->c_arg);
CC_UNLOCK(cc);
KASSERT(!sq_locked, ("sleepqueue chain still locked"));
return (0);
}
if (sq_locked)
sleepq_release(&cc_exec_waiting(cc, direct));

c->c_iflags &= ~CALLOUT_PENDING;
c->c_flags &= ~CALLOUT_ACTIVE;
@@ -1400,7 +1423,7 @@ _callout_stop_safe(struct callout *c, int flags, void (*drain)(void *))
}
callout_cc_del(c, cc);
CC_UNLOCK(cc);
return (cancelled);
return (1);
}

void
@@ -1615,7 +1638,6 @@ SYSCTL_PROC(_kern, OID_AUTO, callout_stat,
CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE,
0, 0, sysctl_kern_callout_stat, "I",
"Dump immediate statistic snapshot of the scheduled callouts");

#ifdef DDB
static void
_show_callout(struct callout *c)
@@ -90,6 +90,7 @@ enum random_entropy_source {
RANDOM_PURE_NEHEMIAH,
RANDOM_PURE_RNDTEST,
RANDOM_PURE_VIRTIO,
RANDOM_PURE_BROADCOM,
ENTROPYSOURCE
};

@@ -1177,6 +1177,7 @@ acpi_print_fadt(ACPI_TABLE_HEADER *sdp)
PRINTFLAG(fadt->BootFlags, NO_VGA);
PRINTFLAG(fadt->BootFlags, NO_MSI);
PRINTFLAG(fadt->BootFlags, NO_ASPM);
PRINTFLAG(fadt->BootFlags, NO_CMOS_RTC);
PRINTFLAG_END();

printf("\tFlags=");
@@ -1200,6 +1201,8 @@ acpi_print_fadt(ACPI_TABLE_HEADER *sdp)
PRINTFLAG(fadt->Flags, REMOTE_POWER_ON);
PRINTFLAG(fadt->Flags, APIC_CLUSTER);
PRINTFLAG(fadt->Flags, APIC_PHYSICAL);
PRINTFLAG(fadt->Flags, HW_REDUCED);
PRINTFLAG(fadt->Flags, LOW_POWER_S0);
PRINTFLAG_END();

#undef PRINTFLAG
@@ -1,4 +1,4 @@
/* $NetBSD: cd9660.c,v 1.31 2011/08/06 23:25:19 christos Exp $ */
/* $NetBSD: cd9660.c,v 1.32 2011/08/23 17:09:11 christos Exp $ */

/*
* Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan
@@ -1,4 +1,4 @@
/* $NetBSD: ffs.c,v 1.44 2009/04/28 22:49:26 joerg Exp $ */
/* $NetBSD: ffs.c,v 1.45 2011/10/09 22:49:26 christos Exp $ */

/*
* Copyright (c) 2001 Wasabi Systems, Inc.
@@ -1,4 +1,4 @@
/* $NetBSD: ffs.h,v 1.1 2004/12/20 20:51:42 jmc Exp $ */
/* $NetBSD: ffs.h,v 1.2 2004/12/20 20:51:42 jmc Exp $ */

/*
* Copyright (c) 2001-2003 Wasabi Systems, Inc.
@@ -1,4 +1,4 @@
/* $NetBSD: mkfs.c,v 1.20 2004/06/24 22:30:13 lukem Exp $ */
/* $NetBSD: mkfs.c,v 1.22 2011/10/09 22:30:13 christos Exp $ */

/*
* Copyright (c) 2002 Networks Associates Technology, Inc.
@@ -1,4 +1,4 @@
.\" $NetBSD: makefs.8,v 1.32 2009/01/20 20:47:25 bjh21 Exp $
.\" $NetBSD: makefs.8,v 1.33 2011/05/22 21:51:39 christos Exp $
.\"
.\" Copyright (c) 2001-2003 Wasabi Systems, Inc.
.\" All rights reserved.
@@ -401,7 +401,8 @@ The
utility appeared in
.Nx 1.6 .
.Sh AUTHORS
.An Luke Mewburn Aq Mt lukem@NetBSD.org
.An Luke Mewburn
.Aq Mt lukem@NetBSD.org
(original program),
.An Daniel Watt ,
.An Walter Deignan ,
@@ -403,10 +403,10 @@ usage(void)

prog = getprogname();
fprintf(stderr,
"usage: %s [-t fs-type] [-o fs-options] [-d debug-mask] [-B endian]\n"
"\t[-S sector-size] [-M minimum-size] [-m maximum-size] [-R roundup-size]\n"
"\t[-s image-size] [-b free-blocks] [-f free-files] [-F mtree-specfile]\n"
"\t[-xZ] [-N userdb-dir] [-T <timestamp/file>]\n"
"usage: %s [-xZ] [-B endian] [-b free-blocks] [-d debug-mask]\n"
"\t[-F mtree-specfile] [-f free-files] [-M minimum-size] [-m maximum-size]\n"
"\t[-N userdb-dir] [-o fs-options] [-R roundup-size] [-S sector-size]\n"
"\t[-s image-size] [-T <timestamp/file>] [-t fs-type]\n"
"\timage-file directory | manifest [extra-directory ...]\n",
prog);
exit(1);