interrupt.s revision ae115bc77f6fcde83175c75b4206dc2e50747966
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1990, 1991 UNIX System Laboratories, Inc. */
/* Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T */
/* All Rights Reserved */
/* Copyright (c) 1987, 1988 Microsoft Corporation */
/* All Rights Reserved */
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/asm_linkage.h>
#include <sys/asm_misc.h>
#include <sys/x86_archext.h>
#if defined(__lint)
#else /* __lint */
#include <sys/segments.h>
#include <sys/traptrace.h>
#include "assym.h"
#endif /* lint */
#if defined(__i386)
#if defined(__lint)
void
patch_tsc(void)
{}
#else /* __lint */
/*
* To cope with processors that do not implement the rdtsc instruction,
* we patch the kernel to use rdtsc if that feature is detected on the CPU.
* On an unpatched kernel, all locations requiring rdtsc are nop's.
*
* This function patches the nop's to rdtsc.
*/
#endif /* __lint */
#endif /* __i386 */
#if defined(__lint)
void
_interrupt(void)
{}
#else /* __lint */
#if defined(__amd64)
/*
* Common register usage:
*
* %r12 trap trace pointer
*/
INTGATE_INIT_KERNEL_FLAGS /* (set kernel rflags values) */
/*
* At the end of TRACE_PTR %r12 points to the current TRAPTRACE entry
*/
/* Uses labels 8 and 9 */
#ifdef TRAPTRACE
#endif
/*NOTREACHED*/
/*
* At the end of TRACE_PTR %esi points to the current TRAPTRACE entry
*/
/* Uses labels 8 and 9 */
#endif /* __i386 */
/*
* Declare a uintptr_t which has the size of _interrupt to enable stack
* traceback code to know when a regs structure is on the stack.
*/
.NWORD . - _interrupt
#endif /* __lint */
#if defined(__lint)
void
fakesoftint(void)
{}
#else /* __lint */
/
/
#if defined(__amd64)
/*
* In 64-bit mode, iretq -always- pops all five regs
* Imitate the 16-byte auto-align of the stack, and the
* zero-ed out %ss value.
*/
pushf /* rflags */
pushq $0 /* err */
pushl $0
#endif /* __i386 */
#endif /* __lint */