dtrace_subr.c (223758) | dtrace_subr.c (236566) |
---|---|
1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License, Version 1.0 only 6 * (the "License"). You may not use this file except in compliance 7 * with the License. 8 * --- 5 unchanged lines hidden (view full) --- 14 * When distributing Covered Code, include this CDDL HEADER in each 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16 * If applicable, add the following below this CDDL HEADER, with the 17 * fields enclosed by brackets "[]" replaced with your own identifying 18 * information: Portions Copyright [yyyy] [name of copyright owner] 19 * 20 * CDDL HEADER END 21 * | 1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License, Version 1.0 only 6 * (the "License"). You may not use this file except in compliance 7 * with the License. 8 * --- 5 unchanged lines hidden (view full) --- 14 * When distributing Covered Code, include this CDDL HEADER in each 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16 * If applicable, add the following below this CDDL HEADER, with the 17 * fields enclosed by brackets "[]" replaced with your own identifying 18 * information: Portions Copyright [yyyy] [name of copyright owner] 19 * 20 * CDDL HEADER END 21 * |
22 * $FreeBSD: head/sys/cddl/dev/dtrace/i386/dtrace_subr.c 223758 2011-07-04 12:04:52Z attilio $ | 22 * $FreeBSD: head/sys/cddl/dev/dtrace/i386/dtrace_subr.c 236566 2012-06-04 16:04:01Z zml $ |
23 * 24 */ 25/* 26 * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 27 * Use is subject to license terms. 28 */ 29 30#include <sys/param.h> --- 411 unchanged lines hidden (view full) --- 442 uint32_t hi; 443 444 /* 445 * We split TSC value into lower and higher 32-bit halves and separately 446 * scale them with nsec_scale, then we scale them down by 2^28 447 * (see nsec_scale calculations) taking into account 32-bit shift of 448 * the higher half and finally add. 449 */ | 23 * 24 */ 25/* 26 * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 27 * Use is subject to license terms. 28 */ 29 30#include <sys/param.h> --- 411 unchanged lines hidden (view full) --- 442 uint32_t hi; 443 444 /* 445 * We split TSC value into lower and higher 32-bit halves and separately 446 * scale them with nsec_scale, then we scale them down by 2^28 447 * (see nsec_scale calculations) taking into account 32-bit shift of 448 * the higher half and finally add. 449 */ |
450 tsc = rdtsc() + tsc_skew[curcpu]; | 450 tsc = rdtsc() - tsc_skew[curcpu]; |
451 lo = tsc; 452 hi = tsc >> 32; 453 return (((lo * nsec_scale) >> SCALE_SHIFT) + 454 ((hi * nsec_scale) << (32 - SCALE_SHIFT))); 455} 456 457uint64_t 458dtrace_gethrestime(void) --- 57 unchanged lines hidden --- | 451 lo = tsc; 452 hi = tsc >> 32; 453 return (((lo * nsec_scale) >> SCALE_SHIFT) + 454 ((hi * nsec_scale) << (32 - SCALE_SHIFT))); 455} 456 457uint64_t 458dtrace_gethrestime(void) --- 57 unchanged lines hidden --- |