Date: Sun, 15 Aug 2004 19:54:47 GMT From: Peter Wemm <peter@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 59744 for review Message-ID: <200408151954.i7FJsllE007722@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=59744 Change 59744 by peter@peter_daintree on 2004/08/15 19:54:09 integ -I -b i386_hammer Affected files ... .. //depot/projects/hammer/sys/amd64/acpica/acpi_machdep.c#16 integrate .. //depot/projects/hammer/sys/amd64/acpica/acpi_wakeup.c#11 integrate .. //depot/projects/hammer/sys/amd64/amd64/autoconf.c#17 integrate .. //depot/projects/hammer/sys/amd64/amd64/elf_machdep.c#29 integrate .. //depot/projects/hammer/sys/amd64/amd64/intr_machdep.c#26 integrate .. //depot/projects/hammer/sys/amd64/amd64/io_apic.c#30 integrate .. //depot/projects/hammer/sys/amd64/amd64/machdep.c#97 integrate .. //depot/projects/hammer/sys/amd64/amd64/mem.c#25 integrate .. //depot/projects/hammer/sys/amd64/amd64/pmap.c#98 integrate .. //depot/projects/hammer/sys/amd64/amd64/trap.c#51 integrate .. //depot/projects/hammer/sys/amd64/conf/GENERIC#50 integrate .. //depot/projects/hammer/sys/amd64/conf/NOTES#39 integrate .. //depot/projects/hammer/sys/amd64/include/cpu.h#16 integrate .. //depot/projects/hammer/sys/amd64/include/critical.h#17 integrate .. //depot/projects/hammer/sys/amd64/include/elf.h#12 integrate .. //depot/projects/hammer/sys/amd64/include/intr_machdep.h#13 integrate .. //depot/projects/hammer/sys/amd64/include/param.h#22 integrate .. //depot/projects/hammer/sys/amd64/isa/atpic.c#43 integrate Differences ... ==== //depot/projects/hammer/sys/amd64/acpica/acpi_machdep.c#16 (text+ko) ==== @@ -40,8 +40,7 @@ { struct acpi_softc *sc; - sc = device_get_softc(dev); - + sc = devclass_get_softc(devclass_find("acpi"), 0); acpi_install_wakeup_handler(sc); if (intr_model != ACPI_INTR_PIC) ==== //depot/projects/hammer/sys/amd64/acpica/acpi_wakeup.c#11 (text+ko) ==== ==== //depot/projects/hammer/sys/amd64/amd64/autoconf.c#17 (text+ko) ==== ==== //depot/projects/hammer/sys/amd64/amd64/elf_machdep.c#29 (text+ko) ==== @@ -102,14 +102,12 @@ (sysinit_cfunc_t) elf64_insert_brand_entry, &freebsd_brand_oinfo); - void elf64_dump_thread(struct thread *td __unused, void *dst __unused, size_t *off __unused) { } - /* Process one elf relocation with addend. */ static int elf_reloc_internal(linker_file_t lf, Elf_Addr relocbase, const void *data, ==== //depot/projects/hammer/sys/amd64/amd64/intr_machdep.c#26 (text+ko) ==== @@ -212,8 +212,7 @@ * For stray and threaded interrupts, we mask and EOI the * source. */ - isrc->is_pic->pic_disable_source(isrc); - isrc->is_pic->pic_eoi_source(isrc); + isrc->is_pic->pic_disable_source(isrc, PIC_EOI); if (ih == NULL) error = EINVAL; else ==== //depot/projects/hammer/sys/amd64/amd64/io_apic.c#30 (text+ko) ==== @@ -119,7 +119,7 @@ static const char *ioapic_bus_string(int bus_type); static void ioapic_print_vector(struct ioapic_intsrc *intpin); static void ioapic_enable_source(struct intsrc *isrc); -static void ioapic_disable_source(struct intsrc *isrc); +static void ioapic_disable_source(struct intsrc *isrc, int eoi); static void ioapic_eoi_source(struct intsrc *isrc); static void ioapic_enable_intr(struct intsrc *isrc); static int ioapic_vector(struct intsrc *isrc); @@ -148,6 +148,12 @@ #endif TUNABLE_INT("hw.apic.mixed_mode", &mixed_mode_active); +static __inline void +_ioapic_eoi_source(struct intsrc *isrc) +{ + lapic_eoi(); +} + static u_int ioapic_read(volatile ioapic_t *apic, int reg) { @@ -225,7 +231,7 @@ } static void -ioapic_disable_source(struct intsrc *isrc) +ioapic_disable_source(struct intsrc *isrc, int eoi) { struct ioapic_intsrc *intpin = (struct ioapic_intsrc *)isrc; struct ioapic *io = (struct ioapic *)isrc->is_pic; @@ -240,6 +246,10 @@ flags); intpin->io_masked = 1; } + + if (eoi == PIC_EOI) + _ioapic_eoi_source(isrc); + mtx_unlock_spin(&icu_lock); } @@ -247,7 +257,7 @@ ioapic_eoi_source(struct intsrc *isrc) { - lapic_eoi(); + _ioapic_eoi_source(isrc); } /* ==== //depot/projects/hammer/sys/amd64/amd64/machdep.c#97 (text+ko) ==== ==== //depot/projects/hammer/sys/amd64/amd64/mem.c#25 (text+ko) ==== @@ -67,6 +67,11 @@ #include <machine/memdev.h> +/* + * Used in /dev/mem drivers and elsewhere + */ +MALLOC_DEFINE(M_MEMDESC, "memdesc", "memory range descriptors"); + /* ARGSUSED */ int memrw(struct cdev *dev, struct uio *uio, int flags) ==== //depot/projects/hammer/sys/amd64/amd64/pmap.c#98 (text+ko) ==== ==== //depot/projects/hammer/sys/amd64/amd64/trap.c#51 (text+ko) ==== @@ -747,6 +747,9 @@ ktrsyscall(code, narg, argp); #endif + CTR4(KTR_SYSC, "syscall enter thread %p pid %d proc %s code %d", td, + td->td_proc->p_pid, td->td_proc->p_comm, code); + if (error == 0) { td->td_retval[0] = 0; td->td_retval[1] = frame.tf_rdx; @@ -810,6 +813,9 @@ */ userret(td, &frame, sticks); + CTR4(KTR_SYSC, "syscall exit thread %p pid %d proc %s code %d", td, + td->td_proc->p_pid, td->td_proc->p_comm, code); + #ifdef KTRACE if (KTRPOINT(td, KTR_SYSRET)) ktrsysret(code, error, td->td_retval[0]); ==== //depot/projects/hammer/sys/amd64/conf/GENERIC#50 (text+ko) ==== @@ -58,6 +58,7 @@ options AHD_REG_PRETTY_PRINT # Print register bitfields in debug # output. Adds ~215k to driver. options PFIL_HOOKS # pfil(9) framework +options ADAPTIVE_GIANT # Giant mutex is adaptive. # Debugging for use in -current options KDB # Enable kernel debugger support. @@ -149,7 +150,6 @@ # PCCARD (PCMCIA) support # PCMCIA and cardbus bridge support device cbb # cardbus (yenta) bridge -#device pcic # ExCA ISA and PCI bridges device pccard # PC Card (16-bit) bus device cardbus # CardBus (32-bit) bus ==== //depot/projects/hammer/sys/amd64/conf/NOTES#39 (text+ko) ==== @@ -4,7 +4,7 @@ # This file contains machine dependent kernel configuration notes. For # machine independent notes, look in /sys/conf/NOTES. # -# (XXX from i386:NOTES,v 1.1166) +# (XXX from i386:NOTES,v 1.1167) # $FreeBSD: src/sys/amd64/conf/NOTES,v 1.15 2004/08/01 11:40:51 markm Exp $ # ==== //depot/projects/hammer/sys/amd64/include/cpu.h#16 (text+ko) ==== ==== //depot/projects/hammer/sys/amd64/include/critical.h#17 (text+ko) ==== ==== //depot/projects/hammer/sys/amd64/include/elf.h#12 (text+ko) ==== ==== //depot/projects/hammer/sys/amd64/include/intr_machdep.h#13 (text+ko) ==== @@ -50,7 +50,7 @@ */ struct pic { void (*pic_enable_source)(struct intsrc *); - void (*pic_disable_source)(struct intsrc *); + void (*pic_disable_source)(struct intsrc *, int); void (*pic_eoi_source)(struct intsrc *); void (*pic_enable_intr)(struct intsrc *); int (*pic_vector)(struct intsrc *); @@ -61,6 +61,12 @@ enum intr_polarity); }; +/* Flags for pic_disable_source() */ +enum { + PIC_EOI, + PIC_NO_EOI, +}; + /* * An interrupt source. The upper-layer code uses the PIC methods to * control a given source. The lower-layer PIC drivers can store additional ==== //depot/projects/hammer/sys/amd64/include/param.h#22 (text+ko) ==== ==== //depot/projects/hammer/sys/amd64/isa/atpic.c#43 (text+ko) ==== @@ -140,7 +140,7 @@ }; static void atpic_enable_source(struct intsrc *isrc); -static void atpic_disable_source(struct intsrc *isrc); +static void atpic_disable_source(struct intsrc *isrc, int eoi); static void atpic_eoi_master(struct intsrc *isrc); static void atpic_eoi_slave(struct intsrc *isrc); static void atpic_enable_intr(struct intsrc *isrc); @@ -177,6 +177,35 @@ CTASSERT(sizeof(atintrs) / sizeof(atintrs[0]) == NUM_ISA_IRQS); +static __inline void +_atpic_eoi_master(struct intsrc *isrc) +{ + + KASSERT(isrc->is_pic == &atpics[MASTER].at_pic, + ("%s: mismatched pic", __func__)); +#ifndef AUTO_EOI_1 + outb(atpics[MASTER].at_ioaddr, OCW2_EOI); +#endif +} + +/* + * The data sheet says no auto-EOI on slave, but it sometimes works. + * So, if AUTO_EOI_2 is enabled, we use it. + */ +static __inline void +_atpic_eoi_slave(struct intsrc *isrc) +{ + + KASSERT(isrc->is_pic == &atpics[SLAVE].at_pic, + ("%s: mismatched pic", __func__)); +#ifndef AUTO_EOI_2 + outb(atpics[SLAVE].at_ioaddr, OCW2_EOI); +#ifndef AUTO_EOI_1 + outb(atpics[MASTER].at_ioaddr, OCW2_EOI); +#endif +#endif +} + static void atpic_enable_source(struct intsrc *isrc) { @@ -192,48 +221,48 @@ } static void -atpic_disable_source(struct intsrc *isrc) +atpic_disable_source(struct intsrc *isrc, int eoi) { struct atpic_intsrc *ai = (struct atpic_intsrc *)isrc; struct atpic *ap = (struct atpic *)isrc->is_pic; - if (ai->at_trigger == INTR_TRIGGER_EDGE) - return; mtx_lock_spin(&icu_lock); - *ap->at_imen |= IMEN_MASK(ai); - outb(ap->at_ioaddr + ICU_IMR_OFFSET, *ap->at_imen); + if (ai->at_trigger != INTR_TRIGGER_EDGE) { + *ap->at_imen |= IMEN_MASK(ai); + outb(ap->at_ioaddr + ICU_IMR_OFFSET, *ap->at_imen); + } + + /* + * Take care to call these functions directly instead of through + * a function pointer. All of the referenced variables should + * still be hot in the cache. + */ + if (eoi == PIC_EOI) { + if (isrc->is_pic == &atpics[MASTER].at_pic) + _atpic_eoi_master(isrc); + else + _atpic_eoi_slave(isrc); + } + mtx_unlock_spin(&icu_lock); } static void atpic_eoi_master(struct intsrc *isrc) { - - KASSERT(isrc->is_pic == &atpics[MASTER].at_pic, - ("%s: mismatched pic", __func__)); #ifndef AUTO_EOI_1 mtx_lock_spin(&icu_lock); - outb(atpics[MASTER].at_ioaddr, OCW2_EOI); + _atpic_eoi_master(isrc); mtx_unlock_spin(&icu_lock); #endif } -/* - * The data sheet says no auto-EOI on slave, but it sometimes works. - * So, if AUTO_EOI_2 is enabled, we use it. - */ static void atpic_eoi_slave(struct intsrc *isrc) { - - KASSERT(isrc->is_pic == &atpics[SLAVE].at_pic, - ("%s: mismatched pic", __func__)); #ifndef AUTO_EOI_2 mtx_lock_spin(&icu_lock); - outb(atpics[SLAVE].at_ioaddr, OCW2_EOI); -#ifndef AUTO_EOI_1 - outb(atpics[MASTER].at_ioaddr, OCW2_EOI); -#endif + _atpic_eoi_slave(isrc); mtx_unlock_spin(&icu_lock); #endif }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200408151954.i7FJsllE007722>