* ========== Copyright Header Begin ==========================================
* OpenSPARC T2 Processor File: cmp_master_park_unpark_all_w1s_w1c.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
/************************************************************************
************************************************************************/
be main_t0 ! branch if thread 0
ba main_t1_t63 ! branch if not thread 0
/************************************************************************
************************************************************************/
/* Park all the other threads one by one. */
setx ASI_CMP_CORE_RUNNING_W1C, %g1, %g2
stxa %g3, [%g2]ASI_CMP_CORE ! thread 1
stxa %g3, [%g2]ASI_CMP_CORE ! thread 2
stxa %g3, [%g2]ASI_CMP_CORE ! thread 3
stxa %g3, [%g2]ASI_CMP_CORE ! thread 4
stxa %g3, [%g2]ASI_CMP_CORE ! thread 5
stxa %g3, [%g2]ASI_CMP_CORE ! thread 6
stxa %g3, [%g2]ASI_CMP_CORE ! thread 7
stxa %g3, [%g2]ASI_CMP_CORE ! thread 8
stxa %g3, [%g2]ASI_CMP_CORE ! thread 9
stxa %g3, [%g2]ASI_CMP_CORE ! thread 10
stxa %g3, [%g2]ASI_CMP_CORE ! thread 11
stxa %g3, [%g2]ASI_CMP_CORE ! thread 12
stxa %g3, [%g2]ASI_CMP_CORE ! thread 13
stxa %g3, [%g2]ASI_CMP_CORE ! thread 14
stxa %g3, [%g2]ASI_CMP_CORE ! thread 15
stxa %g3, [%g2]ASI_CMP_CORE ! thread 16
stxa %g3, [%g2]ASI_CMP_CORE ! thread 17
stxa %g3, [%g2]ASI_CMP_CORE ! thread 18
stxa %g3, [%g2]ASI_CMP_CORE ! thread 19
stxa %g3, [%g2]ASI_CMP_CORE ! thread 20
stxa %g3, [%g2]ASI_CMP_CORE ! thread 21
stxa %g3, [%g2]ASI_CMP_CORE ! thread 22
stxa %g3, [%g2]ASI_CMP_CORE ! thread 23
stxa %g3, [%g2]ASI_CMP_CORE ! thread 24
stxa %g3, [%g2]ASI_CMP_CORE ! thread 25
stxa %g3, [%g2]ASI_CMP_CORE ! thread 26
stxa %g3, [%g2]ASI_CMP_CORE ! thread 27
stxa %g3, [%g2]ASI_CMP_CORE ! thread 28
stxa %g3, [%g2]ASI_CMP_CORE ! thread 29
stxa %g3, [%g2]ASI_CMP_CORE ! thread 30
stxa %g3, [%g2]ASI_CMP_CORE ! thread 31
stxa %g3, [%g2]ASI_CMP_CORE ! thread 32
stxa %g3, [%g2]ASI_CMP_CORE ! thread 33
stxa %g3, [%g2]ASI_CMP_CORE ! thread 34
stxa %g3, [%g2]ASI_CMP_CORE ! thread 35
stxa %g3, [%g2]ASI_CMP_CORE ! thread 36
stxa %g3, [%g2]ASI_CMP_CORE ! thread 37
stxa %g3, [%g2]ASI_CMP_CORE ! thread 38
stxa %g3, [%g2]ASI_CMP_CORE ! thread 39
stxa %g3, [%g2]ASI_CMP_CORE ! thread 40
stxa %g3, [%g2]ASI_CMP_CORE ! thread 41
stxa %g3, [%g2]ASI_CMP_CORE ! thread 42
stxa %g3, [%g2]ASI_CMP_CORE ! thread 43
stxa %g3, [%g2]ASI_CMP_CORE ! thread 44
stxa %g3, [%g2]ASI_CMP_CORE ! thread 45
stxa %g3, [%g2]ASI_CMP_CORE ! thread 46
stxa %g3, [%g2]ASI_CMP_CORE ! thread 47
stxa %g3, [%g2]ASI_CMP_CORE ! thread 48
stxa %g3, [%g2]ASI_CMP_CORE ! thread 49
stxa %g3, [%g2]ASI_CMP_CORE ! thread 50
stxa %g3, [%g2]ASI_CMP_CORE ! thread 51
stxa %g3, [%g2]ASI_CMP_CORE ! thread 52
stxa %g3, [%g2]ASI_CMP_CORE ! thread 53
stxa %g3, [%g2]ASI_CMP_CORE ! thread 54
stxa %g3, [%g2]ASI_CMP_CORE ! thread 55
stxa %g3, [%g2]ASI_CMP_CORE ! thread 56
stxa %g3, [%g2]ASI_CMP_CORE ! thread 57
stxa %g3, [%g2]ASI_CMP_CORE ! thread 58
stxa %g3, [%g2]ASI_CMP_CORE ! thread 59
stxa %g3, [%g2]ASI_CMP_CORE ! thread 60
stxa %g3, [%g2]ASI_CMP_CORE ! thread 61
stxa %g3, [%g2]ASI_CMP_CORE ! thread 62
stxa %g3, [%g2]ASI_CMP_CORE ! thread 63
/* Check the CORE_RUNNING_RW and CORE_RUNNING_STATUS registers. */
setx ASI_CMP_CORE_RUNNING_RW, %g1, %g2
setx ASI_CMP_CORE_RUNNING_STATUS, %g1, %g3
beq local_test_failed ! fail on a timeout
ldxa [%g3]ASI_CMP_CORE, %g4 ! CORE_RUNNING_STATUS
ldxa [%g2]ASI_CMP_CORE, %g5 ! CORE_RUNNING_RW
bne local_test_failed ! fail on RW != STATUS
/* Now unpark all the other threads one by one. */
setx ASI_CMP_CORE_RUNNING_W1S, %g1, %g2
stxa %g3, [%g2]ASI_CMP_CORE ! thread 1
stxa %g3, [%g2]ASI_CMP_CORE ! thread 2
stxa %g3, [%g2]ASI_CMP_CORE ! thread 3
stxa %g3, [%g2]ASI_CMP_CORE ! thread 4
stxa %g3, [%g2]ASI_CMP_CORE ! thread 5
stxa %g3, [%g2]ASI_CMP_CORE ! thread 6
stxa %g3, [%g2]ASI_CMP_CORE ! thread 7
stxa %g3, [%g2]ASI_CMP_CORE ! thread 8
stxa %g3, [%g2]ASI_CMP_CORE ! thread 9
stxa %g3, [%g2]ASI_CMP_CORE ! thread 10
stxa %g3, [%g2]ASI_CMP_CORE ! thread 11
stxa %g3, [%g2]ASI_CMP_CORE ! thread 12
stxa %g3, [%g2]ASI_CMP_CORE ! thread 13
stxa %g3, [%g2]ASI_CMP_CORE ! thread 14
stxa %g3, [%g2]ASI_CMP_CORE ! thread 15
stxa %g3, [%g2]ASI_CMP_CORE ! thread 16
stxa %g3, [%g2]ASI_CMP_CORE ! thread 17
stxa %g3, [%g2]ASI_CMP_CORE ! thread 18
stxa %g3, [%g2]ASI_CMP_CORE ! thread 19
stxa %g3, [%g2]ASI_CMP_CORE ! thread 20
stxa %g3, [%g2]ASI_CMP_CORE ! thread 21
stxa %g3, [%g2]ASI_CMP_CORE ! thread 22
stxa %g3, [%g2]ASI_CMP_CORE ! thread 23
stxa %g3, [%g2]ASI_CMP_CORE ! thread 24
stxa %g3, [%g2]ASI_CMP_CORE ! thread 25
stxa %g3, [%g2]ASI_CMP_CORE ! thread 26
stxa %g3, [%g2]ASI_CMP_CORE ! thread 27
stxa %g3, [%g2]ASI_CMP_CORE ! thread 28
stxa %g3, [%g2]ASI_CMP_CORE ! thread 29
stxa %g3, [%g2]ASI_CMP_CORE ! thread 30
stxa %g3, [%g2]ASI_CMP_CORE ! thread 31
stxa %g3, [%g2]ASI_CMP_CORE ! thread 32
stxa %g3, [%g2]ASI_CMP_CORE ! thread 33
stxa %g3, [%g2]ASI_CMP_CORE ! thread 34
stxa %g3, [%g2]ASI_CMP_CORE ! thread 35
stxa %g3, [%g2]ASI_CMP_CORE ! thread 36
stxa %g3, [%g2]ASI_CMP_CORE ! thread 37
stxa %g3, [%g2]ASI_CMP_CORE ! thread 38
stxa %g3, [%g2]ASI_CMP_CORE ! thread 39
stxa %g3, [%g2]ASI_CMP_CORE ! thread 40
stxa %g3, [%g2]ASI_CMP_CORE ! thread 41
stxa %g3, [%g2]ASI_CMP_CORE ! thread 42
stxa %g3, [%g2]ASI_CMP_CORE ! thread 43
stxa %g3, [%g2]ASI_CMP_CORE ! thread 44
stxa %g3, [%g2]ASI_CMP_CORE ! thread 45
stxa %g3, [%g2]ASI_CMP_CORE ! thread 46
stxa %g3, [%g2]ASI_CMP_CORE ! thread 47
stxa %g3, [%g2]ASI_CMP_CORE ! thread 48
stxa %g3, [%g2]ASI_CMP_CORE ! thread 49
stxa %g3, [%g2]ASI_CMP_CORE ! thread 50
stxa %g3, [%g2]ASI_CMP_CORE ! thread 51
stxa %g3, [%g2]ASI_CMP_CORE ! thread 52
stxa %g3, [%g2]ASI_CMP_CORE ! thread 53
stxa %g3, [%g2]ASI_CMP_CORE ! thread 54
stxa %g3, [%g2]ASI_CMP_CORE ! thread 55
stxa %g3, [%g2]ASI_CMP_CORE ! thread 56
stxa %g3, [%g2]ASI_CMP_CORE ! thread 57
stxa %g3, [%g2]ASI_CMP_CORE ! thread 58
stxa %g3, [%g2]ASI_CMP_CORE ! thread 59
stxa %g3, [%g2]ASI_CMP_CORE ! thread 60
stxa %g3, [%g2]ASI_CMP_CORE ! thread 61
stxa %g3, [%g2]ASI_CMP_CORE ! thread 62
stxa %g3, [%g2]ASI_CMP_CORE ! thread 63
/* Check the CORE_RUNNING_RW and CORE_RUNNING_STATUS registers. */
setx ASI_CMP_CORE_RUNNING_RW, %g1, %g2
setx ASI_CMP_CORE_RUNNING_STATUS, %g1, %g3
beq local_test_failed ! fail on a timeout
ldxa [%g3]ASI_CMP_CORE, %g4 ! CORE_RUNNING_STATUS
ldxa [%g2]ASI_CMP_CORE, %g5 ! CORE_RUNNING_RW
bne local_test_failed ! fail on RW != STATUS
/* Signal all the other threads that were done */
setx user_data_start, %g1, %g2
/************************************************************************
************************************************************************/
/* Wait till thread 0 says were done */
setx user_data_start, %g1, %g2
beq local_test_failed ! fail on a timeout
/************************************************************************
************************************************************************/