Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Mar 2009 19:41:52 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 159870 for review
Message-ID:  <200903261941.n2QJfqYp070805@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=159870

Change 159870 by jhb@jhb_jhbbsd on 2009/03/26 19:41:26

	IFC @159867

Affected files ...

.. //depot/projects/smpng/sys/amd64/acpica/acpi_machdep.c#12 integrate
.. //depot/projects/smpng/sys/amd64/acpica/acpi_wakecode.S#2 integrate
.. //depot/projects/smpng/sys/amd64/acpica/acpi_wakeup.c#6 integrate
.. //depot/projects/smpng/sys/amd64/acpica/genwakecode.sh#2 integrate
.. //depot/projects/smpng/sys/amd64/amd64/fpu.c#14 integrate
.. //depot/projects/smpng/sys/amd64/amd64/machdep.c#76 integrate
.. //depot/projects/smpng/sys/amd64/linux32/linux.h#19 integrate
.. //depot/projects/smpng/sys/amd64/pci/pci_cfgreg.c#12 integrate
.. //depot/projects/smpng/sys/cddl/dev/dtnfsclient/dtnfsclient.c#2 delete
.. //depot/projects/smpng/sys/compat/linprocfs/linprocfs.c#75 integrate
.. //depot/projects/smpng/sys/compat/linux/linux_file.c#43 integrate
.. //depot/projects/smpng/sys/conf/files#234 integrate
.. //depot/projects/smpng/sys/conf/files.amd64#64 integrate
.. //depot/projects/smpng/sys/conf/files.i386#121 integrate
.. //depot/projects/smpng/sys/conf/options#164 integrate
.. //depot/projects/smpng/sys/dev/acpica/acpi.c#111 integrate
.. //depot/projects/smpng/sys/dev/acpica/acpivar.h#69 integrate
.. //depot/projects/smpng/sys/dev/ath/ah_osdep.c#7 integrate
.. //depot/projects/smpng/sys/dev/drm/ati_pcigart.c#8 integrate
.. //depot/projects/smpng/sys/dev/drm/drmP.h#24 integrate
.. //depot/projects/smpng/sys/dev/drm/drm_irq.c#10 integrate
.. //depot/projects/smpng/sys/dev/drm/drm_scatter.c#9 integrate
.. //depot/projects/smpng/sys/dev/drm/i915_dma.c#14 integrate
.. //depot/projects/smpng/sys/dev/drm/i915_irq.c#10 integrate
.. //depot/projects/smpng/sys/dev/ed/if_ed.c#41 integrate
.. //depot/projects/smpng/sys/dev/ed/if_ed_pccard.c#44 integrate
.. //depot/projects/smpng/sys/dev/fe/if_fe_pccard.c#21 integrate
.. //depot/projects/smpng/sys/dev/hptiop/hptiop.h#4 integrate
.. //depot/projects/smpng/sys/dev/if_ndis/if_ndis.c#54 integrate
.. //depot/projects/smpng/sys/dev/ipmi/ipmi_linux.c#1 branch
.. //depot/projects/smpng/sys/dev/iwn/if_iwn.c#4 integrate
.. //depot/projects/smpng/sys/dev/msk/if_msk.c#16 integrate
.. //depot/projects/smpng/sys/dev/pccard/pccarddevs#64 integrate
.. //depot/projects/smpng/sys/geom/label/g_label.c#14 integrate
.. //depot/projects/smpng/sys/geom/label/g_label.h#8 integrate
.. //depot/projects/smpng/sys/geom/label/g_label_ufs.c#9 integrate
.. //depot/projects/smpng/sys/geom/part/g_part_ebr.c#5 integrate
.. //depot/projects/smpng/sys/i386/i386/machdep.c#137 integrate
.. //depot/projects/smpng/sys/i386/isa/npx.c#66 integrate
.. //depot/projects/smpng/sys/i386/pci/pci_cfgreg.c#37 integrate
.. //depot/projects/smpng/sys/kern/subr_bus.c#77 integrate
.. //depot/projects/smpng/sys/kern/subr_param.c#29 integrate
.. //depot/projects/smpng/sys/kern/subr_rtc.c#4 integrate
.. //depot/projects/smpng/sys/kern/vfs_bio.c#118 integrate
.. //depot/projects/smpng/sys/kern/vfs_cache.c#52 integrate
.. //depot/projects/smpng/sys/kern/vfs_lookup.c#56 integrate
.. //depot/projects/smpng/sys/modules/Makefile#158 integrate
.. //depot/projects/smpng/sys/modules/dtrace/dtnfsclient/Makefile#2 integrate
.. //depot/projects/smpng/sys/modules/ipmi/Makefile#3 integrate
.. //depot/projects/smpng/sys/modules/ipmi/ipmi_linux/Makefile#1 branch
.. //depot/projects/smpng/sys/modules/linprocfs/Makefile#7 integrate
.. //depot/projects/smpng/sys/modules/opensolaris/Makefile#2 integrate
.. //depot/projects/smpng/sys/net80211/ieee80211.c#37 integrate
.. //depot/projects/smpng/sys/net80211/ieee80211_adhoc.c#6 integrate
.. //depot/projects/smpng/sys/net80211/ieee80211_freebsd.h#17 integrate
.. //depot/projects/smpng/sys/net80211/ieee80211_hostap.c#8 integrate
.. //depot/projects/smpng/sys/net80211/ieee80211_input.c#45 integrate
.. //depot/projects/smpng/sys/net80211/ieee80211_input.h#3 integrate
.. //depot/projects/smpng/sys/net80211/ieee80211_ioctl.c#44 integrate
.. //depot/projects/smpng/sys/net80211/ieee80211_node.c#43 integrate
.. //depot/projects/smpng/sys/net80211/ieee80211_output.c#39 integrate
.. //depot/projects/smpng/sys/net80211/ieee80211_proto.c#32 integrate
.. //depot/projects/smpng/sys/net80211/ieee80211_proto.h#21 integrate
.. //depot/projects/smpng/sys/net80211/ieee80211_sta.c#6 integrate
.. //depot/projects/smpng/sys/net80211/ieee80211_superg.c#1 branch
.. //depot/projects/smpng/sys/net80211/ieee80211_superg.h#1 branch
.. //depot/projects/smpng/sys/net80211/ieee80211_tdma.c#8 integrate
.. //depot/projects/smpng/sys/net80211/ieee80211_tdma.h#3 integrate
.. //depot/projects/smpng/sys/net80211/ieee80211_wds.c#6 integrate
.. //depot/projects/smpng/sys/netinet/igmp.c#28 integrate
.. //depot/projects/smpng/sys/nfsclient/nfs_bio.c#54 integrate
.. //depot/projects/smpng/sys/nfsclient/nfs_kdtrace.c#1 branch
.. //depot/projects/smpng/sys/nfsclient/nfs_kdtrace.h#1 branch
.. //depot/projects/smpng/sys/nfsclient/nfs_subs.c#37 integrate
.. //depot/projects/smpng/sys/nfsclient/nfs_vnops.c#85 integrate
.. //depot/projects/smpng/sys/powerpc/powermac/ata_macio.c#17 integrate
.. //depot/projects/smpng/sys/sys/dtrace_bsd.h#3 integrate
.. //depot/projects/smpng/sys/sys/param.h#140 integrate

