svn commit: r242494 - in user/andre/tcp_workqueue/sys: amd64/amd64 amd64/include arm/broadcom/bcm2835 arm/conf arm/lpc arm/mv arm/mv/armadaxp arm/tegra arm/ti/omap4 cam/ctl cam/scsi cddl/contrib/op...
Andre Oppermann
andre at FreeBSD.org
Fri Nov 2 21:11:57 UTC 2012
Author: andre
Date: Fri Nov 2 21:11:56 2012
New Revision: 242494
URL: http://svn.freebsd.org/changeset/base/242494
Log:
Integrate from HEAD @242493.
Added:
user/andre/tcp_workqueue/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c
- copied unchanged from r242493, head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c
Modified:
user/andre/tcp_workqueue/sys/amd64/amd64/identcpu.c
user/andre/tcp_workqueue/sys/amd64/amd64/initcpu.c
user/andre/tcp_workqueue/sys/amd64/amd64/pmap.c
user/andre/tcp_workqueue/sys/amd64/include/md_var.h
user/andre/tcp_workqueue/sys/arm/broadcom/bcm2835/bcm2835_machdep.c
user/andre/tcp_workqueue/sys/arm/broadcom/bcm2835/files.bcm2835
user/andre/tcp_workqueue/sys/arm/conf/RPI-B
user/andre/tcp_workqueue/sys/arm/lpc/lpc_machdep.c
user/andre/tcp_workqueue/sys/arm/mv/armadaxp/armadaxp_mp.c
user/andre/tcp_workqueue/sys/arm/mv/mv_machdep.c
user/andre/tcp_workqueue/sys/arm/tegra/tegra2_machdep.c
user/andre/tcp_workqueue/sys/arm/ti/omap4/omap4_mp.c
user/andre/tcp_workqueue/sys/cam/ctl/ctl.c
user/andre/tcp_workqueue/sys/cam/ctl/ctl_backend_block.c
user/andre/tcp_workqueue/sys/cam/scsi/scsi_da.c
user/andre/tcp_workqueue/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
user/andre/tcp_workqueue/sys/compat/linux/linux_misc.c
user/andre/tcp_workqueue/sys/conf/NOTES
user/andre/tcp_workqueue/sys/conf/options
user/andre/tcp_workqueue/sys/contrib/octeon-sdk/cvmx-helper-board.c
user/andre/tcp_workqueue/sys/contrib/octeon-sdk/octeon-feature.c
user/andre/tcp_workqueue/sys/contrib/octeon-sdk/octeon-feature.h
user/andre/tcp_workqueue/sys/ddb/db_command.c
user/andre/tcp_workqueue/sys/ddb/db_textdump.c
user/andre/tcp_workqueue/sys/dev/age/if_age.c
user/andre/tcp_workqueue/sys/dev/ata/ata-all.c
user/andre/tcp_workqueue/sys/dev/ath/ath_hal/ah.h
user/andre/tcp_workqueue/sys/dev/ath/ath_hal/ah_devid.h
user/andre/tcp_workqueue/sys/dev/ath/ath_hal/ah_internal.h
user/andre/tcp_workqueue/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c
user/andre/tcp_workqueue/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c
user/andre/tcp_workqueue/sys/dev/ath/ath_hal/ar9001/ar9130_attach.c
user/andre/tcp_workqueue/sys/dev/ath/ath_hal/ar9001/ar9130_phy.c
user/andre/tcp_workqueue/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c
user/andre/tcp_workqueue/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c
user/andre/tcp_workqueue/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c
user/andre/tcp_workqueue/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c
user/andre/tcp_workqueue/sys/dev/ath/ath_rate/sample/sample.c
user/andre/tcp_workqueue/sys/dev/ath/if_ath.c
user/andre/tcp_workqueue/sys/dev/ath/if_ath_ahb.c
user/andre/tcp_workqueue/sys/dev/ath/if_ath_misc.h
user/andre/tcp_workqueue/sys/dev/ath/if_ath_pci.c
user/andre/tcp_workqueue/sys/dev/ath/if_ath_tx.c
user/andre/tcp_workqueue/sys/dev/ath/if_athvar.h
user/andre/tcp_workqueue/sys/dev/bce/if_bcereg.h
user/andre/tcp_workqueue/sys/dev/bge/if_bge.c
user/andre/tcp_workqueue/sys/dev/drm2/drm_drv.c
user/andre/tcp_workqueue/sys/dev/hwpmc/hwpmc_mod.c
user/andre/tcp_workqueue/sys/dev/isp/isp_pci.c
user/andre/tcp_workqueue/sys/dev/isp/isp_sbus.c
user/andre/tcp_workqueue/sys/dev/ixgbe/ixgbe.c
user/andre/tcp_workqueue/sys/dev/mmc/mmc.c
user/andre/tcp_workqueue/sys/dev/null/null.c
user/andre/tcp_workqueue/sys/dev/nvme/nvme_qpair.c
user/andre/tcp_workqueue/sys/dev/sdhci/sdhci.c
user/andre/tcp_workqueue/sys/dev/sdhci/sdhci.h
user/andre/tcp_workqueue/sys/dev/sound/pci/hda/hdaa.c
user/andre/tcp_workqueue/sys/dev/sound/pci/hda/hdaa.h
user/andre/tcp_workqueue/sys/dev/sound/pci/hda/hdaa_patches.c
user/andre/tcp_workqueue/sys/dev/sound/pci/hda/hdac.c
user/andre/tcp_workqueue/sys/dev/sound/pci/hda/hdac.h
user/andre/tcp_workqueue/sys/dev/sound/pci/hda/hdacc.c
user/andre/tcp_workqueue/sys/dev/sound/pcm/mixer.h
user/andre/tcp_workqueue/sys/dev/sound/usb/uaudio.c
user/andre/tcp_workqueue/sys/dev/ti/if_ti.c
user/andre/tcp_workqueue/sys/dev/uart/uart_dev_pl011.c
user/andre/tcp_workqueue/sys/dev/usb/usb_msctest.c
user/andre/tcp_workqueue/sys/fs/nullfs/null_vnops.c
user/andre/tcp_workqueue/sys/fs/smbfs/smbfs.h
user/andre/tcp_workqueue/sys/fs/smbfs/smbfs_io.c
user/andre/tcp_workqueue/sys/fs/smbfs/smbfs_node.c
user/andre/tcp_workqueue/sys/fs/smbfs/smbfs_node.h
user/andre/tcp_workqueue/sys/fs/smbfs/smbfs_smb.c
user/andre/tcp_workqueue/sys/fs/smbfs/smbfs_subr.c
user/andre/tcp_workqueue/sys/fs/smbfs/smbfs_subr.h
user/andre/tcp_workqueue/sys/fs/smbfs/smbfs_vfsops.c
user/andre/tcp_workqueue/sys/fs/smbfs/smbfs_vnops.c
user/andre/tcp_workqueue/sys/fs/unionfs/union_subr.c
user/andre/tcp_workqueue/sys/geom/geom_dev.c
user/andre/tcp_workqueue/sys/geom/geom_disk.c
user/andre/tcp_workqueue/sys/geom/geom_disk.h
user/andre/tcp_workqueue/sys/geom/label/g_label_ufs.c
user/andre/tcp_workqueue/sys/geom/raid/g_raid.c
user/andre/tcp_workqueue/sys/geom/raid/g_raid.h
user/andre/tcp_workqueue/sys/geom/raid/md_ddf.c
user/andre/tcp_workqueue/sys/geom/raid/md_intel.c
user/andre/tcp_workqueue/sys/geom/raid/md_jmicron.c
user/andre/tcp_workqueue/sys/geom/raid/md_nvidia.c
user/andre/tcp_workqueue/sys/geom/raid/md_promise.c
user/andre/tcp_workqueue/sys/geom/raid/md_sii.c
user/andre/tcp_workqueue/sys/geom/raid/tr_concat.c
user/andre/tcp_workqueue/sys/geom/raid/tr_raid0.c
user/andre/tcp_workqueue/sys/geom/raid/tr_raid1.c
user/andre/tcp_workqueue/sys/geom/raid/tr_raid1e.c
user/andre/tcp_workqueue/sys/i386/ibcs2/imgact_coff.c
user/andre/tcp_workqueue/sys/kern/kern_exec.c
user/andre/tcp_workqueue/sys/kern/kern_mutex.c
user/andre/tcp_workqueue/sys/kern/kern_shutdown.c
user/andre/tcp_workqueue/sys/kern/kern_timeout.c
user/andre/tcp_workqueue/sys/kern/sched_ule.c
user/andre/tcp_workqueue/sys/kern/subr_trap.c
user/andre/tcp_workqueue/sys/kern/vfs_default.c
user/andre/tcp_workqueue/sys/kern/vfs_vnops.c
user/andre/tcp_workqueue/sys/kern/vnode_if.src
user/andre/tcp_workqueue/sys/mips/cavium/files.octeon1
user/andre/tcp_workqueue/sys/mips/cavium/octe/ethernet-common.c
user/andre/tcp_workqueue/sys/mips/cavium/octe/ethernet-rgmii.c
user/andre/tcp_workqueue/sys/mips/cavium/octe/ethernet-rx.c
user/andre/tcp_workqueue/sys/mips/cavium/octe/ethernet-sgmii.c
user/andre/tcp_workqueue/sys/mips/cavium/octe/ethernet-xaui.c
user/andre/tcp_workqueue/sys/mips/cavium/octe/ethernet.c
user/andre/tcp_workqueue/sys/mips/cavium/octeon_ebt3000_cf.c
user/andre/tcp_workqueue/sys/mips/cavium/octeon_machdep.c
user/andre/tcp_workqueue/sys/mips/cavium/octeon_pcmap_regs.h
user/andre/tcp_workqueue/sys/mips/cavium/octopci.c
user/andre/tcp_workqueue/sys/mips/cavium/uart_cpu_octeonusart.c
user/andre/tcp_workqueue/sys/mips/mips/busdma_machdep.c
user/andre/tcp_workqueue/sys/net/pfil.c
user/andre/tcp_workqueue/sys/net/pfil.h
user/andre/tcp_workqueue/sys/netinet/ip_fastfwd.c
user/andre/tcp_workqueue/sys/netinet/ip_input.c
user/andre/tcp_workqueue/sys/netinet/ip_output.c
user/andre/tcp_workqueue/sys/netinet/ip_var.h
user/andre/tcp_workqueue/sys/netinet/sctp_output.c
user/andre/tcp_workqueue/sys/netinet/sctp_uio.h
user/andre/tcp_workqueue/sys/netinet/sctp_var.h
user/andre/tcp_workqueue/sys/netinet/sctputil.c
user/andre/tcp_workqueue/sys/netinet/tcp_input.c
user/andre/tcp_workqueue/sys/netinet/udp_usrreq.c
user/andre/tcp_workqueue/sys/netinet6/ip6_forward.c
user/andre/tcp_workqueue/sys/netinet6/ip6_input.c
user/andre/tcp_workqueue/sys/netinet6/ip6_output.c
user/andre/tcp_workqueue/sys/netinet6/ip6_var.h
user/andre/tcp_workqueue/sys/netinet6/sctp6_var.h
user/andre/tcp_workqueue/sys/netinet6/udp6_usrreq.c
user/andre/tcp_workqueue/sys/netpfil/ipfw/ip_fw2.c
user/andre/tcp_workqueue/sys/netpfil/ipfw/ip_fw_pfil.c
user/andre/tcp_workqueue/sys/netsmb/smb_conn.c
user/andre/tcp_workqueue/sys/netsmb/smb_dev.c
user/andre/tcp_workqueue/sys/netsmb/smb_trantcp.c
user/andre/tcp_workqueue/sys/netsmb/smb_usr.c
user/andre/tcp_workqueue/sys/powerpc/powermac/openpic_macio.c
user/andre/tcp_workqueue/sys/sys/_mutex.h
user/andre/tcp_workqueue/sys/sys/conf.h
user/andre/tcp_workqueue/sys/sys/mutex.h
user/andre/tcp_workqueue/sys/ufs/ffs/ffs_softdep.c
user/andre/tcp_workqueue/sys/ufs/ffs/fs.h
user/andre/tcp_workqueue/sys/ufs/ufs/ufs_extattr.c
user/andre/tcp_workqueue/sys/vm/vm_page.c
user/andre/tcp_workqueue/sys/vm/vm_page.h
user/andre/tcp_workqueue/sys/vm/vm_pageout.c
user/andre/tcp_workqueue/sys/vm/vnode_pager.c
user/andre/tcp_workqueue/sys/x86/include/specialreg.h
Directory Properties:
user/andre/tcp_workqueue/sys/ (props changed)
user/andre/tcp_workqueue/sys/cddl/contrib/opensolaris/ (props changed)
user/andre/tcp_workqueue/sys/conf/ (props changed)
user/andre/tcp_workqueue/sys/contrib/octeon-sdk/ (props changed)
Modified: user/andre/tcp_workqueue/sys/amd64/amd64/identcpu.c
==============================================================================
--- user/andre/tcp_workqueue/sys/amd64/amd64/identcpu.c Fri Nov 2 21:07:30 2012 (r242493)
+++ user/andre/tcp_workqueue/sys/amd64/amd64/identcpu.c Fri Nov 2 21:11:56 2012 (r242494)
@@ -384,6 +384,18 @@ printcpuinfo(void)
);
}
+ if (cpu_stdext_feature != 0) {
+ printf("\n Standard Extended Features=0x%b",
+ cpu_stdext_feature,
+ "\020"
+ "\001GSFSBASE"
+ "\002TSCADJ"
+ "\010SMEP"
+ "\012ENHMOVSB"
+ "\013INVPCID"
+ );
+ }
+
if (via_feature_rng != 0 || via_feature_xcrypt != 0)
print_via_padlock_info();
@@ -501,6 +513,11 @@ identify_cpu(void)
}
}
+ if (cpu_high >= 7) {
+ cpuid_count(7, 0, regs);
+ cpu_stdext_feature = regs[1];
+ }
+
if (cpu_vendor_id == CPU_VENDOR_INTEL ||
cpu_vendor_id == CPU_VENDOR_AMD ||
cpu_vendor_id == CPU_VENDOR_CENTAUR) {
Modified: user/andre/tcp_workqueue/sys/amd64/amd64/initcpu.c
==============================================================================
--- user/andre/tcp_workqueue/sys/amd64/amd64/initcpu.c Fri Nov 2 21:07:30 2012 (r242493)
+++ user/andre/tcp_workqueue/sys/amd64/amd64/initcpu.c Fri Nov 2 21:11:56 2012 (r242494)
@@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/kernel.h>
+#include <sys/pcpu.h>
#include <sys/systm.h>
#include <sys/sysctl.h>
@@ -72,6 +73,7 @@ u_int cpu_vendor_id; /* CPU vendor ID *
u_int cpu_fxsr; /* SSE enabled */
u_int cpu_mxcsr_mask; /* Valid bits in mxcsr */
u_int cpu_clflush_line_size = 32;
+u_int cpu_stdext_feature;
u_int cpu_max_ext_state_size;
SYSCTL_UINT(_hw, OID_AUTO, via_feature_rng, CTLFLAG_RD,
@@ -152,11 +154,25 @@ void
initializecpu(void)
{
uint64_t msr;
+ uint32_t cr4;
+ cr4 = rcr4();
if ((cpu_feature & CPUID_XMM) && (cpu_feature & CPUID_FXSR)) {
- load_cr4(rcr4() | CR4_FXSR | CR4_XMM);
+ cr4 |= CR4_FXSR | CR4_XMM;
cpu_fxsr = hw_instruction_sse = 1;
}
+ if (cpu_stdext_feature & CPUID_STDEXT_FSGSBASE)
+ cr4 |= CR4_FSGSBASE;
+
+ /*
+ * Postpone enabling the SMEP on the boot CPU until the page
+ * tables are switched from the boot loader identity mapping
+ * to the kernel tables. The boot loader enables the U bit in
+ * its tables.
+ */
+ if (!IS_BSP() && (cpu_stdext_feature & CPUID_STDEXT_SMEP))
+ cr4 |= CR4_SMEP;
+ load_cr4(cr4);
if ((amd_feature & AMDID_NX) != 0) {
msr = rdmsr(MSR_EFER) | EFER_NXE;
wrmsr(MSR_EFER, msr);
Modified: user/andre/tcp_workqueue/sys/amd64/amd64/pmap.c
==============================================================================
--- user/andre/tcp_workqueue/sys/amd64/amd64/pmap.c Fri Nov 2 21:07:30 2012 (r242493)
+++ user/andre/tcp_workqueue/sys/amd64/amd64/pmap.c Fri Nov 2 21:11:56 2012 (r242494)
@@ -622,6 +622,8 @@ pmap_bootstrap(vm_paddr_t *firstaddr)
/* XXX do %cr0 as well */
load_cr4(rcr4() | CR4_PGE | CR4_PSE);
load_cr3(KPML4phys);
+ if (cpu_stdext_feature & CPUID_STDEXT_SMEP)
+ load_cr4(rcr4() | CR4_SMEP);
/*
* Initialize the kernel pmap (which is statically allocated).
Modified: user/andre/tcp_workqueue/sys/amd64/include/md_var.h
==============================================================================
--- user/andre/tcp_workqueue/sys/amd64/include/md_var.h Fri Nov 2 21:07:30 2012 (r242493)
+++ user/andre/tcp_workqueue/sys/amd64/include/md_var.h Fri Nov 2 21:11:56 2012 (r242494)
@@ -48,6 +48,7 @@ extern u_int amd_pminfo;
extern u_int via_feature_rng;
extern u_int via_feature_xcrypt;
extern u_int cpu_clflush_line_size;
+extern u_int cpu_stdext_feature;
extern u_int cpu_fxsr;
extern u_int cpu_high;
extern u_int cpu_id;
Modified: user/andre/tcp_workqueue/sys/arm/broadcom/bcm2835/bcm2835_machdep.c
==============================================================================
--- user/andre/tcp_workqueue/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Fri Nov 2 21:07:30 2012 (r242493)
+++ user/andre/tcp_workqueue/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Fri Nov 2 21:11:56 2012 (r242494)
@@ -306,6 +306,7 @@ initarm(struct arm_boot_params *abp)
struct pv_addr dpcpu;
vm_offset_t dtbp, freemempos, l2_start, lastaddr;
uint32_t memsize, l2size;
+ char *env;
void *kmdp;
u_int l1pagetable;
int i = 0, j = 0, err_devmap = 0;
@@ -491,6 +492,10 @@ initarm(struct arm_boot_params *abp)
print_kernel_section_addr();
print_kenv();
+ env = getenv("kernelname");
+ if (env != NULL)
+ strlcpy(kernelname, env, sizeof(kernelname));
+
if (err_devmap != 0)
printf("WARNING: could not fully configure devmap, error=%d\n",
err_devmap);
Copied: user/andre/tcp_workqueue/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c (from r242493, head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ user/andre/tcp_workqueue/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Fri Nov 2 21:11:56 2012 (r242494, copy of r242493, head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c)
@@ -0,0 +1,364 @@
+/*-
+ * Copyright (c) 2012 Oleksandr Tymoshenko <gonzo at freebsd.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/bio.h>
+#include <sys/bus.h>
+#include <sys/conf.h>
+#include <sys/endian.h>
+#include <sys/kernel.h>
+#include <sys/kthread.h>
+#include <sys/lock.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <sys/mutex.h>
+#include <sys/queue.h>
+#include <sys/resource.h>
+#include <sys/rman.h>
+#include <sys/taskqueue.h>
+#include <sys/time.h>
+#include <sys/timetc.h>
+#include <sys/watchdog.h>
+
+#include <sys/kdb.h>
+
+#include <machine/bus.h>
+#include <machine/cpu.h>
+#include <machine/cpufunc.h>
+#include <machine/resource.h>
+#include <machine/frame.h>
+#include <machine/intr.h>
+
+#include <dev/ofw/ofw_bus.h>
+#include <dev/ofw/ofw_bus_subr.h>
+
+#include <dev/mmc/bridge.h>
+#include <dev/mmc/mmcreg.h>
+#include <dev/mmc/mmcbrvar.h>
+
+#include <dev/sdhci/sdhci.h>
+#include "sdhci_if.h"
+
+#define DEBUG
+
+#ifdef DEBUG
+#define dprintf(fmt, args...) do { printf("%s(): ", __func__); \
+ printf(fmt,##args); } while (0)
+#else
+#define dprintf(fmt, args...)
+#endif
+
+struct bcm_sdhci_dmamap_arg {
+ bus_addr_t sc_dma_busaddr;
+};
+
+struct bcm_sdhci_softc {
+ device_t sc_dev;
+ struct mtx sc_mtx;
+ struct resource * sc_mem_res;
+ struct resource * sc_irq_res;
+ bus_space_tag_t sc_bst;
+ bus_space_handle_t sc_bsh;
+ void * sc_intrhand;
+ struct mmc_request * sc_req;
+ struct mmc_data * sc_data;
+ uint32_t sc_flags;
+#define LPC_SD_FLAGS_IGNORECRC (1 << 0)
+ int sc_xfer_direction;
+#define DIRECTION_READ 0
+#define DIRECTION_WRITE 1
+ int sc_xfer_done;
+ int sc_bus_busy;
+ struct sdhci_slot sc_slot;
+};
+
+#define SD_MAX_BLOCKSIZE 1024
+/* XXX */
+
+static int bcm_sdhci_probe(device_t);
+static int bcm_sdhci_attach(device_t);
+static int bcm_sdhci_detach(device_t);
+static void bcm_sdhci_intr(void *);
+
+static int bcm_sdhci_get_ro(device_t, device_t);
+
+#define bcm_sdhci_lock(_sc) \
+ mtx_lock(&_sc->sc_mtx);
+#define bcm_sdhci_unlock(_sc) \
+ mtx_unlock(&_sc->sc_mtx);
+
+static int
+bcm_sdhci_probe(device_t dev)
+{
+ if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-sdhci"))
+ return (ENXIO);
+
+ device_set_desc(dev, "Broadcom 2708 SDHCI controller");
+ return (BUS_PROBE_DEFAULT);
+}
+
+static int
+bcm_sdhci_attach(device_t dev)
+{
+ struct bcm_sdhci_softc *sc = device_get_softc(dev);
+ int rid, err;
+
+ sc->sc_dev = dev;
+ sc->sc_req = NULL;
+
+ mtx_init(&sc->sc_mtx, "bcm sdhci", "sdhci", MTX_DEF);
+
+ rid = 0;
+ sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid,
+ RF_ACTIVE);
+ if (!sc->sc_mem_res) {
+ device_printf(dev, "cannot allocate memory window\n");
+ err = ENXIO;
+ goto fail;
+ }
+
+ sc->sc_bst = rman_get_bustag(sc->sc_mem_res);
+ sc->sc_bsh = rman_get_bushandle(sc->sc_mem_res);
+
+ rid = 0;
+ sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
+ RF_ACTIVE);
+ if (!sc->sc_irq_res) {
+ device_printf(dev, "cannot allocate interrupt\n");
+ bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res);
+ err = ENXIO;
+ goto fail;
+ }
+
+ if (bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_MISC | INTR_MPSAFE,
+ NULL, bcm_sdhci_intr, sc, &sc->sc_intrhand))
+ {
+ bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res);
+ bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_irq_res);
+ device_printf(dev, "cannot setup interrupt handler\n");
+ err = ENXIO;
+ goto fail;
+ }
+
+ sc->sc_slot.caps = SDHCI_CAN_VDD_330 | SDHCI_CAN_VDD_180 | SDHCI_CAN_DO_HISPD;
+ sc->sc_slot.caps |= (50 << SDHCI_CLOCK_BASE_SHIFT);
+ sc->sc_slot.quirks = SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK
+ | SDHCI_QUIRK_BROKEN_TIMEOUT_VAL
+ | SDHCI_QUIRK_MISSING_CAPS;
+
+ sdhci_init_slot(dev, &sc->sc_slot, 0);
+
+ bus_generic_probe(dev);
+ bus_generic_attach(dev);
+
+ sdhci_start_slot(&sc->sc_slot);
+
+ return (0);
+
+fail:
+ if (sc->sc_intrhand)
+ bus_teardown_intr(dev, sc->sc_irq_res, sc->sc_intrhand);
+ if (sc->sc_irq_res)
+ bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_irq_res);
+ if (sc->sc_mem_res)
+ bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res);
+
+ return (err);
+}
+
+static int
+bcm_sdhci_detach(device_t dev)
+{
+
+ return (EBUSY);
+}
+
+static void
+bcm_sdhci_intr(void *arg)
+{
+ struct bcm_sdhci_softc *sc = arg;
+
+ sdhci_generic_intr(&sc->sc_slot);
+}
+
+static int
+bcm_sdhci_get_ro(device_t bus, device_t child)
+{
+
+ return (0);
+}
+
+static inline uint32_t
+RD4(struct bcm_sdhci_softc *sc, bus_size_t off)
+{
+ uint32_t val = bus_space_read_4(sc->sc_bst, sc->sc_bsh, off);
+ return val;
+}
+
+static inline void
+WR4(struct bcm_sdhci_softc *sc, bus_size_t off, uint32_t val)
+{
+ bus_space_write_4(sc->sc_bst, sc->sc_bsh, off, val);
+
+ if ((off != SDHCI_BUFFER && off != SDHCI_INT_STATUS && off != SDHCI_CLOCK_CONTROL))
+ {
+ int timeout = 100000;
+ while (val != bus_space_read_4(sc->sc_bst, sc->sc_bsh, off)
+ && --timeout > 0)
+ continue;
+
+ if (timeout <= 0)
+ printf("sdhci_brcm: writing 0x%X to reg 0x%X "
+ "always gives 0x%X\n",
+ val, (uint32_t)off,
+ bus_space_read_4(sc->sc_bst, sc->sc_bsh, off));
+ }
+}
+
+static uint8_t
+bcm_sdhci_read_1(device_t dev, struct sdhci_slot *slot, bus_size_t off)
+{
+ struct bcm_sdhci_softc *sc = device_get_softc(dev);
+ uint32_t val = RD4(sc, off & ~3);
+
+ return ((val >> (off & 3)*8) & 0xff);
+}
+
+static uint16_t
+bcm_sdhci_read_2(device_t dev, struct sdhci_slot *slot, bus_size_t off)
+{
+ struct bcm_sdhci_softc *sc = device_get_softc(dev);
+ uint32_t val = RD4(sc, off & ~3);
+
+ return ((val >> (off & 3)*8) & 0xffff);
+}
+
+static uint32_t
+bcm_sdhci_read_4(device_t dev, struct sdhci_slot *slot, bus_size_t off)
+{
+ struct bcm_sdhci_softc *sc = device_get_softc(dev);
+
+ return RD4(sc, off);
+}
+
+static void
+bcm_sdhci_read_multi_4(device_t dev, struct sdhci_slot *slot, bus_size_t off,
+ uint32_t *data, bus_size_t count)
+{
+ struct bcm_sdhci_softc *sc = device_get_softc(dev);
+
+ bus_space_read_multi_4(sc->sc_bst, sc->sc_bsh, off, data, count);
+}
+
+static void
+bcm_sdhci_write_1(device_t dev, struct sdhci_slot *slot, bus_size_t off, uint8_t val)
+{
+ struct bcm_sdhci_softc *sc = device_get_softc(dev);
+ uint32_t val32 = RD4(sc, off & ~3);
+ val32 &= ~(0xff << (off & 3)*8);
+ val32 |= (val << (off & 3)*8);
+ WR4(sc, off & ~3, val32);
+}
+
+static void
+bcm_sdhci_write_2(device_t dev, struct sdhci_slot *slot, bus_size_t off, uint16_t val)
+{
+ struct bcm_sdhci_softc *sc = device_get_softc(dev);
+ static uint32_t cmd_and_trandfer_mode;
+ uint32_t val32;
+ if (off == SDHCI_COMMAND_FLAGS)
+ val32 = cmd_and_trandfer_mode;
+ else
+ val32 = RD4(sc, off & ~3);
+ val32 &= ~(0xffff << (off & 3)*8);
+ val32 |= (val << (off & 3)*8);
+ if (off == SDHCI_TRANSFER_MODE)
+ cmd_and_trandfer_mode = val32;
+ else
+ WR4(sc, off & ~3, val32);
+}
+
+static void
+bcm_sdhci_write_4(device_t dev, struct sdhci_slot *slot, bus_size_t off, uint32_t val)
+{
+ struct bcm_sdhci_softc *sc = device_get_softc(dev);
+ WR4(sc, off, val);
+}
+
+static void
+bcm_sdhci_write_multi_4(device_t dev, struct sdhci_slot *slot, bus_size_t off,
+ uint32_t *data, bus_size_t count)
+{
+ struct bcm_sdhci_softc *sc = device_get_softc(dev);
+
+ bus_space_write_multi_4(sc->sc_bst, sc->sc_bsh, off, data, count);
+}
+
+static device_method_t bcm_sdhci_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, bcm_sdhci_probe),
+ DEVMETHOD(device_attach, bcm_sdhci_attach),
+ DEVMETHOD(device_detach, bcm_sdhci_detach),
+
+ /* Bus interface */
+ DEVMETHOD(bus_read_ivar, sdhci_generic_read_ivar),
+ DEVMETHOD(bus_write_ivar, sdhci_generic_write_ivar),
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
+
+ /* MMC bridge interface */
+ DEVMETHOD(mmcbr_update_ios, sdhci_generic_update_ios),
+ DEVMETHOD(mmcbr_request, sdhci_generic_request),
+ DEVMETHOD(mmcbr_get_ro, bcm_sdhci_get_ro),
+ DEVMETHOD(mmcbr_acquire_host, sdhci_generic_acquire_host),
+ DEVMETHOD(mmcbr_release_host, sdhci_generic_release_host),
+
+ /* SDHCI registers accessors */
+ DEVMETHOD(sdhci_read_1, bcm_sdhci_read_1),
+ DEVMETHOD(sdhci_read_2, bcm_sdhci_read_2),
+ DEVMETHOD(sdhci_read_4, bcm_sdhci_read_4),
+ DEVMETHOD(sdhci_read_multi_4, bcm_sdhci_read_multi_4),
+ DEVMETHOD(sdhci_write_1, bcm_sdhci_write_1),
+ DEVMETHOD(sdhci_write_2, bcm_sdhci_write_2),
+ DEVMETHOD(sdhci_write_4, bcm_sdhci_write_4),
+ DEVMETHOD(sdhci_write_multi_4, bcm_sdhci_write_multi_4),
+
+ { 0, 0 }
+};
+
+static devclass_t bcm_sdhci_devclass;
+
+static driver_t bcm_sdhci_driver = {
+ "sdhci_bcm",
+ bcm_sdhci_methods,
+ sizeof(struct bcm_sdhci_softc),
+};
+
+DRIVER_MODULE(sdhci_bcm, simplebus, bcm_sdhci_driver, bcm_sdhci_devclass, 0, 0);
+MODULE_DEPEND(sdhci_bcm, sdhci, 1, 1, 1);
Modified: user/andre/tcp_workqueue/sys/arm/broadcom/bcm2835/files.bcm2835
==============================================================================
--- user/andre/tcp_workqueue/sys/arm/broadcom/bcm2835/files.bcm2835 Fri Nov 2 21:07:30 2012 (r242493)
+++ user/andre/tcp_workqueue/sys/arm/broadcom/bcm2835/files.bcm2835 Fri Nov 2 21:11:56 2012 (r242494)
@@ -4,6 +4,7 @@ arm/broadcom/bcm2835/bcm2835_fb.c optio
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_sdhci.c optional sdhci
arm/broadcom/bcm2835/bcm2835_systimer.c standard
arm/broadcom/bcm2835/bcm2835_wdog.c standard
arm/broadcom/bcm2835/bus_space.c optional fdt
Modified: user/andre/tcp_workqueue/sys/arm/conf/RPI-B
==============================================================================
--- user/andre/tcp_workqueue/sys/arm/conf/RPI-B Fri Nov 2 21:07:30 2012 (r242493)
+++ user/andre/tcp_workqueue/sys/arm/conf/RPI-B Fri Nov 2 21:11:56 2012 (r242494)
@@ -61,7 +61,7 @@ options SYSVMSG #SYSV-style message q
options SYSVSEM #SYSV-style semaphores
options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions
options KBD_INSTALL_CDEV # install a CDEV entry in /dev
-#options ROOTDEVNAME=\"ufs:/dev/da0s1a\"
+#options ROOTDEVNAME=\"ufs:mmcsd0s2\"
options PREEMPTION
@@ -80,6 +80,10 @@ device pty
# options SC_DFLT_FONT # compile font in
# makeoptions SC_DFLT_FONT=cp437
+device sdhci
+device mmc
+device mmcsd
+
options KDB
options DDB #Enable the kernel debugger
options INVARIANTS #Enable calls of extra sanity checking
Modified: user/andre/tcp_workqueue/sys/arm/lpc/lpc_machdep.c
==============================================================================
--- user/andre/tcp_workqueue/sys/arm/lpc/lpc_machdep.c Fri Nov 2 21:07:30 2012 (r242493)
+++ user/andre/tcp_workqueue/sys/arm/lpc/lpc_machdep.c Fri Nov 2 21:11:56 2012 (r242494)
@@ -307,6 +307,7 @@ initarm(struct arm_boot_params *abp)
struct pv_addr dpcpu;
vm_offset_t dtbp, freemempos, l2_start, lastaddr;
uint32_t memsize, l2size;
+ char *env;
void *kmdp;
u_int l1pagetable;
int i = 0, j = 0, err_devmap = 0;
@@ -492,6 +493,10 @@ initarm(struct arm_boot_params *abp)
print_kernel_section_addr();
print_kenv();
+ env = getenv("kernelname");
+ if (env != NULL)
+ strlcpy(kernelname, env, sizeof(kernelname));
+
if (err_devmap != 0)
printf("WARNING: could not fully configure devmap, error=%d\n",
err_devmap);
@@ -542,11 +547,6 @@ initarm(struct arm_boot_params *abp)
*/
physmap_init();
- /*
- * Set initial values of GPIO output ports
- */
- platform_gpio_init();
-
/* Do basic tuning, hz etc */
init_param2(physmem);
kdb_init();
@@ -569,6 +569,11 @@ initarm_lastaddr(void)
void
initarm_gpio_init(void)
{
+
+ /*
+ * Set initial values of GPIO output ports
+ */
+ platform_gpio_init();
}
void
Modified: user/andre/tcp_workqueue/sys/arm/mv/armadaxp/armadaxp_mp.c
==============================================================================
--- user/andre/tcp_workqueue/sys/arm/mv/armadaxp/armadaxp_mp.c Fri Nov 2 21:07:30 2012 (r242493)
+++ user/andre/tcp_workqueue/sys/arm/mv/armadaxp/armadaxp_mp.c Fri Nov 2 21:11:56 2012 (r242494)
@@ -179,7 +179,7 @@ platform_mp_start_ap(void)
for (cpu_num = 1; cpu_num < mp_ncpus; cpu_num++ )
bus_space_write_4(fdtbus_bs_tag, CPU_PMU(cpu_num), CPU_PMU_BOOT,
- pmap_kextract(mpentry));
+ pmap_kextract((vm_offset_t)mpentry));
cpu_idcache_wbinv_all();
Modified: user/andre/tcp_workqueue/sys/arm/mv/mv_machdep.c
==============================================================================
--- user/andre/tcp_workqueue/sys/arm/mv/mv_machdep.c Fri Nov 2 21:07:30 2012 (r242493)
+++ user/andre/tcp_workqueue/sys/arm/mv/mv_machdep.c Fri Nov 2 21:11:56 2012 (r242494)
@@ -297,6 +297,7 @@ initarm(struct arm_boot_params *abp)
struct pv_addr dpcpu;
vm_offset_t dtbp, freemempos, l2_start, lastaddr;
uint32_t memsize, l2size;
+ char *env;
void *kmdp;
u_int l1pagetable;
int i = 0, j = 0, err_devmap = 0;
@@ -482,6 +483,10 @@ initarm(struct arm_boot_params *abp)
print_kernel_section_addr();
print_kenv();
+ env = getenv("kernelname");
+ if (env != NULL)
+ strlcpy(kernelname, env, sizeof(kernelname));
+
if (err_devmap != 0)
printf("WARNING: could not fully configure devmap, error=%d\n",
err_devmap);
Modified: user/andre/tcp_workqueue/sys/arm/tegra/tegra2_machdep.c
==============================================================================
--- user/andre/tcp_workqueue/sys/arm/tegra/tegra2_machdep.c Fri Nov 2 21:07:30 2012 (r242493)
+++ user/andre/tcp_workqueue/sys/arm/tegra/tegra2_machdep.c Fri Nov 2 21:11:56 2012 (r242494)
@@ -346,6 +346,7 @@ initarm(struct arm_boot_params *abp)
struct pv_addr dpcpu;
vm_offset_t dtbp, freemempos, l2_start, lastaddr;
uint32_t memsize, l2size;
+ char *env;
void *kmdp;
u_int l1pagetable;
int i = 0, j = 0, err_devmap = 0;
@@ -531,6 +532,10 @@ initarm(struct arm_boot_params *abp)
print_kernel_section_addr();
print_kenv();
+ env = getenv("kernelname");
+ if (env != NULL)
+ strlcpy(kernelname, env, sizeof(kernelname));
+
if (err_devmap != 0)
printf("WARNING: could not fully configure devmap, error=%d\n",
err_devmap);
Modified: user/andre/tcp_workqueue/sys/arm/ti/omap4/omap4_mp.c
==============================================================================
--- user/andre/tcp_workqueue/sys/arm/ti/omap4/omap4_mp.c Fri Nov 2 21:07:30 2012 (r242493)
+++ user/andre/tcp_workqueue/sys/arm/ti/omap4/omap4_mp.c Fri Nov 2 21:11:56 2012 (r242494)
@@ -75,7 +75,7 @@ platform_mp_start_ap(void)
cpu_idcache_wbinv_all();
cpu_l2cache_wbinv_all();
ti_smc0(0x200, 0xfffffdff, MODIFY_AUX_CORE_0);
- ti_smc0(pmap_kextract(mpentry), 0, WRITE_AUX_CORE_1);
+ ti_smc0(pmap_kextract((vm_offset_t)mpentry), 0, WRITE_AUX_CORE_1);
armv7_sev();
bus_space_unmap(fdtbus_bs_tag, scu_addr, 0x1000);
}
Modified: user/andre/tcp_workqueue/sys/cam/ctl/ctl.c
==============================================================================
--- user/andre/tcp_workqueue/sys/cam/ctl/ctl.c Fri Nov 2 21:07:30 2012 (r242493)
+++ user/andre/tcp_workqueue/sys/cam/ctl/ctl.c Fri Nov 2 21:11:56 2012 (r242494)
@@ -957,11 +957,10 @@ ctl_init(void)
if (ctl_disable != 0)
return;
- control_softc = malloc(sizeof(*control_softc), M_DEVBUF, M_WAITOK);
+ control_softc = malloc(sizeof(*control_softc), M_DEVBUF,
+ M_WAITOK | M_ZERO);
softc = control_softc;
- memset(softc, 0, sizeof(*softc));
-
softc->dev = make_dev(&ctl_cdevsw, 0, UID_ROOT, GID_OPERATOR, 0600,
"cam/ctl");
@@ -3271,14 +3270,13 @@ ctl_pool_create(struct ctl_softc *ctl_so
retval = 0;
- pool = (struct ctl_io_pool *)malloc(sizeof(*pool), M_CTL, M_NOWAIT);
+ pool = (struct ctl_io_pool *)malloc(sizeof(*pool), M_CTL,
+ M_NOWAIT | M_ZERO);
if (pool == NULL) {
retval = -ENOMEM;
goto bailout;
}
- memset(pool, 0, sizeof(*pool));
-
pool->type = pool_type;
pool->ctl_softc = ctl_softc;
@@ -6561,7 +6559,7 @@ ctl_mode_sense(struct ctl_scsiio *ctsio)
header_len, page_len, total_len);
#endif
- ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK);
+ ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO);
ctsio->kern_sg_entries = 0;
ctsio->kern_data_resid = 0;
ctsio->kern_rel_offset = 0;
@@ -6574,7 +6572,6 @@ ctl_mode_sense(struct ctl_scsiio *ctsio)
ctsio->kern_data_len = alloc_len;
ctsio->kern_total_len = alloc_len;
}
- memset(ctsio->kern_data_ptr, 0, total_len);
switch (ctsio->cdb[0]) {
case MODE_SENSE_6: {
@@ -6742,7 +6739,7 @@ ctl_read_capacity(struct ctl_scsiio *cts
lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr;
- ctsio->kern_data_ptr = malloc(sizeof(*data), M_CTL, M_WAITOK);
+ ctsio->kern_data_ptr = malloc(sizeof(*data), M_CTL, M_WAITOK | M_ZERO);
data = (struct scsi_read_capacity_data *)ctsio->kern_data_ptr;
ctsio->residual = 0;
ctsio->kern_data_len = sizeof(*data);
@@ -6751,8 +6748,6 @@ ctl_read_capacity(struct ctl_scsiio *cts
ctsio->kern_rel_offset = 0;
ctsio->kern_sg_entries = 0;
- memset(data, 0, sizeof(*data));
-
/*
* If the maximum LBA is greater than 0xfffffffe, the user must
* issue a SERVICE ACTION IN (16) command, with the read capacity
@@ -6806,7 +6801,7 @@ ctl_read_capacity_16(struct ctl_scsiio *
lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr;
- ctsio->kern_data_ptr = malloc(sizeof(*data), M_CTL, M_WAITOK);
+ ctsio->kern_data_ptr = malloc(sizeof(*data), M_CTL, M_WAITOK | M_ZERO);
data = (struct scsi_read_capacity_data_long *)ctsio->kern_data_ptr;
if (sizeof(*data) < alloc_len) {
@@ -6822,8 +6817,6 @@ ctl_read_capacity_16(struct ctl_scsiio *
ctsio->kern_rel_offset = 0;
ctsio->kern_sg_entries = 0;
- memset(data, 0, sizeof(*data));
-
scsi_u64to8b(lun->be_lun->maxlba, data->addr);
/* XXX KDM this may not be 512 bytes... */
scsi_ulto4b(lun->be_lun->blocksize, data->length);
@@ -6913,8 +6906,7 @@ ctl_maintenance_in(struct ctl_scsiio *ct
alloc_len = scsi_4btoul(cdb->length);
- ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK);
- memset(ctsio->kern_data_ptr, 0, total_len);
+ ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO);
ctsio->kern_sg_entries = 0;
@@ -7068,7 +7060,7 @@ retry:
}
mtx_unlock(&softc->ctl_lock);
- ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK);
+ ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO);
if (total_len < alloc_len) {
ctsio->residual = alloc_len - total_len;
@@ -7084,8 +7076,6 @@ retry:
ctsio->kern_rel_offset = 0;
ctsio->kern_sg_entries = 0;
- memset(ctsio->kern_data_ptr, 0, total_len);
-
mtx_lock(&softc->ctl_lock);
switch (cdb->action) {
case SPRI_RK: { // read keys
@@ -8611,7 +8601,7 @@ ctl_report_luns(struct ctl_scsiio *ctsio
lun_datalen = sizeof(*lun_data) +
(num_luns * sizeof(struct scsi_report_luns_lundata));
- ctsio->kern_data_ptr = malloc(lun_datalen, M_CTL, M_WAITOK);
+ ctsio->kern_data_ptr = malloc(lun_datalen, M_CTL, M_WAITOK | M_ZERO);
lun_data = (struct scsi_report_luns_data *)ctsio->kern_data_ptr;
ctsio->kern_sg_entries = 0;
@@ -8630,8 +8620,6 @@ ctl_report_luns(struct ctl_scsiio *ctsio
initidx = ctl_get_initindex(&ctsio->io_hdr.nexus);
- memset(lun_data, 0, lun_datalen);
-
/*
* We set this to the actual data length, regardless of how much
* space we actually have to return results. If the user looks at
@@ -8907,7 +8895,7 @@ ctl_inquiry_evpd_supported(struct ctl_sc
* XXX KDM GFP_??? We probably don't want to wait here,
* unless we end up having a process/thread context.
*/
- ctsio->kern_data_ptr = malloc(sup_page_size, M_CTL, M_WAITOK);
+ ctsio->kern_data_ptr = malloc(sup_page_size, M_CTL, M_WAITOK | M_ZERO);
if (ctsio->kern_data_ptr == NULL) {
ctsio->io_hdr.status = CTL_SCSI_ERROR;
ctsio->scsi_status = SCSI_STATUS_BUSY;
@@ -8930,8 +8918,6 @@ ctl_inquiry_evpd_supported(struct ctl_sc
ctsio->kern_rel_offset = 0;
ctsio->kern_sg_entries = 0;
- memset(pages, 0, sup_page_size);
-
/*
* The control device is always connected. The disk device, on the
* other hand, may not be online all the time. Need to change this
@@ -8971,7 +8957,7 @@ ctl_inquiry_evpd_serial(struct ctl_scsii
lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr;
/* XXX KDM which malloc flags here?? */
- ctsio->kern_data_ptr = malloc(sizeof(*sn_ptr), M_CTL, M_WAITOK);
+ ctsio->kern_data_ptr = malloc(sizeof(*sn_ptr), M_CTL, M_WAITOK | M_ZERO);
if (ctsio->kern_data_ptr == NULL) {
ctsio->io_hdr.status = CTL_SCSI_ERROR;
ctsio->scsi_status = SCSI_STATUS_BUSY;
@@ -8994,8 +8980,6 @@ ctl_inquiry_evpd_serial(struct ctl_scsii
ctsio->kern_rel_offset = 0;
ctsio->kern_sg_entries = 0;
- memset(sn_ptr, 0, sizeof(*sn_ptr));
-
/*
* The control device is always connected. The disk device, on the
* other hand, may not be online all the time. Need to change this
@@ -9065,7 +9049,7 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio
sizeof(struct scsi_vpd_id_trgt_port_grp_id);
/* XXX KDM which malloc flags here ?? */
- ctsio->kern_data_ptr = malloc(devid_len, M_CTL, M_WAITOK);
+ ctsio->kern_data_ptr = malloc(devid_len, M_CTL, M_WAITOK | M_ZERO);
if (ctsio->kern_data_ptr == NULL) {
ctsio->io_hdr.status = CTL_SCSI_ERROR;
ctsio->scsi_status = SCSI_STATUS_BUSY;
@@ -9096,7 +9080,6 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio
CTL_WWPN_LEN);
desc3 = (struct scsi_vpd_id_descriptor *)(&desc2->identifier[0] +
sizeof(struct scsi_vpd_id_rel_trgt_port_id));
- memset(devid_ptr, 0, devid_len);
/*
* The control device is always connected. The disk device, on the
@@ -9296,7 +9279,7 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio
* that much.
*/
/* XXX KDM what malloc flags should we use here?? */
- ctsio->kern_data_ptr = malloc(sizeof(*inq_ptr), M_CTL, M_WAITOK);
+ ctsio->kern_data_ptr = malloc(sizeof(*inq_ptr), M_CTL, M_WAITOK | M_ZERO);
if (ctsio->kern_data_ptr == NULL) {
ctsio->io_hdr.status = CTL_SCSI_ERROR;
ctsio->scsi_status = SCSI_STATUS_BUSY;
@@ -9318,8 +9301,6 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio
ctsio->kern_total_len = alloc_len;
}
- memset(inq_ptr, 0, sizeof(*inq_ptr));
-
/*
* If we have a LUN configured, report it as connected. Otherwise,
* report that it is offline or no device is supported, depending
Modified: user/andre/tcp_workqueue/sys/cam/ctl/ctl_backend_block.c
==============================================================================
--- user/andre/tcp_workqueue/sys/cam/ctl/ctl_backend_block.c Fri Nov 2 21:07:30 2012 (r242493)
+++ user/andre/tcp_workqueue/sys/cam/ctl/ctl_backend_block.c Fri Nov 2 21:11:56 2012 (r242494)
@@ -376,7 +376,6 @@ ctl_grow_beio(struct ctl_be_block_softc
beio = (struct ctl_be_block_io *)malloc(sizeof(*beio),
M_CTLBLK,
M_WAITOK | M_ZERO);
- bzero(beio, sizeof(*beio));
beio->softc = softc;
mtx_lock(&softc->lock);
STAILQ_INSERT_TAIL(&softc->beio_free_queue, beio, links);
Modified: user/andre/tcp_workqueue/sys/cam/scsi/scsi_da.c
==============================================================================
--- user/andre/tcp_workqueue/sys/cam/scsi/scsi_da.c Fri Nov 2 21:07:30 2012 (r242493)
+++ user/andre/tcp_workqueue/sys/cam/scsi/scsi_da.c Fri Nov 2 21:11:56 2012 (r242494)
@@ -2673,6 +2673,7 @@ dasetgeom(struct cam_periph *periph, uin
struct da_softc *softc;
struct disk_params *dp;
u_int lbppbe, lalba;
+ int error;
softc = (struct da_softc *)periph->softc;
@@ -2779,10 +2780,9 @@ dasetgeom(struct cam_periph *periph, uin
else
softc->disk->d_flags &= ~DISKFLAG_CANDELETE;
-/* Currently as of 6/13/2012, panics if DIAGNOSTIC is set */
-#ifndef DIAGNOSTIC
- disk_resize(softc->disk);
-#endif
+ error = disk_resize(softc->disk, M_NOWAIT);
+ if (error != 0)
+ xpt_print(periph->path, "disk_resize(9) failed, error = %d\n", error);
}
static void
Modified: user/andre/tcp_workqueue/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
==============================================================================
--- user/andre/tcp_workqueue/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Fri Nov 2 21:07:30 2012 (r242493)
+++ user/andre/tcp_workqueue/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Fri Nov 2 21:11:56 2012 (r242494)
@@ -332,7 +332,7 @@ vdev_geom_attach_taster(struct g_consume
}
static void
-vdev_geom_dettach_taster(struct g_consumer *cp)
+vdev_geom_detach_taster(struct g_consumer *cp)
{
g_access(cp, -1, 0, 0);
g_detach(cp);
@@ -373,7 +373,7 @@ vdev_geom_read_pool_label(const char *na
g_topology_unlock();
error = vdev_geom_read_config(zcp, &vdev_cfg);
g_topology_lock();
- vdev_geom_dettach_taster(zcp);
+ vdev_geom_detach_taster(zcp);
if (error)
continue;
ZFS_LOG(1, "successfully read vdev config");
@@ -442,7 +442,7 @@ vdev_geom_attach_by_guid(uint64_t guid)
g_topology_unlock();
pguid = vdev_geom_read_guid(zcp);
g_topology_lock();
- vdev_geom_dettach_taster(zcp);
+ vdev_geom_detach_taster(zcp);
if (pguid != guid)
continue;
cp = vdev_geom_attach(pp);
Modified: user/andre/tcp_workqueue/sys/compat/linux/linux_misc.c
==============================================================================
--- user/andre/tcp_workqueue/sys/compat/linux/linux_misc.c Fri Nov 2 21:07:30 2012 (r242493)
+++ user/andre/tcp_workqueue/sys/compat/linux/linux_misc.c Fri Nov 2 21:11:56 2012 (r242494)
@@ -246,8 +246,7 @@ linux_uselib(struct thread *td, struct l
unsigned long bss_size;
char *library;
ssize_t aresid;
- int error;
- int locked;
+ int error, locked, writecount;
LCONVPATHEXIST(td, args->library, &library);
@@ -277,7 +276,10 @@ linux_uselib(struct thread *td, struct l
locked = 1;
/* Writable? */
- if (vp->v_writecount) {
+ error = VOP_GET_WRITECOUNT(vp, &writecount);
+ if (error != 0)
+ goto cleanup;
+ if (writecount != 0) {
error = ETXTBSY;
goto cleanup;
}
Modified: user/andre/tcp_workqueue/sys/conf/NOTES
==============================================================================
--- user/andre/tcp_workqueue/sys/conf/NOTES Fri Nov 2 21:07:30 2012 (r242493)
+++ user/andre/tcp_workqueue/sys/conf/NOTES Fri Nov 2 21:11:56 2012 (r242494)
@@ -389,6 +389,16 @@ options GDB
options SYSCTL_DEBUG
#
+# Enable textdump by default, this disables kernel core dumps.
+#
+options TEXTDUMP_PREFERRED
+
+#
+# Enable extra debug messages while performing textdumps.
+#
+options TEXTDUMP_VERBOSE
+
+#
# NO_SYSCTL_DESCR omits the sysctl node descriptions to save space in the
# resulting kernel.
options NO_SYSCTL_DESCR
@@ -2142,12 +2152,6 @@ device ral # Ralink Technology RT2500
# This option requires the TI_SF_BUF_JUMBO option above.
#options TI_JUMBO_HDRSPLIT
-#
-# Use header splitting feature on bce(4) adapters.
-# This may help to reduce the amount of jumbo-sized memory buffers used.
-#
-options BCE_JUMBO_HDRSPLIT
-
# These two options allow manipulating the mbuf cluster size and mbuf size,
# respectively. Be very careful with NIC driver modules when changing
# these from their default values, because that can potentially cause a
Modified: user/andre/tcp_workqueue/sys/conf/options
==============================================================================
--- user/andre/tcp_workqueue/sys/conf/options Fri Nov 2 21:07:30 2012 (r242493)
+++ user/andre/tcp_workqueue/sys/conf/options Fri Nov 2 21:11:56 2012 (r242494)
@@ -61,6 +61,8 @@ KDB_TRACE opt_kdb.h
KDB_UNATTENDED opt_kdb.h
KLD_DEBUG opt_kld.h
SYSCTL_DEBUG opt_sysctl.h
+TEXTDUMP_PREFERRED opt_ddb.h
+TEXTDUMP_VERBOSE opt_ddb.h
# Miscellaneous options.
ADAPTIVE_LOCKMGRS
@@ -523,7 +525,6 @@ SOCKET_SEND_COW opt_zero.h
SOCKET_RECV_PFLIP opt_zero.h
TI_SF_BUF_JUMBO opt_ti.h
TI_JUMBO_HDRSPLIT opt_ti.h
-BCE_JUMBO_HDRSPLIT opt_bce.h
# XXX Conflict: # of devices vs network protocol (Native ATM).
# This makes "atm.h" unusable.
Modified: user/andre/tcp_workqueue/sys/contrib/octeon-sdk/cvmx-helper-board.c
==============================================================================
--- user/andre/tcp_workqueue/sys/contrib/octeon-sdk/cvmx-helper-board.c Fri Nov 2 21:07:30 2012 (r242493)
+++ user/andre/tcp_workqueue/sys/contrib/octeon-sdk/cvmx-helper-board.c Fri Nov 2 21:11:56 2012 (r242494)
@@ -451,6 +451,12 @@ int cvmx_helper_board_get_mii_address(in
return ipd_port+1;
else
return -1;
+ case CVMX_BOARD_TYPE_EBT5600:
+ /* Board has 1 management port */
+ if (ipd_port == CVMX_HELPER_BOARD_MGMT_IPD_PORT)
+ return 0;
+ /* Board has 1 XAUI port connected to a switch. */
+ return -1;
case CVMX_BOARD_TYPE_EBB5600:
{
static unsigned char qlm_switch_addr = 0;
@@ -990,6 +996,7 @@ cvmx_helper_link_info_t __cvmx_helper_bo
}
/* Fall through to the generic code below */
break;
+ case CVMX_BOARD_TYPE_EBT5600:
case CVMX_BOARD_TYPE_EBH5600:
case CVMX_BOARD_TYPE_EBH5601:
case CVMX_BOARD_TYPE_EBH5610:
@@ -1289,6 +1296,11 @@ int __cvmx_helper_board_interface_probe(
return 0;
#endif
break;
+ case CVMX_BOARD_TYPE_EBT5600:
+ /* Disable loopback. */
+ if (interface == 3)
+ return 0;
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
More information about the svn-src-user
mailing list