dtrace_subr.c (218909) | dtrace_subr.c (220433) |
---|---|
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/amd64/dtrace_subr.c 218909 2011-02-21 09:01:34Z brucec $ | 22 * $FreeBSD: head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c 220433 2011-04-07 23:28:28Z jkim $ |
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> --- 367 unchanged lines hidden (view full) --- 398 int i; 399 400 /* 401 * Get TSC frequency known at this moment. 402 * This should be constant if TSC is invariant. 403 * Otherwise tick->time conversion will be inaccurate, but 404 * will preserve monotonic property of TSC. 405 */ | 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> --- 367 unchanged lines hidden (view full) --- 398 int i; 399 400 /* 401 * Get TSC frequency known at this moment. 402 * This should be constant if TSC is invariant. 403 * Otherwise tick->time conversion will be inaccurate, but 404 * will preserve monotonic property of TSC. 405 */ |
406 tsc_f = tsc_freq; | 406 tsc_f = atomic_load_acq_64(&tsc_freq); |
407 408 /* 409 * The following line checks that nsec_scale calculated below 410 * doesn't overflow 32-bit unsigned integer, so that it can multiply 411 * another 32-bit integer without overflowing 64-bit. 412 * Thus minimum supported TSC frequency is 62.5MHz. 413 */ 414 KASSERT(tsc_f > (NANOSEC >> (32 - SCALE_SHIFT)), ("TSC frequency is too low")); --- 122 unchanged lines hidden --- | 407 408 /* 409 * The following line checks that nsec_scale calculated below 410 * doesn't overflow 32-bit unsigned integer, so that it can multiply 411 * another 32-bit integer without overflowing 64-bit. 412 * Thus minimum supported TSC frequency is 62.5MHz. 413 */ 414 KASSERT(tsc_f > (NANOSEC >> (32 - SCALE_SHIFT)), ("TSC frequency is too low")); --- 122 unchanged lines hidden --- |