* ========== Copyright Header Begin ==========================================
* OpenSPARC T2 Processor File: spc_tlu_rml_asr.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 ============================================
!#include "bw_default_defines.h"
/************************************************************************
************************************************************************/
!# Initialize registers ..
!# Execute some ALU ops ..
!# set up operands for testing asi instructions
!# in reality, can't be the same value - e.g., some clocks have passed
!# but simics thinks they are the same, so can't test yet
!# in reality, can't be the same value - e.g., some clocks have passed
!# but simics thinks they are the same, so can't test yet
!# in reality, can't be the same value - e.g., some clocks have passed
!# but simics thinks they are the same, so can't test yet
mov %l0, %g2 ! save tid in g2
wrpr %l0, 0x0, %canrestore
wrpr %l0, %g0, %canrestore
!# test tstate == {ccr, asi, pstate, cwp}
setx 0xf0feedf00d, %g3, %l6
!# use mask, which is AND of defined TSTATE bits accounting for 0 <= CWP <= 7, MM=0, RED=0, PEF=1
setx 0xffff031f17, %g3, %l1
!# check the wrhpr/rdhpr ops...
or %l0, 0x4, %l2 !stay in hpriv state, not critical if tlz is set/reset, keep ibe and red off
!# HINTP (only bit 0 is defined)
! expect N1 values for now
setx 0x003e002401006607, %o2, %l4
!# Make sure INT_DIS bits are set...
setx 0x1000000000000000, %g0, %l4
setx 0x1000000000000000, %g0, %l4
wr %l2, 0xf, %sys_tick_cmpr
wr %l2, %g0, %sys_tick_cmpr
setx 0x1000000000000000, %g0, %l4
wrhpr %l2, 0xf, %hsys_tick_cmpr
rdhpr %hsys_tick_cmpr, %l1
wrhpr %l2, %g0, %hsys_tick_cmpr
rdhpr %hsys_tick_cmpr, %l1
setx 0x1ffff, %g3, %l2 ! bits 16..0 are defined
wr %l3, 0x0, %clear_softint
setx 0x1f0f0, %g3, %l2 ! bits 16..0 are defined
wr %l2, 0x0, %set_softint
wr %l2, %g0, %clear_softint
setx 0x10f0f, %g3, %l2 ! bits 16..0 are defined
wr %l2, %g0, %set_softint
EXIT_GOOD /* test finish */
/************************************************************************
************************************************************************/