From owner-p4-projects@FreeBSD.ORG Fri Oct 24 13:31:28 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 61755106567E; Fri, 24 Oct 2008 13:31:28 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5E801065670 for ; Fri, 24 Oct 2008 13:31:27 +0000 (UTC) (envelope-from zec@tel.fer.hr) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id D23BB8FC1A for ; Fri, 24 Oct 2008 13:31:27 +0000 (UTC) (envelope-from zec@tel.fer.hr) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id m9ODVRhJ045126 for ; Fri, 24 Oct 2008 13:31:27 GMT (envelope-from zec@tel.fer.hr) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id m9ODVQJ3045124 for perforce@freebsd.org; Fri, 24 Oct 2008 13:31:26 GMT (envelope-from zec@tel.fer.hr) Date: Fri, 24 Oct 2008 13:31:26 GMT Message-Id: <200810241331.m9ODVQJ3045124@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to zec@tel.fer.hr using -f From: Marko Zec To: Perforce Change Reviews Cc: Subject: PERFORCE change 151848 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Oct 2008 13:31:28 -0000 http://perforce.freebsd.org/chv.cgi?CH=151848 Change 151848 by zec@zec_tpx32 on 2008/10/24 13:31:17 IFC Affected files ... .. //depot/projects/vimage/src/sys/amd64/amd64/identcpu.c#10 integrate .. //depot/projects/vimage/src/sys/amd64/amd64/initcpu.c#2 integrate .. //depot/projects/vimage/src/sys/amd64/amd64/prof_machdep.c#5 integrate .. //depot/projects/vimage/src/sys/amd64/amd64/tsc.c#4 integrate .. //depot/projects/vimage/src/sys/amd64/include/clock.h#5 integrate .. //depot/projects/vimage/src/sys/amd64/include/md_var.h#4 integrate .. //depot/projects/vimage/src/sys/amd64/include/specialreg.h#10 integrate .. //depot/projects/vimage/src/sys/amd64/linux32/linux.h#7 integrate .. //depot/projects/vimage/src/sys/amd64/linux32/linux32_sysvec.c#9 integrate .. //depot/projects/vimage/src/sys/arm/arm/swtch.S#7 integrate .. //depot/projects/vimage/src/sys/arm/conf/AVILA#8 integrate .. //depot/projects/vimage/src/sys/arm/conf/BWCT#4 integrate .. //depot/projects/vimage/src/sys/arm/conf/CRB#5 integrate .. //depot/projects/vimage/src/sys/arm/conf/DB-78XXX#2 integrate .. //depot/projects/vimage/src/sys/arm/conf/DB-88F5XXX#2 integrate .. //depot/projects/vimage/src/sys/arm/conf/DB-88F6XXX#2 integrate .. //depot/projects/vimage/src/sys/arm/conf/DEFAULTS#1 branch .. //depot/projects/vimage/src/sys/arm/conf/EP80219#5 integrate .. //depot/projects/vimage/src/sys/arm/conf/GUMSTIX#2 integrate .. //depot/projects/vimage/src/sys/arm/conf/HL200#3 integrate .. //depot/projects/vimage/src/sys/arm/conf/IQ31244#5 integrate .. //depot/projects/vimage/src/sys/arm/conf/KB920X#8 integrate .. //depot/projects/vimage/src/sys/arm/conf/NSLU#3 integrate .. //depot/projects/vimage/src/sys/arm/conf/SIMICS#5 integrate .. //depot/projects/vimage/src/sys/arm/conf/SKYEYE#4 integrate .. //depot/projects/vimage/src/sys/compat/freebsd32/freebsd32_misc.c#13 integrate .. //depot/projects/vimage/src/sys/compat/freebsd32/freebsd32_proto.h#14 integrate .. //depot/projects/vimage/src/sys/compat/freebsd32/freebsd32_syscall.h#14 integrate .. //depot/projects/vimage/src/sys/compat/freebsd32/freebsd32_syscalls.c#14 integrate .. //depot/projects/vimage/src/sys/compat/freebsd32/freebsd32_sysent.c#14 integrate .. //depot/projects/vimage/src/sys/compat/freebsd32/syscalls.master#15 integrate .. //depot/projects/vimage/src/sys/compat/linux/linux_signal.c#4 integrate .. //depot/projects/vimage/src/sys/compat/linux/linux_signal.h#2 integrate .. //depot/projects/vimage/src/sys/conf/NOTES#34 integrate .. //depot/projects/vimage/src/sys/conf/files#40 integrate .. //depot/projects/vimage/src/sys/conf/files.arm#6 integrate .. //depot/projects/vimage/src/sys/conf/files.mips#4 integrate .. //depot/projects/vimage/src/sys/contrib/altq/altq/altq_subr.c#10 integrate .. //depot/projects/vimage/src/sys/dev/age/if_age.c#5 integrate .. //depot/projects/vimage/src/sys/dev/age/if_agevar.h#2 integrate .. //depot/projects/vimage/src/sys/dev/ata/ata-dma.c#8 integrate .. //depot/projects/vimage/src/sys/dev/ata/chipsets/ata-cyrix.c#2 integrate .. //depot/projects/vimage/src/sys/dev/ata/chipsets/ata-marvell.c#2 integrate .. //depot/projects/vimage/src/sys/dev/ata/chipsets/ata-national.c#2 integrate .. //depot/projects/vimage/src/sys/dev/ata/chipsets/ata-serverworks.c#2 integrate .. //depot/projects/vimage/src/sys/dev/ath/if_ath.c#20 integrate .. //depot/projects/vimage/src/sys/dev/cxgb/cxgb_sge.c#18 integrate .. //depot/projects/vimage/src/sys/dev/mii/ciphy.c#6 integrate .. //depot/projects/vimage/src/sys/dev/mii/e1000phy.c#6 integrate .. //depot/projects/vimage/src/sys/dev/mii/miidevs#17 integrate .. //depot/projects/vimage/src/sys/dev/mmc/mmc.c#8 integrate .. //depot/projects/vimage/src/sys/dev/mmc/mmcreg.h#7 integrate .. //depot/projects/vimage/src/sys/dev/mmc/mmcsd.c#9 integrate .. //depot/projects/vimage/src/sys/dev/mmc/mmcvar.h#7 integrate .. //depot/projects/vimage/src/sys/dev/pci/pci.c#16 integrate .. //depot/projects/vimage/src/sys/dev/pci/pcireg.h#9 integrate .. //depot/projects/vimage/src/sys/dev/ppbus/if_plip.c#6 integrate .. //depot/projects/vimage/src/sys/dev/ppbus/immio.c#2 integrate .. //depot/projects/vimage/src/sys/dev/ppbus/lpbb.c#3 integrate .. //depot/projects/vimage/src/sys/dev/ppbus/lpt.c#5 integrate .. //depot/projects/vimage/src/sys/dev/ppbus/pcfclock.c#3 integrate .. //depot/projects/vimage/src/sys/dev/ppbus/ppb_base.c#2 integrate .. //depot/projects/vimage/src/sys/dev/ppbus/ppb_msq.c#2 integrate .. //depot/projects/vimage/src/sys/dev/ppbus/ppbconf.c#6 integrate .. //depot/projects/vimage/src/sys/dev/ppbus/ppbconf.h#4 integrate .. //depot/projects/vimage/src/sys/dev/ppbus/ppi.c#5 integrate .. //depot/projects/vimage/src/sys/dev/ppbus/pps.c#4 integrate .. //depot/projects/vimage/src/sys/dev/ppbus/vpo.c#5 integrate .. //depot/projects/vimage/src/sys/dev/ppbus/vpoio.c#2 integrate .. //depot/projects/vimage/src/sys/dev/ppbus/vpoio.h#2 integrate .. //depot/projects/vimage/src/sys/dev/ppc/ppc.c#5 integrate .. //depot/projects/vimage/src/sys/dev/ppc/ppcreg.h#4 integrate .. //depot/projects/vimage/src/sys/dev/sdhci/sdhci.c#1 branch .. //depot/projects/vimage/src/sys/dev/sdhci/sdhci.h#1 branch .. //depot/projects/vimage/src/sys/dev/sound/pci/hda/hdac.c#21 integrate .. //depot/projects/vimage/src/sys/dev/usb/u3g.c#2 integrate .. //depot/projects/vimage/src/sys/dev/usb/ubsa.c#13 integrate .. //depot/projects/vimage/src/sys/dev/usb/usb_quirks.c#10 integrate .. //depot/projects/vimage/src/sys/dev/usb/usbdevs#32 integrate .. //depot/projects/vimage/src/sys/geom/geom_disk.c#6 integrate .. //depot/projects/vimage/src/sys/geom/part/g_part_pc98.c#4 integrate .. //depot/projects/vimage/src/sys/geom/part/g_part_vtoc8.c#3 integrate .. //depot/projects/vimage/src/sys/i386/cpufreq/powernow.c#5 integrate .. //depot/projects/vimage/src/sys/i386/i386/apic_vector.s#3 integrate .. //depot/projects/vimage/src/sys/i386/i386/identcpu.c#11 integrate .. //depot/projects/vimage/src/sys/i386/i386/initcpu.c#4 integrate .. //depot/projects/vimage/src/sys/i386/i386/trap.c#13 integrate .. //depot/projects/vimage/src/sys/i386/i386/tsc.c#4 integrate .. //depot/projects/vimage/src/sys/i386/include/apicvar.h#5 integrate .. //depot/projects/vimage/src/sys/i386/include/clock.h#5 integrate .. //depot/projects/vimage/src/sys/i386/include/cpufunc.h#7 integrate .. //depot/projects/vimage/src/sys/i386/include/md_var.h#2 integrate .. //depot/projects/vimage/src/sys/i386/include/pcpu.h#7 integrate .. //depot/projects/vimage/src/sys/i386/include/smp.h#8 integrate .. //depot/projects/vimage/src/sys/i386/include/specialreg.h#10 integrate .. //depot/projects/vimage/src/sys/i386/include/trap.h#3 integrate .. //depot/projects/vimage/src/sys/i386/include/xen/evtchn.h#3 integrate .. //depot/projects/vimage/src/sys/i386/include/xen/xen-os.h#2 integrate .. //depot/projects/vimage/src/sys/i386/include/xen/xen_intr.h#2 integrate .. //depot/projects/vimage/src/sys/i386/include/xen/xenfunc.h#3 integrate .. //depot/projects/vimage/src/sys/i386/isa/prof_machdep.c#5 integrate .. //depot/projects/vimage/src/sys/i386/linux/linux.h#7 integrate .. //depot/projects/vimage/src/sys/i386/linux/linux_sysvec.c#6 integrate .. //depot/projects/vimage/src/sys/i386/xen/clock.c#2 integrate .. //depot/projects/vimage/src/sys/i386/xen/exception.s#3 integrate .. //depot/projects/vimage/src/sys/i386/xen/locore.s#3 integrate .. //depot/projects/vimage/src/sys/i386/xen/mp_machdep.c#5 integrate .. //depot/projects/vimage/src/sys/i386/xen/xen_machdep.c#9 integrate .. //depot/projects/vimage/src/sys/ia64/ia64/mp_machdep.c#7 integrate .. //depot/projects/vimage/src/sys/kern/kern_fork.c#21 integrate .. //depot/projects/vimage/src/sys/kern/kern_prot.c#11 integrate .. //depot/projects/vimage/src/sys/kern/kern_sig.c#15 integrate .. //depot/projects/vimage/src/sys/kern/kern_synch.c#24 integrate .. //depot/projects/vimage/src/sys/kern/kern_thr.c#11 integrate .. //depot/projects/vimage/src/sys/kern/kern_thread.c#17 integrate .. //depot/projects/vimage/src/sys/kern/kern_time.c#6 integrate .. //depot/projects/vimage/src/sys/kern/subr_rman.c#8 integrate .. //depot/projects/vimage/src/sys/kern/subr_sleepqueue.c#12 integrate .. //depot/projects/vimage/src/sys/kern/subr_stack.c#5 integrate .. //depot/projects/vimage/src/sys/kern/subr_trap.c#10 integrate .. //depot/projects/vimage/src/sys/kern/subr_witness.c#18 integrate .. //depot/projects/vimage/src/sys/kern/sys_process.c#9 integrate .. //depot/projects/vimage/src/sys/kern/tty.c#24 integrate .. //depot/projects/vimage/src/sys/kern/uipc_socket.c#26 integrate .. //depot/projects/vimage/src/sys/kern/vfs_subr.c#18 integrate .. //depot/projects/vimage/src/sys/kern/vfs_syscalls.c#16 integrate .. //depot/projects/vimage/src/sys/kern/vfs_vnops.c#14 integrate .. //depot/projects/vimage/src/sys/mips/conf/ADM5120#3 integrate .. //depot/projects/vimage/src/sys/mips/conf/DEFAULTS#1 branch .. //depot/projects/vimage/src/sys/mips/conf/IDT#4 integrate .. //depot/projects/vimage/src/sys/mips/conf/MALTA#3 integrate .. //depot/projects/vimage/src/sys/mips/conf/QEMU#2 integrate .. //depot/projects/vimage/src/sys/mips/conf/SENTRY5#4 integrate .. //depot/projects/vimage/src/sys/modules/Makefile#31 integrate .. //depot/projects/vimage/src/sys/modules/sdhci/Makefile#1 branch .. //depot/projects/vimage/src/sys/netinet/in_pcb.c#38 integrate .. //depot/projects/vimage/src/sys/netinet/in_pcb.h#19 integrate .. //depot/projects/vimage/src/sys/netinet/ip_divert.c#18 integrate .. //depot/projects/vimage/src/sys/netinet/raw_ip.c#31 integrate .. //depot/projects/vimage/src/sys/netinet/sctp_crc32.c#7 integrate .. //depot/projects/vimage/src/sys/netinet/sctp_output.c#33 integrate .. //depot/projects/vimage/src/sys/netinet/sctp_sysctl.c#12 integrate .. //depot/projects/vimage/src/sys/netinet/sctp_uio.h#17 integrate .. //depot/projects/vimage/src/sys/netinet/sctp_usrreq.c#30 integrate .. //depot/projects/vimage/src/sys/netinet/sctputil.c#31 integrate .. //depot/projects/vimage/src/sys/netinet/tcp_subr.c#56 integrate .. //depot/projects/vimage/src/sys/netinet/udp_usrreq.c#38 integrate .. //depot/projects/vimage/src/sys/netinet6/in6_src.c#26 integrate .. //depot/projects/vimage/src/sys/security/mac/mac_framework.h#14 integrate .. //depot/projects/vimage/src/sys/security/mac_biba/mac_biba.c#11 integrate .. //depot/projects/vimage/src/sys/security/mac_lomac/mac_lomac.c#12 integrate .. //depot/projects/vimage/src/sys/security/mac_mls/mac_mls.c#13 integrate .. //depot/projects/vimage/src/sys/security/mac_partition/mac_partition.c#9 integrate .. //depot/projects/vimage/src/sys/security/mac_seeotheruids/mac_seeotheruids.c#8 integrate .. //depot/projects/vimage/src/sys/security/mac_stub/mac_stub.c#13 integrate .. //depot/projects/vimage/src/sys/security/mac_test/mac_test.c#13 integrate .. //depot/projects/vimage/src/sys/sys/cdefs.h#4 integrate .. //depot/projects/vimage/src/sys/sys/param.h#29 integrate .. //depot/projects/vimage/src/sys/sys/proc.h#24 integrate .. //depot/projects/vimage/src/sys/sys/syscallsubr.h#6 integrate .. //depot/projects/vimage/src/sys/sys/systm.h#15 integrate .. //depot/projects/vimage/src/sys/ufs/ffs/ffs_vnops.c#12 integrate .. //depot/projects/vimage/src/sys/vm/vm_mmap.c#14 integrate .. //depot/projects/vimage/src/sys/xen/evtchn/evtchn.c#4 integrate Differences ... ==== //depot/projects/vimage/src/sys/amd64/amd64/identcpu.c#10 (text+ko) ==== @@ -39,7 +39,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/identcpu.c,v 1.160 2008/09/18 18:51:32 stas Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/identcpu.c,v 1.164 2008/10/22 17:30:37 jkim Exp $"); #include "opt_cpu.h" @@ -348,6 +348,19 @@ cpu_feature &= ~CPUID_HTT; /* + * If this CPU supports P-state invariant TSC then + * mention the capability. + */ + if (!tsc_is_invariant && + (strcmp(cpu_vendor, "AuthenticAMD") == 0 && + ((amd_pminfo & AMDPM_TSC_INVARIANT) != 0 || + AMD64_CPU_FAMILY(cpu_id) >= 0x10 || + cpu_id == 0x60fb2))) { + tsc_is_invariant = 1; + printf("\n TSC: P-state invariant"); + } + + /* * If this CPU supports HTT or CMP then mention the * number of physical/logical cores it contains. */ @@ -409,8 +422,11 @@ static void tsc_freq_changed(void *arg, const struct cf_level *level, int status) { - /* If there was an error during the transition, don't do anything. */ - if (status != 0) + /* + * If there was an error during the transition or + * TSC is P-state invariant, don't do anything. + */ + if (status != 0 || tsc_is_invariant) return; /* Total setting for this level gives the new frequency in MHz. */ @@ -451,6 +467,10 @@ amd_feature = regs[3] & ~(cpu_feature & 0x0183f3ff); amd_feature2 = regs[2]; } + if (cpu_exthigh >= 0x80000007) { + do_cpuid(0x80000007, regs); + amd_pminfo = regs[3]; + } if (cpu_exthigh >= 0x80000008) { do_cpuid(0x80000008, regs); cpu_procinfo2 = regs[2]; ==== //depot/projects/vimage/src/sys/amd64/amd64/initcpu.c#2 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/initcpu.c,v 1.50 2006/06/19 22:59:28 davidxu Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/initcpu.c,v 1.51 2008/10/21 00:17:55 jkim Exp $"); #include "opt_cpu.h" @@ -53,6 +53,7 @@ u_int cpu_feature2; /* Feature flags */ u_int amd_feature; /* AMD feature flags */ u_int amd_feature2; /* AMD feature flags */ +u_int amd_pminfo; /* AMD advanced power management info */ u_int cpu_high; /* Highest arg to CPUID */ u_int cpu_exthigh; /* Highest arg to extended CPUID */ u_int cpu_id; /* Stepping ID */ ==== //depot/projects/vimage/src/sys/amd64/amd64/prof_machdep.c#5 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/prof_machdep.c,v 1.32 2008/03/26 15:03:23 phk Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/prof_machdep.c,v 1.33 2008/10/21 00:38:00 jkim Exp $"); #ifdef GUPROF #if 0 @@ -383,8 +383,11 @@ tsc_freq_changed(void *arg, const struct cf_level *level, int status) { - /* If there was an error during the transition, don't do anything. */ - if (status != 0) + /* + * If there was an error during the transition or + * TSC is P-state invariant, don't do anything. + */ + if (status != 0 || tsc_is_invariant) return; if (cputime_prof_active && cputime_clock == CPUTIME_CLOCK_TSC) printf("warning: cpu freq changed while profiling active\n"); ==== //depot/projects/vimage/src/sys/amd64/amd64/tsc.c#4 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/tsc.c,v 1.208 2007/06/04 18:25:01 dwmalone Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/tsc.c,v 1.209 2008/10/21 00:38:00 jkim Exp $"); #include "opt_clock.h" @@ -48,8 +48,13 @@ uint64_t tsc_freq; int tsc_is_broken; +int tsc_is_invariant; static eventhandler_tag tsc_levels_tag, tsc_pre_tag, tsc_post_tag; +SYSCTL_INT(_kern_timecounter, OID_AUTO, invariant_tsc, CTLFLAG_RDTUN, + &tsc_is_invariant, 0, "Indicates whether the TSC is P-state invariant"); +TUNABLE_INT("kern.timecounter.invariant_tsc", &tsc_is_invariant); + #ifdef SMP static int smp_tsc; SYSCTL_INT(_kern_timecounter, OID_AUTO, smp_tsc, CTLFLAG_RDTUN, &smp_tsc, 0, @@ -174,11 +179,12 @@ tsc_freq_changing(void *arg, const struct cf_level *level, int *status) { - if (*status != 0 || timecounter != &tsc_timecounter) + if (*status != 0 || timecounter != &tsc_timecounter || + tsc_is_invariant) return; printf("timecounter TSC must not be in use when " - "changing frequencies; change denied\n"); + "changing frequencies; change denied\n"); *status = EBUSY; } @@ -186,8 +192,11 @@ static void tsc_freq_changed(void *arg, const struct cf_level *level, int status) { - /* If there was an error during the transition, don't do anything. */ - if (status != 0) + /* + * If there was an error during the transition or + * TSC is P-state invariant, don't do anything. + */ + if (status != 0 || tsc_is_invariant) return; /* Total setting for this level gives the new frequency in MHz. */ ==== //depot/projects/vimage/src/sys/amd64/include/clock.h#5 (text+ko) ==== @@ -3,7 +3,7 @@ * Garrett Wollman, September 1994. * This file is in the public domain. * - * $FreeBSD: src/sys/amd64/include/clock.h,v 1.60 2008/04/22 19:38:27 phk Exp $ + * $FreeBSD: src/sys/amd64/include/clock.h,v 1.61 2008/10/21 00:38:00 jkim Exp $ */ #ifndef _MACHINE_CLOCK_H_ @@ -20,6 +20,7 @@ extern int i8254_max_count; extern uint64_t tsc_freq; extern int tsc_is_broken; +extern int tsc_is_invariant; void i8254_init(void); ==== //depot/projects/vimage/src/sys/amd64/include/md_var.h#4 (text+ko) ==== @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/amd64/include/md_var.h,v 1.81 2007/05/19 05:03:59 kan Exp $ + * $FreeBSD: src/sys/amd64/include/md_var.h,v 1.82 2008/10/21 00:17:55 jkim Exp $ */ #ifndef _MACHINE_MD_VAR_H_ @@ -44,6 +44,7 @@ extern u_int cpu_feature2; extern u_int amd_feature; extern u_int amd_feature2; +extern u_int amd_pminfo; extern u_int cpu_fxsr; extern u_int cpu_high; extern u_int cpu_id; ==== //depot/projects/vimage/src/sys/amd64/include/specialreg.h#10 (text+ko) ==== @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * from: @(#)specialreg.h 7.1 (Berkeley) 5/9/91 - * $FreeBSD: src/sys/amd64/include/specialreg.h,v 1.46 2008/08/08 16:26:53 stas Exp $ + * $FreeBSD: src/sys/amd64/include/specialreg.h,v 1.49 2008/10/22 17:36:52 jkim Exp $ */ #ifndef _MACHINE_SPECIALREG_H_ @@ -153,6 +153,21 @@ #define AMDID2_PREFETCH 0x00000100 /* + * CPUID instruction 1 eax info + */ +#define CPUID_STEPPING 0x0000000f +#define CPUID_MODEL 0x000000f0 +#define CPUID_FAMILY 0x00000f00 +#define CPUID_EXT_MODEL 0x000f0000 +#define CPUID_EXT_FAMILY 0x0ff00000 +#define AMD64_CPU_MODEL(id) \ + ((((id) & CPUID_MODEL) >> 4) | \ + (((id) & CPUID_EXT_MODEL) >> 12)) +#define AMD64_CPU_FAMILY(id) \ + ((((id) & CPUID_FAMILY) >> 8) + \ + (((id) & CPUID_EXT_FAMILY) >> 20)) + +/* * CPUID instruction 1 ebx info */ #define CPUID_BRAND_INDEX 0x000000ff @@ -161,6 +176,19 @@ #define CPUID_LOCAL_APIC_ID 0xff000000 /* + * AMD extended function 8000_0007h edx info + */ +#define AMDPM_TS 0x00000001 +#define AMDPM_FID 0x00000002 +#define AMDPM_VID 0x00000004 +#define AMDPM_TTP 0x00000008 +#define AMDPM_TM 0x00000010 +#define AMDPM_STC 0x00000020 +#define AMDPM_100MHZ_STEPS 0x00000040 +#define AMDPM_HW_PSTATE 0x00000080 +#define AMDPM_TSC_INVARIANT 0x00000100 + +/* * AMD extended function 8000_0008h ecx info */ #define AMDID_CMP_CORES 0x000000ff ==== //depot/projects/vimage/src/sys/amd64/linux32/linux.h#7 (text+ko) ==== @@ -27,7 +27,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/amd64/linux32/linux.h,v 1.18 2008/10/14 07:59:23 kib Exp $ + * $FreeBSD: src/sys/amd64/linux32/linux.h,v 1.19 2008/10/19 10:02:26 kib Exp $ */ #ifndef _AMD64_LINUX_H_ @@ -86,6 +86,8 @@ typedef l_long l_time_t; typedef l_uint l_uid_t; typedef l_ushort l_uid16_t; +typedef l_int l_timer_t; +typedef l_int l_mqd_t; typedef struct { l_int val[2]; @@ -399,10 +401,10 @@ #define LINUX_SI_MAX_SIZE 128 #define LINUX_SI_PAD_SIZE ((LINUX_SI_MAX_SIZE/sizeof(l_int)) - 3) -union l_sigval { +typedef union l_sigval { l_int sival_int; l_uintptr_t sival_ptr; -}; +} l_sigval_t; typedef struct l_siginfo { l_int lsi_signo; @@ -413,23 +415,26 @@ struct { l_pid_t _pid; - l_uid16_t _uid; + l_uid_t _uid; } __packed _kill; struct { - l_uint _timer1; - l_uint _timer2; + l_timer_t _tid; + l_int _overrun; + char _pad[sizeof(l_uid_t) - sizeof(l_int)]; + l_sigval_t _sigval; + l_int _sys_private; } __packed _timer; struct { l_pid_t _pid; /* sender's pid */ - l_uid16_t _uid; /* sender's uid */ - union l_sigval _sigval; + l_uid_t _uid; /* sender's uid */ + l_sigval_t _sigval; } __packed _rt; struct { l_pid_t _pid; /* which child */ - l_uid16_t _uid; /* sender's uid */ + l_uid_t _uid; /* sender's uid */ l_int _status; /* exit code */ l_clock_t _utime; l_clock_t _stime; @@ -440,7 +445,7 @@ } __packed _sigfault; struct { - l_int _band; /* POLL_IN,POLL_OUT,POLL_MSG */ + l_long _band; /* POLL_IN,POLL_OUT,POLL_MSG */ l_int _fd; } __packed _sigpoll; } _sifields; @@ -448,6 +453,9 @@ #define lsi_pid _sifields._kill._pid #define lsi_uid _sifields._kill._uid +#define lsi_tid _sifields._timer._tid +#define lsi_overrun _sifields._timer._overrun +#define lsi_sys_private _sifields._timer._sys_private #define lsi_status _sifields._sigchld._status #define lsi_utime _sifields._sigchld._utime #define lsi_stime _sifields._sigchld._stime @@ -860,9 +868,6 @@ #define LINUX_CLOCK_REALTIME_HR 4 #define LINUX_CLOCK_MONOTONIC_HR 5 -typedef int l_timer_t; -typedef int l_mqd_t; - #define LINUX_CLONE_VM 0x00000100 #define LINUX_CLONE_FS 0x00000200 #define LINUX_CLONE_FILES 0x00000400 ==== //depot/projects/vimage/src/sys/amd64/linux32/linux32_sysvec.c#9 (text+ko) ==== @@ -31,7 +31,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_sysvec.c,v 1.35 2008/09/24 10:14:37 kib Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_sysvec.c,v 1.37 2008/10/19 10:02:26 kib Exp $"); #include "opt_compat.h" #ifndef COMPAT_IA32 @@ -334,9 +334,7 @@ frame.sf_ucontext = PTROUT(&fp->sf_sc); /* Fill in POSIX parts */ - frame.sf_si.lsi_signo = sig; - frame.sf_si.lsi_code = code; - frame.sf_si.lsi_addr = PTROUT(ksi->ksi_addr); + ksiginfo_to_lsiginfo(ksi, &frame.sf_si, sig); /* * Build the signal context to be used by sigreturn. @@ -843,7 +841,8 @@ fpstate_drop(td); /* Return via doreti so that we can change to a different %cs */ - pcb->pcb_flags |= PCB_FULLCTX; + pcb->pcb_flags |= PCB_FULLCTX | PCB_32BIT; + pcb->pcb_flags &= ~PCB_GS32BIT; td->td_retval[1] = 0; } ==== //depot/projects/vimage/src/sys/arm/arm/swtch.S#7 (text+ko) ==== @@ -83,7 +83,7 @@ #include #include #include -__FBSDID("$FreeBSD: src/sys/arm/arm/swtch.S,v 1.24 2008/10/13 18:59:59 raj Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/arm/swtch.S,v 1.25 2008/10/16 19:06:24 raj Exp $"); /* @@ -143,8 +143,6 @@ ldr r9, .Lcpufuncs mov lr, pc ldr pc, [r9, #CF_IDCACHE_WBINV_ALL] - mov lr, pc - ldr pc, [r9, #CF_L2CACHE_WBINV_ALL] ldr r0, [r7, #(PCB_PL1VEC)] ldr r1, [r7, #(PCB_DACR)] /* @@ -174,8 +172,6 @@ movne r1, #4 movne lr, pc ldrne pc, [r9, #CF_DCACHE_WB_RANGE] - movne lr, pc - ldrne pc, [r9, #CF_L2CACHE_WB_RANGE] #endif /* PMAP_INCLUDE_PTE_SYNC */ /* @@ -332,8 +328,6 @@ ldr r1, .Lcpufuncs mov lr, pc ldr pc, [r1, #CF_IDCACHE_WBINV_ALL] - mov lr, pc - ldr pc, [r1, #CF_L2CACHE_WBINV_ALL] .Lcs_cache_purge_skipped: /* rem: r6 = lock */ /* rem: r9 = new PCB */ @@ -366,8 +360,6 @@ mov r1, #4 mov lr, pc ldr pc, [r2, #CF_DCACHE_WB_RANGE] - mov lr, pc - ldr pc, [r2, #CF_L2CACHE_WB_RANGE] .Lcs_same_vector: #endif /* PMAP_INCLUDE_PTE_SYNC */ ==== //depot/projects/vimage/src/sys/arm/conf/AVILA#8 (text+ko) ==== @@ -16,9 +16,8 @@ # If you are in doubt as to the purpose or necessity of a line, check first # in NOTES. # -# $FreeBSD: src/sys/arm/conf/AVILA,v 1.16 2008/08/02 22:53:43 imp Exp $ +# $FreeBSD: src/sys/arm/conf/AVILA,v 1.17 2008/10/23 01:51:55 marcel Exp $ -machine arm ident AVILA options PHYSADDR=0x10000000 @@ -80,7 +79,6 @@ #options PREEMPTION #options VERBOSE_SYSINIT -device mem # Memory and kernel memory devices #device saarm device pci ==== //depot/projects/vimage/src/sys/arm/conf/BWCT#4 (text+ko) ==== @@ -15,9 +15,8 @@ # If you are in doubt as to the purpose or necessity of a line, check first # in NOTES. # -# $FreeBSD: src/sys/arm/conf/BWCT,v 1.5 2008/04/21 10:09:54 phk Exp $ +# $FreeBSD: src/sys/arm/conf/BWCT,v 1.6 2008/10/23 01:51:55 marcel Exp $ -machine arm ident BWCT options VERBOSE_INIT_ARM @@ -85,7 +84,6 @@ #options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed #options DIAGNOSTIC -device mem # Memory and kernel memory devices device md device at91_twi # TWI: Two Wire Interface device at91_spi # SPI: ==== //depot/projects/vimage/src/sys/arm/conf/CRB#5 (text+ko) ==== @@ -15,9 +15,8 @@ # If you are in doubt as to the purpose or necessity of a line, check first # in NOTES. # -# $FreeBSD: src/sys/arm/conf/CRB,v 1.5 2008/04/21 10:09:54 phk Exp $ +# $FreeBSD: src/sys/arm/conf/CRB,v 1.6 2008/10/23 01:51:55 marcel Exp $ -machine arm ident CRB options PHYSADDR=0x00000000 @@ -67,7 +66,6 @@ #options PREEMPTION device loop device ether -device mem # Memory and kernel memory devices #device saarm device miibus device rl ==== //depot/projects/vimage/src/sys/arm/conf/DB-78XXX#2 (text+ko) ==== @@ -1,10 +1,9 @@ # # Custom kernel for Marvell DB-78xx boards. # -# $FreeBSD: src/sys/arm/conf/DB-78XXX,v 1.1 2008/10/14 08:18:27 raj Exp $ +# $FreeBSD: src/sys/arm/conf/DB-78XXX,v 1.2 2008/10/23 01:51:55 marcel Exp $ # -machine arm ident DB-88F78XX include "../mv/discovery/std.db78xxx" @@ -49,7 +48,6 @@ # Pseudo devices device loop -device mem device md device pty device random ==== //depot/projects/vimage/src/sys/arm/conf/DB-88F5XXX#2 (text+ko) ==== @@ -1,10 +1,9 @@ # # Custom kernel for Marvell DB-88F5xxx boards. # -# $FreeBSD: src/sys/arm/conf/DB-88F5XXX,v 1.1 2008/10/14 08:18:27 raj Exp $ +# $FreeBSD: src/sys/arm/conf/DB-88F5XXX,v 1.2 2008/10/23 01:51:55 marcel Exp $ # -machine arm ident DB-88F5XXX include "../mv/orion/std.db88f5xxx" @@ -48,7 +47,6 @@ #options WITNESS_KDB # Pseudo devices -device mem device md device loop device pty ==== //depot/projects/vimage/src/sys/arm/conf/DB-88F6XXX#2 (text+ko) ==== @@ -1,10 +1,9 @@ # # Custom kernel for Marvell DB-88F6xxx boards. # -# $FreeBSD: src/sys/arm/conf/DB-88F6XXX,v 1.1 2008/10/14 08:18:27 raj Exp $ +# $FreeBSD: src/sys/arm/conf/DB-88F6XXX,v 1.2 2008/10/23 01:51:55 marcel Exp $ # -machine arm ident DB-88F6XXX include "../mv/kirkwood/std.db88f6xxx" @@ -49,7 +48,6 @@ # Pseudo devices device loop -device mem device md device pty device random ==== //depot/projects/vimage/src/sys/arm/conf/EP80219#5 (text+ko) ==== @@ -15,9 +15,8 @@ # If you are in doubt as to the purpose or necessity of a line, check first # in NOTES. # -# $FreeBSD: src/sys/arm/conf/EP80219,v 1.8 2008/04/21 10:09:54 phk Exp $ +# $FreeBSD: src/sys/arm/conf/EP80219,v 1.9 2008/10/23 01:51:55 marcel Exp $ -machine arm ident EP80219 options PHYSADDR=0xa0000000 @@ -69,7 +68,6 @@ #options PREEMPTION device loop device ether -device mem # Memory and kernel memory devices #device saarm device miibus device fxp ==== //depot/projects/vimage/src/sys/arm/conf/GUMSTIX#2 (text+ko) ==== @@ -16,9 +16,8 @@ # If you are in doubt as to the purpose or necessity of a line, check first # in NOTES. # -# $FreeBSD: src/sys/arm/conf/GUMSTIX,v 1.1 2008/06/06 05:08:09 benno Exp $ +# $FreeBSD: src/sys/arm/conf/GUMSTIX,v 1.2 2008/10/23 01:51:55 marcel Exp $ -machine arm ident GUMSTIX cpu CPU_XSCALE_PXA2X0 @@ -71,7 +70,6 @@ options PREEMPTION device loop device ether -device mem # Memory and kernel memory devices device mii device smc device smcphy ==== //depot/projects/vimage/src/sys/arm/conf/HL200#3 (text+ko) ==== @@ -16,9 +16,8 @@ # If you are in doubt as to the purpose or necessity of a line, check first # in NOTES. # -# $FreeBSD: src/sys/arm/conf/HL200,v 1.5 2008/04/21 10:09:54 phk Exp $ +# $FreeBSD: src/sys/arm/conf/HL200,v 1.6 2008/10/23 01:51:55 marcel Exp $ -machine arm ident HL200 include "../at91/std.at91" @@ -89,7 +88,6 @@ #options WITNESS #Enable checks to detect deadlocks and cycles #options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed -device mem # Memory and kernel memory devices device md device at91_twi # TWI: Two Wire Interface device at91_spi # SPI: ==== //depot/projects/vimage/src/sys/arm/conf/IQ31244#5 (text+ko) ==== @@ -15,9 +15,8 @@ # If you are in doubt as to the purpose or necessity of a line, check first # in NOTES. # -# $FreeBSD: src/sys/arm/conf/IQ31244,v 1.22 2008/04/21 10:09:54 phk Exp $ +# $FreeBSD: src/sys/arm/conf/IQ31244,v 1.23 2008/10/23 01:51:55 marcel Exp $ -machine arm ident IQ31244 options PHYSADDR=0xa0000000 @@ -66,7 +65,6 @@ #options PREEMPTION device loop device ether -device mem # Memory and kernel memory devices #device saarm device miibus device rl ==== //depot/projects/vimage/src/sys/arm/conf/KB920X#8 (text) ==== @@ -16,9 +16,8 @@ # If you are in doubt as to the purpose or necessity of a line, check first # in NOTES. # -# $FreeBSD: src/sys/arm/conf/KB920X,v 1.19 2008/09/07 18:55:55 imp Exp $ +# $FreeBSD: src/sys/arm/conf/KB920X,v 1.20 2008/10/23 01:51:55 marcel Exp $ -machine arm ident KB920X include "../at91/std.kb920x" @@ -80,7 +79,6 @@ #options WITNESS #Enable checks to detect deadlocks and cycles #options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed -device mem # Memory and kernel memory devices device md device at91_twi # TWI: Two Wire Interface device at91_spi # SPI: ==== //depot/projects/vimage/src/sys/arm/conf/NSLU#3 (text+ko) ==== @@ -15,9 +15,8 @@ # If you are in doubt as to the purpose or necessity of a line, check first # in NOTES. # -# $FreeBSD: src/sys/arm/conf/NSLU,v 1.2 2008/09/08 00:41:32 imp Exp $ +# $FreeBSD: src/sys/arm/conf/NSLU,v 1.3 2008/10/23 01:51:55 marcel Exp $ -machine arm ident NSLU options PHYSADDR=0x10000000 @@ -76,7 +75,6 @@ options BOOTP_WIRED_TO=npe0 options BOOTP_COMPAT -device mem # Memory and kernel memory devices device pci device uart ==== //depot/projects/vimage/src/sys/arm/conf/SIMICS#5 (text+ko) ==== @@ -15,9 +15,8 @@ # If you are in doubt as to the purpose or necessity of a line, check first # in NOTES. # -# $FreeBSD: src/sys/arm/conf/SIMICS,v 1.16 2008/04/21 10:09:54 phk Exp $ +# $FreeBSD: src/sys/arm/conf/SIMICS,v 1.17 2008/10/23 01:51:55 marcel Exp $ -machine arm ident SIMICS options KERNPHYSADDR=0xc0000000 @@ -68,5 +67,4 @@ #options WITNESS #Enable checks to detect deadlocks and cycles #options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed -device mem # Memory and kernel memory devices device md ==== //depot/projects/vimage/src/sys/arm/conf/SKYEYE#4 (text) ==== @@ -16,9 +16,8 @@ # If you are in doubt as to the purpose or necessity of a line, check first # in NOTES. # -# $FreeBSD: src/sys/arm/conf/SKYEYE,v 1.10 2008/04/21 10:09:54 phk Exp $ +# $FreeBSD: src/sys/arm/conf/SKYEYE,v 1.11 2008/10/23 01:51:55 marcel Exp $ -machine arm ident KB920X options KERNPHYSADDR=0xc0000000 @@ -79,7 +78,6 @@ #options SMP # Symmetric MultiProcessor Kernel #options APIC_IO # Symmetric (APIC) I/O -device mem # Memory and kernel memory devices device md options SKYEYE_WORKAROUNDS # Floppy drives ==== //depot/projects/vimage/src/sys/compat/freebsd32/freebsd32_misc.c#13 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/compat/freebsd32/freebsd32_misc.c,v 1.80 2008/09/25 20:50:21 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/freebsd32/freebsd32_misc.c,v 1.81 2008/10/22 21:55:48 jhb Exp $"); #include "opt_compat.h" @@ -1762,6 +1762,24 @@ return (ftruncate(td, &ap)); } +int +freebsd32_getdirentries(struct thread *td, + struct freebsd32_getdirentries_args *uap) +{ + long base; + int32_t base32; + int error; + + error = kern_getdirentries(td, uap->fd, uap->buf, uap->count, &base); + if (error) + return (error); + if (uap->basep != NULL) { + base32 = base; + error = copyout(&base32, uap->basep, sizeof(int32_t)); + } + return (error); +} + #ifdef COMPAT_FREEBSD6 /* versions with the 'int pad' argument */ int ==== //depot/projects/vimage/src/sys/compat/freebsd32/freebsd32_proto.h#14 (text+ko) ==== @@ -2,8 +2,8 @@ * System call prototypes. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/compat/freebsd32/freebsd32_proto.h,v 1.93 2008/09/25 20:08:36 jhb Exp $ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 183361 2008-09-25 20:07:42Z jhb + * $FreeBSD: src/sys/compat/freebsd32/freebsd32_proto.h,v 1.94 2008/10/22 21:56:44 jhb Exp $ + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 184183 2008-10-22 21:55:48Z jhb */ #ifndef _FREEBSD32_SYSPROTO_H_ @@ -152,6 +152,12 @@ char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; char ub_l_[PADL_(struct stat32 *)]; struct stat32 * ub; char ub_r_[PADR_(struct stat32 *)]; }; +struct freebsd32_getdirentries_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)]; + char count_l_[PADL_(u_int)]; u_int count; char count_r_[PADR_(u_int)]; + char basep_l_[PADL_(int32_t *)]; int32_t * basep; char basep_r_[PADR_(int32_t *)]; +}; struct freebsd32_sysctl_args { char name_l_[PADL_(int *)]; int * name; char name_r_[PADR_(int *)]; char namelen_l_[PADL_(u_int)]; u_int namelen; char namelen_r_[PADR_(u_int)]; @@ -406,6 +412,7 @@ int freebsd32_stat(struct thread *, struct freebsd32_stat_args *); int freebsd32_fstat(struct thread *, struct freebsd32_fstat_args *); int freebsd32_lstat(struct thread *, struct freebsd32_lstat_args *); +int freebsd32_getdirentries(struct thread *, struct freebsd32_getdirentries_args *); int freebsd32_sysctl(struct thread *, struct freebsd32_sysctl_args *); int freebsd32_futimes(struct thread *, struct freebsd32_futimes_args *); int freebsd32_semctl(struct thread *, struct freebsd32_semctl_args *); @@ -618,6 +625,7 @@ #define FREEBSD32_SYS_AUE_freebsd32_stat AUE_STAT #define FREEBSD32_SYS_AUE_freebsd32_fstat AUE_FSTAT #define FREEBSD32_SYS_AUE_freebsd32_lstat AUE_LSTAT +#define FREEBSD32_SYS_AUE_freebsd32_getdirentries AUE_GETDIRENTRIES #define FREEBSD32_SYS_AUE_freebsd32_sysctl AUE_SYSCTL #define FREEBSD32_SYS_AUE_freebsd32_futimes AUE_FUTIMES #define FREEBSD32_SYS_AUE_freebsd32_semctl AUE_SEMCTL ==== //depot/projects/vimage/src/sys/compat/freebsd32/freebsd32_syscall.h#14 (text+ko) ==== @@ -2,8 +2,8 @@ * System call numbers. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/compat/freebsd32/freebsd32_syscall.h,v 1.92 2008/09/25 20:08:36 jhb Exp $ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 183361 2008-09-25 20:07:42Z jhb + * $FreeBSD: src/sys/compat/freebsd32/freebsd32_syscall.h,v 1.93 2008/10/22 21:56:44 jhb Exp $ >>> TRUNCATED FOR MAIL (1000 lines) <<<