Differences ...

==== //depot/projects/smpng/sys/amd64/acpica/acpi_machdep.c#12 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/acpica/acpi_machdep.c,v 1.19 2009/03/17 00:48:11 jkim Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/acpica/acpi_machdep.c,v 1.20 2009/03/23 22:35:30 jkim Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -40,11 +40,12 @@
 
 SYSCTL_DECL(_debug_acpi);
 
-uint32_t acpi_resume_beep;
+int acpi_resume_beep;
 TUNABLE_INT("debug.acpi.resume_beep", &acpi_resume_beep);
-SYSCTL_UINT(_debug_acpi, OID_AUTO, resume_beep, CTLFLAG_RW, &acpi_resume_beep,
+SYSCTL_INT(_debug_acpi, OID_AUTO, resume_beep, CTLFLAG_RW, &acpi_resume_beep,
     0, "Beep the PC speaker when resuming");
-uint32_t acpi_reset_video;
+
+int acpi_reset_video;
 TUNABLE_INT("hw.acpi.reset_video", &acpi_reset_video);
 
 static int intr_model = ACPI_INTR_PIC;

==== //depot/projects/smpng/sys/amd64/acpica/acpi_wakecode.S#2 (text+ko) ====

@@ -2,7 +2,7 @@
  * Copyright (c) 2001 Takanori Watanabe <takawata@jp.freebsd.org>
  * Copyright (c) 2001 Mitsuru IWASAKI <iwasaki@jp.freebsd.org>
  * Copyright (c) 2003 Peter Wemm
- * Copyright (c) 2008 Jung-uk Kim <jkim@FreeBSD.org>
+ * Copyright (c) 2008-2009 Jung-uk Kim <jkim@FreeBSD.org>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -26,7 +26,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/amd64/acpica/acpi_wakecode.S,v 1.1 2009/03/17 00:48:11 jkim Exp $
+ * $FreeBSD: src/sys/amd64/acpica/acpi_wakecode.S,v 1.2 2009/03/23 22:35:30 jkim Exp $
  */
 
 #define LOCORE
@@ -66,12 +66,14 @@
 	mov	%ax, %ds		/* are offsets rather than selectors */
 	mov	%ax, %ss
 	movw	$PAGE_SIZE - 8, %sp
-	pushw	$0
+	xorw	%ax, %ax
+	pushw	%ax
 	popfw
 
 	/* To debug resume hangs, beep the speaker if the user requested. */
-	cmpw	$0, resume_beep - wakeup_start
-	je	1f
+	testb	$~0, resume_beep - wakeup_start
+	jz	1f
+	movb	$0, resume_beep - wakeup_start
 	movb	$0xc0, %al
 	outb	%al, $0x42
 	movb	$0x04, %al
@@ -79,22 +81,16 @@
 	inb	$0x61, %al
 	orb	$0x3, %al
 	outb	%al, $0x61
-	movw	$0, resume_beep - wakeup_start
 1:
 
 	/* Re-initialize video BIOS if the reset_video tunable is set. */
-	cmpw	$0, reset_video - wakeup_start
-	je	1f
+	testb	$~0, reset_video - wakeup_start
+	jz	1f
+	movb	$0, reset_video - wakeup_start
 	lcall	$0xc000, $3
-	movw	$0, reset_video - wakeup_start
 
-	/*
-	 * Set up segment registers for real mode again in case the
-	 * previous BIOS call clobbers them.
-	 */
-	mov	%cs, %ax
-	mov	%ax, %ds
-	mov	%ax, %ss
+	/* Re-start in case the previous BIOS call clobbers them. */
+	jmp	wakeup_start
 1:
 
 	/*
@@ -204,6 +200,7 @@
 	 * space. Remember that jmp is relative and that we've been relocated,
 	 * so use an indirect jump.
 	 */
+	ALIGN_TEXT
 	.code64
 wakeup_64:
 	mov	$bootdata64 - bootgdt, %eax
@@ -215,6 +212,13 @@
 	movq	wakeup_retaddr - wakeup_start(%rbx), %rax
 	jmp	*%rax
 
+	.data
+
+resume_beep:
+	.byte	0
+reset_video:
+	.byte	0
+
 	ALIGN_DATA
 bootgdt:
 	.long	0x00000000
@@ -245,10 +249,6 @@
 	.long	bootgdt - wakeup_start	/* Offset plus %ds << 4 */
 
 	ALIGN_DATA
-resume_beep:
-	.long	0
-reset_video:
-	.long	0
 wakeup_retaddr:
 	.quad	0
 wakeup_kpml4:

==== //depot/projects/smpng/sys/amd64/acpica/acpi_wakeup.c#6 (text+ko) ====

@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/acpica/acpi_wakeup.c,v 1.23 2009/03/17 00:48:11 jkim Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/acpica/acpi_wakeup.c,v 1.24 2009/03/23 22:35:30 jkim Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -37,7 +37,6 @@
 #include <sys/malloc.h>
 #include <sys/memrange.h>
 #include <sys/smp.h>
-#include <sys/sysctl.h>
 #include <sys/types.h>
 
 #include <vm/vm.h>
@@ -67,8 +66,8 @@
 #error this file needs sys/cdefs.h as a prerequisite
 #endif
 
-extern uint32_t		acpi_resume_beep;
-extern uint32_t		acpi_reset_video;
+extern int		acpi_resume_beep;
+extern int		acpi_reset_video;
 
 #ifdef SMP
 extern struct xpcb	*stopxpcbs;
@@ -280,8 +279,8 @@
 		}
 #endif
 
