* ========== Copyright Header Begin ==========================================
* OpenSPARC T2 Processor File: isa3_intlevel_121503.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
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* ========== Copyright Header End ============================================
#define MAIN_PAGE_HV_ALSO
! Enable main section to run in PRIV mode
#define MAIN_PAGE_NUCLEUS_ALSO
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!Override trap handler definitions
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Trap should set %l6=TT which is verified in main program
! and set %pil=15 or clear %softint
! to keep trap from firing again on return from trap
#define MY_GENERIC_TRAP \
#define H_T0_Interrupt_Level_1_0x41
#define My_T0_Interrupt_Level_1_0x41 MY_GENERIC_TRAP
#define H_T0_Interrupt_Level_2_0x42
#define My_T0_Interrupt_Level_2_0x42 MY_GENERIC_TRAP
#define H_T0_Interrupt_Level_3_0x43
#define My_T0_Interrupt_Level_3_0x43 MY_GENERIC_TRAP
#define H_T0_Interrupt_Level_4_0x44
#define My_T0_Interrupt_Level_4_0x44 MY_GENERIC_TRAP
#define H_T0_Interrupt_Level_5_0x45
#define My_T0_Interrupt_Level_5_0x45 MY_GENERIC_TRAP
#define H_T0_Interrupt_Level_6_0x46
#define My_T0_Interrupt_Level_6_0x46 MY_GENERIC_TRAP
#define H_T0_Interrupt_Level_7_0x47
#define My_T0_Interrupt_Level_7_0x47 MY_GENERIC_TRAP
#define H_T0_Interrupt_Level_8_0x48
#define My_T0_Interrupt_Level_8_0x48 MY_GENERIC_TRAP
#define H_T0_Interrupt_Level_9_0x49
#define My_T0_Interrupt_Level_9_0x49 MY_GENERIC_TRAP
#define H_T0_Interrupt_Level_10_0x4a
#define My_T0_Interrupt_Level_10_0x4a MY_GENERIC_TRAP
#define H_T0_Interrupt_Level_11_0x4b
#define My_T0_Interrupt_Level_11_0x4b MY_GENERIC_TRAP
#define H_T0_Interrupt_Level_12_0x4c
#define My_T0_Interrupt_Level_12_0x4c MY_GENERIC_TRAP
#define H_T0_Interrupt_Level_13_0x4d
#define My_T0_Interrupt_Level_13_0x4d MY_GENERIC_TRAP
#define H_T0_Interrupt_Level_14_0x4e
#define My_T0_Interrupt_Level_14_0x4e MY_GENERIC_TRAP
#define H_T0_Interrupt_Level_15_0x4f
#define My_T0_Interrupt_Level_15_0x4f MY_GENERIC_TRAP
#define CREGS_PSTATE_IE 1 ! Set PSTATE.IE=1
/************************************************************************
************************************************************************/
ta T_CHANGE_PRIV ! Change to PRIV mode
! local reg usage for this diag
! %l1 = n = interrupt level
! %i7 = number of traps taken
! Clear local regs for scratch registers
! Verify interrupt_level_n (where n=1..15) one at a time
! Turn off interrupts by setting PIL=15
! Set loop cnt = n = interrupt_level
wr %l4, %l7, %set_softint
wr %l4, %l7, %clear_softint
! Verify that trap was taken, %l6=TT=0x40+n
!Decrement loop cnt, repeat 15 times
! Verify we took 15 traps
EXIT_GOOD /* test finish */
/************************************************************************
************************************************************************/