PERFORCE change 140666 for review
Diego Giagio
diego at FreeBSD.org
Sat Apr 26 11:25:11 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=140666
Change 140666 by diego at diego_black on 2008/04/26 11:24:10
IFC
Affected files ...
.. //depot/projects/soc2008/diego-audit/src/sys/amd64/amd64/machdep.c#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/amd64/amd64/pmap.c#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/amd64/include/pcpu.h#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/arm/arm/machdep.c#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/conf/files#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/conf/files.sparc64#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/conf/files.sun4v#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/ddb/db_capture.c#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/dev/acpica/acpi_thermal.c#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/dev/bge/if_bge.c#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/dev/em/e1000_82571.c#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/dev/em/e1000_82571.h#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/dev/em/e1000_api.c#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/dev/em/e1000_api.h#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/dev/em/e1000_defines.h#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/dev/em/e1000_hw.h#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/dev/em/e1000_ich8lan.c#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/dev/em/e1000_ich8lan.h#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/dev/em/e1000_osdep.h#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/dev/em/e1000_phy.c#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/dev/em/e1000_phy.h#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/dev/em/if_em.c#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/dev/em/if_em.h#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/dev/hme/if_hme.c#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/dev/hme/if_hme_pci.c#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/dev/hme/if_hme_sbus.c#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/dev/hme/if_hmereg.h#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/dev/hme/if_hmevar.h#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/dev/igb/e1000_82575.c#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/dev/igb/e1000_api.c#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/dev/igb/e1000_api.h#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/dev/igb/e1000_defines.h#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/dev/igb/e1000_hw.h#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/dev/igb/e1000_mac.c#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/dev/igb/e1000_manage.h#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/dev/igb/e1000_osdep.c#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/dev/igb/e1000_osdep.h#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/dev/igb/e1000_phy.c#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/dev/igb/if_igb.c#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/dev/igb/if_igb.h#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/dev/sym/sym_hipd.c#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/dev/usb/if_rum.c#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/dev/usb/if_udav.c#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/dev/usb/usbdevs#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/dev/vx/if_vx.c#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/fs/unionfs/union.h#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/fs/unionfs/union_subr.c#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/fs/unionfs/union_vnops.c#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/i386/i386/machdep.c#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/i386/i386/pmap.c#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/i386/include/pcpu.h#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/ia64/ia64/machdep.c#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/kern/kern_descrip.c#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/kern/sched_4bsd.c#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/kern/sched_ule.c#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/mips/mips/machdep.c#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/modules/em/Makefile#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/net80211/ieee80211.c#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/pc98/pc98/machdep.c#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/powerpc/aim/machdep.c#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/powerpc/booke/machdep.c#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/security/audit/audit.h#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/sparc64/isa/isa.c#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/sparc64/pci/ofw_pci.h#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/sparc64/pci/ofw_pci_if.m#2 delete
.. //depot/projects/soc2008/diego-audit/src/sys/sparc64/pci/psycho.c#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/sparc64/sparc64/machdep.c#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/sun4v/sun4v/hv_pci.c#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/sun4v/sun4v/machdep.c#2 integrate
.. //depot/projects/soc2008/diego-audit/src/sys/sys/proc.h#2 integrate
Differences ...
==== //depot/projects/soc2008/diego-audit/src/sys/amd64/amd64/machdep.c#2 (text+ko) ====
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/machdep.c,v 1.685 2008/04/22 19:38:26 phk Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/machdep.c,v 1.686 2008/04/25 05:18:47 jeff Exp $");
#include "opt_atalk.h"
#include "opt_atpic.h"
@@ -53,6 +53,7 @@
#include "opt_maxmem.h"
#include "opt_msgbuf.h"
#include "opt_perfmon.h"
+#include "opt_sched.h"
#include <sys/param.h>
#include <sys/proc.h>
@@ -527,62 +528,192 @@
__asm__ ("hlt");
}
+void (*cpu_idle_hook)(void) = NULL; /* ACPI idle hook. */
+
+static void
+cpu_idle_hlt(int busy)
+{
+ /*
+ * we must absolutely guarentee that hlt is the next instruction
+ * after sti or we introduce a timing window.
+ */
+ disable_intr();
+ if (sched_runnable())
+ enable_intr();
+ else
+ __asm __volatile("sti; hlt");
+}
+
+static void
+cpu_idle_acpi(int busy)
+{
+ disable_intr();
+ if (sched_runnable())
+ enable_intr();
+ else if (cpu_idle_hook)
+ cpu_idle_hook();
+ else
+ __asm __volatile("sti; hlt");
+}
+
+static void
+cpu_idle_spin(int busy)
+{
+ return;
+}
+
+void (*cpu_idle_fn)(int) = cpu_idle_acpi;
+
+void
+cpu_idle(int busy)
+{
+#ifdef SMP
+ if (mp_grab_cpu_hlt())
+ return;
+#endif
+ cpu_idle_fn(busy);
+}
+
/*
- * Hook to idle the CPU when possible. In the SMP case we default to
- * off because a halted cpu will not currently pick up a new thread in the
- * run queue until the next timer tick. If turned on this will result in
- * approximately a 4.2% loss in real time performance in buildworld tests
- * (but improves user and sys times oddly enough), and saves approximately
- * 5% in power consumption on an idle machine (tests w/2xCPU 1.1GHz P3).
- *
- * XXX we need to have a cpu mask of idle cpus and generate an IPI or
- * otherwise generate some sort of interrupt to wake up cpus sitting in HLT.
- * Then we can have our cake and eat it too.
- *
- * XXX I'm turning it on for SMP as well by default for now. It seems to
- * help lock contention somewhat, and this is critical for HTT. -Peter
+ * mwait cpu power states. Lower 4 bits are sub-states.
*/
-static int cpu_idle_hlt = 1;
-TUNABLE_INT("machdep.cpu_idle_hlt", &cpu_idle_hlt);
-SYSCTL_INT(_machdep, OID_AUTO, cpu_idle_hlt, CTLFLAG_RW,
- &cpu_idle_hlt, 0, "Idle loop HLT enable");
+#define MWAIT_C0 0xf0
+#define MWAIT_C1 0x00
+#define MWAIT_C2 0x10
+#define MWAIT_C3 0x20
+#define MWAIT_C4 0x30
+
+#define MWAIT_DISABLED 0x0
+#define MWAIT_WOKEN 0x1
+#define MWAIT_WAITING 0x2
+
+static void
+cpu_idle_mwait(int busy)
+{
+ int *mwait;
+
+ mwait = (int *)PCPU_PTR(monitorbuf);
+ *mwait = MWAIT_WAITING;
+ if (sched_runnable())
+ return;
+ cpu_monitor(mwait, 0, 0);
+ if (*mwait == MWAIT_WAITING)
+ cpu_mwait(0, MWAIT_C1);
+}
static void
-cpu_idle_default(void)
+cpu_idle_mwait_hlt(int busy)
+{
+ int *mwait;
+
+ mwait = (int *)PCPU_PTR(monitorbuf);
+ if (busy == 0) {
+ *mwait = MWAIT_DISABLED;
+ cpu_idle_hlt(busy);
+ return;
+ }
+ *mwait = MWAIT_WAITING;
+ if (sched_runnable())
+ return;
+ cpu_monitor(mwait, 0, 0);
+ if (*mwait == MWAIT_WAITING)
+ cpu_mwait(0, MWAIT_C1);
+}
+
+int
+cpu_idle_wakeup(int cpu)
{
+ struct pcpu *pcpu;
+ int *mwait;
+
+ if (cpu_idle_fn == cpu_idle_spin)
+ return (1);
+ if (cpu_idle_fn != cpu_idle_mwait && cpu_idle_fn != cpu_idle_mwait_hlt)
+ return (0);
+ pcpu = pcpu_find(cpu);
+ mwait = (int *)pcpu->pc_monitorbuf;
/*
- * we must absolutely guarentee that hlt is the
- * absolute next instruction after sti or we
- * introduce a timing window.
+ * This doesn't need to be atomic since missing the race will
+ * simply result in unnecessary IPIs.
*/
- __asm __volatile("sti; hlt");
+ if (cpu_idle_fn == cpu_idle_mwait_hlt && *mwait == MWAIT_DISABLED)
+ return (0);
+ *mwait = MWAIT_WOKEN;
+
+ return (1);
}
/*
- * Note that we have to be careful here to avoid a race between checking
- * sched_runnable() and actually halting. If we don't do this, we may waste
- * the time between calling hlt and the next interrupt even though there
- * is a runnable process.
+ * Ordered by speed/power consumption.
*/
-void
-cpu_idle(void)
+struct {
+ void *id_fn;
+ char *id_name;
+} idle_tbl[] = {
+ { cpu_idle_spin, "spin" },
+ { cpu_idle_mwait, "mwait" },
+ { cpu_idle_mwait_hlt, "mwait_hlt" },
+ { cpu_idle_hlt, "hlt" },
+ { cpu_idle_acpi, "acpi" },
+ { NULL, NULL }
+};
+
+static int
+idle_sysctl_available(SYSCTL_HANDLER_ARGS)
+{
+ char *avail, *p;
+ int error;
+ int i;
+
+ avail = malloc(256, M_TEMP, M_WAITOK);
+ p = avail;
+ for (i = 0; idle_tbl[i].id_name != NULL; i++) {
+ if (strstr(idle_tbl[i].id_name, "mwait") &&
+ (cpu_feature2 & CPUID2_MON) == 0)
+ continue;
+ p += sprintf(p, "%s, ", idle_tbl[i].id_name);
+ }
+ error = sysctl_handle_string(oidp, avail, 0, req);
+ free(avail, M_TEMP);
+ return (error);
+}
+
+static int
+idle_sysctl(SYSCTL_HANDLER_ARGS)
{
+ char buf[16];
+ int error;
+ char *p;
+ int i;
-#ifdef SMP
- if (mp_grab_cpu_hlt())
- return;
-#endif
- if (cpu_idle_hlt) {
- disable_intr();
- if (sched_runnable())
- enable_intr();
- else
- (*cpu_idle_hook)();
+ p = "unknown";
+ for (i = 0; idle_tbl[i].id_name != NULL; i++) {
+ if (idle_tbl[i].id_fn == cpu_idle_fn) {
+ p = idle_tbl[i].id_name;
+ break;
+ }
+ }
+ strncpy(buf, p, sizeof(buf));
+ error = sysctl_handle_string(oidp, buf, sizeof(buf), req);
+ if (error != 0 || req->newptr == NULL)
+ return (error);
+ for (i = 0; idle_tbl[i].id_name != NULL; i++) {
+ if (strstr(idle_tbl[i].id_name, "mwait") &&
+ (cpu_feature2 & CPUID2_MON) == 0)
+ continue;
+ if (strcmp(idle_tbl[i].id_name, buf))
+ continue;
+ cpu_idle_fn = idle_tbl[i].id_fn;
+ return (0);
}
+ return (EINVAL);
}
-/* Other subsystems (e.g., ACPI) can hook this later. */
-void (*cpu_idle_hook)(void) = cpu_idle_default;
+SYSCTL_PROC(_machdep, OID_AUTO, idle_available, CTLTYPE_STRING | CTLFLAG_RD,
+ 0, 0, idle_sysctl_available, "A", "list of available idle functions");
+
+SYSCTL_PROC(_machdep, OID_AUTO, idle, CTLTYPE_STRING | CTLFLAG_RW, 0, 0,
+ idle_sysctl, "A", "currently selected idle function");
/*
* Clear registers on exec
==== //depot/projects/soc2008/diego-audit/src/sys/amd64/amd64/pmap.c#2 (text+ko) ====
@@ -77,7 +77,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.614 2008/04/10 16:04:50 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.615 2008/04/25 16:00:39 alc Exp $");
/*
* Manages physical address maps.
@@ -2266,7 +2266,7 @@
* the 2mpage to referencing the page table page.
*/
if ((oldpde & PG_MANAGED) != 0)
- pmap_pv_demote_pde(pmap, va, oldpde & PG_FRAME);
+ pmap_pv_demote_pde(pmap, va, oldpde & PG_PS_FRAME);
pmap_pde_demotions++;
CTR2(KTR_PMAP, "pmap_demote_pde: success for va %#lx"
@@ -2301,10 +2301,10 @@
pmap_invalidate_page(kernel_pmap, sva);
pmap->pm_stats.resident_count -= NBPDR / PAGE_SIZE;
if (oldpde & PG_MANAGED) {
- pvh = pa_to_pvh(oldpde & PG_FRAME);
+ pvh = pa_to_pvh(oldpde & PG_PS_FRAME);
pmap_pvh_free(pvh, pmap, sva);
eva = sva + NBPDR;
- for (va = sva, m = PHYS_TO_VM_PAGE(oldpde & PG_FRAME);
+ for (va = sva, m = PHYS_TO_VM_PAGE(oldpde & PG_PS_FRAME);
va < eva; va += PAGE_SIZE, m++) {
if ((oldpde & (PG_M | PG_RW)) == (PG_M | PG_RW))
vm_page_dirty(m);
@@ -2600,7 +2600,7 @@
oldpde = newpde = *pde;
if (oldpde & PG_MANAGED) {
eva = sva + NBPDR;
- for (va = sva, m = PHYS_TO_VM_PAGE(oldpde & PG_FRAME);
+ for (va = sva, m = PHYS_TO_VM_PAGE(oldpde & PG_PS_FRAME);
va < eva; va += PAGE_SIZE, m++) {
/*
* In contrast to the analogous operation on a 4KB page
@@ -2839,7 +2839,7 @@
* Promote the pv entries.
*/
if ((newpde & PG_MANAGED) != 0)
- pmap_pv_promote_pde(pmap, va, newpde & PG_FRAME);
+ pmap_pv_promote_pde(pmap, va, newpde & PG_PS_FRAME);
/*
* Propagate the PAT index to its proper position.
@@ -3820,7 +3820,7 @@
pc->pc_map[field] |= bitmask;
if ((tpte & PG_PS) != 0) {
pmap->pm_stats.resident_count -= NBPDR / PAGE_SIZE;
- pvh = pa_to_pvh(tpte & PG_FRAME);
+ pvh = pa_to_pvh(tpte & PG_PS_FRAME);
TAILQ_REMOVE(&pvh->pv_list, pv, pv_list);
if (TAILQ_EMPTY(&pvh->pv_list)) {
for (mt = m; mt < &m[NBPDR / PAGE_SIZE]; mt++)
@@ -4029,7 +4029,7 @@
* table page.
*/
va += VM_PAGE_TO_PHYS(m) - (oldpde &
- PG_FRAME);
+ PG_PS_FRAME);
pmap_remove_page(pmap, va, pde, NULL);
rtval++;
if (rtval > 4) {
@@ -4098,7 +4098,7 @@
* write access may repromote.
*/
va += VM_PAGE_TO_PHYS(m) - (oldpde &
- PG_FRAME);
+ PG_PS_FRAME);
pte = pmap_pde_to_pte(pde, va);
oldpte = *pte;
if ((oldpte & PG_V) != 0) {
@@ -4163,7 +4163,8 @@
* fully populated, this removal never frees
* a page table page.
*/
- va += VM_PAGE_TO_PHYS(m) - (oldpde & PG_FRAME);
+ va += VM_PAGE_TO_PHYS(m) - (oldpde &
+ PG_PS_FRAME);
pmap_remove_page(pmap, va, pde, NULL);
}
}
==== //depot/projects/soc2008/diego-audit/src/sys/amd64/include/pcpu.h#2 (text+ko) ====
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/amd64/include/pcpu.h,v 1.48 2007/06/04 21:38:45 attilio Exp $
+ * $FreeBSD: src/sys/amd64/include/pcpu.h,v 1.49 2008/04/25 05:18:48 jeff Exp $
*/
#ifndef _MACHINE_PCPU_H_
@@ -43,6 +43,7 @@
* other processors"
*/
#define PCPU_MD_FIELDS \
+ char pc_monitorbuf[128] __aligned(128); /* cache line */ \
struct pcpu *pc_prvspace; /* Self-reference */ \
struct pmap *pc_curpmap; \
struct amd64tss *pc_tssp; \
==== //depot/projects/soc2008/diego-audit/src/sys/arm/arm/machdep.c#2 (text+ko) ====
@@ -46,7 +46,7 @@
#include "opt_ddb.h"
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/arm/machdep.c,v 1.30 2008/04/03 16:44:49 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/arm/machdep.c,v 1.31 2008/04/25 05:18:48 jeff Exp $");
#include <sys/param.h>
#include <sys/proc.h>
@@ -326,12 +326,19 @@
}
void
-cpu_idle(void)
+cpu_idle(int busy)
{
cpu_sleep(0);
}
int
+cpu_idle_wakeup(int cpu)
+{
+
+ return (0);
+}
+
+int
fill_regs(struct thread *td, struct reg *regs)
{
struct trapframe *tf = td->td_frame;
==== //depot/projects/soc2008/diego-audit/src/sys/conf/files#2 (text+ko) ====
@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/files,v 1.1294 2008/04/21 10:09:53 phk Exp $
+# $FreeBSD: src/sys/conf/files,v 1.1295 2008/04/25 20:42:48 sam Exp $
#
# The long compile-with and dependency lines are required because of
# limitations in config: backslash-newline doesn't work in strings, and
@@ -732,6 +732,48 @@
dev/ips/ips_ioctl.c optional ips
dev/ips/ips_pci.c optional ips pci
dev/ipw/if_ipw.c optional ipw
+ipwbssfw.c optional ipwbssfw | ipwfw \
+ compile-with "${AWK} -f $S/tools/fw_stub.awk ipw_bss.fw:ipw_bss:130 -lintel_ipw -mipw_bss -c${.TARGET}" \
+ no-implicit-rule before-depend local \
+ clean "ipwbssfw.c"
+ipw_bss.fwo optional ipwbssfw | ipwfw \
+ dependency "ipw_bss.fw" \
+ compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} ipw_bss.fw" \
+ no-implicit-rule \
+ clean "ipw_bss.fwo"
+ipw_bss.fw optional ipwbssfw | ipwfw \
+ dependency ".PHONY" \
+ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ipw/ipw2100-1.3.fw.uu" \
+ no-obj no-implicit-rule \
+ clean "ipw_bss.fw"
+ipwibssfw.c optional ipwibssfw | ipwfw \
+ compile-with "${AWK} -f $S/tools/fw_stub.awk ipw_ibss.fw:ipw_ibss:130 -lintel_ipw -mipw_ibss -c${.TARGET}" \
+ no-implicit-rule before-depend local \
+ clean "ipwibssfw.c"
+ipw_ibss.fwo optional ipwibssfw | ipwfw \
+ dependency "ipw_ibss.fw" \
+ compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} ipw_ibss.fw" \
+ no-implicit-rule \
+ clean "ipw_ibss.fwo"
+ipw_ibss.fw optional ipwibssfw | ipwfw \
+ dependency ".PHONY" \
+ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ipw/ipw2100-1.3-i.fw.uu" \
+ no-obj no-implicit-rule \
+ clean "ipw_ibss.fw"
+ipwmonitorfw.c optional ipwmonitorfw | ipwfw \
+ compile-with "${AWK} -f $S/tools/fw_stub.awk ipw_monitor.fw:ipw_monitor:130 -lintel_ipw -mipw_monitor -c${.TARGET}" \
+ no-implicit-rule before-depend local \
+ clean "ipwmonitorfw.c"
+ipw_monitor.fwo optional ipwmonitorfw | ipwfw \
+ dependency "ipw_monitor.fw" \
+ compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} ipw_monitor.fw" \
+ no-implicit-rule \
+ clean "ipw_monitor.fwo"
+ipw_monitor.fw optional ipwmonitorfw | ipwfw \
+ dependency ".PHONY" \
+ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ipw/ipw2100-1.3-p.fw.uu" \
+ no-obj no-implicit-rule \
+ clean "ipw_monitor.fw"
dev/iscsi/initiator/iscsi.c optional iscsi_initiator scbus
dev/iscsi/initiator/iscsi_subr.c optional iscsi_initiator scbus
dev/iscsi/initiator/isc_cam.c optional iscsi_initiator scbus
@@ -746,6 +788,48 @@
dev/isp/isp_target.c optional isp
dev/ispfw/ispfw.c optional ispfw
dev/iwi/if_iwi.c optional iwi
+iwibssfw.c optional iwibssfw | iwifw \
+ compile-with "${AWK} -f $S/tools/fw_stub.awk iwi_bss.fw:iwi_bss:300 -lintel_iwi -miwi_bss -c${.TARGET}" \
+ no-implicit-rule before-depend local \
+ clean "iwibssfw.c"
+iwi_bss.fwo optional iwibssfw | iwifw \
+ dependency "iwi_bss.fw" \
+ compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwi_bss.fw" \
+ no-implicit-rule \
+ clean "iwi_bss.fwo"
+iwi_bss.fw optional iwibssfw | iwifw \
+ dependency ".PHONY" \
+ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwi/ipw2200-bss.fw.uu" \
+ no-obj no-implicit-rule \
+ clean "iwi_bss.fw"
+iwiibssfw.c optional iwiibssfw | iwifw \
+ compile-with "${AWK} -f $S/tools/fw_stub.awk iwi_ibss.fw:iwi_ibss:300 -lintel_iwi -miwi_ibss -c${.TARGET}" \
+ no-implicit-rule before-depend local \
+ clean "iwiibssfw.c"
+iwi_ibss.fwo optional iwiibssfw | iwifw \
+ dependency "iwi_ibss.fw" \
+ compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwi_ibss.fw" \
+ no-implicit-rule \
+ clean "iwi_ibss.fwo"
+iwi_ibss.fw optional iwiibssfw | iwifw \
+ dependency ".PHONY" \
+ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwi/ipw2200-ibss.fw.uu" \
+ no-obj no-implicit-rule \
+ clean "iwi_ibss.fw"
+iwimonitorfw.c optional iwimonitorfw | iwifw \
+ compile-with "${AWK} -f $S/tools/fw_stub.awk iwi_monitor.fw:iwi_monitor:300 -lintel_iwi -miwi_monitor -c${.TARGET}" \
+ no-implicit-rule before-depend local \
+ clean "iwimonitorfw.c"
+iwi_monitor.fwo optional iwimonitorfw | iwifw \
+ dependency "iwi_monitor.fw" \
+ compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwi_monitor.fw" \
+ no-implicit-rule \
+ clean "iwi_monitor.fwo"
+iwi_monitor.fw optional iwimonitorfw | iwifw \
+ dependency ".PHONY" \
+ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwi/ipw2200-sniffer.fw.uu" \
+ no-obj no-implicit-rule \
+ clean "iwi_monitor.fw"
dev/ixgb/if_ixgb.c optional ixgb
dev/ixgb/ixgb_ee.c optional ixgb
dev/ixgb/ixgb_hw.c optional ixgb
@@ -922,6 +1006,62 @@
dev/ral/rt2560.c optional ral
dev/ral/rt2661.c optional ral
dev/ral/if_ral_pci.c optional ral pci
+rt2561fw.c optional rt2561fw | ralfw \
+ compile-with "${AWK} -f $S/tools/fw_stub.awk rt2561.fw:rt2561fw -mrt2561 -c${.TARGET}" \
+ no-implicit-rule before-depend local \
+ clean "rt2561fw.c"
+rt2561fw.fwo optional rt2561fw | ralfw \
+ dependency "rt2561.fw" \
+ compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} rt2561.fw" \
+ no-implicit-rule \
+ clean "rt2561.fwo"
+rt2561.fw optional rt2561fw | ralfw \
+ dependency ".PHONY" \
+ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ral/rt2561.fw.uu" \
+ no-obj no-implicit-rule \
+ clean "rt2561.fw"
+rt2561sfw.c optional rt2561sfw | ralfw \
+ compile-with "${AWK} -f $S/tools/fw_stub.awk rt2561s.fw:rt2561sfw -mrt2561s -c${.TARGET}" \
+ no-implicit-rule before-depend local \
+ clean "rt2561sfw.c"
+rt2561sfw.fwo optional rt2561sfw | ralfw \
+ dependency "rt2561s.fw" \
+ compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} rt2561s.fw" \
+ no-implicit-rule \
+ clean "rt2561s.fwo"
+rt2561s.fw optional rt2561sfw | ralfw \
+ dependency ".PHONY" \
+ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ral/rt2561s.fw.uu" \
+ no-obj no-implicit-rule \
+ clean "rt2561s.fw"
+rt2661fw.c optional rt2661fw | ralfw \
+ compile-with "${AWK} -f $S/tools/fw_stub.awk rt2661.fw:rt2661fw -mrt2661 -c${.TARGET}" \
+ no-implicit-rule before-depend local \
+ clean "rt2661fw.c"
+rt2661fw.fwo optional rt2661fw | ralfw \
+ dependency "rt2661.fw" \
+ compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} rt2661.fw" \
+ no-implicit-rule \
+ clean "rt2661.fwo"
+rt2661.fw optional rt2661fw | ralfw \
+ dependency ".PHONY" \
+ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ral/rt2661.fw.uu" \
+ no-obj no-implicit-rule \
+ clean "rt2661.fw"
+rt2860fw.c optional rt2860fw | ralfw \
+ compile-with "${AWK} -f $S/tools/fw_stub.awk rt2860.fw:rt2860fw -mrt2860 -c${.TARGET}" \
+ no-implicit-rule before-depend local \
+ clean "rt2860fw.c"
+rt2860fw.fwo optional rt2860fw | ralfw \
+ dependency "rt2860.fw" \
+ compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} rt2860.fw" \
+ no-implicit-rule \
+ clean "rt2860.fwo"
+rt2860.fw optional rt2860fw | ralfw \
+ dependency ".PHONY" \
+ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ral/rt2860.fw.uu" \
+ no-obj no-implicit-rule \
+ clean "rt2860.fw"
dev/random/harvest.c standard
dev/random/hash.c optional random
dev/random/probe.c optional random
@@ -1183,6 +1323,20 @@
dev/wi/if_wi_pccard.c optional wi pccard
dev/wi/if_wi_pci.c optional wi pci
dev/wl/if_wl.c optional wl isa
+wpifw.c optional wpifw \
+ compile-with "${AWK} -f $S/tools/fw_stub.awk wpi.fw:wpifw:2144 -lintel_wpi -mwpi -c${.TARGET}" \
+ no-implicit-rule before-depend local \
+ clean "wpifw.c"
+wpifw.fwo optional wpifw \
+ dependency "wpi.fw" \
+ compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} wpi.fw" \
+ no-implicit-rule \
+ clean "wpi.fwo"
+wpi.fw optional wpifw \
+ dependency ".PHONY" \
+ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/wpi/iwlwifi-3945-2.14.4.fw.uu" \
+ no-obj no-implicit-rule \
+ clean "wpi.fw"
dev/xe/if_xe.c optional xe
dev/xe/if_xe_pccard.c optional xe pccard
fs/coda/coda_fbsd.c optional vcoda
==== //depot/projects/soc2008/diego-audit/src/sys/conf/files.sparc64#2 (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.sparc64,v 1.94 2008/02/11 21:40:22 marius Exp $
+# $FreeBSD: src/sys/conf/files.sparc64,v 1.95 2008/04/26 11:01:37 marius Exp $
#
# The long compile-with and dependency lines are required because of
# limitations in config: backslash-newline doesn't work in strings, and
@@ -83,7 +83,6 @@
sparc64/pci/ofw_pcib.c optional pci
sparc64/pci/ofw_pcib_subr.c optional pci
sparc64/pci/ofw_pcibus.c optional pci
-sparc64/pci/ofw_pci_if.m optional pci
sparc64/pci/psycho.c optional pci
sparc64/sbus/dma_sbus.c optional sbus
sparc64/sbus/sbus.c optional sbus
==== //depot/projects/soc2008/diego-audit/src/sys/conf/files.sun4v#2 (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.sun4v,v 1.13 2007/12/02 20:40:31 rwatson Exp $
+# $FreeBSD: src/sys/conf/files.sun4v,v 1.14 2008/04/26 11:01:37 marius Exp $
#
# The long compile-with and dependency lines are required because of
# limitations in config: backslash-newline doesn't work in strings, and
@@ -49,7 +49,6 @@
sparc64/pci/ofw_pcib.c optional pci
sparc64/pci/ofw_pcib_subr.c optional pci
sparc64/pci/ofw_pcibus.c optional pci
-sparc64/pci/ofw_pci_if.m optional pci
# XXX hvcons should be optional
sun4v/sun4v/hvcons.c standard
==== //depot/projects/soc2008/diego-audit/src/sys/ddb/db_capture.c#2 (text+ko) ====
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/ddb/db_capture.c,v 1.5 2008/01/26 23:02:14 rwatson Exp $");
+__FBSDID("$FreeBSD: src/sys/ddb/db_capture.c,v 1.6 2008/04/25 13:23:36 rwatson Exp $");
#include "opt_ddb.h"
@@ -83,13 +83,16 @@
static SYSCTL_NODE(_debug_ddb, OID_AUTO, capture, CTLFLAG_RW, 0,
"DDB capture options");
-SYSCTL_UINT(_debug_ddb_capture, OID_AUTO, bytes, CTLFLAG_RD,
+SYSCTL_UINT(_debug_ddb_capture, OID_AUTO, bufoff, CTLFLAG_RD,
&db_capture_bufoff, 0, "Bytes of data in DDB capture buffer");
SYSCTL_UINT(_debug_ddb_capture, OID_AUTO, maxbufsize, CTLFLAG_RD,
&db_capture_maxbufsize, 0,
"Maximum value for debug.ddb.capture.bufsize");
+SYSCTL_UINT(_debug_ddb_capture, OID_AUTO, inprogress, CTLFLAG_RD,
+ &db_capture_inprogress, 0, "DDB output capture in progress");
+
/*
* Boot-time allocation of the DDB capture buffer, if any. Force all buffer
* sizes, including the maximum size, to be rounded to block sizes.
==== //depot/projects/soc2008/diego-audit/src/sys/dev/acpica/acpi_thermal.c#2 (text+ko) ====
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_thermal.c,v 1.69 2008/02/16 07:15:34 ume Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_thermal.c,v 1.70 2008/04/25 16:45:13 rpaulo Exp $");
#include "opt_acpi.h"
#include <sys/param.h>
@@ -90,6 +90,7 @@
int tz_temperature; /*Current temperature*/
int tz_active; /*Current active cooling*/
#define TZ_ACTIVE_NONE -1
+#define TZ_ACTIVE_UNKNOWN -2
int tz_requested; /*Minimum active cooling*/
int tz_thflags; /*Current temp-related flags*/
#define TZ_THFLAG_NONE 0
@@ -202,7 +203,7 @@
sc->tz_dev = dev;
sc->tz_handle = acpi_get_handle(dev);
sc->tz_requested = TZ_ACTIVE_NONE;
- sc->tz_active = TZ_ACTIVE_NONE;
+ sc->tz_active = TZ_ACTIVE_UNKNOWN;
sc->tz_thflags = TZ_THFLAG_NONE;
sc->tz_cooling_proc = NULL;
sc->tz_cooling_proc_running = FALSE;
@@ -520,6 +521,7 @@
* minimum cooling run time if requested.
*/
if (acpi_tz_min_runtime > 0 && sc->tz_active != TZ_ACTIVE_NONE &&
+ sc->tz_active != TZ_ACTIVE_UNKNOWN &&
(newactive == TZ_ACTIVE_NONE || newactive > sc->tz_active)) {
getnanotime(&curtime);
@@ -543,6 +545,23 @@
newflags |= TZ_THFLAG_CRT;
/* If the active cooling state has changed, we have to switch things. */
+ if (sc->tz_active == TZ_ACTIVE_UNKNOWN) {
+ /*
+ * We don't know which cooling device is on or off,
+ * so stop them all, because we now know which
+ * should be on (if any).
+ */
+ for (i = 0; i < TZ_NUMLEVELS; i++) {
+ if (sc->tz_zone.al[i].Pointer != NULL) {
+ acpi_ForeachPackageObject(
+ (ACPI_OBJECT *)sc->tz_zone.al[i].Pointer,
+ acpi_tz_switch_cooler_off, sc);
+ }
+ }
+ /* now we know that all devices are off */
+ sc->tz_active = TZ_ACTIVE_NONE;
+ }
+
if (newactive != sc->tz_active) {
/* Turn off the cooling devices that are on, if any are */
if (sc->tz_active != TZ_ACTIVE_NONE)
==== //depot/projects/soc2008/diego-audit/src/sys/dev/bge/if_bge.c#2 (text+ko) ====
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/bge/if_bge.c,v 1.205 2008/04/08 11:51:17 bz Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/bge/if_bge.c,v 1.206 2008/04/26 10:54:17 marius Exp $");
/*
* Broadcom BCM570x family gigabit ethernet driver for FreeBSD.
@@ -1894,16 +1894,10 @@
/*
* Allocate the parent bus DMA tag appropriate for PCI.
*/
- error = bus_dma_tag_create(bus_get_dma_tag(sc->bge_dev), /* parent */
- 1, 0, /* alignment, boundary */
- BUS_SPACE_MAXADDR, /* lowaddr */
- BUS_SPACE_MAXADDR, /* highaddr */
- NULL, NULL, /* filter, filterarg */
- MAXBSIZE, BGE_NSEG_NEW, /* maxsize, nsegments */
- BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */
- 0, /* flags */
- NULL, NULL, /* lockfunc, lockarg */
- &sc->bge_cdata.bge_parent_tag);
+ error = bus_dma_tag_create(bus_get_dma_tag(sc->bge_dev),
+ 1, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL,
+ NULL, BUS_SPACE_MAXSIZE_32BIT, 0, BUS_SPACE_MAXSIZE_32BIT,
+ 0, NULL, NULL, &sc->bge_cdata.bge_parent_tag);
if (error != 0) {
device_printf(sc->bge_dev,
@@ -1912,7 +1906,7 @@
}
/*
- * Create tag for RX mbufs.
+ * Create tag for mbufs.
*/
error = bus_dma_tag_create(sc->bge_cdata.bge_parent_tag, 1,
0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL,
@@ -3402,7 +3396,7 @@
error = bus_dmamap_load_mbuf_sg(sc->bge_cdata.bge_mtag, map, m, segs,
&nsegs, BUS_DMA_NOWAIT);
if (error == EFBIG) {
- m = m_defrag(m, M_DONTWAIT);
+ m = m_collapse(m, M_DONTWAIT, BGE_NSEG_NEW);
if (m == NULL) {
m_freem(*m_head);
*m_head = NULL;
==== //depot/projects/soc2008/diego-audit/src/sys/dev/em/e1000_82571.c#2 (text+ko) ====
@@ -30,7 +30,7 @@
POSSIBILITY OF SUCH DAMAGE.
******************************************************************************/
-/*$FreeBSD: src/sys/dev/em/e1000_82571.c,v 1.6 2008/04/02 22:00:35 jfv Exp $*/
+/*$FreeBSD: src/sys/dev/em/e1000_82571.c,v 1.7 2008/04/25 21:19:39 jfv Exp $*/
/* e1000_82571
* e1000_82572
@@ -150,6 +150,25 @@
goto out;
}
break;
+ case e1000_82574:
+ phy->type = e1000_phy_bm;
+ phy->ops.get_cfg_done = e1000_get_cfg_done_generic;
+ phy->ops.get_info = e1000_get_phy_info_m88;
+ phy->ops.commit = e1000_phy_sw_reset_generic;
+ phy->ops.force_speed_duplex = e1000_phy_force_speed_duplex_m88;
+ phy->ops.get_cable_length = e1000_get_cable_length_m88;
+ phy->ops.read_reg = e1000_read_phy_reg_bm2;
+ phy->ops.write_reg = e1000_write_phy_reg_bm2;
+
+ /* This uses above function pointers */
+ ret_val = e1000_get_phy_id_82571(hw);
+ /* Verify PHY ID */
+ if (phy->id != BME1000_E_PHY_ID_R2) {
+ ret_val = -E1000_ERR_PHY;
+ DEBUGOUT1("PHY ID unknown: type = 0x%08x\n", phy->id);
+ goto out;
+ }
+ break;
default:
ret_val = -E1000_ERR_PHY;
goto out;
@@ -193,6 +212,7 @@
switch (hw->mac.type) {
case e1000_82573:
+ case e1000_82574:
if (((eecd >> 15) & 0x3) == 0x3) {
nvm->type = e1000_nvm_flash_hw;
nvm->word_size = 2048;
@@ -374,6 +394,7 @@
{
struct e1000_phy_info *phy = &hw->phy;
s32 ret_val = E1000_SUCCESS;
+ u16 phy_id = 0;
DEBUGFUNC("e1000_get_phy_id_82571");
@@ -391,11 +412,26 @@
case e1000_82573:
ret_val = e1000_get_phy_id(hw);
break;
+ case e1000_82574:
+ ret_val = phy->ops.read_reg(hw, PHY_ID1, &phy_id);
+ if (ret_val)
+ goto out;
+
+ phy->id = (u32)(phy_id << 16);
+ usec_delay(20);
+ ret_val = phy->ops.read_reg(hw, PHY_ID2, &phy_id);
+ if (ret_val)
+ goto out;
+
+ phy->id |= (u32)(phy_id);
+ phy->revision = (u32)(phy_id & ~PHY_REVISION_MASK);
+ break;
default:
ret_val = -E1000_ERR_PHY;
break;
}
+out:
return ret_val;
}
@@ -476,7 +512,7 @@
if (ret_val)
goto out;
- if (hw->mac.type != e1000_82573)
+ if (hw->mac.type != e1000_82573 && hw->mac.type != e1000_82574)
ret_val = e1000_acquire_nvm_generic(hw);
if (ret_val)
@@ -521,6 +557,7 @@
switch (hw->mac.type) {
case e1000_82573:
+ case e1000_82574:
ret_val = e1000_write_nvm_eewr_82571(hw, offset, words, data);
break;
case e1000_82571:
@@ -825,7 +862,7 @@
* Must acquire the MDIO ownership before MAC reset.
* Ownership defaults to firmware after a reset.
*/
- if (hw->mac.type == e1000_82573) {
+ if (hw->mac.type == e1000_82573 || hw->mac.type == e1000_82574) {
extcnf_ctrl = E1000_READ_REG(hw, E1000_EXTCNF_CTRL);
extcnf_ctrl |= E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP;
@@ -866,7 +903,7 @@
* Need to wait for Phy configuration completion before accessing
* NVM and Phy.
*/
- if (hw->mac.type == e1000_82573)
+ if (hw->mac.type == e1000_82573 || hw->mac.type == e1000_82574)
msec_delay(25);
/* Clear any pending interrupt events. */
@@ -934,7 +971,7 @@
E1000_WRITE_REG(hw, E1000_TXDCTL(0), reg_data);
/* ...for both queues. */
- if (mac->type != e1000_82573) {
+ if (mac->type != e1000_82573 && mac->type != e1000_82574) {
reg_data = E1000_READ_REG(hw, E1000_TXDCTL(1));
reg_data = (reg_data & ~E1000_TXDCTL_WTHRESH) |
E1000_TXDCTL_FULL_TX_DESC_WB |
@@ -1014,14 +1051,14 @@
}
/* Device Control */
- if (hw->mac.type == e1000_82573) {
+ if (hw->mac.type == e1000_82573 || hw->mac.type == e1000_82574) {
reg = E1000_READ_REG(hw, E1000_CTRL);
reg &= ~(1 << 29);
E1000_WRITE_REG(hw, E1000_CTRL, reg);
}
/* Extended Device Control */
- if (hw->mac.type == e1000_82573) {
+ if (hw->mac.type == e1000_82573 || hw->mac.type == e1000_82574) {
reg = E1000_READ_REG(hw, E1000_CTRL_EXT);
reg &= ~(1 << 23);
reg |= (1 << 22);
@@ -1048,7 +1085,7 @@
DEBUGFUNC("e1000_clear_vfta_82571");
- if (hw->mac.type == e1000_82573) {
+ if (hw->mac.type == e1000_82573 || hw->mac.type == e1000_82574) {
if (hw->mng_cookie.vlan_id != 0) {
/*
* The VFTA is a 4096b bit-field, each identifying
@@ -1121,7 +1158,8 @@
* the default flow control setting, so we explicitly
* set it to full.
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list