install_utrap.c revision aad98a6d8e89f8f5a62a1793da807d4bc5e5b159
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
int
{
int idx;
/*
* Check trap number.
*/
switch (type) {
case UTRAP_V8P_FP_DISABLED:
#ifdef SF_ERRATA_30 /* call causes fp-disabled */
{
extern int spitfire_call_bug;
if (spitfire_call_bug) {
"not supported for cpu version < 2.2");
}
}
#endif /* SF_ERRATA_30 */
break;
break;
default:
}
if (get_udatamodel() == DATAMODEL_LP64) {
"not supported for LP64 user programs");
}
/*
* Be sure handler address is word aligned. The uintptr_t casts are
* there to prevent warnings when using a certain compiler, and the
* temporary 32 bit variable is intended to ensure proper code
* generation and avoid a messy quadruple cast.
*/
if (nv != UTRAP_UTH_NOCHANGE) {
}
/*
* Allocate proc space for saving the addresses to these user
* trap handlers, which must later be freed. Use casptr to
* do this atomically.
*/
sizeof (utrap_handler_t *), KM_SLEEP);
sizeof (utrap_handler_t *));
}
}
/*
* Use casptr to atomically install the handler.
*/
for (;;) {
break;
}
}
if (old_handlerp != NULL) {
}
return (0);
}
void
{
sizeof (utrap_handler_t *), KM_SLEEP);
} else {
}
}
void
utrap_free(struct proc *p)
{
/* Free any kmem_alloc'ed space for user trap handlers. */
sizeof (utrap_handler_t *));
}
}
/*
* The code below supports the set of user traps which are required and
* "must be provided by all ABI-conforming implementations", according to
* 3.3.3 User Traps of the SPARC V9 ABI SUPPLEMENT, Delta Document 1.38.
* There is only 1 deferred trap in Ultra I&II, the asynchronous error
* traps, which are not required, so the deferred args are not used.
*/
/*ARGSUSED*/
int
{
int idx;
/*
* Check trap number.
*/
switch (type) {
case UT_ILLTRAP_INSTRUCTION:
break;
case UT_FP_DISABLED:
#ifdef SF_ERRATA_30 /* call causes fp-disabled */
{
extern int spitfire_call_bug;
if (spitfire_call_bug) {
"not supported for cpu version < 2.2");
}
}
#endif /* SF_ERRATA_30 */
break;
case UT_FP_EXCEPTION_IEEE_754:
break;
case UT_TAG_OVERFLOW:
break;
case UT_DIVISION_BY_ZERO:
break;
break;
case UT_PRIVILEGED_ACTION:
break;
case UT_TRAP_INSTRUCTION_16:
case UT_TRAP_INSTRUCTION_17:
case UT_TRAP_INSTRUCTION_18:
case UT_TRAP_INSTRUCTION_19:
case UT_TRAP_INSTRUCTION_20:
case UT_TRAP_INSTRUCTION_21:
case UT_TRAP_INSTRUCTION_22:
case UT_TRAP_INSTRUCTION_23:
case UT_TRAP_INSTRUCTION_24:
case UT_TRAP_INSTRUCTION_25:
case UT_TRAP_INSTRUCTION_26:
case UT_TRAP_INSTRUCTION_27:
case UT_TRAP_INSTRUCTION_28:
case UT_TRAP_INSTRUCTION_29:
case UT_TRAP_INSTRUCTION_30:
case UT_TRAP_INSTRUCTION_31:
break;
default:
}
if (get_udatamodel() == DATAMODEL_ILP32) {
"not supported for ILP32 user programs");
}
/*
* Be sure handler address is word aligned.
* There are no deferred traps, so ignore them.
*/
if (nvp != UTRAP_UTH_NOCHANGE) {
}
/*
* Allocate proc space for saving the addresses to these user
* trap handlers, which must later be freed. Use casptr to
* do this atomically.
*/
sizeof (utrap_handler_t *), KM_SLEEP);
sizeof (utrap_handler_t *));
}
}
/*
* Use casptr to atomically install the handlers.
*/
for (;;) {
break;
}
}
if (old_precise != NULL) {
}
return (0);
}