-		WAKECODE_FIXUP(resume_beep, uint32_t, acpi_resume_beep);
-		WAKECODE_FIXUP(reset_video, uint32_t, acpi_reset_video);
+		WAKECODE_FIXUP(resume_beep, uint8_t, (acpi_resume_beep != 0));
+		WAKECODE_FIXUP(reset_video, uint8_t, (acpi_reset_video != 0));
 
 		WAKECODE_FIXUP(wakeup_xpcb, struct xpcb *, &stopxpcbs[0]);
 		WAKECODE_FIXUP(wakeup_gdt, uint16_t,
@@ -309,13 +308,11 @@
 			ia32_pause();
 	} else {
 		fpusetregs(curthread, stopfpu);
-
-		WAKECODE_FIXUP(resume_beep, uint32_t, 0);
-		WAKECODE_FIXUP(reset_video, uint32_t, 0);
 #ifdef SMP
 		if (wakeup_cpus != 0)
 			acpi_wakeup_cpus(sc, wakeup_cpus);
 #endif
+		acpi_resync_clock(sc);
 		ret = 0;
 	}
 

==== //depot/projects/smpng/sys/amd64/acpica/genwakecode.sh#2 (text+ko) ====

@@ -1,6 +1,6 @@
 #!/bin/sh
-# $FreeBSD: src/sys/amd64/acpica/genwakecode.sh,v 1.1 2009/03/17 00:48:11 jkim Exp $
+# $FreeBSD: src/sys/amd64/acpica/genwakecode.sh,v 1.2 2009/03/23 22:35:30 jkim Exp $
 #
-file2c 'static char wakecode[] = {' '};' <acpi_wakecode.bin
+file2c -sx 'static char wakecode[] = {' '};' <acpi_wakecode.bin
 
 exit 0

==== //depot/projects/smpng/sys/amd64/amd64/fpu.c#14 (text+ko) ====

@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/fpu.c,v 1.163 2009/03/05 19:42:11 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/fpu.c,v 1.165 2009/03/25 22:08:30 jhb Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -101,7 +101,7 @@
 SYSCTL_INT(_hw, HW_FLOATINGPT, floatingpoint, CTLFLAG_RD,
     NULL, 1, "Floating point instructions executed in hardware");
 
-static	struct savefpu		fpu_cleanstate;
+static	struct savefpu		fpu_initialstate;
 
 /*
  * Initialize the floating point unit.  On the boot CPU we generate a
@@ -123,13 +123,13 @@
 	mxcsr = __INITIAL_MXCSR__;
 	ldmxcsr(mxcsr);
 	if (PCPU_GET(cpuid) == 0) {
-		fxsave(&fpu_cleanstate);
-		if (fpu_cleanstate.sv_env.en_mxcsr_mask)
-			cpu_mxcsr_mask = fpu_cleanstate.sv_env.en_mxcsr_mask;
+		fxsave(&fpu_initialstate);
+		if (fpu_initialstate.sv_env.en_mxcsr_mask)
+			cpu_mxcsr_mask = fpu_initialstate.sv_env.en_mxcsr_mask;
 		else
 			cpu_mxcsr_mask = 0xFFBF;
-		bzero(fpu_cleanstate.sv_fp, sizeof(fpu_cleanstate.sv_fp));
-		bzero(fpu_cleanstate.sv_xmm, sizeof(fpu_cleanstate.sv_xmm));
+		bzero(fpu_initialstate.sv_fp, sizeof(fpu_initialstate.sv_fp));
+		bzero(fpu_initialstate.sv_xmm, sizeof(fpu_initialstate.sv_xmm));
 	}
 	start_emulating();
 	intr_restore(savecrit);
@@ -416,10 +416,11 @@
 
 	if ((pcb->pcb_flags & PCB_FPUINITDONE) == 0) {
 		/*
-		 * This is the first time this thread has used the FPU,
-		 * explicitly load sanitized registers.
+		 * This is the first time this thread has used the FPU or
+		 * the PCB doesn't contain a clean FPU state.  Explicitly
+		 * load an initial state.
 		 */
