common_asm.s revision fedab560fb18c85777c255ea9f445ffaf6830d30
4b22b9337f359bfd063322244f5336cc7c6ffcfars * CDDL HEADER START
4b22b9337f359bfd063322244f5336cc7c6ffcfars * The contents of this file are subject to the terms of the
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome * Common Development and Distribution License (the "License").
4b22b9337f359bfd063322244f5336cc7c6ffcfars * You may not use this file except in compliance with the License.
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome * See the License for the specific language governing permissions
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome * and limitations under the License.
cda73f64f20b8a0afc4909f5ea1f055ec7913856Toomas Soome * When distributing Covered Code, include this CDDL HEADER in each
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome * If applicable, add the following below this CDDL HEADER, with the
4b22b9337f359bfd063322244f5336cc7c6ffcfars * fields enclosed by brackets "[]" replaced with your own identifying
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome * information: Portions Copyright [yyyy] [name of copyright owner]
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome * CDDL HEADER END
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome * Use is subject to license terms.
4b22b9337f359bfd063322244f5336cc7c6ffcfars#pragma ident "%Z%%M% %I% %E% SMI"
4b22b9337f359bfd063322244f5336cc7c6ffcfars#if !defined(lint)
4b22b9337f359bfd063322244f5336cc7c6ffcfars * General assembly language routines.
4b22b9337f359bfd063322244f5336cc7c6ffcfars * It is the intent of this file to contain routines that are
4b22b9337f359bfd063322244f5336cc7c6ffcfars * specific to cpu architecture.
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome * WARNING: If you add a fast trap handler which can be invoked by a
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome * non-privileged user, you may have to use the FAST_TRAP_DONE macro
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome * instead of "done" instruction to return back to the user mode. See
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome * comments for the "fast_trap_done" entry point for more information.
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome * Override GET_NATIVE_TIME for the cpu module code. This is not
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome * guaranteed to be exactly one instruction, be careful of using
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome * the macro in delay slots.
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome * Do not use any instruction that modifies condition codes as the
4b22b9337f359bfd063322244f5336cc7c6ffcfars * caller may depend on these to remain unchanged across the macro.
4b22b9337f359bfd063322244f5336cc7c6ffcfars#endif /* lint */
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome#include <sys/machparam.h> /* To get SYSBASE and PAGESIZE */
cda73f64f20b8a0afc4909f5ea1f055ec7913856Toomas Soome#if !defined(lint)
4b22b9337f359bfd063322244f5336cc7c6ffcfars * Softint generated when counter field of tick reg matches value field
4b22b9337f359bfd063322244f5336cc7c6ffcfars * of tick_cmpr reg
4b22b9337f359bfd063322244f5336cc7c6ffcfars/*ARGSUSED*/
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome#else /* lint */
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome WR_TICKCMPR(%o2,%o4,%o5,__LINE__) ! Write to TICK_CMPR
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome GET_NATIVE_TIME(%o0, %o4, %o5) ! Read %tick to confirm the
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome sllx %o0, 1, %o0 ! value we wrote was in the future.
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome bg,pt %xcc, 2f ! future, then blow out of here.
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome sllx %o3, 1, %o3 ! If not, then double our step size,
4b22b9337f359bfd063322244f5336cc7c6ffcfars#endif /* lint */
4b22b9337f359bfd063322244f5336cc7c6ffcfars#if defined(lint)
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome WR_TICKCMPR(%o0,%o4,%o5,__LINE__) ! Write to TICK_CMPR
4b22b9337f359bfd063322244f5336cc7c6ffcfars#if defined(lint)
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome * tick_write_delta() increments %tick by the specified delta. This should
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome * only be called after a CPR event to assure that gethrtime() continues to
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome * increase monotonically. Obviously, writing %tick needs to de done very
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome * carefully to avoid introducing unnecessary %tick skew across CPUs. For
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome * this reason, we make sure we're i-cache hot before actually writing to
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome * NOTE: No provision for this on sun4v right now.
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome#else /* lint */
4b22b9337f359bfd063322244f5336cc7c6ffcfars save %sp, -SA(MINFRAME), %sp ! get a new window to preserve caller
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome /*NOTREACHED*/
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome * return 1 if disabled
4b22b9337f359bfd063322244f5336cc7c6ffcfars{ return (0); }
4b22b9337f359bfd063322244f5336cc7c6ffcfars#else /* lint */
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome#endif /* lint */
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome * Get current tick
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome{ return (0); }
4b22b9337f359bfd063322244f5336cc7c6ffcfars#else /* lint */
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome#endif /* lint */
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome * Return the counter portion of the tick register.
#if defined(lint)
gettick_counter(void)
#if defined(lint)
gethrtime(void)
return ((hrtime_t)0);
gethrtime_unscaled(void)
return ((hrtime_t)0);
gethrtime_max(void)
return ((hrtime_t)0);
*hrt = 0;
gethrestime_sec(void)
hres_tick(void)
panic_hres_tick(void)
* outlined in detail in clock.h. (Unlike GET_HRESTIME/GET_HRTIME, we don't
! hrestime_adj == 0 ?
QRETURN; \
#ifdef lint
int hres_lock;
int traptrace_use_stick;
.word 0
.word 0
.word 0, 0
.word 0
#if defined(lint)
usec_delay(int n)
#if defined(lint)
#if defined(lint)
#if defined(lint)
vtag_flushall(void)
fp_zero(void)
.xword 0