Date: Thu, 12 Oct 2006 08:41:10 GMT From: Roman Divacky <rdivacky@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 107749 for review Message-ID: <200610120841.k9C8fAhn088839@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=107749 Change 107749 by rdivacky@rdivacky_witten on 2006/10/12 08:40:29 IFC Affected files ... .. //depot/projects/linuxolator/src/sys/amd64/amd64/intr_machdep.c#2 integrate .. //depot/projects/linuxolator/src/sys/amd64/amd64/io_apic.c#2 integrate .. //depot/projects/linuxolator/src/sys/amd64/amd64/local_apic.c#4 integrate .. //depot/projects/linuxolator/src/sys/amd64/amd64/machdep.c#3 integrate .. //depot/projects/linuxolator/src/sys/amd64/amd64/mp_machdep.c#3 integrate .. //depot/projects/linuxolator/src/sys/amd64/include/apicvar.h#2 integrate .. //depot/projects/linuxolator/src/sys/amd64/include/intr_machdep.h#2 integrate .. //depot/projects/linuxolator/src/sys/amd64/isa/atpic.c#2 integrate .. //depot/projects/linuxolator/src/sys/compat/linprocfs/linprocfs.c#4 integrate .. //depot/projects/linuxolator/src/sys/compat/linux/linux_ipc.c#2 integrate .. //depot/projects/linuxolator/src/sys/ddb/db_command.c#3 integrate .. //depot/projects/linuxolator/src/sys/ddb/db_output.c#3 integrate .. //depot/projects/linuxolator/src/sys/dev/ath/if_athvar.h#3 integrate .. //depot/projects/linuxolator/src/sys/dev/iwi/if_iwi.c#2 integrate .. //depot/projects/linuxolator/src/sys/dev/ofw/openfirm.c#3 integrate .. //depot/projects/linuxolator/src/sys/dev/pci/pci.c#3 integrate .. //depot/projects/linuxolator/src/sys/dev/pci/pci_if.m#2 integrate .. //depot/projects/linuxolator/src/sys/dev/pci/pci_pci.c#2 integrate .. //depot/projects/linuxolator/src/sys/dev/pci/pci_private.h#2 integrate .. //depot/projects/linuxolator/src/sys/dev/pci/pcivar.h#2 integrate .. //depot/projects/linuxolator/src/sys/dev/sk/if_sk.c#2 integrate .. //depot/projects/linuxolator/src/sys/dev/sk/if_skreg.h#2 integrate .. //depot/projects/linuxolator/src/sys/dev/sound/pci/hda/hdac.c#3 integrate .. //depot/projects/linuxolator/src/sys/geom/raid3/g_raid3.c#4 integrate .. //depot/projects/linuxolator/src/sys/i386/i386/intr_machdep.c#2 integrate .. //depot/projects/linuxolator/src/sys/i386/i386/io_apic.c#2 integrate .. //depot/projects/linuxolator/src/sys/i386/i386/local_apic.c#4 integrate .. //depot/projects/linuxolator/src/sys/i386/i386/mp_machdep.c#3 integrate .. //depot/projects/linuxolator/src/sys/i386/include/apicvar.h#2 integrate .. //depot/projects/linuxolator/src/sys/i386/include/intr_machdep.h#2 integrate .. //depot/projects/linuxolator/src/sys/i386/isa/atpic.c#2 integrate .. //depot/projects/linuxolator/src/sys/kern/kern_timeout.c#2 integrate .. //depot/projects/linuxolator/src/sys/net/if_vlan.c#3 integrate .. //depot/projects/linuxolator/src/sys/netgraph/netflow/netflow.c#2 integrate .. //depot/projects/linuxolator/src/sys/netgraph/netflow/ng_netflow.c#2 integrate .. //depot/projects/linuxolator/src/sys/netgraph/ng_base.c#2 integrate .. //depot/projects/linuxolator/src/sys/netinet/ip_fw2.c#4 integrate .. //depot/projects/linuxolator/src/sys/netinet/libalias/libalias.3#4 integrate .. //depot/projects/linuxolator/src/sys/pci/agp_amd64.c#2 integrate .. //depot/projects/linuxolator/src/sys/powerpc/powerpc/db_interface.c#2 integrate .. //depot/projects/linuxolator/src/sys/security/audit/audit_syscalls.c#4 integrate .. //depot/projects/linuxolator/src/sys/security/mac_portacl/mac_portacl.c#2 integrate .. //depot/projects/linuxolator/src/sys/sparc64/pci/ofw_pcib.c#2 integrate .. //depot/projects/linuxolator/src/sys/sparc64/pci/ofw_pcib_subr.c#2 integrate .. //depot/projects/linuxolator/src/sys/sparc64/sparc64/db_interface.c#2 integrate .. //depot/projects/linuxolator/src/sys/sun4v/conf/NOTES#2 integrate .. //depot/projects/linuxolator/src/sys/sun4v/sun4v/fpemu.c#2 delete .. //depot/projects/linuxolator/src/sys/ufs/ffs/ffs_inode.c#2 integrate .. //depot/projects/linuxolator/src/sys/ufs/ffs/ffs_snapshot.c#3 integrate .. //depot/projects/linuxolator/src/sys/ufs/ffs/ffs_vnops.c#2 integrate .. //depot/projects/linuxolator/src/sys/ufs/ufs/inode.h#3 integrate .. //depot/projects/linuxolator/src/sys/ufs/ufs/ufs_vnops.c#3 integrate .. //depot/projects/linuxolator/src/sys/vm/vm_contig.c#2 integrate .. //depot/projects/linuxolator/src/sys/vm/vnode_pager.c#3 integrate Differences ... ==== //depot/projects/linuxolator/src/sys/amd64/amd64/intr_machdep.c#2 (text+ko) ==== @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/amd64/amd64/intr_machdep.c,v 1.20 2006/07/12 21:22:42 jhb Exp $ + * $FreeBSD: src/sys/amd64/amd64/intr_machdep.c,v 1.21 2006/10/10 23:23:11 jhb Exp $ */ /* @@ -37,6 +37,7 @@ * that source. */ +#include "opt_atpic.h" #include "opt_ddb.h" #include <sys/param.h> @@ -62,6 +63,7 @@ static int intrcnt_index; static struct intsrc *interrupt_sources[NUM_IO_INTS]; static struct mtx intr_table_lock; +static STAILQ_HEAD(, pic) pics; #ifdef SMP static int assign_cpu; @@ -70,11 +72,46 @@ #endif static void intr_init(void *__dummy); +static int intr_pic_registered(struct pic *pic); static void intrcnt_setname(const char *name, int index); static void intrcnt_updatename(struct intsrc *is); static void intrcnt_register(struct intsrc *is); +static int +intr_pic_registered(struct pic *pic) +{ + struct pic *p; + + STAILQ_FOREACH(p, &pics, pics) { + if (p == pic) + return (1); + } + return (0); +} + /* + * Register a new interrupt controller (PIC). This is to support suspend + * and resume where we suspend/resume controllers rather than individual + * sources. This also allows controllers with no active sources (such as + * 8259As in a system using the APICs) to participate in suspend and resume. + */ +int +intr_register_pic(struct pic *pic) +{ + int error; + + mtx_lock_spin(&intr_table_lock); + if (intr_pic_registered(pic)) + error = EBUSY; + else { + STAILQ_INSERT_TAIL(&pics, pic, pics); + error = 0; + } + mtx_unlock_spin(&intr_table_lock); + return (error); +} + +/* * Register a new interrupt source with the global interrupt system. * The global interrupts need to be disabled when this function is * called. @@ -84,6 +121,7 @@ { int error, vector; + KASSERT(intr_pic_registered(isrc->is_pic), ("unregistered PIC")); vector = isrc->is_pic->pic_vector(isrc); if (interrupt_sources[vector] != NULL) return (EEXIST); @@ -255,26 +293,29 @@ void intr_resume(void) { - struct intsrc **isrc; - int i; + struct pic *pic; +#ifndef DEV_ATPIC + atpic_reset(); +#endif mtx_lock_spin(&intr_table_lock); - for (i = 0, isrc = interrupt_sources; i < NUM_IO_INTS; i++, isrc++) - if (*isrc != NULL && (*isrc)->is_pic->pic_resume != NULL) - (*isrc)->is_pic->pic_resume(*isrc); + STAILQ_FOREACH(pic, &pics, pics) { + if (pic->pic_resume != NULL) + pic->pic_resume(pic); + } mtx_unlock_spin(&intr_table_lock); } void intr_suspend(void) { - struct intsrc **isrc; - int i; + struct pic *pic; mtx_lock_spin(&intr_table_lock); - for (i = 0, isrc = interrupt_sources; i < NUM_IO_INTS; i++, isrc++) - if (*isrc != NULL && (*isrc)->is_pic->pic_suspend != NULL) - (*isrc)->is_pic->pic_suspend(*isrc); + STAILQ_FOREACH(pic, &pics, pics) { + if (pic->pic_suspend != NULL) + pic->pic_suspend(pic); + } mtx_unlock_spin(&intr_table_lock); } @@ -327,10 +368,33 @@ intrcnt_setname("???", 0); intrcnt_index = 1; + STAILQ_INIT(&pics); mtx_init(&intr_table_lock, "intr table", NULL, MTX_SPIN); } SYSINIT(intr_init, SI_SUB_INTR, SI_ORDER_FIRST, intr_init, NULL) +#ifndef DEV_ATPIC +/* Initialize the two 8259A's to a known-good shutdown state. */ +void +atpic_reset(void) +{ + + outb(IO_ICU1, ICW1_RESET | ICW1_IC4); + outb(IO_ICU1 + ICU_IMR_OFFSET, IDT_IO_INTS); + outb(IO_ICU1 + ICU_IMR_OFFSET, 1 << 2); + outb(IO_ICU1 + ICU_IMR_OFFSET, ICW4_8086); + outb(IO_ICU1 + ICU_IMR_OFFSET, 0xff); + outb(IO_ICU1, OCW3_SEL | OCW3_RR); + + outb(IO_ICU2, ICW1_RESET | ICW1_IC4); + outb(IO_ICU2 + ICU_IMR_OFFSET, IDT_IO_INTS + 8); + outb(IO_ICU2 + ICU_IMR_OFFSET, 2); + outb(IO_ICU2 + ICU_IMR_OFFSET, ICW4_8086); + outb(IO_ICU2 + ICU_IMR_OFFSET, 0xff); + outb(IO_ICU2, OCW3_SEL | OCW3_RR); +} +#endif + #ifdef DDB /* * Dump data about interrupt handlers ==== //depot/projects/linuxolator/src/sys/amd64/amd64/io_apic.c#2 (text+ko) ==== @@ -28,9 +28,8 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/amd64/amd64/io_apic.c,v 1.24 2006/04/05 20:43:19 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/io_apic.c,v 1.25 2006/10/10 23:23:11 jhb Exp $"); -#include "opt_atpic.h" #include "opt_isa.h" #include <sys/param.h> @@ -61,8 +60,6 @@ #define IRQ_SMI (NUM_IO_INTS + 3) #define IRQ_DISABLED (NUM_IO_INTS + 4) -#define TODO printf("%s: not implemented!\n", __func__) - static MALLOC_DEFINE(M_IOAPIC, "io_apic", "I/O APIC structures"); /* @@ -115,8 +112,7 @@ static int ioapic_source_pending(struct intsrc *isrc); static int ioapic_config_intr(struct intsrc *isrc, enum intr_trigger trig, enum intr_polarity pol); -static void ioapic_suspend(struct intsrc *isrc); -static void ioapic_resume(struct intsrc *isrc); +static void ioapic_resume(struct pic *pic); static void ioapic_assign_cpu(struct intsrc *isrc, u_int apic_id); static void ioapic_program_intpin(struct ioapic_intsrc *intpin); @@ -124,7 +120,7 @@ struct pic ioapic_template = { ioapic_enable_source, ioapic_disable_source, ioapic_eoi_source, ioapic_enable_intr, ioapic_vector, ioapic_source_pending, - ioapic_suspend, ioapic_resume, + NULL, ioapic_resume, ioapic_config_intr, ioapic_assign_cpu }; static int next_ioapic_base; @@ -419,17 +415,13 @@ } static void -ioapic_suspend(struct intsrc *isrc) +ioapic_resume(struct pic *pic) { + struct ioapic *io = (struct ioapic *)pic; + int i; - TODO; -} - -static void -ioapic_resume(struct intsrc *isrc) -{ - - ioapic_program_intpin((struct ioapic_intsrc *)isrc); + for (i = 0; i < io->io_numintr; i++) + ioapic_program_intpin(&io->io_pins[i]); } /* @@ -727,6 +719,7 @@ io->io_intbase + io->io_numintr - 1); /* Register valid pins as interrupt sources. */ + intr_register_pic(&io->io_pic); for (i = 0, pin = io->io_pins; i < io->io_numintr; i++, pin++) if (pin->io_irq < NUM_IO_INTS) intr_register_source(&pin->io_intsrc); ==== //depot/projects/linuxolator/src/sys/amd64/amd64/local_apic.c#4 (text+ko) ==== @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/amd64/amd64/local_apic.c,v 1.31 2006/09/27 22:09:35 sobomax Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/local_apic.c,v 1.32 2006/10/10 23:23:11 jhb Exp $"); #include "opt_hwpmc_hooks.h" @@ -151,12 +151,15 @@ static u_long lapic_timer_divisor, lapic_timer_period, lapic_timer_hz; static void lapic_enable(void); +static void lapic_resume(struct pic *pic); static void lapic_timer_enable_intr(void); static void lapic_timer_oneshot(u_int count); static void lapic_timer_periodic(u_int count); static void lapic_timer_set_divisor(u_int divisor); static uint32_t lvt_mode(struct lapic *la, u_int pin, uint32_t value); +struct pic lapic_pic = { .pic_resume = lapic_resume }; + static uint32_t lvt_mode(struct lapic *la, u_int pin, uint32_t value) { @@ -277,7 +280,7 @@ } void -lapic_setup(void) +lapic_setup(int boot) { struct lapic *la; u_int32_t maxlvt; @@ -306,9 +309,13 @@ /* Program timer LVT and setup handler. */ lapic->lvt_timer = lvt_mode(la, LVT_TIMER, lapic->lvt_timer); - snprintf(buf, sizeof(buf), "cpu%d: timer", PCPU_GET(cpuid)); - intrcnt_add(buf, &la->la_timer_count); - if (PCPU_GET(cpuid) != 0) { + if (boot) { + snprintf(buf, sizeof(buf), "cpu%d: timer", PCPU_GET(cpuid)); + intrcnt_add(buf, &la->la_timer_count); + } + + /* We don't setup the timer during boot on the BSP until later. */ + if (!(boot && PCPU_GET(cpuid) == 0)) { KASSERT(lapic_timer_period != 0, ("lapic%u: zero divisor", lapic_id())); lapic_timer_set_divisor(lapic_timer_divisor); @@ -398,6 +405,14 @@ lapic->svr = value; } +/* Reset the local APIC on the BSP during resume. */ +static void +lapic_resume(struct pic *pic) +{ + + lapic_setup(0); +} + int lapic_id(void) { @@ -983,7 +998,8 @@ * Finish setting up the local APIC on the BSP once we know how to * properly program the LINT pins. */ - lapic_setup(); + lapic_setup(1); + intr_register_pic(&lapic_pic); if (bootverbose) lapic_dump("BSP"); } ==== //depot/projects/linuxolator/src/sys/amd64/amd64/machdep.c#3 (text+ko) ==== @@ -39,7 +39,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/amd64/amd64/machdep.c,v 1.654 2006/10/02 15:42:01 phk Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/machdep.c,v 1.655 2006/10/10 23:23:11 jhb Exp $"); #include "opt_atalk.h" #include "opt_atpic.h" @@ -1212,19 +1212,7 @@ atpic_startup(); #else /* Reset and mask the atpics and leave them shut down. */ - outb(IO_ICU1, ICW1_RESET | ICW1_IC4); - outb(IO_ICU1 + ICU_IMR_OFFSET, IDT_IO_INTS); - outb(IO_ICU1 + ICU_IMR_OFFSET, 1 << 2); - outb(IO_ICU1 + ICU_IMR_OFFSET, ICW4_8086); - outb(IO_ICU1 + ICU_IMR_OFFSET, 0xff); - outb(IO_ICU1, OCW3_SEL | OCW3_RR); - - outb(IO_ICU2, ICW1_RESET | ICW1_IC4); - outb(IO_ICU2 + ICU_IMR_OFFSET, IDT_IO_INTS + 8); - outb(IO_ICU2 + ICU_IMR_OFFSET, 2); - outb(IO_ICU2 + ICU_IMR_OFFSET, ICW4_8086); - outb(IO_ICU2 + ICU_IMR_OFFSET, 0xff); - outb(IO_ICU2, OCW3_SEL | OCW3_RR); + atpic_reset(); /* * Point the ICU spurious interrupt vectors at the APIC spurious ==== //depot/projects/linuxolator/src/sys/amd64/amd64/mp_machdep.c#3 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/amd64/amd64/mp_machdep.c,v 1.277 2006/09/11 20:10:42 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/mp_machdep.c,v 1.278 2006/10/10 23:23:11 jhb Exp $"); #include "opt_cpu.h" #include "opt_kstack_pages.h" @@ -543,7 +543,7 @@ mtx_lock_spin(&ap_boot_mtx); /* Init local apic for irq's */ - lapic_setup(); + lapic_setup(1); /* Set memory range attributes for this CPU to match the BSP */ mem_range_AP_init(); ==== //depot/projects/linuxolator/src/sys/amd64/include/apicvar.h#2 (text+ko) ==== @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/amd64/include/apicvar.h,v 1.18 2006/05/01 21:36:47 jhb Exp $ + * $FreeBSD: src/sys/amd64/include/apicvar.h,v 1.19 2006/10/10 23:23:11 jhb Exp $ */ #ifndef _MACHINE_APICVAR_H_ @@ -211,7 +211,7 @@ int lapic_set_lvt_triggermode(u_int apic_id, u_int lvt, enum intr_trigger trigger); void lapic_set_tpr(u_int vector); -void lapic_setup(void); +void lapic_setup(int boot); int lapic_setup_clock(void); #endif /* !LOCORE */ ==== //depot/projects/linuxolator/src/sys/amd64/include/intr_machdep.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/intr_machdep.h,v 1.9 2006/02/28 22:24:54 jhb Exp $ + * $FreeBSD: src/sys/amd64/include/intr_machdep.h,v 1.11 2006/10/10 23:23:11 jhb Exp $ */ #ifndef __MACHINE_INTR_MACHDEP_H__ @@ -56,9 +56,9 @@ * - 7 counters for each CPU for IPI counters for SMP. */ #ifdef SMP +#define INTRCNT_COUNT (1 + NUM_IO_INTS * 2 + (1 + 7) * MAXCPU) +#else #define INTRCNT_COUNT (1 + NUM_IO_INTS * 2 + 1) -#else -#define INTRCNT_COUNT (1 + NUM_IO_INTS * 2 + (1 + 7) * MAXCPU) #endif #ifndef LOCORE @@ -81,11 +81,12 @@ void (*pic_enable_intr)(struct intsrc *); int (*pic_vector)(struct intsrc *); int (*pic_source_pending)(struct intsrc *); - void (*pic_suspend)(struct intsrc *); - void (*pic_resume)(struct intsrc *); + void (*pic_suspend)(struct pic *); + void (*pic_resume)(struct pic *); int (*pic_config_intr)(struct intsrc *, enum intr_trigger, enum intr_polarity); void (*pic_assign_cpu)(struct intsrc *, u_int apic_id); + STAILQ_ENTRY(pic) pics; }; /* Flags for pic_disable_source() */ @@ -114,6 +115,9 @@ extern struct mtx icu_lock; extern int elcr_found; +#ifndef DEV_ATPIC +void atpic_reset(void); +#endif /* XXX: The elcr_* prototypes probably belong somewhere else. */ int elcr_probe(void); enum intr_trigger elcr_read_trigger(u_int irq); @@ -130,6 +134,7 @@ enum intr_polarity pol); void intr_execute_handlers(struct intsrc *isrc, struct trapframe *frame); struct intsrc *intr_lookup_source(int vector); +int intr_register_pic(struct pic *pic); int intr_register_source(struct intsrc *isrc); int intr_remove_handler(void *cookie); void intr_resume(void); ==== //depot/projects/linuxolator/src/sys/amd64/isa/atpic.c#2 (text+ko) ==== @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/amd64/isa/atpic.c,v 1.19 2006/02/28 22:24:54 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/isa/atpic.c,v 1.20 2006/10/10 23:23:11 jhb Exp $"); #include "opt_auto_eoi.h" #include "opt_isa.h" @@ -138,7 +138,7 @@ static void atpic_eoi_slave(struct intsrc *isrc); static void atpic_enable_intr(struct intsrc *isrc); static int atpic_vector(struct intsrc *isrc); -static void atpic_resume(struct intsrc *isrc); +static void atpic_resume(struct pic *pic); static int atpic_source_pending(struct intsrc *isrc); static int atpic_config_intr(struct intsrc *isrc, enum intr_trigger trig, enum intr_polarity pol); @@ -285,16 +285,13 @@ } static void -atpic_resume(struct intsrc *isrc) +atpic_resume(struct pic *pic) { - struct atpic_intsrc *ai = (struct atpic_intsrc *)isrc; - struct atpic *ap = (struct atpic *)isrc->is_pic; + struct atpic *ap = (struct atpic *)pic; - if (ai->at_irq == 0) { - i8259_init(ap, ap == &atpics[SLAVE]); - if (ap == &atpics[SLAVE] && elcr_found) - elcr_resume(); - } + i8259_init(ap, ap == &atpics[SLAVE]); + if (ap == &atpics[SLAVE] && elcr_found) + elcr_resume(); } static int @@ -465,6 +462,14 @@ int i; /* + * Register our PICs, even if we aren't going to use any of their + * pins so that they are suspended and resumed. + */ + if (intr_register_pic(&atpics[0].at_pic) != 0 || + intr_register_pic(&atpics[1].at_pic) != 0) + panic("Unable to register ATPICs"); + + /* * If any of the ISA IRQs have an interrupt source already, then * assume that the APICs are being used and don't register any * of our interrupt sources. This makes sure we don't accidentally ==== //depot/projects/linuxolator/src/sys/compat/linprocfs/linprocfs.c#4 (text+ko) ==== @@ -40,7 +40,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/compat/linprocfs/linprocfs.c,v 1.98 2006/10/08 16:55:27 netchild Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linprocfs/linprocfs.c,v 1.99 2006/10/11 20:32:46 keramida Exp $"); #include <sys/param.h> #include <sys/queue.h> @@ -925,7 +925,7 @@ } /* - * Filler function for proc/pid_max + * Filler function for proc/sys/kernel/pid_max */ static int linprocfs_dopid_max(PFS_FILL_ARGS) ==== //depot/projects/linuxolator/src/sys/compat/linux/linux_ipc.c#2 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/compat/linux/linux_ipc.c,v 1.48 2006/07/08 19:51:37 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linux/linux_ipc.c,v 1.51 2006/10/10 22:46:50 jhb Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -465,7 +465,7 @@ } */ bsd_args; bsd_args.semid = args->semid; - bsd_args.sops = (struct sembuf *)PTRIN(args->tsops); + bsd_args.sops = PTRIN(args->tsops); bsd_args.nsops = args->nsops; return semop(td, &bsd_args); } @@ -520,7 +520,7 @@ case LINUX_IPC_SET: cmd = IPC_SET; error = linux_semid_pullup(args->cmd & LINUX_IPC_64, - &linux_semid, (caddr_t)PTRIN(args->arg.buf)); + &linux_semid, PTRIN(args->arg.buf)); if (error) return (error); linux_to_bsd_semid_ds(&linux_semid, &semid); @@ -540,7 +540,7 @@ return (error); bsd_to_linux_semid_ds(&semid, &linux_semid); error = linux_semid_pushdown(args->cmd & LINUX_IPC_64, - &linux_semid, (caddr_t)PTRIN(args->arg.buf)); + &linux_semid, PTRIN(args->arg.buf)); if (error == 0) td->td_retval[0] = (cmd == SEM_STAT) ? rval : 0; return (error); @@ -628,13 +628,14 @@ struct l_msqid_ds linux_msqid; struct msqid_ds bsd_msqid; - error = linux_msqid_pullup(args->cmd & LINUX_IPC_64, - &linux_msqid, (caddr_t)PTRIN(args->buf)); - if (error != 0) - return (error); bsd_cmd = args->cmd & ~LINUX_IPC_64; - if (bsd_cmd == LINUX_IPC_SET) + if (bsd_cmd == LINUX_IPC_SET) { + error = linux_msqid_pullup(args->cmd & LINUX_IPC_64, + &linux_msqid, PTRIN(args->buf)); + if (error) + return (error); linux_to_bsd_msqid_ds(&linux_msqid, &bsd_msqid); + } error = kern_msgctl(td, args->msqid, bsd_cmd, &bsd_msqid); if (error != 0) @@ -644,7 +645,7 @@ if (bsd_cmd == LINUX_IPC_STAT) { bsd_to_linux_msqid_ds(&bsd_msqid, &linux_msqid); return (linux_msqid_pushdown(args->cmd & LINUX_IPC_64, - &linux_msqid, (caddr_t)PTRIN(args->buf))); + &linux_msqid, PTRIN(args->buf))); } return (0); @@ -710,7 +711,6 @@ struct l_shminfo linux_shminfo; struct l_shm_info linux_shm_info; struct shmid_ds bsd_shmid; - size_t bufsz; int error; switch (args->cmd & ~LINUX_IPC_64) { @@ -720,14 +720,14 @@ /* Perform shmctl wanting removed segments lookup */ error = kern_shmctl(td, args->shmid, IPC_INFO, - (void *)&bsd_shminfo, &bufsz); + (void *)&bsd_shminfo, NULL); if (error) return error; bsd_to_linux_shminfo(&bsd_shminfo, &linux_shminfo); return (linux_shminfo_pushdown(args->cmd & LINUX_IPC_64, - &linux_shminfo, (caddr_t)PTRIN(args->buf))); + &linux_shminfo, PTRIN(args->buf))); } case LINUX_SHM_INFO: { @@ -735,43 +735,43 @@ /* Perform shmctl wanting removed segments lookup */ error = kern_shmctl(td, args->shmid, SHM_INFO, - (void *)&bsd_shm_info, &bufsz); + (void *)&bsd_shm_info, NULL); if (error) return error; bsd_to_linux_shm_info(&bsd_shm_info, &linux_shm_info); - return copyout(&linux_shm_info, (caddr_t)PTRIN(args->buf), + return copyout(&linux_shm_info, PTRIN(args->buf), sizeof(struct l_shm_info)); } case LINUX_IPC_STAT: /* Perform shmctl wanting removed segments lookup */ error = kern_shmctl(td, args->shmid, IPC_STAT, - (void *)&bsd_shmid, &bufsz); + (void *)&bsd_shmid, NULL); if (error) return error; bsd_to_linux_shmid_ds(&bsd_shmid, &linux_shmid); return (linux_shmid_pushdown(args->cmd & LINUX_IPC_64, - &linux_shmid, (caddr_t)PTRIN(args->buf))); + &linux_shmid, PTRIN(args->buf))); case LINUX_SHM_STAT: /* Perform shmctl wanting removed segments lookup */ error = kern_shmctl(td, args->shmid, IPC_STAT, - (void *)&bsd_shmid, &bufsz); + (void *)&bsd_shmid, NULL); if (error) return error; bsd_to_linux_shmid_ds(&bsd_shmid, &linux_shmid); return (linux_shmid_pushdown(args->cmd & LINUX_IPC_64, - &linux_shmid, (caddr_t)PTRIN(args->buf))); + &linux_shmid, PTRIN(args->buf))); case LINUX_IPC_SET: error = linux_shmid_pullup(args->cmd & LINUX_IPC_64, - &linux_shmid, (caddr_t)PTRIN(args->buf)); + &linux_shmid, PTRIN(args->buf)); if (error) return error; @@ -779,7 +779,7 @@ /* Perform shmctl wanting removed segments lookup */ return kern_shmctl(td, args->shmid, IPC_SET, - (void *)&bsd_shmid, &bufsz); + (void *)&bsd_shmid, NULL); case LINUX_IPC_RMID: { void *buf; @@ -788,13 +788,13 @@ buf = NULL; else { error = linux_shmid_pullup(args->cmd & LINUX_IPC_64, - &linux_shmid, (caddr_t)PTRIN(args->buf)); + &linux_shmid, PTRIN(args->buf)); if (error) return error; linux_to_bsd_shmid_ds(&linux_shmid, &bsd_shmid); buf = (void *)&bsd_shmid; } - return kern_shmctl(td, args->shmid, IPC_RMID, buf, &bufsz); + return kern_shmctl(td, args->shmid, IPC_RMID, buf, NULL); } case LINUX_SHM_LOCK: ==== //depot/projects/linuxolator/src/sys/ddb/db_command.c#3 (text+ko) ==== @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/ddb/db_command.c,v 1.70 2006/10/08 18:37:00 bde Exp $"); +__FBSDID("$FreeBSD: src/sys/ddb/db_command.c,v 1.71 2006/10/10 07:26:53 bde Exp $"); #include <sys/param.h> #include <sys/linker_set.h> @@ -68,6 +68,7 @@ static db_cmdfcn_t db_fncall; static db_cmdfcn_t db_gdb; +static db_cmdfcn_t db_halt; static db_cmdfcn_t db_kill; static db_cmdfcn_t db_reset; static db_cmdfcn_t db_stack_trace; @@ -134,7 +135,8 @@ { "show", 0, 0, &db_show_table }, { "ps", db_ps, 0, 0 }, { "gdb", db_gdb, 0, 0 }, - { "registers", db_show_regs, 0, 0 }, + { "halt", db_halt, 0, 0 }, + { "reboot", db_reset, 0, 0 }, { "reset", db_reset, 0, 0 }, { "kill", db_kill, CS_OWN, 0 }, { "watchdog", db_watchdog, 0, 0 }, @@ -538,6 +540,13 @@ } static void +db_halt(db_expr_t dummy, boolean_t dummy2, db_expr_t dummy3, char *dummy4) +{ + + cpu_halt(); +} + +static void db_kill(dummy1, dummy2, dummy3, dummy4) db_expr_t dummy1; boolean_t dummy2; ==== //depot/projects/linuxolator/src/sys/ddb/db_output.c#3 (text+ko) ==== @@ -33,7 +33,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/ddb/db_output.c,v 1.36 2006/10/08 18:15:08 bde Exp $"); +__FBSDID("$FreeBSD: src/sys/ddb/db_output.c,v 1.37 2006/10/10 06:36:01 bde Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -142,7 +142,6 @@ } else if (c == '\n') { /* Newline */ - db_force_whitespace(); cnputc(c); db_output_position = 0; db_last_non_space = 0; @@ -155,7 +154,6 @@ } else if (c == '\r') { /* Return */ - db_force_whitespace(); cnputc(c); db_output_position = 0; db_last_non_space = 0; @@ -247,7 +245,9 @@ #endif } } - db_printf(" \r"); + db_printf(" "); + db_force_whitespace(); + db_printf("\r"); db_newlines = 0; } ==== //depot/projects/linuxolator/src/sys/dev/ath/if_athvar.h#3 (text+ko) ==== @@ -33,7 +33,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/if_athvar.h,v 1.53 2006/09/18 16:26:19 sam Exp $ + * $FreeBSD: src/sys/dev/ath/if_athvar.h,v 1.54 2006/10/09 23:45:26 sam Exp $ */ /* @@ -418,7 +418,7 @@ ((*(_ah)->ah_getDiagState)((_ah), (_id), \ (_indata), (_insize), (_outdata), (_outsize))) #define ath_hal_getfatalstate(_ah, _outdata, _outsize) \ - ath_hal_getdiagstate(_ah, 27, NULL, 0, (void **)(_outdata), _outsize) + ath_hal_getdiagstate(_ah, 29, NULL, 0, (void **)(_outdata), _outsize) #define ath_hal_setuptxqueue(_ah, _type, _irq) \ ((*(_ah)->ah_setupTxQueue)((_ah), (_type), (_irq))) #define ath_hal_resettxqueue(_ah, _q) \ ==== //depot/projects/linuxolator/src/sys/dev/iwi/if_iwi.c#2 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/iwi/if_iwi.c,v 1.39 2006/07/26 03:09:32 sam Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/iwi/if_iwi.c,v 1.40 2006/10/10 18:02:22 mlaier Exp $"); /*- * Intel(R) PRO/Wireless 2200BG/2225BG/2915ABG driver @@ -2699,7 +2699,7 @@ struct ieee80211com *ic = &sc->sc_ic; const struct ieee80211_channel *c; struct iwi_scan_ext scan; - int i, ix, start, scan_type; + int i, ix, start, scan_type, error; memset(&scan, 0, sizeof scan); @@ -2710,8 +2710,22 @@ scan.full_scan_index = htole32(ic->ic_scan.nt_scangen); - scan_type = (ic->ic_des_esslen != 0) ? IWI_SCAN_TYPE_BDIRECTED : - IWI_SCAN_TYPE_BROADCAST; + if (ic->ic_des_esslen != 0) { + scan_type = IWI_SCAN_TYPE_BDIRECTED; +#ifdef IWI_DEBUG + if (iwi_debug > 0) { + printf("Setting desired ESSID to "); + ieee80211_print_essid(ic->ic_des_essid, + ic->ic_des_esslen); + printf("\n"); + } +#endif + error = iwi_cmd(sc, IWI_CMD_SET_ESSID, ic->ic_des_essid, + ic->ic_des_esslen); + if (error != 0) + return error; + } else + scan_type = IWI_SCAN_TYPE_BROADCAST; ix = 0; if (ic->ic_modecaps & IEEE80211_MODE_5GHZ) { ==== //depot/projects/linuxolator/src/sys/dev/ofw/openfirm.c#3 (text+ko) ==== @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/ofw/openfirm.c,v 1.16 2006/10/09 04:45:17 kmacy Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ofw/openfirm.c,v 1.17 2006/10/11 02:52:46 kmacy Exp $"); /*- * Copyright (C) 2000 Benno Rice. * All rights reserved. @@ -842,8 +842,8 @@ 0, }; - args.tba_addr = p1275_ptr2cell(tba_addr); - args.mmfsa_ra = p1275_ptr2cell(mmfsa_ra); + args.tba_addr = (cell_t)tba_addr; + args.mmfsa_ra = (cell_t)mmfsa_ra; openfirmware(&args); } ==== //depot/projects/linuxolator/src/sys/dev/pci/pci.c#3 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/pci/pci.c,v 1.314 2006/09/20 06:47:14 jmg Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/pci/pci.c,v 1.315 2006/10/09 16:15:55 jmg Exp $"); #include "opt_bus.h" @@ -41,7 +41,7 @@ #include <sys/kernel.h> #include <sys/queue.h> #include <sys/sysctl.h> -#include <sys/types.h> +#include <sys/endian.h> #include <vm/vm.h> #include <vm/pmap.h> @@ -90,6 +90,13 @@ static void pci_hdrtypedata(device_t pcib, int b, int s, int f, pcicfgregs *cfg); static void pci_read_extcap(device_t pcib, pcicfgregs *cfg); +static uint32_t pci_read_vpd_reg(device_t pcib, pcicfgregs *cfg, + int reg); +#if 0 +static void pci_write_vpd_reg(device_t pcib, pcicfgregs *cfg, + int reg, uint32_t data); +#endif +static void pci_read_vpd(device_t pcib, pcicfgregs *cfg); static device_method_t pci_methods[] = { /* Device interface */ @@ -127,6 +134,8 @@ DEVMETHOD(pci_disable_busmaster, pci_disable_busmaster_method), DEVMETHOD(pci_enable_io, pci_enable_io_method), DEVMETHOD(pci_disable_io, pci_disable_io_method), + DEVMETHOD(pci_get_vpd_ident, pci_get_vpd_ident_method), + DEVMETHOD(pci_get_vpd_readonly, pci_get_vpd_readonly_method), DEVMETHOD(pci_get_powerstate, pci_get_powerstate_method), DEVMETHOD(pci_set_powerstate, pci_set_powerstate_method), DEVMETHOD(pci_assign_interrupt, pci_assign_interrupt_method), @@ -344,7 +353,6 @@ } /* read configuration header into pcicfgregs structure */ - struct pci_devinfo * pci_read_device(device_t pcib, int b, int s, int f, size_t size) { @@ -428,7 +436,7 @@ ptrptr = PCIR_CAP_PTR; break; case 2: - ptrptr = PCIR_CAP_PTR_2; + ptrptr = PCIR_CAP_PTR_2; /* cardbus capabilities ptr */ break; default: return; /* no extended capabilities support */ @@ -468,13 +476,304 @@ cfg->msi.msi_data = PCIR_MSI_DATA; cfg->msi.msi_msgnum = 1 << ((cfg->msi.msi_ctrl & PCIM_MSICTRL_MMC_MASK)>>1); + break; + case PCIY_VPD: /* PCI Vital Product Data */ + cfg->vpd.vpd_reg = ptr; + pci_read_vpd(pcib, cfg); + break; + default: + break; + } + } +/* REG use carry through to next functions */ +} >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200610120841.k9C8fAhn088839>