Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / obp / obp / arch / sun4v / niagara / cleanup.fth
CommitLineData
920dae64
AT
1\ ========== Copyright Header Begin ==========================================
2\
3\ Hypervisor Software File: cleanup.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: @(#)cleanup.fth 1.2 06/05/10
43purpose:
44copyright: Copyright 2006 Sun Microsystems, Inc. All Rights Reserved
45copyright: Use is subject to license terms.
46
47headers
48
49[ifdef] trace-errors
50: xbp
51 [ also hidden ]
52 .registers cr
53 ftrace cr
54 hex
55 (handle-breakpoint
56;
57' xbp is handle-breakpoint
58: real-bp ( -- )
59 [ also hidden ] ['] (handle-breakpoint is handle-breakpoint [ previous ]
60;
61[then]
62
63' (cold-hook is cold-hook
64
65\ This stand-init-io has a header, in case the previous one does not.
66chain: finalize-chain ( -- ) here fence a! ;
67overload: execute-buffer ( adr,len -- ) execute-buffer ;
68overload: stand-init ( -- )
69 stand-init finalize-chain
70 ['] startup catch ?dup if .error then
71;
72overload: stand-init-io ( -- ) stand-init-io ;
73overload: unix-init ( -- ) unix-init ;
74overload: unix-init-io ( -- ) unix-init-io ;
75overload: init ( -- ) init ;
76
77\ Make sure these words are available at the ok prompt
78\ Unfortunately, wanboot ramdisk depends on them.
79overload: headers ;
80overload: headerless ;
81overload: external ;
82
83\ Install the various boot chains
84' check-machine-state is check-machine-chain
85' don't-boot? is interrupt-auto-boot?
86' client-starting is client-starting-chain
87' client-exited is client-exited-chain
88
89\ Install the entry/exit/reset chains now
90' enterforth-chain is enterforth-hook
91' go-chain is go-hook
92
93origin " origin" $export-procedure
94
95hidden definitions
96: voc-unlink ( acf -- )
97 >r voc-link begin dup another-link? while ( prev next )
98 dup r@ = if ( prev next )
99 >voc-link link@ swap link! r> drop exit
100 else ( prev next )
101 nip ( next )
102 then >voc-link ( next-voc )
103 repeat r> drop ( )
104;
105previous definitions
106
107[ifndef] assembler?
108also hidden
109\ Turn off the assembler; it is about to be disposed
110' noop is do-entercode
111' noop is do-exitcode
112' noop is do-label-hook
113' nulldis is disassemble
114previous
115[then]
116resident
117
118\ Align dp to 16 bytes .
119here h# 10 round-up here - 0 ?do h# ff c, loop
120\ Align the User Area size to 16 bytes
121#user @ h# 10 round-up #user !
122
123dictionary-size to ROM-dictionary-size
124ROMbase ROM-dictionary-size + to text-end
125warning on
126
127\ Supress file notification warnings for dup defs for runtime.
128patch noop where duplicate-notification
129
130\ remove the forth->system error interface
131patch 2drop fsyscall (compile-time-error)
132patch 2drop fsyscall (compile-time-warning)
133
134dispose 0 0 set-transize
135
136also hidden also forth
137' boolean-voc voc-unlink
138' recovery-types voc-unlink
139' security-mode-voc voc-unlink
140' hidden voc-unlink
141' trap-types voc-unlink
142' keys-forth voc-unlink
143' disassembler voc-unlink
144' command-completion voc-unlink
145' allocator voc-unlink
146' bug voc-unlink
147' aliases voc-unlink
148' options voc-unlink
149forth
150
151' noop is title \ Turn off the Bradley Forthware copyright message
152
153\ XREF does not generate a stand.dic, this magic takes care of it.
154\ If SAVEFILE is not [define]'d then we dont save an image.
155\
156" SAVEFILE" d# 55 d# 45 fsyscall dup 0= if 2drop else
157 "" stand.dic save-forth
158 patchboot
159 #user @ origin h# 10 + x!
160 here origin- origin h# 18 + x!
161 text-end origin h# 20 + x!
162 " stand-init-io" $find-name is init-io
163 " stand-init" init-save
164 up@ #user @ 2swap ( up,len file$ )
165 origin here over - 2swap ( up,len dic,len file$ )
166 d# 45 d# 45 fsyscall ( )
167then
168
169warning off
170
171fload ${BP}/pkg/fcode/chkfcod.fth