zulu_asm.s revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#if defined(lint)
#else /* lint */
#include "assym.h"
#endif /* lint */
#include <sys/asm_linkage.h>
#include <vm/hat_sfmmu.h>
#include <sys/zulu_hat.h>
#include <zuluvm_offsets.h>
#ifdef lint
void
{}
#else /* lint */
.word 0
#if 1
1:
#ifdef ZULUVM_STATS
#endif
2:
#ifdef ZULUVM_STATS
1:
#endif
/*
* lookup the tte in the tsb
* %g1 - vaddr[63:13], ctx[12:0]
* %g2 - our trap level
* %g3 - return address
* %g7 - zulu data pointer (needs to be preserved)
* return:
* %g1 - flags [63..58] and pfn [31..0]
* %g2 - status code if %g1 is null
* %g7 - zulu data pointer
*/
/*
* did we find a tte ??
* If not, %g2 has the error code
*/
/*
* get flags and pfn
*/
/*
* check if this is a dtlb2 miss(no itlb, pgsz != 8k)
* and if the current dtlb2 pgsz != tte pgsz
*/
#ifdef ZULUVM_STATS
#endif
2:
#ifdef ZULUVM_STATS
#endif
3:
1:
3:
and %g3, ZULUVM_ITLB_FLAG, %g3
! assumption is that data miss
brz,pt %g3, 4f ! is more likely than instr miss
ldx [%g7 + ZULUVM_PAMMU], %g2 ! physical addr of zulu mmu regs
! instruction miss
mov ZULUVM_ZFB_MMU_TLB_CR_IMISS_MASK, %g5
add %g2, ZULUVM_ITLB_DATA_IN, %g4
!stxa %g1, [%g4]ASI_IO
ba,pt %xcc, 5f
stxa %g1, [%g4]ASI_IO
!ldxa [%g4]ASI_IO, %g4
4:
! data miss
mov ZULUVM_ZFB_MMU_TLB_CR_DMISS_MASK, %g5
add %g2, ZULUVM_DTLB_DATA_IN, %g4
stxa %g1, [%g4]ASI_IO
!ldxa [%g4]ASI_IO, %g4
5:
add %g7, ZULUVM_STATE, %g4
mov ZULUVM_STATE_TLB_PENDING, %g6
mov ZULUVM_STATE_IDLE, %g1
casa [%g4]ASI_N, %g6, %g1
cmp %g6, %g1
bne,a,pn %icc, stopped
mov ZULUVM_STATE_STOPPED, %g3
ldx [%g7 + ZULUVM_PAMMU], %g2
add %g2, ZULUVM_TLB_CONTROL, %g2
stxa %g5, [%g2]ASI_IO
!ldxa [%g2]ASI_IO, %g3
retry
send_intr:
add %g7, ZULUVM_STATE, %g4
mov ZULUVM_STATE_INTR_QUEUED, %g5
mov ZULUVM_STATE_TLB_PENDING, %g3
casa [%g4]ASI_N, %g3, %g5
cmp %g3, %g5
be,pt %icc, deliver_intr
mov ZULUVM_STATE_STOPPED, %g3
ba,pt %icc, stopped
nop
#endif
send_intr1:
add %g7, ZULUVM_STATE, %g4
mov ZULUVM_STATE_IDLE, %g3
mov ZULUVM_STATE_INTR_QUEUED, %g5
casa [%g4]ASI_N, %g3, %g5
cmp %g3, %g5
be,pt %icc, deliver_intr
mov ZULUVM_STATE_STOPPED, %g3
stopped:
st %g3, [%g4]
#ifdef ZULUVM_STATS
lduw [%g7 + ZULUVM_ST_TLBCANCEL], %g3
add %g3, 1, %g3
stuw %g3, [%g7 + ZULUVM_ST_TLBCANCEL]
#endif
retry
deliver_intr:
stx %g1, [%g7 + ZULUVM_ASM_TLB_ERRCODE] ! set the error field
stx %g6, [%g7 + ZULUVM_ASM_TLB_TTE] ! deliver tte in data_0
! %g6 is invalid if error != SUCCESS
! setsoftint_tl1(uint64_t inum, uint64_t dummy)
set setsoftint_tl1, %g5
jmp %g5
lduh [%g7 + ZULUVM_INTRNUM], %g1
SET_SIZE(zuluvm_dmv_tlbmiss_tl1)
#endif /* lint */