From owner-p4-projects@FreeBSD.ORG Mon Oct 11 15:52:48 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D35C516A4D1; Mon, 11 Oct 2004 15:52:47 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A618716A4CE for ; Mon, 11 Oct 2004 15:52:47 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 73B7043D2D for ; Mon, 11 Oct 2004 15:52:47 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id i9BFqlww069075 for ; Mon, 11 Oct 2004 15:52:47 GMT (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i9BFqlTV069072 for perforce@freebsd.org; Mon, 11 Oct 2004 15:52:47 GMT (envelope-from peter@freebsd.org) Date: Mon, 11 Oct 2004 15:52:47 GMT Message-Id: <200410111552.i9BFqlTV069072@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 62991 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2004 15:52:48 -0000 http://perforce.freebsd.org/chv.cgi?CH=62991 Change 62991 by peter@peter_overcee on 2004/10/11 15:51:46 IFC @62990 Affected files ... .. //depot/projects/hammer/release/doc/en_US.ISO8859-1/relnotes/common/new.sgml#82 integrate .. //depot/projects/hammer/release/doc/ru_RU.KOI8-R/relnotes/common/new.sgml#8 integrate .. //depot/projects/hammer/share/man/man4/polling.4#11 integrate .. //depot/projects/hammer/sys/amd64/acpica/acpi_machdep.c#18 integrate .. //depot/projects/hammer/sys/amd64/include/acpica_machdep.h#12 integrate .. //depot/projects/hammer/sys/arm/conf/SIMICS#3 integrate .. //depot/projects/hammer/sys/arm/sa11x0/assabet_machdep.c#5 integrate .. //depot/projects/hammer/sys/dev/acpica/acpi_cmbat.c#19 integrate .. //depot/projects/hammer/sys/dev/acpica/acpi_cpu.c#25 integrate .. //depot/projects/hammer/sys/dev/fdc/fdc.c#19 integrate .. //depot/projects/hammer/sys/i386/acpica/acpi_machdep.c#20 integrate .. //depot/projects/hammer/sys/i386/include/acpica_machdep.h#6 integrate .. //depot/projects/hammer/sys/i386/isa/pbio.c#2 integrate .. //depot/projects/hammer/sys/ia64/acpica/acpi_machdep.c#5 integrate .. //depot/projects/hammer/sys/ia64/include/acpica_machdep.h#4 integrate .. //depot/projects/hammer/sys/kern/subr_witness.c#35 integrate .. //depot/projects/hammer/sys/kern/uipc_socket.c#39 integrate .. //depot/projects/hammer/sys/net/if_ethersubr.c#33 integrate .. //depot/projects/hammer/sys/net/if_tun.c#20 integrate .. //depot/projects/hammer/usr.sbin/moused/moused.8#8 integrate .. //depot/projects/hammer/usr.sbin/moused/moused.c#9 integrate .. //depot/projects/hammer/usr.sbin/ppp/ccp.c#4 integrate .. //depot/projects/hammer/usr.sbin/ppp/chat.c#3 integrate .. //depot/projects/hammer/usr.sbin/ppp/command.c#10 integrate .. //depot/projects/hammer/usr.sbin/ppp/datalink.c#5 integrate .. //depot/projects/hammer/usr.sbin/ppp/datalink.h#3 integrate .. //depot/projects/hammer/usr.sbin/ppp/nat_cmd.c#5 integrate .. //depot/projects/hammer/usr.sbin/ppp/ncp.c#4 integrate .. //depot/projects/hammer/usr.sbin/ppp/physical.c#7 integrate .. //depot/projects/hammer/usr.sbin/ppp/radius.c#11 integrate .. //depot/projects/hammer/usr.sbin/ppp/route.c#5 integrate Differences ... ==== //depot/projects/hammer/release/doc/en_US.ISO8859-1/relnotes/common/new.sgml#82 (text+ko) ==== @@ -3,7 +3,7 @@ The &os; Project - $FreeBSD: src/release/doc/en_US.ISO8859-1/relnotes/common/new.sgml,v 1.780 2004/10/08 15:51:02 hrs Exp $ + $FreeBSD: src/release/doc/en_US.ISO8859-1/relnotes/common/new.sgml,v 1.781 2004/10/11 13:07:04 den Exp $ 2000 @@ -1677,7 +1677,7 @@ updated from the 29 July 2003 release to the 7 February 2004 release. - BIND has been updated to + BIND has been updated from version 8.3.1-REL to version 9.3.0. &merged; Binutils have been updated to ==== //depot/projects/hammer/release/doc/ru_RU.KOI8-R/relnotes/common/new.sgml#8 (text+ko) ==== @@ -1,9 +1,9 @@ @@ -11,7 +11,7 @@ Проект &os; - $FreeBSD: src/release/doc/ru_RU.KOI8-R/relnotes/common/new.sgml,v 1.11 2004/10/01 08:54:34 den Exp $ + $FreeBSD: src/release/doc/ru_RU.KOI8-R/relnotes/common/new.sgml,v 1.12 2004/10/11 06:36:48 den Exp $ 2000 @@ -230,6 +230,14 @@ За дальнейшей информацией обращайтесь к сообщению безопасности FreeBSD-SA-04:14. &merged; + Ошибка в CONS_SCRSHOT &man.ioctl.2; + была исправлена; она может привести к получению неавторизованного + доступа к областям памяти ядра с возможным раскрытием + критической информации, пропуску механизмов контроля доступа, + или к получению повышенных привилегий. За дальнейшей информацией + обращайтесь к сообщению безопасности FreeBSD-SA-04:15. &merged; + @@ -794,11 +802,11 @@ скорость передачи данных. &merged; Поддержка интерфейсами &man.polling.4; теперь может быть включена - поинтерфейсно. Все драйвера, поддерживающие &man.polling.4; - (&man.dc.4;, &man.fxp.4;, &man.em.4;, &man.nge.4;, &man.re.4;, - &man.rl.4;, &man.sis.4;, &man.ste.4;, и &man.vr.4;), - теперь также поддерживают эту возможность, которая может управляться - через &man.ifconfig.8;. &merged; + поинтерфейсно. Следующие сетевые драйверы поддерживают &man.polling.4;: + &man.dc.4;, &man.fxp.4;, &man.em.4;, &man.ixgb.4;, + &man.nge.4;, &man.re.4;, &man.rl.4;, &man.sis.4;, &man.ste.4;, &man.vge.4;, + и &man.vr.4;. Эта возможность может управляться + через &man.ifconfig.8; (за исключением &man.ixgb.4;). &merged; @@ -1630,6 +1638,41 @@ работы сохраняет текущие настройки всех аудио микшеров, присутствующих в системе, и восстанавливает их при загрузке. + Скрипт named был обновлен для поддержки + BIND 9 в базовой системе. Изменения + включают: + + + + &man.named.8; по умолчанию запускается в каталоге + &man.chroot.2; /var/named. + Это поведение может быть отменено переменной + named_chrootdir в файле + named_chrootdir, + а каталог &man.chroot.2; может быть изменен переменной + named_chrootdir в том же файле. + + + + Когда переменная named_chroot_autoupdate + установлена в YES (это значение по умолчанию), + каталог chroot автоматически настраивается во время загрузки. + Символическая ссылка, которая указывает на + /var/named/etc/namedb, создается как + /etc/namedb, а символическая ссылка, + которая указывает в + /var/named/var/run/named/pid, создается + как /var/run/named/pid. Последнее может + быть отменено переменной named_symlink_enable + в файле rc.conf. + + + + Файл rndc.key создается + автоматически, если еще не существует. + + + Были добавлены скрипты pf и pflog для &man.pf.4;. @@ -1647,6 +1690,9 @@ awk от Bell Labs был обновлен с релиза от 29 июня 2003 года до релиза 7 февраля 2004 года. + BIND был обновлен с версии + 8.3.1-REL до версии 9.3.0. &merged; + Binutils были обновлены до снэпшота от 23 мая 2004 из ветви FSF 2.15. @@ -1695,7 +1741,7 @@ libpcap была обновлена с версии 0.7.1 до версии 0.8.3. - lukemftp + lukemftpd был обновлен с снэпшота от 3 ноября 2003 года до снэпшота от 9 августа 2004 года. ==== //depot/projects/hammer/share/man/man4/polling.4#11 (text+ko) ==== @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $FreeBSD: src/share/man/man4/polling.4,v 1.13 2004/09/18 12:33:01 brueffer Exp $ +.\" $FreeBSD: src/share/man/man4/polling.4,v 1.14 2004/10/11 13:27:44 brueffer Exp $ .\" .Dd April 5, 2004 .Dt POLLING 4 @@ -188,6 +188,7 @@ .Xr rl 4 , .Xr sis 4 , .Xr ste 4 , +.Xr vge 4 , and .Xr vr 4 devices are supported, with others in the works. ==== //depot/projects/hammer/sys/amd64/acpica/acpi_machdep.c#18 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/acpica/acpi_machdep.c,v 1.15 2004/08/16 23:10:18 peter Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/acpica/acpi_machdep.c,v 1.16 2004/10/11 05:39:14 njl Exp $"); #include #include @@ -61,3 +61,9 @@ { return (0); } + +void +acpi_cpu_c1() +{ + __asm __volatile("sti; hlt"); +} ==== //depot/projects/hammer/sys/amd64/include/acpica_machdep.h#12 (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/acpica_machdep.h,v 1.5 2004/05/05 20:04:14 njl Exp $ + * $FreeBSD: src/sys/amd64/include/acpica_machdep.h,v 1.6 2004/10/11 05:39:15 njl Exp $ */ /****************************************************************************** @@ -73,6 +73,7 @@ #define COMPILER_DEPENDENT_INT64 long #define COMPILER_DEPENDENT_UINT64 unsigned long -void acpi_SetDefaultIntrModel(int model); +void acpi_SetDefaultIntrModel(int model); +void acpi_cpu_c1(void); #endif /* __ACPICA_MACHDEP_H__ */ ==== //depot/projects/hammer/sys/arm/conf/SIMICS#3 (text+ko) ==== @@ -15,7 +15,7 @@ # If you are in doubt as to the purpose or necessity of a line, check first # in NOTES. # -# $FreeBSD: src/sys/arm/conf/SIMICS,v 1.3 2004/09/23 22:53:50 cognet Exp $ +# $FreeBSD: src/sys/arm/conf/SIMICS,v 1.4 2004/10/11 14:42:06 cognet Exp $ machine arm ident SIMICS @@ -40,6 +40,7 @@ options UFS_ACL #Support for access control lists options UFS_DIRHASH #Improve performance on big directories options MD_ROOT #MD is a potential root device +options MD_ROOT_SIZE=65535 options ROOTDEVNAME=\"ufs:md0\" options NFSCLIENT #Network Filesystem Client options NFSSERVER #Network Filesystem Server ==== //depot/projects/hammer/sys/arm/sa11x0/assabet_machdep.c#5 (text+ko) ==== @@ -47,7 +47,9 @@ #include -__FBSDID("$FreeBSD: src/sys/arm/sa11x0/assabet_machdep.c,v 1.4 2004/09/23 22:32:33 cognet Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/sa11x0/assabet_machdep.c,v 1.5 2004/10/11 14:41:38 cognet Exp $"); + +#include "opt_md.h" #define _ARM32_BUS_DMA_PRIVATE #include @@ -131,7 +133,9 @@ struct pcpu __pcpu; struct pcpu *pcpup = &__pcpu; -#define MDSIZE 8192 +#ifndef MD_ROOT_SIZE +#error SIMICS needs MD_ROOT and MD_ROOT_SIZE +#endif /* Physical and virtual addresses for some global pages */ vm_paddr_t phys_avail[10]; @@ -218,7 +222,7 @@ fake_preload[i++] = MDROOT_ADDR; fake_preload[i++] = MODINFO_SIZE; fake_preload[i++] = sizeof(uint32_t); - fake_preload[i++] = MDSIZE * 1024; + fake_preload[i++] = MD_ROOT_SIZE * 1024; fake_preload[i++] = 0; fake_preload[i] = 0; preload_metadata = (void *)fake_preload; @@ -236,7 +240,6 @@ kerneldatasize = (u_int32_t)&end - (u_int32_t)KERNEL_TEXT_BASE; symbolsize = 0; freemempos = (vm_offset_t)round_page(physical_freestart); - printf("freemempos %p\n", (void*)freemempos); memset((void *)freemempos, 0, 256*1024); /* Define a macro to simplify memory allocation */ #define valloc_pages(var, np) \ @@ -311,12 +314,10 @@ pmap_map_chunk(l1pagetable, KERNBASE, KERNBASE, (uint32_t)&end - KERNBASE, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); /* Map the stack pages */ - printf("avant irq %p %p\n", (void*)irqstack.pv_va, (void*)irqstack.pv_pa); pmap_map_chunk(l1pagetable, irqstack.pv_va, irqstack.pv_pa, IRQ_STACK_SIZE * PAGE_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); - printf("apres irq\n"); pmap_map_chunk(l1pagetable, md_addr.pv_va, md_addr.pv_pa, - MDSIZE * 1024, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); + MD_ROOT_SIZE * 1024, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); pmap_map_chunk(l1pagetable, abtstack.pv_va, abtstack.pv_pa, ABT_STACK_SIZE * PAGE_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); pmap_map_chunk(l1pagetable, undstack.pv_va, undstack.pv_pa, @@ -365,7 +366,6 @@ * Since the ARM stacks use STMFD etc. we must set r13 to the top end * of the stack memory. */ - printf("init subsystems: stacks\n"); set_stackptr(PSR_IRQ32_MODE, irqstack.pv_va + IRQ_STACK_SIZE * PAGE_SIZE); set_stackptr(PSR_ABT32_MODE, ==== //depot/projects/hammer/sys/dev/acpica/acpi_cmbat.c#19 (text+ko) ==== @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/acpica/acpi_cmbat.c,v 1.36 2004/08/17 18:36:07 njl Exp $ + * $FreeBSD: src/sys/dev/acpica/acpi_cmbat.c,v 1.37 2004/10/11 06:18:07 njl Exp $ */ #include "opt_acpi.h" @@ -189,6 +189,10 @@ goto end; acpi_cmbat_info_updated(&sc->bst_lastupdated); + /* XXX Should we shut down here? */ + if (sc->bst.state & ACPI_BATT_STAT_CRITICAL) + device_printf(dev, "critically low charge!\n"); + end: if (bst_buffer.Pointer != NULL) AcpiOsFree(bst_buffer.Pointer); ==== //depot/projects/hammer/sys/dev/acpica/acpi_cpu.c#25 (text+ko) ==== @@ -26,7 +26,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_cpu.c,v 1.42 2004/08/13 06:21:47 njl Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_cpu.c,v 1.44 2004/10/11 06:06:42 njl Exp $"); #include "opt_acpi.h" #include @@ -43,9 +43,6 @@ #include #include #include -#ifdef __ia64__ -#include -#endif #include #include "acpi.h" @@ -106,8 +103,9 @@ #define ACPI_CPU_NOTIFY_PERF_STATES 0x80 /* _PSS changed. */ #define ACPI_CPU_NOTIFY_CX_STATES 0x81 /* _CST changed. */ -#define CPU_QUIRK_NO_C3 0x0001 /* C3-type states are not usable. */ -#define CPU_QUIRK_NO_THROTTLE 0x0002 /* Throttling is not usable. */ +#define CPU_QUIRK_NO_C3 (1<<0) /* C3-type states are not usable. */ +#define CPU_QUIRK_NO_THROTTLE (1<<1) /* Throttling is not usable. */ +#define CPU_QUIRK_NO_BM_CTRL (1<<2) /* No bus mastering control. */ #define PCI_VENDOR_INTEL 0x8086 #define PCI_DEVICE_82371AB_3 0x7113 /* PIIX4 chipset for quirks. */ @@ -155,7 +153,6 @@ static void acpi_cpu_startup_cx(void); static void acpi_cpu_throttle_set(uint32_t speed); static void acpi_cpu_idle(void); -static void acpi_cpu_c1(void); static void acpi_cpu_notify(ACPI_HANDLE h, UINT32 notify, void *context); static int acpi_cpu_quirks(struct acpi_cpu_softc *sc); static int acpi_cpu_throttle_sysctl(SYSCTL_HANDLER_ARGS); @@ -465,12 +462,16 @@ ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); - /* Bus mastering arbitration control is needed for C3. */ + /* + * Bus mastering arbitration control is needed to keep caches coherent + * while sleeping in C3. If it's not present, we flush the caches before + * entering C3 instead. + */ if (AcpiGbl_FADT->V1_Pm2CntBlk == 0 || AcpiGbl_FADT->Pm2CntLen == 0) { - cpu_quirks |= CPU_QUIRK_NO_C3; + cpu_quirks |= CPU_QUIRK_NO_BM_CTRL; ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "acpi_cpu%d: No BM control, C3 disabled\n", - device_get_unit(sc->cpu_dev))); + "acpi_cpu%d: no BM control, using flush cache method\n", + device_get_unit(sc->cpu_dev))); } /* @@ -856,15 +857,20 @@ * Check for bus master activity. If there was activity, clear * the bit and use the lowest non-C3 state. Note that the USB * driver polling for new devices keeps this bit set all the - * time if USB is loaded. + * time if USB is loaded. If bus mastering control is not available, + * flush caches. This can be quite slow but may be useful since not + * all systems support BM control. */ - AcpiGetRegister(ACPI_BITREG_BUS_MASTER_STATUS, &bm_active, - ACPI_MTX_DO_NOT_LOCK); - if (bm_active != 0) { - AcpiSetRegister(ACPI_BITREG_BUS_MASTER_STATUS, 1, - ACPI_MTX_DO_NOT_LOCK); - cx_next_idx = min(cx_next_idx, cpu_non_c3); - } + if ((cpu_quirks & CPU_QUIRK_NO_BM_CTRL) == 0) { + AcpiGetRegister(ACPI_BITREG_BUS_MASTER_STATUS, &bm_active, + ACPI_MTX_DO_NOT_LOCK); + if (bm_active != 0) { + AcpiSetRegister(ACPI_BITREG_BUS_MASTER_STATUS, 1, + ACPI_MTX_DO_NOT_LOCK); + cx_next_idx = min(cx_next_idx, cpu_non_c3); + } + } else + ACPI_FLUSH_CPU_CACHE(); /* Select the next state and update statistics. */ cx_next = &sc->cpu_cx_states[cx_next_idx]; @@ -907,7 +913,8 @@ AcpiHwLowLevelRead(32, &end_time, &AcpiGbl_FADT->XPmTmrBlk); /* Enable bus master arbitration and disable bus master wakeup. */ - if (cx_next->type == ACPI_STATE_C3) { + if (cx_next->type == ACPI_STATE_C3 && + (cpu_quirks & CPU_QUIRK_NO_BM_CTRL) == 0) { AcpiSetRegister(ACPI_BITREG_ARB_DISABLE, 0, ACPI_MTX_DO_NOT_LOCK); AcpiSetRegister(ACPI_BITREG_BUS_MASTER_RLD, 0, ACPI_MTX_DO_NOT_LOCK); } @@ -918,17 +925,6 @@ ACPI_ENABLE_IRQS(); } -/* Put the CPU in C1 in a machine-dependant way. */ -static void -acpi_cpu_c1() -{ -#ifdef __ia64__ - ia64_call_pal_static(PAL_HALT_LIGHT, 0, 0, 0); -#else - __asm __volatile("sti; hlt"); -#endif -} - /* * Re-evaluate the _PSS and _CST objects when we are notified that they * have changed. @@ -964,7 +960,7 @@ * flushing all caches which is currently too expensive. */ if (mp_ncpus > 1) - cpu_quirks |= CPU_QUIRK_NO_C3; + cpu_quirks |= CPU_QUIRK_NO_BM_CTRL; #ifdef notyet /* Look for various quirks of the PIIX4 part. */ ==== //depot/projects/hammer/sys/dev/fdc/fdc.c#19 (text+ko) ==== @@ -51,7 +51,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/fdc/fdc.c,v 1.295 2004/09/25 08:56:57 phk Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/fdc/fdc.c,v 1.296 2004/10/10 23:39:59 peadar Exp $"); #include "opt_fdc.h" @@ -173,6 +173,7 @@ fd_searchlist_12m, /* FDT_12M */ fd_searchlist_720k, /* FDT_720K */ fd_searchlist_144m, /* FDT_144M */ + fd_searchlist_288m, /* FDT_288M_1 (mapped to FDT_288M) */ fd_searchlist_288m, /* FDT_288M */ }; ==== //depot/projects/hammer/sys/i386/acpica/acpi_machdep.c#20 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/i386/acpica/acpi_machdep.c,v 1.25 2004/07/24 22:41:30 njl Exp $"); +__FBSDID("$FreeBSD: src/sys/i386/acpica/acpi_machdep.c,v 1.27 2004/10/11 05:42:12 njl Exp $"); #include #include @@ -333,20 +333,26 @@ int acpi_machdep_quirks(int *quirks) { - char *va; - int year; + char *va; + int year; + + /* BIOS address 0xffff5 contains the date in the format mm/dd/yy. */ + va = pmap_mapdev(0xffff0, 16); + sscanf(va + 11, "%2d", &year); + pmap_unmapdev((vm_offset_t)va, 16); - /* BIOS address 0xffff5 contains the date in the format mm/dd/yy. */ - va = pmap_mapdev(0xffff0, 16); - sscanf(va + 11, "%2d", &year); - pmap_unmapdev((vm_offset_t)va, 16); + /* + * Date must be >= 1/1/1999 or we don't trust ACPI. Note that this + * check must be changed by my 114th birthday. + */ + if (year > 90 && year < 99) + *quirks = ACPI_Q_BROKEN; - /* - * Date must be >= 1/1/1999 or we don't trust ACPI. Note that this - * check must be changed by my 114th birthday. - */ - if (year > 90 && year < 99) - *quirks = ACPI_Q_BROKEN; + return (0); +} - return (0); +void +acpi_cpu_c1() +{ + __asm __volatile("sti; hlt"); } ==== //depot/projects/hammer/sys/i386/include/acpica_machdep.h#6 (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/i386/include/acpica_machdep.h,v 1.6 2004/05/05 20:04:14 njl Exp $ + * $FreeBSD: src/sys/i386/include/acpica_machdep.h,v 1.7 2004/10/11 05:39:15 njl Exp $ */ /****************************************************************************** @@ -93,6 +93,7 @@ #define COMPILER_DEPENDENT_UINT64 unsigned long long #define ACPI_USE_NATIVE_DIVIDE -void acpi_SetDefaultIntrModel(int model); +void acpi_SetDefaultIntrModel(int model); +void acpi_cpu_c1(void); #endif /* __ACPICA_MACHDEP_H__ */ ==== //depot/projects/hammer/sys/i386/isa/pbio.c#2 (text+ko) ==== @@ -29,7 +29,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/i386/isa/pbio.c,v 1.4 2004/10/10 03:26:20 imp Exp $"); +__FBSDID("$FreeBSD: src/sys/i386/isa/pbio.c,v 1.5 2004/10/11 00:58:24 imp Exp $"); #include #include @@ -113,7 +113,6 @@ * One of these per allocated device */ struct pbio_softc { - int iobase; /* I/O base */ struct portdata pd[PBIO_NPORTS];/* Per port data */ int iomode; /* Virtualized I/O mode port value */ /* The real port is write-only */ @@ -186,7 +185,7 @@ /* Set all ports to output */ pboutb(scp, PBIO_CFG, 0x80); printf("pbio val(CFG: 0x%03x)=0x%02x (should be 0x80)\n", - iobase, pbinb(scp, PBIO_CFG)); + rman_get_start(scp->res), pbinb(scp, PBIO_CFG)); pboutb(scp, PBIO_PORTA, 0xa5); val = pbinb(scp, PBIO_PORTA); printf("pbio val=0x%02x (should be 0xa5)\n", val); @@ -221,7 +220,6 @@ int i; int rid; struct pbio_softc *sc; - int flags, i, iobase, rid, unit; sc = device_get_softc(dev); unit = device_get_unit(dev); @@ -403,7 +401,7 @@ pbiowrite(struct cdev *dev, struct uio *uio, int ioflag) { struct pbio_softc *scp; - int i, iobase, port, ret, towrite, unit; + int i, port, ret, towrite, unit; char val, oval; unit = UNIT(dev); ==== //depot/projects/hammer/sys/ia64/acpica/acpi_machdep.c#5 (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/ia64/acpica/acpi_machdep.c,v 1.4 2004/06/30 04:42:29 njl Exp $ + * $FreeBSD: src/sys/ia64/acpica/acpi_machdep.c,v 1.5 2004/10/11 05:39:14 njl Exp $ */ #include @@ -31,6 +31,7 @@ #include "acpi.h" #include +#include int acpi_machdep_init(device_t dev) @@ -49,3 +50,9 @@ { return (0); } + +void +acpi_cpu_c1() +{ + ia64_call_pal_static(PAL_HALT_LIGHT, 0, 0, 0); +} ==== //depot/projects/hammer/sys/ia64/include/acpica_machdep.h#4 (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/ia64/include/acpica_machdep.h,v 1.3 2004/05/05 20:04:14 njl Exp $ + * $FreeBSD: src/sys/ia64/include/acpica_machdep.h,v 1.4 2004/10/11 05:39:15 njl Exp $ */ /****************************************************************************** @@ -75,4 +75,6 @@ #define COMPILER_DEPENDENT_INT64 long #define COMPILER_DEPENDENT_UINT64 unsigned long +void acpi_cpu_c1(void); + #endif /* __ACPICA_MACHDEP_H__ */ ==== //depot/projects/hammer/sys/kern/subr_witness.c#35 (text+ko) ==== @@ -82,7 +82,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/subr_witness.c,v 1.181 2004/10/09 08:16:37 green Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/subr_witness.c,v 1.182 2004/10/11 08:26:18 rwatson Exp $"); #include "opt_ddb.h" #include "opt_witness.h" @@ -352,8 +352,7 @@ { "turnstile chain", &lock_class_mtx_spin }, { "td_contested", &lock_class_mtx_spin }, { "callout", &lock_class_mtx_spin }, - { "entropy harvest", &lock_class_mtx_spin }, - { "entropy harvest buffers", &lock_class_mtx_spin }, + { "entropy harvest mutex", &lock_class_mtx_spin }, /* * leaf locks */ ==== //depot/projects/hammer/sys/kern/uipc_socket.c#39 (text+ko) ==== @@ -32,7 +32,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/uipc_socket.c,v 1.212 2004/09/05 14:33:21 rwatson Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/uipc_socket.c,v 1.213 2004/10/11 08:11:26 rwatson Exp $"); #include "opt_inet.h" #include "opt_mac.h" @@ -316,22 +316,34 @@ return (0); } +/* + * Attempt to free a socket. This should really be sotryfree(). + * + * We free the socket if the protocol is no longer interested in the socket, + * there's no file descriptor reference, and the refcount is 0. While the + * calling macro sotryfree() tests the refcount, sofree() has to test it + * again as it's possible to race with an accept()ing thread if the socket is + * in an listen queue of a listen socket, as being in the listen queue + * doesn't elevate the reference count. sofree() acquires the accept mutex + * early for this test in order to avoid that race. + */ void sofree(so) struct socket *so; { struct socket *head; - KASSERT(so->so_count == 0, ("socket %p so_count not 0", so)); - SOCK_LOCK_ASSERT(so); + SOCK_UNLOCK(so); + ACCEPT_LOCK(); + SOCK_LOCK(so); - if (so->so_pcb != NULL || (so->so_state & SS_NOFDREF) == 0) { + if (so->so_pcb != NULL || (so->so_state & SS_NOFDREF) == 0 || + so->so_count != 0) { SOCK_UNLOCK(so); + ACCEPT_UNLOCK(); return; } - SOCK_UNLOCK(so); - ACCEPT_LOCK(); head = so->so_head; if (head != NULL) { KASSERT((so->so_qstate & SQ_COMP) != 0 || @@ -353,6 +365,7 @@ * the listening socket is closed. */ if ((so->so_qstate & SQ_COMP) != 0) { + SOCK_UNLOCK(so); ACCEPT_UNLOCK(); return; } @@ -365,6 +378,7 @@ (so->so_qstate & SQ_INCOMP) == 0, ("sofree: so_head == NULL, but still SQ_COMP(%d) or SQ_INCOMP(%d)", so->so_qstate & SQ_COMP, so->so_qstate & SQ_INCOMP)); + SOCK_UNLOCK(so); ACCEPT_UNLOCK(); SOCKBUF_LOCK(&so->so_snd); so->so_snd.sb_flags |= SB_NOINTR; ==== //depot/projects/hammer/sys/net/if_ethersubr.c#33 (text+ko) ==== @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * @(#)if_ethersubr.c 8.1 (Berkeley) 6/10/93 - * $FreeBSD: src/sys/net/if_ethersubr.c,v 1.177 2004/07/27 23:20:45 rwatson Exp $ + * $FreeBSD: src/sys/net/if_ethersubr.c,v 1.178 2004/10/11 10:21:34 rwatson Exp $ */ #include "opt_atalk.h" @@ -614,10 +614,10 @@ } } - ether_demux(ifp, m); /* First chunk of an mbuf contains good entropy */ if (harvest.ethernet) random_harvest(m, 16, 3, 0, RANDOM_NET); + ether_demux(ifp, m); } /* ==== //depot/projects/hammer/sys/net/if_tun.c#20 (text+ko) ==== @@ -13,7 +13,7 @@ * UCL. This driver is based much more on read/write/poll mode of * operation though. * - * $FreeBSD: src/sys/net/if_tun.c,v 1.144 2004/07/15 08:26:06 phk Exp $ + * $FreeBSD: src/sys/net/if_tun.c,v 1.145 2004/10/11 07:28:36 glebius Exp $ */ #include "opt_atalk.h" @@ -765,7 +765,7 @@ return (ENOBUFS); mlen = MHLEN; - top = 0; + top = NULL; mp = ⊤ while (error == 0 && uio->uio_resid > 0) { m->m_len = min(mlen, uio->uio_resid); ==== //depot/projects/hammer/usr.sbin/moused/moused.8#8 (text+ko) ==== @@ -28,7 +28,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $FreeBSD: src/usr.sbin/moused/moused.8,v 1.46 2004/08/03 18:43:45 philip Exp $ +.\" $FreeBSD: src/usr.sbin/moused/moused.8,v 1.47 2004/10/11 07:57:08 philip Exp $ .\" .Dd April 1, 2000 .Dt MOUSED 8 @@ -43,6 +43,7 @@ .Op Fl F Ar rate .Op Fl r Ar resolution .Op Fl S Ar baudrate +.Op Fl V Op Fl U Ar distance .Op Fl a Ar X Ns Op , Ns Ar Y .Op Fl C Ar threshold .Op Fl m Ar N=M @@ -156,6 +157,12 @@ .It Fl S Ar baudrate Select the baudrate for the serial port (1200 to 9600). Not all serial mice support this option. +.It Fl V +Enable ``Virtual Scrolling'', with this option set, holding the middle mouse +button down will cause motion to be interpreted as scrolling. Use the +.Fl U +option to set the distance the mouse must move before the scrolling mode is +activated. .It Fl a Ar X Ns Op , Ns Ar Y Accelerate or decelerate the mouse input. This is a linear acceleration only. ==== //depot/projects/hammer/usr.sbin/moused/moused.c#9 (text+ko) ==== @@ -45,7 +45,7 @@ **/ #include -__FBSDID("$FreeBSD: src/usr.sbin/moused/moused.c,v 1.67 2004/08/03 18:43:45 philip Exp $"); +__FBSDID("$FreeBSD: src/usr.sbin/moused/moused.c,v 1.68 2004/10/11 07:57:08 philip Exp $"); #include #include @@ -76,6 +76,7 @@ #define MAX_BUTTON2TIMEOUT 2000 /* 2 seconds */ #define DFLT_CLICKTHRESHOLD 500 /* 0.5 second */ #define DFLT_BUTTON2TIMEOUT 100 /* 0.1 second */ +#define DFLT_SCROLLTHRESHOLD 3 /* 3 pixels */ /* Abort 3-button emulation delay after this many movement events. */ #define BUTTON2_MAXMOVE 3 @@ -97,11 +98,12 @@ #define ClearDTR 0x0004 #define ClearRTS 0x0008 #define NoPnP 0x0010 +#define VirtualScroll 0x0020 #define ID_NONE 0 #define ID_PORT 1 #define ID_IF 2 -#define ID_TYPE 4 +#define ID_TYPE 4 #define ID_MODEL 8 #define ID_ALL (ID_PORT | ID_IF | ID_TYPE | ID_MODEL) @@ -159,6 +161,13 @@ int extioctl = FALSE; char *pidfile = "/var/run/moused.pid"; +#define SCROLL_NOTSCROLLING 0 +#define SCROLL_PREPARE 1 +#define SCROLL_SCROLLING 2 + +static int scroll_state; +static int scroll_movement; + /* local variables */ /* interface (the table must be ordered by MOUSE_IF_XXX in mouse.h) */ @@ -380,6 +389,7 @@ mousemode_t mode; /* protocol information */ float accelx; /* Acceleration in the X axis */ float accely; /* Acceleration in the Y axis */ + int scrollthreshold; /* Movement distance before virtual scrolling */ } rodent = { .flags = 0, .portname = NULL, @@ -398,6 +408,7 @@ .button2timeout = DFLT_BUTTON2TIMEOUT, .accelx = 1.0, .accely = 1.0, + .scrollthreshold = DFLT_SCROLLTHRESHOLD, }; /* button status */ @@ -509,7 +520,7 @@ for (i = 0; i < MOUSE_MAXBUTTON; ++i) mstate[i] = &bstate[i]; - while ((c = getopt(argc, argv, "3C:DE:F:I:PRS:a:cdfhi:l:m:p:r:st:w:z:")) != -1) + while ((c = getopt(argc, argv, "3C:DE:F:I:PRS:VU:a:cdfhi:l:m:p:r:st:w:z:")) != -1) switch(c) { case '3': @@ -714,6 +725,17 @@ warnx("no such mouse type `%s'", optarg); usage(); + case 'V': + rodent.flags |= VirtualScroll; + break; + case 'U': + rodent.scrollthreshold = atoi(optarg); + if (rodent.scrollthreshold < 0) { + warnx("invalid argument `%s'", optarg); + usage(); + } + break; + case 'h': case '?': default: @@ -967,6 +989,50 @@ } if ((flags = r_protocol(b, &action0)) == 0) continue; + + if (rodent.flags & VirtualScroll) { + /* Allow middle button drags to scroll up and down */ + if (action0.button == MOUSE_BUTTON2DOWN) { + if (scroll_state == SCROLL_NOTSCROLLING) { + scroll_state = SCROLL_PREPARE; + debug("PREPARING TO SCROLL"); + } + debug("[BUTTON2] flags:%08x buttons:%08x obuttons:%08x", + action.flags, action.button, action.obutton); + } else { + debug("[NOTBUTTON2] flags:%08x buttons:%08x obuttons:%08x", + action.flags, action.button, action.obutton); + + /* This isn't a middle button down... move along... */ + if (scroll_state == SCROLL_SCROLLING) { + /* + * We were scrolling, someone let go of button 2. + * Now turn autoscroll off. + */ + scroll_state = SCROLL_NOTSCROLLING; + debug("DONE WITH SCROLLING / %d", scroll_state); + } else if (scroll_state == SCROLL_PREPARE) { + mousestatus_t newaction = action0; + + /* We were preparing to scroll, but we never moved... */ + r_timestamp(&action0); + r_statetrans(&action0, &newaction, + A(newaction.button & MOUSE_BUTTON1DOWN, + action0.button & MOUSE_BUTTON3DOWN)); + + /* Send middle down */ + newaction.button = MOUSE_BUTTON2DOWN; + r_click(&newaction); + + /* Send middle up */ + r_timestamp(&newaction); + newaction.obutton = newaction.button; + newaction.button = action0.button; + r_click(&newaction); + } + } + } + r_timestamp(&action0); r_statetrans(&action0, &action, A(action0.button & MOUSE_BUTTON1DOWN, @@ -984,8 +1050,41 @@ debug("activity : buttons 0x%08x dx %d dy %d dz %d", action2.button, action2.dx, action2.dy, action2.dz); + if (rodent.flags & VirtualScroll) { + /* + * If *only* the middle button is pressed AND we are moving + * the stick/trackpoint/nipple, scroll! + */ + if (scroll_state == SCROLL_PREPARE) { + /* Ok, Set we're really scrolling now.... */ + if (action2.dy || action2.dx) + scroll_state = SCROLL_SCROLLING; + } + if (scroll_state == SCROLL_SCROLLING) { + scroll_movement += action2.dy; + debug("SCROLL: %d", scroll_movement); + + if (scroll_movement < -rodent.scrollthreshold) { + /* Scroll down */ + action2.dz = -1; + scroll_movement = 0; + } + else if (scroll_movement > rodent.scrollthreshold) { + /* Scroll up */ + action2.dz = 1; >>> TRUNCATED FOR MAIL (1000 lines) <<<