-		fxrstor(&fpu_cleanstate);
+		fxrstor(&fpu_initialstate);
 		if (pcb->pcb_initial_fpucw != __INITIAL_FPUCW__)
 			fldcw(&pcb->pcb_initial_fpucw);
 		pcb->pcb_flags |= PCB_FPUINITDONE;
@@ -453,7 +454,7 @@
 	register_t s;
 
 	if ((td->td_pcb->pcb_flags & PCB_FPUINITDONE) == 0) {
-		bcopy(&fpu_cleanstate, addr, sizeof(fpu_cleanstate));
+		bcopy(&fpu_initialstate, addr, sizeof(fpu_initialstate));
 		addr->sv_env.en_cw = td->td_pcb->pcb_initial_fpucw;
 		return (_MC_FPOWNED_NONE);
 	}
@@ -479,7 +480,6 @@
 
 	s = intr_disable();
 	if (td == PCPU_GET(fpcurthread)) {
-		fpu_clean_state();
 		fxrstor(addr);
 		intr_restore(s);
 	} else {
@@ -498,10 +498,10 @@
  * In order to avoid leaking this information across processes, we clean
  * these values by performing a dummy load before executing fxrstor().
  */
-static	double	dummy_variable = 0.0;
 static void
 fpu_clean_state(void)
 {
+	static float dummy_variable = 0.0;
 	u_short status;
 
 	/*

==== //depot/projects/smpng/sys/amd64/amd64/machdep.c#76 (text+ko) ====

@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/machdep.c,v 1.693 2009/03/11 15:30:12 dfr Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/machdep.c,v 1.694 2009/03/26 18:07:13 kib Exp $");
 
 #include "opt_atalk.h"
 #include "opt_atpic.h"
@@ -818,87 +818,86 @@
 /* software prototypes -- in more palatable form */
 struct soft_segment_descriptor gdt_segs[] = {
 /* GNULL_SEL	0 Null Descriptor */
-{	0x0,			/* segment base address  */
-	0x0,			/* length */
-	0,			/* segment type */
-	0,			/* segment descriptor priority level */
-	0,			/* segment descriptor present */
-	0,			/* long */
-	0,			/* default 32 vs 16 bit size */
-	0  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0x0,
+	.ssd_limit = 0x0,
+	.ssd_type = 0,
+	.ssd_dpl = 0,
+	.ssd_p = 0,
+	.ssd_long = 0,
+	.ssd_def32 = 0,
+	.ssd_gran = 0		},
 /* GCODE_SEL	1 Code Descriptor for kernel */
-{	0x0,			/* segment base address  */
-	0xfffff,		/* length - all address space */
-	SDT_MEMERA,		/* segment type */
-	SEL_KPL,		/* segment descriptor priority level */
-	1,			/* segment descriptor present */
-	1,			/* long */
-	0,			/* default 32 vs 16 bit size */
-	1  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0x0,
+	.ssd_limit = 0xfffff,
+	.ssd_type = SDT_MEMERA,
+	.ssd_dpl = SEL_KPL,
+	.ssd_p = 1,
+	.ssd_long = 1,
+	.ssd_def32 = 0,
+	.ssd_gran = 1		},
 /* GDATA_SEL	2 Data Descriptor for kernel */
-{	0x0,			/* segment base address  */
-	0xfffff,		/* length - all address space */
-	SDT_MEMRWA,		/* segment type */
-	SEL_KPL,		/* segment descriptor priority level */
-	1,			/* segment descriptor present */
-	1,			/* long */
-	0,			/* default 32 vs 16 bit size */
-	1  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0x0,
+	.ssd_limit = 0xfffff,
+	.ssd_type = SDT_MEMRWA,
+	.ssd_dpl = SEL_KPL,
+	.ssd_p = 1,
+	.ssd_long = 1,
+	.ssd_def32 = 0,
+	.ssd_gran = 1		},
 /* GUCODE32_SEL	3 32 bit Code Descriptor for user */
-{	0x0,			/* segment base address  */
-	0xfffff,		/* length - all address space */
-	SDT_MEMERA,		/* segment type */
-	SEL_UPL,		/* segment descriptor priority level */
-	1,			/* segment descriptor present */
-	0,			/* long */
-	1,			/* default 32 vs 16 bit size */
-	1  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0x0,
+	.ssd_limit = 0xfffff,
+	.ssd_type = SDT_MEMERA,
+	.ssd_dpl = SEL_UPL,
+	.ssd_p = 1,
+	.ssd_long = 0,
+	.ssd_def32 = 1,
+	.ssd_gran = 1		},
 /* GUDATA_SEL	4 32/64 bit Data Descriptor for user */
-{	0x0,			/* segment base address  */
-	0xfffff,		/* length - all address space */
-	SDT_MEMRWA,		/* segment type */
-	SEL_UPL,		/* segment descriptor priority level */
-	1,			/* segment descriptor present */
-	0,			/* long */
-	1,			/* default 32 vs 16 bit size */
-	1  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0x0,
+	.ssd_limit = 0xfffff,
+	.ssd_type = SDT_MEMRWA,
+	.ssd_dpl = SEL_UPL,
+	.ssd_p = 1,
+	.ssd_long = 0,
+	.ssd_def32 = 1,
+	.ssd_gran = 1		},
 /* GUCODE_SEL	5 64 bit Code Descriptor for user */
-{	0x0,			/* segment base address  */
-	0xfffff,		/* length - all address space */
-	SDT_MEMERA,		/* segment type */
-	SEL_UPL,		/* segment descriptor priority level */
-	1,			/* segment descriptor present */
-	1,			/* long */
-	0,			/* default 32 vs 16 bit size */
-	1  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0x0,
+	.ssd_limit = 0xfffff,
+	.ssd_type = SDT_MEMERA,
+	.ssd_dpl = SEL_UPL,
+	.ssd_p = 1,
+	.ssd_long = 1,
+	.ssd_def32 = 0,
+	.ssd_gran = 1		},
 /* GPROC0_SEL	6 Proc 0 Tss Descriptor */
-{
-	0x0,			/* segment base address */
-	sizeof(struct amd64tss)-1,/* length */
-	SDT_SYSTSS,		/* segment type */
-	SEL_KPL,		/* segment descriptor priority level */
-	1,			/* segment descriptor present */
-	0,			/* long */
-	0,			/* unused - default 32 vs 16 bit size */
-	0  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0x0,
+	.ssd_limit = sizeof(struct amd64tss)-1,
+	.ssd_type = SDT_SYSTSS,
+	.ssd_dpl = SEL_KPL,
+	.ssd_p = 1,
+	.ssd_long = 0,
+	.ssd_def32 = 0,
+	.ssd_gran = 0		},
 /* Actually, the TSS is a system descriptor which is double size */
-{	0x0,			/* segment base address  */
-	0x0,			/* length */
-	0,			/* segment type */
-	0,			/* segment descriptor priority level */
-	0,			/* segment descriptor present */
-	0,			/* long */
-	0,			/* default 32 vs 16 bit size */
-	0  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0x0,
+	.ssd_limit = 0x0,
+	.ssd_type = 0,
+	.ssd_dpl = 0,
+	.ssd_p = 0,
+	.ssd_long = 0,
+	.ssd_def32 = 0,
+	.ssd_gran = 0		},
 /* GUGS32_SEL	8 32 bit GS Descriptor for user */
-{	0x0,			/* segment base address  */
-	0xfffff,		/* length - all address space */
-	SDT_MEMRWA,		/* segment type */
-	SEL_UPL,		/* segment descriptor priority level */
-	1,			/* segment descriptor present */
-	0,			/* long */
-	1,			/* default 32 vs 16 bit size */
-	1  			/* limit granularity (byte/page units)*/ },
+{	.ssd_base = 0x0,
+	.ssd_limit = 0xfffff,
+	.ssd_type = SDT_MEMRWA,
+	.ssd_dpl = SEL_UPL,
+	.ssd_p = 1,
+	.ssd_long = 0,
+	.ssd_def32 = 1,
+	.ssd_gran = 1		},
 };
 
 void

==== //depot/projects/smpng/sys/amd64/linux32/linux.h#19 (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.23 2009/03/04 12:14:33 dchagin Exp $
+ * $FreeBSD: src/sys/amd64/linux32/linux.h,v 1.24 2009/03/26 17:14:22 ambrisko Exp $
  */
 
 #ifndef _AMD64_LINUX_H_
@@ -79,7 +79,7 @@
 typedef l_int		l_key_t;
 typedef l_longlong	l_loff_t;
 typedef l_ushort	l_mode_t;
-typedef l_long		l_off_t;
+typedef l_ulong		l_off_t;
 typedef l_int		l_pid_t;
 typedef l_uint		l_size_t;
 typedef l_long		l_suseconds_t;

==== //depot/projects/smpng/sys/amd64/pci/pci_cfgreg.c#12 (text+ko) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/pci/pci_cfgreg.c,v 1.113 2008/09/11 21:42:11 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/pci/pci_cfgreg.c,v 1.114 2009/03/24 18:10:22 jhb Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -119,6 +119,7 @@
 {
 
 	if (cfgmech == CFGMECH_PCIE &&
+	    (bus >= pcie_minbus && bus <= pcie_maxbus) &&
 	    (bus != 0 || !(1 << slot & pcie_badslots)))
 		return (pciereg_cfgread(bus, slot, func, reg, bytes));
 	else
@@ -158,6 +159,7 @@
 {
 
 	if (cfgmech == CFGMECH_PCIE &&
+	    (bus >= pcie_minbus && bus <= pcie_maxbus) &&
 	    (bus != 0 || !(1 << slot & pcie_badslots)))
 		pciereg_cfgwrite(bus, slot, func, reg, data, bytes);
 	else

==== //depot/projects/smpng/sys/compat/linprocfs/linprocfs.c#75 (text+ko) ====

@@ -43,7 +43,7 @@
 #include "opt_compat.h"
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/compat/linprocfs/linprocfs.c,v 1.136 2009/02/27 14:12:05 bz Exp $");
+__FBSDID("$FreeBSD: src/sys/compat/linprocfs/linprocfs.c,v 1.137 2009/03/26 17:14:22 ambrisko Exp $");
 
 #include <sys/param.h>
 #include <sys/queue.h>
@@ -75,6 +75,7 @@
 #include <sys/vmmeter.h>
 #include <sys/vnode.h>
 #include <sys/vimage.h>
+#include <sys/bus.h>
 
 #include <net/if.h>
 #include <net/route.h>
@@ -90,6 +91,9 @@
 
 #include <machine/clock.h>
 
+#include <geom/geom.h>
+#include <geom/geom_int.h>
+
 #if defined(__i386__) || defined(__amd64__)
 #include <machine/cputypes.h>
 #include <machine/md_var.h>
@@ -359,6 +363,9 @@
 			sbuf_printf(sb, "/sys %s sysfs %s", mntto,
 			    mp->mnt_stat.f_flags & MNT_RDONLY ? "ro" : "rw");
 		} else {
+			/* For Linux msdosfs is called vfat */
+			if (strcmp(fstype, "msdosfs") == 0)
+				fstype = "vfat";
 			sbuf_printf(sb, "%s %s %s %s", mntfrom, mntto, fstype,
 			    mp->mnt_stat.f_flags & MNT_RDONLY ? "ro" : "rw");
 		}
@@ -383,6 +390,69 @@
 }
 
 /*
+ * Filler function for proc/partitions
+ *
+ */
+static int
+linprocfs_dopartitions(PFS_FILL_ARGS)
+{
+	struct g_class *cp;
+	struct g_geom *gp;
+	struct g_provider *pp;
+	struct nameidata nd;
+	const char *lep;
+	char  *dlep, *flep;
+	size_t lep_len;
+	int error;
+	int major, minor;
+
+	/* resolve symlinks etc. in the emulation tree prefix */
+	NDINIT(&nd, LOOKUP, FOLLOW | MPSAFE, UIO_SYSSPACE, linux_emul_path, td);
+	flep = NULL;
+	error = namei(&nd);
+	lep = linux_emul_path;
+	if (error == 0) {
+		if (vn_fullpath(td, nd.ni_vp, &dlep, &flep) == 0)
+			lep = dlep;
+		vrele(nd.ni_vp);
+		VFS_UNLOCK_GIANT(NDHASGIANT(&nd));
+	}
+	lep_len = strlen(lep);
+
+	g_topology_lock();
+	error = 0;
+	sbuf_printf(sb, "major minor  #blocks  name rio rmerge rsect "
+	    "ruse wio wmerge wsect wuse running use aveq\n");
+
+	LIST_FOREACH(cp, &g_classes, class) {
+		if (strcmp(cp->name, "DISK") == 0 ||
+		    strcmp(cp->name, "PART") == 0)
+			LIST_FOREACH(gp, &cp->geom, geom) {
+				LIST_FOREACH(pp, &gp->provider, provider) {
+					if (linux_driver_get_major_minor(
+					    pp->name, &major, &minor) != 0) {
+						major = 0;
+						minor = 0;
+					}
+					sbuf_printf(sb, "%d %d %lld %s "
+					    "%d %d %d %d %d "
+					     "%d %d %d %d %d %d\n",
+					     major, minor,
+					     (long long)pp->mediasize, pp->name,
+					     0, 0, 0, 0, 0,
+					     0, 0, 0, 0, 0, 0);
+				}
+			}
+	}
+	g_topology_unlock();
+
+	if (flep != NULL)
+		free(flep, M_TEMP);
+	return (error);
+}
+
+
+/*
  * Filler function for proc/stat
  */
 static int
@@ -1206,6 +1276,8 @@
 	    NULL, NULL, NULL, PFS_RD);
 	pfs_create_file(root, "mtab", &linprocfs_domtab,
 	    NULL, NULL, NULL, PFS_RD);
+	pfs_create_file(root, "partitions", &linprocfs_dopartitions,
+	    NULL, NULL, NULL, PFS_RD);
 	pfs_create_link(root, "self", &procfs_docurproc,
 	    NULL, NULL, NULL, 0);
 	pfs_create_file(root, "stat", &linprocfs_dostat,

==== //depot/projects/smpng/sys/compat/linux/linux_file.c#43 (text+ko) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/compat/linux/linux_file.c,v 1.117 2009/02/13 18:18:14 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/compat/linux/linux_file.c,v 1.118 2009/03/26 17:14:22 ambrisko Exp $");
 
 #include "opt_compat.h"
 #include "opt_mac.h"
@@ -1109,6 +1109,9 @@
 	} else if (strcmp(fstypename, "proc") == 0) {
 		strcpy(fstypename, "linprocfs");
 		fsdata = NULL;
+	} else if (strcmp(fstypename, "vfat") == 0) {
+		strcpy(fstypename, "msdosfs");
+		fsdata = NULL;
 	} else {
 		return (ENODEV);
 	}
@@ -1135,6 +1138,12 @@
 			"fstype", fstypename,
 			"fspath", mntonname,
 			NULL);
