machclock.h revision bd28a477274db2b836577dfd6f223c696ad00720
5562N/A * The contents of this file are subject to the terms of the 5562N/A * Common Development and Distribution License (the "License"). 5562N/A * You may not use this file except in compliance with the License. 5562N/A * See the License for the specific language governing permissions 5562N/A * and limitations under the License. 5562N/A * When distributing Covered Code, include this CDDL HEADER in each 5562N/A * If applicable, add the following below this CDDL HEADER, with the 5562N/A * fields enclosed by brackets "[]" replaced with your own identifying 5562N/A * information: Portions Copyright [yyyy] [name of copyright owner] 5680N/A * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. 5562N/A * Macro to clear the NPT (non-privileged trap) bit in the %tick/%stick 5706N/A * These macros on sun4u read the %tick register, due to : 5706N/A * - %stick does not have enough precision, it's very low frequency 5562N/A * - %stick accesses are very slow on UltraSPARC IIe 5562N/A * Instead, consumers read %tick and scale it by the current stick/tick ratio. 5562N/A * This only works because all cpus in a system change clock ratios 5562N/A * synchronously and the changes are all initiated by the kernel. * Constants used to convert hi-res timestamps into nanoseconds * At least 3.9MHz, for slower %stick-based systems. * At least 62.5 MHz, for faster %tick-based systems. #
error "Compiling for CPU_MODULE but no CPU specified" * NOTE: the macros below assume that the various time-related variables * (hrestime, hrestime_adj, hres_last_tick, timedelta, nsec_scale, etc) * are all stored together on a 64-byte boundary. The primary motivation * is cache performance, but we also take advantage of a convenient side * effect: these variables all have the same high 22 address bits, so only * one sethi is needed to access them all. * GET_HRESTIME() returns the value of hrestime, hrestime_adj and the * number of nanoseconds since the last clock tick ('nslt'). It also * sets 'nano' to the value NANOSEC (one billion). * This macro assumes that all registers are globals or outs so they can * safely contain 64-bit data, and that it's safe to use the label "5:". * Further, this macro calls the NATIVE_TIME_TO_NSEC_SCALE which in turn * uses the labels "6:" and "7:"; labels "5:", "6:" and "7:" must not * be used across invocations of this macro. /* membar #LoadLoad; (see comment (2) above) */ \
* Similar to above, but returns current gethrtime() value in 'base'. /* membar #LoadLoad; (see comment (2) above) */ \
* Hardware watchdog variables and knobs * tod module name and operations * These defines allow common code to use TOD functions independant #
endif /* !_SYS_MACHCLOCK_H */