Date: Wed, 15 Nov 2006 16:32:32 GMT From: Roman Divacky <rdivacky@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 110033 for review Message-ID: <200611151632.kAFGWWXV094926@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=110033 Change 110033 by rdivacky@rdivacky_witten on 2006/11/15 16:31:50 IFC Affected files ... .. //depot/projects/linuxolator/src/sys/amd64/amd64/db_disasm.c#2 integrate .. //depot/projects/linuxolator/src/sys/amd64/amd64/local_apic.c#5 integrate .. //depot/projects/linuxolator/src/sys/amd64/amd64/mptable_pci.c#2 integrate .. //depot/projects/linuxolator/src/sys/amd64/amd64/msi.c#1 branch .. //depot/projects/linuxolator/src/sys/amd64/amd64/nexus.c#3 integrate .. //depot/projects/linuxolator/src/sys/amd64/amd64/pmap.c#3 integrate .. //depot/projects/linuxolator/src/sys/amd64/include/apicvar.h#3 integrate .. //depot/projects/linuxolator/src/sys/amd64/include/intr_machdep.h#3 integrate .. //depot/projects/linuxolator/src/sys/amd64/include/pmap.h#2 integrate .. //depot/projects/linuxolator/src/sys/amd64/linux32/linux.h#10 edit .. //depot/projects/linuxolator/src/sys/amd64/pci/pci_bus.c#2 integrate .. //depot/projects/linuxolator/src/sys/arm/arm/pmap.c#3 integrate .. //depot/projects/linuxolator/src/sys/arm/include/pmap.h#3 integrate .. //depot/projects/linuxolator/src/sys/coda/coda_vnops.c#2 integrate .. //depot/projects/linuxolator/src/sys/coda/coda_vnops.h#2 integrate .. //depot/projects/linuxolator/src/sys/compat/linux/linux_emul.c#15 integrate .. //depot/projects/linuxolator/src/sys/compat/linux/linux_misc.c#34 integrate .. //depot/projects/linuxolator/src/sys/conf/NOTES#11 integrate .. //depot/projects/linuxolator/src/sys/conf/files#11 integrate .. //depot/projects/linuxolator/src/sys/conf/files.amd64#8 integrate .. //depot/projects/linuxolator/src/sys/conf/files.i386#7 integrate .. //depot/projects/linuxolator/src/sys/conf/files.pc98#5 integrate .. //depot/projects/linuxolator/src/sys/conf/files.sun4v#4 integrate .. //depot/projects/linuxolator/src/sys/dev/acpica/acpi_pcib_acpi.c#2 integrate .. //depot/projects/linuxolator/src/sys/dev/acpica/acpi_pcib_pci.c#2 integrate .. //depot/projects/linuxolator/src/sys/dev/fxp/if_fxp.c#4 integrate .. //depot/projects/linuxolator/src/sys/dev/isp/isp.c#3 integrate .. //depot/projects/linuxolator/src/sys/dev/isp/isp_freebsd.c#4 integrate .. //depot/projects/linuxolator/src/sys/dev/isp/isp_freebsd.h#4 integrate .. //depot/projects/linuxolator/src/sys/dev/isp/isp_library.c#3 integrate .. //depot/projects/linuxolator/src/sys/dev/isp/isp_library.h#3 integrate .. //depot/projects/linuxolator/src/sys/dev/isp/isp_pci.c#3 integrate .. //depot/projects/linuxolator/src/sys/dev/isp/isp_stds.h#2 integrate .. //depot/projects/linuxolator/src/sys/dev/isp/ispvar.h#3 integrate .. //depot/projects/linuxolator/src/sys/dev/mfi/mfi.c#6 integrate .. //depot/projects/linuxolator/src/sys/dev/mfi/mfi_ioctl.h#2 integrate .. //depot/projects/linuxolator/src/sys/dev/mfi/mfi_linux.c#2 integrate .. //depot/projects/linuxolator/src/sys/dev/pci/pci.c#8 integrate .. //depot/projects/linuxolator/src/sys/dev/pci/pci_if.m#3 integrate .. //depot/projects/linuxolator/src/sys/dev/pci/pci_pci.c#5 integrate .. //depot/projects/linuxolator/src/sys/dev/pci/pci_private.h#4 integrate .. //depot/projects/linuxolator/src/sys/dev/pci/pcib_if.m#3 integrate .. //depot/projects/linuxolator/src/sys/dev/pci/pcib_private.h#2 integrate .. //depot/projects/linuxolator/src/sys/dev/pci/pcireg.h#2 integrate .. //depot/projects/linuxolator/src/sys/dev/pci/pcivar.h#4 integrate .. //depot/projects/linuxolator/src/sys/dev/usb/uark.c#1 branch .. //depot/projects/linuxolator/src/sys/dev/usb/usb_quirks.c#3 integrate .. //depot/projects/linuxolator/src/sys/dev/usb/usbdevs#5 integrate .. //depot/projects/linuxolator/src/sys/fs/nullfs/null_vnops.c#2 integrate .. //depot/projects/linuxolator/src/sys/i386/i386/local_apic.c#5 integrate .. //depot/projects/linuxolator/src/sys/i386/i386/mptable_pci.c#2 integrate .. //depot/projects/linuxolator/src/sys/i386/i386/msi.c#1 branch .. //depot/projects/linuxolator/src/sys/i386/i386/nexus.c#3 integrate .. //depot/projects/linuxolator/src/sys/i386/i386/pmap.c#3 integrate .. //depot/projects/linuxolator/src/sys/i386/include/apicvar.h#3 integrate .. //depot/projects/linuxolator/src/sys/i386/include/intr_machdep.h#3 integrate .. //depot/projects/linuxolator/src/sys/i386/include/pmap.h#2 integrate .. //depot/projects/linuxolator/src/sys/i386/linux/linux.h#8 edit .. //depot/projects/linuxolator/src/sys/i386/pci/pci_bus.c#2 integrate .. //depot/projects/linuxolator/src/sys/ia64/ia64/pmap.c#3 integrate .. //depot/projects/linuxolator/src/sys/ia64/include/pmap.h#2 integrate .. //depot/projects/linuxolator/src/sys/kern/init_main.c#5 integrate .. //depot/projects/linuxolator/src/sys/kern/kern_idle.c#3 integrate .. //depot/projects/linuxolator/src/sys/kern/kern_lock.c#4 integrate .. //depot/projects/linuxolator/src/sys/kern/kern_mutex.c#3 integrate .. //depot/projects/linuxolator/src/sys/kern/kern_rwlock.c#3 integrate .. //depot/projects/linuxolator/src/sys/kern/kern_sx.c#3 integrate .. //depot/projects/linuxolator/src/sys/kern/posix4_mib.c#2 integrate .. //depot/projects/linuxolator/src/sys/kern/sched_4bsd.c#4 integrate .. //depot/projects/linuxolator/src/sys/kern/subr_lock.c#3 integrate .. //depot/projects/linuxolator/src/sys/kern/uipc_syscalls.c#5 integrate .. //depot/projects/linuxolator/src/sys/kern/vfs_default.c#3 integrate .. //depot/projects/linuxolator/src/sys/kern/vfs_subr.c#8 integrate .. //depot/projects/linuxolator/src/sys/kern/vfs_vnops.c#4 integrate .. //depot/projects/linuxolator/src/sys/kern/vnode_if.src#2 integrate .. //depot/projects/linuxolator/src/sys/modules/Makefile#3 integrate .. //depot/projects/linuxolator/src/sys/modules/uark/Makefile#1 branch .. //depot/projects/linuxolator/src/sys/netinet/ip_fw2.c#7 integrate .. //depot/projects/linuxolator/src/sys/powerpc/powerpc/mmu_oea.c#2 integrate .. //depot/projects/linuxolator/src/sys/sparc64/sparc64/pmap.c#3 integrate .. //depot/projects/linuxolator/src/sys/sun4v/include/asmacros.h#2 integrate .. //depot/projects/linuxolator/src/sys/sun4v/include/pmap.h#2 integrate .. //depot/projects/linuxolator/src/sys/sun4v/include/tte_hash.h#2 integrate .. //depot/projects/linuxolator/src/sys/sun4v/sun4v/exception.S#4 integrate .. //depot/projects/linuxolator/src/sys/sun4v/sun4v/interrupt.S#3 integrate .. //depot/projects/linuxolator/src/sys/sun4v/sun4v/pmap.c#4 integrate .. //depot/projects/linuxolator/src/sys/sun4v/sun4v/rtc.c#2 integrate .. //depot/projects/linuxolator/src/sys/sun4v/sun4v/trap.c#4 integrate .. //depot/projects/linuxolator/src/sys/sun4v/sun4v/tte_hash.c#2 integrate .. //depot/projects/linuxolator/src/sys/sys/_lock.h#3 integrate .. //depot/projects/linuxolator/src/sys/sys/elf_common.h#3 integrate .. //depot/projects/linuxolator/src/sys/sys/lock.h#3 integrate .. //depot/projects/linuxolator/src/sys/sys/lock_profile.h#2 integrate .. //depot/projects/linuxolator/src/sys/sys/mbuf.h#5 integrate .. //depot/projects/linuxolator/src/sys/sys/proc.h#6 integrate .. //depot/projects/linuxolator/src/sys/sys/vnode.h#3 integrate .. //depot/projects/linuxolator/src/sys/ufs/ffs/ffs_vnops.c#4 integrate .. //depot/projects/linuxolator/src/sys/vm/vm_fault.c#4 integrate .. //depot/projects/linuxolator/src/sys/vm/vm_kern.c#3 integrate Differences ... ==== //depot/projects/linuxolator/src/sys/amd64/amd64/db_disasm.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/amd64/amd64/db_disasm.c,v 1.30 2005/03/30 22:57:41 peter Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/db_disasm.c,v 1.31 2006/11/13 21:14:54 jhb Exp $"); /* * Instruction disassembler. @@ -84,6 +84,7 @@ #define Ib 21 /* byte immediate, unsigned */ #define Ibs 22 /* byte immediate, signed */ #define Iw 23 /* word immediate, unsigned */ +#define Ilq 24 /* long/quad immediate, unsigned */ #define O 25 /* direct address */ #define Db 26 /* byte displacement from EIP */ #define Dl 27 /* long displacement from EIP */ @@ -351,7 +352,6 @@ 0, 0, 0, - 0, db_inst_0f8x, db_inst_0f9x, db_inst_0fax, @@ -752,14 +752,14 @@ /*b6*/ { "mov", FALSE, BYTE, op2(I, Ri), 0 }, /*b7*/ { "mov", FALSE, BYTE, op2(I, Ri), 0 }, -/*b8*/ { "mov", FALSE, LONG, op2(I, Ri), 0 }, -/*b9*/ { "mov", FALSE, LONG, op2(I, Ri), 0 }, -/*ba*/ { "mov", FALSE, LONG, op2(I, Ri), 0 }, -/*bb*/ { "mov", FALSE, LONG, op2(I, Ri), 0 }, -/*bc*/ { "mov", FALSE, LONG, op2(I, Ri), 0 }, -/*bd*/ { "mov", FALSE, LONG, op2(I, Ri), 0 }, -/*be*/ { "mov", FALSE, LONG, op2(I, Ri), 0 }, -/*bf*/ { "mov", FALSE, LONG, op2(I, Ri), 0 }, +/*b8*/ { "mov", FALSE, LONG, op2(Ilq, Ri), 0 }, +/*b9*/ { "mov", FALSE, LONG, op2(Ilq, Ri), 0 }, +/*ba*/ { "mov", FALSE, LONG, op2(Ilq, Ri), 0 }, +/*bb*/ { "mov", FALSE, LONG, op2(Ilq, Ri), 0 }, +/*bc*/ { "mov", FALSE, LONG, op2(Ilq, Ri), 0 }, +/*bd*/ { "mov", FALSE, LONG, op2(Ilq, Ri), 0 }, +/*be*/ { "mov", FALSE, LONG, op2(Ilq, Ri), 0 }, +/*bf*/ { "mov", FALSE, LONG, op2(Ilq, Ri), 0 }, /*c0*/ { "", TRUE, BYTE, op2(Ib, E), db_Grp2 }, /*c1*/ { "", TRUE, LONG, op2(Ib, E), db_Grp2 }, @@ -854,17 +854,6 @@ int ss; }; -static const char * const db_index_reg_16[8] = { - "%bx,%si", - "%bx,%di", - "%bp,%si", - "%bp,%di", - "%si", - "%di", - "%bp", - "%bx" -}; - static const char * const db_reg[2][4][16] = { {{"%al", "%cl", "%dl", "%bl", "%ah", "%ch", "%dh", "%bh", @@ -927,7 +916,7 @@ int regmodrm; struct i_addr * addrp; /* out */ { - int mod, rm, sib, index, disp; + int mod, rm, sib, index, disp, size, have_sib; mod = f_mod(rex, regmodrm); rm = f_rm(rex, regmodrm); @@ -940,68 +929,49 @@ addrp->is_reg = FALSE; addrp->index = 0; - if (short_addr) { - addrp->index = 0; - addrp->ss = 0; - switch (mod) { - case 0: - if (rm == 6) { - get_value_inc(disp, loc, 2, FALSE); - addrp->disp = disp; - addrp->base = 0; - } - else { - addrp->disp = 0; - addrp->base = db_index_reg_16[rm]; - } - break; - case 1: - get_value_inc(disp, loc, 1, TRUE); - disp &= 0xFFFF; - addrp->disp = disp; - addrp->base = db_index_reg_16[rm]; - break; - case 2: - get_value_inc(disp, loc, 2, FALSE); - addrp->disp = disp; - addrp->base = db_index_reg_16[rm]; - break; - } - } - else { - if (mod != 3 && rm == 4) { - get_value_inc(sib, loc, 1, FALSE); - rm = sib_base(rex, sib); - index = sib_index(rex, sib); - if (index != 4) - addrp->index = db_reg[1][QUAD][index]; - addrp->ss = sib_ss(rex, sib); - } + if (short_addr) + size = LONG; + else + size = QUAD; + + if ((rm & 0x7) == 4) { + get_value_inc(sib, loc, 1, FALSE); + rm = sib_base(rex, sib); + index = sib_index(rex, sib); + if (index != 4) + addrp->index = db_reg[1][size][index]; + addrp->ss = sib_ss(rex, sib); + have_sib = 1; + } else + have_sib = 0; - switch (mod) { - case 0: - if (rm == 5) { - get_value_inc(addrp->disp, loc, 4, FALSE); + switch (mod) { + case 0: + if (rm == 5) { + get_value_inc(addrp->disp, loc, 4, FALSE); + if (have_sib) addrp->base = 0; - } - else { - addrp->disp = 0; - addrp->base = db_reg[1][QUAD][rm]; - } - break; + else if (short_addr) + addrp->base = "%eip"; + else + addrp->base = "%rip"; + } else { + addrp->disp = 0; + addrp->base = db_reg[1][size][rm]; + } + break; - case 1: - get_value_inc(disp, loc, 1, TRUE); - addrp->disp = disp; - addrp->base = db_reg[1][QUAD][rm]; - break; + case 1: + get_value_inc(disp, loc, 1, TRUE); + addrp->disp = disp; + addrp->base = db_reg[1][size][rm]; + break; - case 2: - get_value_inc(disp, loc, 4, FALSE); - addrp->disp = disp; - addrp->base = db_reg[1][QUAD][rm]; - break; - } + case 2: + get_value_inc(disp, loc, 4, FALSE); + addrp->disp = disp; + addrp->base = db_reg[1][size][rm]; + break; } return (loc); } @@ -1022,7 +992,8 @@ db_printf("%s:", seg); } - db_printsym((db_addr_t)addrp->disp, DB_STGY_ANY); + if (addrp->disp != 0 || (addrp->base == 0 && addrp->index == 0)) + db_printsym((db_addr_t)addrp->disp, DB_STGY_ANY); if (addrp->base != 0 || addrp->index != 0) { db_printf("("); if (addrp->base) @@ -1154,6 +1125,7 @@ int prefix; int imm; int imm2; + long imm64; int len; struct i_addr address; @@ -1426,6 +1398,12 @@ db_printf("$%#r", imm); break; + case Ilq: + len = db_lengths[rex & REX_W ? QUAD : LONG]; + get_value_inc(imm64, loc, len, FALSE); + db_printf("$%#lr", imm64); + break; + case O: len = (short_addr ? 2 : 4); get_value_inc(displ, loc, len, FALSE); ==== //depot/projects/linuxolator/src/sys/amd64/amd64/local_apic.c#5 (text+ko) ==== @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/amd64/amd64/local_apic.c,v 1.32 2006/10/10 23:23:11 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/local_apic.c,v 1.33 2006/11/13 22:23:32 jhb Exp $"); #include "opt_hwpmc_hooks.h" @@ -744,6 +744,65 @@ panic("Couldn't find an APIC vector for IRQ %u", irq); } +/* + * Request 'count' free contiguous IDT vectors to be used by 'count' + * IRQs. 'count' must be a power of two and the vectors will be + * aligned on a boundary of 'align'. If the request cannot be + * satisfied, 0 is returned. + */ +u_int +apic_alloc_vectors(u_int *irqs, u_int count, u_int align) +{ + u_int first, run, vector; + + KASSERT(powerof2(count), ("bad count")); + KASSERT(powerof2(align), ("bad align")); + KASSERT(align >= count, ("align < count")); +#ifdef INVARIANTS + for (run = 0; run < count; run++) + KASSERT(irqs[run] < NUM_IO_INTS, ("Invalid IRQ %u at index %u", + irqs[run], run)); +#endif + + /* + * Search for 'count' free vectors. As with apic_alloc_vector(), + * this just uses a simple first fit algorithm. + */ + run = 0; + first = 0; + mtx_lock_spin(&icu_lock); + for (vector = 0; vector < APIC_NUM_IOINTS; vector++) { + + /* Vector is in use, end run. */ + if (ioint_irqs[vector] != 0) { + run = 0; + first = 0; + continue; + } + + /* Start a new run if run == 0 and vector is aligned. */ + if (run == 0) { + if ((vector & (align - 1)) != 0) + continue; + first = vector; + } + run++; + + /* Keep looping if the run isn't long enough yet. */ + if (run < count) + continue; + + /* Found a run, assign IRQs and return the first vector. */ + for (vector = 0; vector < count; vector++) + ioint_irqs[first + vector] = irqs[vector]; + mtx_unlock_spin(&icu_lock); + return (first + APIC_IO_INTS); + } + mtx_unlock_spin(&icu_lock); + printf("APIC: Couldn't find APIC vectors for %u IRQs\n", count); + return (0); +} + void apic_enable_vector(u_int vector) { @@ -1002,6 +1061,9 @@ intr_register_pic(&lapic_pic); if (bootverbose) lapic_dump("BSP"); + + /* Enable the MSI "pic". */ + msi_init(); } SYSINIT(apic_setup_io, SI_SUB_INTR, SI_ORDER_SECOND, apic_setup_io, NULL) ==== //depot/projects/linuxolator/src/sys/amd64/amd64/mptable_pci.c#2 (text+ko) ==== @@ -33,7 +33,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/amd64/amd64/mptable_pci.c,v 1.4 2006/01/06 19:22:18 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/mptable_pci.c,v 1.5 2006/11/13 22:23:32 jhb Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -96,6 +96,10 @@ DEVMETHOD(pcib_read_config, legacy_pcib_read_config), DEVMETHOD(pcib_write_config, legacy_pcib_write_config), DEVMETHOD(pcib_route_interrupt, mptable_pci_route_interrupt), + DEVMETHOD(pcib_alloc_msi, pcib_alloc_msi), + DEVMETHOD(pcib_release_msi, pcib_release_msi), + DEVMETHOD(pcib_alloc_msix, pcib_alloc_msix), + DEVMETHOD(pcib_release_msix, pcib_release_msix), { 0, 0 } }; @@ -148,6 +152,10 @@ DEVMETHOD(pcib_read_config, pcib_read_config), DEVMETHOD(pcib_write_config, pcib_write_config), DEVMETHOD(pcib_route_interrupt, mptable_pci_route_interrupt), + DEVMETHOD(pcib_alloc_msi, pcib_alloc_msi), + DEVMETHOD(pcib_release_msi, pcib_release_msi), + DEVMETHOD(pcib_alloc_msix, pcib_alloc_msix), + DEVMETHOD(pcib_release_msix, pcib_release_msix), {0, 0} }; ==== //depot/projects/linuxolator/src/sys/amd64/amd64/nexus.c#3 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/amd64/amd64/nexus.c,v 1.69 2006/09/11 19:31:51 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/nexus.c,v 1.70 2006/11/13 22:23:32 jhb Exp $"); /* * This code implements a `root nexus' for Intel Architecture @@ -61,6 +61,8 @@ #include <machine/resource.h> +#include "pcib_if.h" + #ifdef DEV_ISA #include <isa/isavar.h> #include <amd64/isa/isa.h> @@ -100,6 +102,10 @@ static int nexus_set_resource(device_t, device_t, int, int, u_long, u_long); static int nexus_get_resource(device_t, device_t, int, int, u_long *, u_long *); static void nexus_delete_resource(device_t, device_t, int, int); +static int nexus_alloc_msi(device_t pcib, device_t dev, int count, int maxcount, int *irqs); +static int nexus_release_msi(device_t pcib, device_t dev, int count, int *irqs); +static int nexus_alloc_msix(device_t pcib, device_t dev, int index, int *irq); +static int nexus_release_msix(device_t pcib, device_t dev, int irq); static device_method_t nexus_methods[] = { /* Device interface */ @@ -125,6 +131,12 @@ DEVMETHOD(bus_get_resource, nexus_get_resource), DEVMETHOD(bus_delete_resource, nexus_delete_resource), + /* pcib interface */ + DEVMETHOD(pcib_alloc_msi, nexus_alloc_msi), + DEVMETHOD(pcib_release_msi, nexus_release_msi), + DEVMETHOD(pcib_alloc_msix, nexus_alloc_msix), + DEVMETHOD(pcib_release_msix, nexus_release_msix), + { 0, 0 } }; @@ -504,6 +516,47 @@ resource_list_delete(rl, type, rid); } +static int +nexus_alloc_msix(device_t pcib, device_t dev, int index, int *irq) +{ + int error, new; + + error = msix_alloc(dev, index, irq, &new); + if (new) + rman_manage_region(&irq_rman, *irq, *irq); + return (error); +} + +static int +nexus_release_msix(device_t pcib, device_t dev, int irq) +{ + + return (msix_release(irq)); +} + +static int +nexus_alloc_msi(device_t pcib, device_t dev, int count, int maxcount, int *irqs) +{ + int error, i, newirq, newcount; + + /* First alloc the messages. */ + error = msi_alloc(dev, count, maxcount, irqs, &newirq, &newcount); + + /* Always add any new IRQs to the rman, even on failure. */ + for (i = 0; i < newcount; i++) + rman_manage_region(&irq_rman, irqs[newirq + i], + irqs[newirq + i]); + + return (error); +} + +static int +nexus_release_msi(device_t pcib, device_t dev, int count, int *irqs) +{ + + return (msi_release(irqs, count)); +} + #ifdef DEV_ISA /* * Placeholder which claims PnP 'devices' which describe system ==== //depot/projects/linuxolator/src/sys/amd64/amd64/pmap.c#3 (text+ko) ==== @@ -77,7 +77,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.572 2006/10/22 04:18:01 alc Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.573 2006/11/12 21:48:32 alc Exp $"); /* * Manages physical address maps. @@ -2357,8 +2357,10 @@ * Now validate mapping with desired protection/wiring. */ newpte = (pt_entry_t)(pa | PG_V); - if ((prot & VM_PROT_WRITE) != 0) + if ((prot & VM_PROT_WRITE) != 0) { newpte |= PG_RW; + vm_page_flag_set(m, PG_WRITEABLE); + } if ((prot & VM_PROT_EXECUTE) == 0) newpte |= pg_nx; if (wired) ==== //depot/projects/linuxolator/src/sys/amd64/include/apicvar.h#3 (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.19 2006/10/10 23:23:11 jhb Exp $ + * $FreeBSD: src/sys/amd64/include/apicvar.h,v 1.20 2006/11/13 22:23:33 jhb Exp $ */ #ifndef _MACHINE_APICVAR_H_ @@ -175,6 +175,7 @@ IDTVEC(apic_isr7), IDTVEC(spuriousint), IDTVEC(timerint); u_int apic_alloc_vector(u_int irq); +u_int apic_alloc_vectors(u_int *irqs, u_int count, u_int align); void apic_enable_vector(u_int vector); void apic_free_vector(u_int vector, u_int irq); u_int apic_idt_to_irq(u_int vector); ==== //depot/projects/linuxolator/src/sys/amd64/include/intr_machdep.h#3 (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.11 2006/10/10 23:23:11 jhb Exp $ + * $FreeBSD: src/sys/amd64/include/intr_machdep.h,v 1.12 2006/11/13 22:23:33 jhb Exp $ */ #ifndef __MACHINE_INTR_MACHDEP_H__ @@ -43,11 +43,18 @@ * 191 and still be safe since only interrupt sources in actual use will * allocate IDT vectors. * - * For now we stick with 255 as ISA IRQs and PCI intline IRQs only allow - * for IRQs in the range 0 - 254. When MSI support is added this number - * will likely increase. + * The first 255 IRQs (0 - 254) are reserved for ISA IRQs and PCI intline IRQs. + * IRQ values beyond 256 are used by MSI. We leave 255 unused to avoid + * confusion since 255 is used in PCI to indicate an invalid IRQ. + */ +#define NUM_MSI_INTS 128 +#define FIRST_MSI_INT 256 +#define NUM_IO_INTS (FIRST_MSI_INT + NUM_MSI_INTS) + +/* + * Default base address for MSI messages on x86 platforms. */ -#define NUM_IO_INTS 255 +#define MSI_INTEL_ADDR_BASE 0xfee00000 /* * - 1 ??? dummy counter. @@ -140,6 +147,12 @@ void intr_resume(void); void intr_suspend(void); void intrcnt_add(const char *name, u_long **countp); +void msi_init(void); +int msi_alloc(device_t dev, int count, int maxcount, int *irqs, int *newirq, + int *newcount); +int msi_release(int *irqs, int count); +int msix_alloc(device_t dev, int index, int *irq, int *new); +int msix_release(int irq); #endif /* !LOCORE */ #endif /* _KERNEL */ ==== //depot/projects/linuxolator/src/sys/amd64/include/pmap.h#2 (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.134 2006/08/11 19:22:56 jhb Exp $ + * $FreeBSD: src/sys/amd64/include/pmap.h,v 1.136 2006/11/13 20:33:54 ru Exp $ */ #ifndef _MACHINE_PMAP_H_ @@ -101,9 +101,10 @@ ((unsigned long)(l2) << PDRSHIFT) | \ ((unsigned long)(l1) << PAGE_SHIFT)) -/* Initial number of kernel page tables */ +/* Initial number of kernel page tables. */ #ifndef NKPT -#define NKPT 240 /* Enough for 16GB (2MB page tables) */ +/* 240 page tables needed to map 16G (120B "struct vm_page", 2M page tables). */ +#define NKPT 240 #endif #define NKPML4E 1 /* number of kernel PML4 slots */ @@ -262,7 +263,7 @@ /* * For each vm_page_t, there is a list of all currently valid virtual - * mappings of that page. An entry is a pv_entry_t, the list is pv_table. + * mappings of that page. An entry is a pv_entry_t, the list is pv_list. */ typedef struct pv_entry { vm_offset_t pv_va; /* virtual address for mapping */ ==== //depot/projects/linuxolator/src/sys/amd64/linux32/linux.h#10 (text+ko) ==== @@ -842,7 +842,7 @@ #define CLONE_CHILD_SETTID 0x01000000 #define CLONE_PARENT_SETTID 0x00100000 -#define THREADING_FLAGS (CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND) +#define THREADING_FLAGS (CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND | CLONE_THREAD) #include <compat/linux/linux_aio.h> ==== //depot/projects/linuxolator/src/sys/amd64/pci/pci_bus.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/amd64/pci/pci_bus.c,v 1.117 2006/03/13 23:58:40 peter Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/pci/pci_bus.c,v 1.118 2006/11/13 22:23:33 jhb Exp $"); #include "opt_cpu.h" @@ -322,6 +322,10 @@ DEVMETHOD(pcib_read_config, legacy_pcib_read_config), DEVMETHOD(pcib_write_config, legacy_pcib_write_config), DEVMETHOD(pcib_route_interrupt, legacy_pcib_route_interrupt), + DEVMETHOD(pcib_alloc_msi, pcib_alloc_msi), + DEVMETHOD(pcib_release_msi, pcib_release_msi), + DEVMETHOD(pcib_alloc_msix, pcib_alloc_msix), + DEVMETHOD(pcib_release_msix, pcib_release_msix), { 0, 0 } }; ==== //depot/projects/linuxolator/src/sys/arm/arm/pmap.c#3 (text+ko) ==== @@ -147,7 +147,7 @@ #include "opt_vm.h" #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/arm/arm/pmap.c,v 1.72 2006/11/11 20:57:51 alc Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/arm/pmap.c,v 1.73 2006/11/12 21:48:32 alc Exp $"); #include <sys/param.h> #include <sys/systm.h> #include <sys/kernel.h> @@ -3396,8 +3396,11 @@ npte |= L2_TYPE_INV; } - if (prot & VM_PROT_WRITE) + if (prot & VM_PROT_WRITE) { npte |= L2_S_PROT_W; + if (m != NULL) + vm_page_flag_set(m, PG_WRITEABLE); + } npte |= pte_l2_s_cache_mode; if (m && m == opg) { /* ==== //depot/projects/linuxolator/src/sys/arm/include/pmap.h#3 (text+ko) ==== @@ -44,7 +44,7 @@ * from: @(#)pmap.h 7.4 (Berkeley) 5/12/91 * from: FreeBSD: src/sys/i386/include/pmap.h,v 1.70 2000/11/30 * - * $FreeBSD: src/sys/arm/include/pmap.h,v 1.22 2006/11/11 20:57:52 alc Exp $ + * $FreeBSD: src/sys/arm/include/pmap.h,v 1.23 2006/11/13 06:26:56 ru Exp $ */ #ifndef _MACHINE_PMAP_H_ @@ -170,7 +170,7 @@ /* * For each vm_page_t, there is a list of all currently valid virtual - * mappings of that page. An entry is a pv_entry_t, the list is pv_table. + * mappings of that page. An entry is a pv_entry_t, the list is pv_list. */ typedef struct pv_entry { pmap_t pv_pmap; /* pmap where mapping lies */ ==== //depot/projects/linuxolator/src/sys/coda/coda_vnops.c#2 (text+ko) ==== @@ -42,7 +42,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/coda/coda_vnops.c,v 1.68 2006/02/01 00:25:24 jeff Exp $"); +__FBSDID("$FreeBSD: src/sys/coda/coda_vnops.c,v 1.69 2006/11/13 05:51:21 kmacy Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -129,7 +129,7 @@ .vop_readlink = coda_readlink, /* readlink */ .vop_inactive = coda_inactive, /* inactive */ .vop_reclaim = coda_reclaim, /* reclaim */ - .vop_lock = coda_lock, /* lock */ + ._vop_lock = coda_lock, /* lock */ .vop_unlock = coda_unlock, /* unlock */ .vop_bmap = coda_bmap, /* bmap */ .vop_print = VOP_PANIC, /* print */ @@ -1627,7 +1627,7 @@ } int -coda_lock(struct vop_lock_args *ap) +coda_lock(struct _vop_lock_args *ap) { /* true args */ struct vnode *vp = ap->a_vp; ==== //depot/projects/linuxolator/src/sys/coda/coda_vnops.h#2 (text+ko) ==== @@ -27,7 +27,7 @@ * Mellon the rights to redistribute these changes without encumbrance. * * @(#) src/sys/coda/coda_vnops.h,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $ - * $FreeBSD: src/sys/coda/coda_vnops.h,v 1.16 2005/01/19 08:24:53 phk Exp $ + * $FreeBSD: src/sys/coda/coda_vnops.h,v 1.17 2006/11/13 05:51:21 kmacy Exp $ * */ @@ -72,7 +72,7 @@ vop_bmap_t coda_bmap; vop_strategy_t coda_strategy; vop_reclaim_t coda_reclaim; -vop_lock_t coda_lock; +_vop_lock_t coda_lock; vop_unlock_t coda_unlock; vop_islocked_t coda_islocked; int coda_vop_error(void *); ==== //depot/projects/linuxolator/src/sys/compat/linux/linux_emul.c#15 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/compat/linux/linux_emul.c,v 1.8 2006/10/28 10:59:59 netchild Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linux/linux_emul.c,v 1.9 2006/11/15 11:04:37 kib Exp $"); #include "opt_compat.h" ==== //depot/projects/linuxolator/src/sys/compat/linux/linux_misc.c#34 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/compat/linux/linux_misc.c,v 1.193 2006/11/11 16:26:55 trhodes Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linux/linux_misc.c,v 1.194 2006/11/15 10:01:06 kib Exp $"); #include "opt_compat.h" #include "opt_mac.h" ==== //depot/projects/linuxolator/src/sys/conf/NOTES#11 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/NOTES,v 1.1398 2006/11/11 05:35:39 kmacy Exp $ +# $FreeBSD: src/sys/conf/NOTES,v 1.1400 2006/11/15 09:13:24 maxim Exp $ # # NOTES -- Lines that can be cut/pasted into kernel and hints configs. # @@ -195,7 +195,7 @@ # MUTEX_NOINLINE forces mutex operations to call functions to perform each # operation rather than inlining the simple cases. This can be used to # shrink the size of the kernel text segment. Note that this behavior is -# already implied by the INVARIANT_SUPPORT, INVARIANTS, KTR, MUTEX_PROFILING, +# already implied by the INVARIANT_SUPPORT, INVARIANTS, KTR, LOCK_PROFILING, # and WITNESS options. options MUTEX_NOINLINE @@ -207,7 +207,7 @@ # RWLOCK_NOINLINE forces rwlock operations to call functions to perform each # operation rather than inlining the simple cases. This can be used to # shrink the size of the kernel text segment. Note that this behavior is -# already implied by the INVARIANT_SUPPORT, INVARIANTS, KTR, MUTEX_PROFILING, +# already implied by the INVARIANT_SUPPORT, INVARIANTS, KTR, LOCK_PROFILING, # and WITNESS options. options RWLOCK_NOINLINE @@ -241,8 +241,7 @@ options WITNESS_KDB options WITNESS_SKIPSPIN -# LOCK_PROFILING - Profiling locks. See -# MUTEX_PROFILING(9) for details. +# LOCK_PROFILING - Profiling locks. See LOCK_PROFILING(9) for details. options LOCK_PROFILING # Set the number of buffers and the hash size. The hash size MUST be larger # than the number of buffers. Hash size should be prime. @@ -2398,6 +2397,8 @@ # # USB serial support device ucom +# USB support for Technologies ARK3116 based serial adapters +device uark # USB support for Belkin F5U103 and compatible serial adapters device ubsa # USB support for BWCT console serial adapters ==== //depot/projects/linuxolator/src/sys/conf/files#11 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/files,v 1.1161 2006/11/11 16:26:56 trhodes Exp $ +# $FreeBSD: src/sys/conf/files,v 1.1162 2006/11/15 09:13:24 maxim Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -1037,6 +1037,7 @@ dev/usb/ohci_pci.c optional ohci pci dev/usb/sl811hs.c optional slhci dev/usb/slhci_pccard.c optional slhci pccard +dev/usb/uark.c optional uark dev/usb/ubsa.c optional ubsa dev/usb/ubser.c optional ubser dev/usb/ucom.c optional ucom ==== //depot/projects/linuxolator/src/sys/conf/files.amd64#8 (text+ko) ==== @@ -1,7 +1,7 @@ # This file tells config what files go into building a kernel, # files marked standard are always included. # -# $FreeBSD: src/sys/conf/files.amd64,v 1.98 2006/10/29 14:02:39 netchild Exp $ +# $FreeBSD: src/sys/conf/files.amd64,v 1.99 2006/11/13 22:23:33 jhb Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -114,6 +114,7 @@ amd64/amd64/mpboot.S optional smp amd64/amd64/mptable.c optional mptable amd64/amd64/mptable_pci.c optional mptable pci +amd64/amd64/msi.c optional pci amd64/amd64/nexus.c standard amd64/amd64/pmap.c standard amd64/amd64/prof_machdep.c optional profiling-routine ==== //depot/projects/linuxolator/src/sys/conf/files.i386#7 (text+ko) ==== @@ -1,7 +1,7 @@ # This file tells config what files go into building a kernel, # files marked standard are always included. # -# $FreeBSD: src/sys/conf/files.i386,v 1.570 2006/10/29 14:02:39 netchild Exp $ +# $FreeBSD: src/sys/conf/files.i386,v 1.571 2006/11/13 22:23:33 jhb Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -294,6 +294,7 @@ i386/i386/mpboot.s optional smp i386/i386/mptable.c optional apic i386/i386/mptable_pci.c optional apic pci +i386/i386/msi.c optional apic pci i386/i386/nexus.c standard i386/i386/perfmon.c optional perfmon i386/i386/pmap.c standard ==== //depot/projects/linuxolator/src/sys/conf/files.pc98#5 (text+ko) ==== @@ -3,7 +3,7 @@ # # modified for PC-9801/PC-9821 # -# $FreeBSD: src/sys/conf/files.pc98,v 1.349 2006/10/29 14:02:39 netchild Exp $ +# $FreeBSD: src/sys/conf/files.pc98,v 1.350 2006/11/14 14:28:09 ru Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -176,6 +176,7 @@ i386/i386/mpboot.s optional smp i386/i386/mptable.c optional apic i386/i386/mptable_pci.c optional apic pci +i386/i386/msi.c optional apic pci i386/i386/nexus.c standard i386/i386/perfmon.c optional perfmon i386/i386/pmap.c standard ==== //depot/projects/linuxolator/src/sys/conf/files.sun4v#4 (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.3 2006/11/08 21:45:45 ru Exp $ +# $FreeBSD: src/sys/conf/files.sun4v,v 1.4 2006/11/13 01:02:18 kmacy Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -80,6 +80,7 @@ sun4v/sun4v/pmap.c standard sun4v/sun4v/prof_machdep.c optional profiling-routine sun4v/sun4v/rwindow.c standard +sun4v/sun4v/rtc.c standard sun4v/sun4v/simdisk.c optional simulator sun4v/sun4v/support.S standard sun4v/sun4v/sys_machdep.c standard ==== //depot/projects/linuxolator/src/sys/dev/acpica/acpi_pcib_acpi.c#2 (text+ko) ==== @@ -26,7 +26,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_pcib_acpi.c,v 1.50 2006/01/06 19:22:18 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_pcib_acpi.c,v 1.51 2006/11/13 21:47:30 jhb Exp $"); #include "opt_acpi.h" #include <sys/param.h> @@ -103,6 +103,10 @@ DEVMETHOD(pcib_read_config, acpi_pcib_read_config), DEVMETHOD(pcib_write_config, acpi_pcib_write_config), DEVMETHOD(pcib_route_interrupt, acpi_pcib_acpi_route_interrupt), + DEVMETHOD(pcib_alloc_msi, pcib_alloc_msi), + DEVMETHOD(pcib_release_msi, pcib_release_msi), + DEVMETHOD(pcib_alloc_msix, pcib_alloc_msix), + DEVMETHOD(pcib_release_msix, pcib_release_msix), {0, 0} }; ==== //depot/projects/linuxolator/src/sys/dev/acpica/acpi_pcib_pci.c#2 (text+ko) ==== @@ -26,7 +26,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_pcib_pci.c,v 1.14 2006/01/06 19:22:18 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_pcib_pci.c,v 1.15 2006/11/13 21:47:30 jhb Exp $"); #include "opt_acpi.h" @@ -93,6 +93,10 @@ >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200611151632.kAFGWWXV094926>