+	} else if (strcmp(fstypename, "msdosfs") == 0) {
+		error = kernel_vmount(fsflags,
+			"fstype", fstypename,
+			"fspath", mntonname,
+			"from", mntfromname,
+			NULL);
 	} else
 		error = EOPNOTSUPP;
 	return (error);

==== //depot/projects/smpng/sys/conf/files#234 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/files,v 1.1383 2009/03/19 20:33:26 thompsa Exp $
+# $FreeBSD: src/sys/conf/files,v 1.1386 2009/03/24 20:39:08 sam Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -2189,14 +2189,14 @@
 					 mxge | netgraph_deflate | \
 					 ddb_ctf
 net80211/ieee80211.c		optional wlan
-net80211/ieee80211_acl.c	optional wlan_acl
+net80211/ieee80211_acl.c	optional wlan wlan_acl
 net80211/ieee80211_adhoc.c	optional wlan
-net80211/ieee80211_amrr.c	optional wlan_amrr
+net80211/ieee80211_amrr.c	optional wlan wlan_amrr
 net80211/ieee80211_crypto.c	optional wlan
-net80211/ieee80211_crypto_ccmp.c optional wlan_ccmp
+net80211/ieee80211_crypto_ccmp.c optional wlan wlan_ccmp
 net80211/ieee80211_crypto_none.c optional wlan
