Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / obp / obp / cpu / sparc / ultra4v / tlbasm.fth
CommitLineData
920dae64
AT
1\ ========== Copyright Header Begin ==========================================
2\
3\ Hypervisor Software File: tlbasm.fth
4\
5\ Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
6\
7\ - Do no alter or remove copyright notices
8\
9\ - Redistribution and use of this software in source and binary forms, with
10\ or without modification, are permitted provided that the following
11\ conditions are met:
12\
13\ - Redistribution of source code must retain the above copyright notice,
14\ this list of conditions and the following disclaimer.
15\
16\ - Redistribution in binary form must reproduce the above copyright notice,
17\ this list of conditions and the following disclaimer in the
18\ documentation and/or other materials provided with the distribution.
19\
20\ Neither the name of Sun Microsystems, Inc. or the names of contributors
21\ may be used to endorse or promote products derived from this software
22\ without specific prior written permission.
23\
24\ This software is provided "AS IS," without a warranty of any kind.
25\ ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
26\ INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
27\ PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
28\ MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
29\ ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
30\ DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN
31\ OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR
32\ FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
33\ DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
34\ ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
35\ SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
36\
37\ You acknowledge that this software is not designed, licensed or
38\ intended for use in the design, construction, operation or maintenance of
39\ any nuclear facility.
40\
41\ ========== Copyright Header End ============================================
42id: @(#)tlbasm.fth 1.1 06/02/16
43purpose: Implements low level tlb code for sun4v class CPUs
44copyright: Copyright 2006 Sun Microsystems, Inc. All Rights Reserved
45copyright: Use is subject to license terms.
46
47
48\ %o0 = VA
49\ %o1 = PA
50\ %o2 = Size 0 = 8K, 1 = 64K , 3 = 4M , 5 = 256M
51\ %o3 = TTE Mode bits
52label setup-itlb-entry
53 %o1 d# 64 #pabits - %o5 sllx
54 %o5 %g0 %g0 subcc
55 0< if
56 %o1 0 >tte-priv >tte-cv >tte-cp >tte-writable %o5 or \ P,CP,CV,W
57 %o1 0 >tte-priv >tte-effect >tte-writable %o5 or \ P,E,W
58 then
59 %o5 %o3 %o1 or \ Other bits
60 %o5 %o2 %o1 or \ Size
61 %g0 1 %o2 or
62 %o2 d# 63 %o2 sllx \ V
63 %o2 %o1 %o2 or \ %o2 = TTE
64 %g0 %o1 move \ %o1 = context
65 %g0 2 %o3 add \ %o3 = ITLB
66 \ %o0 = Virt
67 \ %o1 = context
68 \ %o2 = TTE
69 \ %o3 = ITLB
70
71 %g0 map-perm-addr-func# %o5 add %g0 0 always htrapif
72
73 retl
74 nop
75end-code
76
77\ %o0 = VA
78\ %o1 = PA
79\ %o2 = Size 0 = 8K, 1 = 64K , 3 = 4M , 5 = 256M
80\ %o3 = TTE Mode bits
81label setup-dtlb-entry
82 %o1 d# 64 #pabits - %o5 sllx
83 %o5 %g0 %g0 subcc
84 0< if
85 %o1 0 >tte-priv >tte-cv >tte-cp >tte-writable %o5 or \ P,CP,CV,W
86 %o1 0 >tte-priv >tte-effect >tte-writable %o5 or \ P,E,W
87 then
88 %o5 %o3 %o1 or \ Other bits
89 %o5 %o2 %o1 or \ Size
90 %g0 1 %o2 or
91 %o2 d# 63 %o2 sllx \ V
92 %o2 %o1 %o2 or \ %o2 = TTE
93 %g0 %o1 move \ %o1 = context
94 %g0 1 %o3 add \ %o3 = DTLB
95 \ %o0 = Virt
96 \ %o1 = context
97 \ %o2 = TTE
98 \ %o3 = DTLB
99
100 %g0 map-perm-addr-func# %o5 add %g0 0 always htrapif
101
102 retl
103 nop
104end-code