diff options
author | attilio <attilio@FreeBSD.org> | 2013-02-26 17:33:18 +0000 |
---|---|---|
committer | attilio <attilio@FreeBSD.org> | 2013-02-26 17:33:18 +0000 |
commit | afe5ce0c13a339718eedb08d875d136798499ad3 (patch) | |
tree | 20fe8e5e757f20a950dd317277daa575b44a5d5e | |
parent | e590e8091e823df34af5b8553df7832c49de0258 (diff) | |
download | FreeBSD-src-afe5ce0c13a339718eedb08d875d136798499ad3.zip FreeBSD-src-afe5ce0c13a339718eedb08d875d136798499ad3.tar.gz |
MFC
-rw-r--r-- | sys/arm/at91/at91_machdep.c | 1 | ||||
-rw-r--r-- | sys/arm/conf/RPI-B | 7 | ||||
-rw-r--r-- | sys/arm/include/vmparam.h | 6 | ||||
-rw-r--r-- | sys/arm/sa11x0/assabet_machdep.c | 1 | ||||
-rw-r--r-- | sys/boot/common/load_elf.c | 23 | ||||
-rw-r--r-- | sys/dev/ath/ath_rate/sample/sample.c | 43 | ||||
-rw-r--r-- | sys/dev/hwpmc/hwpmc_soft.c | 8 | ||||
-rw-r--r-- | sys/fs/fuse/fuse_io.c | 1 | ||||
-rw-r--r-- | sys/sys/time.h | 5 | ||||
-rw-r--r-- | sys/vm/vm_object.c | 2 | ||||
-rw-r--r-- | usr.bin/truss/main.c | 8 | ||||
-rw-r--r-- | usr.bin/truss/syscalls.c | 10 | ||||
-rw-r--r-- | usr.bin/truss/truss.h | 4 |
13 files changed, 77 insertions, 42 deletions
diff --git a/sys/arm/at91/at91_machdep.c b/sys/arm/at91/at91_machdep.c index 27e8844..3837cbd 100644 --- a/sys/arm/at91/at91_machdep.c +++ b/sys/arm/at91/at91_machdep.c @@ -77,7 +77,6 @@ __FBSDID("$FreeBSD$"); #include <vm/vm_object.h> #include <vm/vm_page.h> #include <vm/vm_map.h> -#include <machine/pmap.h> #include <machine/vmparam.h> #include <machine/pcb.h> #include <machine/undefined.h> diff --git a/sys/arm/conf/RPI-B b/sys/arm/conf/RPI-B index c7b9a5f..d9e8d38 100644 --- a/sys/arm/conf/RPI-B +++ b/sys/arm/conf/RPI-B @@ -42,6 +42,7 @@ options FFS #Berkeley Fast Filesystem options SOFTUPDATES #Enable FFS soft updates support options UFS_ACL #Support for access control lists options UFS_DIRHASH #Improve performance on big directories +options MSDOSFS #MSDOS Filesystem device snp options NFSCL #Network Filesystem Client @@ -113,5 +114,7 @@ device smsc # Flattened Device Tree options FDT -options FDT_DTB_STATIC -makeoptions FDT_DTS_FILE=bcm2835-rpi-b.dts +# Note: DTB is normally loaded and modified by RPi boot loader, then +# handed to kernel via U-Boot and ubldr. +#options FDT_DTB_STATIC +#makeoptions FDT_DTS_FILE=bcm2835-rpi-b.dts diff --git a/sys/arm/include/vmparam.h b/sys/arm/include/vmparam.h index 94caeef..09bf62c 100644 --- a/sys/arm/include/vmparam.h +++ b/sys/arm/include/vmparam.h @@ -142,15 +142,15 @@ #define VM_KMEM_SIZE (12*1024*1024) #endif #ifndef VM_KMEM_SIZE_SCALE -#define VM_KMEM_SIZE_SCALE (2) +#define VM_KMEM_SIZE_SCALE (3) #endif /* - * Ceiling on the size of the kmem submap: 60% of the kernel map. + * Ceiling on the size of the kmem submap: 40% of the kernel map. */ #ifndef VM_KMEM_SIZE_MAX #define VM_KMEM_SIZE_MAX ((vm_max_kernel_address - \ - VM_MIN_KERNEL_ADDRESS + 1) * 3 / 5) + VM_MIN_KERNEL_ADDRESS + 1) * 2 / 5) #endif #define MAXTSIZ (16*1024*1024) diff --git a/sys/arm/sa11x0/assabet_machdep.c b/sys/arm/sa11x0/assabet_machdep.c index 9863953..0808798 100644 --- a/sys/arm/sa11x0/assabet_machdep.c +++ b/sys/arm/sa11x0/assabet_machdep.c @@ -80,7 +80,6 @@ __FBSDID("$FreeBSD$"); #include <vm/vm_object.h> #include <vm/vm_page.h> #include <vm/vm_map.h> -#include <machine/pmap.h> #include <machine/vmparam.h> #include <machine/pcb.h> #include <machine/undefined.h> diff --git a/sys/boot/common/load_elf.c b/sys/boot/common/load_elf.c index e1e6de7..d712b3d 100644 --- a/sys/boot/common/load_elf.c +++ b/sys/boot/common/load_elf.c @@ -290,14 +290,25 @@ __elfN(loadimage)(struct preloaded_file *fp, elf_file_t ef, u_int64_t off) } else off = 0; #elif defined(__arm__) - if (off & 0xf0000000u) { - off = -(off & 0xf0000000u); - ehdr->e_entry += off; + /* + * The elf headers in some kernels specify virtual addresses in all + * header fields. More recently, the e_entry and p_paddr fields are the + * proper physical addresses. Even when the p_paddr fields are correct, + * the MI code below uses the p_vaddr fields with an offset added for + * loading (doing so is arguably wrong). To make loading work, we need + * an offset that represents the difference between physical and virtual + * addressing. ARM kernels are always linked at 0xC0000000. Depending + * on the headers, the offset value passed in may be physical or virtual + * (because it typically comes from e_entry), but we always replace + * whatever is passed in with the va<->pa offset. On the other hand, we + * only adjust the entry point if it's a virtual address to begin with. + */ + off = -0xc0000000u; + if ((ehdr->e_entry & 0xc0000000u) == 0xc000000u) + ehdr->e_entry += off; #ifdef ELF_VERBOSE - printf("Converted entry 0x%08x\n", ehdr->e_entry); + printf("ehdr->e_entry 0x%08x, va<->pa off %llx\n", ehdr->e_entry, off); #endif - } else - off = 0; #else off = 0; /* other archs use direct mapped kernels */ #endif diff --git a/sys/dev/ath/ath_rate/sample/sample.c b/sys/dev/ath/ath_rate/sample/sample.c index 54360f5..a7d6af6 100644 --- a/sys/dev/ath/ath_rate/sample/sample.c +++ b/sys/dev/ath/ath_rate/sample/sample.c @@ -1008,6 +1008,15 @@ ath_rate_tx_complete(struct ath_softc *sc, struct ath_node *an, short_tries, long_tries, long_tries > rc[0].tries, nframes, nbad); + update_ewma_stats(sc, an, frame_size, + rc[0].rix, rc[0].tries, + rc[1].rix, rc[1].tries, + rc[2].rix, rc[2].tries, + rc[3].rix, rc[3].tries, + short_tries, long_tries, + long_tries > rc[0].tries, + nframes, nbad); + long_tries -= rc[0].tries; } @@ -1020,6 +1029,14 @@ ath_rate_tx_complete(struct ath_softc *sc, struct ath_node *an, short_tries, long_tries, status, nframes, nbad); + update_ewma_stats(sc, an, frame_size, + rc[1].rix, rc[1].tries, + rc[2].rix, rc[2].tries, + rc[3].rix, rc[3].tries, + 0, 0, + short_tries, long_tries, + status, + nframes, nbad); long_tries -= rc[1].tries; } @@ -1032,6 +1049,14 @@ ath_rate_tx_complete(struct ath_softc *sc, struct ath_node *an, short_tries, long_tries, status, nframes, nbad); + update_ewma_stats(sc, an, frame_size, + rc[2].rix, rc[2].tries, + rc[3].rix, rc[3].tries, + 0, 0, + 0, 0, + short_tries, long_tries, + status, + nframes, nbad); long_tries -= rc[2].tries; } @@ -1044,17 +1069,15 @@ ath_rate_tx_complete(struct ath_softc *sc, struct ath_node *an, short_tries, long_tries, status, nframes, nbad); + update_ewma_stats(sc, an, frame_size, + rc[3].rix, rc[3].tries, + 0, 0, + 0, 0, + 0, 0, + short_tries, long_tries, + status, + nframes, nbad); } - - update_ewma_stats(sc, an, frame_size, - rc[0].rix, rc[0].tries, - rc[1].rix, rc[1].tries, - rc[2].rix, rc[2].tries, - rc[3].rix, rc[3].tries, - short_tries, long_tries, - long_tries > rc[0].tries, - nframes, nbad); - } } diff --git a/sys/dev/hwpmc/hwpmc_soft.c b/sys/dev/hwpmc/hwpmc_soft.c index dac3612..0ed2262 100644 --- a/sys/dev/hwpmc/hwpmc_soft.c +++ b/sys/dev/hwpmc/hwpmc_soft.c @@ -408,8 +408,11 @@ pmc_soft_intr(struct pmckern_soft *ks) } processed = 1; - pc->soft_values[ri]++; if (PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) { + if ((pc->soft_values[ri]--) <= 0) + pc->soft_values[ri] += pm->pm_sc.pm_reloadcount; + else + continue; user_mode = TRAPF_USERMODE(ks->pm_tf); error = pmc_process_interrupt(ks->pm_cpu, PMC_SR, pm, ks->pm_tf, user_mode); @@ -424,7 +427,8 @@ pmc_soft_intr(struct pmckern_soft *ks) */ curthread->td_flags |= TDF_ASTPENDING; } - } + } else + pc->soft_values[ri]++; } atomic_add_int(processed ? &pmc_stats.pm_intr_processed : diff --git a/sys/fs/fuse/fuse_io.c b/sys/fs/fuse/fuse_io.c index 3cdc1e5..89b57bb 100644 --- a/sys/fs/fuse/fuse_io.c +++ b/sys/fs/fuse/fuse_io.c @@ -88,7 +88,6 @@ __FBSDID("$FreeBSD$"); #include <vm/vm_map.h> #include <vm/vm_page.h> #include <vm/vm_object.h> -#include <vm/vm_object.h> #include "fuse.h" #include "fuse_file.h" diff --git a/sys/sys/time.h b/sys/sys/time.h index 80878c0..14b80e3 100644 --- a/sys/sys/time.h +++ b/sys/sys/time.h @@ -156,9 +156,6 @@ timeval2bintime(const struct timeval *tv, struct bintime *bt) /* 18446744073709 = int(2^64 / 1000000) */ bt->frac = tv->tv_usec * (uint64_t)18446744073709LL; } -#endif /* __BSD_VISIBLE */ - -#ifdef _KERNEL /* Operations on timespecs */ #define timespecclear(tvp) ((tvp)->tv_sec = (tvp)->tv_nsec = 0) @@ -197,7 +194,7 @@ timeval2bintime(const struct timeval *tv, struct bintime *bt) /* timevaladd and timevalsub are not inlined */ -#endif /* _KERNEL */ +#endif /* __BSD_VISIBLE */ #ifndef _KERNEL /* NetBSD/OpenBSD compatible interfaces */ diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index fdf1d74..674c3c3 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -581,7 +581,7 @@ retry: VM_OBJECT_WUNLOCK(robject); object->flags |= OBJ_PIPWNT; VM_OBJECT_SLEEP(object, object, - PDROP | PVM, "objde2" , 0); + PDROP | PVM, "objde2", 0); VM_OBJECT_WLOCK(robject); temp = robject->backing_object; if (object == temp) { diff --git a/usr.bin/truss/main.c b/usr.bin/truss/main.c index 4e9f74b..7b8242b 100644 --- a/usr.bin/truss/main.c +++ b/usr.bin/truss/main.c @@ -323,14 +323,14 @@ START_TRACE: fprintf(trussinfo->outfile, "%5d: ", trussinfo->pid); if (trussinfo->flags & ABSOLUTETIMESTAMPS) { - timespecsubt(&trussinfo->curthread->after, + timespecsubt_to(&trussinfo->curthread->after, &trussinfo->start_time, &timediff); fprintf(trussinfo->outfile, "%ld.%09ld ", (long)timediff.tv_sec, timediff.tv_nsec); } if (trussinfo->flags & RELATIVETIMESTAMPS) { - timespecsubt(&trussinfo->curthread->after, + timespecsubt_to(&trussinfo->curthread->after, &trussinfo->curthread->before, &timediff); fprintf(trussinfo->outfile, "%ld.%09ld ", (long)timediff.tv_sec, @@ -349,14 +349,14 @@ START_TRACE: fprintf(trussinfo->outfile, "%5d: ", trussinfo->pid); if (trussinfo->flags & ABSOLUTETIMESTAMPS) { - timespecsubt(&trussinfo->curthread->after, + timespecsubt_to(&trussinfo->curthread->after, &trussinfo->start_time, &timediff); fprintf(trussinfo->outfile, "%ld.%09ld ", (long)timediff.tv_sec, timediff.tv_nsec); } if (trussinfo->flags & RELATIVETIMESTAMPS) { - timespecsubt(&trussinfo->curthread->after, + timespecsubt_to(&trussinfo->curthread->after, &trussinfo->curthread->before, &timediff); fprintf(trussinfo->outfile, "%ld.%09ld ", (long)timediff.tv_sec, timediff.tv_nsec); diff --git a/usr.bin/truss/syscalls.c b/usr.bin/truss/syscalls.c index 0afd083..c926af2 100644 --- a/usr.bin/truss/syscalls.c +++ b/usr.bin/truss/syscalls.c @@ -1126,14 +1126,14 @@ print_syscall(struct trussinfo *trussinfo, const char *name, int nargs, } if (trussinfo->flags & ABSOLUTETIMESTAMPS) { - timespecsubt(&trussinfo->curthread->after, + timespecsubt_to(&trussinfo->curthread->after, &trussinfo->start_time, &timediff); len += fprintf(trussinfo->outfile, "%ld.%09ld ", (long)timediff.tv_sec, timediff.tv_nsec); } if (trussinfo->flags & RELATIVETIMESTAMPS) { - timespecsubt(&trussinfo->curthread->after, + timespecsubt_to(&trussinfo->curthread->after, &trussinfo->curthread->before, &timediff); len += fprintf(trussinfo->outfile, "%ld.%09ld ", (long)timediff.tv_sec, timediff.tv_nsec); @@ -1165,9 +1165,9 @@ print_syscall_ret(struct trussinfo *trussinfo, const char *name, int nargs, if (!sc) return; clock_gettime(CLOCK_REALTIME, &trussinfo->curthread->after); - timespecsubt(&trussinfo->curthread->after, + timespecsubt_to(&trussinfo->curthread->after, &trussinfo->curthread->before, &timediff); - timespecadd(&sc->time, &timediff, &sc->time); + timespecadd_to(&sc->time, &timediff, &sc->time); sc->ncalls++; if (errorp) sc->nerror++; @@ -1205,7 +1205,7 @@ print_summary(struct trussinfo *trussinfo) fprintf(trussinfo->outfile, "%-20s%5jd.%09ld%8d%8d\n", sc->name, (intmax_t)sc->time.tv_sec, sc->time.tv_nsec, sc->ncalls, sc->nerror); - timespecadd(&total, &sc->time, &total); + timespecadd_to(&total, &sc->time, &total); ncall += sc->ncalls; nerror += sc->nerror; } diff --git a/usr.bin/truss/truss.h b/usr.bin/truss/truss.h index dcc86a5..ea954e8 100644 --- a/usr.bin/truss/truss.h +++ b/usr.bin/truss/truss.h @@ -62,7 +62,7 @@ struct trussinfo SLIST_HEAD(, threadinfo) threadlist; }; -#define timespecsubt(tvp, uvp, vvp) \ +#define timespecsubt_to(tvp, uvp, vvp) \ do { \ (vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \ (vvp)->tv_nsec = (tvp)->tv_nsec - (uvp)->tv_nsec; \ @@ -72,7 +72,7 @@ struct trussinfo } \ } while (0) -#define timespecadd(tvp, uvp, vvp) \ +#define timespecadd_to(tvp, uvp, vvp) \ do { \ (vvp)->tv_sec = (tvp)->tv_sec + (uvp)->tv_sec; \ (vvp)->tv_nsec = (tvp)->tv_nsec + (uvp)->tv_nsec; \ |