Date: Sat, 24 Oct 2009 07:36:00 GMT From: Alexander Motin <mav@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 169749 for review Message-ID: <200910240736.n9O7a0OE048026@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/chv.cgi?CH=169749 Change 169749 by mav@mav_mavbook on 2009/10/24 07:35:07 IFC Affected files ... .. //depot/projects/scottl-camlock/src/lib/libc/gen/wordexp.c#2 integrate .. //depot/projects/scottl-camlock/src/lib/libpmc/libpmc.c#5 integrate .. //depot/projects/scottl-camlock/src/sys/amd64/acpica/acpi_wakecode.S#4 integrate .. //depot/projects/scottl-camlock/src/sys/boot/i386/zfsboot/zfsboot.c#4 integrate .. //depot/projects/scottl-camlock/src/sys/boot/zfs/zfs.c#2 integrate .. //depot/projects/scottl-camlock/src/sys/boot/zfs/zfsimpl.c#3 integrate .. //depot/projects/scottl-camlock/src/sys/cddl/boot/zfs/zfsimpl.h#3 integrate .. //depot/projects/scottl-camlock/src/sys/contrib/dev/iwn/LICENSE#2 integrate .. //depot/projects/scottl-camlock/src/sys/contrib/dev/iwn/iwlwifi-4965-228.57.2.23.fw.uu#1 branch .. //depot/projects/scottl-camlock/src/sys/contrib/dev/iwn/iwlwifi-4965-4.44.17.fw.uu#2 delete .. //depot/projects/scottl-camlock/src/sys/contrib/dev/iwn/iwlwifi-5000-5.4.A.11.fw.uu#1 branch .. //depot/projects/scottl-camlock/src/sys/contrib/dev/iwn/iwlwifi-5150-8.24.2.2.fw.uu#1 branch .. //depot/projects/scottl-camlock/src/sys/dev/fb/vesa.c#5 integrate .. //depot/projects/scottl-camlock/src/sys/dev/fb/vesa.h#2 integrate .. //depot/projects/scottl-camlock/src/sys/dev/hwpmc/hwpmc_core.c#4 integrate .. //depot/projects/scottl-camlock/src/sys/dev/iwn/if_iwn.c#6 integrate .. //depot/projects/scottl-camlock/src/sys/dev/iwn/if_iwnreg.h#2 integrate .. //depot/projects/scottl-camlock/src/sys/dev/iwn/if_iwnvar.h#3 integrate .. //depot/projects/scottl-camlock/src/sys/dev/pci/pci.c#27 integrate .. //depot/projects/scottl-camlock/src/sys/dev/siis/siis.c#10 integrate .. //depot/projects/scottl-camlock/src/sys/dev/syscons/syscons.c#20 integrate .. //depot/projects/scottl-camlock/src/sys/kern/kern_exec.c#23 integrate .. //depot/projects/scottl-camlock/src/sys/kern/kern_ktrace.c#19 integrate .. //depot/projects/scottl-camlock/src/sys/kern/kern_shutdown.c#19 integrate .. //depot/projects/scottl-camlock/src/sys/kern/subr_bus.c#36 integrate .. //depot/projects/scottl-camlock/src/sys/kern/subr_taskqueue.c#13 integrate .. //depot/projects/scottl-camlock/src/sys/modules/iwnfw/Makefile#2 integrate .. //depot/projects/scottl-camlock/src/sys/net/bpf.c#26 integrate .. //depot/projects/scottl-camlock/src/sys/netinet/if_ether.c#28 integrate .. //depot/projects/scottl-camlock/src/sys/netinet/in.c#28 integrate .. //depot/projects/scottl-camlock/src/sys/netinet6/in6.c#30 integrate .. //depot/projects/scottl-camlock/src/sys/powerpc/aim/clock.c#4 integrate .. //depot/projects/scottl-camlock/src/sys/powerpc/aim/machdep.c#6 integrate .. //depot/projects/scottl-camlock/src/sys/powerpc/aim/mp_cpudep.c#5 integrate .. //depot/projects/scottl-camlock/src/sys/sys/interrupt.h#16 integrate .. //depot/projects/scottl-camlock/src/sys/sys/ktrace.h#7 integrate .. //depot/projects/scottl-camlock/src/tools/regression/lib/libc/gen/test-wordexp.c#3 integrate Differences ... ==== //depot/projects/scottl-camlock/src/lib/libc/gen/wordexp.c#2 (text+ko) ==== @@ -28,8 +28,10 @@ #include <sys/cdefs.h> #include <sys/types.h> #include <sys/wait.h> +#include <errno.h> #include <fcntl.h> #include <paths.h> +#include <signal.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -37,7 +39,7 @@ #include <wordexp.h> #include "un-namespace.h" -__FBSDID("$FreeBSD: src/lib/libc/gen/wordexp.c,v 1.6 2004/06/30 13:55:08 tjr Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/gen/wordexp.c,v 1.7 2009/10/23 14:50:11 jilles Exp $"); static int we_askshell(const char *, wordexp_t *, int); static int we_check(const char *, int); @@ -73,6 +75,24 @@ return (0); } +static size_t +we_read_fully(int fd, char *buffer, size_t len) +{ + size_t done; + ssize_t nread; + + done = 0; + do { + nread = _read(fd, buffer + done, len - done); + if (nread == -1 && errno == EINTR) + continue; + if (nread <= 0) + break; + done += nread; + } while (done != len); + return done; +} + /* * we_askshell -- * Use the `wordexp' /bin/sh builtin function to do most of the work @@ -90,20 +110,31 @@ size_t sofs; /* Offset into we->we_strings */ size_t vofs; /* Offset into we->we_wordv */ pid_t pid; /* Process ID of child */ + pid_t wpid; /* waitpid return value */ int status; /* Child exit status */ + int error; /* Our return value */ + int serrno; /* errno to return */ char *ifs; /* IFS env. var. */ char *np, *p; /* Handy pointers */ char *nstrings; /* Temporary for realloc() */ char **nwv; /* Temporary for realloc() */ + sigset_t newsigblock, oldsigblock; + serrno = errno; if ((ifs = getenv("IFS")) == NULL) ifs = " \t\n"; if (pipe(pdes) < 0) return (WRDE_NOSPACE); /* XXX */ + (void)sigemptyset(&newsigblock); + (void)sigaddset(&newsigblock, SIGCHLD); + (void)_sigprocmask(SIG_BLOCK, &newsigblock, &oldsigblock); if ((pid = fork()) < 0) { + serrno = errno; _close(pdes[0]); _close(pdes[1]); + (void)_sigprocmask(SIG_SETMASK, &oldsigblock, NULL); + errno = serrno; return (WRDE_NOSPACE); /* XXX */ } else if (pid == 0) { @@ -114,6 +145,7 @@ int devnull; char *cmd; + (void)_sigprocmask(SIG_SETMASK, &oldsigblock, NULL); _close(pdes[0]); if (_dup2(pdes[1], STDOUT_FILENO) < 0) _exit(1); @@ -139,10 +171,11 @@ * the expanded words separated by nulls. */ _close(pdes[1]); - if (_read(pdes[0], wbuf, 8) != 8 || _read(pdes[0], bbuf, 8) != 8) { - _close(pdes[0]); - _waitpid(pid, &status, 0); - return (flags & WRDE_UNDEF ? WRDE_BADVAL : WRDE_SYNTAX); + if (we_read_fully(pdes[0], wbuf, 8) != 8 || + we_read_fully(pdes[0], bbuf, 8) != 8) { + error = flags & WRDE_UNDEF ? WRDE_BADVAL : WRDE_SYNTAX; + serrno = errno; + goto cleanup; } wbuf[8] = bbuf[8] = '\0'; nwords = strtol(wbuf, NULL, 16); @@ -162,33 +195,38 @@ if ((nwv = realloc(we->we_wordv, (we->we_wordc + 1 + (flags & WRDE_DOOFFS ? we->we_offs : 0)) * sizeof(char *))) == NULL) { - _close(pdes[0]); - _waitpid(pid, &status, 0); - return (WRDE_NOSPACE); + error = WRDE_NOSPACE; + goto cleanup; } we->we_wordv = nwv; if ((nstrings = realloc(we->we_strings, we->we_nbytes)) == NULL) { - _close(pdes[0]); - _waitpid(pid, &status, 0); - return (WRDE_NOSPACE); + error = WRDE_NOSPACE; + goto cleanup; } for (i = 0; i < vofs; i++) if (we->we_wordv[i] != NULL) we->we_wordv[i] += nstrings - we->we_strings; we->we_strings = nstrings; - if (_read(pdes[0], we->we_strings + sofs, nbytes) != nbytes) { - _close(pdes[0]); - _waitpid(pid, &status, 0); - return (flags & WRDE_UNDEF ? WRDE_BADVAL : WRDE_SYNTAX); + if (we_read_fully(pdes[0], we->we_strings + sofs, nbytes) != nbytes) { + error = flags & WRDE_UNDEF ? WRDE_BADVAL : WRDE_SYNTAX; + serrno = errno; + goto cleanup; } - if (_waitpid(pid, &status, 0) < 0 || !WIFEXITED(status) || - WEXITSTATUS(status) != 0) { - _close(pdes[0]); + error = 0; +cleanup: + _close(pdes[0]); + do + wpid = _waitpid(pid, &status, 0); + while (wpid < 0 && errno == EINTR); + (void)_sigprocmask(SIG_SETMASK, &oldsigblock, NULL); + if (error != 0) { + errno = serrno; + return (error); + } + if (wpid < 0 || !WIFEXITED(status) || WEXITSTATUS(status) != 0) return (flags & WRDE_UNDEF ? WRDE_BADVAL : WRDE_SYNTAX); - } - _close(pdes[0]); /* * Break the null-terminated expanded word strings out into ==== //depot/projects/scottl-camlock/src/lib/libpmc/libpmc.c#5 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/lib/libpmc/libpmc.c,v 1.21 2009/06/09 06:34:48 jkoshy Exp $"); +__FBSDID("$FreeBSD: src/lib/libpmc/libpmc.c,v 1.22 2009/10/24 04:11:40 jkoshy Exp $"); #include <sys/types.h> #include <sys/module.h> @@ -442,6 +442,10 @@ /* * Intel Core2 (Family 6, Model F), Core2Extreme (Family 6, Model 17H) * and Atom (Family 6, model 1CH) PMCs. + * + * We map aliases to events on the fixed-function counters if these + * are present. Note that not all CPUs in this family contain fixed-function + * counters. */ static struct pmc_event_alias core2_aliases[] = { @@ -454,8 +458,22 @@ EV_ALIAS("unhalted-cycles", "iaf-cpu-clk-unhalted.core"), EV_ALIAS(NULL, NULL) }; -#define atom_aliases core2_aliases -#define corei7_aliases core2_aliases + +static struct pmc_event_alias core2_aliases_without_iaf[] = { + EV_ALIAS("branches", "iap-br-inst-retired.any"), + EV_ALIAS("branch-mispredicts", "iap-br-inst-retired.mispred"), + EV_ALIAS("cycles", "tsc-tsc"), + EV_ALIAS("ic-misses", "iap-l1i-misses"), + EV_ALIAS("instructions", "iap-inst-retired.any_p"), + EV_ALIAS("interrupts", "iap-hw-int-rcv"), + EV_ALIAS("unhalted-cycles", "iap-cpu-clk-unhalted.core_p"), + EV_ALIAS(NULL, NULL) +}; + +#define atom_aliases core2_aliases +#define atom_aliases_without_iaf core2_aliases_without_iaf +#define corei7_aliases core2_aliases +#define corei7_aliases_without_iaf core2_aliases_without_iaf #define IAF_KW_OS "os" #define IAF_KW_USR "usr" @@ -2379,6 +2397,10 @@ uint32_t abi_version; struct module_stat pmc_modstat; struct pmc_op_getcpuinfo op_cpu_info; +#if defined(__amd64__) || defined(__i386__) + int cpu_has_iaf_counters; + unsigned int t; +#endif if (pmc_syscall != -1) /* already inited */ return (0); @@ -2420,6 +2442,8 @@ if (pmc_class_table == NULL) return (-1); + for (n = 0; n < PMC_CLASS_TABLE_SIZE; n++) + pmc_class_table[n] = NULL; /* * Fill in the class table. @@ -2427,6 +2451,14 @@ n = 0; #if defined(__amd64__) || defined(__i386__) pmc_class_table[n++] = &tsc_class_table_descr; + + /* + * Check if this CPU has fixed function counters. + */ + cpu_has_iaf_counters = 0; + for (t = 0; t < cpu_info.pm_nclass; t++) + if (cpu_info.pm_classes[t].pm_class == PMC_CLASS_IAF) + cpu_has_iaf_counters = 1; #endif #define PMC_MDEP_INIT(C) do { \ @@ -2436,6 +2468,16 @@ PMC_TABLE_SIZE(C##_pmc_classes); \ } while (0) +#define PMC_MDEP_INIT_INTEL_V2(C) do { \ + PMC_MDEP_INIT(C); \ + if (cpu_has_iaf_counters) \ + pmc_class_table[n++] = &iaf_class_table_descr; \ + else \ + pmc_mdep_event_aliases = \ + C##_aliases_without_iaf; \ + pmc_class_table[n] = &C##_class_table_descr; \ + } while (0) + /* Configure the event name parser. */ switch (cpu_info.pm_cputype) { #if defined(__i386__) @@ -2461,24 +2503,17 @@ pmc_class_table[n] = &k8_class_table_descr; break; case PMC_CPU_INTEL_ATOM: - PMC_MDEP_INIT(atom); - pmc_class_table[n++] = &iaf_class_table_descr; - pmc_class_table[n] = &atom_class_table_descr; + PMC_MDEP_INIT_INTEL_V2(atom); break; case PMC_CPU_INTEL_CORE: PMC_MDEP_INIT(core); - pmc_class_table[n] = &core_class_table_descr; break; case PMC_CPU_INTEL_CORE2: case PMC_CPU_INTEL_CORE2EXTREME: - PMC_MDEP_INIT(core2); - pmc_class_table[n++] = &iaf_class_table_descr; - pmc_class_table[n] = &core2_class_table_descr; + PMC_MDEP_INIT_INTEL_V2(core2); break; case PMC_CPU_INTEL_COREI7: - PMC_MDEP_INIT(corei7); - pmc_class_table[n++] = &iaf_class_table_descr; - pmc_class_table[n] = &corei7_class_table_descr; + PMC_MDEP_INIT_INTEL_V2(corei7); break; case PMC_CPU_INTEL_PIV: PMC_MDEP_INIT(p4); ==== //depot/projects/scottl-camlock/src/sys/amd64/acpica/acpi_wakecode.S#4 (text+ko) ==== @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/amd64/acpica/acpi_wakecode.S,v 1.4 2009/10/08 17:41:53 jkim Exp $ + * $FreeBSD: src/sys/amd64/acpica/acpi_wakecode.S,v 1.5 2009/10/23 18:57:52 jkim Exp $ */ #define LOCORE @@ -88,6 +88,11 @@ movb $0, reset_video - wakeup_start lcall $0xc000, $3 + /* When we reach here, int 0x10 should be ready. Hide cursor. */ + movb $0x01, %ah + movb $0x20, %ch + int $0x10 + /* Re-start in case the previous BIOS call clobbers them. */ jmp wakeup_start 1: ==== //depot/projects/scottl-camlock/src/sys/boot/i386/zfsboot/zfsboot.c#4 (text+ko) ==== @@ -14,7 +14,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/boot/i386/zfsboot/zfsboot.c,v 1.4 2009/10/14 14:13:42 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/i386/zfsboot/zfsboot.c,v 1.5 2009/10/23 18:44:53 rnoland Exp $"); #include <sys/param.h> #include <sys/errno.h> @@ -474,6 +474,7 @@ slba = hdr.hdr_lba_table; elba = slba + hdr.hdr_entries / entries_per_sec; while (slba < elba) { + dsk->start = 0; if (drvread(dsk, sec, slba, 1)) return; for (part = 0; part < entries_per_sec; part++) { @@ -494,7 +495,6 @@ */ dsk = copy_dsk(dsk); } - break; } } slba++; @@ -857,12 +857,13 @@ printf(const char *fmt,...) { va_list ap; - char buf[10]; + char buf[20]; char *s; - unsigned u; + unsigned long long u; int c; int minus; int prec; + int l; int len; int pad; @@ -871,6 +872,7 @@ if (c == '%') { minus = 0; prec = 0; + l = 0; nextfmt: c = *fmt++; switch (c) { @@ -892,6 +894,9 @@ case 'c': putchar(va_arg(ap, int)); continue; + case 'l': + l++; + goto nextfmt; case 's': s = va_arg(ap, char *); if (prec) { @@ -914,7 +919,17 @@ } continue; case 'u': - u = va_arg(ap, unsigned); + switch (l) { + case 2: + u = va_arg(ap, unsigned long long); + break; + case 1: + u = va_arg(ap, unsigned long); + break; + default: + u = va_arg(ap, unsigned); + break; + } s = buf; do *s++ = '0' + u % 10U; ==== //depot/projects/scottl-camlock/src/sys/boot/zfs/zfs.c#2 (text+ko) ==== @@ -23,11 +23,11 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/boot/zfs/zfs.c,v 1.4 2008/12/11 16:48:35 ps Exp $ + * $FreeBSD: src/sys/boot/zfs/zfs.c,v 1.5 2009/10/23 18:44:53 rnoland Exp $ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/boot/zfs/zfs.c,v 1.4 2008/12/11 16:48:35 ps Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/zfs/zfs.c,v 1.5 2009/10/23 18:44:53 rnoland Exp $"); /* * Stand-alone file reading package. @@ -100,7 +100,7 @@ f->f_fsdata = (void *)fp; if (spa->spa_root_objset.os_type != DMU_OST_ZFS) { - printf("Unexpected object set type %lld\n", + printf("Unexpected object set type %llu\n", spa->spa_root_objset.os_type); rc = EIO; goto out; @@ -413,7 +413,7 @@ if (vdev_probe(vdev_read, (void*) (uintptr_t) fd, 0)) close(fd); - for (slice = 1; slice <= 4; slice++) { + for (slice = 1; slice <= 128; slice++) { sprintf(devname, "disk%dp%d:", unit, slice); fd = open(devname, O_RDONLY); if (fd == -1) { ==== //depot/projects/scottl-camlock/src/sys/boot/zfs/zfsimpl.c#3 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/boot/zfs/zfsimpl.c,v 1.5 2009/05/16 10:48:20 dfr Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/zfs/zfsimpl.c,v 1.6 2009/10/23 18:44:53 rnoland Exp $"); /* * Stand-alone ZFS file reader. @@ -53,6 +53,8 @@ #define TEMP_SIZE (1*SPA_MAXBLOCKSIZE) +static int zio_read(spa_t *spa, const blkptr_t *bp, void *buf); + static void zfs_init(void) { @@ -897,6 +899,33 @@ } static int +zio_read_gang(spa_t *spa, const blkptr_t *bp, const dva_t *dva, void *buf) +{ + zio_gbh_phys_t zio_gb; + vdev_t *vdev; + int vdevid; + off_t offset; + int i; + + vdevid = DVA_GET_VDEV(dva); + offset = DVA_GET_OFFSET(dva); + STAILQ_FOREACH(vdev, &spa->spa_vdevs, v_childlink) + if (vdev->v_id == vdevid) + break; + if (!vdev || !vdev->v_read) + return (EIO); + if (vdev->v_read(vdev, bp, &zio_gb, offset, SPA_GANGBLOCKSIZE)) + return (EIO); + + for (i = 0; i < SPA_GBH_NBLKPTRS; i++) { + if (zio_read(spa, &zio_gb.zg_blkptr[i], buf)) + return (EIO); + } + + return (0); +} + +static int zio_read(spa_t *spa, const blkptr_t *bp, void *buf) { int cpfunc = BP_GET_COMPRESS(bp); @@ -920,20 +949,27 @@ if (!dva->dva_word[0] && !dva->dva_word[1]) continue; - vdevid = DVA_GET_VDEV(dva); - offset = DVA_GET_OFFSET(dva); - STAILQ_FOREACH(vdev, &spa->spa_vdevs, v_childlink) - if (vdev->v_id == vdevid) - break; - if (!vdev || !vdev->v_read) - continue; - if (vdev->v_read(vdev, bp, pbuf, offset, psize)) - continue; + if (DVA_GET_GANG(dva)) { + printf("ZFS: gang block detected!\n"); + if (zio_read_gang(spa, bp, dva, buf)) + return (EIO); + } else { + vdevid = DVA_GET_VDEV(dva); + offset = DVA_GET_OFFSET(dva); + STAILQ_FOREACH(vdev, &spa->spa_vdevs, v_childlink) + if (vdev->v_id == vdevid) + break; + if (!vdev || !vdev->v_read) { + continue; + } + if (vdev->v_read(vdev, bp, pbuf, offset, psize)) + continue; - if (cpfunc != ZIO_COMPRESS_OFF) { - if (zio_decompress_data(cpfunc, pbuf, psize, - buf, lsize)) - return (EIO); + if (cpfunc != ZIO_COMPRESS_OFF) { + if (zio_decompress_data(cpfunc, pbuf, psize, + buf, lsize)) + return (EIO); + } } return (0); @@ -1331,13 +1367,13 @@ dsl_dataset_phys_t *ds; if (objset_get_dnode(spa, &spa->spa_mos, objnum, &dataset)) { - printf("ZFS: can't find dataset %lld\n", objnum); + printf("ZFS: can't find dataset %llu\n", objnum); return (EIO); } ds = (dsl_dataset_phys_t *) &dataset.dn_bonus; if (zio_read(spa, &ds->ds_bp, objset)) { - printf("ZFS: can't read object set for dataset %lld\n", objnum); + printf("ZFS: can't read object set for dataset %llu\n", objnum); return (EIO); } @@ -1367,7 +1403,8 @@ */ if (zap_lookup(spa, &dir, DMU_POOL_PROPS, &props) == 0 && objset_get_dnode(spa, &spa->spa_mos, props, &propdir) == 0 - && zap_lookup(spa, &propdir, "bootfs", &bootfs) == 0) + && zap_lookup(spa, &propdir, "bootfs", &bootfs) == 0 + && bootfs != 0) return zfs_mount_dataset(spa, bootfs, objset); /* @@ -1425,7 +1462,7 @@ int symlinks_followed = 0; if (spa->spa_root_objset.os_type != DMU_OST_ZFS) { - printf("ZFS: unexpected object set type %lld\n", + printf("ZFS: unexpected object set type %llu\n", spa->spa_root_objset.os_type); return (EIO); } ==== //depot/projects/scottl-camlock/src/sys/cddl/boot/zfs/zfsimpl.h#3 (text+ko) ==== @@ -374,6 +374,24 @@ #define VDEV_LABEL_END_SIZE (2 * sizeof (vdev_label_t)) #define VDEV_LABELS 4 +/* + * Gang block headers are self-checksumming and contain an array + * of block pointers. + */ +#define SPA_GANGBLOCKSIZE SPA_MINBLOCKSIZE +#define SPA_GBH_NBLKPTRS ((SPA_GANGBLOCKSIZE - \ + sizeof (zio_block_tail_t)) / sizeof (blkptr_t)) +#define SPA_GBH_FILLER ((SPA_GANGBLOCKSIZE - \ + sizeof (zio_block_tail_t) - \ + (SPA_GBH_NBLKPTRS * sizeof (blkptr_t))) /\ + sizeof (uint64_t)) + +typedef struct zio_gbh { + blkptr_t zg_blkptr[SPA_GBH_NBLKPTRS]; + uint64_t zg_filler[SPA_GBH_FILLER]; + zio_block_tail_t zg_tail; +} zio_gbh_phys_t; + enum zio_checksum { ZIO_CHECKSUM_INHERIT = 0, ZIO_CHECKSUM_ON, ==== //depot/projects/scottl-camlock/src/sys/contrib/dev/iwn/LICENSE#2 (text+ko) ==== @@ -1,39 +1,39 @@ -Copyright (c) 2006, Intel Corporation. -All rights reserved. - -Redistribution. Redistribution and use in binary form, without -modification, are permitted provided that the following conditions are -met: - -* Redistributions must reproduce the above copyright notice and the - following disclaimer in the documentation and/or other materials - provided with the distribution. -* Neither the name of Intel Corporation nor the names of its suppliers - may be used to endorse or promote products derived from this software - without specific prior written permission. -* No reverse engineering, decompilation, or disassembly of this software - is permitted. - -Limited patent license. Intel Corporation grants a world-wide, -royalty-free, non-exclusive license under patents it now or hereafter -owns or controls to make, have made, use, import, offer to sell and -sell ("Utilize") this software, but solely to the extent that any -such patent is necessary to Utilize the software alone, or in -combination with an operating system licensed under an approved Open -Source license as listed by the Open Source Initiative at -http://opensource.org/licenses. The patent license shall not apply to -any other combinations which include this software. No hardware per -se is licensed hereunder. - -DISCLAIMER. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND -CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT OWNER 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. +Copyright (c) 2006-2009, Intel Corporation. +All rights reserved. + +Redistribution. Redistribution and use in binary form, without +modification, are permitted provided that the following conditions are +met: + +* Redistributions must reproduce the above copyright notice and the + following disclaimer in the documentation and/or other materials + provided with the distribution. +* Neither the name of Intel Corporation nor the names of its suppliers + may be used to endorse or promote products derived from this software + without specific prior written permission. +* No reverse engineering, decompilation, or disassembly of this software + is permitted. + +Limited patent license. Intel Corporation grants a world-wide, +royalty-free, non-exclusive license under patents it now or hereafter +owns or controls to make, have made, use, import, offer to sell and +sell ("Utilize") this software, but solely to the extent that any +such patent is necessary to Utilize the software alone, or in +combination with an operating system licensed under an approved Open +Source license as listed by the Open Source Initiative at +http://opensource.org/licenses. The patent license shall not apply to +any other combinations which include this software. No hardware per +se is licensed hereunder. + +DISCLAIMER. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER 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. ==== //depot/projects/scottl-camlock/src/sys/dev/fb/vesa.c#5 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/fb/vesa.c,v 1.12 2009/10/19 20:58:10 jkim Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/fb/vesa.c,v 1.14 2009/10/23 19:02:53 jkim Exp $"); #include "opt_vga.h" #include "opt_vesa.h" @@ -74,8 +74,7 @@ /* VESA video adapter */ static video_adapter_t *vesa_adp = NULL; -static int vesa_state_buf_size = 0; -#define VESA_BIOS_BUFSIZE (3 * PAGE_SIZE) +static ssize_t vesa_state_buf_size = -1; /* VESA functions */ #if 0 @@ -188,7 +187,7 @@ #define STATE_REG (1<<3) #define STATE_MOST (STATE_HW | STATE_DATA | STATE_REG) #define STATE_ALL (STATE_HW | STATE_DATA | STATE_DAC | STATE_REG) -static int vesa_bios_state_buf_size(void); +static ssize_t vesa_bios_state_buf_size(void); static int vesa_bios_save_restore(int code, void *p, size_t size); static int vesa_bios_get_line_length(void); static int vesa_bios_set_line_length(int pixel, int *bytes, int *lines); @@ -282,6 +281,10 @@ } regs.R_DL = 0x80; x86bios_call(®s, 0xc000, 0x0003); + + if (x86bios_get_intr(0x10) == 0) + return (1); + return (0); } @@ -532,7 +535,7 @@ } #endif -static int +static ssize_t vesa_bios_state_buf_size(void) { x86regs_t regs; @@ -557,9 +560,6 @@ uint32_t offs; void *buf; - if (size > VESA_BIOS_BUFSIZE) - return (1); - if (code != STATE_SAVE && code != STATE_LOAD) return (1); @@ -808,12 +808,11 @@ if (x86bios_get_intr(0x10) == 0) { if (vesa_bios_post() != 0) return (1); - offs = x86bios_get_intr(0x10); - if (offs == 0) - return (1); - if (bootverbose) + if (bootverbose) { + offs = x86bios_get_intr(0x10); printf("VESA: interrupt vector installed (0x%x)\n", BIOS_SADDRTOLADDR(offs)); + } } x86bios_init_regs(®s); @@ -879,6 +878,21 @@ if (vesa_bios_get_mode(vesa_vmodetab[i], &vmode)) continue; + vmode.v_modeattr = le16toh(vmode.v_modeattr); + vmode.v_wgran = le16toh(vmode.v_wgran); + vmode.v_wsize = le16toh(vmode.v_wsize); + vmode.v_waseg = le16toh(vmode.v_waseg); + vmode.v_wbseg = le16toh(vmode.v_wbseg); + vmode.v_posfunc = le32toh(vmode.v_posfunc); + vmode.v_bpscanline = le16toh(vmode.v_bpscanline); + vmode.v_width = le16toh(vmode.v_width); + vmode.v_height = le16toh(vmode.v_height); + vmode.v_lfb = le32toh(vmode.v_lfb); + vmode.v_offscreen = le32toh(vmode.v_offscreen); + vmode.v_offscreensize = le16toh(vmode.v_offscreensize); + vmode.v_linbpscanline = le16toh(vmode.v_linbpscanline); + vmode.v_maxpixelclock = le32toh(vmode.v_maxpixelclock); + /* reject unsupported modes */ #if 0 if ((vmode.v_modeattr & (V_MODESUPP | V_MODEOPTINFO @@ -1417,11 +1431,14 @@ if (adp != vesa_adp) return ((*prevvidsw->save_state)(adp, p, size)); - if (vesa_state_buf_size == 0) + if (vesa_state_buf_size == -1) { vesa_state_buf_size = vesa_bios_state_buf_size(); + if (vesa_state_buf_size == 0) + return (1); + } if (size == 0) - return (sizeof(int) + vesa_state_buf_size); - else if (size < (sizeof(int) + vesa_state_buf_size)) + return (offsetof(adp_state_t, regs) + vesa_state_buf_size); + else if (size < (offsetof(adp_state_t, regs) + vesa_state_buf_size)) return (1); ((adp_state_t *)p)->sig = V_STATE_SIG; @@ -1438,22 +1455,36 @@ if ((adp != vesa_adp) || (((adp_state_t *)p)->sig != V_STATE_SIG)) return ((*prevvidsw->load_state)(adp, p)); + if (vesa_state_buf_size <= 0) + return (1); + + /* + * If the current mode is not the same, probably it was powered down. + * Try BIOS POST to restore a sane state. + */ + mode = vesa_bios_get_current_mode(); + if (mode >= 0 && (mode & 0x1ff) != adp->va_mode && + VESA_MODE(adp->va_mode)) + (void)vesa_bios_post(); + ret = vesa_bios_save_restore(STATE_LOAD, ((adp_state_t *)p)->regs, vesa_state_buf_size); /* - * If the current mode is not restored properly, try BIOS POST and - * force setting the mode. + * If the desired mode is not restored, force setting the mode. */ - flags = adp->va_info.vi_flags; - if (!(flags & V_INFO_GRAPHICS)) - flags &= ~V_INFO_LINEAR; - mode = adp->va_mode | ((flags & V_INFO_LINEAR) ? 0x4000 : 0); - if (vesa_bios_get_current_mode() != mode && vesa_bios_post() == 0 && - x86bios_get_intr(0x10) != 0) { - int10_set_mode(adp->va_initial_bios_mode); - vesa_bios_set_mode(mode); + mode = vesa_bios_get_current_mode(); + if (mode >= 0 && (mode & 0x1ff) != adp->va_mode && + VESA_MODE(adp->va_mode)) { + mode = adp->va_mode; + flags = adp->va_info.vi_flags; + if ((flags & V_INFO_GRAPHICS) != 0 && + (flags & V_INFO_LINEAR) != 0) + mode |= 0x4000; + (void)vesa_bios_set_mode(mode); + (void)(*vidsw[adp->va_index]->set_hw_cursor)(adp, -1, -1); } + return (ret); } ==== //depot/projects/scottl-camlock/src/sys/dev/fb/vesa.h#2 (text+ko) ==== @@ -23,7 +23,7 @@ * (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: src/sys/dev/fb/vesa.h,v 1.2 2009/09/09 09:50:31 delphij Exp $ + * $FreeBSD: src/sys/dev/fb/vesa.h,v 1.3 2009/10/23 18:41:00 jkim Exp $ */ #ifndef _DEV_FB_VESA_H_ @@ -108,7 +108,21 @@ u_int32_t v_lfb; u_int32_t v_offscreen; u_int16_t v_offscreensize; -}; + /* 3.0 implementations */ + u_int16_t v_linbpscanline; + u_int8_t v_bankipages; + u_int8_t v_linipages; + u_int8_t v_linredmasksize; + u_int8_t v_linredfieldpos; + u_int8_t v_lingreenmasksize; + u_int8_t v_lingreenfieldpos; + u_int8_t v_linbluemasksize; + u_int8_t v_linbluefieldpos; + u_int8_t v_linresmasksize; + u_int8_t v_linresfieldpos; + u_int32_t v_maxpixelclock; + u_int8_t v_reserved1[190]; +} __packed; #ifdef _KERNEL ==== //depot/projects/scottl-camlock/src/sys/dev/hwpmc/hwpmc_core.c#4 (text+ko) ==== @@ -29,7 +29,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/hwpmc/hwpmc_core.c,v 1.6 2009/09/01 17:55:37 gnn Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/hwpmc/hwpmc_core.c,v 1.7 2009/10/24 01:58:10 jkoshy Exp $"); #include <sys/param.h> #include <sys/bus.h> @@ -1977,11 +1977,21 @@ core_iaf_npmc = cpuid[CORE_CPUID_EDX] & 0x1F; core_iaf_width = (cpuid[CORE_CPUID_EDX] >> 5) & 0xFF; - iaf_initialize(md, maxcpu, core_iaf_npmc, core_iaf_width); - - core_pmcmask |= ((1ULL << core_iaf_npmc) - 1) << - IAF_OFFSET; - + if (core_iaf_npmc > 0) { + iaf_initialize(md, maxcpu, core_iaf_npmc, + core_iaf_width); + core_pmcmask |= ((1ULL << core_iaf_npmc) - 1) << + IAF_OFFSET; + } else { + /* + * Adjust the number of classes exported to + * user space. + */ + md->pmd_nclass--; + KASSERT(md->pmd_nclass == 2, + ("[core,%d] unexpected nclass %d", __LINE__, + md->pmd_nclass)); + } } PMCDBG(MDP,INI,1,"core-init pmcmask=0x%jx iafri=%d", core_pmcmask, ==== //depot/projects/scottl-camlock/src/sys/dev/iwn/if_iwn.c#6 (text+ko) ==== @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2007 + * Copyright (c) 2007-2009 * Damien Bergamini <damien.bergamini@free.fr> * Copyright (c) 2008 * Benjamin Close <benjsc@FreeBSD.org> @@ -19,11 +19,12 @@ */ /* - * Driver for Intel Wireless WiFi Link 4965AGN 802.11 network adapters. + * Driver for Intel Wireless WiFi Link 4965 and Intel WiFi Link 5000 Series + * 802.11 network adapters. */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/iwn/if_iwn.c,v 1.18 2009/07/10 15:28:33 rpaulo Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/iwn/if_iwn.c,v 1.19 2009/10/23 22:04:18 rpaulo Exp $"); #include <sys/param.h> #include <sys/sockio.h> @@ -73,29 +74,28 @@ static int iwn_probe(device_t); static int iwn_attach(device_t); -static int iwn_detach(device_t); -static int iwn_cleanup(device_t); +const struct iwn_hal *iwn_hal_attach(struct iwn_softc *); +void iwn_radiotap_attach(struct iwn_softc *); static struct ieee80211vap *iwn_vap_create(struct ieee80211com *, const char name[IFNAMSIZ], int unit, int opmode, int flags, const uint8_t bssid[IEEE80211_ADDR_LEN], const uint8_t mac[IEEE80211_ADDR_LEN]); static void iwn_vap_delete(struct ieee80211vap *); -static int iwn_shutdown(device_t); -static int iwn_suspend(device_t); -static int iwn_resume(device_t); +static int iwn_cleanup(device_t); +static int iwn_detach(device_t); +int iwn_nic_lock(struct iwn_softc *); +int iwn_eeprom_lock(struct iwn_softc *); +int iwn_init_otprom(struct iwn_softc *); +int iwn_read_prom_data(struct iwn_softc *, uint32_t, void *, int); static int iwn_dma_contig_alloc(struct iwn_softc *, struct iwn_dma_info *, void **, bus_size_t, bus_size_t, int); static void iwn_dma_contig_free(struct iwn_dma_info *); >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200910240736.n9O7a0OE048026>