Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / obp / obp / os / bootprom / diagmode.fth
CommitLineData
920dae64
AT
1\ ========== Copyright Header Begin ==========================================
2\
3\ Hypervisor Software File: diagmode.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: @(#)diagmode.fth 2.5 04/04/28
43purpose:
44copyright: Copyright 1993-2004 Sun Microsystems, Inc. All Rights Reserved
45copyright: Use is subject to license terms.
46
47hex
48headers
49defer diagnostic-mode? ' false is diagnostic-mode?
50defer svc-mode? ' false is svc-mode?
51
52headerless
53
54\ First, the mode control words. These words return the current
55\ effective verbosity for determining whether or not to display a
56\ given "level" of output on the console. Generally, these modes
57\ are hierarchical or layered in effect, lower-levels of verbosity
58\ are satisfied by a higher level being set, e.g., anything you
59\ would type in minimum verbosity you would also type in maximum
60\ verbosity. This is reflected in the mode words with "+": 'min+mode'
61\ is minimum or higher ("minimum plus"), while mode words with "-"
62\ are more strictly defined as just that mode: 'brief-mode' is ONLY
63\ medium ("normal" keyword) verbosity, not maximum or minimum.
64\
65\ 'diagnostic-mode?' set (returning "true") is treated as maximum
66\ ("max" keyword) verbosity.
67
68
69\ The min+mode words typeout if verbosity is "min" or higher (min,
70\ "normal", "max", "debug") or if 'diagnostic?-mode' is true. For
71\ example, the OpenBoot banner prints in min+mode.
72
73defer min+mode? ( -- flag ) \ 'true' if "min" or higher
74' true is min+mode? \ Pre-"verbosity" control
75
76
77\ The brief-mode words typeout iff verbosity is "normal"; unlike other
78\ verbosity-controlled typeout, higher-level verbosity (max, debug, etc)
79\ do NOT count for "brief" typeout. This implements a distinct class
80\ of "inbetween minimum and maximum" firmware verbosity, enough output
81\ to inform the user that the firmware is alive and making progress,
82\ without multiple screenfuls of cybercrud meaningless to normal mortals.
83\
84\ This mode is available only with full firmware verbosity control
85\ implemented (i.e., 'verbosity' NVRAM configuration variable, reset-
86\ level assembly support, etc.); here it is effectively nullified
87\ (see verbosity.fth).
88
89defer brief-mode? ( -- flag ) \ 'true' if "normal" verbosity ONLY
90' false is brief-mode?
91
92
93\ The med+mode words typeout if verbosity is medium ("normal"
94\ keyword) or higher, or if 'diagnostic-mode?' is true.
95\
96\ As with brief above, this is available only with full firmware
97\ verbosity control implemented, and is by default disabled.
98
99defer med+mode? ( -- flag ) \ 'true' if medium or higher verbosity
100' false is med+mode? \ Pre-verbosity control
101
102
103\ The max+mode words effectively overlay with the "diag-" words,
104\ with the exception of 'max+mode?' which exists in its own right.
105\ This mode maps exactly to pre-verbosity-controlled output levels
106\ controlled by 1275 'diagnostic-mode?' unless full firmware
107\ verbosity control is implemented (see verbosity.fth).
108
109defer max+mode? ( -- flag ) \ 'true' if max/debug/diag
110' diagnostic-mode? is max+mode? \ Pre-"verbosity" control
111
112
113\ The "debug" mode words typeout if verbosity is debug or higher.
114\ The default here is driven by stand-init-debug. Note that
115\ 'diagnostic-mode?' does NOT feed into "debug or higher" verbosity.
116
117defer debug+mode? ( -- flag ) \ 'true' if debug/diag
118[ifdef] stand-init-debug
119 ' true \ Default on for stand-init-debug
120[else]
121 ' false \ Default off normally
122[then] is debug+mode?
123
124
125
126\ For hysterical reasons (i.e., backwards-compatibility with non-
127\ verbosity-supporting platforms, as well as not having to change
128\ every file in OpenBoot that calls diag-type and friends), the
129\ "diag-" moniker is left as is, even though the routines are now
130\ more than merely 'diagnostic-mode?'-controlled output routines
131\ when coupled with full firmware verbosity control (verbosity.fth).
132
133: diag-type ( adr,len -- ) max+mode? if type else 2drop then ;
134: diag-cr ( -- ) max+mode? if cr then ;
135: diag-.d ( n -- ) max+mode? if .d else drop then ;
136: diag-type-cr ( adr,len -- ) diag-type diag-cr ;
137
138headers