/* * ========== Copyright Header Begin ========================================== * * OpenSPARC T2 Processor File: tlu_custom_trap_handlers.s * Copyright (C) 1995-2007 Sun Microsystems, Inc. All Rights Reserved * 4150 Network Circle, Santa Clara, California 95054, U.S.A. * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 2 of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * For the avoidance of doubt, and except that if any non-GPL license * choice is available it will apply instead, Sun elects to use only * the General Public License version 2 (GPLv2) at this time for any * software where a choice of GPL license versions is made * available with the language indicating that GPLv2 or any later version * may be used, or where a choice of which version of the GPL is applied is * otherwise unspecified. * * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, * CA 95054 USA or visit www.sun.com if you need additional information or * have any questions. * * * ========== Copyright Header End ============================================ */ #ifndef T_HANDLER_RAND4_1 #define T_HANDLER_RAND4_1 b .+16;\ sdiv %r1, %r0, %l4;nop;nop #endif #ifndef T_HANDLER_RAND7_1 #define T_HANDLER_RAND7_1 b .+28;\ pdist %f4, %f6, %f20; \ nop; nop ; nop; nop; illtrap #endif #ifndef T_HANDLER_RAND4_2 #define T_HANDLER_RAND4_2 save %i7, %g0, %i7; \ save %i7, %g0, %i7; \ restore %i7, %g0, %i7;\ restore %i7, %g0, %i7; #endif #ifndef T_HANDLER_RAND7_2 #define T_HANDLER_RAND7_2 b .+8 ;\ rdpr %pstate, %l2;\ b .+8 ;\ rdpr %tstate, %l3;\ b .+12 ;\ wrpr %l3, %r0, %tstate; nop #endif #ifndef T_HANDLER_RAND4_3 #define T_HANDLER_RAND4_3 save %i7, %g0, %i7;\ restore %i7, %g0, %i7;\ save %i7, %g0, %i7; \ restore %i7, %g0, %i7; #endif #ifndef T_HANDLER_RAND7_3 #define T_HANDLER_RAND7_3 b .+8 ;\ rdpr %tnpc, %l2;\ and %l2, 0xfc0, %l2;\ add %i7, %l2, %l2;\ stda %f16,[%i7]ASI_BLOCK_AS_IF_USER_PRIMARY ;\ b .+8 ;\ stda %f0,[%i7]ASI_BLOCK_AS_IF_USER_PRIMARY_LITTLE ; #endif #ifndef T_HANDLER_RAND4_4 #define T_HANDLER_RAND4_4 b .+4 ; b .+4; b .+4; b .+4 #endif #ifndef T_HANDLER_RAND7_4 #define T_HANDLER_RAND7_4 b .+8;\ save %i7, %g0, %i7; \ b,a .+8;\ b .+12;\ stw %i7, [%i7];\ b .-8;;\ restore %i7, %g0, %i7; #endif #ifndef T_HANDLER_RAND4_5 #define T_HANDLER_RAND4_5 ldda [%r31]ASI_NUCLEUS_QUAD_LDD, %f16;\ sdiv %l4, %l5, %l7;\ add %r31, 128, %l5;\ stda %l4, [%i7]ASI_BLOCK_PRIMARY_LITTLE; #endif #ifndef T_HANDLER_RAND7_5 #define T_HANDLER_RAND7_5 save %i7, %g0, %i7;\ rdpr %tnpc, %l2;\ wrpr %l2, %tpc;\ add %l2, 4, %l2;\ wrpr %l2, %tnpc;\ restore %i7, %g0, %i7;\ retry; #endif #ifndef T_HANDLER_RAND4_6 #define T_HANDLER_RAND4_6 ldda [%r31]ASI_BLOCK_AS_IF_USER_PRIMARY, %f32;\ rd %fprs, %l2; \ wr %l2, 0x4, %fprs ;\ stda %f0,[%r31]ASI_BLOCK_AS_IF_USER_PRIMARY_LITTLE; #endif #ifndef T_HANDLER_RAND7_6 #define T_HANDLER_RAND7_6 umul %o4, 2, %o5;\ rdpr %tnpc, %l2;\ wrpr %l2, %tpc;\ add %l2, 4, %l2;\ wrpr %l2, %tnpc;\ stw %l2, [%i7];\ retry; #endif !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! #ifndef HT_HANDLER_RAND4_1 #define HT_HANDLER_RAND4_1 mov 0x80, %l3;\ b .+12;\ stxa %l3, [%l3]0x57 ;\ nop #endif #ifndef HT_HANDLER_RAND7_1 #define HT_HANDLER_RAND7_1 b .+28;\ pdist %f4, %f4, %f20;\ nop; nop ; nop; nop; illtrap #endif #ifndef HT_HANDLER_RAND4_2 #define HT_HANDLER_RAND4_2 rdpr %tstate, %l2;\ b .+12;\ wrpr %l2, 0x800, %tstate;\ nop; #endif #ifndef HT_HANDLER_RAND7_2 #define HT_HANDLER_RAND7_2 b .+8 ;\ rdhpr %hpstate, %l2;\ b .+8 ;\ rdhpr %htstate, %l3;\ b .+12 ;\ wrhpr %l3, %r0, %htstate; nop #endif #ifndef HT_HANDLER_RAND4_3 #define HT_HANDLER_RAND4_3 stxa %l4, [%r31]ASI_AS_IF_USER_PRIMARY;\ mov 0x80, %l3;\ stxa %l3, [%l3]0x5f ;\ b .+8 ;\ ldxa [%r31]ASI_AS_IF_USER_PRIMARY, %l4; #endif #ifndef HT_HANDLER_RAND7_3 #define HT_HANDLER_RAND7_3 b .+8 ;\ rdpr %tnpc, %l2;\ and %l2, 0xfc0, %l2;\ add %i7, %l2, %l2;\ stda %f16,[%i7]ASI_BLOCK_AS_IF_USER_PRIMARY ;\ b .+8 ;\ stda %f0,[%i7]ASI_BLOCK_AS_IF_USER_PRIMARY_LITTLE ; #endif #ifndef HT_HANDLER_RAND4_4 #define HT_HANDLER_RAND4_4 ldda [%i7]ASI_BLOCK_PRIMARY_LITTLE, %f0;\ b .+12 ;\ stxa %l3, [%g0]ASI_LSU_CONTROL; nop #endif #ifndef HT_HANDLER_RAND7_4 #define HT_HANDLER_RAND7_4 rdpr %tnpc, %l3;\ and %l3, 0xff, %l3;\ sllx %l3, 26, %l3;\ ldxa [%g0]0x45, %l4;\ or %l3, %l4, %l3 ;\ stxa %l3, [%g0]0x45 ;\ nop; #endif #ifndef HT_HANDLER_RAND4_5 #define HT_HANDLER_RAND4_5 ldda [%r31]ASI_NUCLEUS_QUAD_LDD, %f48;\ sdiv %l4, %l5, %l6;\ sdiv %l3, %l6, %l7;\ stda %f32, [%r31]ASI_BLOCK_PRIMARY_LITTLE; #endif #ifndef HT_HANDLER_RAND7_5 #define HT_HANDLER_RAND7_5 save %i7, %g0, %i7;\ rdpr %tnpc, %l2;\ wrpr %l2, %tpc;\ add %l2, 4, %l2;\ wrpr %l2, %tnpc;\ restore %i7, %g0, %i7;\ retry; #endif #ifndef HT_HANDLER_RAND4_6 #define HT_HANDLER_RAND4_6 ld [%r31], %l2;\ rd %fprs, %l2; \ wr %l2, 0x4, %fprs ;\ stda %f0,[%i7]ASI_BLOCK_AS_IF_USER_PRIMARY_LITTLE; #endif #ifndef HT_HANDLER_RAND7_6 #define HT_HANDLER_RAND7_6 rdhpr %htstate, %o4;\ rdpr %tnpc, %l2;\ wrpr %l2, %tpc;\ add %l2, 4, %l2;\ wrpr %l2, %tnpc;\ wrhpr %o4, %r0, %htstate;\ retry; #endif !!!!!!!!!!!!!!!!!!!!!!!!! !! Disable trap checking #define NO_TRAPCHECK ! Enable Traps #define ENABLE_T1_Privileged_Opcode_0x11 #define ENABLE_T1_Fp_Disabled_0x20 #define ENABLE_HT0_Watchdog_Reset_0x02 #define FILL_TRAP_RETRY #define SPILL_TRAP_RETRY #define CLEAN_WIN_RETRY #define My_RED_Mode_Other_Reset #define My_RED_Mode_Other_Reset \ ba red_other_ext;\ nop;retry;nop;nop;nop;nop;nop #define H_HT0_Software_Initiated_Reset_0x04 #define SUN_H_HT0_Software_Initiated_Reset_0x04 \ setx Software_Reset_Handler, %g1, %g2 ;\ jmp %g2 ;\ nop #define H_T1_Clean_Window_0x24 #define SUN_H_T1_Clean_Window_0x24 \ rdpr %cleanwin, %l1;\ add %l1,1,%l1;\ wrpr %l1, %g0, %cleanwin;\ retry; nop; nop; nop; nop #define H_T1_Clean_Window_0x25 #define SUN_H_T1_Clean_Window_0x25 \ rdpr %cleanwin, %l1;\ add %l1,1,%l1;\ wrpr %l1, %g0, %cleanwin;\ retry; nop; nop; nop; nop #define H_T1_Clean_Window_0x26 #define SUN_H_T1_Clean_Window_0x26 \ rdpr %cleanwin, %l1;\ add %l1,1,%l1;\ wrpr %l1, %g0, %cleanwin;\ retry; nop; nop; nop; nop #define H_T1_Clean_Window_0x27 #define SUN_H_T1_Clean_Window_0x27 \ rdpr %cleanwin, %l1;\ add %l1,1,%l1;\ wrpr %l1, %g0, %cleanwin;\ retry; nop; nop; nop; nop #define H_HT0_Tag_Overflow #define My_HT0_Tag_Overflow \ HT_HANDLER_RAND7_1 ;\ done #define H_T0_Tag_Overflow #define My_T0_Tag_Overflow \ T_HANDLER_RAND7_2 ;\ done #define H_T1_Tag_Overflow_0x23 #define SUN_H_T1_Tag_Overflow_0x23 \ T_HANDLER_RAND7_3 ;\ done #define H_T0_Window_Spill_0_Normal_Trap #define SUN_H_T0_Window_Spill_0_Normal_Trap saved; retry; nop;nop;nop;nop;nop;nop; #define H_T0_Window_Spill_1_Normal_Trap #define SUN_H_T0_Window_Spill_1_Normal_Trap saved; retry; nop;nop;nop;nop;nop;nop; #define H_T0_Window_Spill_2_Normal_Trap #define SUN_H_T0_Window_Spill_2_Normal_Trap saved; retry; nop;nop;nop;nop;nop;nop; #define H_T0_Window_Spill_3_Normal_Trap #define SUN_H_T0_Window_Spill_3_Normal_Trap saved; retry; nop;nop;nop;nop;nop;nop; #define H_T0_Window_Spill_4_Normal_Trap #define SUN_H_T0_Window_Spill_4_Normal_Trap saved; retry; nop;nop;nop;nop;nop;nop; #define H_T0_Window_Spill_5_Normal_Trap #define SUN_H_T0_Window_Spill_5_Normal_Trap saved; retry; nop;nop;nop;nop;nop;nop; #define H_T0_Window_Spill_6_Normal_Trap #define SUN_H_T0_Window_Spill_6_Normal_Trap saved; retry; nop;nop;nop;nop;nop;nop; #define H_T0_Window_Spill_7_Normal_Trap #define SUN_H_T0_Window_Spill_7_Normal_Trap saved; retry; nop;nop;nop;nop;nop;nop; #define H_T0_Window_Spill_0_Other_Trap #define SUN_H_T0_Window_Spill_0_Other_Trap saved; retry; nop;nop;nop;nop;nop;nop; #define H_T0_Window_Spill_1_Other_Trap #define SUN_H_T0_Window_Spill_1_Other_Trap saved; retry; nop;nop;nop;nop;nop;nop; #define H_T0_Window_Spill_2_Other_Trap #define SUN_H_T0_Window_Spill_2_Other_Trap saved; retry; nop;nop;nop;nop;nop;nop; #define H_T0_Window_Spill_3_Other_Trap #define SUN_H_T0_Window_Spill_3_Other_Trap saved; retry; nop;nop;nop;nop;nop;nop; #define H_T0_Window_Spill_4_Other_Trap #define SUN_H_T0_Window_Spill_4_Other_Trap saved; retry; nop;nop;nop;nop;nop;nop; #define H_T0_Window_Spill_5_Other_Trap #define SUN_H_T0_Window_Spill_5_Other_Trap saved; retry; nop;nop;nop;nop;nop;nop; #define H_T0_Window_Spill_6_Other_Trap #define SUN_H_T0_Window_Spill_6_Other_Trap saved; retry; nop;nop;nop;nop;nop;nop; #define H_T0_Window_Spill_7_Other_Trap #define SUN_H_T0_Window_Spill_7_Other_Trap saved; retry; nop;nop;nop;nop;nop;nop; #define H_T0_Window_Fill_0_Normal_Trap #define SUN_H_T0_Window_Fill_0_Normal_Trap restored; retry; nop;nop;nop;nop;nop;nop; #define H_T0_Window_Fill_1_Normal_Trap #define SUN_H_T0_Window_Fill_1_Normal_Trap restored; retry; nop;nop;nop;nop;nop;nop; #define H_T0_Window_Fill_2_Normal_Trap #define SUN_H_T0_Window_Fill_2_Normal_Trap restored; retry; nop;nop;nop;nop;nop;nop; #define H_T0_Window_Fill_3_Normal_Trap #define SUN_H_T0_Window_Fill_3_Normal_Trap restored; retry; nop;nop;nop;nop;nop;nop; #define H_T0_Window_Fill_4_Normal_Trap #define SUN_H_T0_Window_Fill_4_Normal_Trap restored; retry; nop;nop;nop;nop;nop;nop; #define H_T0_Window_Fill_5_Normal_Trap #define SUN_H_T0_Window_Fill_5_Normal_Trap restored; retry; nop;nop;nop;nop;nop;nop; #define H_T0_Window_Fill_6_Normal_Trap #define SUN_H_T0_Window_Fill_6_Normal_Trap restored; retry; nop;nop;nop;nop;nop;nop; #define H_T0_Window_Fill_7_Normal_Trap #define SUN_H_T0_Window_Fill_7_Normal_Trap restored; retry; nop;nop;nop;nop;nop;nop; #define H_T0_Window_Fill_0_Other_Trap #define SUN_H_T0_Window_Fill_0_Other_Trap restored; retry; nop;nop;nop;nop;nop;nop; #define H_T0_Window_Fill_1_Other_Trap #define SUN_H_T0_Window_Fill_1_Other_Trap restored; retry; nop;nop;nop;nop;nop;nop; #define H_T0_Window_Fill_2_Other_Trap #define SUN_H_T0_Window_Fill_2_Other_Trap restored; retry; nop;nop;nop;nop;nop;nop; #define H_T0_Window_Fill_3_Other_Trap #define SUN_H_T0_Window_Fill_3_Other_Trap restored; retry; nop;nop;nop;nop;nop;nop; #define H_T0_Window_Fill_4_Other_Trap #define SUN_H_T0_Window_Fill_4_Other_Trap restored; retry; nop;nop;nop;nop;nop;nop; #define H_T0_Window_Fill_5_Other_Trap #define SUN_H_T0_Window_Fill_5_Other_Trap restored; retry; nop;nop;nop;nop;nop;nop; #define H_T0_Window_Fill_6_Other_Trap #define SUN_H_T0_Window_Fill_6_Other_Trap restored; retry; nop;nop;nop;nop;nop;nop; #define H_T0_Window_Fill_7_Other_Trap #define SUN_H_T0_Window_Fill_7_Other_Trap restored; retry; nop;nop;nop;nop;nop;nop; #define H_T1_Window_Spill_0_Normal_Trap #define SUN_H_T1_Window_Spill_0_Normal_Trap saved; retry; nop;nop;nop;nop;nop;nop; #define H_T1_Window_Spill_1_Normal_Trap #define SUN_H_T1_Window_Spill_1_Normal_Trap saved; retry; nop;nop;nop;nop;nop;nop; #define H_T1_Window_Spill_2_Normal_Trap #define SUN_H_T1_Window_Spill_2_Normal_Trap saved; retry; nop;nop;nop;nop;nop;nop; #define H_T1_Window_Spill_3_Normal_Trap #define SUN_H_T1_Window_Spill_3_Normal_Trap saved; retry; nop;nop;nop;nop;nop;nop; #define H_T1_Window_Spill_4_Normal_Trap #define SUN_H_T1_Window_Spill_4_Normal_Trap saved; retry; nop;nop;nop;nop;nop;nop; #define H_T1_Window_Spill_5_Normal_Trap #define SUN_H_T1_Window_Spill_5_Normal_Trap saved; retry; nop;nop;nop;nop;nop;nop; #define H_T1_Window_Spill_6_Normal_Trap #define SUN_H_T1_Window_Spill_6_Normal_Trap saved; retry; nop;nop;nop;nop;nop;nop; #define H_T1_Window_Spill_7_Normal_Trap #define SUN_H_T1_Window_Spill_7_Normal_Trap saved; retry; nop;nop;nop;nop;nop;nop; #define H_T1_Window_Spill_0_Other_Trap #define SUN_H_T1_Window_Spill_0_Other_Trap saved; retry; nop;nop;nop;nop;nop;nop; #define H_T1_Window_Spill_1_Other_Trap #define SUN_H_T1_Window_Spill_1_Other_Trap saved; retry; nop;nop;nop;nop;nop;nop; #define H_T1_Window_Spill_2_Other_Trap #define SUN_H_T1_Window_Spill_2_Other_Trap saved; retry; nop;nop;nop;nop;nop;nop; #define H_T1_Window_Spill_3_Other_Trap #define SUN_H_T1_Window_Spill_3_Other_Trap saved; retry; nop;nop;nop;nop;nop;nop; #define H_T1_Window_Spill_4_Other_Trap #define SUN_H_T1_Window_Spill_4_Other_Trap saved; retry; nop;nop;nop;nop;nop;nop; #define H_T1_Window_Spill_5_Other_Trap #define SUN_H_T1_Window_Spill_5_Other_Trap saved; retry; nop;nop;nop;nop;nop;nop; #define H_T1_Window_Spill_6_Other_Trap #define SUN_H_T1_Window_Spill_6_Other_Trap saved; retry; nop;nop;nop;nop;nop;nop; #define H_T1_Window_Spill_7_Other_Trap #define SUN_H_T1_Window_Spill_7_Other_Trap saved; retry; nop;nop;nop;nop;nop;nop; #define H_T1_Window_Fill_0_Normal_Trap #define SUN_H_T1_Window_Fill_0_Normal_Trap restored; retry; nop;nop;nop;nop;nop;nop; #define H_T1_Window_Fill_1_Normal_Trap #define SUN_H_T1_Window_Fill_1_Normal_Trap restored; retry; nop;nop;nop;nop;nop;nop; #define H_T1_Window_Fill_2_Normal_Trap #define SUN_H_T1_Window_Fill_2_Normal_Trap restored; retry; nop;nop;nop;nop;nop;nop; #define H_T1_Window_Fill_3_Normal_Trap #define SUN_H_T1_Window_Fill_3_Normal_Trap restored; retry; nop;nop;nop;nop;nop;nop; #define H_T1_Window_Fill_4_Normal_Trap #define SUN_H_T1_Window_Fill_4_Normal_Trap restored; retry; nop;nop;nop;nop;nop;nop; #define H_T1_Window_Fill_5_Normal_Trap #define SUN_H_T1_Window_Fill_5_Normal_Trap restored; retry; nop;nop;nop;nop;nop;nop; #define H_T1_Window_Fill_6_Normal_Trap #define SUN_H_T1_Window_Fill_6_Normal_Trap restored; retry; nop;nop;nop;nop;nop;nop; #define H_T1_Window_Fill_7_Normal_Trap #define SUN_H_T1_Window_Fill_7_Normal_Trap restored; retry; nop;nop;nop;nop;nop;nop; #define H_T1_Window_Fill_0_Other_Trap #define SUN_H_T1_Window_Fill_0_Other_Trap restored; retry; nop;nop;nop;nop;nop;nop; #define H_T1_Window_Fill_1_Other_Trap #define SUN_H_T1_Window_Fill_1_Other_Trap restored; retry; nop;nop;nop;nop;nop;nop; #define H_T1_Window_Fill_2_Other_Trap #define SUN_H_T1_Window_Fill_2_Other_Trap restored; retry; nop;nop;nop;nop;nop;nop; #define H_T1_Window_Fill_3_Other_Trap #define SUN_H_T1_Window_Fill_3_Other_Trap restored; retry; nop;nop;nop;nop;nop;nop; #define H_T1_Window_Fill_4_Other_Trap #define SUN_H_T1_Window_Fill_4_Other_Trap restored; retry; nop;nop;nop;nop;nop;nop; #define H_T1_Window_Fill_5_Other_Trap #define SUN_H_T1_Window_Fill_5_Other_Trap restored; retry; nop;nop;nop;nop;nop;nop; #define H_T1_Window_Fill_6_Other_Trap #define SUN_H_T1_Window_Fill_6_Other_Trap restored; retry; nop;nop;nop;nop;nop;nop; #define H_T1_Window_Fill_7_Other_Trap #define SUN_H_T1_Window_Fill_7_Other_Trap restored; retry; nop;nop;nop;nop;nop;nop; #define H_T0_Trap_Instruction_0 #define My_T0_Trap_Instruction_0 \ T_HANDLER_RAND7_5 ;\ done; #define H_T0_Trap_Instruction_1 #define My_T0_Trap_Instruction_1 \ T_HANDLER_RAND7_6 ;\ done; #define H_T0_Trap_Instruction_2 #define My_T0_Trap_Instruction_2 \ inc %o3;\ umul %o3, 2, %o4;\ ba 1f; \ save %i7, %g0, %i7; \ 2: done; \ nop; \ 1: ba 2b; \ restore %i7, %g0, %i7 #define H_T0_Trap_Instruction_3 #define My_T0_Trap_Instruction_3 \ save %i7, %g0, %i7 ;\ T_HANDLER_RAND4_5;\ stw %o4, [%i7];\ restore %i7, %g0, %i7 ;\ done #define H_T0_Trap_Instruction_4 #define My_T0_Trap_Instruction_4 \ T_HANDLER_RAND7_6 ;\ done; #define H_T0_Trap_Instruction_5 #define My_T0_Trap_Instruction_5 \ T_HANDLER_RAND4_5;\ done; #define H_T1_Trap_Instruction_0 #define My_T1_Trap_Instruction_0 \ inc %o4;\ umul %o4, 2, %o5;\ ba 3f; \ save %i7, %g0, %i7; \ 4: done; \ nop; \ 3: ba 4b; \ restore %i7, %g0, %i7 #define H_T1_Trap_Instruction_1 #define My_T1_Trap_Instruction_1 \ T_HANDLER_RAND7_3;\ done #define H_T1_Trap_Instruction_2 #define My_T1_Trap_Instruction_2 \ inc %o3;\ umul %o3, 2, %o4;\ ba 5f; \ save %i7, %g0, %i7; \ 6: done; \ nop; \ 5: ba 6b; \ restore %i7, %g0, %i7 #define H_T1_Trap_Instruction_3 #define My_T1_Trap_Instruction_3 \ T_HANDLER_RAND4_1;\ done; #define H_T1_Trap_Instruction_4 #define My_T1_Trap_Instruction_4 \ T_HANDLER_RAND7_1;\ done; #define H_T1_Trap_Instruction_5 #define My_T1_Trap_Instruction_5 \ T_HANDLER_RAND7_2;\ done #define H_HT0_Trap_Instruction_0 #define My_HT0_Trap_Instruction_0 \ HT_HANDLER_RAND4_1 ;\ done; #define H_HT0_Trap_Instruction_1 #define My_HT0_Trap_Instruction_1 \ HT_HANDLER_RAND4_3 ;\ done #define H_HT0_Trap_Instruction_2 #define My_HT0_Trap_Instruction_2 \ HT_HANDLER_RAND7_5 ;\ done; #define H_HT0_Trap_Instruction_3 #define My_HT0_Trap_Instruction_3 \ HT_HANDLER_RAND4_5 ;\ done #define H_HT0_Trap_Instruction_4 #define My_HT0_Trap_Instruction_4 \ HT_HANDLER_RAND7_4 ;\ done #define H_HT0_Trap_Instruction_5 #define My_HT0_Trap_Instruction_5 \ ba htrap_5_ext;\ nop; retry;\ nop; nop; nop; nop; nop #define H_HT0_Mem_Address_Not_Aligned_0x34 #define My_HT0_Mem_Address_Not_Aligned_0x34 \ HT_HANDLER_RAND4_2 ;\ done ; #define H_HT0_Illegal_instruction_0x10 #define My_HT0_Illegal_instruction_0x10 \ done; #define H_HT0_DAE_so_page_0x30 #define My_HT0_DAE_so_page_0x30 \ done; #define H_HT0_DAE_invalid_asi_0x14 #define SUN_H_HT0_DAE_invalid_asi_0x14 \ done #define H_HT0_DAE_privilege_violation_0x15 #define SUN_H_HT0_DAE_privilege_violation_0x15 \ done; #define H_HT0_Privileged_Action_0x37 #define My_HT0_Privileged_Action_0x37 \ done; \ nop; nop #define H_HT0_Lddf_Mem_Address_Not_Aligned_0x35 #define My_HT0_Lddf_Mem_Address_Not_Aligned_0x35 \ HT_HANDLER_RAND4_3 ;\ done #define H_HT0_Stdf_Mem_Address_Not_Aligned_0x36 #define My_HT0_Stdf_Mem_Address_Not_Aligned_0x36 \ HT_HANDLER_RAND7_1;\ done #define H_HT0_Fp_exception_ieee_754_0x21 #define My_HT0_Fp_exception_ieee_754_0x21 \ HT_HANDLER_RAND4_2 ;\ done #define H_HT0_Fp_exception_other_0x22 #define My_HT0_Fp_exception_other_0x22 \ HT_HANDLER_RAND7_2 ;\ done #define H_HT0_Division_By_Zero #define My_HT0_Division_By_Zero \ HT_HANDLER_RAND4_6;\ done #define H_T0_Division_By_Zero #define My_T0_Division_By_Zero \ T_HANDLER_RAND4_3;\ done #define H_T1_Division_By_Zero_0x28 #define My_H_T1_Division_By_Zero_0x28 \ T_HANDLER_RAND4_3;\ done #define H_T0_Division_By_Zero #define My_T0_Division_By_Zero\ T_HANDLER_RAND4_4 ;\ done #define H_T0_Fp_exception_ieee_754_0x21 #define My_T0_Fp_exception_ieee_754_0x21 \ T_HANDLER_RAND4_3 ;\ done #define H_T1_Fp_Exception_Ieee_754_0x21 #define My_H_T1_Fp_Exception_Ieee_754_0x21 \ T_HANDLER_RAND4_4 ;\ done #define H_T1_Fp_Exception_Other_0x22 #define My_H_T1_Fp_Exception_Other_0x22 \ T_HANDLER_RAND4_5 ;\ done #define H_T1_Privileged_Opcode_0x11 #define SUN_H_T1_Privileged_Opcode_0x11 \ T_HANDLER_RAND4_6 ;\ done #define H_HT0_Privileged_opcode_0x11 #define My_HT0_Privileged_opcode_0x11 \ HT_HANDLER_RAND4_1;\ done; #define H_HT0_Fp_disabled_0x20 #define My_HT0_Fp_disabled_0x20 \ mov 0x4, %l2 ;\ wr %l2, 0x0, %fprs ;\ sllx %l2, 10, %l3; \ rdpr %tstate, %l2;\ or %l2, %l3, %l2 ;\ stw %l2, [%i7];\ wrpr %l2, 0x0, %tstate;\ retry; #define H_T0_Fp_disabled_0x20 #define My_T0_Fp_disabled_0x20 \ mov 0x4, %l2 ;\ wr %l2, 0x0, %fprs ;\ sllx %l2, 10, %l3; \ rdpr %tstate, %l2;\ or %l2, %l3, %l2 ;\ wrpr %l2, 0x0, %tstate;\ retry; nop #define H_T1_Fp_Disabled_0x20 #define My_H_T1_Fp_Disabled_0x20 \ mov 0x4, %l2 ;\ wr %l2, 0x0, %fprs ;\ sllx %l2, 10, %l3; \ rdpr %tstate, %l2;\ or %l2, %l3, %l2 ;\ wrpr %l2, 0x0, %tstate;\ stw %l2, [%i7];\ retry #define H_HT0_Watchdog_Reset_0x02 #define My_HT0_Watchdog_Reset_0x02 \ ba wdog_2_ext;\ nop;retry;nop;nop;nop;nop;nop #define H_T0_Privileged_opcode_0x11 #define My_T0_Privileged_opcode_0x11 \ T_HANDLER_RAND4_4;\ done #define H_T1_Fp_exception_other_0x22 #define My_T1_Fp_exception_other_0x22 \ T_HANDLER_RAND7_3 ;\ done; #define H_T0_Fp_exception_other_0x22 #define My_T0_Fp_exception_other_0x22 \ T_HANDLER_RAND7_4;\ done #define H_HT0_Trap_Level_Zero_0x5f #define My_HT0_Trap_Level_Zero_0x5f \ not %g0, %r13; \ rdhpr %hpstate, %l3;\ jmp %r13;\ rdhpr %htstate, %l3;\ and %l3, 0xfe, %l3;\ wrhpr %l3, 0, %htstate;\ stw %r13, [%i7];\ retry #define My_Watchdog_Reset #define My_Watchdog_Reset \ ba wdog_red_ext;\ nop;retry;nop;nop;nop;nop;nop #define H_HT0_Control_Transfer_Instr_0x74 #define My_H_HT0_Control_Transfer_Instr_0x74 \ rdpr %tstate, %l3;\ mov 1, %l4;\ sllx %l4, 20, %l4;\ wrpr %l3, %l4, %tstate ;\ retry;nop; #define H_T0_Control_Transfer_Instr_0x74 #define My_H_T0_Control_Transfer_Instr_0x74 \ rdpr %tstate, %l3;\ mov 1, %l4;\ sllx %l4, 20, %l4;\ wrpr %l3, %l4, %tstate ;\ retry;nop; #define H_T1_Control_Transfer_Instr_0x74 #define My_H_T1_Control_Transfer_Instr_0x74 \ rdpr %tstate, %l3;\ mov 1, %l4;\ sllx %l4, 20, %l4;\ wrpr %l3, %l4, %tstate ;\ retry;nop; #define H_HT0_data_access_protection_0x6c #define SUN_H_HT0_data_access_protection_0x6c ba daccess_prot_handler; nop #define H_HT0_PA_Watchpoint_0x61 #define My_H_HT0_PA_Watchpoint_0x61 \ HT_HANDLER_RAND7_4;\ done #ifndef H_HT0_Data_access_error_0x32 #define H_HT0_Data_access_error_0x32 #define SUN_H_HT0_Data_access_error_0x32 \ done;nop #endif #define H_T0_VA_Watchpoint_0x62 #define My_T0_VA_Watchpoint_0x62 \ T_HANDLER_RAND7_5;\ done #define H_T1_VA_Watchpoint_0x62 #define SUN_H_T1_VA_Watchpoint_0x62 \ T_HANDLER_RAND7_3;\ done #define H_HT0_VA_Watchpoint_0x62 #define My_H_HT0_VA_Watchpoint_0x62 \ HT_HANDLER_RAND7_5;\ done #define H_HT0_Instruction_VA_Watchpoint_0x75 #define SUN_H_HT0_Instruction_VA_Watchpoint_0x75 \ done; #define H_HT0_Instruction_Breakpoint_0x76 #define SUN_H_HT0_Instruction_Breakpoint_0x76 \ rdhpr %htstate, %g1;\ wrhpr %g1, 0x400, %htstate;\ retry;nop #define H_HT0_Instruction_address_range_0x0d #define SUN_H_HT0_Instruction_address_range_0x0d \ HT_HANDLER_RAND4_1;\ done; #define H_HT0_Instruction_real_range_0x0e #define SUN_H_HT0_Instruction_real_range_0x0e \ HT_HANDLER_RAND4_1;\ done; #define H_HT0_mem_real_range_0x2d #define SUN_H_HT0_mem_real_range_0x2d \ HT_HANDLER_RAND4_2;\ done; #define H_HT0_mem_address_range_0x2e #define SUN_H_HT0_mem_address_range_0x2e \ HT_HANDLER_RAND4_3;\ done; #define H_HT0_DAE_nc_page_0x16 #define SUN_H_HT0_DAE_nc_page_0x16 \ done; #define H_HT0_DAE_nfo_page_0x17 #define SUN_H_HT0_DAE_nfo_page_0x17 \ done; #define H_HT0_IAE_unauth_access_0x0b #define SUN_H_HT0_IAE_unauth_access_0x0b \ HT_HANDLER_RAND7_3;\ done; #define H_HT0_IAE_nfo_page_0x0c #define SUN_H_HT0_IAE_nfo_page_0x0c \ HT_HANDLER_RAND7_6;\ done; #define H_HT0_Reserved_0x3b #define SUN_H_HT0_Reserved_0x3b \ mov 0x80, %l3;\ stxa %l3, [%l3]0x5f ;\ stxa %l3, [%l3]0x57 ;\ done; #define H_HT0_IAE_privilege_violation_0x08 #define My_HT0_IAE_privilege_violation_0x08 \ HT_HANDLER_RAND7_2;\ done; #ifndef H_HT0_Instruction_Access_MMU_Error_0x71 #define H_HT0_Instruction_Access_MMU_Error_0x71 #define SUN_H_HT0_Instruction_Access_MMU_Error_0x71 \ mov 0x80, %l3;\ stxa %l3, [%l3]0x5f ;\ stxa %l3, [%l3]0x57 ;\ retry; #endif #ifndef H_HT0_Data_Access_MMU_Error_0x72 #define H_HT0_Data_Access_MMU_Error_0x72 #define SUN_H_HT0_Data_Access_MMU_Error_0x72 \ mov 0x80, %l3;\ stxa %l3, [%l3]0x5f ;\ stxa %l3, [%l3]0x57 ;\ retry; #endif !!!!!!!!!!!!!!!!!!!!!! END of all handlers !!!!!!!!!!!!!!!!!!!