17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * CDDL HEADER START 37c478bd9Sstevel@tonic-gate * 47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 57c478bd9Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 67c478bd9Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 77c478bd9Sstevel@tonic-gate * with the License. 87c478bd9Sstevel@tonic-gate * 97c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 107c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 117c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 127c478bd9Sstevel@tonic-gate * and limitations under the License. 137c478bd9Sstevel@tonic-gate * 147c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 157c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 167c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 177c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 187c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 197c478bd9Sstevel@tonic-gate * 207c478bd9Sstevel@tonic-gate * CDDL HEADER END 217c478bd9Sstevel@tonic-gate */ 227c478bd9Sstevel@tonic-gate /* 23*5d54f3d8Smuffin * Copyright 1985 Sun Microsystems, Inc. All rights reserved. 24*5d54f3d8Smuffin * Use is subject to license terms. 257c478bd9Sstevel@tonic-gate */ 267c478bd9Sstevel@tonic-gate 277c478bd9Sstevel@tonic-gate #ifndef _sparc_trap_h 287c478bd9Sstevel@tonic-gate #define _sparc_trap_h 297c478bd9Sstevel@tonic-gate 30*5d54f3d8Smuffin #pragma ident "%Z%%M% %I% %E% SMI" 31*5d54f3d8Smuffin 327c478bd9Sstevel@tonic-gate /* 337c478bd9Sstevel@tonic-gate * Trap type values. 347c478bd9Sstevel@tonic-gate */ 357c478bd9Sstevel@tonic-gate #define TT(X) ((X)<<4) 367c478bd9Sstevel@tonic-gate 377c478bd9Sstevel@tonic-gate /* 387c478bd9Sstevel@tonic-gate * The Coprocessor bit. 397c478bd9Sstevel@tonic-gate */ 407c478bd9Sstevel@tonic-gate #define CP_BIT 0x20 417c478bd9Sstevel@tonic-gate 427c478bd9Sstevel@tonic-gate /* 437c478bd9Sstevel@tonic-gate * Hardware traps. 447c478bd9Sstevel@tonic-gate */ 457c478bd9Sstevel@tonic-gate #define T_RESET 0x00 467c478bd9Sstevel@tonic-gate #define T_TEXT_FAULT 0x01 477c478bd9Sstevel@tonic-gate #define T_UNIMP_INSTR 0x02 487c478bd9Sstevel@tonic-gate #define T_PRIV_INSTR 0x03 497c478bd9Sstevel@tonic-gate #define T_FP_DISABLED 0x04 507c478bd9Sstevel@tonic-gate #define T_CP_DISABLED (0x4 | CP_BIT) 517c478bd9Sstevel@tonic-gate #define T_WIN_OVERFLOW 0x05 527c478bd9Sstevel@tonic-gate #define T_WIN_UNDERFLOW 0x06 537c478bd9Sstevel@tonic-gate #define T_ALIGNMENT 0x07 547c478bd9Sstevel@tonic-gate #define T_FP_EXCEPTION 0x08 557c478bd9Sstevel@tonic-gate #define T_CP_EXCEPTION (0x8 | CP_BIT) 567c478bd9Sstevel@tonic-gate #define T_DATA_FAULT 0x09 577c478bd9Sstevel@tonic-gate #define T_TAG_OVERFLOW 0x0A 587c478bd9Sstevel@tonic-gate #define T_INT 0x10 597c478bd9Sstevel@tonic-gate #define T_INT_LEVEL 0x0F 607c478bd9Sstevel@tonic-gate #define T_INT_LEVEL_1 0x11 617c478bd9Sstevel@tonic-gate #define T_INT_LEVEL_2 0x12 627c478bd9Sstevel@tonic-gate #define T_INT_LEVEL_3 0x13 637c478bd9Sstevel@tonic-gate #define T_INT_LEVEL_4 0x14 647c478bd9Sstevel@tonic-gate #define T_INT_LEVEL_5 0x15 657c478bd9Sstevel@tonic-gate #define T_INT_LEVEL_6 0x16 667c478bd9Sstevel@tonic-gate #define T_INT_LEVEL_7 0x17 677c478bd9Sstevel@tonic-gate #define T_INT_LEVEL_8 0x18 687c478bd9Sstevel@tonic-gate #define T_INT_LEVEL_9 0x19 697c478bd9Sstevel@tonic-gate #define T_INT_LEVEL_10 0x1A 707c478bd9Sstevel@tonic-gate #define T_INT_LEVEL_11 0x1B 717c478bd9Sstevel@tonic-gate #define T_INT_LEVEL_12 0x1C 727c478bd9Sstevel@tonic-gate #define T_INT_LEVEL_13 0x1D 737c478bd9Sstevel@tonic-gate #define T_INT_LEVEL_14 0x1E 747c478bd9Sstevel@tonic-gate #define T_INT_LEVEL_15 0x1F 757c478bd9Sstevel@tonic-gate 767c478bd9Sstevel@tonic-gate /* 777c478bd9Sstevel@tonic-gate * Software traps (ticc instructions). 787c478bd9Sstevel@tonic-gate */ 797c478bd9Sstevel@tonic-gate #define ST_SYSCALL 0x00 807c478bd9Sstevel@tonic-gate #define ST_BREAKPOINT 0x01 817c478bd9Sstevel@tonic-gate #define ST_DIV0 0x02 827c478bd9Sstevel@tonic-gate #define ST_FLUSH_WINDOWS 0x03 837c478bd9Sstevel@tonic-gate #define ST_CLEAN_WINDOWS 0x04 847c478bd9Sstevel@tonic-gate #define ST_RANGE_CHECK 0x05 857c478bd9Sstevel@tonic-gate #define ST_FIX_ALIGN 0x06 867c478bd9Sstevel@tonic-gate #define ST_INT_OVERFLOW 0x07 877c478bd9Sstevel@tonic-gate 887c478bd9Sstevel@tonic-gate #define ST_GETCC 0x20 897c478bd9Sstevel@tonic-gate #define ST_SETCC 0x21 907c478bd9Sstevel@tonic-gate #define ST_MON_BREAKPOINT 0x7F 917c478bd9Sstevel@tonic-gate 927c478bd9Sstevel@tonic-gate /* 937c478bd9Sstevel@tonic-gate * Software trap vectors 16 - 31 are reserved for use by the user 947c478bd9Sstevel@tonic-gate * and will not be usurped by Sun. 957c478bd9Sstevel@tonic-gate */ 967c478bd9Sstevel@tonic-gate 977c478bd9Sstevel@tonic-gate /* 987c478bd9Sstevel@tonic-gate * Software trap type values. 997c478bd9Sstevel@tonic-gate */ 1007c478bd9Sstevel@tonic-gate #define T_SOFTWARE_TRAP 0x80 1017c478bd9Sstevel@tonic-gate #define T_ESOFTWARE_TRAP 0xFF 1027c478bd9Sstevel@tonic-gate #define T_SYSCALL (T_SOFTWARE_TRAP + ST_SYSCALL) 1037c478bd9Sstevel@tonic-gate #define T_BREAKPOINT (T_SOFTWARE_TRAP + ST_BREAKPOINT) 1047c478bd9Sstevel@tonic-gate #define T_DIV0 (T_SOFTWARE_TRAP + ST_DIV0) 1057c478bd9Sstevel@tonic-gate #define T_FLUSH_WINDOWS (T_SOFTWARE_TRAP + ST_FLUSH_WINDOWS) 1067c478bd9Sstevel@tonic-gate #define T_CLEAN_WINDOWS (T_SOFTWARE_TRAP + ST_CLEAN_WINDOWS) 1077c478bd9Sstevel@tonic-gate #define T_RANGE_CHECK (T_SOFTWARE_TRAP + ST_RANGE_CHECK) 1087c478bd9Sstevel@tonic-gate #define T_FIX_ALIGN (T_SOFTWARE_TRAP + ST_FIX_ALIGN) 1097c478bd9Sstevel@tonic-gate #define T_INT_OVERFLOW (T_SOFTWARE_TRAP + ST_INT_OVERFLOW) 1107c478bd9Sstevel@tonic-gate 1117c478bd9Sstevel@tonic-gate #define T_GETCC (T_SOFTWARE_TRAP + ST_GETCC) 1127c478bd9Sstevel@tonic-gate #define T_SETCC (T_SOFTWARE_TRAP + ST_SETCC) 1137c478bd9Sstevel@tonic-gate 1147c478bd9Sstevel@tonic-gate /* 1157c478bd9Sstevel@tonic-gate * Pseudo traps. 1167c478bd9Sstevel@tonic-gate */ 1177c478bd9Sstevel@tonic-gate #define T_INTERRUPT 0x100 1187c478bd9Sstevel@tonic-gate #define T_SPURIOUS (T_INTERRUPT | T_INT) 1197c478bd9Sstevel@tonic-gate #define T_FAULT 0x200 1207c478bd9Sstevel@tonic-gate #define T_AST 0x400 1217c478bd9Sstevel@tonic-gate #define T_ZERO 0x00 1227c478bd9Sstevel@tonic-gate 1237c478bd9Sstevel@tonic-gate #endif /* !_sparc_trap_h */ 124