-net80211/ieee80211_crypto_tkip.c optional wlan_tkip
-net80211/ieee80211_crypto_wep.c	optional wlan_wep
+net80211/ieee80211_crypto_tkip.c optional wlan wlan_tkip
+net80211/ieee80211_crypto_wep.c	optional wlan wlan_wep
 net80211/ieee80211_ddb.c	optional wlan ddb
 net80211/ieee80211_dfs.c	optional wlan
 net80211/ieee80211_freebsd.c	optional wlan
@@ -2211,13 +2211,14 @@
 net80211/ieee80211_power.c	optional wlan
 net80211/ieee80211_proto.c	optional wlan
 net80211/ieee80211_regdomain.c	optional wlan
-net80211/ieee80211_rssadapt.c	optional wlan_rssadapt
+net80211/ieee80211_rssadapt.c	optional wlan wlan_rssadapt
 net80211/ieee80211_scan.c	optional wlan
 net80211/ieee80211_scan_sta.c	optional wlan
 net80211/ieee80211_sta.c	optional wlan
-net80211/ieee80211_tdma.c	optional wlan
+net80211/ieee80211_superg.c	optional wlan ieee80211_support_superg
+net80211/ieee80211_tdma.c	optional wlan ieee80211_support_tdma
 net80211/ieee80211_wds.c	optional wlan
