svn commit: r211196 - head/usr.sbin/acpi/acpidump
Author: takawata Date: Wed Aug 11 23:21:25 2010 New Revision: 211196 URL: http://svn.freebsd.org/changeset/base/211196 Log: Add TCG ACPI spec table (TCPA) support. Submitted by: hans-joerg_hoe...@genua.de Modified: head/usr.sbin/acpi/acpidump/acpi.c head/usr.sbin/acpi/acpidump/acpidump.h Modified: head/usr.sbin/acpi/acpidump/acpi.c == --- head/usr.sbin/acpi/acpidump/acpi.c Wed Aug 11 22:44:10 2010 (r211195) +++ head/usr.sbin/acpi/acpidump/acpi.c Wed Aug 11 23:21:25 2010 (r211196) @@ -68,6 +68,7 @@ static void acpi_print_srat_cpu(uint32_t static voidacpi_print_srat_memory(ACPI_SRAT_MEM_AFFINITY *mp); static voidacpi_print_srat(ACPI_SUBTABLE_HEADER *srat); static voidacpi_handle_srat(ACPI_TABLE_HEADER *sdp); +static voidacpi_handle_tcpa(ACPI_TABLE_HEADER *sdp); static voidacpi_print_sdt(ACPI_TABLE_HEADER *sdp); static voidacpi_print_fadt(ACPI_TABLE_HEADER *sdp); static voidacpi_print_facs(ACPI_TABLE_FACS *facs); @@ -81,6 +82,46 @@ static void acpi_walk_subtables(ACPI_TAB /* Size of an address. 32-bit for ACPI 1.0, 64-bit for ACPI 2.0 and up. */ static int addr_size; +/* Strings used in the TCPA table */ +static const char *tcpa_event_type_strings[] = { + PREBOOT Certificate, + POST Code, + Unused, + No Action, + Separator, + Action, + Event Tag, + S-CRTM Contents, + S-CRTM Version, + CPU Microcode, + Platform Config Flags, + Table of Devices, + Compact Hash, + IPL, + IPL Partition Data, + Non-Host Code, + Non-Host Config, + Non-Host Info +}; + +static const char *TCPA_pcclient_strings[] = { + undefined, + SMBIOS, + BIS Certificate, + POST BIOS ROM Strings, + ESCD, + CMOS, + NVRAM, + Option ROM Execute, + Option ROM Configurateion, + undefined, + Option ROM Microcode Update , + S-CRTM Version String, + S-CRTM Contents, + POST Contents, + Table of Devices, +}; + static void acpi_print_string(char *s, size_t length) { @@ -492,6 +533,165 @@ acpi_print_srat_cpu(uint32_t apic_id, ui printf(\tProximity Domain=%d\n, proximity_domain); } +static char * +acpi_tcpa_evname(struct TCPAevent *event) +{ + struct TCPApc_event *pc_event; + char *eventname = NULL; + + pc_event = (struct TCPApc_event *)(event + 1); + + switch(event-event_type) { + case PREBOOT: + case POST_CODE: + case UNUSED: + case NO_ACTION: + case SEPARATOR: + case SCRTM_CONTENTS: + case SCRTM_VERSION: + case CPU_MICROCODE: + case PLATFORM_CONFIG_FLAGS: + case TABLE_OF_DEVICES: + case COMPACT_HASH: + case IPL: + case IPL_PARTITION_DATA: + case NONHOST_CODE: + case NONHOST_CONFIG: + case NONHOST_INFO: + asprintf(eventname, %s, + tcpa_event_type_strings[event-event_type]); + break; + + case ACTION: + eventname = calloc(event-event_size + 1, sizeof(char)); + memcpy(eventname, pc_event, event-event_size); + break; + + case EVENT_TAG: + switch (pc_event-event_id) { + case SMBIOS: + case BIS_CERT: + case CMOS: + case NVRAM: + case OPTION_ROM_EXEC: + case OPTION_ROM_CONFIG: + case S_CRTM_VERSION: + case POST_BIOS_ROM: + case ESCD: + case OPTION_ROM_MICROCODE: + case S_CRTM_CONTENTS: + case POST_CONTENTS: + asprintf(eventname, %s, + TCPA_pcclient_strings[pc_event-event_id]); + break; + + default: + asprintf(eventname, unknown tag 0x%02x, + pc_event-event_id); + break; + } + break; + + default: + asprintf(eventname, unknown 0x%02x, event-event_type); + break; + } + + return eventname; +} + +static void +acpi_print_tcpa(struct TCPAevent *event) +{ + int i; + char *eventname; + + eventname = acpi_tcpa_evname(event); + + printf(\t%d, event-pcr_index); + printf( 0x); + for (i = 0; i 20; i++) + printf(%02x, event-pcr_value[i]); + printf( [%s]\n, eventname ? eventname : unknown); + + free(eventname); +} + +static void +acpi_handle_tcpa(ACPI_TABLE_HEADER *sdp) +{ + struct TCPAbody *tcpa; + struct TCPAevent *event; + u_int64_t len, paddr; + unsigned char *vaddr = NULL; + unsigned char *vend = NULL; + + printf(BEGIN_COMMENT); + acpi_print_sdt(sdp); + tcpa = (struct TCPAbody *) sdp; + +
svn commit: r211197 - in head/sys: amd64/amd64 arm/include i386/i386 i386/xen mips/include powerpc/include sparc64/include sparc64/sparc64 sun4v/include sun4v/sun4v
Author: jhb Date: Wed Aug 11 23:22:53 2010 New Revision: 211197 URL: http://svn.freebsd.org/changeset/base/211197 Log: Update various places that store or manipulate CPU masks to use cpumask_t instead of int or u_int. Since cpumask_t is currently u_int on all platforms this should just be a cosmetic change. Modified: head/sys/amd64/amd64/mp_machdep.c head/sys/amd64/amd64/vm_machdep.c head/sys/arm/include/pmap.h head/sys/i386/i386/mp_machdep.c head/sys/i386/i386/vm_machdep.c head/sys/i386/xen/pmap.c head/sys/mips/include/pmap.h head/sys/powerpc/include/pmap.h head/sys/sparc64/include/pmap.h head/sys/sparc64/include/smp.h head/sys/sparc64/sparc64/mp_machdep.c head/sys/sun4v/include/smp.h head/sys/sun4v/sun4v/mp_machdep.c head/sys/sun4v/sun4v/pmap.c Modified: head/sys/amd64/amd64/mp_machdep.c == --- head/sys/amd64/amd64/mp_machdep.c Wed Aug 11 23:21:25 2010 (r211196) +++ head/sys/amd64/amd64/mp_machdep.c Wed Aug 11 23:22:53 2010 (r211197) @@ -1053,7 +1053,7 @@ smp_targeted_tlb_shootdown(cpumask_t mas int ncpu, othercpus; othercpus = mp_ncpus - 1; - if (mask == (u_int)-1) { + if (mask == (cpumask_t)-1) { ncpu = othercpus; if (ncpu 1) return; @@ -1078,7 +1078,7 @@ smp_targeted_tlb_shootdown(cpumask_t mas smp_tlb_addr1 = addr1; smp_tlb_addr2 = addr2; atomic_store_rel_int(smp_tlb_wait, 0); - if (mask == (u_int)-1) + if (mask == (cpumask_t)-1) ipi_all_but_self(vector); else ipi_selected(mask, vector); @@ -1549,9 +1549,11 @@ mp_grab_cpu_hlt(void) mask = PCPU_GET(cpumask); #endif - retval = mask hlt_cpus_mask; - while (mask hlt_cpus_mask) + retval = 0; + while (mask hlt_cpus_mask) { + retval = 1; __asm __volatile(sti; hlt : : : memory); + } return (retval); } Modified: head/sys/amd64/amd64/vm_machdep.c == --- head/sys/amd64/amd64/vm_machdep.c Wed Aug 11 23:21:25 2010 (r211196) +++ head/sys/amd64/amd64/vm_machdep.c Wed Aug 11 23:22:53 2010 (r211197) @@ -527,7 +527,8 @@ void cpu_reset() { #ifdef SMP - u_int cnt, map; + cpumask_t map; + u_int cnt; if (smp_active) { map = PCPU_GET(other_cpus) ~stopped_cpus; Modified: head/sys/arm/include/pmap.h == --- head/sys/arm/include/pmap.h Wed Aug 11 23:21:25 2010(r211196) +++ head/sys/arm/include/pmap.h Wed Aug 11 23:22:53 2010(r211197) @@ -136,7 +136,7 @@ struct pmap { pd_entry_t *pm_pdir; /* KVA of page directory */ uint32_tpm_gen_count; /* generation count (pmap lock dropped) */ u_int pm_retries; - int pm_active; /* active on cpus */ + cpumask_t pm_active; /* active on cpus */ struct pmap_statistics pm_stats; /* pmap statictics */ TAILQ_HEAD(,pv_entry) pm_pvlist; /* list of mappings in pmap */ }; Modified: head/sys/i386/i386/mp_machdep.c == --- head/sys/i386/i386/mp_machdep.c Wed Aug 11 23:21:25 2010 (r211196) +++ head/sys/i386/i386/mp_machdep.c Wed Aug 11 23:22:53 2010 (r211197) @@ -1598,9 +1598,11 @@ mp_grab_cpu_hlt(void) mask = PCPU_GET(cpumask); #endif - retval = mask hlt_cpus_mask; - while (mask hlt_cpus_mask) + retval = 0; + while (mask hlt_cpus_mask) { + retval = 1; __asm __volatile(sti; hlt : : : memory); + } return (retval); } Modified: head/sys/i386/i386/vm_machdep.c == --- head/sys/i386/i386/vm_machdep.c Wed Aug 11 23:21:25 2010 (r211196) +++ head/sys/i386/i386/vm_machdep.c Wed Aug 11 23:22:53 2010 (r211197) @@ -596,7 +596,8 @@ cpu_reset() #endif #ifdef SMP - u_int cnt, map; + cpumask_t map; + u_int cnt; if (smp_active) { map = PCPU_GET(other_cpus) ~stopped_cpus; Modified: head/sys/i386/xen/pmap.c == --- head/sys/i386/xen/pmap.cWed Aug 11 23:21:25 2010(r211196) +++ head/sys/i386/xen/pmap.cWed Aug 11 23:22:53 2010(r211197) @@ -863,8 +863,7 @@ pmap_cache_bits(int mode, boolean_t is_p void pmap_invalidate_page(pmap_t pmap, vm_offset_t va) { - u_int cpumask; - u_int other_cpus; + cpumask_t cpumask, other_cpus; CTR2(KTR_PMAP,
svn commit: r211201 - in head: share/man/man4 sys/conf sys/dev/tpm sys/modules sys/modules/tpm
Author: takawata Date: Thu Aug 12 00:16:18 2010 New Revision: 211201 URL: http://svn.freebsd.org/changeset/base/211201 Log: Add tpm(4) driver for Trusted Platform Module. You may want to look at http://bsssd.sourceforge.net/ . Submitted by: Hans-Joerg Hoexer hans-joerg_hoe...@genua.de Added: head/share/man/man4/tpm.4 (contents, props changed) head/sys/dev/tpm/ head/sys/dev/tpm/tpm.c (contents, props changed) head/sys/dev/tpm/tpm_acpi.c (contents, props changed) head/sys/dev/tpm/tpm_isa.c (contents, props changed) head/sys/dev/tpm/tpmvar.h (contents, props changed) head/sys/modules/tpm/ head/sys/modules/tpm/Makefile (contents, props changed) Modified: head/sys/conf/files.i386 head/sys/modules/Makefile Added: head/share/man/man4/tpm.4 == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/tpm.4 Thu Aug 12 00:16:18 2010(r211201) @@ -0,0 +1,74 @@ +.\ +.\ Copyright (c) 2010 Hans-J +.\ +.\ Permission to use, copy, modify, and distribute this software for any +.\ purpose with or without fee is hereby granted, provided that the above +.\ copyright notice and this permission notice appear in all copies. +.\ +.\ THE SOFTWARE IS PROVIDED AS IS AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\ +.\ $FreeBSD$ +.\ +.Dd March 8, 2010 +.Dt TPM 4 +.Os +.Sh NAME +.Nm tpm +.Nd Trusted Platform Module +.Sh SYNOPSIS +.Cd device tpm +.Pp +In +.Pa /boot/device.hints : +.Cd hint.tpm.0.at=isa +.Cd hint.tpm.0.maddr=0xfed4 +.Cd hint.tpm.0.msize=0x5000 +.Cd hint.tpm.1.at=isa +.Cd hint.tpm.1.maddr=0xfed4 +.Cd hint.tpm.1.msize=0x1000 +.Sh DESCRIPTION +The +.Nm +driver provides support for various trusted platfrom modules (TPM) that can +store cryptographic keys. +.Pp +Supported modules: +.Pp +.Bl -bullet -compact -offset indent +.It +Atmel 97SC3203 +.It +Broadcom BCM0102 +.It +Infineon IFX SLD 9630 TT 1.1 and IFX SLB 9635 TT 1.2 +.It +Intel INTC0102 +.It +Sinosun SNS SSX35 +.It +STM ST19WP18 +.It +Winbond WEC WPCT200 +.El +.Pp +The driver can be configured to use an IRQ by providing a free ISA +interrupt vector in +.Pa /boot/device.hints . +.Sh SEE ALSO +.Xr intro 4 , +.Xr files.conf 5, +.Xr config 8 +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An Michael Shalayeff +and +.An Hans-Joerg Hoexer . Modified: head/sys/conf/files.i386 == --- head/sys/conf/files.i386Wed Aug 11 23:59:21 2010(r211200) +++ head/sys/conf/files.i386Thu Aug 12 00:16:18 2010(r211201) @@ -231,6 +231,9 @@ dev/syscons/scterm-teken.c optional sc dev/syscons/scvesactl.coptional sc vga vesa dev/syscons/scvgarndr.coptional sc vga dev/syscons/scvtb.coptional sc +dev/tpm/tpm.c optional tpm +dev/tpm/tpm_acpi.c optional tpm acpi +dev/tpm/tpm_isa.c optional tpm isa dev/uart/uart_cpu_i386.c optional uart dev/acpica/acpi_if.m standard dev/acpi_support/acpi_wmi_if.m standard Added: head/sys/dev/tpm/tpm.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/tpm/tpm.c Thu Aug 12 00:16:18 2010(r211201) @@ -0,0 +1,1492 @@ +/* + * Copyright (c) 2008, 2009 Michael Shalayeff + * Copyright (c) 2009, 2010 Hans-Joerg Hoexer + * All rights reserved. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED AS IS AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/* #define TPM_DEBUG */ + +#include sys/cdefs.h +__FBSDID($FreeBSD$); + +#include sys/param.h +#include sys/systm.h +#include sys/kernel.h +#include sys/malloc.h +#include sys/proc.h + +#ifdef __FreeBSD__ +#include sys/module.h +#include sys/conf.h +#include
svn commit: r211202 - in head/sys/amd64: acpica amd64
Author: jkim Date: Thu Aug 12 00:20:46 2010 New Revision: 211202 URL: http://svn.freebsd.org/changeset/base/211202 Log: Reset switchtime and switchticks after resynchronizing the system clock. This should fix weird runtime problem after resume on amd64. It also fixes calcru: runtime went backwards warnings with bootverbose. Modified: head/sys/amd64/acpica/acpi_wakeup.c head/sys/amd64/amd64/mp_machdep.c Modified: head/sys/amd64/acpica/acpi_wakeup.c == --- head/sys/amd64/acpica/acpi_wakeup.c Thu Aug 12 00:16:18 2010 (r211201) +++ head/sys/amd64/acpica/acpi_wakeup.c Thu Aug 12 00:20:46 2010 (r211202) @@ -278,11 +278,13 @@ acpi_sleep_machdep(struct acpi_softc *sc for (;;) ia32_pause(); } else { + acpi_resync_clock(sc); + PCPU_SET(switchtime, cpu_ticks()); + PCPU_SET(switchticks, ticks); #ifdef SMP if (wakeup_cpus != 0) acpi_wakeup_cpus(sc, wakeup_cpus); #endif - acpi_resync_clock(sc); ret = 0; } Modified: head/sys/amd64/amd64/mp_machdep.c == --- head/sys/amd64/amd64/mp_machdep.c Thu Aug 12 00:16:18 2010 (r211201) +++ head/sys/amd64/amd64/mp_machdep.c Thu Aug 12 00:20:46 2010 (r211202) @@ -1369,6 +1369,9 @@ cpususpend_handler(void) if (savectx(susppcbs[cpu])) { wbinvd(); atomic_set_int(stopped_cpus, cpumask); + } else { + PCPU_SET(switchtime, cpu_ticks()); + PCPU_SET(switchticks, ticks); } /* Wait for resume */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r211201 - in head: share/man/man4 sys/conf sys/dev/tpm sys/modules sys/modules/tpm
On 12 August 2010 12:16, Takanori Watanabe takaw...@freebsd.org wrote: Author: takawata Date: Thu Aug 12 00:16:18 2010 New Revision: 211201 URL: http://svn.freebsd.org/changeset/base/211201 Log: Add tpm(4) driver for Trusted Platform Module. You may want to look at http://bsssd.sourceforge.net/ . Submitted by: Hans-Joerg Hoexer hans-joerg_hoe...@genua.de Added: head/share/man/man4/tpm.4 (contents, props changed) head/sys/dev/tpm/ head/sys/dev/tpm/tpm.c (contents, props changed) head/sys/dev/tpm/tpm_acpi.c (contents, props changed) head/sys/dev/tpm/tpm_isa.c (contents, props changed) head/sys/dev/tpm/tpmvar.h (contents, props changed) head/sys/modules/tpm/ head/sys/modules/tpm/Makefile (contents, props changed) Modified: head/sys/conf/files.i386 head/sys/modules/Makefile Added: head/share/man/man4/tpm.4 == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/tpm.4 Thu Aug 12 00:16:18 2010 (r211201) @@ -0,0 +1,74 @@ +.\ +.\ Copyright (c) 2010 Hans-J His name appears truncated here, the other files seem ok. Andrew ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r211204 - head/share/man/man4
Author: takawata Date: Thu Aug 12 01:08:50 2010 New Revision: 211204 URL: http://svn.freebsd.org/changeset/base/211204 Log: Fix copyright information. Modified: head/share/man/man4/tpm.4 Modified: head/share/man/man4/tpm.4 == --- head/share/man/man4/tpm.4 Thu Aug 12 00:55:35 2010(r211203) +++ head/share/man/man4/tpm.4 Thu Aug 12 01:08:50 2010(r211204) @@ -1,5 +1,5 @@ .\ -.\ Copyright (c) 2010 Hans-J +.\ Copyright (c) 2010 Hans-Joerg Hoexer .\ .\ Permission to use, copy, modify, and distribute this software for any .\ purpose with or without fee is hereby granted, provided that the above ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r211206 - head/sys/dev/ath/ath_hal/ar5212
Author: adrian Date: Thu Aug 12 06:06:14 2010 New Revision: 211206 URL: http://svn.freebsd.org/changeset/base/211206 Log: Add a couple of functions to check NF calibration progress / completion. Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212.h head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212.h == --- head/sys/dev/ath/ath_hal/ar5212/ar5212.hThu Aug 12 05:59:55 2010 (r211205) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212.hThu Aug 12 06:06:14 2010 (r211206) @@ -608,4 +608,8 @@ extern void ar5212AniPoll(struct ath_hal const struct ieee80211_channel *); extern void ar5212AniReset(struct ath_hal *, const struct ieee80211_channel *, HAL_OPMODE, int); + +extern HAL_BOOL ar5212IsNFCalInProgress(struct ath_hal *ah); +extern HAL_BOOL ar5212WaitNFCalComplete(struct ath_hal *ah, int i); + #endif /* _ATH_AR5212_H_ */ Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c == --- head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Thu Aug 12 05:59:55 2010(r211205) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Thu Aug 12 06:06:14 2010(r211206) @@ -1071,3 +1071,38 @@ ar5212GetDiagState(struct ath_hal *ah, i } return AH_FALSE; } + +/* + * Check whether there's an in-progress NF completion. + * + * Returns AH_TRUE if there's a in-progress NF calibration, AH_FALSE + * otherwise. + */ +HAL_BOOL +ar5212IsNFCalInProgress(struct ath_hal *ah) +{ + if (OS_REG_READ(ah, AR_PHY_AGC_CONTROL) AR_PHY_AGC_CONTROL_NF) + return AH_TRUE; + return AH_FALSE; +} + +/* + * Wait for an in-progress NF calibration to complete. + * + * The completion function waits i times 10uS. + * It returns AH_TRUE if the NF calibration completed (or was never + * in progress); AH_FALSE if it was still in progress after i checks. + */ +HAL_BOOL +ar5212WaitNFCalComplete(struct ath_hal *ah, int i) +{ + int j; + if (i = 0) + i = 1;/* it should run at least once */ + for (j = 0; j i; j++) { + if (! ar5212IsNFCalInProgress(ah)) + return AH_TRUE; + OS_DELAY(10); + } + return AH_FALSE; +} ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r211207 - head/sys/dev/ath/ath_hal/ar5416
Author: adrian Date: Thu Aug 12 06:08:36 2010 New Revision: 211207 URL: http://svn.freebsd.org/changeset/base/211207 Log: Internal NF calibration should not occur in parallel with any other calibration. Ensure that the NF calibration completes before continuing with the rest of the calibration setup process. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c == --- head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.cThu Aug 12 06:06:14 2010(r211206) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.cThu Aug 12 06:08:36 2010(r211207) @@ -24,6 +24,8 @@ #include ah_eeprom_v14.h +#include ar5212/ar5212.h /* for NF cal related declarations */ + #include ar5416/ar5416.h #include ar5416/ar5416reg.h #include ar5416/ar5416phy.h @@ -220,7 +222,16 @@ ar5416InitCal(struct ath_hal *ah, const * triggered at the same time. */ OS_REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_NF); - + /* +* Try to make sure the above NF cal completes, just so +* it doesn't clash with subsequent percals -adrian + */ + if (! ar5212WaitNFCalComplete(ah, 1)) { + HALDEBUG(ah, HAL_DEBUG_ANY, %s: initial NF calibration did + not complete in time; noisy environment?\n, __func__); + return AH_FALSE; + } + /* Initialize list pointers */ cal-cal_list = cal-cal_last = cal-cal_curr = AH_NULL; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r211208 - head/sys/dev/ath/ath_hal/ar5416
Author: adrian Date: Thu Aug 12 06:11:44 2010 New Revision: 211208 URL: http://svn.freebsd.org/changeset/base/211208 Log: Ensure that the correct rxchainmask is used when doing calibration in the AR5416 and later chipsets. ath_hal_calibrateN() calls the HAL calibrateN function with rxchainmask=0x1. This is not necessarily the case for AR5416 and later chipsets. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c == --- head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.cThu Aug 12 06:08:36 2010(r211207) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.cThu Aug 12 06:11:44 2010(r211208) @@ -407,6 +407,13 @@ ar5416PerCalibrationN(struct ath_hal *ah *isCalDone = AH_TRUE; + /* +* Since ath_hal calls the PerCal method with rxchainmask=0x1; +* override it with the current chainmask. The upper levels currently +* doesn't know about the chainmask. +*/ + rxchainmask = AH5416(ah)-ah_rx_chainmask; + /* Invalid channel check */ ichan = ath_hal_checkchannel(ah, chan); if (ichan == AH_NULL) { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r211209 - head/sys/dev/ath/ath_hal/ar5416
Author: adrian Date: Thu Aug 12 06:12:39 2010 New Revision: 211209 URL: http://svn.freebsd.org/changeset/base/211209 Log: Fix indentation. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c == --- head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.cThu Aug 12 06:11:44 2010(r211208) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.cThu Aug 12 06:12:39 2010(r211209) @@ -225,7 +225,7 @@ ar5416InitCal(struct ath_hal *ah, const /* * Try to make sure the above NF cal completes, just so * it doesn't clash with subsequent percals -adrian - */ +*/ if (! ar5212WaitNFCalComplete(ah, 1)) { HALDEBUG(ah, HAL_DEBUG_ANY, %s: initial NF calibration did not complete in time; noisy environment?\n, __func__); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r211210 - head/sys/dev/ath/ath_hal/ar5416
Author: adrian Date: Thu Aug 12 06:14:26 2010 New Revision: 211210 URL: http://svn.freebsd.org/changeset/base/211210 Log: Use ar5212IsNFCalInProgress() to check for NF calibration progress. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c == --- head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.cThu Aug 12 06:12:39 2010(r211209) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.cThu Aug 12 06:14:26 2010(r211210) @@ -632,7 +632,7 @@ ar5416GetNf(struct ath_hal *ah, struct i { int16_t nf, nfThresh; - if (OS_REG_READ(ah, AR_PHY_AGC_CONTROL) AR_PHY_AGC_CONTROL_NF) { + if (ar5212IsNFCalInProgress(ah)) { HALDEBUG(ah, HAL_DEBUG_ANY, %s: NF didn't complete in calibration window\n, __func__); nf = 0; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r211211 - head/sys/dev/ath/ath_hal/ar5416
Author: adrian Date: Thu Aug 12 06:20:54 2010 New Revision: 211211 URL: http://svn.freebsd.org/changeset/base/211211 Log: Loading the NF CCA values may take longer than expected to occur. If it does, don't then try reprogramming the NF cap values (ie what values are the maximum value the NF can be) - instead, just leave the current CCA value as the NF cap. This was inspired by some similar work from ath9k. It isn't a 100% complete solution (as there may be some reason where a high NF CCA/cap is written, causing the baseband to stop thinking it is able to transmit, leading to stuck beacon and interface reset) which I'll investigate and look at fixing in a later commit. Obtained from:Linux Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c == --- head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.cThu Aug 12 06:14:26 2010(r211210) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.cThu Aug 12 06:20:54 2010(r211211) @@ -527,7 +527,7 @@ ar5416LoadNF(struct ath_hal *ah, const s AR_PHY_CH2_EXT_CCA }; struct ar5212NfCalHist *h; - int i, j; + int i; int32_t val; uint8_t chainmask; @@ -562,11 +562,20 @@ ar5416LoadNF(struct ath_hal *ah, const s OS_REG_CLR_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_NO_UPDATE_NF); OS_REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_NF); - /* Wait for load to complete, should be fast, a few 10s of us. */ - for (j = 0; j 1000; j++) { - if ((OS_REG_READ(ah, AR_PHY_AGC_CONTROL) AR_PHY_AGC_CONTROL_NF) == 0) - break; - OS_DELAY(10); + if (! ar5212WaitNFCalComplete(ah, 1000)) { + /* +* We timed out waiting for the noisefloor to load, probably due to an +* in-progress rx. Simply return here and allow the load plenty of time +* to complete before the next calibration interval. We need to avoid +* trying to load -50 (which happens below) while the previous load is +* still in progress as this can cause rx deafness. Instead by returning +* here, the baseband nf cal will just be capped by our present +* noisefloor until the next calibration timer. +*/ + HALDEBUG(ah, HAL_DEBUG_ANY, Timeout while waiting for nf + to load: AR_PHY_AGC_CONTROL=0x%x\n, + OS_REG_READ(ah, AR_PHY_AGC_CONTROL)); + return; } /* ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r211146 - head
On 11 August 2010 22:17, Ed Schouten e...@80386.nl wrote: Hi Adrian, * Adrian Chadd adr...@freebsd.org wrote: Modified: head/Makefile.mips Can't this file be simply removed now? I think so. Warner? Adrian ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r211205 - stable/8/sys/boot/zfs
Author: mm Date: Thu Aug 12 05:59:55 2010 New Revision: 211205 URL: http://svn.freebsd.org/changeset/base/211205 Log: MFC r211091: Return EIO if vdev-v_phys_read is NULL. This fixes booting from a ZFS mirror with a unavailable primary device. PR: kern/148655 Reviewed by: avg Approved by: delphij (mentor) Modified: stable/8/sys/boot/zfs/zfsimpl.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cam/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/boot/zfs/zfsimpl.c == --- stable/8/sys/boot/zfs/zfsimpl.c Thu Aug 12 01:08:50 2010 (r211204) +++ stable/8/sys/boot/zfs/zfsimpl.c Thu Aug 12 05:59:55 2010 (r211205) @@ -328,6 +328,9 @@ vdev_read_phys(vdev_t *vdev, const blkpt size_t psize; int rc; + if (!vdev-v_phys_read) + return (EIO); + if (bp) { psize = BP_GET_PSIZE(bp); } else { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r211146 - head
In message: aanlkti=buijbr15mp7oolwcnxrhfbkxrhcwyhoh-x...@mail.gmail.com Adrian Chadd adr...@freebsd.org writes: : On 11 August 2010 22:17, Ed Schouten e...@80386.nl wrote: : Hi Adrian, : : * Adrian Chadd adr...@freebsd.org wrote: : Modified: : head/Makefile.mips : : Can't this file be simply removed now? : : I think so. Warner? I was planning on removing it once I finished the tbemd merge that's stalled :(. There's a small chance we may need it in the near future (like within the month), and I'd like to make sure we really don't before deleting it. Warner ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r211157 - in head/sys: modules modules/if_carp net netinet netinet6
On 2010.08.11 00:51:51 +, Will Andrews wrote: Author: will Date: Wed Aug 11 00:51:50 2010 New Revision: 211157 URL: http://svn.freebsd.org/changeset/base/211157 Log: Allow carp(4) to be loaded as a kernel module. Follow precedent set by bridge(4), lagg(4) etc. and make use of function pointers and pf_proto_register() to hook carp into the network stack. Yay! Thanks! I'm really looking forward to not having to handle compile kernels when upgrading to 8.2 on all my CARP based systems :-). -- Simon L. Nielsen ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r211212 - head/sys/ufs/ffs
Author: kib Date: Thu Aug 12 08:35:24 2010 New Revision: 211212 URL: http://svn.freebsd.org/changeset/base/211212 Log: Softdep_process_worklist() should unsuspend not only before processing the worklist (in softdep_process_journal), but also after flushing the workitems. Might be, we should even do this before bwillwrite() too, but this seems to be not needed for now. Fs might be suspended during processing the queue, and then there is nobody around to unsuspend. In collaboration with:pho Tested by:bz Reviewed by: jeff Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c == --- head/sys/ufs/ffs/ffs_softdep.c Thu Aug 12 06:20:54 2010 (r211211) +++ head/sys/ufs/ffs/ffs_softdep.c Thu Aug 12 08:35:24 2010 (r211212) @@ -857,6 +857,7 @@ static int journal_mount(struct mount *, static void journal_unmount(struct mount *); static int journal_space(struct ufsmount *, int); static void journal_suspend(struct ufsmount *); +static int journal_unsuspend(struct ufsmount *ump); static void softdep_prelink(struct vnode *, struct vnode *); static void add_to_journal(struct worklist *); static void remove_from_journal(struct worklist *); @@ -1390,6 +1391,8 @@ softdep_process_worklist(mp, full) if (!full starttime != time_second) break; } + if (full == 0) + journal_unsuspend(ump); FREE_LOCK(lk); return (matchcnt); } @@ -2436,6 +2439,27 @@ journal_suspend(ump) MNT_IUNLOCK(mp); } +static int +journal_unsuspend(struct ufsmount *ump) +{ + struct jblocks *jblocks; + struct mount *mp; + + mp = UFSTOVFS(ump); + jblocks = ump-softdep_jblocks; + + if (jblocks != NULL jblocks-jb_suspended + journal_space(ump, jblocks-jb_min)) { + jblocks-jb_suspended = 0; + FREE_LOCK(lk); + mp-mnt_susp_owner = curthread; + vfs_write_resume(mp); + ACQUIRE_LOCK(lk); + return (1); + } + return (0); +} + /* * Called before any allocation function to be certain that there is * sufficient space in the journal prior to creating any new records. @@ -2852,15 +2876,9 @@ softdep_process_journal(mp, flags) * space either try to sync it here to make some progress or * unsuspend it if we already have. */ - if (flags == 0 jblocks jblocks-jb_suspended) { - if (journal_space(ump, jblocks-jb_min)) { - FREE_LOCK(lk); - jblocks-jb_suspended = 0; - mp-mnt_susp_owner = curthread; - vfs_write_resume(mp); - ACQUIRE_LOCK(lk); + if (flags == 0 jblocks-jb_suspended) { + if (journal_unsuspend(ump)) return; - } FREE_LOCK(lk); VFS_SYNC(mp, MNT_NOWAIT); ffs_sbupdate(ump, MNT_WAIT, 0); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r211213 - head/sys/kern
Author: kib Date: Thu Aug 12 08:36:23 2010 New Revision: 211213 URL: http://svn.freebsd.org/changeset/base/211213 Log: The buffers b_vflags field is not always properly protected by bufobj lock. If b_bufobj is not NULL, then bufobj lock should be held when manipulating the flags. Not doing this sometimes leaves BV_BKGRDINPROG to be erronously set, causing softdep' getdirtybuf() to stuck indefinitely in getbuf sleep, waiting for background write to finish which is not actually performed. Add BO_LOCK() in the cases where it was missed. In collaboration with:pho Tested by:bz Reviewed by: jeff MFC after:1 month Modified: head/sys/kern/vfs_bio.c head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_bio.c == --- head/sys/kern/vfs_bio.c Thu Aug 12 08:35:24 2010(r211212) +++ head/sys/kern/vfs_bio.c Thu Aug 12 08:36:23 2010(r211213) @@ -398,6 +398,8 @@ bufcountwakeup(struct buf *bp) KASSERT((bp-b_vflags BV_INFREECNT) == 0, (buf %p already counted as free, bp)); + if (bp-b_bufobj != NULL) + mtx_assert(BO_MTX(bp-b_bufobj), MA_OWNED); bp-b_vflags |= BV_INFREECNT; old = atomic_fetchadd_int(numfreebuffers, 1); KASSERT(old = 0 old nbuf, @@ -714,6 +716,8 @@ bremfree(struct buf *bp) if ((bp-b_flags B_INVAL) || (bp-b_flags B_DELWRI) == 0) { KASSERT((bp-b_vflags BV_INFREECNT) != 0, (buf %p not counted in numfreebuffers, bp)); + if (bp-b_bufobj != NULL) + mtx_assert(BO_MTX(bp-b_bufobj), MA_OWNED); bp-b_vflags = ~BV_INFREECNT; old = atomic_fetchadd_int(numfreebuffers, -1); KASSERT(old 0, (numfreebuffers dropped to %d, old - 1)); @@ -770,6 +774,8 @@ bremfreel(struct buf *bp) if ((bp-b_flags B_INVAL) || (bp-b_flags B_DELWRI) == 0) { KASSERT((bp-b_vflags BV_INFREECNT) != 0, (buf %p not counted in numfreebuffers, bp)); + if (bp-b_bufobj != NULL) + mtx_assert(BO_MTX(bp-b_bufobj), MA_OWNED); bp-b_vflags = ~BV_INFREECNT; old = atomic_fetchadd_int(numfreebuffers, -1); KASSERT(old 0, (numfreebuffers dropped to %d, old - 1)); @@ -1412,8 +1418,16 @@ brelse(struct buf *bp) /* enqueue */ mtx_lock(bqlock); /* Handle delayed bremfree() processing. */ - if (bp-b_flags B_REMFREE) + if (bp-b_flags B_REMFREE) { + struct bufobj *bo; + + bo = bp-b_bufobj; + if (bo != NULL) + BO_LOCK(bo); bremfreel(bp); + if (bo != NULL) + BO_UNLOCK(bo); + } if (bp-b_qindex != QUEUE_NONE) panic(brelse: free buffer onto another queue???); @@ -1474,8 +1488,16 @@ brelse(struct buf *bp) * if B_INVAL is set ). */ - if (!(bp-b_flags B_DELWRI)) + if (!(bp-b_flags B_DELWRI)) { + struct bufobj *bo; + + bo = bp-b_bufobj; + if (bo != NULL) + BO_LOCK(bo); bufcountwakeup(bp); + if (bo != NULL) + BO_UNLOCK(bo); + } /* * Something we can maybe free or reuse @@ -1504,6 +1526,8 @@ brelse(struct buf *bp) void bqrelse(struct buf *bp) { + struct bufobj *bo; + CTR3(KTR_BUF, bqrelse(%p) vp %p flags %X, bp, bp-b_vp, bp-b_flags); KASSERT(!(bp-b_flags (B_CLUSTER|B_PAGING)), (bqrelse: inappropriate B_PAGING or B_CLUSTER bp %p, bp)); @@ -1514,10 +1538,15 @@ bqrelse(struct buf *bp) return; } + bo = bp-b_bufobj; if (bp-b_flags B_MANAGED) { if (bp-b_flags B_REMFREE) { mtx_lock(bqlock); + if (bo != NULL) + BO_LOCK(bo); bremfreel(bp); + if (bo != NULL) + BO_UNLOCK(bo); mtx_unlock(bqlock); } bp-b_flags = ~(B_ASYNC | B_NOCACHE | B_AGE | B_RELBUF); @@ -1527,8 +1556,13 @@ bqrelse(struct buf *bp) mtx_lock(bqlock); /* Handle delayed bremfree() processing. */ - if (bp-b_flags B_REMFREE) + if (bp-b_flags B_REMFREE) { + if (bo != NULL) + BO_LOCK(bo); bremfreel(bp); + if (bo != NULL) + BO_UNLOCK(bo); + } if (bp-b_qindex != QUEUE_NONE) panic(bqrelse: free buffer onto another queue???); /* buffers with stale but valid contents */ @@ -1563,8 +1597,13 @@ bqrelse(struct buf *bp) } mtx_unlock(bqlock); -
svn commit: r211214 - head/sys/dev/ath/ath_hal/ar5416
Author: adrian Date: Thu Aug 12 08:39:54 2010 New Revision: 211214 URL: http://svn.freebsd.org/changeset/base/211214 Log: * Fix indentation * Restore comment erroneously deleted from the previous commit Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c == --- head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.cThu Aug 12 08:36:23 2010(r211213) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.cThu Aug 12 08:39:54 2010(r211214) @@ -562,6 +562,7 @@ ar5416LoadNF(struct ath_hal *ah, const s OS_REG_CLR_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_NO_UPDATE_NF); OS_REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_NF); + /* Wait for load to complete, should be fast, a few 10s of us. */ if (! ar5212WaitNFCalComplete(ah, 1000)) { /* * We timed out waiting for the noisefloor to load, probably due to an @@ -575,7 +576,7 @@ ar5416LoadNF(struct ath_hal *ah, const s HALDEBUG(ah, HAL_DEBUG_ANY, Timeout while waiting for nf to load: AR_PHY_AGC_CONTROL=0x%x\n, OS_REG_READ(ah, AR_PHY_AGC_CONTROL)); - return; + return; } /* ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r211215 - head/sys/mips/mips
Author: jchandra Date: Thu Aug 12 09:03:21 2010 New Revision: 211215 URL: http://svn.freebsd.org/changeset/base/211215 Log: Re-arrange the pmap calls that use smp_rendezvous() on SMP, so that their per-cpu variants are also available to be called. The per-cpu variants are needed for some later optimizations. Also remove unnecessary casts, do some style fixes. Reviewed by: alc, neel Modified: head/sys/mips/mips/pmap.c Modified: head/sys/mips/mips/pmap.c == --- head/sys/mips/mips/pmap.c Thu Aug 12 08:39:54 2010(r211214) +++ head/sys/mips/mips/pmap.c Thu Aug 12 09:03:21 2010(r211215) @@ -173,7 +173,6 @@ static void pmap_pvh_free(struct md_page static pv_entry_t pmap_pvh_remove(struct md_page *pvh, pmap_t pmap, vm_offset_t va); static __inline void pmap_changebit(vm_page_t m, int bit, boolean_t setem); - static vm_page_t pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, vm_page_t mpte); static int pmap_remove_pte(struct pmap *pmap, pt_entry_t *ptq, vm_offset_t va); @@ -181,7 +180,8 @@ static void pmap_remove_page(struct pmap static void pmap_remove_entry(struct pmap *pmap, vm_page_t m, vm_offset_t va); static boolean_t pmap_try_insert_pv_entry(pmap_t pmap, vm_page_t mpte, vm_offset_t va, vm_page_t m); -static __inline void pmap_invalidate_page(pmap_t pmap, vm_offset_t va); +static void pmap_invalidate_all(pmap_t pmap); +static void pmap_invalidate_page(pmap_t pmap, vm_offset_t va); static int _pmap_unwire_pte_hold(pmap_t pmap, vm_offset_t va, vm_page_t m); static vm_page_t pmap_allocpte(pmap_t pmap, vm_offset_t va, int flags); @@ -592,61 +592,100 @@ pmap_nw_modified(pt_entry_t pte) else return (0); } - #endif +static __inline void +pmap_invalidate_all_local(pmap_t pmap) +{ + + if (pmap == kernel_pmap) { + tlb_invalidate_all(); + return; + } + if (pmap-pm_active PCPU_GET(cpumask)) + tlb_invalidate_all_user(pmap); + else + pmap-pm_asid[PCPU_GET(cpuid)].gen = 0; +} + +#ifdef SMP static void pmap_invalidate_all(pmap_t pmap) { -#ifdef SMP - smp_rendezvous(0, pmap_invalidate_all_action, 0, (void *)pmap); + + smp_rendezvous(0, pmap_invalidate_all_action, 0, pmap); } static void pmap_invalidate_all_action(void *arg) { - pmap_t pmap = (pmap_t)arg; + pmap_invalidate_all_local((pmap_t)arg); +} +#else +static void +pmap_invalidate_all(pmap_t pmap) +{ + + pmap_invalidate_all_local(pmap); +} #endif - if (pmap == kernel_pmap) { - tlb_invalidate_all(); +static __inline void +pmap_invalidate_page_local(pmap_t pmap, vm_offset_t va) +{ + + if (is_kernel_pmap(pmap)) { + tlb_invalidate_address(pmap, va); return; } - - if (pmap-pm_active PCPU_GET(cpumask)) - tlb_invalidate_all_user(pmap); - else + if (pmap-pm_asid[PCPU_GET(cpuid)].gen != PCPU_GET(asid_generation)) + return; + else if (!(pmap-pm_active PCPU_GET(cpumask))) { pmap-pm_asid[PCPU_GET(cpuid)].gen = 0; + return; + } + tlb_invalidate_address(pmap, va); } +#ifdef SMP struct pmap_invalidate_page_arg { pmap_t pmap; vm_offset_t va; }; -static __inline void +static void pmap_invalidate_page(pmap_t pmap, vm_offset_t va) { -#ifdef SMP struct pmap_invalidate_page_arg arg; arg.pmap = pmap; arg.va = va; - - smp_rendezvous(0, pmap_invalidate_page_action, 0, (void *)arg); + smp_rendezvous(0, pmap_invalidate_page_action, 0, arg); } static void pmap_invalidate_page_action(void *arg) { - pmap_t pmap = ((struct pmap_invalidate_page_arg *)arg)-pmap; - vm_offset_t va = ((struct pmap_invalidate_page_arg *)arg)-va; + struct pmap_invalidate_page_arg *p = arg; + + pmap_invalidate_page_local(p-pmap, p-va); +} +#else +static void +pmap_invalidate_page(pmap_t pmap, vm_offset_t va) +{ + pmap_invalidate_page_local(pmap, va); +} #endif +static __inline void +pmap_update_page_local(pmap_t pmap, vm_offset_t va, pt_entry_t pte) +{ + if (is_kernel_pmap(pmap)) { - tlb_invalidate_address(pmap, va); + tlb_update(pmap, va, pte); return; } if (pmap-pm_asid[PCPU_GET(cpuid)].gen != PCPU_GET(asid_generation)) @@ -655,9 +694,10 @@ pmap_invalidate_page_action(void *arg) pmap-pm_asid[PCPU_GET(cpuid)].gen = 0; return; } - tlb_invalidate_address(pmap, va); + tlb_update(pmap, va, pte); } +#ifdef SMP struct pmap_update_page_arg { pmap_t pmap; vm_offset_t va; @@ -667,36 +707,29 @@ struct pmap_update_page_arg { void pmap_update_page(pmap_t pmap, vm_offset_t va, pt_entry_t pte) { -#ifdef SMP
svn commit: r211216 - head/sys/mips/mips
Author: jchandra Date: Thu Aug 12 09:15:27 2010 New Revision: 211216 URL: http://svn.freebsd.org/changeset/base/211216 Log: Optimization for pmap_kenter(), call pmap_update_page() only when necessary. On SMP, pmap_update_page() can be costly as it needs a a smp_rendezvous(). Reviewed by: alc, neel Obtained from:jmallett (http://svn.freebsd.org/base/user/jmallett/octeon) Modified: head/sys/mips/mips/pmap.c Modified: head/sys/mips/mips/pmap.c == --- head/sys/mips/mips/pmap.c Thu Aug 12 09:03:21 2010(r211215) +++ head/sys/mips/mips/pmap.c Thu Aug 12 09:15:27 2010(r211216) @@ -810,7 +810,8 @@ pmap_kenter(vm_offset_t va, vm_paddr_t p pte = pmap_pte(kernel_pmap, va); opte = *pte; *pte = npte; - pmap_update_page(kernel_pmap, va, npte); + if (pte_test(opte, PTE_V) opte != npte) + pmap_update_page(kernel_pmap, va, npte); } /* ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r211217 - in head/sys/mips: include mips
Author: jchandra Date: Thu Aug 12 10:09:28 2010 New Revision: 211217 URL: http://svn.freebsd.org/changeset/base/211217 Log: Implement pmap changes suggested by alc@: 1. Move dirty bit emulation code that is duplicted for kernel and user in trap.c to a function pmap_emulate_modified() in pmap.c. 2. While doing dirty bit emulation, it is not necessary to update the TLB entry on all CPUs using smp_rendezvous(), we can just update the TLB entry on the current CPU, and let the other CPUs update their TLB entry lazily if they get an exception. Reviewed by: alc, neel Modified: head/sys/mips/include/pmap.h head/sys/mips/mips/pmap.c head/sys/mips/mips/trap.c Modified: head/sys/mips/include/pmap.h == --- head/sys/mips/include/pmap.hThu Aug 12 09:15:27 2010 (r211216) +++ head/sys/mips/include/pmap.hThu Aug 12 10:09:28 2010 (r211217) @@ -157,16 +157,14 @@ void pmap_bootstrap(void); void *pmap_mapdev(vm_offset_t, vm_size_t); void pmap_unmapdev(vm_offset_t, vm_size_t); vm_offset_t pmap_steal_memory(vm_size_t size); -void pmap_set_modified(vm_offset_t pa); int page_is_managed(vm_offset_t pa); void pmap_kenter(vm_offset_t va, vm_paddr_t pa); void pmap_kremove(vm_offset_t va); void *pmap_kenter_temporary(vm_paddr_t pa, int i); void pmap_kenter_temporary_free(vm_paddr_t pa); int pmap_compute_pages_to_dump(void); -void pmap_update_page(pmap_t pmap, vm_offset_t va, pt_entry_t pte); void pmap_flush_pvcache(vm_page_t m); - +int pmap_emulate_modified(pmap_t pmap, vm_offset_t va); #endif /* _KERNEL */ #endif /* !LOCORE */ Modified: head/sys/mips/mips/pmap.c == --- head/sys/mips/mips/pmap.c Thu Aug 12 09:15:27 2010(r211216) +++ head/sys/mips/mips/pmap.c Thu Aug 12 10:09:28 2010(r211217) @@ -180,6 +180,7 @@ static void pmap_remove_page(struct pmap static void pmap_remove_entry(struct pmap *pmap, vm_page_t m, vm_offset_t va); static boolean_t pmap_try_insert_pv_entry(pmap_t pmap, vm_page_t mpte, vm_offset_t va, vm_page_t m); +static void pmap_update_page(pmap_t pmap, vm_offset_t va, pt_entry_t pte); static void pmap_invalidate_all(pmap_t pmap); static void pmap_invalidate_page(pmap_t pmap, vm_offset_t va); static int _pmap_unwire_pte_hold(pmap_t pmap, vm_offset_t va, vm_page_t m); @@ -704,7 +705,7 @@ struct pmap_update_page_arg { pt_entry_t pte; }; -void +static void pmap_update_page(pmap_t pmap, vm_offset_t va, pt_entry_t pte) { struct pmap_update_page_arg arg; @@ -723,7 +724,7 @@ pmap_update_page_action(void *arg) pmap_update_page_local(p-pmap, p-va, p-pte); } #else -void +static void pmap_update_page(pmap_t pmap, vm_offset_t va, pt_entry_t pte) { @@ -3265,15 +3266,49 @@ init_pte_prot(vm_offset_t va, vm_page_t } /* - * pmap_set_modified: + * pmap_emulate_modified : do dirty bit emulation * - * Sets the page modified and reference bits for the specified page. + * On SMP, update just the local TLB, other CPUs will update their + * TLBs from PTE lazily, if they get the exception. + * Returns 0 in case of sucess, 1 if the page is read only and we + * need to fault. */ -void -pmap_set_modified(vm_offset_t pa) +int +pmap_emulate_modified(pmap_t pmap, vm_offset_t va) { + vm_page_t m; + pt_entry_t *pte; + vm_offset_t pa; - PHYS_TO_VM_PAGE(pa)-md.pv_flags |= (PV_TABLE_REF | PV_TABLE_MOD); + PMAP_LOCK(pmap); + pte = pmap_pte(pmap, va); + if (pte == NULL) + panic(pmap_emulate_modified: can't find PTE); +#ifdef SMP + /* It is possible that some other CPU changed m-bit */ + if (!pte_test(pte, PTE_V) || pte_test(pte, PTE_D)) { + pmap_update_page_local(pmap, va, *pte); + PMAP_UNLOCK(pmap); + return (0); + } +#else + if (!pte_test(pte, PTE_V) || pte_test(pte, PTE_D)) + panic(pmap_emulate_modified: invalid pte); +#endif + if (pte_test(pte, PTE_RO)) { + /* write to read only page in the kernel */ + PMAP_UNLOCK(pmap); + return (1); + } + pte_set(pte, PTE_D); + pmap_update_page_local(pmap, va, *pte); + pa = TLBLO_PTE_TO_PA(*pte); + if (!page_is_managed(pa)) + panic(pmap_emulate_modified: unmanaged page); + m = PHYS_TO_VM_PAGE(pa); + m-md.pv_flags |= (PV_TABLE_REF | PV_TABLE_MOD); + PMAP_UNLOCK(pmap); + return (0); } /* Modified: head/sys/mips/mips/trap.c == --- head/sys/mips/mips/trap.c Thu Aug 12 09:15:27 2010(r211216) +++ head/sys/mips/mips/trap.c Thu Aug 12 10:09:28 2010(r211217) @@ -281,7 +281,6 @@ trap(struct trapframe *trapframe)
svn commit: r211218 - head/sys/mips/mips
Author: jchandra Date: Thu Aug 12 11:00:45 2010 New Revision: 211218 URL: http://svn.freebsd.org/changeset/base/211218 Log: SMP support in n64. - Enable KX and UX bits on CPU startup for non-boot CPUs - Keep the KX bit when in userspace - XTLB handler needs it to access PCPU data - revert r210638 partly - we don't need to enable KX on kernel entry now Reviewed by: jmallett, imp Modified: head/sys/mips/mips/exception.S head/sys/mips/mips/mpboot.S head/sys/mips/mips/pm_machdep.c head/sys/mips/mips/vm_machdep.c Modified: head/sys/mips/mips/exception.S == --- head/sys/mips/mips/exception.S Thu Aug 12 10:09:28 2010 (r211217) +++ head/sys/mips/mips/exception.S Thu Aug 12 11:00:45 2010 (r211218) @@ -434,12 +434,6 @@ NNON_LEAF(MipsUserGenException, CALLFRAM /* * Save all of the registers except for the kernel temporaries in u.u_pcb. */ - mfc0k0, MIPS_COP_0_STATUS - HAZARD_DELAY -#ifdef __mips_n64 - ori k1, k0, MIPS_SR_KX - mtc0k1, MIPS_COP_0_STATUS -#endif GET_CPU_PCPU(k1) PTR_L k1, PC_CURPCB(k1) SAVE_U_PCB_REG(AT, AST, k1) @@ -457,7 +451,7 @@ NNON_LEAF(MipsUserGenException, CALLFRAM SAVE_U_PCB_REG(t2, T2, k1) SAVE_U_PCB_REG(t3, T3, k1) SAVE_U_PCB_REG(ta0, TA0, k1) - movea0, k0 # First arg is the status reg. + mfc0a0, MIPS_COP_0_STATUS # First arg is the status reg. SAVE_U_PCB_REG(ta1, TA1, k1) SAVE_U_PCB_REG(ta2, TA2, k1) SAVE_U_PCB_REG(ta3, TA3, k1) @@ -656,12 +650,6 @@ NNON_LEAF(MipsUserIntr, CALLFRAME_SIZ, r * Save the relevant user registers into the u.u_pcb struct. * We don't need to save s0 - s8 because the compiler does it for us. */ - mfc0k0, MIPS_COP_0_STATUS - HAZARD_DELAY -#ifdef __mips_n64 - ori k1, k0, MIPS_SR_KX - mtc0k1, MIPS_COP_0_STATUS -#endif GET_CPU_PCPU(k1) PTR_L k1, PC_CURPCB(k1) SAVE_U_PCB_REG(AT, AST, k1) @@ -700,7 +688,7 @@ NNON_LEAF(MipsUserIntr, CALLFRAME_SIZ, r mflov0 # get lo/hi late to avoid stall mfhiv1 - movea0, k0 + mfc0a0, MIPS_COP_0_STATUS mfc0a1, MIPS_COP_0_CAUSE MFC0a3, MIPS_COP_0_EXC_PC SAVE_U_PCB_REG(v0, MULLO, k1) Modified: head/sys/mips/mips/mpboot.S == --- head/sys/mips/mips/mpboot.S Thu Aug 12 10:09:28 2010(r211217) +++ head/sys/mips/mips/mpboot.S Thu Aug 12 11:00:45 2010(r211218) @@ -36,7 +36,8 @@ .setnoat .setnoreorder -#ifdef CPU_CNMIPS +/* XXX move this to a header file */ +#if defined(CPU_CNMIPS) #define CLEAR_STATUS \ mfc0a0, MIPS_COP_0_STATUS ;\ li a2, (MIPS_SR_KX | MIPS_SR_SX | MIPS_SR_UX) ; \ @@ -44,6 +45,10 @@ li a2, ~(MIPS_SR_INT_IE | MIPS_SR_EXL | SR_KSU_USER | MIPS_SR_BEV) ; \ and a0, a0, a2 ; \ mtc0a0, MIPS_COP_0_STATUS +#elif defined(__mips_n64) +#define CLEAR_STATUS \ + li a0, (MIPS_SR_KX | MIPS_SR_UX) ; \ + mtc0a0, MIPS_COP_0_STATUS #else #define CLEAR_STATUS \ mtc0zero, MIPS_COP_0_STATUS Modified: head/sys/mips/mips/pm_machdep.c == --- head/sys/mips/mips/pm_machdep.c Thu Aug 12 10:09:28 2010 (r211217) +++ head/sys/mips/mips/pm_machdep.c Thu Aug 12 11:00:45 2010 (r211218) @@ -517,7 +517,7 @@ exec_setregs(struct thread *td, struct i #if defined(__mips_n32) td-td_frame-sr |= MIPS_SR_PX; #elif defined(__mips_n64) - td-td_frame-sr |= MIPS_SR_PX | MIPS_SR_UX; + td-td_frame-sr |= MIPS_SR_PX | MIPS_SR_UX | MIPS_SR_KX; #endif #ifdef CPU_CNMIPS td-td_frame-sr |= MIPS_SR_COP_2_BIT | MIPS_SR_PX | MIPS_SR_UX | Modified: head/sys/mips/mips/vm_machdep.c == --- head/sys/mips/mips/vm_machdep.c Thu Aug 12 10:09:28 2010 (r211217) +++ head/sys/mips/mips/vm_machdep.c Thu Aug 12 11:00:45 2010 (r211218) @@ -419,7 +419,7 @@ cpu_set_upcall_kse(struct thread *td, vo #if defined(__mips_n32) td-td_frame-sr |= MIPS_SR_PX; #elif defined(__mips_n64) - td-td_frame-sr |= MIPS_SR_PX | MIPS_SR_UX; + td-td_frame-sr |= MIPS_SR_PX | MIPS_SR_UX | MIPS_SR_KX; #endif #ifdef CPU_CNMIPS tf-sr |= MIPS_SR_INT_IE | MIPS_SR_COP_0_BIT | MIPS_SR_PX | MIPS_SR_UX | ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r211219 - head/usr.sbin/acpi/acpidump
Author: takawata Date: Thu Aug 12 11:01:38 2010 New Revision: 211219 URL: http://svn.freebsd.org/changeset/base/211219 Log: Fix tindebox breakage about format warning. Modified: head/usr.sbin/acpi/acpidump/acpi.c Modified: head/usr.sbin/acpi/acpidump/acpi.c == --- head/usr.sbin/acpi/acpidump/acpi.c Thu Aug 12 11:00:45 2010 (r211218) +++ head/usr.sbin/acpi/acpidump/acpi.c Thu Aug 12 11:01:38 2010 (r211219) @@ -646,7 +646,7 @@ acpi_handle_tcpa(ACPI_TABLE_HEADER *sdp) printf(END_COMMENT); return; } - printf(\tClass %d Base Address 0x%jx Length %lld\n\n, + printf(\tClass %d Base Address 0x%jx Length %llu\n\n, tcpa-platform_class, paddr, len); if (len == 0) { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r211219 - head/usr.sbin/acpi/acpidump
On Thursday 12 August 2010 19:01:38 Takanori Watanabe wrote: Author: takawata Date: Thu Aug 12 11:01:38 2010 New Revision: 211219 URL: http://svn.freebsd.org/changeset/base/211219 Log: Fix tindebox breakage about format warning. Modified: head/usr.sbin/acpi/acpidump/acpi.c Modified: head/usr.sbin/acpi/acpidump/acpi.c === === --- head/usr.sbin/acpi/acpidump/acpi.cThu Aug 12 11:00:45 2010 (r211218) +++ head/usr.sbin/acpi/acpidump/acpi.cThu Aug 12 11:01:38 2010 (r211219) @@ -646,7 +646,7 @@ acpi_handle_tcpa(ACPI_TABLE_HEADER *sdp) printf(END_COMMENT); return; } - printf(\tClass %d Base Address 0x%jx Length %lld\n\n, + printf(\tClass %d Base Address 0x%jx Length %llu\n\n, %llu didn't work on my amd64 -r211091M buildworld only able to proceed when I replaced %lld with %lu -al -- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail? ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r211220 - in head/sys: amd64/amd64 i386/i386
Author: attilio Date: Thu Aug 12 13:46:43 2010 New Revision: 211220 URL: http://svn.freebsd.org/changeset/base/211220 Log: Revert r211176: As long as interrupts are disabled and there is not explicit call to sched_add() there can't be any preemption there, thus the calls may be consistent. Reported by: kib, jhb Modified: head/sys/amd64/amd64/mp_machdep.c head/sys/i386/i386/mp_machdep.c Modified: head/sys/amd64/amd64/mp_machdep.c == --- head/sys/amd64/amd64/mp_machdep.c Thu Aug 12 11:01:38 2010 (r211219) +++ head/sys/amd64/amd64/mp_machdep.c Thu Aug 12 13:46:43 2010 (r211220) @@ -1324,10 +1324,8 @@ cpustop_handler(void) cpumask_t cpumask; u_int cpu; - sched_pin(); cpu = PCPU_GET(cpuid); cpumask = PCPU_GET(cpumask); - sched_unpin(); savectx(stoppcbs[cpu]); @@ -1358,10 +1356,8 @@ cpususpend_handler(void) register_t cr3, rf; u_int cpu; - sched_pin(); cpu = PCPU_GET(cpuid); cpumask = PCPU_GET(cpumask); - sched_unpin(); rf = intr_disable(); cr3 = rcr3(); @@ -1542,14 +1538,10 @@ mp_grab_cpu_hlt(void) #endif int retval; -#ifdef MP_WATCHDOG - sched_pin(); mask = PCPU_GET(cpumask); +#ifdef MP_WATCHDOG cpuid = PCPU_GET(cpuid); - sched_unpin(); ap_watchdog(cpuid); -#else - mask = PCPU_GET(cpumask); #endif retval = 0; Modified: head/sys/i386/i386/mp_machdep.c == --- head/sys/i386/i386/mp_machdep.c Thu Aug 12 11:01:38 2010 (r211219) +++ head/sys/i386/i386/mp_machdep.c Thu Aug 12 13:46:43 2010 (r211220) @@ -1411,10 +1411,8 @@ cpustop_handler(void) cpumask_t cpumask; u_int cpu; - sched_pin(); cpu = PCPU_GET(cpuid); cpumask = PCPU_GET(cpumask); - sched_unpin(); savectx(stoppcbs[cpu]); @@ -1588,14 +1586,10 @@ mp_grab_cpu_hlt(void) #endif int retval; -#ifdef MP_WATCHDOG - sched_pin(); mask = PCPU_GET(cpumask); +#ifdef MP_WATCHDOG cpuid = PCPU_GET(cpuid); - sched_unpin(); ap_watchdog(cpuid); -#else - mask = PCPU_GET(cpumask); #endif retval = 0; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r211221 - head/usr.sbin/acpi/acpidump
Author: takawata Date: Thu Aug 12 13:58:46 2010 New Revision: 211221 URL: http://svn.freebsd.org/changeset/base/211221 Log: Fix breakage on 64bit architecture by using inttypes.h macro. Modified: head/usr.sbin/acpi/acpidump/acpi.c Modified: head/usr.sbin/acpi/acpidump/acpi.c == --- head/usr.sbin/acpi/acpidump/acpi.c Thu Aug 12 13:46:43 2010 (r211220) +++ head/usr.sbin/acpi/acpidump/acpi.c Thu Aug 12 13:58:46 2010 (r211221) @@ -40,6 +40,7 @@ #include stdlib.h #include string.h #include unistd.h +#include inttypes.h #include acpidump.h @@ -646,7 +647,7 @@ acpi_handle_tcpa(ACPI_TABLE_HEADER *sdp) printf(END_COMMENT); return; } - printf(\tClass %d Base Address 0x%jx Length %llu\n\n, + printf(\tClass %d Base Address 0x%jx Length % PRIu64 \n\n, tcpa-platform_class, paddr, len); if (len == 0) { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r211222 - head/usr.sbin/crunch/crunchide
Author: adrian Date: Thu Aug 12 14:16:57 2010 New Revision: 211222 URL: http://svn.freebsd.org/changeset/base/211222 Log: Fix crunchide to work on sparc64 and perhaps other 64 bit platforms. I used the wrong type when setting st_name in the symbol table entry struct. It's an Elf64_Word which is defined as an unsigned 32 bit int on both 32 and 64 bit platforms. To make things sensible, define some new macros to use as word macros and use those, rather than simply using the explicit 32 bit macros. Modified: head/usr.sbin/crunch/crunchide/exec_elf32.c Modified: head/usr.sbin/crunch/crunchide/exec_elf32.c == --- head/usr.sbin/crunch/crunchide/exec_elf32.c Thu Aug 12 13:58:46 2010 (r211221) +++ head/usr.sbin/crunch/crunchide/exec_elf32.c Thu Aug 12 14:16:57 2010 (r211222) @@ -60,10 +60,15 @@ __FBSDID($FreeBSD$); #include sys/elf32.h #definexewtoh(x) ((data == ELFDATA2MSB) ? be32toh(x) : le32toh(x)) #definehtoxew(x) ((data == ELFDATA2MSB) ? htobe32(x) : htole32(x)) +#definewewtoh(x) ((data == ELFDATA2MSB) ? be32toh(x) : le32toh(x)) +#definehtowew(x) ((data == ELFDATA2MSB) ? htobe32(x) : htole32(x)) #elif (ELFSIZE == 64) #include sys/elf64.h #definexewtoh(x) ((data == ELFDATA2MSB) ? be64toh(x) : le64toh(x)) #definehtoxew(x) ((data == ELFDATA2MSB) ? htobe64(x) : htole64(x)) +/* elf64 Elf64_Word are 32 bits */ +#definewewtoh(x) ((data == ELFDATA2MSB) ? be32toh(x) : le32toh(x)) +#definehtowew(x) ((data == ELFDATA2MSB) ? htobe32(x) : htole32(x)) #endif #include sys/elf_generic.h @@ -345,7 +350,7 @@ ELFNAMEEND(hide)(int fd, const char *fn) goto bad; } - sp-st_name = htoxew(nstrtab_nextoff); + sp-st_name = htowew(nstrtab_nextoff); /* if it's a keeper or is undefined, don't rename it. */ if (in_keep_list(symname) || ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r211221 - head/usr.sbin/acpi/acpidump
Takanori Watanabe takaw...@freebsd.org writes: - printf(\tClass %d Base Address 0x%jx Length %llu\n\n, + printf(\tClass %d Base Address 0x%jx Length % PRIu64 \n\n, tcpa-platform_class, paddr, len); This is just as wrong as the previous attempt. 1) platform_class is not an int. 2) paddr is not a uintmax_t. 3) so far, we've avoided using the PRI macros. Slightly better: printf(\tClass %u Base Address 0x%jx Length %ju\n\n, (unsigned int)tcpa-platform_class, (uintmax_t)paddr, (uintmax_t)len); but it would probably be easier to define paddr and len as unsigned long long instead of the misspelled u_int64_t, and use %llx and %llu. DES -- Dag-Erling Smørgrav - d...@des.no ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r211201 - in head: share/man/man4 sys/conf sys/dev/tpm sys/modules sys/modules/tpm
On 2010-08-12 02:42, Andrew Thompson wrote: --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/tpm.4 Thu Aug 12 00:16:18 2010(r211201) @@ -0,0 +1,74 @@ +.\ +.\ Copyright (c) 2010 Hans-J His name appears truncated here, the other files seem ok. The original diff that Hans-Jörg sent to -hackers had this too, either the diff tool didn't cope with 'ö', or the mailing list stripped it... ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r211226 - head/sys/fs/devfs
Author: jh Date: Thu Aug 12 15:29:07 2010 New Revision: 211226 URL: http://svn.freebsd.org/changeset/base/211226 Log: Allow user created symbolic links to cover device files and directories if the device file appears during or after the link creation. User created symbolic links are now inserted at the head of the directory entry list after the . and .. entries. A new directory entry flag DE_COVERED indicates that an entry is covered by a symbolic link. PR: kern/114057 Reviewed by: kib Idea from:kib Discussed on: freebsd-current (mostly silence) Modified: head/sys/fs/devfs/devfs.h head/sys/fs/devfs/devfs_devs.c head/sys/fs/devfs/devfs_vnops.c Modified: head/sys/fs/devfs/devfs.h == --- head/sys/fs/devfs/devfs.h Thu Aug 12 15:15:30 2010(r211225) +++ head/sys/fs/devfs/devfs.h Thu Aug 12 15:29:07 2010(r211226) @@ -126,10 +126,11 @@ struct devfs_dirent { struct cdev_priv*de_cdp; int de_inode; int de_flags; -#defineDE_WHITEOUT 0x1 -#defineDE_DOT 0x2 -#defineDE_DOTDOT 0x4 -#define DE_DOOMED 0x8 +#defineDE_WHITEOUT 0x01 +#defineDE_DOT 0x02 +#defineDE_DOTDOT 0x04 +#defineDE_DOOMED 0x08 +#defineDE_COVERED 0x10 int de_holdcnt; struct dirent *de_dirent; TAILQ_ENTRY(devfs_dirent) de_list; @@ -182,7 +183,7 @@ void devfs_unmount_final(struct devfs_mo struct devfs_dirent *devfs_newdirent (char *name, int namelen); struct devfs_dirent *devfs_parent_dirent(struct devfs_dirent *de); struct devfs_dirent *devfs_vmkdir (struct devfs_mount *, char *name, int namelen, struct devfs_dirent *dotdot, u_int inode); -struct devfs_dirent *devfs_find (struct devfs_dirent *dd, const char *name, int namelen); +struct devfs_dirent *devfs_find(struct devfs_dirent *dd, const char *name, int namelen, int type); #endif /* _KERNEL */ Modified: head/sys/fs/devfs/devfs_devs.c == --- head/sys/fs/devfs/devfs_devs.c Thu Aug 12 15:15:30 2010 (r211225) +++ head/sys/fs/devfs/devfs_devs.c Thu Aug 12 15:29:07 2010 (r211226) @@ -158,13 +158,15 @@ devfs_free(struct cdev *cdev) } struct devfs_dirent * -devfs_find(struct devfs_dirent *dd, const char *name, int namelen) +devfs_find(struct devfs_dirent *dd, const char *name, int namelen, int type) { struct devfs_dirent *de; TAILQ_FOREACH(de, dd-de_dlist, de_list) { if (namelen != de-de_dirent-d_namlen) continue; + if (type != 0 type != de-de_dirent-d_type) + continue; if (bcmp(name, de-de_dirent-d_name, namelen) != 0) continue; break; @@ -235,14 +237,19 @@ devfs_vmkdir(struct devfs_mount *dmp, ch else dd-de_inode = alloc_unr(devfs_inos); - /* Create the . entry in the new directory */ + /* +* . and .. are always the two first entries in the +* de_dlist list. +* +* Create the . entry in the new directory. +*/ de = devfs_newdirent(., 1); de-de_dirent-d_type = DT_DIR; de-de_flags |= DE_DOT; TAILQ_INSERT_TAIL(dd-de_dlist, de, de_list); de-de_dir = dd; - /* Create the .. entry in the new directory */ + /* Create the .. entry in the new directory. */ de = devfs_newdirent(.., 2); de-de_dirent-d_type = DT_DIR; de-de_flags |= DE_DOTDOT; @@ -382,7 +389,7 @@ devfs_populate_loop(struct devfs_mount * struct devfs_dirent *de; struct devfs_dirent *dd; struct cdev *pdev; - int j; + int de_flags, j; char *q, *s; sx_assert(dm-dm_lock, SX_XLOCKED); @@ -454,12 +461,27 @@ devfs_populate_loop(struct devfs_mount * continue; if (*q != '/') break; - de = devfs_find(dd, s, q - s); + de = devfs_find(dd, s, q - s, 0); if (de == NULL) de = devfs_vmkdir(dm, s, q - s, dd, 0); + else if (de-de_dirent-d_type == DT_LNK) { + de = devfs_find(dd, s, q - s, DT_DIR); + if (de == NULL) + de = devfs_vmkdir(dm, s, q - s, dd, 0); + de-de_flags |= DE_COVERED; + } s = q + 1; dd = de; + KASSERT(dd-de_dirent-d_type == DT_DIR + (dd-de_flags (DE_DOT |
Re: svn commit: r211221 - head/usr.sbin/acpi/acpidump
Dag-Erling Smørgrav wrote: Takanori Watanabe takaw...@freebsd.org writes: - printf(\tClass %d Base Address 0x%jx Length %llu\n\n, + printf(\tClass %d Base Address 0x%jx Length % PRIu64 \n\n, tcpa-platform_class, paddr, len); This is just as wrong as the previous attempt. 1) platform_class is not an int. 2) paddr is not a uintmax_t. 3) so far, we've avoided using the PRI macros. Slightly better: printf(\tClass %u Base Address 0x%jx Length %ju\n\n, (unsigned int)tcpa-platform_class, (uintmax_t)paddr, (uintmax_t)len); but it would probably be easier to define paddr and len as unsigned long long instead of the misspelled u_int64_t, and use %llx and %llu. Depends. If the table defines a field to be a 64-bit integer, it is better to use an explicitly-64-bit integer type such as uint64_t rather than assuming that 'long long' is 64-bit. Other ACPI table definitions all use fixed-size types like uint32_t and uint64_t since the tables are defined as fixed-size fields, not as 'long' and 'int'. Using %j with uintmax_t casts is the solution used for other 64-bit fields in ACPI tables. -- John Baldwin ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r211201 - in head: share/man/man4 sys/conf sys/dev/tpm sys/modules sys/modules/tpm
On 12 Aug 2010, at 01:16, Takanori Watanabe wrote: Author: takawata Date: Thu Aug 12 00:16:18 2010 New Revision: 211201 URL: http://svn.freebsd.org/changeset/base/211201 Log: Add tpm(4) driver for Trusted Platform Module. You may want to look at http://bsssd.sourceforge.net/ . Submitted by: Hans-Joerg Hoexer hans-joerg_hoe...@genua.de Added: head/share/man/man4/tpm.4 (contents, props changed) head/sys/dev/tpm/ head/sys/dev/tpm/tpm.c (contents, props changed) head/sys/dev/tpm/tpm_acpi.c (contents, props changed) head/sys/dev/tpm/tpm_isa.c (contents, props changed) head/sys/dev/tpm/tpmvar.h (contents, props changed) head/sys/modules/tpm/ head/sys/modules/tpm/Makefile (contents, props changed) Modified: head/sys/conf/files.i386 head/sys/modules/Makefile This breaks pc98: === tpm (depend)rm -f .depend mkdep -f .depend -a -nostdinc -DPC98 -D_KERNEL -DKLD_MODULE -DHAVE_KERNEL_OPTI ON_HEADERS -I. -I@ -I@/contrib/altq -I/scratch/tmp/rpaulo/obj/pc98.i386/scratch/tmp/rpaulo/p4/dtrace/sys/GENERIC /scratch/tmp/rpaulo/p4/dtrace/sys/modules/tpm/. /../dev/tpm/tpm.c /scratch/tmp/rpaulo/p4/dtrace/sys/modules/tpm/../../dev/tpm/t pm_isa.c /scratch/tmp/rpaulo/p4/dtrace/sys/modules/tpm/../../dev/tpm/tpm_acpi.c In file included from /scratch/tmp/rpaulo/p4/dtrace/sys/modules/tpm/../../dev/tp m/tpm.c:42:@/isa/isareg.h:37:2: error: #error isareg.h is included from PC-9801 source In file included from /scratch/tmp/rpaulo/p4/dtrace/sys/modules/tpm/../../dev/tpm/tpm_isa.c:40: @/isa/isareg.h:37:2: error: #error isareg.h is included from PC-9801 source In file included from /scratch/tmp/rpaulo/p4/dtrace/sys/modules/tpm/../../dev/tpm/tpm_acpi.c:38: @/isa/isareg.h:37:2: error: #error isareg.h is included from PC-9801 sourceIn file included from @/contrib/dev/acpica/include/platform/acenv.h:197, from @/contrib/dev/acpica/include/acpi.h:128, from /scratch/tmp/rpaulo/p4/dtrace/sys/modules/tpm/../../dev/tp m/tpm_acpi.c:43: @/contrib/dev/acpica/include/platform/acfreebsd.h:124:36: error: machine/acpica_ machdep.h: No such file or directory In file included from @/contrib/dev/acpica/include/acpi.h:130, from /scratch/tmp/rpaulo/p4/dtrace/sys/modules/tpm/../../dev/tp m/tpm_acpi.c:43: @/contrib/dev/acpica/include/actypes.h:127:2: error: #error ACPI_MACHINE_WIDTH n ot defined @/contrib/dev/acpica/include/actypes.h:276:2: error: #error unknown ACPI_MACHINE _WIDTH mkdep: compile failed Maybe you want to disable tpm for pc98. Regards, -- Rui Paulo ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r211229 - head/sys/vm
Author: mdf Date: Thu Aug 12 16:54:43 2010 New Revision: 211229 URL: http://svn.freebsd.org/changeset/base/211229 Log: Fix compile. It seemed better to have memguard.c include opt_vm.h in case future compile-time knobs were added that it wants to use. Also add include guards and forward declarations to vm/memguard.h. Approved by:zml (mentor) MFC after: 1 month Modified: head/sys/vm/memguard.c head/sys/vm/memguard.h Modified: head/sys/vm/memguard.c == --- head/sys/vm/memguard.c Thu Aug 12 16:13:24 2010(r211228) +++ head/sys/vm/memguard.c Thu Aug 12 16:54:43 2010(r211229) @@ -37,6 +37,8 @@ __FBSDID($FreeBSD$); * See the memguard(9) man page for more information on using MemGuard. */ +#include opt_vm.h + #include sys/param.h #include sys/systm.h #include sys/kernel.h Modified: head/sys/vm/memguard.h == --- head/sys/vm/memguard.h Thu Aug 12 16:13:24 2010(r211228) +++ head/sys/vm/memguard.h Thu Aug 12 16:54:43 2010(r211229) @@ -26,8 +26,14 @@ * $FreeBSD$ */ +#ifndef _VM_MEMGUARD_H_ +#define_VM_MEMGUARD_H_ + #include opt_vm.h +struct malloc_type; +struct vm_map; + #ifdef DEBUG_MEMGUARD unsigned long memguard_fudge(unsigned long, unsigned long); void memguard_init(struct vm_map *); @@ -43,3 +49,5 @@ int is_memguard_addr(void *); #definememguard_cmp(mtp, size) 0 #defineis_memguard_addr(addr) 0 #endif + +#endif /* _VM_MEMGUARD_H_ */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r211221 - head/usr.sbin/acpi/acpidump
John Baldwin j...@freebsd.org writes: Dag-Erling Smørgrav d...@des.no writes: Slightly better: printf(\tClass %u Base Address 0x%jx Length %ju\n\n, (unsigned int)tcpa-platform_class, (uintmax_t)paddr, (uintmax_t)len); but it would probably be easier to define paddr and len as unsigned long long instead of the misspelled u_int64_t, and use %llx and %llu. Depends. If the table defines a field to be a 64-bit integer, it is better to use an explicitly-64-bit integer type such as uint64_t rather than assuming that 'long long' is 64-bit. Actually, paddr and len are a memory address and an object size, respectively, so the logical thing would be to use uintptr_t and size_t with uintmax_t casts... DES -- Dag-Erling Smørgrav - d...@des.no ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r211230 - head/sys/kern
Author: jkim Date: Thu Aug 12 17:17:05 2010 New Revision: 211230 URL: http://svn.freebsd.org/changeset/base/211230 Log: Add the half of time-of-day clock resolution when we adjust system time from time-of-day clock or vice versa. For x86 systems, RTC resolution is one second and we used to lose up to one second whenever we initialize system time from RTC or write system time back to RTC. With this change, margin of error per conversion is roughly between -0.5 and +0.5 second rather than between -1 and 0 second. Note that it does not take care of errors from getnanotime(9) (which is up to 1/hz second) or CLOCK_GETTIME() latency. These are just too expensive to correct and it is not worthy of the cost. Modified: head/sys/kern/subr_rtc.c Modified: head/sys/kern/subr_rtc.c == --- head/sys/kern/subr_rtc.cThu Aug 12 16:54:43 2010(r211229) +++ head/sys/kern/subr_rtc.cThu Aug 12 17:17:05 2010(r211230) @@ -62,6 +62,7 @@ __FBSDID($FreeBSD$); static device_t clock_dev = NULL; static long clock_res; +static struct timespec clock_adj; /* XXX: should be kern. now, it's no longer machdep. */ static int disable_rtc_set; @@ -87,9 +88,12 @@ clock_register(device_t dev, long res) / } clock_dev = dev; clock_res = res; + clock_adj.tv_sec = res / 2 / 100; + clock_adj.tv_nsec = res / 2 % 100 * 1000; if (bootverbose) device_printf(dev, registered as a time-of-day clock - (resolution %ldus)\n, res); + (resolution %ldus, adjustment %jd.%09jds)\n, res, + (intmax_t)clock_adj.tv_sec, (intmax_t)clock_adj.tv_nsec); } /* @@ -127,6 +131,7 @@ inittodr(time_t base) } ts.tv_sec += utc_offset(); + timespecadd(ts, clock_adj); tc_setclock(ts); return; @@ -151,6 +156,7 @@ resettodr(void) return; getnanotime(ts); + timespecadd(ts, clock_adj); ts.tv_sec -= utc_offset(); /* XXX: We should really set all registered RTCs */ if ((error = CLOCK_SETTIME(clock_dev, ts)) != 0) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r211228 - head/sys/kern
On Thursday 12 August 2010 12:37 pm, m...@freebsd.org wrote: On Thu, Aug 12, 2010 at 9:13 AM, Jung-uk Kim j...@freebsd.org wrote: Author: jkim Date: Thu Aug 12 16:13:24 2010 New Revision: 211228 URL: http://svn.freebsd.org/changeset/base/211228 Log: �Provide description for 'machdep.disable_rtc_set' sysctl. �Clean up style(9) �nits. �Remove a redundant return statement and an unnecessary variable. --- 8 SNIP!!! --- 8 --- While the device_printf() is a single statement, it spans multiple lines. It seems in this instance that clarity is preserved better by using braces even though not required by C. Quoting style(9): Space after keywords (if, while, for, return, switch). No braces ('{' and '}') are used for control statements with zero or only a single statement unless that statement is more than a single line in which case they are permitted. So both styles are accepted, and I would think that changing this is needless code churn. Some times it is very hard to read code when if statements contain excessive braces and 'else' statements although is permitted by style(9). It was one of those cases. Please note a 'else' block was also removed from there. Besides, I don't think it is revert worthy, either. ;-) Thanks, Jung-uk Kim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r211221 - head/usr.sbin/acpi/acpidump
Dag-Erling Smørgrav wrote: John Baldwin j...@freebsd.org writes: Dag-Erling Smørgrav d...@des.no writes: Slightly better: printf(\tClass %u Base Address 0x%jx Length %ju\n\n, (unsigned int)tcpa-platform_class, (uintmax_t)paddr, (uintmax_t)len); but it would probably be easier to define paddr and len as unsigned long long instead of the misspelled u_int64_t, and use %llx and %llu. Depends. If the table defines a field to be a 64-bit integer, it is better to use an explicitly-64-bit integer type such as uint64_t rather than assuming that 'long long' is 64-bit. Actually, paddr and len are a memory address and an object size, respectively, so the logical thing would be to use uintptr_t and size_t with uintmax_t casts... Except that physical addresses do not always fit in uintptr_t on i386 (think PAE with 36-bit physical addresses and 32-bit uintptr_t, same for the length). If they truly were a size_t you could use %z without a uintmax_t cast. -- John Baldwin ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r211232 - head/sys/kern
Author: gibbs Date: Thu Aug 12 19:26:27 2010 New Revision: 211232 URL: http://svn.freebsd.org/changeset/base/211232 Log: Properly indent a continue statement. No functional changes. Modified: head/sys/kern/subr_bus.c Modified: head/sys/kern/subr_bus.c == --- head/sys/kern/subr_bus.cThu Aug 12 19:15:21 2010(r211231) +++ head/sys/kern/subr_bus.cThu Aug 12 19:26:27 2010(r211232) @@ -3316,7 +3316,7 @@ bus_generic_probe(device_t dev) * on early-pass busses during BUS_NEW_PASS(). */ if (dl-pass bus_current_pass) - continue; + continue; DEVICE_IDENTIFY(dl-driver, dev); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r211219 - head/usr.sbin/acpi/acpidump
I think it's pretty obvious at this point that you didn't do a 'make universe' to verify that your updates were correct, and the build is still broken. Can you either fix this immediately, or back it out immediately? Thanks, Doug On 08/12/2010 04:01, Takanori Watanabe wrote: Author: takawata Date: Thu Aug 12 11:01:38 2010 New Revision: 211219 URL: http://svn.freebsd.org/changeset/base/211219 Log: Fix tindebox breakage about format warning. Modified: head/usr.sbin/acpi/acpidump/acpi.c Modified: head/usr.sbin/acpi/acpidump/acpi.c == --- head/usr.sbin/acpi/acpidump/acpi.cThu Aug 12 11:00:45 2010 (r211218) +++ head/usr.sbin/acpi/acpidump/acpi.cThu Aug 12 11:01:38 2010 (r211219) @@ -646,7 +646,7 @@ acpi_handle_tcpa(ACPI_TABLE_HEADER *sdp) printf(END_COMMENT); return; } - printf(\tClass %d Base Address 0x%jx Length %lld\n\n, + printf(\tClass %d Base Address 0x%jx Length %llu\n\n, tcpa-platform_class, paddr, len); if (len == 0) { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r211234 - head/tools/regression/fstest/tests/unlink
Author: pjd Date: Thu Aug 12 19:43:40 2010 New Revision: 211234 URL: http://svn.freebsd.org/changeset/base/211234 Log: Fix copypasted code - we want to create character device here. Modified: head/tools/regression/fstest/tests/unlink/11.t Modified: head/tools/regression/fstest/tests/unlink/11.t == --- head/tools/regression/fstest/tests/unlink/11.t Thu Aug 12 19:40:49 2010(r211233) +++ head/tools/regression/fstest/tests/unlink/11.t Thu Aug 12 19:43:40 2010(r211234) @@ -67,19 +67,19 @@ expect EACCES|EPERM -u 65533 -g 65533 expect 0 unlink ${n0}/${n1} # User owns both: the sticky directory and the character device to be removed. -expect 0 mknod ${n0}/${n1} b 0644 1 2 +expect 0 mknod ${n0}/${n1} c 0644 1 2 expect 0 chown ${n0}/${n1} 65534 65534 expect 0 -u 65534 -g 65534 unlink ${n0}/${n1} # User owns the character device to be removed, but doesn't own the sticky directory. -expect 0 mknod ${n0}/${n1} b 0644 1 2 +expect 0 mknod ${n0}/${n1} c 0644 1 2 expect 0 chown ${n0}/${n1} 65533 65533 expect 0 -u 65533 -g 65533 unlink ${n0}/${n1} # User owns the sticky directory, but doesn't own the character device to be removed. -expect 0 mknod ${n0}/${n1} b 0644 1 2 +expect 0 mknod ${n0}/${n1} c 0644 1 2 expect 0 chown ${n0}/${n1} 65533 65533 expect 0 -u 65534 -g 65534 unlink ${n0}/${n1} # User doesn't own the sticky directory nor the character directory to be removed. -expect 0 mknod ${n0}/${n1} b 0644 1 2 +expect 0 mknod ${n0}/${n1} c 0644 1 2 expect 0 chown ${n0}/${n1} 65534 65534 expect EACCES|EPERM -u 65533 -g 65533 unlink ${n0}/${n1} expect 0 unlink ${n0}/${n1} ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r211235 - head/tools/regression/fstest
Author: pjd Date: Thu Aug 12 19:45:27 2010 New Revision: 211235 URL: http://svn.freebsd.org/changeset/base/211235 Log: Portable Makefile. Modified: head/tools/regression/fstest/Makefile Modified: head/tools/regression/fstest/Makefile == --- head/tools/regression/fstest/Makefile Thu Aug 12 19:43:40 2010 (r211234) +++ head/tools/regression/fstest/Makefile Thu Aug 12 19:45:27 2010 (r211235) @@ -1,25 +1,26 @@ # $FreeBSD$ PROG= fstest -NO_MAN= -OSTYPE!= uname +${PROG}: ${PROG}.c + @OSTYPE=`uname`; \ + CFLAGS=-D__OS_$${OSTYPE}__; \ + if [ $$OSTYPE = FreeBSD ]; then \ + CFLAGS=$$CFLAGS -DHAS_LCHMOD -DHAS_CHFLAGS -DHAS_LCHFLAGS -DHAS_FREEBSD_ACL; \ + elif [ $$OSTYPE = SunOS ]; then \ + CFLAGS=$$CFLAGS -DHAS_TRUNCATE64 -DHAS_STAT64; \ + CFLAGS=$$CFLAGS -lsocket; \ + elif [ $$OSTYPE = Darwin ]; then \ + CFLAGS=$$CFLAGS -DHAS_LCHMOD -DHAS_CHFLAGS -DHAS_LCHFLAGS; \ + elif [ $$OSTYPE == Linux ]; then \ + CFLAGS=$$CFLAGS -D_GNU_SOURCE; \ + else \ + echo Unsupported operating system: ${OSTYPE}.; \ + exit 1; \ + fi; \ + cmd=gcc -Wall $$CFLAGS ${PROG}.c -o ${PROG}; \ + echo $$cmd; \ + $$cmd -.if ${OSTYPE} == FreeBSD -CFLAGS+= -D__OS_FreeBSD__ -CFLAGS+= -DHAS_LCHMOD -DHAS_CHFLAGS -DHAS_LCHFLAGS -DHAS_FREEBSD_ACL - -.elif ${OSTYPE} == SunOS -CFLAGS+= -D__OS_Solaris__ -CFLAGS+= -DHAS_TRUNCATE64 -DHAS_STAT64 - -.elif ${OSTYPE} == Darwin -CFLAGS+= -D__OS_Darwin__ -CFLAGS+= -DHAS_LCHMOD -DHAS_CHFLAGS -DHAS_LCHFLAGS - -.elif ${OSTYPE} == Linux -CFLAGS+= -D__OS_Linux__ -CFLAGS+= -D_GNU_SOURCE -.endif - -.include bsd.prog.mk +clean: + rm -f ${PROG} ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r211236 - head/sys/kern
Author: gibbs Date: Thu Aug 12 19:50:40 2010 New Revision: 211236 URL: http://svn.freebsd.org/changeset/base/211236 Log: Allow interrupt driven config hooks to be registered from config hook callbacks. Interrupt driven configuration hooks serve two purposes: they are a mechanism for registering for a callback that is invoked once interrupt services are available, and they hold off root device selection so long as any configuration hooks are still active. Before this change, it was not possible to safely register additional hooks from the context of a configuration hook callback. The need for this feature arises when interrupts are required to discover new devices (e.g. access to the XenStore to find para-virtualized devices) which in turn also require the ability to hold off root device selection until some lengthy, interrupt driven, configuration task has completed (e.g. Xen front/back device driver negotiation). More specifically, the mutex protecting the list of active configuration hooks is never held during a callback, and static information is used to ensure proper ordering and only a single callback to each hook even when faced with registration or removal of a hook during an active run. Sponsored by: Spectra Logic Corporation MFC after: 1 week. Modified: head/sys/kern/subr_autoconf.c Modified: head/sys/kern/subr_autoconf.c == --- head/sys/kern/subr_autoconf.c Thu Aug 12 19:45:27 2010 (r211235) +++ head/sys/kern/subr_autoconf.c Thu Aug 12 19:50:40 2010 (r211236) @@ -55,11 +55,12 @@ __FBSDID($FreeBSD$); */ static TAILQ_HEAD(, intr_config_hook) intr_config_hook_list = TAILQ_HEAD_INITIALIZER(intr_config_hook_list); +static struct intr_config_hook *next_to_notify; static struct mtx intr_config_hook_lock; MTX_SYSINIT(intr_config_hook, intr_config_hook_lock, intr config, MTX_DEF); /* ARGSUSED */ -static void run_interrupt_driven_config_hooks(void *dummy); +static void run_interrupt_driven_config_hooks(void); /* * If we wait too long for an interrupt-driven config hook to return, print @@ -91,19 +92,46 @@ run_interrupt_driven_config_hooks_warnin } static void -run_interrupt_driven_config_hooks(void *dummy) +run_interrupt_driven_config_hooks() { - struct intr_config_hook *hook_entry, *next_entry; - int warned; + static int running; + struct intr_config_hook *hook_entry; mtx_lock(intr_config_hook_lock); - TAILQ_FOREACH_SAFE(hook_entry, intr_config_hook_list, ich_links, - next_entry) { + + /* +* If hook processing is already active, any newly +* registered hooks will eventually be notified. +* Let the currently running session issue these +* notifications. +*/ + if (running != 0) { + mtx_unlock(intr_config_hook_lock); + return; + } + running = 1; + + while (next_to_notify != NULL) { + hook_entry = next_to_notify; + next_to_notify = TAILQ_NEXT(hook_entry, ich_links); mtx_unlock(intr_config_hook_lock); (*hook_entry-ich_func)(hook_entry-ich_arg); mtx_lock(intr_config_hook_lock); } + running = 0; + mtx_unlock(intr_config_hook_lock); +} + +static void +boot_run_interrupt_driven_config_hooks(void *dummy) +{ + int warned; + + run_interrupt_driven_config_hooks(); + + /* Block boot processing until all hooks are disestablished. */ + mtx_lock(intr_config_hook_lock); warned = 0; while (!TAILQ_EMPTY(intr_config_hook_list)) { if (msleep(intr_config_hook_list, intr_config_hook_lock, @@ -117,8 +145,9 @@ run_interrupt_driven_config_hooks(void * } mtx_unlock(intr_config_hook_lock); } + SYSINIT(intr_config_hooks, SI_SUB_INT_CONFIG_HOOKS, SI_ORDER_FIRST, - run_interrupt_driven_config_hooks, NULL); + boot_run_interrupt_driven_config_hooks, NULL); /* * Register a hook that will be called after cold @@ -141,10 +170,16 @@ config_intrhook_establish(struct intr_co return (1); } TAILQ_INSERT_TAIL(intr_config_hook_list, hook, ich_links); + if (next_to_notify == NULL) + next_to_notify = hook; mtx_unlock(intr_config_hook_lock); if (cold == 0) + /* +* XXX Call from a task since not all drivers expect +* to be re-entered at the time a hook is established. +*/ /* XXX Sufficient for modules loaded after initial config??? */ - run_interrupt_driven_config_hooks(NULL); + run_interrupt_driven_config_hooks(); return (0); } @@ -161,6 +196,8 @@ config_intrhook_disestablish(struct intr panic(config_intrhook_disestablish:
svn commit: r211241 - in stable/8/sys: conf dev/e1000 modules/em modules/igb
Author: jfv Date: Thu Aug 12 20:18:06 2010 New Revision: 211241 URL: http://svn.freebsd.org/changeset/base/211241 Log: MFC of e1000 changes Many bug fixes, major new feature: the igb vf driver. Added: stable/8/sys/dev/e1000/e1000_mbx.c - copied unchanged from r209616, head/sys/dev/e1000/e1000_mbx.c stable/8/sys/dev/e1000/e1000_mbx.h - copied unchanged from r209616, head/sys/dev/e1000/e1000_mbx.h stable/8/sys/dev/e1000/e1000_vf.c - copied unchanged from r209616, head/sys/dev/e1000/e1000_vf.c stable/8/sys/dev/e1000/e1000_vf.h - copied unchanged from r209616, head/sys/dev/e1000/e1000_vf.h Modified: stable/8/sys/conf/files stable/8/sys/dev/e1000/e1000_82575.h stable/8/sys/dev/e1000/e1000_api.c stable/8/sys/dev/e1000/e1000_api.h stable/8/sys/dev/e1000/e1000_hw.h stable/8/sys/dev/e1000/e1000_osdep.h stable/8/sys/dev/e1000/e1000_regs.h stable/8/sys/dev/e1000/if_em.c stable/8/sys/dev/e1000/if_igb.c stable/8/sys/dev/e1000/if_igb.h stable/8/sys/dev/e1000/if_lem.c stable/8/sys/modules/em/Makefile stable/8/sys/modules/igb/Makefile Directory Properties: stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/conf/files == --- stable/8/sys/conf/files Thu Aug 12 20:09:22 2010(r211240) +++ stable/8/sys/conf/files Thu Aug 12 20:18:06 2010(r211241) @@ -932,6 +932,10 @@ dev/e1000/e1000_nvm.c optional em | igb compile-with ${NORMAL_C} -I$S/dev/e1000 dev/e1000/e1000_phy.c optional em | igb \ compile-with ${NORMAL_C} -I$S/dev/e1000 +dev/e1000/e1000_vf.c optional em | igb \ + compile-with ${NORMAL_C} -I$S/dev/e1000 +dev/e1000/e1000_mbx.c optional em | igb \ + compile-with ${NORMAL_C} -I$S/dev/e1000 dev/e1000/e1000_osdep.coptional em | igb \ compile-with ${NORMAL_C} -I$S/dev/e1000 dev/et/if_et.c optional et Modified: stable/8/sys/dev/e1000/e1000_82575.h == --- stable/8/sys/dev/e1000/e1000_82575.hThu Aug 12 20:09:22 2010 (r211240) +++ stable/8/sys/dev/e1000/e1000_82575.hThu Aug 12 20:18:06 2010 (r211241) @@ -459,5 +459,16 @@ struct e1000_adv_tx_context_desc { #define E1000_RXPBS_SIZE_MASK_82576 0x007F void e1000_vmdq_set_loopback_pf(struct e1000_hw *hw, bool enable); void e1000_vmdq_set_replication_pf(struct e1000_hw *hw, bool enable); +enum e1000_promisc_type { + e1000_promisc_disabled = 0, /* all promisc modes disabled */ + e1000_promisc_unicast = 1,/* unicast promiscuous enabled */ + e1000_promisc_multicast = 2, /* multicast promiscuous enabled */ + e1000_promisc_enabled = 3,/* both uni and multicast promisc */ + e1000_num_promisc_types +}; + +void e1000_vfta_set_vf(struct e1000_hw *, u16, bool); +void e1000_rlpml_set_vf(struct e1000_hw *, u16); +s32 e1000_promisc_set_vf(struct e1000_hw *, enum e1000_promisc_type type); u16 e1000_rxpbs_adjust_82580(u32 data); #endif /* _E1000_82575_H_ */ Modified: stable/8/sys/dev/e1000/e1000_api.c == --- stable/8/sys/dev/e1000/e1000_api.c Thu Aug 12 20:09:22 2010 (r211240) +++ stable/8/sys/dev/e1000/e1000_api.c Thu Aug 12 20:18:06 2010 (r211241) @@ -112,6 +112,31 @@ out: return ret_val; } +/** + * e1000_init_mbx_params - Initialize mailbox function pointers + * @hw: pointer to the HW structure + * + * This function initializes the function pointers for the PHY + * set of functions. Called by drivers or by e1000_setup_init_funcs. + **/ +s32 e1000_init_mbx_params(struct e1000_hw *hw) +{ + s32 ret_val = E1000_SUCCESS; + + if (hw-mbx.ops.init_params) { + ret_val = hw-mbx.ops.init_params(hw); + if (ret_val) { + DEBUGOUT(Mailbox Initialization Error\n); + goto out; + } + } else { + DEBUGOUT(mbx.init_mbx_params was NULL\n); + ret_val = -E1000_ERR_CONFIG; + } + +out: + return ret_val; +} /** * e1000_set_mac_type - Sets MAC type @@ -281,6 +306,9 @@ s32 e1000_set_mac_type(struct e1000_hw * case E1000_DEV_ID_82580_COPPER_DUAL: mac-type = e1000_82580; break; + case E1000_DEV_ID_82576_VF: + mac-type = e1000_vfadapt; + break; default: /* Should never have loaded on this device */ ret_val = -E1000_ERR_MAC_INIT; @@ -326,6 +354,7 @@ s32 e1000_setup_init_funcs(struct e1000_ e1000_init_mac_ops_generic(hw); e1000_init_phy_ops_generic(hw); e1000_init_nvm_ops_generic(hw); + e1000_init_mbx_ops_generic(hw); /* * Set up the init function pointers. These are
svn commit: r211242 - in head/tools/regression/fstest/tests: rmdir unlink
Author: pjd Date: Thu Aug 12 20:35:14 2010 New Revision: 211242 URL: http://svn.freebsd.org/changeset/base/211242 Log: More tests. Modified: head/tools/regression/fstest/tests/rmdir/11.t head/tools/regression/fstest/tests/unlink/11.t Modified: head/tools/regression/fstest/tests/rmdir/11.t == --- head/tools/regression/fstest/tests/rmdir/11.t Thu Aug 12 20:18:06 2010(r211241) +++ head/tools/regression/fstest/tests/rmdir/11.t Thu Aug 12 20:35:14 2010(r211242) @@ -6,7 +6,7 @@ desc=rmdir returns EACCES or EPERM if t dir=`dirname $0` . ${dir}/../misc.sh -echo 1..15 +echo 1..47 n0=`namegen` n1=`namegen` @@ -22,17 +22,34 @@ expect 0 chmod ${n0} 01777 # User owns both: the sticky directory and the directory to be removed. expect 0 -u 65534 -g 65534 mkdir ${n0}/${n1} 0755 +expect dir,65534,65534 lstat ${n0}/${n1} type,uid,gid expect 0 -u 65534 -g 65534 rmdir ${n0}/${n1} +expect ENOENT lstat ${n0}/${n1} type # User owns the directory to be removed, but doesn't own the sticky directory. -expect 0 -u 65533 -g 65533 mkdir ${n0}/${n1} 0755 -expect 0 -u 65533 -g 65533 rmdir ${n0}/${n1} +for id in 0 65533; do + expect 0 chown ${n0} ${id} ${id} + create_file dir ${n0}/${n1} 65534 65534 + expect dir,65534,65534 lstat ${n0}/${n1} type,uid,gid + expect 0 -u 65534 -g 65534 rmdir ${n0}/${n1} + expect ENOENT lstat ${n0}/${n1} type +done # User owns the sticky directory, but doesn't own the directory to be removed. -expect 0 -u 65533 -g 65533 mkdir ${n0}/${n1} 0755 -expect 0 -u 65534 -g 65534 rmdir ${n0}/${n1} +expect 0 chown ${n0} 65534 65534 +for id in 0 65533; do + create_file dir ${n0}/${n1} ${id} ${id} + expect dir,${id},${id} lstat ${n0}/${n1} type,uid,gid + expect 0 -u 65534 -g 65534 rmdir ${n0}/${n1} + expect ENOENT lstat ${n0}/${n1} type +done # User doesn't own the sticky directory nor the directory to be removed. -expect 0 -u 65534 -g 65534 mkdir ${n0}/${n1} 0755 -expect EACCES|EPERM -u 65533 -g 65533 rmdir ${n0}/${n1} -expect 0 rmdir ${n0}/${n1} +for id in 0 65533; do + expect 0 chown ${n0} ${id} ${id} + create_file dir ${n0}/${n1} ${id} ${id} + expect dir,${id},${id} lstat ${n0}/${n1} type,uid,gid + expect EACCES|EPERM -u 65534 -g 65534 rmdir ${n0}/${n1} + expect dir,${id},${id} lstat ${n0}/${n1} type,uid,gid + expect 0 rmdir ${n0}/${n1} +done expect 0 rmdir ${n0} Modified: head/tools/regression/fstest/tests/unlink/11.t == --- head/tools/regression/fstest/tests/unlink/11.t Thu Aug 12 20:18:06 2010(r211241) +++ head/tools/regression/fstest/tests/unlink/11.t Thu Aug 12 20:35:14 2010(r211242) @@ -6,7 +6,7 @@ desc=unlink returns EACCES or EPERM if dir=`dirname $0` . ${dir}/../misc.sh -echo 1..68 +echo 1..270 n0=`namegen` n1=`namegen` @@ -17,100 +17,45 @@ cdir=`pwd` cd ${n2} expect 0 mkdir ${n0} 0755 -expect 0 chown ${n0} 65534 65534 expect 0 chmod ${n0} 01777 +expect 0 chown ${n0} 65534 65534 -# User owns both: the sticky directory and the file to be removed. -expect 0 -u 65534 -g 65534 create ${n0}/${n1} 0644 -expect 0 -u 65534 -g 65534 unlink ${n0}/${n1} -# User owns the file to be removed, but doesn't own the sticky directory. -expect 0 -u 65533 -g 65533 create ${n0}/${n1} 0644 -expect 0 -u 65533 -g 65533 unlink ${n0}/${n1} -# User owns the sticky directory, but doesn't own the file to be removed. -expect 0 -u 65533 -g 65533 create ${n0}/${n1} 0644 -expect 0 -u 65534 -g 65534 unlink ${n0}/${n1} -# User doesn't own the sticky directory nor the file to be removed. -expect 0 -u 65534 -g 65534 create ${n0}/${n1} 0644 -expect EACCES|EPERM -u 65533 -g 65533 unlink ${n0}/${n1} -expect 0 unlink ${n0}/${n1} - -# User owns both: the sticky directory and the fifo to be removed. -expect 0 -u 65534 -g 65534 mkfifo ${n0}/${n1} 0644 -expect 0 -u 65534 -g 65534 unlink ${n0}/${n1} -# User owns the fifo to be removed, but doesn't own the sticky directory. -expect 0 -u 65533 -g 65533 mkfifo ${n0}/${n1} 0644 -expect 0 -u 65533 -g 65533 unlink ${n0}/${n1} -# User owns the sticky directory, but doesn't own the fifo to be removed. -expect 0 -u 65533 -g 65533 mkfifo ${n0}/${n1} 0644 -expect 0 -u 65534 -g 65534 unlink ${n0}/${n1} -# User doesn't own the sticky directory nor the fifo to be removed. -expect 0 -u 65534 -g 65534 mkfifo ${n0}/${n1} 0644 -expect EACCES|EPERM -u 65533 -g 65533 unlink ${n0}/${n1} -expect 0 unlink ${n0}/${n1} - -# User owns both: the sticky directory and the block device to be removed. -expect 0 mknod ${n0}/${n1} b 0644 1 2 -expect 0 chown ${n0}/${n1} 65534 65534 -expect 0 -u 65534 -g 65534 unlink ${n0}/${n1} -# User owns the block device to be removed, but doesn't own the sticky directory. -expect 0 mknod ${n0}/${n1} b 0644 1 2 -expect 0 chown ${n0}/${n1} 65533 65533 -expect
svn commit: r211243 - in head: gnu/lib/libreadline/history gnu/lib/libreadline/readline/doc gnu/usr.bin/cvs/contrib gnu/usr.bin/gdb/doc lib/libexpat secure/lib/libcrypto share/mk
Author: will Date: Thu Aug 12 20:46:49 2010 New Revision: 211243 URL: http://svn.freebsd.org/changeset/base/211243 Log: Fix buildworld -DNO_CLEAN when using with Perforce, which marks files as read-only by default, meaning files copied can't be overwritten next time. Reviewed by: imp Approved by: ken (mentor) Modified: head/gnu/lib/libreadline/history/Makefile head/gnu/lib/libreadline/readline/doc/Makefile head/gnu/usr.bin/cvs/contrib/Makefile head/gnu/usr.bin/gdb/doc/Makefile head/lib/libexpat/Makefile head/secure/lib/libcrypto/Makefile head/share/mk/sys.mk Modified: head/gnu/lib/libreadline/history/Makefile == --- head/gnu/lib/libreadline/history/Makefile Thu Aug 12 20:35:14 2010 (r211242) +++ head/gnu/lib/libreadline/history/Makefile Thu Aug 12 20:46:49 2010 (r211243) @@ -8,7 +8,7 @@ MAN=rlhistory.3 SRCS= $(HISTSRC) xmalloc.c rlhistory.3: doc/history.3 - cp ${.ALLSRC} ${.TARGET} + cp -f ${.ALLSRC} ${.TARGET} CLEANFILES+= rlhistory.3 Modified: head/gnu/lib/libreadline/readline/doc/Makefile == --- head/gnu/lib/libreadline/readline/doc/Makefile Thu Aug 12 20:35:14 2010(r211242) +++ head/gnu/lib/libreadline/readline/doc/Makefile Thu Aug 12 20:46:49 2010(r211243) @@ -13,7 +13,7 @@ CLEANFILES += readline.texi readline.info: rlman.texi rluser.texi rltech.texi version.texi fdl.texi readline.texi: rlman.texi - cp ${SRCDIR}/rlman.texi ${.TARGET} + cp -f ${SRCDIR}/rlman.texi ${.TARGET} rluserman.info: rluserman.texi version.texi rluser.texi fdl.texi Modified: head/gnu/usr.bin/cvs/contrib/Makefile == --- head/gnu/usr.bin/cvs/contrib/Makefile Thu Aug 12 20:35:14 2010 (r211242) +++ head/gnu/usr.bin/cvs/contrib/Makefile Thu Aug 12 20:46:49 2010 (r211243) @@ -24,7 +24,7 @@ Makefile: @: .sh: - cp ${.IMPSRC} ${.TARGET} + cp -f ${.IMPSRC} ${.TARGET} .pl: sed -e 's,xPERL_PATHx,$(PERLPATH),' ${.IMPSRC} ${.TARGET} Modified: head/gnu/usr.bin/gdb/doc/Makefile == --- head/gnu/usr.bin/gdb/doc/Makefile Thu Aug 12 20:35:14 2010 (r211242) +++ head/gnu/usr.bin/gdb/doc/Makefile Thu Aug 12 20:46:49 2010 (r211243) @@ -20,11 +20,11 @@ GDBvn.texi: version.in echo @set GDBVN `sed q ${.ALLSRC}` ${.TARGET} inc-hist.texinfo: hsuser.texi inc-hist.diff - cp ${.ALLSRC:M*.texi} ${.TARGET} + cp -f ${.ALLSRC:M*.texi} ${.TARGET} patch ${.ALLSRC:M*.diff} rluser.texinfo: rluser.texi - cp ${.ALLSRC:M*.texi} ${.TARGET} + cp -f ${.ALLSRC:M*.texi} ${.TARGET} CLEANFILES= gdb-cfg.texi GDBvn.texi inc-hist.texinfo inc-hist.texinfo.orig \ rluser.texinfo Modified: head/lib/libexpat/Makefile == --- head/lib/libexpat/Makefile Thu Aug 12 20:35:14 2010(r211242) +++ head/lib/libexpat/Makefile Thu Aug 12 20:46:49 2010(r211243) @@ -30,6 +30,6 @@ bsdxml.h: expat.h ${.TARGET} bsdxml_external.h: expat_external.h - cp ${.ALLSRC} ${.TARGET} + cp -f ${.ALLSRC} ${.TARGET} .include bsd.lib.mk Modified: head/secure/lib/libcrypto/Makefile == --- head/secure/lib/libcrypto/Makefile Thu Aug 12 20:35:14 2010 (r211242) +++ head/secure/lib/libcrypto/Makefile Thu Aug 12 20:46:49 2010 (r211243) @@ -355,13 +355,13 @@ buildinf.h: ${.CURDIR}/Makefile echo #endif ) ${.TARGET} opensslconf.h: opensslconf-${MACHINE_ARCH}.h - cp ${.ALLSRC} ${.TARGET} + cp -f ${.ALLSRC} ${.TARGET} evp.h: ${LCRYPTO_SRC}/crypto/evp/evp.h .if ${MK_IDEA} == no sed '/^#ifndef OPENSSL_NO_IDEA$$/,/^#endif$$/d' ${.ALLSRC} ${.TARGET} .else - cp ${.ALLSRC} ${.TARGET} + cp -f ${.ALLSRC} ${.TARGET} .endif # No FIPS support for now Modified: head/share/mk/sys.mk == --- head/share/mk/sys.mkThu Aug 12 20:35:14 2010(r211242) +++ head/share/mk/sys.mkThu Aug 12 20:46:49 2010(r211243) @@ -167,7 +167,7 @@ YFLAGS ?= -d ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}) .sh: - cp ${.IMPSRC} ${.TARGET} + cp -f ${.IMPSRC} ${.TARGET} chmod a+x ${.TARGET} # DOUBLE SUFFIX RULES @@ -225,7 +225,7 @@ YFLAGS ?= -d # non-Posix rule set .sh: - cp -p ${.IMPSRC} ${.TARGET} + cp -fp ${.IMPSRC} ${.TARGET} chmod a+x ${.TARGET} .c.ln: ___ svn-src-all@freebsd.org mailing
Re: svn commit: r211201 - in head: share/man/man4 sys/conf sys/dev/tpm sys/modules sys/modules/tpm
On Thu, Aug 12, 2010 at 12:16:18AM +, Takanori Watanabe wrote: Author: takawata Date: Thu Aug 12 00:16:18 2010 New Revision: 211201 URL: http://svn.freebsd.org/changeset/base/211201 Log: Add tpm(4) driver for Trusted Platform Module. You may want to look at http://bsssd.sourceforge.net/ . Submitted by: Hans-Joerg Hoexer hans-joerg_hoe...@genua.de Yay! PS. Any reason manual page is not enabled in man4/Makefile? -- Pawel Jakub Dawidek http://www.wheelsystems.com p...@freebsd.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! pgpIHdjRyXEPg.pgp Description: PGP signature
svn commit: r211244 - head/share/man/man7
Author: ivoras Date: Thu Aug 12 21:21:50 2010 New Revision: 211244 URL: http://svn.freebsd.org/changeset/base/211244 Log: Describe vfs.read_max and update vfs.hirunningspace documentation. While there, update nits. Considered viewed by: jeff, phk, rwatson Modified: head/share/man/man7/tuning.7 Modified: head/share/man/man7/tuning.7 == --- head/share/man/man7/tuning.7Thu Aug 12 20:46:49 2010 (r211243) +++ head/share/man/man7/tuning.7Thu Aug 12 21:21:50 2010 (r211244) @@ -23,7 +23,7 @@ .\ .\ $FreeBSD$ .\ -.Dd January 23, 2009 +.Dd August 11, 2010 .Dt TUNING 7 .Os .Sh NAME @@ -470,7 +470,7 @@ sysctl defaults to 1 (on). This parameter controls how directories are cached by the system. Most directories are small and use but a single fragment -(typically 1K) in the file system and even less (typically 512 bytes) in +(typically 2K) in the file system and even less (typically 512 bytes) in the buffer cache. However, when operating in the default mode the buffer cache will only cache a fixed number of directories even if you have a huge @@ -504,17 +504,35 @@ it off. The .Va vfs.hirunningspace sysctl determines how much outstanding write I/O may be queued to -disk controllers system-wide at any given instance. -The default is -usually sufficient but on machines with lots of disks you may want to bump -it up to four or five megabytes. +disk controllers system-wide at any given time. +It is used by the UFS file system. +The default is self-tuned and +usually sufficient but on machines with advanced controllers and lots +of disks this may be tuned up to match what the controllers buffer. +Configuring this setting to match tagged queuing capabilities of +controllers or drives with average IO size used in production works +best (for example: 16 MiB will use 128 tags with IO requests of 128 KiB). Note that setting too high a value (exceeding the buffer cache's write threshold) can lead to extremely bad clustering performance. Do not set this value arbitrarily high! -Also, -higher write queueing values may add latency to reads occurring at the same -time. +Higher write queueing values may also add latency to reads occurring at +the same time. +.Pp +The +.Va vfs.read_max +sysctl governs VFS read-ahead and is expressed as the number of blocks +to pre-read if the heuristics algorithm decides that the reads are +issued sequentially. +It is used by the UFS, ext2fs and msdosfs file systems. +With the default UFS block size of 16 KiB, a setting of 32 will allow +speculatively reading up to 512 KiB. +This setting may be increased to get around disk I/O latencies, especially +where these latencies are large such as in virtual machine emulated +environments. +It may be tuned down in specific cases where the I/O load is such that +read-ahead adversely affects performance or where system memory is really +low. .Pp There are various other buffer-cache and VM page cache related sysctls. We do not recommend modifying these values. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r211252 - head/usr.sbin/acpi/acpidump
Author: takawata Date: Fri Aug 13 00:45:30 2010 New Revision: 211252 URL: http://svn.freebsd.org/changeset/base/211252 Log: Fix build on amd64 and ia64. Modified: head/usr.sbin/acpi/acpidump/acpi.c Modified: head/usr.sbin/acpi/acpidump/acpi.c == --- head/usr.sbin/acpi/acpidump/acpi.c Fri Aug 13 00:21:32 2010 (r211251) +++ head/usr.sbin/acpi/acpidump/acpi.c Fri Aug 13 00:45:30 2010 (r211252) @@ -40,7 +40,6 @@ #include stdlib.h #include string.h #include unistd.h -#include inttypes.h #include acpidump.h @@ -623,7 +622,7 @@ acpi_handle_tcpa(ACPI_TABLE_HEADER *sdp) { struct TCPAbody *tcpa; struct TCPAevent *event; - u_int64_t len, paddr; + uint64_t len, paddr; unsigned char *vaddr = NULL; unsigned char *vend = NULL; @@ -647,7 +646,7 @@ acpi_handle_tcpa(ACPI_TABLE_HEADER *sdp) printf(END_COMMENT); return; } - printf(\tClass %d Base Address 0x%jx Length % PRIu64 \n\n, + printf(\tClass %u Base Address 0x%jx Length %ju\n\n, tcpa-platform_class, paddr, len); if (len == 0) { @@ -662,7 +661,7 @@ acpi_handle_tcpa(ACPI_TABLE_HEADER *sdp) while (vaddr != NULL) { if (vaddr + sizeof(struct TCPAevent) = vend) break; - event = (struct TCPAevent *)vaddr; + event = (struct TCPAevent *)(void *)vaddr; if (vaddr + event-event_size = vend) break; if (event-event_type == 0 event-event_size == 0) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r211222 - head/usr.sbin/crunch/crunchide
On 12 August 2010 22:16, Adrian Chadd adr...@freebsd.org wrote: I used the wrong type when setting st_name in the symbol table entry struct. It's an Elf64_Word which is defined as an unsigned 32 bit int on both 32 and 64 bit platforms. To make things sensible, define some new macros to use as word macros and use those, rather than simply using the explicit 32 bit macros. .. and I haven't gone over the source with a fine tooth comb to substitute the right macros everywhere. It's possible things are still not correct but work fine. Adrian ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r211270 - head/sys/modules/tpm
Author: takawata Date: Fri Aug 13 04:00:35 2010 New Revision: 211270 URL: http://svn.freebsd.org/changeset/base/211270 Log: Hook tpm.4 manual to build. Modified: head/sys/modules/tpm/Makefile Modified: head/sys/modules/tpm/Makefile == --- head/sys/modules/tpm/Makefile Fri Aug 13 03:17:33 2010 (r211269) +++ head/sys/modules/tpm/Makefile Fri Aug 13 04:00:35 2010 (r211270) @@ -3,7 +3,9 @@ .PATH: ${.CURDIR}/../../dev/tpm KMOD= tpm -SRCS= tpm.c tpm_isa.c tpm_acpi.c isa_if.h opt_acpi.h acpi_if.h \ - bus_if.h device_if.h + +SRCS= tpm.c bus_if.h device_if.h +#Bus specific stuff. +SRCS+= tpm_isa.c tpm_acpi.c isa_if.h opt_acpi.h acpi_if.h .include bsd.kmod.mk ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r211270 - head/sys/modules/tpm
This commit seems to accomplish something totally different than your commit message indicates. Doug On 08/12/2010 21:00, Takanori Watanabe wrote: Author: takawata Date: Fri Aug 13 04:00:35 2010 New Revision: 211270 URL: http://svn.freebsd.org/changeset/base/211270 Log: Hook tpm.4 manual to build. Modified: head/sys/modules/tpm/Makefile Modified: head/sys/modules/tpm/Makefile == --- head/sys/modules/tpm/Makefile Fri Aug 13 03:17:33 2010 (r211269) +++ head/sys/modules/tpm/Makefile Fri Aug 13 04:00:35 2010 (r211270) @@ -3,7 +3,9 @@ .PATH: ${.CURDIR}/../../dev/tpm KMOD=tpm -SRCS=tpm.c tpm_isa.c tpm_acpi.c isa_if.h opt_acpi.h acpi_if.h \ - bus_if.h device_if.h + +SRCS=tpm.c bus_if.h device_if.h +#Bus specific stuff. +SRCS+= tpm_isa.c tpm_acpi.c isa_if.h opt_acpi.h acpi_if.h .include bsd.kmod.mk -- Improve the effectiveness of your Internet presence with a domain name makeover!http://SupersetSolutions.com/ Computers are useless. They can only give you answers. -- Pablo Picasso ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r211271 - head/share/man/man4
Author: takawata Date: Fri Aug 13 05:01:44 2010 New Revision: 211271 URL: http://svn.freebsd.org/changeset/base/211271 Log: Hook tpm.4 manual to hook. Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile == --- head/share/man/man4/MakefileFri Aug 13 04:00:35 2010 (r211270) +++ head/share/man/man4/MakefileFri Aug 13 05:01:44 2010 (r211271) @@ -419,6 +419,7 @@ MAN=aac.4 \ ti.4 \ tl.4 \ tnt4882.4 \ + ${_tpm.4} \ trm.4 \ tty.4 \ tun.4 \ @@ -670,6 +671,7 @@ _padlock.4= padlock.4 _rr232x.4= rr232x.4 _speaker.4=speaker.4 _spkr.4= spkr.4 +_tpm.4=tpm.4 _urtw.4= urtw.4 _wpi.4=wpi.4 ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r211270 - head/sys/modules/tpm
In message 201008130400.o7d40zwp087...@svn.freebsd.org, Takanori Watanabe : Author: takawata Date: Fri Aug 13 04:00:35 2010 New Revision: 211270 URL: http://svn.freebsd.org/changeset/base/211270 Log: Hook tpm.4 manual to build. Wrong directory. Real change was committed separately. This is cosmetic change to separate core and bus frontend, because I heard some embedded platform also uses TPM. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org