Commit 7dda64d6 authored by HardenedBSD Sync Service's avatar HardenedBSD Sync Service
Browse files

Merge branch 'freebsd/current/main' into hardened/current/master

parents 72bc54a2 b6f61525
......@@ -62,40 +62,43 @@ a20_if_dwc_probe(device_t dev)
static int
a20_if_dwc_init(device_t dev)
{
struct dwc_softc *sc;
const char *tx_parent_name;
char *phy_type;
clk_t clk_tx, clk_tx_parent;
regulator_t reg;
phandle_t node;
int error;
node = ofw_bus_get_node(dev);
sc = device_get_softc(dev);
/* Configure PHY for MII or RGMII mode */
if (OF_getprop_alloc(node, "phy-mode", (void **)&phy_type)) {
error = clk_get_by_ofw_name(dev, 0, "allwinner_gmac_tx", &clk_tx);
if (error != 0) {
device_printf(dev, "could not get tx clk\n");
return (error);
}
if (strcmp(phy_type, "rgmii") == 0)
tx_parent_name = "gmac_int_tx";
else
tx_parent_name = "mii_phy_tx";
error = clk_get_by_name(dev, tx_parent_name, &clk_tx_parent);
if (error != 0) {
device_printf(dev, "could not get clock '%s'\n",
tx_parent_name);
return (error);
}
switch(sc->phy_mode) {
case PHY_MODE_RGMII:
tx_parent_name = "gmac_int_tx";
break;
case PHY_MODE_MII:
tx_parent_name = "mii_phy_tx";
break;
default:
device_printf(dev, "unsupported PHY connection type: %d",
sc->phy_mode);
return (ENXIO);
}
error = clk_set_parent_by_clk(clk_tx, clk_tx_parent);
if (error != 0) {
device_printf(dev, "could not set tx clk parent\n");
return (error);
}
error = clk_get_by_ofw_name(dev, 0, "allwinner_gmac_tx", &clk_tx);
if (error != 0) {
device_printf(dev, "could not get tx clk\n");
return (error);
}
error = clk_get_by_name(dev, tx_parent_name, &clk_tx_parent);
if (error != 0) {
device_printf(dev, "could not get clock '%s'\n",
tx_parent_name);
return (error);
}
error = clk_set_parent_by_clk(clk_tx, clk_tx_parent);
if (error != 0) {
device_printf(dev, "could not set tx clk parent\n");
return (error);
}
/* Enable PHY regulator if applicable */
......
......@@ -457,8 +457,9 @@ pass_add_physpath(void *context, int pending)
"GEOM::physpath", periph->path) == 0
&& strlen(physpath) != 0) {
mtx_unlock(mtx);
make_dev_physpath_alias(MAKEDEV_WAITOK, &softc->alias_dev,
softc->dev, softc->alias_dev, physpath);
make_dev_physpath_alias(MAKEDEV_WAITOK | MAKEDEV_CHECKNAME,
&softc->alias_dev, softc->dev,
softc->alias_dev, physpath);
mtx_lock(mtx);
}
......
......@@ -241,10 +241,17 @@ contrib/openzfs/module/zcommon/zprop_common.c optional zfs compile-with "${ZFS_
# zfs edon-r hash support
contrib/openzfs/module/icp/algs/edonr/edonr.c optional zfs compile-with "${ZFS_C}"
# zfs blake3 hash support
contrib/openzfs/module/icp/algs/blake3/blake3.c optional zfs compile-with "${ZFS_C}"
contrib/openzfs/module/icp/algs/blake3/blake3_generic.c optional zfs compile-with "${ZFS_C}"
contrib/openzfs/module/icp/algs/blake3/blake3_impl.c optional zfs compile-with "${ZFS_C}"
contrib/openzfs/module/icp/algs/blake3/blake3_x86-64.c optional zfs compile-with "${ZFS_C}"
#zfs core common code
contrib/openzfs/module/zfs/abd.c optional zfs compile-with "${ZFS_C}"
contrib/openzfs/module/zfs/aggsum.c optional zfs compile-with "${ZFS_C}"
contrib/openzfs/module/zfs/arc.c optional zfs compile-with "${ZFS_C}"
contrib/openzfs/module/zfs/blake3_zfs.c optional zfs compile-with "${ZFS_C}"
contrib/openzfs/module/zfs/blkptr.c optional zfs compile-with "${ZFS_C}"
contrib/openzfs/module/zfs/bplist.c optional zfs compile-with "${ZFS_C}"
contrib/openzfs/module/zfs/bpobj.c optional zfs compile-with "${ZFS_C}"
......@@ -342,6 +349,7 @@ contrib/openzfs/module/zfs/zcp_set.c optional zfs compile-with "${ZFS_C}"
contrib/openzfs/module/zfs/zcp_synctask.c optional zfs compile-with "${ZFS_C}"
contrib/openzfs/module/zfs/zfeature.c optional zfs compile-with "${ZFS_C}"
contrib/openzfs/module/zfs/zfs_byteswap.c optional zfs compile-with "${ZFS_C}"
contrib/openzfs/module/zfs/zfs_chksum.c optional zfs compile-with "${ZFS_C}"
contrib/openzfs/module/zfs/zfs_fm.c optional zfs compile-with "${ZFS_C}"
contrib/openzfs/module/zfs/zfs_fuid.c optional zfs compile-with "${ZFS_C}"
contrib/openzfs/module/zfs/zfs_ioctl.c optional zfs compile-with "${ZFS_C}"
......
......@@ -406,6 +406,11 @@ x86/x86/mptable_pci.c optional mptable pci
x86/x86/msi.c optional pci
x86/xen/pv.c optional xenhvm
contrib/openzfs/module/icp/asm-x86_64/blake3/blake3_avx2.S optional zfs compile-with "${ZFS_S}"
contrib/openzfs/module/icp/asm-x86_64/blake3/blake3_avx512.S optional zfs compile-with "${ZFS_S}"
contrib/openzfs/module/icp/asm-x86_64/blake3/blake3_sse2.S optional zfs compile-with "${ZFS_S}"
contrib/openzfs/module/icp/asm-x86_64/blake3/blake3_sse41.S optional zfs compile-with "${ZFS_S}"
contrib/openzfs/module/zcommon/zfs_fletcher_avx512.c optional zfs compile-with "${ZFS_C}"
contrib/openzfs/module/zcommon/zfs_fletcher_intel.c optional zfs compile-with "${ZFS_C}"
contrib/openzfs/module/zcommon/zfs_fletcher_sse.c optional zfs compile-with "${ZFS_C}"
......
......@@ -156,6 +156,9 @@ cddl/dev/dtrace/aarch64/dtrace_asm.S optional dtrace compile-with "${DTRACE_S}"
cddl/dev/dtrace/aarch64/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}"
cddl/dev/fbt/aarch64/fbt_isa.c optional dtrace_fbt | dtraceall compile-with "${FBT_C}"
contrib/openzfs/module/icp/asm-aarch64/blake3/b3_aarch64_sse2.S optional zfs compile-with "${ZFS_S}"
contrib/openzfs/module/icp/asm-aarch64/blake3/b3_aarch64_sse41.S optional zfs compile-with "${ZFS_S}"
##
## ASoC support
##
......
......@@ -10,6 +10,8 @@
#
# There is only an asm version on ppc64.
contrib/openzfs/module/icp/asm-ppc64/blake3/b3_ppc64le_sse2.S optional zfs compile-with "${ZFS_S}"
contrib/openzfs/module/icp/asm-ppc64/blake3/b3_ppc64le_sse41.S optional zfs compile-with "${ZFS_S}"
cddl/compat/opensolaris/kern/opensolaris_atomic.c optional zfs powerpc | dtrace powerpc | zfs powerpcspe | dtrace powerpcspe compile-with "${ZFS_C}"
cddl/dev/dtrace/powerpc/dtrace_asm.S optional dtrace compile-with "${DTRACE_S}"
cddl/dev/dtrace/powerpc/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}"
......
......@@ -245,8 +245,8 @@ ZFS_CFLAGS+= ${CDDL_CFLAGS} -DBUILDING_ZFS -DHAVE_UIO_ZEROCOPY \
-DIN_FREEBSD_BASE
.if ${MACHINE_ARCH} == "amd64"
ZFS_CFLAGS+= -DHAVE_AVX2 -DHAVE_AVX -D__x86_64 -DHAVE_SSE2 -DHAVE_AVX512F \
-DHAVE_SSSE3 -DHAVE_AVX512BW
ZFS_CFLAGS+= -D__x86_64 -DHAVE_SSE2 -DHAVE_SSSE3 -DHAVE_SSE4_1 -DHAVE_SSE4_2 \
-DHAVE_AVX -DHAVE_AVX2 -DHAVE_AVX512F -DHAVE_AVX512VL -DHAVE_AVX512BW
.endif
.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "powerpc" || \
......
......@@ -354,12 +354,12 @@ dwc_miibus_statchg(device_t dev)
*/
static void
dwc_media_status(struct ifnet * ifp, struct ifmediareq *ifmr)
dwc_media_status(if_t ifp, struct ifmediareq *ifmr)
{
struct dwc_softc *sc;
struct mii_data *mii;
sc = ifp->if_softc;
sc = if_getsoftc(ifp);
mii = sc->mii_softc;
DWC_LOCK(sc);
mii_pollstat(mii);
......@@ -376,12 +376,12 @@ dwc_media_change_locked(struct dwc_softc *sc)
}
static int
dwc_media_change(struct ifnet * ifp)
dwc_media_change(if_t ifp)
{
struct dwc_softc *sc;
int error;
sc = ifp->if_softc;
sc = if_getsoftc(ifp);
DWC_LOCK(sc);
error = dwc_media_change_locked(sc);
......@@ -441,7 +441,7 @@ static void
dwc_setup_rxfilter(struct dwc_softc *sc)
{
struct dwc_hash_maddr_ctx ctx;
struct ifnet *ifp;
if_t ifp;
uint8_t *eaddr;
uint32_t ffval, hi, lo;
int nhash, i;
......@@ -454,7 +454,7 @@ dwc_setup_rxfilter(struct dwc_softc *sc)
/*
* Set the multicast (group) filter hash.
*/
if ((ifp->if_flags & IFF_ALLMULTI) != 0) {
if ((if_getflags(ifp) & IFF_ALLMULTI) != 0) {
ffval = (FRAME_FILTER_PM);
for (i = 0; i < nhash; i++)
ctx.hash[i] = ~0;
......@@ -469,7 +469,7 @@ dwc_setup_rxfilter(struct dwc_softc *sc)
/*
* Set the individual address filter hash.
*/
if (ifp->if_flags & IFF_PROMISC)
if ((if_getflags(ifp) & IFF_PROMISC) != 0)
ffval |= (FRAME_FILTER_PR);
/*
......@@ -518,6 +518,20 @@ dwc_enable_mac(struct dwc_softc *sc, bool enable)
WRITE4(sc, MAC_CONFIGURATION, reg);
}
static void
dwc_enable_csum_offload(struct dwc_softc *sc)
{
uint32_t reg;
DWC_ASSERT_LOCKED(sc);
reg = READ4(sc, MAC_CONFIGURATION);
if ((if_getcapenable(sc->ifp) & IFCAP_RXCSUM) != 0)
reg |= CONF_IPC;
else
reg &= ~CONF_IPC;
WRITE4(sc, MAC_CONFIGURATION, reg);
}
static void
dwc_get_hwaddr(struct dwc_softc *sc, uint8_t *hwaddr)
{
......@@ -802,7 +816,7 @@ static struct mbuf *
dwc_rxfinish_one(struct dwc_softc *sc, struct dwc_hwdesc *desc,
struct dwc_bufmap *map)
{
struct ifnet *ifp;
if_t ifp;
struct mbuf *m, *m0;
int len;
uint32_t rdesc0;
......@@ -810,14 +824,6 @@ dwc_rxfinish_one(struct dwc_softc *sc, struct dwc_hwdesc *desc,
m = map->mbuf;
ifp = sc->ifp;
rdesc0 = desc ->desc0;
/* Validate descriptor. */
if (rdesc0 & RDESC0_ES) {
/*
* Errored packet. Statistic counters are updated
* globally, so do nothing
*/
return (NULL);
}
if ((rdesc0 & (RDESC0_FS | RDESC0_LS)) !=
(RDESC0_FS | RDESC0_LS)) {
......@@ -873,7 +879,7 @@ dwc_rxfinish_one(struct dwc_softc *sc, struct dwc_hwdesc *desc,
m_adj(m, -ETHER_CRC_LEN);
DWC_UNLOCK(sc);
(*ifp->if_input)(ifp, m);
if_input(ifp, m);
DWC_LOCK(sc);
return (m0);
}
......@@ -1043,6 +1049,48 @@ setup_dma(struct dwc_softc *sc)
return (0);
}
static void
free_dma(struct dwc_softc *sc)
{
bus_dmamap_t map;
int idx;
/* Clean up RX DMA resources and free mbufs. */
for (idx = 0; idx < RX_DESC_COUNT; ++idx) {
if ((map = sc->rxbuf_map[idx].map) != NULL) {
bus_dmamap_unload(sc->rxbuf_tag, map);
bus_dmamap_destroy(sc->rxbuf_tag, map);
m_freem(sc->rxbuf_map[idx].mbuf);
}
}
if (sc->rxbuf_tag != NULL)
bus_dma_tag_destroy(sc->rxbuf_tag);
if (sc->rxdesc_map != NULL) {
bus_dmamap_unload(sc->rxdesc_tag, sc->rxdesc_map);
bus_dmamem_free(sc->rxdesc_tag, sc->rxdesc_ring,
sc->rxdesc_map);
}
if (sc->rxdesc_tag != NULL)
bus_dma_tag_destroy(sc->rxdesc_tag);
/* Clean up TX DMA resources. */
for (idx = 0; idx < TX_DESC_COUNT; ++idx) {
if ((map = sc->txbuf_map[idx].map) != NULL) {
/* TX maps are already unloaded. */
bus_dmamap_destroy(sc->txbuf_tag, map);
}
}
if (sc->txbuf_tag != NULL)
bus_dma_tag_destroy(sc->txbuf_tag);
if (sc->txdesc_map != NULL) {
bus_dmamap_unload(sc->txdesc_tag, sc->txdesc_map);
bus_dmamem_free(sc->txdesc_tag, sc->txdesc_ring,
sc->txdesc_map);
}
if (sc->txdesc_tag != NULL)
bus_dma_tag_destroy(sc->txdesc_tag);
}
/*
* if_ functions
*/
......@@ -1050,7 +1098,7 @@ setup_dma(struct dwc_softc *sc)
static void
dwc_txstart_locked(struct dwc_softc *sc)
{
struct ifnet *ifp;
if_t ifp;
struct mbuf *m;
int enqueued;
......@@ -1099,9 +1147,9 @@ dwc_txstart_locked(struct dwc_softc *sc)
}
static void
dwc_txstart(struct ifnet *ifp)
dwc_txstart(if_t ifp)
{
struct dwc_softc *sc = ifp->if_softc;
struct dwc_softc *sc = if_getsoftc(ifp);
DWC_LOCK(sc);
dwc_txstart_locked(sc);
......@@ -1111,7 +1159,7 @@ dwc_txstart(struct ifnet *ifp)
static void
dwc_init_locked(struct dwc_softc *sc)
{
struct ifnet *ifp = sc->ifp;
if_t ifp = sc->ifp;
DWC_ASSERT_LOCKED(sc);
......@@ -1121,6 +1169,7 @@ dwc_init_locked(struct dwc_softc *sc)
dwc_setup_rxfilter(sc);
dwc_setup_core(sc);
dwc_enable_mac(sc, true);
dwc_enable_csum_offload(sc);
dwc_init_dma(sc);
if_setdrvflagbits(ifp, IFF_DRV_RUNNING, IFF_DRV_OACTIVE);
......@@ -1146,7 +1195,7 @@ dwc_init(void *if_softc)
static void
dwc_stop_locked(struct dwc_softc *sc)
{
struct ifnet *ifp;
if_t ifp;
DWC_ASSERT_LOCKED(sc);
......@@ -1162,14 +1211,14 @@ dwc_stop_locked(struct dwc_softc *sc)
}
static int
dwc_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
dwc_ioctl(if_t ifp, u_long cmd, caddr_t data)
{
struct dwc_softc *sc;
struct mii_data *mii;
struct ifreq *ifr;
int flags, mask, error;
sc = ifp->if_softc;
sc = if_getsoftc(ifp);
ifr = (struct ifreq *)data;
error = 0;
......@@ -1219,6 +1268,12 @@ dwc_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
if_sethwassistbits(ifp, CSUM_IP | CSUM_UDP | CSUM_TCP, 0);
else
if_sethwassistbits(ifp, 0, CSUM_IP | CSUM_UDP | CSUM_TCP);
if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) {
DWC_LOCK(sc);
dwc_enable_csum_offload(sc);
DWC_UNLOCK(sc);
}
break;
default:
......@@ -1238,7 +1293,7 @@ dwc_txfinish_locked(struct dwc_softc *sc)
{
struct dwc_bufmap *bmap;
struct dwc_hwdesc *desc;
struct ifnet *ifp;
if_t ifp;
int idx, last_idx;
bool map_finished;
......@@ -1369,7 +1424,7 @@ static void dwc_clear_stats(struct dwc_softc *sc)
static void
dwc_harvest_stats(struct dwc_softc *sc)
{
struct ifnet *ifp;
if_t ifp;
/* We don't need to harvest too often. */
if (++sc->stats_harvest_count < STATS_HARVEST_INTERVAL)
......@@ -1378,16 +1433,12 @@ dwc_harvest_stats(struct dwc_softc *sc)
sc->stats_harvest_count = 0;
ifp = sc->ifp;
if_inc_counter(ifp, IFCOUNTER_IPACKETS, READ4(sc, RXFRAMECOUNT_GB));
if_inc_counter(ifp, IFCOUNTER_IMCASTS, READ4(sc, RXMULTICASTFRAMES_G));
if_inc_counter(ifp, IFCOUNTER_IERRORS,
READ4(sc, RXOVERSIZE_G) + READ4(sc, RXUNDERSIZE_G) +
READ4(sc, RXCRCERROR) + READ4(sc, RXALIGNMENTERROR) +
READ4(sc, RXRUNTERROR) + READ4(sc, RXJABBERERROR) +
READ4(sc, RXLENGTHERROR));
if_inc_counter(ifp, IFCOUNTER_OPACKETS, READ4(sc, TXFRAMECOUNT_G));
if_inc_counter(ifp, IFCOUNTER_OMCASTS, READ4(sc, TXMULTICASTFRAMES_G));
if_inc_counter(ifp, IFCOUNTER_OERRORS,
READ4(sc, TXOVERSIZE_G) + READ4(sc, TXEXCESSDEF) +
READ4(sc, TXCARRIERERR) + READ4(sc, TXUNDERFLOWERROR));
......@@ -1402,7 +1453,7 @@ static void
dwc_tick(void *arg)
{
struct dwc_softc *sc;
struct ifnet *ifp;
if_t ifp;
int link_was_up;
sc = arg;
......@@ -1551,7 +1602,7 @@ dwc_attach(device_t dev)
{
uint8_t macaddr[ETHER_ADDR_LEN];
struct dwc_softc *sc;
struct ifnet *ifp;
if_t ifp;
int error, i;
uint32_t reg;
phandle_t node;
......@@ -1677,7 +1728,7 @@ dwc_attach(device_t dev)
/* Set up the ethernet interface. */
sc->ifp = ifp = if_alloc(IFT_ETHER);
ifp->if_softc = sc;
if_setsoftc(ifp, sc);
if_initname(ifp, device_get_name(dev), device_get_unit(dev));
if_setflags(sc->ifp, IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST);
if_setstartfn(ifp, dwc_txstart);
......@@ -1709,9 +1760,55 @@ dwc_attach(device_t dev)
return (0);
}
static int
dwc_detach(device_t dev)
{
struct dwc_softc *sc;
sc = device_get_softc(dev);
/*
* Disable and tear down interrupts before anything else, so we don't
* race with the handler.
*/
WRITE4(sc, INTERRUPT_ENABLE, 0);
if (sc->intr_cookie != NULL) {
bus_teardown_intr(dev, sc->res[1], sc->intr_cookie);
}
if (sc->is_attached) {
DWC_LOCK(sc);
sc->is_detaching = true;
dwc_stop_locked(sc);
DWC_UNLOCK(sc);
callout_drain(&sc->dwc_callout);
ether_ifdetach(sc->ifp);
}
if (sc->miibus != NULL) {
device_delete_child(dev, sc->miibus);
sc->miibus = NULL;
}
bus_generic_detach(dev);
/* Free DMA descriptors */
free_dma(sc);
if (sc->ifp != NULL) {
if_free(sc->ifp);
sc->ifp = NULL;
}
bus_release_resources(dev, dwc_spec, sc->res);
mtx_destroy(&sc->mtx);
return (0);
}
static device_method_t dwc_methods[] = {
DEVMETHOD(device_probe, dwc_probe),
DEVMETHOD(device_attach, dwc_attach),
DEVMETHOD(device_detach, dwc_detach),
/* MII Interface */
DEVMETHOD(miibus_readreg, dwc_miibus_read_reg),
......
......@@ -48,6 +48,7 @@
#define CONF_PS (1 << 15) /* GMII/MII */
#define CONF_FES (1 << 14) /* MII speed select */
#define CONF_DM (1 << 11) /* Full Duplex Enable */
#define CONF_IPC (1 << 10) /* IPC checksum offload */
#define CONF_ACS (1 << 7)
#define CONF_TE (1 << 3)
#define CONF_RE (1 << 2)
......
......@@ -1425,10 +1425,11 @@ ffec_detach(device_t dev)
bus_dma_tag_destroy(sc->rxbuf_tag);
if (sc->rxdesc_map != NULL) {
bus_dmamap_unload(sc->rxdesc_tag, sc->rxdesc_map);
bus_dmamap_destroy(sc->rxdesc_tag, sc->rxdesc_map);
bus_dmamem_free(sc->rxdesc_tag, sc->rxdesc_ring,
sc->rxdesc_map);
}
if (sc->rxdesc_tag != NULL)
bus_dma_tag_destroy(sc->rxdesc_tag);
bus_dma_tag_destroy(sc->rxdesc_tag);
/* Clean up TX DMA resources. */
for (idx = 0; idx < TX_DESC_COUNT; ++idx) {
......@@ -1441,7 +1442,8 @@ ffec_detach(device_t dev)
bus_dma_tag_destroy(sc->txbuf_tag);
if (sc->txdesc_map != NULL) {
bus_dmamap_unload(sc->txdesc_tag, sc->txdesc_map);
bus_dmamap_destroy(sc->txdesc_tag, sc->txdesc_map);
bus_dmamem_free(sc->txdesc_tag, sc->txdesc_ring,
sc->txdesc_map);
}
if (sc->txdesc_tag != NULL)
bus_dma_tag_destroy(sc->txdesc_tag);
......
......@@ -218,6 +218,12 @@ uhid_intr_read_callback(struct usb_xfer *xfer, usb_error_t error)
actlen = sc->sc_isize;
usb_fifo_put_data(sc->sc_fifo.fp[USB_FIFO_RX], pc,
0, actlen, 1);
/*
* Do not do read-ahead, because this may lead
* to data loss!
*/
return;
} else {
/* ignore it */
DPRINTF("ignored transfer, %d bytes\n", actlen);
......
......@@ -273,8 +273,8 @@ g_dev_set_physpath(struct g_consumer *cp)
dev = sc->sc_dev;
old_alias_dev = sc->sc_alias;
alias_devp = (struct cdev **)&sc->sc_alias;
make_dev_physpath_alias(MAKEDEV_WAITOK, alias_devp, dev,
old_alias_dev, physpath);
make_dev_physpath_alias(MAKEDEV_WAITOK | MAKEDEV_CHECKNAME,
alias_devp, dev, old_alias_dev, physpath);
} else if (sc->sc_alias) {
destroy_dev((struct cdev *)sc->sc_alias);
sc->sc_alias = NULL;
......
......@@ -291,7 +291,7 @@ geode_probe(device_t self)
tc_init(&geode_timecounter);
EVENTHANDLER_REGISTER(watchdog_list, geode_watchdog,
NULL, 0);
set_cputicker(geode_cputicks, 27000000, 0);
set_cputicker(geode_cputicks, 27000000, false);
}
break;
case 0x0510100b:
......
......@@ -67,16 +67,17 @@ CODE {
panic("bus_add_child is not implemented");
}
static int null_reset_post(device_t bus, device_t dev)
static int
null_reset_post(device_t bus, device_t dev)
{
return (0);
}
static int null_reset_prepare(device_t bus, device_t dev)
static int
null_reset_prepare(device_t bus, device_t dev)
{
return (0);
}
};
/**
......@@ -253,7 +254,7 @@ METHOD device_t add_child {
*/
METHOD int rescan {
device_t _dev;
}
} DEFAULT bus_null_rescan;
/**
* @brief Allocate a system resource
......
......@@ -2035,7 +2035,7 @@ SYSINIT(timecounter, SI_SUB_CLOCKS, SI_ORDER_SECOND, inittimecounter, NULL);
/* Cpu tick handling -------------------------------------------------*/
static int cpu_tick_variable;
static bool cpu_tick_variable;
static uint64_t cpu_tick_frequency;
DPCPU_DEFINE_STATIC(uint64_t, tc_cpu_ticks_base);
......@@ -2128,14 +2128,14 @@ cpu_tick_calibrate(int reset)
}
void
set_cputicker(cpu_tick_f *func, uint64_t freq, unsigned var)
set_cputicker(cpu_tick_f *func, uint64_t freq, bool isvariable)
{
if (func == NULL) {
cpu_ticks = tc_cpu_ticks;
} else {
cpu_tick_frequency = freq;
cpu_tick_variable = var;