-net80211/ieee80211_xauth.c	optional wlan_xauth
+net80211/ieee80211_xauth.c	optional wlan wlan_xauth
 netatalk/aarp.c			optional netatalk
 netatalk/at_control.c		optional netatalk
 netatalk/at_proto.c		optional netatalk

==== //depot/projects/smpng/sys/conf/files.amd64#64 (text+ko) ====

@@ -1,7 +1,7 @@
 # This file tells config what files go into building a kernel,
 # files marked standard are always included.
 #
-# $FreeBSD: src/sys/conf/files.amd64,v 1.133 2009/03/17 00:48:11 jkim Exp $
+# $FreeBSD: src/sys/conf/files.amd64,v 1.134 2009/03/26 17:14:22 ambrisko Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -183,6 +183,7 @@
 dev/ipmi/ipmi_smbios.c		optional	ipmi
 dev/ipmi/ipmi_ssif.c		optional	ipmi smbus
 dev/ipmi/ipmi_pci.c		optional	ipmi pci
+dev/ipmi/ipmi_linux.c		optional	ipmi linux_compat32
 dev/fdc/fdc.c			optional	fdc
 dev/fdc/fdc_acpi.c		optional	fdc
 dev/fdc/fdc_isa.c		optional	fdc isa

==== //depot/projects/smpng/sys/conf/files.i386#121 (text+ko) ====

@@ -1,7 +1,7 @@
 # This file tells config what files go into building a kernel,
 # files marked standard are always included.
 #
-# $FreeBSD: src/sys/conf/files.i386,v 1.617 2009/03/15 14:21:05 rwatson Exp $
+# $FreeBSD: src/sys/conf/files.i386,v 1.618 2009/03/26 17:14:22 ambrisko Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -196,6 +196,7 @@
 dev/ipmi/ipmi_smbios.c		optional ipmi
 dev/ipmi/ipmi_ssif.c		optional ipmi smbus
 dev/ipmi/ipmi_pci.c		optional ipmi pci
+dev/ipmi/ipmi_linux.c		optional ipmi linux_compat
 dev/kbd/kbd.c			optional atkbd | sc | ukbd | usb2_input_kbd
 dev/le/if_le_isa.c		optional le isa
 dev/mem/memutil.c		optional mem

==== //depot/projects/smpng/sys/conf/options#164 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/options,v 1.662 2009/03/15 14:21:05 rwatson Exp $
+# $FreeBSD: src/sys/conf/options,v 1.663 2009/03/24 20:39:08 sam Exp $
 #
 #        On the handling of kernel options
 #
@@ -789,6 +789,7 @@
 IEEE80211_DEBUG		opt_wlan.h
 IEEE80211_DEBUG_REFCNT	opt_wlan.h
 IEEE80211_AMPDU_AGE	opt_wlan.h
+IEEE80211_SUPPORT_SUPERG	opt_wlan.h
 IEEE80211_SUPPORT_TDMA	opt_wlan.h
 
 # 802.11 TDMA support

==== //depot/projects/smpng/sys/dev/acpica/acpi.c#111 (text+ko) ====

@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi.c,v 1.255 2009/03/17 00:48:11 jkim Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi.c,v 1.257 2009/03/23 22:12:33 jkim Exp $");
 
 #include "opt_acpi.h"
 #include <sys/param.h>
