From owner-p4-projects@FreeBSD.ORG Fri Nov 14 14:38:10 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3115916A4D0; Fri, 14 Nov 2003 14:38:10 -0800 (PST) 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 0B74516A4CE for ; Fri, 14 Nov 2003 14:38:10 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3B6D343FEC for ; Fri, 14 Nov 2003 14:38:08 -0800 (PST) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.9/8.12.9) with ESMTP id hAEMc7XJ080586 for ; Fri, 14 Nov 2003 14:38:08 -0800 (PST) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.9/8.12.9/Submit) id hAEMc7hj080583 for perforce@freebsd.org; Fri, 14 Nov 2003 14:38:07 -0800 (PST) (envelope-from peter@freebsd.org) Date: Fri, 14 Nov 2003 14:38:07 -0800 (PST) Message-Id: <200311142238.hAEMc7hj080583@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 42397 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: Fri, 14 Nov 2003 22:38:10 -0000 X-List-Received-Date: Fri, 14 Nov 2003 22:38:10 -0000 http://perforce.freebsd.org/chv.cgi?CH=42397 Change 42397 by peter@peter_daintree on 2003/11/14 14:37:09 IFC @42396 Affected files ... .. //depot/projects/hammer/sys/amd64/include/clock.h#10 integrate .. //depot/projects/hammer/sys/amd64/isa/clock.c#13 integrate .. //depot/projects/hammer/sys/i386/acpica/madt.c#5 integrate .. //depot/projects/hammer/sys/i386/i386/mptable.c#6 integrate .. //depot/projects/hammer/sys/i386/include/apicvar.h#5 integrate .. //depot/projects/hammer/sys/i386/include/mptable.h#2 integrate Differences ... ==== //depot/projects/hammer/sys/amd64/include/clock.h#10 (text+ko) ==== @@ -3,7 +3,7 @@ * Garrett Wollman, September 1994. * This file is in the public domain. * - * $FreeBSD: src/sys/amd64/include/clock.h,v 1.47 2003/09/30 06:38:11 peter Exp $ + * $FreeBSD: src/sys/amd64/include/clock.h,v 1.48 2003/11/14 22:34:43 peter Exp $ */ #ifndef _MACHINE_CLOCK_H_ @@ -31,10 +31,6 @@ */ struct clockframe; -#ifndef BURN_BRIDGES -int acquire_timer0(int rate, void (*function)(struct clockframe *frame)); -int release_timer0(void); -#endif int acquire_timer2(int mode); int release_timer2(void); int rtcin(int val); ==== //depot/projects/hammer/sys/amd64/isa/clock.c#13 (text+ko) ==== @@ -37,7 +37,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/isa/clock.c,v 1.204 2003/09/30 06:42:47 peter Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/isa/clock.c,v 1.205 2003/11/14 22:34:43 peter Exp $"); /* * Routines to handle clock hardware. @@ -94,24 +94,6 @@ #define TIMER_DIV(x) ((timer_freq + (x) / 2) / (x)) -#ifndef BURN_BRIDGES -/* - * Time in timer cycles that it takes for microtime() to disable interrupts - * and latch the count. microtime() currently uses "cli; outb ..." so it - * normally takes less than 2 timer cycles. Add a few for cache misses. - * Add a few more to allow for latency in bogus calls to microtime() with - * interrupts already disabled. - */ -#define TIMER0_LATCH_COUNT 20 - -/* - * Maximum frequency that we are willing to allow for timer0. Must be - * low enough to guarantee that the timer interrupt handler returns - * before the next timer interrupt. - */ -#define TIMER0_MAX_FREQ 20000 -#endif - int adjkerntz; /* local offset from GMT in seconds */ int clkintr_pending; int disable_rtc_set; /* disable resettodr() if != 0 */ @@ -132,19 +114,6 @@ static u_int32_t i8254_lastcount; static u_int32_t i8254_offset; static int i8254_ticked; -static struct intsrc *i8254_intsrc; -#ifndef BURN_BRIDGES -/* - * XXX new_function and timer_func should not handle clockframes, but - * timer_func currently needs to hold hardclock to handle the - * timer0_state == 0 case. We should use inthand_add()/inthand_remove() - * to switch between clkintr() and a slightly different timerintr(). - */ -static void (*new_function)(struct clockframe *frame); -static u_int new_rate; -static u_int timer0_prescaler_count; -static u_char timer0_state; -#endif static u_char rtc_statusa = RTCSA_DIVIDER | RTCSA_NOPROF; static u_char rtc_statusb = RTCSB_24HR | RTCSB_PINTR; @@ -184,103 +153,8 @@ clkintr_pending = 0; mtx_unlock_spin(&clock_lock); } - timer_func(frame); -#ifdef SMP - if (timer_func == hardclock) - forward_hardclock(); -#endif -#ifndef BURN_BRIDGES - switch (timer0_state) { - - case RELEASED: - break; - - case ACQUIRED: - if ((timer0_prescaler_count += timer0_max_count) - >= hardclock_max_count) { - timer0_prescaler_count -= hardclock_max_count; - hardclock(frame); -#ifdef SMP - forward_hardclock(); -#endif - } - break; - - case ACQUIRE_PENDING: - mtx_lock_spin(&clock_lock); - i8254_offset = i8254_get_timecount(NULL); - i8254_lastcount = 0; - timer0_max_count = TIMER_DIV(new_rate); - outb(TIMER_MODE, TIMER_SEL0 | TIMER_RATEGEN | TIMER_16BIT); - outb(TIMER_CNTR0, timer0_max_count & 0xff); - outb(TIMER_CNTR0, timer0_max_count >> 8); - mtx_unlock_spin(&clock_lock); - timer_func = new_function; - timer0_state = ACQUIRED; - break; - - case RELEASE_PENDING: - if ((timer0_prescaler_count += timer0_max_count) - >= hardclock_max_count) { - mtx_lock_spin(&clock_lock); - i8254_offset = i8254_get_timecount(NULL); - i8254_lastcount = 0; - timer0_max_count = hardclock_max_count; - outb(TIMER_MODE, - TIMER_SEL0 | TIMER_RATEGEN | TIMER_16BIT); - outb(TIMER_CNTR0, timer0_max_count & 0xff); - outb(TIMER_CNTR0, timer0_max_count >> 8); - mtx_unlock_spin(&clock_lock); - timer0_prescaler_count = 0; - timer_func = hardclock; - timer0_state = RELEASED; - hardclock(frame); -#ifdef SMP - forward_hardclock(); -#endif - } - break; - } -#endif -} - -#ifndef BURN_BRIDGES -/* - * The acquire and release functions must be called at ipl >= splclock(). - */ -int -acquire_timer0(int rate, void (*function)(struct clockframe *frame)) -{ - static int old_rate; - - if (rate <= 0 || rate > TIMER0_MAX_FREQ) - return (-1); - switch (timer0_state) { - - case RELEASED: - timer0_state = ACQUIRE_PENDING; - break; - - case RELEASE_PENDING: - if (rate != old_rate) - return (-1); - /* - * The timer has been released recently, but is being - * re-acquired before the release completed. In this - * case, we simply reclaim it as if it had not been - * released at all. - */ - timer0_state = ACQUIRED; - break; - - default: - return (-1); /* busy */ - } - new_function = function; - old_rate = new_rate = rate; - return (0); + timer_func(&frame); } -#endif int acquire_timer2(int mode) @@ -302,29 +176,7 @@ return (0); } -#ifndef BURN_BRIDGES int -release_timer0() -{ - switch (timer0_state) { - - case ACQUIRED: - timer0_state = RELEASE_PENDING; - break; - - case ACQUIRE_PENDING: - /* Nothing happened yet, release quickly. */ - timer0_state = RELEASED; - break; - - default: - return (-1); - } - return (0); -} -#endif - -int release_timer2() { @@ -942,10 +794,6 @@ freq = timer_freq; error = sysctl_handle_int(oidp, &freq, sizeof(freq), req); if (error == 0 && req->newptr != NULL) { -#ifndef BURN_BRIDGES - if (timer0_state != RELEASED) - return (EBUSY); /* too much trouble to handle */ -#endif set_timer_freq(freq, hz); i8254_timecounter.tc_frequency = freq; } ==== //depot/projects/hammer/sys/i386/acpica/madt.c#5 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/i386/acpica/madt.c,v 1.6 2003/11/11 18:20:10 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/i386/acpica/madt.c,v 1.7 2003/11/14 22:26:29 peter Exp $"); #include #include @@ -200,7 +200,9 @@ */ if (AcpiOsGetRootPointer(ACPI_LOGICAL_ADDRESSING, &rsdp_ptr) != AE_OK) return (ENXIO); +#ifdef __i386__ KASSERT(rsdp_ptr.Pointer.Physical < KERNLOAD, ("RSDP too high")); +#endif rsdp = pmap_mapdev(rsdp_ptr.Pointer.Physical, sizeof(RSDP_DESCRIPTOR)); if (rsdp == NULL) { if (bootverbose) @@ -308,8 +310,8 @@ madt = pmap_mapdev(madt_physaddr, madt_length); lapic_init((uintptr_t)madt->LocalApicAddress); printf("ACPI APIC Table: <%.*s %.*s>\n", - sizeof(madt->Header.OemId), madt->Header.OemId, - sizeof(madt->Header.OemTableId), madt->Header.OemTableId); + (int)sizeof(madt->Header.OemId), madt->Header.OemId, + (int)sizeof(madt->Header.OemTableId), madt->Header.OemTableId); /* * We ignore 64-bit local APIC override entries. Should we @@ -419,7 +421,7 @@ if (bootverbose) printf("MADT: Found IO APIC ID %d, Vector %d at %p\n", apic->IoApicId, apic->Vector, - (void *)apic->IoApicAddress); + (void *)(uintptr_t)apic->IoApicAddress); if (apic->IoApicId >= NIOAPICS) panic("%s: I/O APIC ID %d too high", __func__, apic->IoApicId); ==== //depot/projects/hammer/sys/i386/i386/mptable.c#6 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/i386/i386/mptable.c,v 1.226 2003/11/14 20:51:07 peter Exp $"); +__FBSDID("$FreeBSD: src/sys/i386/i386/mptable.c,v 1.227 2003/11/14 22:29:21 peter Exp $"); #include "opt_mptable_force_htt.h" #include @@ -321,8 +321,8 @@ printf("Preset Config %d", mpfps->config_type); } else { lapic_init((uintptr_t)mpct->apic_address); - printf("%.*s %.*s", sizeof(mpct->oem_id), mpct->oem_id, - sizeof(mpct->product_id), mpct->product_id); + printf("%.*s %.*s", (int)sizeof(mpct->oem_id), mpct->oem_id, + (int)sizeof(mpct->product_id), mpct->product_id); } printf(">\n"); return (0); ==== //depot/projects/hammer/sys/i386/include/apicvar.h#5 (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/i386/include/apicvar.h,v 1.4 2003/11/14 19:10:13 jhb Exp $ + * $FreeBSD: src/sys/i386/include/apicvar.h,v 1.5 2003/11/14 22:21:30 peter Exp $ */ #ifndef _MACHINE_APICVAR_H_ @@ -40,7 +40,7 @@ * Layout of local APIC interrupt vectors: * * 0xff (255) +-------------+ - * | | 15 (Spurious / IPIs / Local Interrupts ) + * | | 15 (Spurious / IPIs / Local Interrupts) * 0xf0 (240) +-------------+ * | | 14 (I/O Interrupts) * 0xe0 (224) +-------------+ ==== //depot/projects/hammer/sys/i386/include/mptable.h#2 (text+ko) ==== @@ -22,7 +22,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/i386/include/mptable.h,v 1.220 2003/11/03 22:12:37 jhb Exp $ + * $FreeBSD: src/sys/i386/include/mptable.h,v 1.221 2003/11/14 22:23:30 peter Exp $ */ #ifndef __MACHINE_MPTABLE_H__ @@ -41,7 +41,7 @@ /* MP Floating Pointer Structure */ typedef struct MPFPS { char signature[4]; - void *pap; + u_int32_t pap; u_char length; u_char spec_rev; u_char checksum; @@ -63,10 +63,10 @@ u_char checksum; u_char oem_id[8]; u_char product_id[12]; - void *oem_table_pointer; + u_int32_t oem_table_pointer; u_short oem_table_size; u_short entry_count; - void *apic_address; + u_int32_t apic_address; u_short extended_table_length; u_char extended_table_checksum; u_char reserved; @@ -103,7 +103,7 @@ u_char apic_id; u_char apic_version; u_char apic_flags; - void *apic_address; + u_int32_t apic_address; } *io_apic_entry_ptr; #define IOAPICENTRY_FLAG_EN 0x01