From owner-p4-projects@FreeBSD.ORG Tue Apr 20 17:41:00 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0911816A4D0; Tue, 20 Apr 2004 17:41:00 -0700 (PDT) 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 BD7DE16A4CE for ; Tue, 20 Apr 2004 17:40:59 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id B640B43D39 for ; Tue, 20 Apr 2004 17:40:59 -0700 (PDT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i3L0exGe045973 for ; Tue, 20 Apr 2004 17:40:59 -0700 (PDT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i3L0exoi045969 for perforce@freebsd.org; Tue, 20 Apr 2004 17:40:59 -0700 (PDT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Tue, 20 Apr 2004 17:40:59 -0700 (PDT) Message-Id: <200404210040.i3L0exoi045969@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Subject: PERFORCE change 51489 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: Wed, 21 Apr 2004 00:41:00 -0000 http://perforce.freebsd.org/chv.cgi?CH=51489 Change 51489 by rwatson@rwatson_paprika on 2004/04/20 17:40:45 Integrate netperf_socket: - More ACPI madness. Affected files ... .. //depot/projects/netperf_socket/sys/dev/acpica/acpi.c#15 integrate .. //depot/projects/netperf_socket/sys/dev/acpica/acpi_cpu.c#6 integrate .. //depot/projects/netperf_socket/sys/dev/acpica/acpivar.h#9 integrate Differences ... ==== //depot/projects/netperf_socket/sys/dev/acpica/acpi.c#15 (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/dev/acpica/acpi.c,v 1.139 2004/04/16 16:27:37 njl Exp $ + * $FreeBSD: src/sys/dev/acpica/acpi.c,v 1.140 2004/04/21 00:36:15 njl Exp $ */ #include "opt_acpi.h" @@ -1372,6 +1372,21 @@ } } +/* Find the difference between two PM tick counts. */ +uint32_t +acpi_TimerDelta(uint32_t end, uint32_t start) +{ + uint32_t delta; + + if (end >= start) + delta = end - start; + else if (AcpiGbl_FADT->TmrValExt == 0) + delta = (((0x00FFFFFF - start) + end + 1) & 0x00FFFFFF); + else + delta = ((0xFFFFFFFF - start) + end + 1); + return (delta); +} + /* * Allocate a buffer with a preset data size. */ ==== //depot/projects/netperf_socket/sys/dev/acpica/acpi_cpu.c#6 (text+ko) ==== @@ -26,7 +26,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_cpu.c,v 1.33 2004/04/09 18:14:32 njl Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_cpu.c,v 1.34 2004/04/21 00:36:15 njl Exp $"); #include "opt_acpi.h" #include @@ -160,7 +160,6 @@ static void acpi_cpu_throttle_set(uint32_t speed); static void acpi_cpu_idle(void); static void acpi_cpu_c1(void); -static void acpi_pm_ticksub(uint32_t *end, const uint32_t *start); 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); @@ -875,7 +874,7 @@ } /* Find the actual time asleep in microseconds, minus overhead. */ - acpi_pm_ticksub(&end_time, &start_time); + end_time = acpi_TimerDelta(end_time, start_time); asleep = PM_USEC(end_time) - cx_next->trans_lat; /* Record statistics */ @@ -915,18 +914,6 @@ #endif } -/* Find the difference between two PM tick counts. */ -static void -acpi_pm_ticksub(uint32_t *end, const uint32_t *start) -{ - if (*end >= *start) - *end = *end - *start; - else if (AcpiGbl_FADT->TmrValExt == 0) - *end = (((0x00FFFFFF - *start) + *end + 1) & 0x00FFFFFF); - else - *end = ((0xFFFFFFFF - *start) + *end + 1); -} - /* * Re-evaluate the _PSS and _CST objects when we are notified that they * have changed. ==== //depot/projects/netperf_socket/sys/dev/acpica/acpivar.h#9 (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/acpivar.h,v 1.61 2004/04/14 03:39:08 njl Exp $ + * $FreeBSD: src/sys/dev/acpica/acpivar.h,v 1.62 2004/04/21 00:36:15 njl Exp $ */ #include "bus_if.h" @@ -233,6 +233,7 @@ extern BOOLEAN acpi_MatchHid(device_t dev, char *hid); extern ACPI_STATUS acpi_GetHandleInScope(ACPI_HANDLE parent, char *path, ACPI_HANDLE *result); +extern uint32_t acpi_TimerDelta(uint32_t end, uint32_t start); extern ACPI_BUFFER *acpi_AllocBuffer(int size); extern ACPI_STATUS acpi_ConvertBufferToInteger(ACPI_BUFFER *bufp, UINT32 *number);