@@ -254,6 +254,12 @@
 SYSCTL_INT(_debug_acpi, OID_AUTO, do_powerstate, CTLFLAG_RW,
     &acpi_do_powerstate, 1, "Turn off devices when suspending.");
 
+/* Reset system clock while resuming.  XXX Remove once tested. */
+static int acpi_reset_clock = 1;
+TUNABLE_INT("debug.acpi.reset_clock", &acpi_reset_clock);
+SYSCTL_INT(_debug_acpi, OID_AUTO, reset_clock, CTLFLAG_RW,
+    &acpi_reset_clock, 1, "Reset system clock while resuming.");
+
 /* Allow users to override quirks. */
 TUNABLE_INT("debug.acpi.quirks", &acpi_quirks);
 
@@ -2336,7 +2342,7 @@
 #endif
 
     /* If devd(8) is not running, immediately enter the sleep state. */
-    if (devctl_process_running() == FALSE) {
+    if (!devctl_process_running()) {
 	ACPI_UNLOCK(acpi);
 	if (ACPI_SUCCESS(acpi_EnterSleepState(sc, sc->acpi_next_sstate))) {
 	    return (0);
@@ -2345,9 +2351,6 @@
 	}
     }
 
-    /* Now notify devd(8) also. */
-    acpi_UserNotify("Suspend", ACPI_ROOT_OBJECT, state);
-
     /*
      * Set a timeout to fire if userland doesn't ack the suspend request
      * in time.  This way we still eventually go to sleep if we were
@@ -2357,6 +2360,10 @@
      */
     callout_reset(&sc->susp_force_to, 10 * hz, acpi_sleep_force, sc);
     ACPI_UNLOCK(acpi);
+
+    /* Now notify devd(8) also. */
+    acpi_UserNotify("Suspend", ACPI_ROOT_OBJECT, state);
+
     return (0);
 #else
     /* This platform does not support acpi suspend/resume. */
@@ -2432,8 +2439,24 @@
 static void
 acpi_sleep_enable(void *arg)
 {
+    struct acpi_softc	*sc = (struct acpi_softc *)arg;
+
+    ACPI_LOCK(acpi);
+    sc->acpi_sleep_disabled = 0;
+    ACPI_UNLOCK(acpi);
+}
+
+static ACPI_STATUS
+acpi_sleep_disable(struct acpi_softc *sc)
+{
+    ACPI_STATUS		status;
+
+    ACPI_LOCK(acpi);
+    status = sc->acpi_sleep_disabled ? AE_ERROR : AE_OK;
+    sc->acpi_sleep_disabled = 1;
+    ACPI_UNLOCK(acpi);
 
-    ((struct acpi_softc *)arg)->acpi_sleep_disabled = 0;
+    return (status);
 }
 
 enum acpi_sleep_state {
@@ -2460,15 +2483,11 @@
     ACPI_FUNCTION_TRACE_U32((char *)(uintptr_t)__func__, state);
 
     /* Re-entry once we're suspending is not allowed. */
-    status = AE_OK;
-    ACPI_LOCK(acpi);
-    if (sc->acpi_sleep_disabled) {
-	ACPI_UNLOCK(acpi);
+    status = acpi_sleep_disable(sc);
+    if (ACPI_FAILURE(status)) {
 	printf("acpi: suspend request ignored (not ready yet)\n");
-	return (AE_ERROR);
+	return (status);
     }
-    sc->acpi_sleep_disabled = 1;
-    ACPI_UNLOCK(acpi);
 
 #ifdef SMP
     thread_lock(curthread);
@@ -2557,6 +2576,7 @@
 	 * shutdown handlers.
 	 */
 	shutdown_nice(RB_POWEROFF);
+	status = AE_OK;
 	break;
     case ACPI_STATE_S0:
     default:
@@ -2580,26 +2600,38 @@
     if (slp_state >= ACPI_SS_SLEPT)
 	acpi_enable_fixed_events(sc);
 
+    mtx_unlock(&Giant);
+
+#ifdef SMP
+    thread_lock(curthread);
+    sched_unbind(curthread);
+    thread_unlock(curthread);
+#endif
+
     /* Allow another sleep request after a while. */
     if (state != ACPI_STATE_S5)
 	timeout(acpi_sleep_enable, sc, hz * ACPI_MINIMUM_AWAKETIME);
 
     /* Run /etc/rc.resume after we are back. */
-    acpi_UserNotify("Resume", ACPI_ROOT_OBJECT, state);
+    if (devctl_process_running())
+	acpi_UserNotify("Resume", ACPI_ROOT_OBJECT, state);
+
+    return_ACPI_STATUS (status);
+}
+
+void
+acpi_resync_clock(struct acpi_softc *sc)
+{
 
-    mtx_unlock(&Giant);
+    if (!acpi_reset_clock)
+	return;
 
-    /* Warm up timecounter again */
+    /*
+     * Warm up timecounter again and reset system clock.
+     */
     (void)timecounter->tc_get_timecount(timecounter);
     (void)timecounter->tc_get_timecount(timecounter);
-
-#ifdef SMP
-    thread_lock(curthread);
-    sched_unbind(curthread);
-    thread_unlock(curthread);
-#endif
-
-    return_ACPI_STATUS (status);

>>> TRUNCATED FOR MAIL (1000 lines) <<<



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200903261941.n2QJfqYp070805>