Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / obp / obp / arch / sun4v / fastfill.fth
CommitLineData
920dae64
AT
1\ ========== Copyright Header Begin ==========================================
2\
3\ Hypervisor Software File: fastfill.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: @(#)fastfill.fth 1.1 06/02/16
43purpose:
44copyright: Copyright 2006 Sun Microsystems, Inc. All Rights Reserved
45copyright: Use is subject to license terms.
46
47headers
48
49code touch-memory ( pa.lo pa.hi size -- )
50 sp sc1 pop \ pa.hi in sc1
51 sp scr pop \ pa.lo in scr
52 begin
53 tos /x tos subcc
54 scr tos memory-asi sc2 ldxa
55 0= until
56 sc2 scr tos memory-asi stxa
57 sp tos pop
58 #Sync membar
59c;
60
61headerless
62
63code (clear-memory ( pa.lo pa.hi size -- )
64 sp sc1 pop
65 sp scr pop
66 tos h# 40 tos subcc
67 %g0 memory-asi wrasi
68 begin
69 scr tos sc1 add
70 %g0 sc1 h# 0 %asi stxa
71 %g0 sc1 h# 8 %asi stxa
72 %g0 sc1 h# 10 %asi stxa
73 %g0 sc1 h# 18 %asi stxa
74 %g0 sc1 h# 20 %asi stxa
75 %g0 sc1 h# 28 %asi stxa
76 %g0 sc1 h# 30 %asi stxa
77 %g0 sc1 h# 38 %asi stxa
78 0<= until
79 tos h# 40 tos subcc
80 sp tos pop
81c;
82
83code hv-mem-scrub ( pa 0 len -- )
84 %o0 %l0 move
85 %o1 %l1 move
86 %o5 %l2 move
87 sp %l3 pop
88 sp %l3 pop
89 %g0 h# 31 %o5 add \ mem_scrub
90 begin
91 tos %o1 move \ Len
92 %l3 %o0 move \ RA
93 %g0 0 always htrapif
94 %l3 %o1 %l3 add
95 tos %o1 tos subcc
96 0<= until
97 %g0 h# 31 %o5 add \ (mem scrub) delay
98 %l2 %o5 move
99 %l1 %o1 move
100 %l0 %o0 move
101 sp tos pop
102c;
103
104headers
105
106defer clear-memory
107alias bclear-memory-4MB clear-memory
108
109' hv-mem-scrub to clear-memory
110' hv-mem-scrub to clear-mem
111
112headerless