* ========== Copyright Header Begin ==========================================
* OpenSPARC T2 Processor File: memop_mt2_invalidate_l1.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
/************************************************************************
************************************************************************/
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! - For a line in D$ for thread 0, have thread 1 store
! to that line to invalidate it
st %g7, [%g2] ! put a line into D$
! Tread 1 is waiting for this.
! Now wait for Thread 1 to put a 2 into this location,
! which invalidates this D$ line.
! - For a line in I$ for thread 0, have thread 1 store
! to that line to invalidate it.
st %g6, [%g2] ! This is the instr. to be invalidated
! Thread 1 is waiting for this
cmp %g7, 0 ! Thread 1 will change st to
be loop1_t0 ! add %g7, 1, %g7
! - For a line in I$ for thread 0, have the corresponding
! L2$ line replaced, causing the I$ line to be invalidated.
st %g6, [%g2] ! Signal Thread 1 we're ready
ld [%g2], %g3 ! Wait for Thread 1's signal
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! - For a line in D$ for thread 0, have thread 1 store
! to that line to invalidate it
! Wait for Thread 0 to be ready
st %g3, [%g2] ! Invalidate line in Thread 0 D$
! - For a line in I$ for thread 0, have thread 1 store
! to that line to invalidate it.
! Wait for Thread 0 to be ready
! Now do store to invalidate Tread 0 I$ line
setx 0x8e01e001, %g1, %g3 ! add %g7, 1, %g7
! - For a line in I$ for thread 0, have the corresponding
! L2$ line replaced, causing the I$ line to be invalidated.
! Wait for Thread 0 to be ready
! Cause L2$ line corresponding to Thread 0 I$ line to be replaced
! Wait a bit for Thread 0 to see effect if I$ invalidate
! Now signal Thread 0, we're all done
/**********************************************************************
*********************************************************************/
! Assumes that %o0 contains VA that maps to L2$ line to be flushed.
! This is done by doing 16 loads from different addresses that alias
! to that line. Note that this will cause a writeback if the L2$
/************************************************************************
************************************************************************/
data: .xword 0x0000000000000000
.align 0x40000 ! each 246kb, 0x40000, aliases to same L2$ line