* ========== Copyright Header Begin ==========================================
* OpenSPARC T2 Processor File: interrupt_SWVR_INTR_W_all_threads.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_NUCLEUS_ALSO
#define MAIN_PAGE_HV_ALSO
#define H_HT0_Interrupt_0x60
#define My_HT0_Interrupt_0x60 \
/************************************************************************
************************************************************************/
! Switch to hypervisor mode.
! Initialize the global registers.
mov %o1, %g6 ! %o1, %g6 = thread ID
setx user_data_start, %g1, %g3
add %l7, %g3, %g7 ! %g7 = pointer to thread's data area
be main_t0 ! branch if tread 0
ba main_t1_to_t63 ! branch if not thread 0
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! For each of the 64 threads generate an interrupt to that thread
set 63, %g3 ! %g3 = destination thread number
! Generate a cross thread interrupt to each thread.
stxa %g3, [%g0]ASI_SWVR_UDB_INTR_W ! send an interrupt
sub %g3, %g4, %g3 ! decrement destination thread number
#else /* ifndef PORTABLE_CORE */
! For each thread in this core generate an interrupt to it
ldxa [%g0]ASI_INTR_ID, %o2 ! get full thread ID
or %o2, 7, %g3 ! g3 = destination thread ID
! Loop to generate the interrupts
stxa %g3, [%g0]ASI_SWVR_UDB_INTR_W ! send an interrupt
sub %g3, %g4, %g3 ! decrement destination thread number
#endif /* ifndef PORTABLE_CORE */
! Wait until interrupt occurs in this thread, 0.
set 4000, %l4 ! l4 = timeout counter
mov %g7, %l2 ! l2 = interrupt count
be test_failed ! branch if no interrupt occured
add %l4, -1, %l4 ! decrement wait count
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! All Threads Except 0 Start Here
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Wait for interrup to arrive to this thread.
setx 8000, %i6, %i5 ! i5 = timeout counter
mov %g7, %i2 ! i2 = interrupt count address
be test_failed ! branch if no interrupt occured
/**********************************************************************
Interrupt trap handler. Same interrupt handler for all threads.
**********************************************************************/
! Get the thread ID & find data area
ta T_RD_THID ! %o1 = thread id
setx user_data_start, %l2, %l3
ldxa [%g0]ASI_SWVR_INTR_R, %g3
/************************************************************************
************************************************************************/
.word 0x0 ! Thread 0 interrupt count
.word 0x0 ! Thread 1 interrupt count