From owner-p4-projects@FreeBSD.ORG Wed Mar 25 14:58:18 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 18A971065670; Wed, 25 Mar 2009 14:58:18 +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 BCBC7106566B for ; Wed, 25 Mar 2009 14:58:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id A72648FC0C for ; Wed, 25 Mar 2009 14:58:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n2PEwHeX065080 for ; Wed, 25 Mar 2009 14:58:17 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n2PEwHi9065078 for perforce@freebsd.org; Wed, 25 Mar 2009 14:58:17 GMT (envelope-from hselasky@FreeBSD.org) Date: Wed, 25 Mar 2009 14:58:17 GMT Message-Id: <200903251458.n2PEwHi9065078@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 159804 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: Wed, 25 Mar 2009 14:58:20 -0000 http://perforce.freebsd.org/chv.cgi?CH=159804 Change 159804 by hselasky@hselasky_laptop001 on 2009/03/25 14:58:11 IFC @ 159802 Affected files ... .. //depot/projects/usb/src/sys/amd64/acpica/acpi_machdep.c#4 integrate .. //depot/projects/usb/src/sys/amd64/acpica/acpi_wakecode.S#2 integrate .. //depot/projects/usb/src/sys/amd64/acpica/acpi_wakeup.c#3 integrate .. //depot/projects/usb/src/sys/amd64/acpica/genwakecode.sh#2 integrate .. //depot/projects/usb/src/sys/amd64/amd64/fpu.c#6 integrate .. //depot/projects/usb/src/sys/amd64/amd64/pmap.c#20 integrate .. //depot/projects/usb/src/sys/amd64/amd64/vm_machdep.c#11 integrate .. //depot/projects/usb/src/sys/amd64/include/pmap.h#9 integrate .. //depot/projects/usb/src/sys/amd64/pci/pci_cfgreg.c#4 integrate .. //depot/projects/usb/src/sys/cddl/dev/dtnfsclient/dtnfsclient.c#1 branch .. //depot/projects/usb/src/sys/conf/files#57 integrate .. //depot/projects/usb/src/sys/conf/options#23 integrate .. //depot/projects/usb/src/sys/dev/acpica/acpi.c#15 integrate .. //depot/projects/usb/src/sys/dev/acpica/acpivar.h#9 integrate .. //depot/projects/usb/src/sys/dev/age/if_age.c#7 integrate .. //depot/projects/usb/src/sys/dev/ath/ah_osdep.c#7 integrate .. //depot/projects/usb/src/sys/dev/bge/if_bge.c#16 integrate .. //depot/projects/usb/src/sys/dev/bge/if_bgereg.h#10 integrate .. //depot/projects/usb/src/sys/dev/cxgb/cxgb_main.c#14 integrate .. //depot/projects/usb/src/sys/dev/cxgb/cxgb_offload.c#6 integrate .. //depot/projects/usb/src/sys/dev/drm/ati_pcigart.c#5 integrate .. //depot/projects/usb/src/sys/dev/drm/drmP.h#12 integrate .. //depot/projects/usb/src/sys/dev/drm/drm_irq.c#8 integrate .. //depot/projects/usb/src/sys/dev/drm/drm_scatter.c#6 integrate .. //depot/projects/usb/src/sys/dev/drm/i915_dma.c#11 integrate .. //depot/projects/usb/src/sys/dev/drm/i915_irq.c#8 integrate .. //depot/projects/usb/src/sys/dev/hptiop/hptiop.h#4 integrate .. //depot/projects/usb/src/sys/dev/if_ndis/if_ndis.c#21 integrate .. //depot/projects/usb/src/sys/dev/iwn/if_iwn.c#5 integrate .. //depot/projects/usb/src/sys/dev/msk/if_msk.c#10 integrate .. //depot/projects/usb/src/sys/dev/my/if_my.c#7 integrate .. //depot/projects/usb/src/sys/dev/pccard/pccarddevs#11 integrate .. //depot/projects/usb/src/sys/dev/twa/tw_cl_init.c#4 integrate .. //depot/projects/usb/src/sys/dev/twa/tw_osl.h#5 integrate .. //depot/projects/usb/src/sys/dev/twa/tw_osl_freebsd.c#7 integrate .. //depot/projects/usb/src/sys/dev/usb/storage/umass.c#10 integrate .. //depot/projects/usb/src/sys/dev/usb/storage/ustorage_fs.c#8 integrate .. //depot/projects/usb/src/sys/dev/usb/usb_dev.c#14 integrate .. //depot/projects/usb/src/sys/dev/usb/usb_device.c#14 integrate .. //depot/projects/usb/src/sys/geom/part/g_part.c#16 integrate .. //depot/projects/usb/src/sys/i386/i386/vm_machdep.c#12 integrate .. //depot/projects/usb/src/sys/i386/include/pmap.h#9 integrate .. //depot/projects/usb/src/sys/i386/isa/npx.c#10 integrate .. //depot/projects/usb/src/sys/i386/pci/pci_cfgreg.c#5 integrate .. //depot/projects/usb/src/sys/kern/imgact_elf.c#11 integrate .. //depot/projects/usb/src/sys/kern/kern_environment.c#7 integrate .. //depot/projects/usb/src/sys/kern/kern_time.c#9 integrate .. //depot/projects/usb/src/sys/kern/subr_bus.c#20 integrate .. //depot/projects/usb/src/sys/kern/subr_param.c#10 integrate .. //depot/projects/usb/src/sys/kern/subr_rtc.c#4 integrate .. //depot/projects/usb/src/sys/kern/vfs_bio.c#16 integrate .. //depot/projects/usb/src/sys/kern/vfs_cache.c#20 integrate .. //depot/projects/usb/src/sys/kern/vfs_lookup.c#13 integrate .. //depot/projects/usb/src/sys/modules/Makefile#29 integrate .. //depot/projects/usb/src/sys/modules/dtrace/Makefile#2 integrate .. //depot/projects/usb/src/sys/modules/dtrace/dtnfsclient/Makefile#1 branch .. //depot/projects/usb/src/sys/modules/dtrace/dtraceall/dtraceall.c#2 integrate .. //depot/projects/usb/src/sys/modules/opensolaris/Makefile#2 integrate .. //depot/projects/usb/src/sys/net80211/ieee80211.c#17 integrate .. //depot/projects/usb/src/sys/net80211/ieee80211_adhoc.c#6 integrate .. //depot/projects/usb/src/sys/net80211/ieee80211_freebsd.h#13 integrate .. //depot/projects/usb/src/sys/net80211/ieee80211_hostap.c#8 integrate .. //depot/projects/usb/src/sys/net80211/ieee80211_input.c#14 integrate .. //depot/projects/usb/src/sys/net80211/ieee80211_input.h#3 integrate .. //depot/projects/usb/src/sys/net80211/ieee80211_ioctl.c#19 integrate .. //depot/projects/usb/src/sys/net80211/ieee80211_node.c#18 integrate .. //depot/projects/usb/src/sys/net80211/ieee80211_output.c#18 integrate .. //depot/projects/usb/src/sys/net80211/ieee80211_proto.c#16 integrate .. //depot/projects/usb/src/sys/net80211/ieee80211_proto.h#11 integrate .. //depot/projects/usb/src/sys/net80211/ieee80211_sta.c#6 integrate .. //depot/projects/usb/src/sys/net80211/ieee80211_superg.c#1 branch .. //depot/projects/usb/src/sys/net80211/ieee80211_superg.h#1 branch .. //depot/projects/usb/src/sys/net80211/ieee80211_tdma.c#6 integrate .. //depot/projects/usb/src/sys/net80211/ieee80211_tdma.h#3 integrate .. //depot/projects/usb/src/sys/net80211/ieee80211_wds.c#6 integrate .. //depot/projects/usb/src/sys/netinet/igmp.c#11 integrate .. //depot/projects/usb/src/sys/netinet/tcp_subr.c#20 integrate .. //depot/projects/usb/src/sys/netipsec/key.c#13 integrate .. //depot/projects/usb/src/sys/nfsclient/nfs_bio.c#10 integrate .. //depot/projects/usb/src/sys/nfsclient/nfs_kdtrace.h#1 branch .. //depot/projects/usb/src/sys/nfsclient/nfs_krpc.c#2 integrate .. //depot/projects/usb/src/sys/nfsclient/nfs_subs.c#8 integrate .. //depot/projects/usb/src/sys/nfsclient/nfs_vnops.c#20 integrate .. //depot/projects/usb/src/sys/powerpc/powermac/ata_macio.c#4 integrate .. //depot/projects/usb/src/sys/sys/dtrace_bsd.h#2 integrate .. //depot/projects/usb/src/sys/sys/param.h#26 integrate Differences ... ==== //depot/projects/usb/src/sys/amd64/acpica/acpi_machdep.c#4 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__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 #include @@ -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/usb/src/sys/amd64/acpica/acpi_wakecode.S#2 (text+ko) ==== @@ -2,7 +2,7 @@ * Copyright (c) 2001 Takanori Watanabe * Copyright (c) 2001 Mitsuru IWASAKI * Copyright (c) 2003 Peter Wemm - * Copyright (c) 2008 Jung-uk Kim + * Copyright (c) 2008-2009 Jung-uk Kim * 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/usb/src/sys/amd64/acpica/acpi_wakeup.c#3 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__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 #include @@ -37,7 +37,6 @@ #include #include #include -#include #include #include @@ -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/usb/src/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[] = {' '};' -__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.164 2009/03/25 14:17:08 jhb Exp $"); #include #include @@ -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); } ==== //depot/projects/usb/src/sys/amd64/amd64/pmap.c#20 (text+ko) ==== @@ -77,7 +77,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.656 2009/03/14 08:28:02 alc Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.657 2009/03/22 04:32:05 alc Exp $"); /* * Manages physical address maps. @@ -542,7 +542,7 @@ * Initialize the kernel pmap (which is statically allocated). */ PMAP_LOCK_INIT(kernel_pmap); - kernel_pmap->pm_pml4 = (pdp_entry_t *) (KERNBASE + KPML4phys); + kernel_pmap->pm_pml4 = (pdp_entry_t *)PHYS_TO_DMAP(KPML4phys); kernel_pmap->pm_root = NULL; kernel_pmap->pm_active = -1; /* don't allow deactivation */ TAILQ_INIT(&kernel_pmap->pm_pvchunk); @@ -1351,7 +1351,7 @@ { PMAP_LOCK_INIT(pmap); - pmap->pm_pml4 = (pml4_entry_t *)(KERNBASE + KPML4phys); + pmap->pm_pml4 = (pml4_entry_t *)PHYS_TO_DMAP(KPML4phys); pmap->pm_root = NULL; pmap->pm_active = 0; TAILQ_INIT(&pmap->pm_pvchunk); @@ -4695,7 +4695,7 @@ oldpmap->pm_active &= ~PCPU_GET(cpumask); pmap->pm_active |= PCPU_GET(cpumask); #endif - cr3 = vtophys(pmap->pm_pml4); + cr3 = DMAP_TO_PHYS((vm_offset_t)pmap->pm_pml4); td->td_pcb->pcb_cr3 = cr3; load_cr3(cr3); critical_exit(); ==== //depot/projects/usb/src/sys/amd64/amd64/vm_machdep.c#11 (text+ko) ==== @@ -41,7 +41,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/vm_machdep.c,v 1.260 2009/03/02 18:43:50 kib Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/vm_machdep.c,v 1.262 2009/03/22 04:32:05 alc Exp $"); #include "opt_isa.h" #include "opt_cpu.h" @@ -103,6 +103,7 @@ register struct proc *p1; struct pcb *pcb2; struct mdproc *mdp2; + pmap_t pmap2; p1 = td1->td_proc; if ((flags & RFPROC) == 0) @@ -150,7 +151,8 @@ * Set registers for trampoline to user mode. Leave space for the * return address on stack. These are the kernel mode register values. */ - pcb2->pcb_cr3 = vtophys(vmspace_pmap(p2->p_vmspace)->pm_pml4); + pmap2 = vmspace_pmap(p2->p_vmspace); + pcb2->pcb_cr3 = DMAP_TO_PHYS((vm_offset_t)pmap2->pm_pml4); pcb2->pcb_r12 = (register_t)fork_return; /* fork_trampoline argument */ pcb2->pcb_rbp = 0; pcb2->pcb_rsp = (register_t)td2->td_frame - sizeof(void *); @@ -287,7 +289,6 @@ * Set registers for trampoline to user mode. Leave space for the * return address on stack. These are the kernel mode register values. */ - pcb2->pcb_cr3 = vtophys(vmspace_pmap(td->td_proc->p_vmspace)->pm_pml4); pcb2->pcb_r12 = (register_t)fork_return; /* trampoline arg */ pcb2->pcb_rbp = 0; pcb2->pcb_rsp = (register_t)td->td_frame - sizeof(void *); /* trampoline arg */ @@ -295,6 +296,7 @@ pcb2->pcb_rip = (register_t)fork_trampoline; /* * If we didn't copy the pcb, we'd need to do the following registers: + * pcb2->pcb_cr3: cloned above. * pcb2->pcb_dr*: cloned above. * pcb2->pcb_savefpu: cloned above. * pcb2->pcb_onfault: cloned above (always NULL here?). ==== //depot/projects/usb/src/sys/amd64/include/pmap.h#9 (text+ko) ==== @@ -39,7 +39,7 @@ * * from: hp300: @(#)pmap.h 7.2 (Berkeley) 12/16/90 * from: @(#)pmap.h 7.4 (Berkeley) 5/12/91 - * $FreeBSD: src/sys/amd64/include/pmap.h,v 1.148 2008/08/04 08:04:09 alc Exp $ + * $FreeBSD: src/sys/amd64/include/pmap.h,v 1.150 2009/03/22 18:56:26 alc Exp $ */ #ifndef _MACHINE_PMAP_H_ @@ -160,13 +160,7 @@ #define PDESHIFT (3) /* - * Address of current and alternate address space page table maps - * and directories. - * XXX it might be saner to just direct map all of physical memory - * into the kernel using 2MB pages. We have enough space to do - * it (2^47 bits of KVM, while current max physical addressability - * is 2^40 physical bits). Then we can get rid of the evil hole - * in the page tables and the evil overlapping. + * Address of current address space page table maps and directories. */ #ifdef _KERNEL #define addr_PTmap (KVADDR(PML4PML4I, 0, 0, 0)) @@ -243,6 +237,10 @@ TAILQ_HEAD(,pv_entry) pv_list; }; +/* + * The kernel virtual address (KVA) of the level 4 page table page is always + * within the direct map (DMAP) region. + */ struct pmap { struct mtx pm_mtx; pml4_entry_t *pm_pml4; /* KVA of level 4 page table */ ==== //depot/projects/usb/src/sys/amd64/pci/pci_cfgreg.c#4 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__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 #include @@ -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/usb/src/sys/conf/files#57 (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/usb/src/sys/conf/options#23 (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/usb/src/sys/dev/acpica/acpi.c#15 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__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 @@ -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); + inittodr(time_second + sc->acpi_sleep_delay); } /* Initialize a device's wake GPE. */ ==== //depot/projects/usb/src/sys/dev/acpica/acpivar.h#9 (text+ko) ==== @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/acpica/acpivar.h,v 1.109 2008/03/13 20:39:03 jhb Exp $ + * $FreeBSD: src/sys/dev/acpica/acpivar.h,v 1.110 2009/03/23 22:12:33 jkim Exp $ */ #ifndef _ACPIVAR_H_ @@ -330,6 +330,7 @@ int acpi_ReqSleepState(struct acpi_softc *sc, int state); int acpi_AckSleepState(struct apm_clone_data *clone, int error); ACPI_STATUS acpi_SetSleepState(struct acpi_softc *sc, int state); +void acpi_resync_clock(struct acpi_softc *sc); int acpi_wake_init(device_t dev, int type); int acpi_wake_set_enable(device_t dev, int enable); int acpi_parse_prw(ACPI_HANDLE h, struct acpi_prw_data *prw); ==== //depot/projects/usb/src/sys/dev/age/if_age.c#7 (text+ko) ==== @@ -28,7 +28,7 @@ /* Driver for Attansic Technology Corp. L1 Gigabit Ethernet. */ #include -__FBSDID("$FreeBSD: src/sys/dev/age/if_age.c,v 1.6 2008/11/07 07:02:28 yongari Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/age/if_age.c,v 1.7 2009/03/23 00:27:46 yongari Exp $"); #include #include @@ -1369,7 +1369,7 @@ AGE_LOCK_ASSERT(sc); - if (pci_find_extcap(sc->age_dev, PCIY_PMG, &pmc) == 0) { + if (pci_find_extcap(sc->age_dev, PCIY_PMG, &pmc) != 0) { CSR_WRITE_4(sc, AGE_WOL_CFG, 0); /* * No PME capability, PHY power down. ==== //depot/projects/usb/src/sys/dev/ath/ah_osdep.c#7 (text+ko) ==== @@ -26,7 +26,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGES. * - * $FreeBSD: src/sys/dev/ath/ah_osdep.c,v 1.6 2008/12/01 16:53:01 sam Exp $ + * $FreeBSD: src/sys/dev/ath/ah_osdep.c,v 1.7 2009/03/24 00:09:35 sam Exp $ */ #include "opt_ah.h" @@ -71,12 +71,7 @@ int lineno, const char* msg); #endif #ifdef AH_DEBUG -#if HAL_ABI_VERSION >= 0x08090101 extern void HALDEBUG(struct ath_hal *ah, u_int mask, const char* fmt, ...); -#else -extern void HALDEBUG(struct ath_hal *ah, const char* fmt, ...); -extern void HALDEBUGn(struct ath_hal *ah, u_int level, const char* fmt, ...); -#endif #endif /* AH_DEBUG */ /* NB: put this here instead of the driver to avoid circular references */ @@ -140,7 +135,6 @@ } #ifdef AH_DEBUG -#if HAL_ABI_VERSION >= 0x08090101 void HALDEBUG(struct ath_hal *ah, u_int mask, const char* fmt, ...) { @@ -151,29 +145,6 @@ va_end(ap); } } -#else -void -HALDEBUG(struct ath_hal *ah, const char* fmt, ...) -{ - if (ath_hal_debug) { - __va_list ap; - va_start(ap, fmt); - ath_hal_vprintf(ah, fmt, ap); - va_end(ap); - } -} - -void -HALDEBUGn(struct ath_hal *ah, u_int level, const char* fmt, ...) -{ - if (ath_hal_debug >= level) { - __va_list ap; - va_start(ap, fmt); - ath_hal_vprintf(ah, fmt, ap); - va_end(ap); - } -} -#endif #endif /* AH_DEBUG */ #ifdef AH_DEBUG_ALQ ==== //depot/projects/usb/src/sys/dev/bge/if_bge.c#16 (text+ko) ==== @@ -32,7 +32,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/bge/if_bge.c,v 1.218 2009/02/10 21:54:23 marius Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/bge/if_bge.c,v 1.220 2009/03/23 14:36:50 marius Exp $"); /* * Broadcom BCM570x family gigabit ethernet driver for FreeBSD. @@ -384,6 +384,7 @@ #endif static void bge_writemem_direct(struct bge_softc *, int, int); static void bge_writereg_ind(struct bge_softc *, int, int); +static void bge_set_max_readrq(struct bge_softc *, int); static int bge_miibus_readreg(device_t, int, int); static int bge_miibus_writereg(device_t, int, int, int); @@ -523,6 +524,34 @@ pci_write_config(dev, BGE_PCI_MEMWIN_BASEADDR, 0, 4); } +/* + * PCI Express only + */ +static void +bge_set_max_readrq(struct bge_softc *sc, int expr_ptr) +{ + device_t dev; + uint16_t val; + + KASSERT((sc->bge_flags & BGE_FLAG_PCIE) && expr_ptr != 0, + ("%s: not applicable", __func__)); + + dev = sc->bge_dev; + + val = pci_read_config(dev, expr_ptr + BGE_PCIE_DEVCTL, 2); + if ((val & BGE_PCIE_DEVCTL_MAX_READRQ_MASK) != + BGE_PCIE_DEVCTL_MAX_READRQ_4096) { + if (bootverbose) + device_printf(dev, "adjust device control 0x%04x ", + val); + val &= ~BGE_PCIE_DEVCTL_MAX_READRQ_MASK; + val |= BGE_PCIE_DEVCTL_MAX_READRQ_4096; + pci_write_config(dev, expr_ptr + BGE_PCIE_DEVCTL, val, 2); + if (bootverbose) + printf("-> 0x%04x\n", val); + } +} + #ifdef notdef static uint32_t bge_readreg_ind(struct bge_softc *sc, int off) @@ -1266,8 +1295,7 @@ } /* - * Do endian, PCI and DMA initialization. Also check the on-board ROM - * self-test results. + * Do endian, PCI and DMA initialization. */ static int bge_chipinit(struct bge_softc *sc) @@ -1278,18 +1306,6 @@ /* Set endianness before we access any non-PCI registers. */ pci_write_config(sc->bge_dev, BGE_PCI_MISC_CTL, BGE_INIT, 4); - /* - * Check the 'ROM failed' bit on the RX CPU to see if - * self-tests passed. Skip this check when there's no - * chip containing the Ethernet address fitted, since - * in that case it will always fail. - */ - if ((sc->bge_flags & BGE_FLAG_EADDR) && - CSR_READ_4(sc, BGE_RXCPU_MODE) & BGE_RXCPUMODE_ROMFAIL) { - device_printf(sc->bge_dev, "RX CPU self-diagnostics failed!\n"); - return (ENODEV); - } - /* Clear the MAC control register */ CSR_WRITE_4(sc, BGE_MAC_MODE, 0); @@ -1387,9 +1403,11 @@ /* * Disable memory write invalidate. Apparently it is not supported - * properly by these devices. + * properly by these devices. Also ensure that INTx isn't disabled, + * as these chips need it even when using MSI. */ - PCI_CLRBIT(sc->bge_dev, BGE_PCI_CMD, PCIM_CMD_MWIEN, 4); + PCI_CLRBIT(sc->bge_dev, BGE_PCI_CMD, + PCIM_CMD_INTxDIS | PCIM_CMD_MWIEN, 4); /* Set the timer prescaler (always 66Mhz) */ CSR_WRITE_4(sc, BGE_MISC_CFG, BGE_32BITTIME_66MHZ); @@ -1742,14 +1760,18 @@ /* Enable host coalescing bug fix. */ if (sc->bge_asicrev == BGE_ASICREV_BCM5755 || sc->bge_asicrev == BGE_ASICREV_BCM5787) - val |= 1 << 29; + val |= 1 << 29; /* Turn on write DMA state machine */ CSR_WRITE_4(sc, BGE_WDMA_MODE, val); + DELAY(40); /* Turn on read DMA state machine */ - CSR_WRITE_4(sc, BGE_RDMA_MODE, - BGE_RDMAMODE_ENABLE | BGE_RDMAMODE_ALL_ATTNS); + val = BGE_RDMAMODE_ENABLE | BGE_RDMAMODE_ALL_ATTNS; + if (sc->bge_flags & BGE_FLAG_PCIE) + val |= BGE_RDMAMODE_FIFO_LONG_BURST; + CSR_WRITE_4(sc, BGE_RDMA_MODE, val); + DELAY(40); /* Turn on RX data completion state machine */ CSR_WRITE_4(sc, BGE_RDC_MODE, BGE_RDCMODE_ENABLE); @@ -2387,7 +2409,7 @@ goto fail; } - /* Save ASIC rev. */ + /* Save various chip information. */ sc->bge_chipid = pci_read_config(dev, BGE_PCI_MISC_CTL, 4) & BGE_PCIMISCCTL_ASICREV; @@ -2470,14 +2492,17 @@ * Found a PCI Express capabilities register, this * must be a PCI Express device. */ - if (reg != 0) + if (reg != 0) { sc->bge_flags |= BGE_FLAG_PCIE; #else if (BGE_IS_5705_PLUS(sc)) { reg = pci_read_config(dev, BGE_PCIE_CAPID_REG, 4); - if ((reg & 0xFF) == BGE_PCIE_CAPID) + if ((reg & 0xFF) == BGE_PCIE_CAPID) { sc->bge_flags |= BGE_FLAG_PCIE; + reg = BGE_PCIE_CAPID; #endif + bge_set_max_readrq(sc, reg); + } } else { /* * Check if the device is in PCI-X Mode. @@ -2522,6 +2547,13 @@ goto fail; } + if (bootverbose) + device_printf(dev, + "CHIP ID 0x%08x; ASIC REV 0x%02x; CHIP REV 0x%02x; %s\n", + sc->bge_chipid, sc->bge_asicrev, sc->bge_chiprev, + (sc->bge_flags & BGE_FLAG_PCIX) ? "PCI-X" : + ((sc->bge_flags & BGE_FLAG_PCIE) ? "PCI-E" : "PCI")); + BGE_LOCK_INIT(sc, device_get_nameunit(dev)); /* Try to reset the chip. */ @@ -3882,6 +3914,7 @@ { struct bge_softc *sc = ifp->if_softc; struct mii_data *mii; >>> TRUNCATED FOR MAIL (1000 lines) <<<